/* ================================================================
   CQ Hook · 移动端控制台
   设计令牌 / 组件样式 / 响应式 / 无障碍降级
   零依赖原生 CSS，data-theme="light|dark" 双主题
   ================================================================ */

:root {
  color-scheme: light;
  /* 表面与背景 */
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface-2: #F1F2F8;
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .88);
  --glass-border: rgba(255, 255, 255, .5);
  /* 文字三级 */
  --text-1: #0F1116;
  --text-2: #6B7080;
  --text-3: #9AA0B0;
  /* 描边 */
  --line: rgba(15, 17, 22, .08);
  --line-strong: rgba(15, 17, 22, .14);
  /* 品牌与语义色 */
  --accent: #5B5BF0;
  --accent-deep: #4C4CD8;
  --accent-soft: #8B8BFF;
  --accent-2: #7A6CF5;
  --success: #12A150;
  --warning: #E8890C;
  --danger: #D93025;
  --info: #5B5BF0;
  --accent-tint: rgba(91, 91, 240, .10);
  --accent-tint-2: rgba(91, 91, 240, .16);
  --success-tint: rgba(18, 161, 80, .10);
  --warning-tint: rgba(232, 137, 12, .12);
  --danger-tint: rgba(217, 48, 37, .09);
  --chip-bg: rgba(15, 17, 22, .045);
  /* Phase 3B 派生令牌 */
  --surface-raised: rgba(255, 255, 255, .88);
  --surface-sunken: rgba(15, 17, 22, .035);
  --border-hairline: rgba(15, 17, 22, .08);
  --accent-tint-strong: rgba(91, 91, 240, .18);
  --overlay-scrim: rgba(11, 13, 20, .48);
  --focus-ring: 0 0 0 2px var(--accent-tint-strong);
  /* 阴影 */
  --shadow-card: 0 8px 30px rgba(16, 17, 31, .06);
  --shadow-cta: 0 12px 26px rgba(91, 91, 240, .28);
  --shadow-float: 0 18px 50px rgba(16, 17, 31, .16);
  --glow-border: 0 0 0 1px rgba(255, 255, 255, .4) inset;
  /* 圆角 */
  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  /* 间距 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;
  /* 尺寸 */
  --topbar-h: 96px;
  --tabbar-h: 56px;
  --ease: cubic-bezier(.22, .8, .28, 1);
  --font-sans: 'PingFang SC', 'HarmonyOS Sans SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Mono', 'Menlo', 'Consolas', monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d14;
  --surface: #161923;
  --surface-2: #1D2130;
  --glass: rgba(255, 255, 255, .06);
  --glass-strong: rgba(22, 25, 35, .92);
  --glass-border: rgba(255, 255, 255, .09);
  --text-1: #F2F3F7;
  --text-2: #9AA0B4;
  --text-3: #6B7080;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .15);
  --accent: #8B8BFF;
  --accent-deep: #7474EF;
  --accent-soft: #A8A8FF;
  --accent-2: #9587FF;
  --success: #4AD98A;
  --warning: #F2AC4B;
  --danger: #FF6B60;
  --info: #8B8BFF;
  --accent-tint: rgba(139, 139, 255, .14);
  --accent-tint-2: rgba(139, 139, 255, .20);
  --success-tint: rgba(74, 217, 138, .12);
  --warning-tint: rgba(242, 172, 75, .12);
  --danger-tint: rgba(255, 107, 96, .12);
  --chip-bg: rgba(255, 255, 255, .055);
  /* Phase 3B 派生令牌 */
  --surface-raised: rgba(255, 255, 255, .10);
  --surface-sunken: rgba(255, 255, 255, .045);
  --border-hairline: rgba(242, 243, 247, .10);
  --accent-tint-strong: rgba(139, 139, 255, .26);
  --overlay-scrim: rgba(0, 0, 0, .64);
  --focus-ring: 0 0 0 2px rgba(139, 139, 255, .35);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, .30);
  --shadow-cta: 0 12px 30px rgba(90, 90, 240, .32);
  --shadow-float: 0 20px 60px rgba(0, 0, 0, .60);
  --glow-border: 0 0 0 1px rgba(255, 255, 255, .05) inset;
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
svg { width: 24px; height: 24px; display: block; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.tnum { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.clamp-1, .clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-1 { -webkit-line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.accent { color: var(--accent); }

/* ---------- App 外壳（桌面预览收进设备框） ---------- */
.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 430px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
}
@media (min-width: 600px) {
  body {
    display: grid;
    place-items: center;
    padding: 24px 0;
    background:
      radial-gradient(800px 500px at 15% -10%, rgba(91, 91, 240, .16), transparent 65%),
      radial-gradient(700px 500px at 95% 110%, rgba(122, 108, 245, .12), transparent 60%),
      var(--bg);
  }
  .app-shell {
    height: min(900px, calc(100dvh - 48px));
    border: 1px solid var(--line);
    border-radius: 38px;
    box-shadow: 0 40px 100px rgba(10, 12, 30, .28);
  }
}

/* ---------- 顶部导航 ---------- */
.app-topbar {
  position: relative;
  z-index: 20;
  flex: none;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: height .28s var(--ease), border-color .2s ease;
}
.app-topbar.is-compact {
  height: calc(var(--tabbar-h) + env(safe-area-inset-top, 0px));
  border-bottom-color: var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: env(safe-area-inset-top, 0px) 20px 0;
}
.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.5px;
  box-shadow: 0 6px 16px rgba(91, 91, 240, .28);
  transition: width .28s var(--ease), height .28s var(--ease), border-radius .28s var(--ease);
}
.is-compact .brand-mark { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.topbar-copy { min-width: 0; flex: 1; }
.topbar-kicker {
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  white-space: nowrap;
  transition: opacity .18s ease, height .2s var(--ease);
  height: 16px;
}
.topbar-sep { padding: 0 2px; }
.topbar-title {
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -.8px;
  line-height: 1.18;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: font-size .28s var(--ease);
}
.is-compact .topbar-kicker { opacity: 0; height: 0; }
.is-compact .topbar-title { font-size: 16px; font-weight: 650; letter-spacing: -.2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.status-led {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-tint);
  animation: led-pulse 2.6s ease-in-out infinite;
}
.status-led.is-offline { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-tint); }
@keyframes led-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.icon-btn {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  transition: background .18s, color .18s, transform .12s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active { background: var(--chip-bg); transform: scale(.94); color: var(--accent); }

/* ---------- 滚动区与视图 ---------- */
.scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  padding: 4px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 28px);
}
.scroll-area::-webkit-scrollbar { display: none; }
.view { animation: view-in .24s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section { margin-top: var(--sp-6); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title { font-size: 17px; font-weight: 680; letter-spacing: -.3px; }
.section-more { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; color: var(--accent); min-height: 44px; }
.section-more svg { width: 15px; height: 15px; }
.home-lede { margin: 8px 2px 18px; color: var(--text-2); font-size: 13px; }

/* ---------- 通用卡片与按钮 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card), var(--glow-border);
}
.glass-card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 650;
  transition: transform .12s var(--ease), filter .18s, background .18s;
}
.btn svg { width: 19px; height: 19px; }
.btn:active { transform: translateY(1px) scale(.985); filter: brightness(.96); }
.btn-primary {
  min-height: 50px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-cta);
}
.btn-primary svg { width: 20px; height: 20px; }
.btn-tint { background: var(--accent-tint); color: var(--accent); }
.btn-tint:active { background: var(--accent-tint-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--accent); }
.btn-outline { background: var(--surface); border: 1px solid var(--line); color: var(--text-1); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 12.5px; border-radius: var(--r-sm); }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 650;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  background: var(--chip-bg); color: var(--text-2);
  white-space: nowrap;
}
.badge.tint-accent { background: var(--accent-tint); color: var(--accent); }
.badge.tint-success { background: var(--success-tint); color: var(--success); }
.badge.tint-warning { background: var(--warning-tint); color: var(--warning); }
.badge.tint-danger { background: var(--danger-tint); color: var(--danger); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.is-online { background: var(--success); box-shadow: 0 0 0 3px var(--success-tint); }
.dot.is-off { background: var(--danger); }

/* ---------- 首页：状态 / CTA / 宫格 ---------- */
.status-card { position: relative; overflow: hidden; padding: 16px; margin-top: 4px; }
.status-card::before {
  content: ''; position: absolute; z-index: 0;
  width: 180px; height: 180px; right: -70px; top: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-tint-2), transparent 70%);
  pointer-events: none;
}
.status-card > * { position: relative; z-index: 1; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.status-cell { min-width: 0; }
.status-label { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: .3px; }
.status-value { margin-top: 3px; font-size: 16px; font-weight: 680; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-sub { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.lines-list { display: grid; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.line-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.line-row .line-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-row .line-role { font-size: 11px; color: var(--text-3); }
.hero-cta { margin-top: 16px; }
.cta-meta { display: flex; justify-content: center; gap: 12px; margin-top: 9px; font-size: 11.5px; color: var(--text-3); }
.cta-meta span { display: inline-flex; align-items: center; gap: 4px; }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-item {
  display: flex; align-items: center; gap: 10px;
  min-height: 76px; padding: 12px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  text-align: left;
  transition: transform .16s var(--ease), border-color .18s;
}
.quick-item:active { transform: scale(.975); border-color: var(--accent-tint-2); }
.quick-icon {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 13px;
  background: var(--accent-tint); color: var(--accent);
}
.quick-icon svg { width: 20px; height: 20px; }
.quick-copy { min-width: 0; flex: 1; }
.quick-label { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-sub { font-size: 10.5px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-arrow { color: var(--text-3); align-self: flex-start; }
.quick-arrow svg { width: 14px; height: 14px; }
.notice-strip {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 16px; padding: 11px 12px;
  border-radius: var(--r-md);
  background: var(--warning-tint); color: var(--warning);
  font-size: 11.5px; line-height: 1.6;
}
.notice-strip svg { width: 16px; height: 16px; margin-top: 1px; }

/* ---------- 插件页 ---------- */
.search-box {
  display: flex; align-items: center; gap: 9px;
  height: 46px; padding: 0 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  color: var(--text-3);
}
.search-box svg { width: 19px; height: 19px; }
.search-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; }
.search-input::placeholder { color: var(--text-3); }
.search-clear { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text-3); }
.search-clear:active { background: var(--chip-bg); }
.search-clear svg { width: 15px; height: 15px; }
.chip-row { display: flex; gap: 8px; margin: 12px 0 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 36px; padding: 0 13px;
  border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text-2); font-size: 12.5px; font-weight: 550;
  transition: background .18s, color .18s, border-color .18s;
}
.chip::after { content: ''; position: absolute; inset: -4px -2px; }
.chip.is-active { background: var(--accent-tint); color: var(--accent); border-color: transparent; font-weight: 650; }
.chip svg { width: 14px; height: 14px; }
.plugin-list { display: grid; gap: 10px; margin-top: 12px; }
.plugin-card {
  display: block; width: 100%; text-align: left;
  padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-card), var(--glow-border);
  transition: transform .16s var(--ease), border-color .18s;
}
.plugin-card:active { transform: scale(.99); border-color: var(--accent-tint-2); }
.plugin-top { display: flex; align-items: flex-start; gap: 12px; }
.plugin-icon {
  display: grid; place-items: center; flex: none;
  width: 48px; height: 48px; border-radius: var(--r-md);
  background: linear-gradient(140deg, var(--tone-a, var(--accent)), var(--tone-b, var(--accent-2)));
  color: #fff; font-size: 15px; font-weight: 750; letter-spacing: -.5px;
  box-shadow: 0 6px 16px rgba(16, 17, 31, .14);
}
.tone-0 { --tone-a: #5B5BF0; --tone-b: #7A6CF5; }
.tone-1 { --tone-a: #0E9F8A; --tone-b: #37C9A8; }
.tone-2 { --tone-a: #E8890C; --tone-b: #F5B545; }
.tone-3 { --tone-a: #D9509A; --tone-b: #F58BB9; }
.tone-4 { --tone-a: #2E7CF6; --tone-b: #5BA8FF; }
.tone-5 { --tone-a: #12A150; --tone-b: #4AC97C; }
.tone-6 { --tone-a: #D93025; --tone-b: #F2796E; }
.tone-7 { --tone-a: #4B5B8C; --tone-b: #7D8FBF; }
.plugin-main { flex: 1; min-width: 0; }
.plugin-title-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.plugin-name { font-size: 17px; font-weight: 650; letter-spacing: -.3px; line-height: 1.3; }
.plugin-author { margin-top: 3px; font-size: 13px; color: var(--text-3); }
.plugin-chevron { color: var(--text-3); margin-top: 12px; }
.plugin-chevron svg { width: 17px; height: 17px; }
.plugin-targets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.target-chip {
  height: 24px; padding: 0 8px; display: inline-flex; align-items: center;
  border-radius: 7px; background: var(--chip-bg); color: var(--text-2);
  font-size: 11px; font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plugin-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.plugin-meta span { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.plugin-meta svg { width: 13px; height: 13px; color: var(--text-3); }
.plugin-desc { margin-top: 10px; font-size: 13px; line-height: 19px; color: var(--text-2); }

/* ---------- 更新页 ---------- */
.banner-danger {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 4px 0 16px; padding: 13px 14px;
  border-radius: var(--r-md);
  background: var(--danger-tint);
  border: 1px solid rgba(217, 48, 37, .18);
  color: var(--danger); font-size: 12.5px; line-height: 1.6;
}
.banner-danger svg { width: 19px; height: 19px; margin-top: 1px; }
.banner-danger strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.timeline { position: relative; padding-left: 22px; margin-top: 12px; }
.timeline::before {
  content: ''; position: absolute; left: 4px; top: 14px; bottom: 14px;
  width: 2px; border-radius: 2px; background: var(--line-strong);
}
.tl-node { position: relative; margin-bottom: 12px; }
.tl-dot {
  position: absolute; left: -22px; top: 20px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-strong);
  z-index: 1;
}
.tl-node.is-latest .tl-dot {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-tint), 0 0 18px var(--accent);
}
.release-card { padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card), var(--glow-border); }
.release-card.is-latest { border-color: var(--accent-tint-2); }
.release-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.release-version { font-size: 17px; font-weight: 680; letter-spacing: -.3px; }
.release-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.release-notes { margin: 12px 0 0; padding-left: 17px; color: var(--text-2); font-size: 13px; line-height: 1.75; }
.release-notes li { padding-left: 2px; }
.release-notes li::marker { color: var(--accent); }
.sha-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 40px; margin-top: 10px;
  color: var(--text-3); font-size: 12px;
}
.sha-toggle svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.sha-toggle.is-open svg { transform: rotate(90deg); }
.sha-box { display: flex; gap: 8px; align-items: center; margin-top: 4px; padding: 10px; border-radius: var(--r-sm); background: var(--chip-bg); }
.sha-text { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.release-actions { display: flex; gap: 8px; margin-top: 12px; }
.release-actions .btn { flex: 1; }

/* ---------- 公告页 ---------- */
.ann-list { display: grid; gap: 10px; margin-top: 12px; }
.ann-row {
  display: flex; align-items: stretch; gap: 12px;
  width: 100%; text-align: left; padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  transition: transform .16s var(--ease);
}
.ann-row:active { transform: scale(.99); }
.ann-bar { flex: none; width: 3px; border-radius: 3px; background: var(--info); }
.ann-bar.level-info { background: var(--info); }
.ann-bar.level-release { background: var(--success); }
.ann-bar.level-warn { background: var(--warning); }
.ann-body { flex: 1; min-width: 0; }
.ann-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 620; letter-spacing: -.2px; }
.ann-time { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.ann-desc { margin-top: 8px; font-size: 13px; line-height: 19px; color: var(--text-2); }
.ann-chevron { align-self: center; color: var(--text-3); }
.ann-chevron svg { width: 16px; height: 16px; }

/* ---------- 我的页 ---------- */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--chip-bg); }
.seg-item { flex: 1; min-height: 42px; border-radius: var(--r-sm); color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.seg-item.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-card); }
.auth-card { padding: 16px; margin-top: 4px; }
.field { margin-top: 14px; }
.field-label { display: block; margin-bottom: 7px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.field-input {
  width: 100%; height: 46px; padding: 0 14px;
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface-2); outline: 0;
  font-size: 14px; transition: border-color .18s, box-shadow .18s;
}
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.field-hint { margin-top: 7px; font-size: 11px; color: var(--text-3); line-height: 1.5; }
.field-error { margin-top: 8px; font-size: 12px; color: var(--danger); min-height: 16px; }
.auth-submit { margin-top: 18px; }
.profile-card { display: flex; align-items: center; gap: 14px; padding: 18px 16px; }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 54px; height: 54px; border-radius: 18px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 17px; font-weight: 750;
  box-shadow: var(--shadow-cta);
}
.profile-name { font-size: 18px; font-weight: 680; letter-spacing: -.3px; }
.profile-email { margin-top: 3px; font-size: 12.5px; color: var(--text-2); word-break: break-all; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.stat { text-align: center; }
.stat-num { font-size: 17px; font-weight: 700; }
.stat-label { margin-top: 2px; font-size: 11px; color: var(--text-3); }
.group-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 13px; font-weight: 650; color: var(--text-2); }
.group-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.upload-row { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px; }
.upload-info { flex: 1; min-width: 0; }
.upload-name { font-size: 14px; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-sub { margin-top: 3px; font-size: 11.5px; color: var(--text-3); }
.status-badge { flex: none; height: 22px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 999px; font-size: 11px; font-weight: 650; }
.status-badge.state-published { background: var(--success-tint); color: var(--success); }
.status-badge.state-approved { background: var(--accent-tint); color: var(--accent); }
.status-badge.state-pending { background: var(--warning-tint); color: var(--warning); }
.status-badge.state-rejected { background: var(--danger-tint); color: var(--danger); }
.upload-note { margin-top: 6px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--danger-tint); color: var(--danger); font-size: 11.5px; line-height: 1.5; }
.setting-list { margin-top: 16px; overflow: hidden; }
.setting-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 56px; padding: 10px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  text-align: left;
}
.setting-row:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.setting-row:last-child { border-bottom: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.setting-row .setting-icon { color: var(--accent); }
.setting-row .setting-icon svg { width: 19px; height: 19px; }
.setting-copy { flex: 1; min-width: 0; }
.setting-title { font-size: 14px; font-weight: 600; }
.setting-sub { margin-top: 2px; font-size: 11.5px; color: var(--text-3); }
.setting-value { font-size: 12px; color: var(--text-3); }
.switch {
  position: relative; flex: none;
  width: 50px; height: 30px; border-radius: 999px;
  background: var(--line-strong); transition: background .22s var(--ease);
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2);
  transition: transform .22s var(--ease);
}
.switch.is-on { background: var(--accent); }
.switch.is-on::after { transform: translateX(20px); }
.logout-btn { width: 100%; margin-top: 16px; color: var(--danger); background: var(--danger-tint); }
.mini-tip { margin: 14px 2px 0; font-size: 11px; color: var(--text-3); line-height: 1.6; }

/* ---------- 详情推入层 ---------- */
.detail-layer {
  position: absolute; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--bg);
  transform: translateX(100%); visibility: hidden;
  transition: transform .3s var(--ease), visibility 0s .3s;
}
.detail-layer.is-open { transform: none; visibility: visible; transition: transform .3s var(--ease); }
.detail-topbar {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  height: calc(44px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 10px 0;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line);
}
.back-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-sm); color: var(--text-1); }
.back-btn:active { background: var(--chip-bg); }
.back-btn svg { width: 22px; height: 22px; }
.detail-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-close { color: var(--text-3); }
.detail-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px calc(28px + env(safe-area-inset-bottom, 0px)); scrollbar-width: none; }
.detail-scroll::-webkit-scrollbar { display: none; }
.detail-hero { padding: 18px 16px; border-radius: var(--r-xl); background: linear-gradient(150deg, var(--accent-tint-2), transparent 70%), var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.detail-hero-title { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.detail-title-lg { font-size: 22px; font-weight: 750; letter-spacing: -.6px; line-height: 1.25; }
.detail-sub { margin-top: 8px; font-size: 13px; color: var(--text-2); line-height: 1.7; }
.detail-actions { display: flex; gap: 8px; margin-top: 16px; }
.detail-actions .btn { flex: 1; }
.detail-section { margin-top: 22px; }
.detail-section-title { margin-bottom: 10px; font-size: 14px; font-weight: 680; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.info-item { padding: 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.info-label { font-size: 11px; color: var(--text-3); }
.info-value { margin-top: 4px; font-size: 13.5px; font-weight: 620; word-break: break-all; }
.info-desc { margin-top: 5px; font-size: 11.5px; font-weight: 400; line-height: 1.55; color: var(--text-2); }
.detail-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.release-meta svg { width: 13px; height: 13px; }
.plugin-icon svg { width: 22px; height: 22px; }
.setting-row > svg { width: 18px; height: 18px; color: var(--text-3); }
.feature-group { margin-bottom: 10px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.feature-group-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; }
.feature-group-title::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--accent); }
.feature-list { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.feature-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-2); }
.feature-item svg { width: 15px; height: 15px; margin-top: 2px; color: var(--success); }
.scope-list { display: flex; flex-wrap: wrap; gap: 7px; }
.scope-chip { height: 26px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 8px; background: var(--chip-bg); font-size: 11px; font-family: var(--font-mono); color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.kv-row:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.kv-row:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); border-bottom: 0; }
.kv-key { color: var(--text-3); flex: none; }
.kv-val { text-align: right; word-break: break-all; }
.code-box { padding: 12px; border-radius: var(--r-md); background: var(--chip-bg); font-family: var(--font-mono); font-size: 11px; line-height: 1.7; color: var(--text-2); word-break: break-all; }
.step-list { margin: 0; padding-left: 19px; color: var(--text-2); font-size: 13px; line-height: 1.9; }
.step-list li::marker { color: var(--accent); font-weight: 700; }

