/* =========================================================================
   MiniForum —— Apple / iOS 风格主题
   设计语言：SF 字体栈 · 毛玻璃导航 · iOS 系统色板 · 分组卡片 · 胶囊按钮
   断点：手机 <768 / 平板 768–1023 / 桌面 ≥1024
   ========================================================================= */

:root {
  color-scheme: light;

  /* 背景与表面 */
  --bg: #f5f5f7;              /* Apple 灰 */
  --surface: #ffffff;         /* 卡片 */
  --surface-2: #f2f2f7;       /* iOS 分组背景 / 输入框 */
  --surface-3: #e8e8ed;       /* 次级按钮 / 按下态 */

  /* 文字 */
  --text: #1d1d1f;
  --text-2: #424245;
  --muted: #86868b;
  --hairline: rgba(0, 0, 0, .10);   /* 分隔线 */
  --border: rgba(0, 0, 0, .08);

  /* 强调色（iOS systemBlue） */
  --primary: #0071e3;
  --primary-hover: #0077ed;
  --primary-ink: #ffffff;
  --ring: rgba(0, 113, 227, .18);

  /* 语义色（iOS systemGreen / Red / Orange） */
  --ok-bg: rgba(52, 199, 89, .14);    --ok-ink: #248a3d;
  --danger-bg: rgba(255, 59, 48, .12); --danger-ink: #d70015;
  --warn-bg: rgba(255, 149, 0, .15);   --warn-ink: #a35a00;

  /* 形状与阴影 */
  --radius: 18px;
  --radius-sm: 12px;
  --pill: 980px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, .04), 0 6px 18px rgba(0, 0, 0, .05);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .16);

  /* 导航毛玻璃 */
  --nav-bg: rgba(251, 251, 253, .72);
  --hero-1: #1d1d1f;
  --hero-2: #6e6e73;
  --container: 1000px;

  /* 科幻强调色（科技感统一色板） */
  --tech-1: #0a84ff;
  --tech-2: #bf5af2;
  --tech-3: #64d2ff;
  --tech-glow: rgba(10, 132, 255, .55);
  --grid-line: rgba(10, 132, 255, .085);
  --grid-line-fine: rgba(10, 132, 255, .05);

  /* 玻璃卡片（半透明，让背景科技层透出来） */
  --glass: rgba(255, 255, 255, .78);
  --glass-strong: rgba(255, 255, 255, .9);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --surface-3: #3a3a3c;

  --text: #f5f5f7;
  --text-2: #c7c7cc;
  --muted: #8e8e93;
  --hairline: rgba(255, 255, 255, .12);
  --border: rgba(255, 255, 255, .10);

  --primary: #0a84ff;
  --primary-hover: #3d9bff;
  --primary-ink: #ffffff;
  --ring: rgba(10, 132, 255, .32);

  --ok-bg: rgba(48, 209, 88, .16);     --ok-ink: #30d158;
  --danger-bg: rgba(255, 69, 58, .18); --danger-ink: #ff6961;
  --warn-bg: rgba(255, 159, 10, .18);  --warn-ink: #ffb340;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .6);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .7);

  --nav-bg: rgba(22, 22, 23, .72);
  --hero-1: #f5f5f7;
  --hero-2: #86868b;

  --tech-glow: rgba(10, 132, 255, .8);
  --grid-line: rgba(100, 210, 255, .13);
  --grid-line-fine: rgba(100, 210, 255, .075);

  --glass: rgba(28, 28, 30, .72);
  --glass-strong: rgba(28, 28, 30, .88);
}

/* ------------------------------ 基础 ------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  /* 底色 + 顶部蓝色氛围 + 扫描线（三层背景，科技感基底） */
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(10, 132, 255, .05), transparent 38%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .016) 0 1px, transparent 1px 3px);
  background-attachment: fixed, fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro SC",
    "PingFang SC", "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei",
    "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
}

/* ------------------------------ 科技感：极光背景 + 网格 + 扫描线 ------------------------------ */
/* 关键：body 自身背景必须保持透明/氛围色，
   否则 z-index 为负的 ::before/::after 会被整片盖住（之前「看不到科技感」的根因）。 */
