/* =========================================================
   云端文本 · 样式表
   移动端优先，桌面端增强
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #080b11;
  --bg-2: #0c1119;
  --card: #121926;
  --card-2: #18202e;
  --input: #0d1320;
  --input-2: #101827;
  --line: #233046;
  --line-2: #2d3d57;
  --text: #e7eefb;
  --muted: #8fa1ba;
  --muted-2: #6b7d95;
  --accent: #4f8cff;
  --accent-2: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #ff5c6c;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --topbar: 58px;
  --tabbar: 64px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(900px 480px at 108% -8%, rgba(79, 140, 255, .13), transparent 62%),
    radial-gradient(680px 380px at -12% 108%, rgba(34, 211, 238, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body.sheet-open { overflow: hidden; }

h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
svg.ic { display: block; flex: none; }
img { max-width: 100%; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace; }

/* ---------------- 品牌标记 ---------------- */
.mark {
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #4f8cff, #22d3ee);
  box-shadow: 0 14px 32px rgba(79, 140, 255, .35);
  margin: 0 auto 18px;
}
.mark.sm { width: 36px; height: 36px; border-radius: 12px; margin: 0; box-shadow: 0 8px 18px rgba(79, 140, 255, .28); }
.mark.dim { background: var(--card-2); color: var(--muted); box-shadow: none; }