/* ---------- 三态：骨架 / 空 / 错 ---------- */
.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--chip-bg) 25%, var(--line) 50%, var(--chip-bg) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-card { padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); margin-bottom: 10px; }
.sk-line { height: 12px; margin-bottom: 10px; }
.state-block { display: grid; justify-items: center; gap: 10px; padding: 56px 24px; text-align: center; color: var(--text-2); }
.state-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 20px; background: var(--chip-bg); color: var(--text-3); }
.state-icon svg { width: 26px; height: 26px; }
.state-title { font-size: 15px; font-weight: 650; color: var(--text-1); }
.state-desc { font-size: 12.5px; line-height: 1.7; max-width: 240px; }

/* ---------- 强制更新弹窗 ---------- */
.modal-layer { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6, 8, 16, .58); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal-card {
  position: relative; width: 100%; max-width: 340px;
  padding: 24px 20px 18px; text-align: center;
  border-radius: var(--r-xl);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-float);
  animation: modal-in .3s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.modal-mark { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px; background: var(--danger-tint); color: var(--danger); }
.modal-mark svg { width: 28px; height: 28px; }
.modal-eyebrow { font-size: 11px; font-weight: 750; letter-spacing: 1.6px; color: var(--danger); text-transform: uppercase; }
.modal-title { margin: 6px 0 8px; font-size: 21px; font-weight: 750; letter-spacing: -.5px; }
.modal-desc { margin: 0 0 18px; font-size: 13px; line-height: 1.7; color: var(--text-2); }
.modal-fallbacks { display: flex; justify-content: center; gap: 4px; margin-top: 8px; }
.modal-fallbacks .btn { flex: 1; font-size: 12.5px; min-height: 40px; }