/* 极光层：多色光晕，缓慢漂移 */
body::before {
  content: ""; position: fixed; inset: -25%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38% 46% at 14% 12%, rgba(10, 132, 255, .52), transparent 62%),
    radial-gradient(34% 42% at 88% 16%, rgba(191, 90, 242, .46), transparent 62%),
    radial-gradient(42% 46% at 76% 88%, rgba(48, 209, 88, .30), transparent 62%),
    radial-gradient(38% 44% at 18% 86%, rgba(255, 159, 10, .30), transparent 62%),
    radial-gradient(30% 34% at 52% 46%, rgba(100, 210, 255, .26), transparent 66%);
  filter: blur(38px);
  animation: aurora 26s ease-in-out infinite alternate;
}
/* 网格层：粗网格 + 细网格 + 中心径向遮罩 */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-fine) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 22%, #000 0%, rgba(0,0,0,.55) 55%, transparent 92%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 22%, #000 0%, rgba(0,0,0,.55) 55%, transparent 92%);
}
@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(2.5%, -2.5%, 0) scale(1.08) rotate(3deg); }
  100% { transform: translate3d(-2.5%, 2.5%, 0) scale(1.04) rotate(-3deg); }
}
[data-theme="dark"] body::before { opacity: .95; }
[data-theme="dark"] body {
  background-image:
    linear-gradient(180deg, rgba(10, 132, 255, .09), transparent 42%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .022) 0 1px, transparent 1px 3px);
}

/* 等宽数字（科技感数据展示） */
.cat-stats .num, .reply-pill b, .stat .num, .mono {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}

/* 页面进入动画 */
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
main.container { animation: pageIn .5s ease both; }

/* 滚动渐显（由 app.js 添加 .is-visible 触发） */
.js .reveal { opacity: 0; transform: translateY(18px); will-change: opacity, transform;
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* 悬停辉光（科技感） */
.js .cat-card:hover { transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--ring), 0 10px 34px var(--ring); }
.js .card:hover { box-shadow: 0 0 0 1px var(--border), var(--shadow-lg); }
.js .thread-row:hover { background: var(--surface-2); border-radius: 12px; }

/* 导航 Logo 徽标呼吸辉光 */
.js .logo-mark { animation: markPulse 4.5s ease-in-out infinite; }
@keyframes markPulse {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 0 10px rgba(10, 132, 255, .25); }
  50%      { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 0 22px rgba(10, 132, 255, .5); }
}

/* 分段控件（最新 / 热门） */
.seg { display: inline-flex; gap: 4px; padding: 4px; margin: 4px 0 16px;
  background: var(--surface-2); border-radius: 12px; box-shadow: var(--shadow-sm); }
.seg-item { padding: 8px 20px; border-radius: 9px; font-size: 14px; font-weight: 500;
  color: var(--text-2); transition: background .2s ease, color .2s ease; }
.seg-item:hover { color: var(--text); }
.seg-item.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* 主页「查看全部」行 */
.more-row { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--hairline); text-align: center; }
.more-row .btn-glass { display: inline-block; }

/* 子页 Hero（最新主题页） */
.hero-sm { padding: 28px 8px 12px; }
.hero-sm h1 { font-size: clamp(26px, 6vw, 36px); }
.hero-sm p { margin-bottom: 6px; font-size: 16px; }

/* 举报等次要文字链接 */
.link-muted {
  margin-left: auto; font-size: 13px; color: var(--muted);
  transition: color .18s ease;
}
.link-muted:hover { color: var(--danger-ink); }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 8px;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { letter-spacing: -.022em; line-height: 1.16; font-weight: 600; }
h2 { font-size: 21px; margin: 22px 0 12px; }
h3 { font-size: 18px; margin: 18px 0 10px; }
p { margin: 0 0 12px; }
::selection { background: var(--ring); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* 导航毛玻璃 + 底部科技光带 */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(10, 132, 255, .85), rgba(191, 90, 242, .6), transparent);
  pointer-events: none;
}

.topbar .container {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  height: 48px;
}

.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 600; letter-spacing: -.022em;
  color: var(--text);
}
.logo-mark {
  width: 26px; height: 26px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #0a84ff, #0060df);
  color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28);
}

.nav-toggle, .icon-btn {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-2);
  border-radius: 9px; cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.nav-toggle:hover, .icon-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-toggle:active, .icon-btn:active { background: var(--surface-3); }
.nav-toggle svg, .icon-btn svg { width: 19px; height: 19px; display: block; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }

/* 移动端：下拉毛玻璃面板 */
.nav {
  display: none;
  position: absolute; top: calc(100% + 6px); left: max(8px, env(safe-area-inset-left));
  right: max(8px, env(safe-area-inset-right));
  flex-direction: column;
  padding: 8px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
body.nav-open .nav { display: flex; animation: sheetIn .18s ease both; }
@keyframes sheetIn {
  from { opacity: 0; transform: translateY(-6px) scale(.99); }
  to   { opacity: 1; transform: none; }
}
.nav a {
  padding: 12px 14px; border-radius: 11px;
  font-size: 16px; color: var(--text);
}
.nav a:hover, .nav a:active { background: var(--surface-2); color: var(--text); }

/* ------------------------------ 内容区 ------------------------------ */
main.container { padding-top: 8px; padding-bottom: 56px; min-height: 62vh; }

.section-title {
  position: relative;
  font-size: 21px; font-weight: 600; letter-spacing: -.025em;
  margin: 30px 0 12px; color: var(--text);
  padding-left: 13px;
}
/* 标题前的科技竖光条 */
.section-title::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: .82em; border-radius: 2px;
  background: linear-gradient(180deg, var(--tech-1), var(--tech-2));
  box-shadow: 0 0 10px var(--tech-glow);
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 30px 0 12px;
}
.section-head .section-title { margin: 0; }
.section-head > a { font-size: 14px; color: var(--primary); }

/* ------------------------------ Hero ------------------------------ */
.hero {
  position: relative;
  padding: 30px 8px 22px;
  text-align: center;
  background: transparent;
  border: none; border-radius: 0; box-shadow: none;
  margin-bottom: 4px;
  overflow: hidden;
}
/* 科幻：Hero 顶部辉光 */
.hero-glow {
  position: absolute; left: 50%; top: -60px;
  width: min(760px, 98%); height: 300px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(10, 132, 255, .30), rgba(191, 90, 242, .14) 55%, transparent 72%);
  filter: blur(34px); pointer-events: none; z-index: 0;
  animation: heroGlow 9s ease-in-out infinite alternate;
}
@keyframes heroGlow {
  0%   { opacity: .7; transform: translateX(-50%) scale(1); }
  100% { opacity: 1;  transform: translateX(-50%) scale(1.08); }
}
.hero > * { position: relative; z-index: 1; }
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 7.2vw, 46px);
  font-weight: 700; letter-spacing: -.035em; line-height: 1.07;
  background: linear-gradient(180deg, var(--hero-1) 30%, var(--hero-2) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero p {
  max-width: 560px; margin: 0 auto 22px;
  font-size: 17px; line-height: 1.47; letter-spacing: -.01em;
  color: var(--muted);
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* 科幻：社区数据条 —— 三个 HUD 面板横向并排（主题 / 回复 / 成员） */
.hero-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; width: min(540px, 100%); margin: 26px auto 0;
}
.hero-stats .hs {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 15px 10px 13px;
  border-radius: 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
          backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--hairline);
  box-shadow: 0 0 0 1px rgba(10, 132, 255, .10), 0 12px 30px rgba(10, 132, 255, .14);
  transition: transform .22s ease, box-shadow .22s ease;
}
/* 面板顶部蓝色辉光 */
.hero-stats .hs::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 82% at 50% 0%, rgba(10, 132, 255, .24), transparent 64%);
}
.hero-stats .hs:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 0 1px rgba(10, 132, 255, .28), 0 16px 40px rgba(10, 132, 255, .26);
}
.hero-stats .hs .num {
  position: relative;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
  background: linear-gradient(180deg, #0a84ff, #0060df);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 10px rgba(10, 132, 255, .35));
}
.hero-stats .hs .lbl {
  position: relative;
  font-size: 12px; color: var(--muted); margin-top: 2px;
  letter-spacing: .04em;
}
/* 面板底部发光分隔线 */
.hero-stats .hs::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--tech-1), transparent);
  opacity: .75;
}
@media (max-width: 420px) {
  .hero-stats { gap: 8px; }
  .hero-stats .hs { padding: 12px 6px 10px; border-radius: 14px; }
  .hero-stats .hs .num { font-size: 23px; }
  .hero-stats .hs .lbl { font-size: 11px; }
}

/* ------------------------------ 卡片（玻璃 + 科技描边） ------------------------------ */
.card {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
          backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(10, 132, 255, .06);
}
/* 顶部一道科技感高光线 */
.card::before {
  content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(10, 132, 255, .55), transparent);
  pointer-events: none;
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card + .card { margin-top: 0; }

/* iOS 分组列表标题（卡片外的小字标签） */
.group-label {
  font-size: 12.5px; font-weight: 500; letter-spacing: .01em;
  color: var(--muted); margin: 22px 4px 7px;
}