/* ---------------- 登录 / 初始化 ---------------- */
.auth-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 18px calc(28px + env(safe-area-inset-bottom));
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, rgba(24, 32, 46, .88), rgba(16, 22, 33, .94));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 22px 22px;
  box-shadow: var(--shadow);
  animation: rise .4s cubic-bezier(.22, .8, .3, 1) both;
}
.auth-card h1 { font-size: 20px; letter-spacing: -.01em; text-align: center; margin-bottom: 6px; }
.auth-card > p.muted { text-align: center; font-size: 13px; margin-bottom: 22px; }
.auth-card .mark + h1 { margin-top: 2px; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.stack { display: flex; flex-direction: column; gap: 18px; }

.notice {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12.5px; line-height: 1.5;
  padding: 10px 12px; border-radius: 12px; margin-bottom: 16px;
  background: rgba(79, 140, 255, .1);
  border: 1px solid rgba(79, 140, 255, .22);
  color: #cfe0ff;
}
.notice.danger { background: rgba(255, 92, 108, .1); border-color: rgba(255, 92, 108, .28); color: #ffc4c9; }
.notice svg { margin-top: 1px; }

.hint {
  font-size: 12px;
  color: var(--muted-2);
  text-align: center;
  margin-top: 16px;
  line-height: 1.6;
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 12px;
  padding: 11px 16px; font-size: 14.5px; font-weight: 600;
  background: var(--card-2); color: var(--text);
  transition: transform .12s, filter .15s, background .15s, border-color .15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:hover { filter: brightness(1.12); }
.btn.primary {
  background: linear-gradient(135deg, #5a93ff, #2f7bff);
  color: #fff;
  box-shadow: 0 10px 24px rgba(79, 140, 255, .28);
}
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn.danger { background: rgba(255, 92, 108, .13); border-color: rgba(255, 92, 108, .3); color: #ff9aa3; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn.xs { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; gap: 4px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: transparent; border: 1px solid transparent;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover, .icon-btn:active { background: var(--card-2); color: var(--text); }

/* ---------------- 表单 ---------------- */
.form { display: flex; flex-direction: column; gap: 18px; }

.field { position: relative; }

.field .fi {
  width: 100%;
  height: 58px;
  padding: 22px 14px 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: border-color .16s, box-shadow .16s, background .16s;
  appearance: none;
}
.field textarea.fi {
  height: auto;
  min-height: 168px;
  padding: 24px 14px 14px;
  resize: vertical;
  line-height: 1.65;
  font-size: 15px;
}
.field .fi:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--input-2);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, .14);
}
.field .fi:disabled { opacity: .55; }

.field .fl {
  position: absolute;
  left: 14px;
  top: 18px;
  font-size: 15px;
  color: var(--muted);
  pointer-events: none;
  transition: top .16s ease, font-size .16s ease, color .16s ease;
  transform-origin: left top;
}
.field .fi:focus ~ .fl,
.field .fi:not(:placeholder-shown) ~ .fl {
  top: 8px;
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--accent);
}
.field .fi:disabled ~ .fl { opacity: .55; }
.field textarea.fi ~ .fl { top: 15px; }
.field textarea.fi:focus ~ .fl,
.field textarea.fi:not(:placeholder-shown) ~ .fl { top: 8px; font-size: 11.5px; }

.field .fh {
  font-size: 12px;
  color: var(--muted-2);
  margin: 7px 2px 0;
  line-height: 1.55;
}
.field .fe {
  display: none;
  font-size: 12px;
  color: #ff96a0;
  margin: 7px 2px 0;
  line-height: 1.5;
}
.field.bad .fe { display: block; }
.field.bad .fi { border-color: rgba(255, 92, 108, .65); }
.field.bad .fi:focus { box-shadow: 0 0 0 3px rgba(255, 92, 108, .13); }
.field.bad .fl { color: #ff96a0; }

.req { color: var(--danger); margin-left: 2px; font-weight: 700; }

.field .fe-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; background: transparent;
  color: var(--muted-2);
  border-radius: 10px;
}
.field .fe-btn:hover { color: var(--text); background: var(--card-2); }
.field .fi ~ .fp { padding-right: 48px; }

.field .fc {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 11px;
  color: var(--muted-2);
  pointer-events: none;
}

/* 密码强度 */
.pw {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 9px 2px 0;
}
.pw-bars { display: flex; gap: 4px; flex: 1; }
.pw-bars i { height: 4px; flex: 1; border-radius: 2px; background: var(--line); transition: background .2s; }
.pw-bars.s1 i:nth-child(1) { background: #ff5c6c; }
.pw-bars.s2 i:nth-child(-n+2) { background: #fbbf24; }
.pw-bars.s3 i:nth-child(-n+3) { background: #38bdf8; }
.pw-bars.s4 i { background: var(--ok); }
.pw-text { font-size: 11.5px; color: var(--muted-2); min-width: 52px; text-align: right; }

/* 单选项（少于 5 个选项时使用） */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--muted);
  font-size: 13.5px;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.chip input:checked + span {
  background: rgba(79, 140, 255, .15);
  border-color: rgba(79, 140, 255, .55);
  color: #d5e5ff;
  font-weight: 600;
}
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(79, 140, 255, .2); }

/* 开关 */
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--muted); user-select: none; }
.check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 19px; height: 19px;
  border-radius: 6px;
  border: 1.5px solid var(--line-2);
  background: var(--input);
  display: grid;
  place-content: center;
  margin: 0;
  transition: background .15s, border-color .15s;
}
.check input[type="checkbox"]::after {
  content: "";
  width: 9px; height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
}
.check input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.check input[type="checkbox"]:checked::after { opacity: 1; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; }
.switch .track {
  width: 44px; height: 26px; border-radius: 999px; background: var(--line-2);
  position: relative; transition: background .18s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform .18s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ---------------- 后台外壳 ---------------- */
.shell { min-height: 100dvh; }

.side {
  position: fixed;
  inset: 0 auto 0 0;
  width: 252px;
  padding: 20px 14px 16px;
  background: rgba(12, 17, 25, .96);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: translateX(-100%);
  transition: transform .26s cubic-bezier(.22, .8, .3, 1);
  z-index: 60;
  padding-top: calc(20px + env(safe-area-inset-top));
}
.side.open { transform: none; }

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 15px; }
.brand-text small { font-size: 11.5px; color: var(--muted-2); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border: 0; border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--card-2); color: var(--text); }
.nav-item.active { background: rgba(79, 140, 255, .14); color: #d3e3ff; font-weight: 600; }
.nav-item.active svg { color: var(--accent); }

.side-foot { margin-top: auto; }

.scrim {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .6);
  opacity: 0; pointer-events: none;
  transition: opacity .26s;
  z-index: 50;
  backdrop-filter: blur(2px);
}
.scrim.show { opacity: 1; pointer-events: auto; }