/* ---------- Toast / 下拉提示 ---------- */
.toast-root {
  position: absolute; z-index: 80;
  left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 24px; pointer-events: none;
}
.toast {
  max-width: 100%; padding: 10px 16px;
  border-radius: 999px; font-size: 12.5px; color: var(--text-1);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-float);
  animation: toast-in .24s var(--ease);
}
.toast.is-out { animation: toast-out .2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px) scale(.98); } }

/* ---------- 底部 TabBar ---------- */
.tabbar {
  position: relative; z-index: 30; flex: none;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--tabbar-h); color: var(--text-3);
  transition: color .18s;
}
.tab::before {
  content: ''; position: absolute; top: 0;
  width: 22px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--accent); opacity: 0; transform: scaleX(.4);
  transition: opacity .2s, transform .24s var(--ease);
}
.tab.is-active { color: var(--accent); }
.tab.is-active::before { opacity: 1; transform: scaleX(1); }
.tab .icon-outline { display: block; }
.tab .icon-filled { display: none; }
.tab.is-active .icon-outline { display: none; }
.tab.is-active .icon-filled { display: block; }
.tab-icon svg { width: 24px; height: 24px; }
.tab-label { font-size: 10.5px; font-weight: 600; letter-spacing: .2px; }
.tab:active .tab-icon { transform: scale(.9); transition: transform .12s; }

