/* SnapGate · iOS 原生风格 H5(浅色)
   贴近 Apple HIG:大标题导航、底部 TabBar、分段控件、分组圆角卡片、
   系统蓝强调色、毛玻璃、安全区适配。固定浅色背景。 */

:root {
  --bg: #f2f2f7;            /* systemGroupedBackground */
  --card: #ffffff;
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.6);   /* secondaryLabel */
  --label-3: rgba(60, 60, 67, 0.3);   /* tertiaryLabel */
  --separator: rgba(60, 60, 67, 0.29);
  --separator-opaque: #c6c6c8;
  --blue: #007aff;
  --blue-press: #0061d1;
  --green: #34c759;
  --red: #ff3b30;
  --fill: rgba(118, 118, 128, 0.12);  /* tertiarySystemFill */
  --fill-2: rgba(118, 118, 128, 0.2);
  --bar: rgba(249, 249, 249, 0.82);   /* 半透明栏背景 */
  --radius: 12px;
  --radius-lg: 14px;
  --nav-h: 44px;
  --tab-h: 50px;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro",
    "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top));
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; }
.muted { color: var(--label-2); }

/* ---------- 顶部导航栏(毛玻璃 + 大标题) ---------- */
.nav-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: center;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
}
.nav-title { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }
.nav-action {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  margin-top: calc(env(safe-area-inset-top) / 2);
  background: none; border: none; color: var(--blue); font-size: 17px; padding: 4px;
}
.nav-action:active { opacity: 0.4; }

/* ---------- 内容容器 ---------- */
main { max-width: 600px; margin: 0 auto; }
.view { padding: 8px 16px 24px; display: none; }
.view.active { display: block; }

.large-title { font-size: 34px; font-weight: 700; letter-spacing: 0.37px; margin: 8px 4px 16px; }
.group-title {
  font-size: 13px; color: var(--label-2); margin: 24px 16px 7px;
  text-transform: none;
}

/* ---------- 分段控件(iOS Segmented Control) ---------- */
.seg {
  display: flex; gap: 0; padding: 2px; margin: 4px 0 18px;
  background: var(--fill); border-radius: 9px;
}
.seg-item {
  flex: 1; border: none; background: transparent; color: var(--label);
  font-size: 13px; font-weight: 600; padding: 7px 6px; border-radius: 7px;
  transition: background .2s, box-shadow .2s; letter-spacing: -0.08px;
}
.seg-item.active {
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04);
}

/* ---------- 投递面板 ---------- */
.panel { display: none; }
.panel.active { display: block; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 240px; padding: 28px;
  background: var(--card); border-radius: var(--radius-lg);
  text-align: center; border: none;
  transition: transform .15s, background .15s;
}
.dropzone:active { transform: scale(0.985); background: #fafafa; }
.dropzone.dragover { background: #eef5ff; outline: 2px dashed var(--blue); outline-offset: -8px; }
.dz-icon {
  width: 64px; height: 64px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue); color: #fff;
}
.dz-icon svg { width: 34px; height: 34px; }
.dz-title { font-size: 17px; font-weight: 600; }
.dz-sub { font-size: 13px; color: var(--label-2); }

textarea {
  width: 100%; padding: 14px; border-radius: var(--radius-lg);
  background: var(--card); color: var(--label); border: none;
  font-size: 17px; font-family: inherit; resize: none; min-height: 160px;
}
textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

/* ---------- 按钮 ---------- */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin-top: 16px; min-height: 50px; padding: 0 20px;
  border: none; border-radius: var(--radius); font-size: 17px; font-weight: 600;
  background: var(--blue); color: #fff; letter-spacing: -0.2px;
  transition: opacity .15s, transform .1s;
}
.btn:active { opacity: 0.85; transform: scale(0.99); }
.btn.gray { background: var(--fill); color: var(--blue); }
.btn.small { width: auto; min-height: 34px; margin: 0; padding: 0 14px; font-size: 15px; }

/* ---------- 状态提示 ---------- */
.status {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--card); font-size: 15px; display: none;
  border-left: 3px solid var(--label-3);
}
.status.show { display: block; }
.status.ok { border-left-color: var(--green); }
.status.err { border-left-color: var(--red); }
.status.loading { border-left-color: var(--blue); }

/* ---------- 分组列表(iOS inset grouped) ---------- */
.list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius-lg); overflow: hidden; }
.list:empty { display: none; }
.list li {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px;
  position: relative;
}
.list li + li::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0;
  border-top: 0.5px solid var(--separator);
}
.thumb {
  width: 44px; height: 44px; border-radius: 9px; object-fit: cover;
  background: var(--fill); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--label-2);
}
.thumb svg { width: 22px; height: 22px; }
.meta { flex: 1; min-width: 0; }
.meta .name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .sub { font-size: 13px; color: var(--label-2); margin-top: 1px; }
.row-action { color: var(--blue); font-size: 15px; text-decoration: none; flex-shrink: 0; }
.empty { padding: 20px 16px; color: var(--label-2); font-size: 15px; text-align: center; }

/* ---------- 搜索框 ---------- */
.search {
  width: 100%; margin: 4px 0 14px; padding: 9px 12px; border-radius: 10px;
  background: var(--fill); color: var(--label); border: none; font-size: 17px;
}
.search:focus { outline: none; background: #fff; box-shadow: 0 0 0 2px var(--blue) inset; }

/* ---------- 当前剪贴板卡片 ---------- */
.current-clip { background: var(--card); border-radius: var(--radius-lg); padding: 14px 16px; }
.current-clip .cc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.current-clip .cc-type { font-size: 13px; color: var(--label-2); }
.current-clip pre {
  margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 16px;
  font-family: inherit; max-height: 180px; overflow: auto; color: var(--label);
}
.clip-body {
  margin: 8px 0 0; white-space: pre-wrap; word-break: break-word;
  font-size: 15px; line-height: 1.45; max-height: 200px; overflow: auto;
  color: var(--label); font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.clip-li { flex-direction: column; align-items: stretch !important; gap: 0 !important; }
.clip-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- 底部 TabBar ---------- */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--separator);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; border: none; background: none; color: var(--label-3); padding: 6px 0 4px;
}
.tab svg { width: 26px; height: 26px; }
.tab span { font-size: 10px; letter-spacing: 0.1px; }
.tab.active { color: var(--blue); }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
  padding-bottom: env(safe-area-inset-bottom);
}
.login-icon {
  width: 76px; height: 76px; border-radius: 18px; background: var(--blue);
  display: flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
}
.login-icon svg { width: 40px; height: 40px; }
.login-title { font-size: 28px; font-weight: 700; margin: 0 0 4px; }
.login-sub { font-size: 15px; color: var(--label-2); margin: 0 0 28px; }
.login-card { width: 100%; max-width: 340px; }
.login-card input {
  width: 100%; padding: 15px 16px; border-radius: var(--radius); border: none;
  background: var(--card); color: var(--label); font-size: 17px; margin-bottom: 12px;
}
.login-card input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.login-msg { color: var(--red); font-size: 15px; text-align: center; margin-top: 12px; min-height: 20px; }