.main { min-height: 100dvh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  height: calc(var(--topbar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  background: rgba(8, 11, 17, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 16.5px; font-weight: 650; letter-spacing: -.01em; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.views { padding: 18px 16px calc(40px + env(safe-area-inset-bottom)); max-width: 1120px; }

.only-mobile { display: grid; }

/* ---------------- 卡片 / 统计 ---------------- */
.card {
  background: linear-gradient(180deg, rgba(24, 32, 46, .75), rgba(16, 22, 33, .9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.stat {
  padding: 14px 15px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(24, 32, 46, .7), rgba(16, 22, 33, .85));
  border: 1px solid var(--line);
}
.stat b { display: block; font-size: 25px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.accent b { color: #7aa9ff; }
.stat.ok b { color: var(--ok); }
.stat.warn b { color: var(--warn); }
.stat.bad b { color: #ff8d97; }

.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 2px 2px 14px;
}
.section-head h2 { font-size: 15.5px; font-weight: 650; }

/* ---------------- 用户卡片（管理端） ---------------- */
.user-card { padding: 14px; margin-bottom: 11px; }
.uc-head { display: flex; align-items: flex-start; gap: 10px; }
.uc-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 650; flex-wrap: wrap; }
.uc-url {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 4px;
  word-break: break-all;
  font-family: ui-monospace, Consolas, monospace;
}
.uc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 11px 0 0; font-size: 12px; color: var(--muted); }
.uc-meta b { color: var(--text); font-weight: 600; }
.uc-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }

.pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 2.5px 8px; border-radius: 999px;
  background: var(--card-2); color: var(--muted);
  border: 1px solid transparent;
}
.pill.ok { background: rgba(52, 211, 153, .12); color: #6ee7b7; border-color: rgba(52, 211, 153, .25); }
.pill.warn { background: rgba(251, 191, 36, .12); color: #fcd34d; border-color: rgba(251, 191, 36, .25); }
.pill.danger { background: rgba(255, 92, 108, .12); color: #ff9aa3; border-color: rgba(255, 92, 108, .25); }

/* ---------------- 用户端外壳 ---------------- */
.app-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  height: calc(var(--topbar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  background: rgba(8, 11, 17, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.app-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.app-brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.app-brand-text b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-brand-text small { font-size: 11.5px; color: var(--muted-2); }

.app-main {
  padding: 18px 16px calc(var(--tabbar) + 42px + env(safe-area-inset-bottom));
  max-width: 860px;
  margin: 0 auto;
}

.tab-view { animation: fade .28s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.list { display: flex; flex-direction: column; }

.loading { padding: 40px 0; text-align: center; color: var(--muted-2); font-size: 13px; }

.empty {
  padding: 44px 22px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(18, 25, 38, .35);
}
.empty svg { margin: 0 auto 12px; color: var(--muted-2); }
.empty b { display: block; font-size: 14px; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 12.5px; line-height: 1.6; }

/* 项目折叠 */
.proj {
  margin-bottom: 11px;
  overflow: hidden;
  transition: border-color .2s;
}
.proj.open { border-color: var(--line-2); }
.proj-head {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 15px 14px;
  background: transparent;
  border: 0;
  text-align: left;
}
.proj-title { flex: 1; min-width: 0; }
.proj-name {
  display: block;
  font-size: 14.5px; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.proj-meta { display: block; font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }
.proj-chev { color: var(--muted-2); transition: transform .25s; }
.proj.open .proj-chev { transform: rotate(180deg); }

.proj-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s cubic-bezier(.22, .8, .3, 1);
}
.proj.open .proj-body { grid-template-rows: 1fr; }
.proj-inner { overflow: hidden; }
.proj-content { padding: 2px 12px 12px; }

.link-card {
  padding: 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(13, 19, 32, .7);
  margin-bottom: 8px;
}
.lc-title { font-size: 14px; font-weight: 600; word-break: break-word; }
.lc-excerpt {
  font-size: 12.5px; color: var(--muted);
  margin-top: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.lc-excerpt:empty::before { content: "（空白文本）"; color: var(--muted-2); }
.lc-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted-2); margin-top: 8px; }
.lc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.add-link {
  width: 100%;
  padding: 11px;
  border-radius: 12px;
  border: 1px dashed var(--line-2);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  transition: .15s;
}
.add-link:hover { border-color: var(--accent); color: var(--accent); background: rgba(79, 140, 255, .06); }

/* 底部导航 */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(10, 14, 21, .9);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: transparent;
  color: var(--muted-2);
  font-size: 10.5px;
  transition: color .15s;
}
.tab.active { color: var(--accent); }
.tab svg { transition: transform .18s; }
.tab.active svg { transform: translateY(-1px); }

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom));
  z-index: 41;
  width: 56px; height: 56px;
  border-radius: 19px;
  border: 0;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #5a93ff, #2f7bff);
  box-shadow: 0 14px 30px rgba(47, 123, 255, .45);
  transition: transform .15s, box-shadow .15s;
}
.fab:active { transform: scale(.94); }

/* 统计页 */
.stat-proj { margin-bottom: 11px; overflow: hidden; }
.sp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 15px 10px; }
.sp-head b { font-size: 14px; }
.sp-head span { font-size: 11.5px; color: var(--muted-2); }
.sp-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 11px 15px;
  border: 0;
  border-top: 1px solid rgba(35, 48, 70, .6);
  background: transparent;
  text-align: left;
  transition: background .15s;
}
.sp-row:hover { background: rgba(79, 140, 255, .06); }
.sp-title { flex: 1; font-size: 13.5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-nums { font-size: 11.5px; color: var(--muted-2); white-space: nowrap; }
.sp-nums b { color: var(--text); font-weight: 600; }

/* 访问明细行 */
.log-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(35, 48, 70, .55);
  font-size: 12.5px;
}
.log-row:last-child { border-bottom: 0; }
.log-ip { font-family: ui-monospace, Consolas, monospace; color: var(--text); }
.log-sub { color: var(--muted-2); font-size: 11.5px; margin-top: 2px; }

/* 我的页 */
.me-card { padding: 16px; margin-bottom: 12px; }
.me-head { display: flex; align-items: center; gap: 12px; }
.me-avatar {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(79, 140, 255, .28), rgba(34, 211, 238, .22));
  color: #cfe3ff; font-weight: 700; font-size: 18px;
}
.me-name { font-size: 16px; font-weight: 650; }
.me-sub { font-size: 12px; color: var(--muted-2); margin-top: 2px; }

.me-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(35, 48, 70, .55);
  font-size: 13.5px;
}
.me-row:last-child { border-bottom: 0; }
.me-row .k { color: var(--muted); flex: none; white-space: nowrap; }
.me-row .v { display: flex; align-items: center; gap: 8px; min-width: 0; }
.me-row .v span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.opt {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-left: 6px;
  font-weight: 400;
}

/* ---------------- 抽屉 / 弹层 ---------------- */
.sheet { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); opacity: 0; transition: opacity .24s; backdrop-filter: blur(2px); }
.sheet.open .sheet-backdrop { opacity: 1; }

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #161f2e, #0f1521);
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.22, .8, .3, 1);
  box-shadow: var(--shadow);
}
.sheet.open .sheet-panel { transform: none; }