/* ---------- 小屏与降级 ---------- */
@media (max-width: 350px) {
  .scroll-area { padding-left: 12px; padding-right: 12px; }
  .topbar-inner { padding-left: 14px; padding-right: 12px; }
  .topbar-title { font-size: 25px; }
  .quick-item { padding: 10px; gap: 8px; }
  .quick-icon { width: 36px; height: 36px; }
  .plugin-card { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ================================================================
   Phase 3B · 两站合一 / 完整论坛 / 账号绑定
   新增令牌在 :root 与 :root[data-theme="dark"] 中定义
   ================================================================ */

/* ---------- 二级页期间隐藏 TabBar（保持布局不跳动） ---------- */
.app-shell.has-detail .tabbar { visibility: hidden; pointer-events: none; }
.detail-extra { display: flex; align-items: center; gap: 4px; min-height: 44px; }
.detail-extra[hidden] { display: none; }
.top-text-btn, .top-publish {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 12px; border-radius: 10px;
  font-size: 13px; font-weight: 650; white-space: nowrap;
}
.top-text-btn { color: var(--text-2); }
.top-text-btn:active { background: var(--chip-bg); }
.top-publish { background: var(--accent); color: #fff; box-shadow: var(--shadow-cta); }
.top-publish:active { filter: brightness(.94); }
.detail-extra.is-publish { flex: none; }
.topbar-message { position: relative; }
.topbar-message .msg-dot {
  position: absolute; top: 7px; right: 7px;
  min-width: 8px; height: 8px; border-radius: 999px;
  background: var(--danger); box-shadow: 0 0 0 2px var(--bg);
}
.fab {
  position: absolute; z-index: 6; right: 18px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  display: grid; place-items: center;
  width: 54px; height: 54px; border-radius: 18px;
  color: #fff; background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 30px rgba(91, 91, 240, .38);
  transition: transform .16s var(--ease);
}
.fab svg { width: 25px; height: 25px; }
.fab:active { transform: scale(.94); }
.fab[hidden] { display: none; }

/* ---------- 头像尺寸与色调 ---------- */
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar[class*="tone-"] { background: linear-gradient(140deg, var(--tone-a), var(--tone-b)); }
.avatar-xxs { width: 24px !important; height: 24px !important; border-radius: 8px; font-size: 10px; }
.avatar-sm { width: 32px !important; height: 32px !important; border-radius: 11px; font-size: 12px; }
.avatar-md { width: 44px !important; height: 44px !important; border-radius: 14px; font-size: 14px; }
.avatar-lg { width: 64px !important; height: 64px !important; border-radius: 22px; font-size: 19px; }
.avatar-xl { width: 88px !important; height: 88px !important; border-radius: 30px; font-size: 26px; }
.avatar-button { display: inline-flex; flex: none; padding: 0; border-radius: 30px; }
.avatar-button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---------- 玻璃整段容器 + 发丝分割线 ---------- */
.glass-list {
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border-hairline);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow-card);
}
.glass-list > * + * { border-top: 1px solid var(--border-hairline); }
.glass-list .state-block { padding: 36px 20px; }
.sk-row { padding: 15px 16px; background: transparent; border-radius: 0; }
.sk-row .skeleton { margin-bottom: 9px; }
.community-hint {
  display: flex; gap: 9px; align-items: flex-start;
  margin-top: 12px; padding: 0 4px;
  color: var(--text-3); font-size: 11.5px; line-height: 1.6;
}
.community-hint svg { width: 15px; height: 15px; margin-top: 2px; }

/* ---------- 社区：版块 ---------- */
.board-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 92px; padding: 12px 14px;
  text-align: left; transition: background .18s;
}
.board-row:active { background: var(--surface-sunken); }
.board-icon {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 15px;
  color: #fff; background: linear-gradient(140deg, var(--tone-a, var(--accent)), var(--tone-b, var(--accent-2)));
  box-shadow: 0 6px 16px rgba(16, 17, 31, .14);
}
.board-icon svg { width: 22px; height: 22px; }
.board-emoji {
  display: block; font-size: 22px; line-height: 1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', var(--font-sans);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.18));
}
.board-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.board-title { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 660; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px var(--danger-tint); }
.board-desc { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-counts { font-size: 11px; color: var(--text-3); }
.board-chevron { color: var(--text-3); }
.board-chevron svg { width: 16px; height: 16px; }
.board-hero { display: flex; align-items: center; gap: 12px; padding: 4px 2px; }
.board-hero .detail-title-lg { font-size: 20px; }
.load-more { margin-top: 12px; }

/* ---------- 社区：帖子列表 ---------- */
.post-row {
  display: flex; flex-direction: column; justify-content: center; gap: 9px;
  width: 100%; min-height: 88px; padding: 13px 14px; text-align: left;
  transition: background .18s;
}
.post-row:active { background: var(--surface-sunken); }
.post-row-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-row-title .badge svg { width: 11px; height: 11px; }
.post-row-name { font-size: 15px; font-weight: 620; line-height: 1.4; color: var(--text-1); }
.post-row-meta { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-3); }
.post-row-author { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-row-time { margin-right: auto; }
.post-row-stats { display: inline-flex; align-items: center; gap: 4px; }
.post-row-stats svg { width: 13px; height: 13px; }
.post-row-stats svg + svg { margin-left: 5px; }

/* ---------- 社区：帖子详情 ---------- */
.post-detail-top { padding: 2px 2px 14px; }
.post-board-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; margin-bottom: 10px;
  border-radius: 8px; background: var(--accent-tint); color: var(--accent);
  font-size: 11.5px; font-weight: 650;
}
.post-board-badge svg { width: 13px; height: 13px; }
.post-title-lg { margin: 0; font-size: 20px; line-height: 1.4; font-weight: 720; letter-spacing: -.4px; }
.post-author-row { display: flex; align-items: center; gap: 9px; margin-top: 14px; }
.post-author-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-author-name { font-size: 13.5px; font-weight: 650; }
.post-author-time { font-size: 11px; color: var(--text-3); }
.post-content-card {
  padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-card);
}
.post-content { font-size: 14.5px; line-height: 1.85; color: var(--text-1); word-break: break-word; }
.post-quote {
  margin: 14px 0 0; padding: 10px 12px;
  border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
  background: var(--surface-sunken); color: var(--text-2); font-size: 13px; line-height: 1.7;
}
.post-images { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.post-image {
  position: relative; min-height: 104px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(140deg, var(--tone-a, var(--accent)), var(--tone-b, var(--accent-2)));
  background-size: cover; background-position: center;
}
.post-image span {
  position: absolute; left: 8px; bottom: 8px;
  padding: 3px 7px; border-radius: 999px;
  background: var(--overlay-scrim); color: #fff; font-size: 10.5px;
}
.reply-heading {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 22px 2px 10px; font-size: 14px;
}
.reply-heading .faint { font-size: 11px; }
.reply-list { display: grid; }
.reply-row {
  display: flex; gap: 10px; padding: 14px 12px;
  border-radius: var(--r-md); background: var(--surface-raised);
  border: 1px solid var(--border-hairline); margin-bottom: 8px;
}
.reply-main { flex: 1; min-width: 0; }
.reply-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.reply-name { font-size: 13px; font-weight: 650; }
.reply-floor, .reply-time { font-size: 10.5px; color: var(--text-3); }
.reply-time { margin-left: auto; }
.reply-content { margin-top: 6px; font-size: 13.5px; line-height: 1.7; color: var(--text-1); word-break: break-word; }
.reply-actions { display: flex; gap: 12px; margin-top: 8px; }
.reply-action {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 32px; color: var(--text-3); font-size: 11.5px;
}
.reply-action svg { width: 15px; height: 15px; }
.reply-action.is-liked { color: var(--danger); }
.nested-replies {
  margin-top: 9px; padding: 8px 10px; border-radius: 10px;
  background: var(--surface-sunken); border: 1px solid var(--border-hairline);
}
.nested-row { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; line-height: 1.65; }
.nested-row + .nested-row { margin-top: 5px; }
.nested-name { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 600; }
.nested-name .badge { height: 16px; padding: 0 5px; font-size: 9px; }
.nested-content { color: var(--text-2); }
.detail-scroll:has(.post-bottombar), .detail-scroll:has(.chat-inputbar) { padding-bottom: 0; }
.post-bottombar {
  position: sticky; bottom: 0; z-index: 7;
  margin: 18px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--border-hairline);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.reply-form { display: flex; gap: 8px; align-items: center; }
.reply-input {
  flex: 1; min-width: 0; height: 42px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--border-hairline);
  background: var(--surface-sunken); outline: 0; font-size: 13px;
}
.reply-input:focus { box-shadow: var(--focus-ring); border-color: var(--accent); }
.reply-send {
  display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; border-radius: 50%;
  color: #fff; background: var(--accent);
}
.reply-send svg { width: 19px; height: 19px; }
.reply-target {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 7px; padding: 5px 10px; border-radius: 8px;
  background: var(--accent-tint); color: var(--accent); font-size: 11.5px;
}
.reply-target button { color: var(--accent); font-size: 16px; line-height: 1; min-width: 24px; }
.post-bottom-actions { display: flex; gap: 8px; margin-top: 7px; }
.post-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  flex: 1; min-height: 34px; border-radius: 10px;
  background: var(--surface-sunken); color: var(--text-2); font-size: 12px;
}
.post-action svg { width: 16px; height: 16px; }
.post-action.is-active { color: var(--accent); background: var(--accent-tint); }