/* ------------------------------ 版块卡片 ------------------------------ */
.cat-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.cat-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 13px;
  padding: 14px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
          backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(10, 132, 255, .07);
  color: var(--text);
  transition: box-shadow .2s ease, transform .2s ease, background .2s ease;
}
/* 左侧科技竖光条 */
.cat-card::before {
  content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 2px;
  background: linear-gradient(180deg, transparent, var(--tech-1), transparent);
  opacity: .6; transition: opacity .2s ease;
}
.cat-card:hover { color: var(--text); box-shadow: var(--shadow-md), 0 0 0 1px rgba(10, 132, 255, .2), 0 10px 30px rgba(10, 132, 255, .18); transform: translateY(-1px); }
.cat-card:hover::before { opacity: 1; }
.cat-card:active { transform: none; background: var(--surface-2); }

.cat-icon {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  font-size: 19px; font-weight: 600; color: #fff;
  background: linear-gradient(180deg, #0a84ff, #0060df);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.cat-body { flex: 1; min-width: 0; }
.cat-name { font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.cat-desc {
  margin-top: 1px; font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-stats { display: flex; gap: 20px; flex: none; }
.cat-stats .num { display: block; text-align: center; font-size: 16px; font-weight: 600; line-height: 1.2; }
.cat-stats .lbl { display: block; text-align: center; font-size: 11px; color: var(--muted); margin-top: 1px; }
.cat-meta { flex: none; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* iOS 系统色循环（图标） */
.cat-card:nth-child(6n+2) .cat-icon { background: linear-gradient(180deg, #30d158, #248a3d); }
.cat-card:nth-child(6n+3) .cat-icon { background: linear-gradient(180deg, #ff9f0a, #e07b00); }
.cat-card:nth-child(6n+4) .cat-icon { background: linear-gradient(180deg, #bf5af2, #8944ab); }
.cat-card:nth-child(6n+5) .cat-icon { background: linear-gradient(180deg, #ff375f, #d70015); }
.cat-card:nth-child(6n+6) .cat-icon { background: linear-gradient(180deg, #64d2ff, #0a84ff); }

/* ------------------------------ 主题列表 ------------------------------ */
.thread-list { display: flex; flex-direction: column; }
.thread-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  color: var(--text);
  border-radius: 0;
}
.thread-row + .thread-row { border-top: 1px solid var(--hairline); }
.thread-row:hover { color: var(--text); }
.thread-row:hover .thread-title { color: var(--primary); }
.thread-main { flex: 1; min-width: 0; }
.thread-title {
  font-size: 15px; font-weight: 500; letter-spacing: -.012em;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color .18s ease;
}
.thread-sub {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-top: 2px; font-size: 12.5px; color: var(--muted);
}
/* 元信息分隔点：窄屏换行时隐藏，避免「·」跑到行首 */
.thread-sub .sep { margin: 0 -1px; opacity: .65; }
@media (max-width: 430px) {
  .thread-sub { gap: 6px; }
  .thread-sub .sep { display: none; }
}
.cat-chip {
  padding: 1px 7px; border-radius: 6px;
  background: var(--surface-2); color: var(--muted);
  font-size: 11.5px; font-weight: 500;
}
.pin-tag {
  display: inline-block; margin-right: 5px; padding: 1px 6px;
  border-radius: 5px; vertical-align: 1px;
  background: var(--warn-bg); color: var(--warn-ink);
  font-size: 11px; font-weight: 600;
}
/* 热门标签：管理员审核添加的热度推荐位 */
.hot-tag {
  display: inline-block; margin-right: 5px; padding: 1px 7px;
  border-radius: 5px; vertical-align: 1px;
  background: linear-gradient(135deg, #ff9f0a, #ff375f);
  color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 0 10px rgba(255, 149, 10, .45);
}
/* 后台列表里的热门状态标签 */
.tag-hot {
  background: linear-gradient(135deg, #ff9f0a, #ff375f);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 149, 10, .35);
}
/* 版块发言权限标记：仅管理员可发帖/回复 */
.lock-tag {
  display: inline-block; margin-left: 7px; padding: 1px 7px;
  border-radius: 6px; vertical-align: 1px;
  background: rgba(10,132,255,.14); color: #0a84ff;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.lock-tag.sm { margin-left: 5px; padding: 0 4px; font-size: 11px; }
/* 帖子页管理员操作条 */
.admin-bar { padding: 10px 14px; margin-bottom: 14px; }
.reply-pill {
  flex: none; min-width: 44px; padding: 3px 8px;
  display: inline-flex; flex-direction: column; align-items: center;
  background: var(--surface-2); border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, .12);
}
.reply-pill b { font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--text); }
.reply-pill span { font-size: 10.5px; line-height: 1.2; color: var(--muted); }

/* ------------------------------ 头像 ------------------------------ */
.avatar {
  width: 40px; height: 40px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 15px; font-weight: 600; color: #fff;
  background: linear-gradient(180deg, #0a84ff, #0060df);
  user-select: none; overflow: hidden;
}
.avatar-sm { width: 40px; height: 40px; font-size: 15px; }
.thread-row:nth-child(5n+2) .avatar,
.post:nth-child(5n+2) .avatar { background: linear-gradient(180deg, #30d158, #248a3d); }
.thread-row:nth-child(5n+3) .avatar,
.post:nth-child(5n+3) .avatar { background: linear-gradient(180deg, #ff9f0a, #e07b00); }
.thread-row:nth-child(5n+4) .avatar,
.post:nth-child(5n+4) .avatar { background: linear-gradient(180deg, #bf5af2, #8944ab); }
.thread-row:nth-child(5n+5) .avatar,
.post:nth-child(5n+5) .avatar { background: linear-gradient(180deg, #ff375f, #d70015); }

/* ------------------------------ 按钮 ------------------------------ */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 9px 22px;
  border: none; border-radius: var(--pill);
  font-family: inherit; font-size: 15px; font-weight: 500; letter-spacing: -.01em;
  line-height: 1.2; cursor: pointer;
  color: var(--primary-ink); background: var(--primary);
  transition: background .2s ease, transform .1s ease, box-shadow .2s ease;
}
/* 按钮顶部高光 */
.btn::after {
  content: ""; position: absolute; left: 12%; right: 12%; top: 0; height: 1px;
  background: rgba(255, 255, 255, .5); pointer-events: none;
}
.btn:hover { background: var(--primary-hover); color: #fff; box-shadow: 0 0 0 1px var(--ring), 0 8px 26px rgba(10, 132, 255, .45); }
.btn:active { transform: scale(.975); }

.btn-sm { min-height: 32px; padding: 5px 14px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* 主按钮（蓝底） */
.btn-light { background: var(--primary); color: #fff; }
.btn-light:hover { background: var(--primary-hover); color: #fff; }

/* 次级文字按钮（Apple「了解更多 ›」） */
.btn-glass, .btn-link {
  background: transparent; color: var(--primary);
  padding-left: 10px; padding-right: 10px;
}
.btn-glass::after, .btn-link::after {
  content: "›"; font-size: 19px; line-height: 1; transform: translateY(-1px);
}
.btn-glass:hover, .btn-link:hover { background: transparent; color: var(--primary-hover); }
.btn-glass:active, .btn-link:active { transform: none; opacity: .6; }

/* 灰色次级按钮（iOS gray） */
.btn-ghost {
  background: var(--surface-2); color: var(--text);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: #ff3b30; color: #fff; }
.btn-danger:hover { background: #ff453a; color: #fff; }

/* ------------------------------ 表单 ------------------------------ */
input[type=text], input[type=password], input[type=email],
input[type=number], input[type=search], textarea, select {
  width: 100%; min-height: 44px; padding: 11px 14px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  font-family: inherit; font-size: 16px; letter-spacing: -.01em;
  -webkit-appearance: none; appearance: none;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { min-height: 150px; resize: vertical; line-height: 1.6; }

/* 复选框行（处罚面板等） */
.check-line {
  display: flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 500; color: var(--text);
  cursor: pointer; margin-bottom: 4px;
}
.check-line input[type=checkbox] {
  width: 18px; height: 18px; min-height: 0; flex: none;
  accent-color: var(--primary); cursor: pointer;
}
select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2386868b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 7px;
  font-size: 13px; font-weight: 500; color: var(--muted);
}
.hint { color: var(--muted); font-size: 13.5px; }

/* ------------------------------ 登录验证码 ------------------------------ */
.captcha-box {
  display: flex; align-items: center; gap: 10px;
}
.captcha-img {
  height: 46px; width: 124px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); cursor: pointer; flex: 0 0 auto;
  background: var(--surface);
}
.captcha-box input { flex: 1 1 auto; }
.captcha-math {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 124px; height: 46px; padding: 0 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); font-size: 16px; font-weight: 600; color: var(--text);
  flex: 0 0 auto;
}
.link-btn {
  margin-top: 8px; padding: 4px 2px; border: none; background: none;
  color: var(--primary); font-size: 13px; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

.center-box { max-width: 400px; margin: 24px auto; }

.alert {
  padding: 12px 15px; margin-bottom: 14px;
  border-radius: var(--radius-sm);
  font-size: 14px; border: none;
}
.alert-err { background: var(--danger-bg); color: var(--danger-ink); }
.alert-ok  { background: var(--ok-bg);  color: var(--ok-ink); }

/* ------------------------------ 分页 ------------------------------ */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 18px; }
.pagination a, .pagination span {
  min-width: 38px; min-height: 38px; padding: 6px 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--pill);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.pagination a:hover { color: var(--primary); background: var(--surface); }
.pagination .cur { background: var(--primary); color: #fff; box-shadow: none; }

/* ------------------------------ 帖子 / 回复 ------------------------------ */
.post {
  position: relative;
  padding: 14px 0 14px 14px;
  border-radius: 12px;
  transition: background .2s ease, box-shadow .2s ease;
}
/* 回复贴左侧科技光条 */
.post::before {
  content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, transparent, rgba(10, 132, 255, .5), transparent);
  opacity: .55; transition: opacity .2s ease, top .2s ease, bottom .2s ease;
}
.post:hover {
  background: var(--surface-2);
  box-shadow: 0 0 0 1px rgba(10, 132, 255, .1);
}
.post:hover::before { opacity: 1; top: 8px; bottom: 8px; }
.post + .post { border-top: 1px solid var(--hairline); }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.post-author { font-size: 15px; font-weight: 600; }
.post-author a { color: var(--text); }
.post-author a:hover { color: var(--primary); }
.post-time { font-size: 12.5px; color: var(--muted); }
.post-body {
  color: var(--text-2); font-size: 16px; line-height: 1.62;
  letter-spacing: -.011em;
  word-break: break-word; overflow-wrap: anywhere;
}
.post-body code {
  padding: 1px 6px; border-radius: 6px;
  background: var(--surface-2); color: var(--text);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
}
.thread-op .post-body { color: var(--text); }
.thread-op h2 { font-size: 24px; letter-spacing: -.028em; line-height: 1.22; margin-bottom: 14px; }
.thread-meta-bar { display: flex; gap: 14px; margin-top: 12px; font-size: 13px; color: var(--muted); }

.footer {
  padding: 26px 16px calc(30px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
  text-align: center; font-size: 12.5px; color: var(--muted);
}
.footer .container { padding-left: 16px; padding-right: 16px; }

/* ------------------------------ 后台 ------------------------------ */
.admin-bar {
  position: sticky; top: 0; z-index: 60;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.admin-bar .container {
  display: flex; align-items: center; gap: 2px;
  min-height: 50px; padding-top: 6px; padding-bottom: 6px;
  flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.admin-bar .container::-webkit-scrollbar { display: none; }
.admin-bar a {
  padding: 7px 12px; border-radius: 9px; white-space: nowrap;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  transition: background .18s ease, color .18s ease;
}
.admin-bar a:hover { background: var(--surface-2); color: var(--text); }
.admin-bar a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.admin-bar .spacer { flex: 1; }

/* ------------------------------ 表格（后台） ------------------------------ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
table.tbl { width: 100%; min-width: 580px; border-collapse: collapse; background: transparent; }
table.tbl th, table.tbl td {
  padding: 12px 14px; text-align: left;
  font-size: 14px; color: var(--text);
  border-bottom: 1px solid var(--hairline);
}
table.tbl th {
  background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  white-space: nowrap;
}
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--surface-2); }

/* 已删除的行（回收站）：整行淡化，与正常内容明显区分 */
table.tbl tbody tr.row-deleted td {
  color: var(--muted);
  background: repeating-linear-gradient(
    135deg,
    transparent, transparent 9px,
    rgba(128, 128, 128, .05) 9px, rgba(128, 128, 128, .05) 18px
  );
}
table.tbl tbody tr.row-deleted:hover td { background: var(--surface-2); }
table.tbl tbody tr.row-deleted td .tag { font-weight: 600; }

/* ------------------------------ 统计卡 ------------------------------ */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  padding: 18px 14px; text-align: center;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat .num {
  font-size: 28px; font-weight: 600; line-height: 1.1; letter-spacing: -.03em;
  color: var(--text);
}
.stat .lbl { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.stat:nth-child(4n+1) .num { color: #0071e3; }
.stat:nth-child(4n+2) .num { color: #34c759; }
.stat:nth-child(4n+3) .num { color: #ff9f0a; }
.stat:nth-child(4n+4) .num { color: #bf5af2; }

/* ------------------------------ 标签 ------------------------------ */
.tag {
  padding: 2px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  vertical-align: 2px;
}
.tag-ok    { background: var(--ok-bg);     color: var(--ok-ink); }
.tag-off   { background: var(--danger-bg); color: var(--danger-ink); }
.tag-admin { background: var(--warn-bg);   color: var(--warn-ink); }

/* 主页 UID 标识：等宽字体 + 微弱描边，任何隐私设置下都展示 */
.uid-tag {
  display: inline-block;
  padding: 1px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--primary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  vertical-align: 1px;
}
.stat .num.uid-num { font-size: 22px; letter-spacing: .06em; }

/* iOS 风格开关（个人信息公开 / 仅自己可见） */
.switch input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  position: relative; width: 46px; height: 28px; margin: 0;
  border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: background .25s ease, border-color .25s ease;
}
.switch input[type="checkbox"]::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}
.switch input[type="checkbox"]:checked { background: #34c759; border-color: #34c759; }
.switch input[type="checkbox"]:checked::after { transform: translateX(18px); }
.switch input[type="checkbox"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch span { font-size: 13.5px; color: var(--text); }

/* 蓝色认证 V（管理员）：名字后自动出现 */
.v-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 4px;
  border-radius: 50%; background: #0a84ff; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  vertical-align: 1px;
  box-shadow: 0 0 0 2px var(--surface), 0 0 10px rgba(10, 132, 255, .5);
}
/* 深色模式下描边用表面色，保持清晰 */
[data-theme="dark"] .v-badge { box-shadow: 0 0 0 2px var(--surface), 0 0 12px rgba(10, 132, 255, .65); }

/* 头像图片（上传后显示） */
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-lg { width: 72px; height: 72px; font-size: 28px; }
.avatar-xs { width: 26px; height: 26px; font-size: 12px; }

/* 导航栏用户名 + 小头像 */
.nav-user { display: inline-flex; align-items: center; gap: 7px; }
.nav-user .avatar-xs { flex: none; }

/* 蓝 V 字 */
.v-badge { font-family: -apple-system, "SF Pro", "Segoe UI", system-ui, sans-serif; }

/* ------------------------------ 安全中心 ------------------------------ */
.sec-center { padding: 6px 0; }
.sec-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.sec-row:last-child { border-bottom: none; }
.sec-label { min-width: 120px; }
.sec-title { font-weight: 600; }
.sec-ctrl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1; }
.sec-ctrl input[type="text"],
.sec-ctrl input[type="email"],
.sec-ctrl input[type="password"],
.sec-ctrl input[type="file"] { max-width: 320px; }
.sec-pass-ctrl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; }
.sec-pass-ctrl input[type="password"] { width: 150px; }
@media (max-width: 560px) {
  .sec-row { gap: 10px; }
  .sec-label { min-width: 0; width: 100%; }
  .sec-ctrl input[type="text"],
  .sec-ctrl input[type="email"],
  .sec-ctrl input[type="password"],
  .sec-ctrl input[type="file"] { max-width: 100%; }
  .sec-pass-ctrl input[type="password"] { width: 100%; }
}

/* ------------------------------ 后台行内表单 ------------------------------ */
.form-row { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: end; }
/* 处罚面板：三列（处罚方式 / 时长 / 原因），窄屏自动堆叠 */
.form-grid-3 { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: end; }

/* =========================================================================
   平板 / 桌面（≥768px）
   ========================================================================= */
@media (min-width: 768px) {
  body { font-size: 15px; }
  .container { padding-left: 24px; padding-right: 24px; }

  .topbar .container { height: 52px; }
  .nav-toggle { display: none; }
  .nav {
    display: flex; position: static; flex-direction: row; align-items: center;
    margin-left: auto; padding: 0;
    background: transparent; border: none; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .nav a {
    margin-left: 2px; padding: 6px 11px; border-radius: 8px;
    font-size: 13.5px; color: var(--text-2);
  }
  .nav a:hover { background: var(--surface-2); color: var(--text); }
  .topbar-actions { margin-left: 8px; }

  main.container { padding-top: 18px; }
  .hero { padding: 40px 8px 32px; }
  .hero p { font-size: 19px; }
  .card { padding: 20px; }
  .cat-list { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .stat .num { font-size: 34px; }
  .center-box { margin: 48px auto; }
  .form-row { grid-template-columns: 1fr 2fr 100px auto; }
  .form-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .section-title { font-size: 24px; }
  .thread-row { padding: 12px 0; }
}

@media (min-width: 1024px) {
  .hero { padding: 48px 8px 38px; }
}

@media (min-width: 1440px) {
  :root { --container: 1080px; }
}

/* 手机端微调：避免窄屏横向溢出 */
@media (max-width: 767px) {
  .cat-list { gap: 10px; }
  .cat-stats { gap: 12px; }
  .cat-stats .num { font-size: 15px; }
  .thread-title { font-size: 14.5px; }
  .thread-op h2 { font-size: 21px; }
  h2 { font-size: 20px; }
  .section-title { font-size: 19px; }
}

@media (max-width: 420px) {
  .cat-card { padding: 13px; gap: 11px; }
  .cat-stats { gap: 12px; }
  .cat-stats .num { font-size: 14.5px; }
  .cat-stats .lbl { font-size: 10.5px; }
  .cat-desc { max-width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  main.container { animation: none !important; }
}

/* ==========================================================================
   PWA / App 形态
   ========================================================================== */

/* ------------------------------ 移动端底部标签栏 ------------------------------ */
.tabbar { display: none; }

@media (max-width: 767px) {
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    display: flex; align-items: flex-end; justify-content: space-around;
    padding-left: max(6px, env(safe-area-inset-left));
    padding-right: max(6px, env(safe-area-inset-right));
    padding-top: 6px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    background: var(--nav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    backdrop-filter: saturate(180%) blur(22px);
    border-top: 1px solid var(--hairline);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .06);
  }
  .tabbar a {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 0 5px; border-radius: 12px;
    font-size: 10.5px; font-weight: 500; letter-spacing: 0;
    color: var(--muted); text-decoration: none;
    transition: color .18s ease, background .18s ease, transform .18s ease;
  }
  .tabbar a:active { transform: scale(.94); background: var(--surface-2); }
  .tabbar a.active { color: var(--primary); }
  .tabbar svg { width: 23px; height: 23px; display: block; }
  .tabbar a.active svg { filter: drop-shadow(0 0 6px var(--ring)); }

  /* 中间「发帖」：渐变圆底，最像原生 App 的一颗按钮 */
  .tabbar .tab-post svg {
    width: 27px; height: 27px; padding: 5px; border-radius: 50%;
    color: #fff; background: linear-gradient(180deg, #0a84ff, #0060df);
    box-shadow: 0 4px 12px rgba(10, 132, 255, .38);
  }
  .tabbar .tab-post.active svg { color: #fff; }
  .tabbar .tab-post.active { color: var(--primary); }

  /* 给标签栏让位，避免遮住正文与版权行 */
  main.container { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .footer { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ------------------------------ 安装引导浮层 ------------------------------ */
.pwa-sheet {
  display: none; position: fixed; z-index: 90;
  left: 50%; bottom: calc(16px + env(safe-area-inset-bottom));
  width: min(430px, calc(100% - 24px));
  transform: translateX(-50%);
}
.pwa-sheet.show { display: block; animation: pwaIn .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pwaIn {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (max-width: 767px) {
  .pwa-sheet { bottom: calc(88px + env(safe-area-inset-bottom)); }
}
.pwa-card {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.pwa-icon img { width: 44px; height: 44px; border-radius: 12px; display: block; }
.pwa-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.pwa-text strong { font-size: 14px; color: var(--text); }
.pwa-text span { font-size: 11.5px; color: var(--muted); }
.pwa-install { flex: none; min-height: 34px; padding: 6px 16px; font-size: 13.5px; }
.pwa-close {
  width: 26px; height: 26px; flex: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 8px; background: transparent;
  color: var(--muted); cursor: pointer;
}
.pwa-close:hover { background: var(--surface-2); color: var(--text); }
.pwa-close svg { width: 14px; height: 14px; }

/* ------------------------------ 已安装（独立窗口）形态 ------------------------------ */
/* 安装后不再提示安装 */
html.standalone .pwa-sheet { display: none !important; }
/* 独立运行时顶栏贴住状态栏，避免刘海/圆角遮挡 */
html.standalone .topbar { padding-top: env(safe-area-inset-top); }