.sheet-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.sheet-head h3 { font-size: 16.5px; font-weight: 650; flex: 1; }
.sheet-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.sheet-actions { display: flex; gap: 9px; margin-top: 22px; }
.sheet-actions .btn { flex: 1; }

/* 复制行 */
.copy-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--input);
  margin-bottom: 9px;
}
.copy-row .k { font-size: 11.5px; color: var(--muted-2); }
.copy-row .v {
  font-size: 13px;
  word-break: break-all;
  font-family: ui-monospace, Consolas, monospace;
  margin-top: 2px;
}
.copy-row > div { flex: 1; min-width: 0; }

/* 提示 */
.toast-wrap {
  position: fixed;
  top: calc(var(--topbar) + 12px + env(safe-area-inset-top));
  left: 0; right: 0;
  z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  pointer-events: auto;
  max-width: 440px;
  padding: 10px 15px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  background: rgba(24, 32, 46, .97);
  border: 1px solid var(--line-2);
  color: var(--text);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
  animation: toast-in .24s cubic-bezier(.22, .8, .3, 1) both;
  word-break: break-word;
}
.toast.ok { border-color: rgba(52, 211, 153, .4); }
.toast.err { border-color: rgba(255, 92, 108, .45); color: #ffc0c5; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }

/* 确认框 */
.confirm-layer { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 22px; }
.confirm-layer .cl-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); }
.confirm-box {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 22px 20px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #18212f, #101725);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  animation: rise .2s ease both;
}
.confirm-box h3 { font-size: 16px; margin-bottom: 8px; }
.confirm-box p { font-size: 13px; color: var(--muted); line-height: 1.6; word-break: break-word; }
.confirm-box .actions { display: flex; gap: 9px; margin-top: 20px; }
.confirm-box .actions .btn { flex: 1; }