/* ---------- 发帖编辑器 / 底部版块弹层 ---------- */
.compose-page { padding-bottom: 24px; }
.compose-field { margin-bottom: 12px; }
.compose-title, .compose-content {
  width: 100%; border: 0; outline: 0; resize: none;
  background: var(--surface); color: var(--text-1);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-card);
}
.compose-title { height: 52px; padding: 0 15px; border-radius: var(--r-md); font-size: 16px; font-weight: 620; }
.compose-content { min-height: 180px; padding: 14px 15px; border-radius: var(--r-lg); font-size: 14px; line-height: 1.75; }
.compose-title:focus, .compose-content:focus { box-shadow: var(--focus-ring); border-color: var(--accent); }
.compose-board {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 60px; padding: 10px 14px; border-radius: var(--r-md);
  background: var(--surface-raised); border: 1px solid var(--border-hairline); text-align: left;
}
.compose-board-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent-tint); color: var(--accent); }
.compose-board-icon svg { width: 19px; height: 19px; }
.compose-board-copy { flex: 1; display: flex; flex-direction: column; }
.compose-board-copy small { color: var(--text-3); font-size: 10.5px; }
.compose-board-copy strong { font-size: 13.5px; }
.compose-board > svg { width: 16px; height: 16px; color: var(--text-3); }
.image-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.image-cell, .image-add {
  position: relative; aspect-ratio: 1; border-radius: 12px;
  background-color: var(--surface-sunken); background-size: cover; background-position: center;
  border: 1px solid var(--border-hairline);
}
.image-add { display: grid; place-items: center; color: var(--text-3); cursor: pointer; }
.image-add svg { width: 24px; height: 24px; }
.image-remove {
  position: absolute; top: 3px; right: 3px;
  display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; color: #fff; background: var(--overlay-scrim);
}
.image-remove svg { width: 13px; height: 13px; }
.sheet-scrim { position: fixed; inset: 0; z-index: 70; background: var(--overlay-scrim); }
.board-sheet {
  position: fixed; z-index: 71; left: 0; right: 0; bottom: 0;
  max-width: 430px; margin: 0 auto;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: var(--surface-raised); border-top: 1px solid var(--border-hairline);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  max-height: 70%; overflow-y: auto;
  animation: sheet-in .24s var(--ease);
}
@keyframes sheet-in { from { transform: translateY(22px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-title { margin-bottom: 8px; font-size: 14px; font-weight: 680; }
.sheet-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 54px; padding: 7px 4px; text-align: left;
  border-bottom: 1px solid var(--border-hairline);
}
.sheet-row > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.sheet-row strong { font-size: 13.5px; }
.sheet-row small { font-size: 11px; color: var(--text-3); }
.sheet-row > svg { width: 18px; height: 18px; color: var(--accent); }

/* ---------- 私信会话 / 聊天 ---------- */
.conv-row {
  display: flex; align-items: center; gap: 11px;
  width: 100%; min-height: 76px; padding: 12px 14px; text-align: left;
}
.conv-row:active { background: var(--surface-sunken); }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.conv-top { display: flex; align-items: center; gap: 6px; }
.conv-top strong { font-size: 14px; font-weight: 650; }
.conv-time { margin-left: auto; font-size: 10.5px; color: var(--text-3); }
.conv-last { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-unread {
  flex: none; min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 10px;
}
.chat-page { min-height: 100%; display: flex; flex-direction: column; }
.chat-messages { flex: 1; padding: 4px 0 12px; }
.chat-day { margin: 10px auto; width: fit-content; padding: 4px 10px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-3); font-size: 10.5px; }
.chat-row { display: flex; align-items: flex-end; gap: 7px; margin: 10px 0; }
.chat-row.is-mine { flex-direction: row; }
.chat-row.is-theirs { flex-direction: row; }
.bubble {
  max-width: 72%; padding: 10px 13px; font-size: 13.5px; line-height: 1.65;
  word-break: break-word; box-shadow: var(--shadow-card);
}
.bubble-mine { border-radius: 18px 18px 6px 18px; background: var(--accent); color: #fff; }
.bubble-theirs { border-radius: 18px 18px 18px 6px; background: var(--surface-raised); color: var(--text-1); border: 1px solid var(--border-hairline); }
.bubble-meta { align-self: flex-end; margin: 0 0 2px; font-size: 9.5px; color: var(--text-3); white-space: nowrap; }
.chat-row.is-mine .bubble { order: 1; }
.chat-row.is-mine > .bubble-meta { order: 0; }
.chat-row.is-theirs > .bubble-meta { order: 2; }
.chat-empty { display: grid; justify-items: center; gap: 12px; padding: 56px 12px; color: var(--text-3); font-size: 12.5px; }
.chat-empty p { margin: 0; }
.chat-inputbar {
  position: sticky; bottom: 0; z-index: 6;
  display: flex; gap: 8px; align-items: center;
  margin: auto -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--border-hairline);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.chat-input {
  flex: 1; min-width: 0; height: 42px; padding: 0 14px;
  border-radius: 999px; outline: 0;
  background: var(--surface-sunken); border: 1px solid var(--border-hairline); font-size: 13px;
}
.chat-input:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.chat-send { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: var(--accent); }
.chat-send svg { width: 19px; height: 19px; }

/* ---------- 用户主页 ---------- */
.user-hero { display: flex; align-items: center; gap: 14px; padding: 6px 2px; }
.user-hero-copy { min-width: 0; }
.user-bio { margin: 14px 2px; font-size: 13px; line-height: 1.7; color: var(--text-2); }

/* ---------- 资源：分段 / 预设 / 图案 / 首页聚合 ---------- */
.segmented-main { height: 40px; padding: 3px; border-radius: 14px; }
.segmented-main .seg-item {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; border-radius: 11px; font-size: 13px;
}
.segmented-main .seg-item svg { width: 16px; height: 16px; }
.resource-list { margin-top: 12px; }
.preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.preset-card, .pattern-card {
  display: block; width: 100%; text-align: left; overflow: hidden;
  border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--border-hairline); box-shadow: var(--shadow-card);
}
.preset-preview {
  position: relative; display: block; width: 100%; padding-top: 56.25%;
  border-radius: 0; background-size: cover;
}
.preset-badge { position: absolute; top: 9px; left: 9px; height: 20px; }
.preset-preview-mark { position: absolute; right: 10px; bottom: 9px; color: rgba(255,255,255,.9); }
.preset-preview-mark svg { width: 20px; height: 20px; }
.preset-info { display: block; padding: 11px 12px 12px; }
.preset-title { display: block; font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset-swatches { display: flex; gap: 4px; margin-top: 8px; }
.preset-swatches i { width: 18px; height: 18px; border-radius: 6px; border: 1px solid var(--border-hairline); }
.preset-foot, .pattern-foot { display: flex; justify-content: space-between; gap: 6px; margin-top: 9px; font-size: 10.5px; color: var(--text-3); }
.preset-foot span:last-child { display: inline-flex; align-items: center; gap: 3px; }
.preset-foot svg { width: 12px; height: 12px; }
.pattern-list { display: grid; gap: 9px; }
.pattern-card { padding: 0; }
.pattern-preview { display: block; height: 46px; width: 100%; }
.pattern-info { display: block; padding: 11px 13px 12px; }
.pattern-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pattern-name { font-size: 15px; font-weight: 650; }
.pattern-desc { margin-top: 5px; font-size: 12px; color: var(--text-2); }
.pick-grid { display: grid; gap: 9px; }
.pick-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px; border-radius: var(--r-lg); text-align: left;
  background: var(--surface-raised); border: 1px solid var(--border-hairline);
}
.pick-card:active { background: var(--surface-sunken); }
.pick-visual {
  display: grid; place-items: center; flex: none;
  width: 62px; height: 52px; border-radius: 12px;
  color: #fff; font-size: 15px; font-weight: 750;
  background: linear-gradient(140deg, var(--tone-a, var(--accent)), var(--tone-b, var(--accent-2)));
}
.pick-visual.ratio-16, .resource-preview.ratio-16 { width: 84px; height: 52px; }
.pick-overlay { width: 100%; height: 100%; display: grid; place-items: center; background: rgba(0,0,0,.12); border-radius: 12px; }
.pick-overlay svg { width: 21px; height: 21px; }
.pick-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.pick-title { font-size: 13.5px; font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pick-sub { font-size: 10.5px; color: var(--text-3); }
.resource-preview {
  display: grid; place-items: center; width: 100%; height: 92px;
  border-radius: 16px; color: #fff;
}
.resource-preview.ratio-bar { height: 58px; }
.resource-preview svg { width: 28px; height: 28px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }
.palette-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.palette-swatch {
  display: flex; align-items: flex-end; justify-content: center;
  min-height: 68px; padding: 5px 2px; border-radius: 12px;
  border: 1px solid var(--border-hairline);
}
.palette-swatch i { font-size: 9.5px; color: #fff; font-style: normal; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.hot-post-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 62px; padding: 11px 13px; text-align: left;
}
.hot-post-row:active { background: var(--surface-sunken); }
.hot-rank { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: var(--accent-tint); color: var(--accent); font-size: 11px; font-weight: 700; }
.hot-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hot-title { font-size: 13.5px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-meta { font-size: 10.5px; color: var(--text-3); }
.hot-chevron { color: var(--text-3); }
.hot-chevron svg { width: 15px; height: 15px; }

/* ---------- 账号：登录 / 注册 / 资料 / 绑定 ---------- */
.auth-hero { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.auth-hero > svg { width: 38px; height: 38px; padding: 8px; border-radius: 13px; background: var(--accent-tint); color: var(--accent); }
.auth-hero > div { display: flex; flex-direction: column; }
.auth-hero strong { font-size: 15px; }
.auth-hero span { font-size: 11.5px; color: var(--text-3); }
.auth-page { padding-top: 12px; }
.auth-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 8px 0 14px; border-radius: 22px; background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; }
.auth-mark svg { width: 30px; height: 30px; }
.auth-title { margin: 0; font-size: 23px; font-weight: 750; letter-spacing: -.5px; }
.auth-sub { margin: 7px 0 20px; font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.reg-page { padding-top: 4px; }
.step-indicator { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 24px; }
.step-node { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); position: relative; }
.step-node:not(:last-child)::after { content: ''; position: absolute; top: 13px; left: calc(50% + 17px); right: calc(-50% + 17px); height: 2px; background: var(--line); }
.step-node.is-done::after { background: var(--accent-tint-strong); }
.step-dot { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--surface-sunken); border: 1px solid var(--border-hairline); font-size: 11px; font-weight: 700; }
.step-dot svg { width: 14px; height: 14px; }
.step-node.is-current { color: var(--accent); font-weight: 650; }
.step-node.is-current .step-dot { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 0 0 4px var(--accent-tint); }
.step-node.is-done { color: var(--text-2); }
.step-node.is-done .step-dot { background: var(--accent-tint); color: var(--accent); border-color: transparent; }
.reg-tip { margin: 0 0 14px; padding: 10px 12px; border-radius: 11px; background: var(--accent-tint); color: var(--accent); font-size: 12px; line-height: 1.6; }
.reg-inline-error { margin-top: 6px; min-height: 16px; }
.reg-inline-error.is-error-text, .field-error.is-error-text { color: var(--danger); font-weight: 600; }
.field-input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-tint); }
.otp-group { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.otp-box {
  width: 100%; height: 52px; border-radius: 12px; outline: 0;
  border: 1px solid var(--border-hairline); background: var(--surface-sunken);
  text-align: center; font-size: 22px; font-weight: 650;
  font-variant-numeric: tabular-nums; font-family: var(--font-mono);
  color: var(--text-1); transition: border-color .16s, box-shadow .16s;
}
.otp-box:focus { border: 2px solid var(--accent); box-shadow: var(--focus-ring); }
.otp-group.is-error .otp-box { border-color: var(--danger); background: var(--danger-tint); box-shadow: none; }
.code-field { margin-top: 16px; }
.code-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 14px; margin-top: 10px;
  border-radius: 11px; background: var(--accent-tint); color: var(--accent);
  font-size: 12.5px; font-weight: 650;
}
.code-btn.is-counting, .code-btn:disabled { background: var(--surface-sunken); color: var(--text-3); cursor: not-allowed; }
.code-btn:not(:disabled):active { background: var(--accent-tint-strong); }
.reg-success { display: grid; justify-items: center; text-align: center; padding-top: 24px; }
.success-mark { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 16px; border-radius: 50%; background: var(--success-tint); color: var(--success); }
.success-mark svg { width: 34px; height: 34px; }
.success-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; margin: 8px 0 20px; text-align: left; }
.success-card > div { display: flex; flex-direction: column; }
.success-card strong { font-size: 14px; }
.success-card span { font-size: 11.5px; }
.edit-profile-page { padding-top: 4px; }
.avatar-edit-wrap { display: grid; justify-items: center; margin-bottom: 20px; }
.avatar-edit {
  position: relative; display: grid; place-items: center;
  width: 96px; height: 96px; border-radius: 50%; overflow: visible;
  background: var(--surface-sunken); border: 1px solid var(--border-hairline); cursor: pointer;
}
.avatar-edit > img, .avatar-edit > .avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.avatar-edit-badge {
  position: absolute; right: -2px; bottom: 0;
  display: grid; place-items: center; width: 31px; height: 31px;
  border-radius: 50%; background: var(--accent); color: #fff; border: 2px solid var(--bg);
}
.avatar-edit-badge svg { width: 16px; height: 16px; }
.field-textarea { height: auto; padding: 12px 14px; line-height: 1.7; resize: vertical; }
.binding-page { padding-top: 4px; }
.binding-list { margin-bottom: 12px; }
.binding-row { display: flex; align-items: center; gap: 9px; padding: 13px; }
.binding-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 12px; background: var(--accent-tint); color: var(--accent); }
.binding-icon svg { width: 18px; height: 18px; }
.binding-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.binding-copy strong { font-size: 13px; }
.binding-copy small { font-size: 10.5px; color: var(--text-3); }
.binding-value { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.binding-row .btn { flex: none; }
.bind-card { padding: 14px; }
.bind-form { margin-top: 10px; }
.bind-form .field-input { margin-bottom: 4px; }
.bind-code-row { display: flex; gap: 8px; align-items: flex-start; }
.bind-code-row .field-input { flex: 1; min-width: 0; }
.bind-code-row .code-btn { margin-top: 0; flex: none; }
.bind-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.mine-content { margin-top: 12px; }
.mine-row { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 13px 14px; text-align: left; }
.mine-row:active { background: var(--surface-sunken); }
.mine-row-title { font-size: 13.5px; font-weight: 620; }
.mine-row-meta { font-size: 10.5px; color: var(--text-3); }
.profile-card-lg { padding: 18px 16px; }
.profile-card-lg > svg { width: 20px; height: 20px; color: var(--text-3); }

/* ---------- 焦点与可访问性 ---------- */
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: none; box-shadow: var(--focus-ring);
}
.badge.is-error, .field-error:not(:empty) { letter-spacing: 0; }
[aria-hidden="true"] { pointer-events: none; }