/* ---------------- 桌面端 ---------------- */
@media (min-width: 960px) {
  .side { transform: none; }
  .main { margin-left: 252px; }
  .scrim { display: none; }
  .only-mobile { display: none !important; }
  .views { padding: 26px 30px 60px; }
  .app-main { padding: 26px 24px 40px; }

  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .sheet { align-items: center; padding: 24px; }
  .sheet-panel {
    border-radius: 22px;
    padding: 24px 24px 20px;
    transform: translateY(16px) scale(.98);
    opacity: 0;
    transition: transform .22s, opacity .22s;
  }
  .sheet.open .sheet-panel { transform: none; opacity: 1; }

  .tabbar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18px;
    width: min(860px, calc(100% - 48px));
    height: 60px;
    padding-bottom: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
  }
  .app-main { padding-bottom: 120px; }
  .app-top {
    padding-left: max(16px, calc(50% - 430px));
    padding-right: max(16px, calc(50% - 430px));
  }
  .fab { bottom: 96px; right: max(18px, calc(50% - 430px)); }
}

@media (min-width: 600px) {
  .auth-wrap { padding: 40px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------------- 工具类 ---------------- */
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.mt8 { margin-top: 8px; }
.mt10 { margin-top: 10px; }
.mt12 { margin-top: 12px; }
.mt14 { margin-top: 14px; }
.mt24 { margin-top: 24px; }
.pad { padding: 4px 15px; }
.t13 { font-size: 13px; font-weight: 600; word-break: break-word; }
.narrow { max-width: 520px; }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row .fi.plain { flex: 0 0 108px; width: 108px; text-align: center; font-weight: 600; }

.group-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.fi.plain {
  height: 50px;
  padding: 0 14px;
  font-size: 16px;
}

.gen-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  height: 44px;
  padding: 0 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--muted-2);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
}

.empty.plain {
  border: 0;
  background: transparent;
  padding: 30px 16px;
}

.proj-tools { display: flex; gap: 7px; margin-top: 10px; }

.stat-mini {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.mini-stat {
  flex: 1;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--input);
}
.mini-stat b { display: block; font-size: 20px; line-height: 1.2; }
.mini-stat span { font-size: 11.5px; color: var(--muted-2); }

/* 空状态里的图标居中 */
.empty svg { margin: 0 auto 12px; }
