/* ==========================================================================
   天使会 · iOS 版（Web App）
   设计令牌与 app/ios/LinxiApp/DesignSystem/Palette.swift 一一对应。
   改这里之前先改 Palette.swift —— 双端必须同源，否则 iOS 原生版与 Web 版会
   在色值、圆角、间距上产生肉眼可见的偏差，且没有任何测试能发现。
   ========================================================================== */

:root {
  /* 品牌 */
  --brand-050: #F2F6FC;
  --brand-100: #E3EDF9;
  --brand-200: #C4D8F2;
  --brand-300: #93B5E6;
  --brand-400: #5A8DD4;
  --brand-500: #2A64B8;
  --brand-600: #1A4D96;
  --brand-700: #123C74;
  --brand-900: #0A1F3C;

  /* 金 */
  --accent-050: #FDF6E9;
  --accent-200: #F6E6C6;
  --accent-500: #D49A34;
  --accent-700: #8A5A10;

  /* 语义（浅色） */
  --success: #1A7F4B;
  --success-bg: #E6F4EC;
  --warning: #B46A08;
  --warning-bg: #FDF1DF;
  --danger: #C62828;
  --danger-bg: #FBE9E9;
  --info: #0E6E8C;
  --info-bg: #E4F2F7;

  /* 语义色板（浅色，对应 Palette.light） */
  --bg: #F9FAFB;
  --surface: #FFFFFF;
  --surface-alt: #F3F4F6;
  --border: #E5E7EB;
  --t1: #111827;
  --t2: #374151;
  --t3: #6B7280;
  --primary: #1A4D96;
  --on-primary: #FFFFFF;
  --accent: #D49A34;
  --accent-text: #8A5A10;
  /* 派生色：显式给出，不依赖 color-mix（iOS 16.4 以下不认，会退化成透明） */
  --primary-soft: rgba(26, 77, 150, .10);
  --primary-glow: rgba(26, 77, 150, .18);
  --primary-veil: rgba(26, 77, 150, .13);
  --surface-veil-88: rgba(255, 255, 255, .88);
  --surface-veil-92: rgba(255, 255, 255, .92);
  --danger-line: rgba(198, 40, 40, .34);

  /* 间距 / 圆角（对应 Lx.s1…s8 / rSm…rXl） */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s8: 32px;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 18px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  /* 外壳（桌面端舞台背景，跟随站点深色风格，不属于 App UI） */
  --stage-bg: #0A0F1A;
  --stage-panel: #111A2B;
  --stage-border: #1E2A40;
  --stage-text: #E7EDF7;
  --stage-text2: #94A3B8;
}

/* 深色：对应 Palette.dark */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1220;
    --surface: #131C2E;
    --surface-alt: #1B2740;
    --border: #263349;
    --t1: #F1F5F9;
    --t2: #A8B4C7;
    --t3: #71809A;
    --primary: #5A8DD4;
    --on-primary: #0B1220;
    --accent: #E0AC4E;
    --accent-text: #F6E6C6;
    --primary-soft: rgba(90, 141, 212, .16);
    --primary-glow: rgba(90, 141, 212, .22);
    --primary-veil: rgba(90, 141, 212, .18);
    --surface-veil-88: rgba(19, 28, 46, .88);
    --surface-veil-92: rgba(19, 28, 46, .92);
    --danger-line: rgba(248, 113, 113, .38);

    --success: #3DB27A;
    --success-bg: rgba(61, 178, 122, .16);
    --warning: #E0AC4E;
    --warning-bg: rgba(224, 172, 78, .16);
    --danger: #F87171;
    --danger-bg: rgba(248, 113, 113, .16);
    --info: #93B5E6;
    --info-bg: rgba(147, 181, 230, .16);
  }
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font);
  background: var(--stage-bg);
  color: var(--stage-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ==========================================================================
   桌面舞台：左说明 + 右手机
   ========================================================================== */

.stage {
  min-height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 56px;
  padding: 40px 32px 56px;
  max-width: 1180px;
  margin: 0 auto;
}

.panel {
  width: 380px;
  flex: 0 0 auto;
  padding-top: 8px;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--brand-600), var(--brand-700));
  color: var(--accent-200);
  display: grid; place-items: center;
  font-weight: 700; font-size: 17px;
  border: 1px solid rgba(246, 230, 198, .22);
}

.brand-text { font-size: 15px; font-weight: 650; letter-spacing: -.2px; }
.brand-text small { color: var(--stage-text2); font-weight: 400; font-size: 12px; }

.panel h1 {
  font-size: 27px;
  line-height: 1.28;
  letter-spacing: -.6px;
  margin: 0 0 12px;
  font-weight: 760;
}

.panel .lede {
  color: var(--stage-text2);
  font-size: 13.5px;
  line-height: 1.72;
  margin: 0 0 22px;
}

.panel .lede b { color: var(--stage-text); font-weight: 600; }

.install-steps {
  background: var(--stage-panel);
  border: 1px solid var(--stage-border);
  border-radius: 13px;
  padding: 16px 17px;
  margin-bottom: 20px;
}

.install-steps h2 {
  font-size: 12px;
  letter-spacing: .04em;
  /* 不要 uppercase：这里会出现 iPhone 这类产品名，转大写会变成 IPHONE */
  color: var(--stage-text2);
  margin: 0 0 12px;
  font-weight: 600;
}

.install-steps ol {
  margin: 0; padding: 0; list-style: none;
  counter-reset: step;
}

.install-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 28px;
  font-size: 13px;
  line-height: 1.62;
  color: var(--stage-text);
  margin-bottom: 9px;
}

.install-steps li:last-child { margin-bottom: 0; }

.install-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 1px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid; place-items: center;
}

.install-steps li span { color: var(--stage-text2); }

.honest-note {
  border-left: 2px solid var(--accent-500);
  padding: 2px 0 2px 12px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--stage-text2);
  margin-bottom: 22px;
}

.honest-note b { color: var(--accent-200); font-weight: 600; }

.screen-index h2 {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--stage-text2);
  margin: 0 0 10px;
  font-weight: 600;
}

.idx-group { margin-bottom: 14px; }

.idx-group > .g-name {
  font-size: 11px;
  color: #64748B;
  margin-bottom: 6px;
  letter-spacing: .02em;
}

.idx-chips { display: flex; flex-wrap: wrap; gap: 5px; }

.idx-chip {
  font-size: 11.5px;
  line-height: 1;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--stage-panel);
  border: 1px solid var(--stage-border);
  color: var(--stage-text2);
  cursor: pointer;
  transition: all .12s;
  user-select: none;
}

.idx-chip:hover { border-color: var(--brand-500); color: var(--stage-text); }
.idx-chip.on { background: var(--brand-600); border-color: var(--brand-500); color: #fff; }

/* ==========================================================================
   iPhone 外框
   ========================================================================== */

.device-wrap {
  flex: 0 0 auto;
  position: sticky;
  top: 40px;
}

.device {
  width: 393px;
  height: 852px;
  border-radius: 54px;
  background: #06080D;
  border: 11px solid #1B222E;
  box-shadow:
    0 0 0 1.5px #2C3543,
    0 34px 90px -18px rgba(0, 0, 0, .86),
    0 0 120px -40px rgba(90, 141, 212, .34);
  position: relative;
  overflow: hidden;
}

/* 灵动岛 */
.device::before {
  content: "";
  position: absolute;
  top: 11px; left: 50%;
  transform: translateX(-50%);
  width: 122px; height: 33px;
  background: #05070B;
  border-radius: 20px;
  z-index: 60;
  pointer-events: none;
}

/* 屏幕本体 */
.screen {
  position: absolute;
  inset: 0;
  border-radius: 43px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

/* 状态栏 / 导航栏 / TabBar 之外的滚动区 */
.view {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--bg);
  padding-bottom: 8px;
}

.view::-webkit-scrollbar { width: 0; height: 0; }

/* ==========================================================================
   状态栏
   ========================================================================== */

.statusbar {
  flex: 0 0 auto;
  height: 52px;
  padding: 15px 30px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14.5px;
  font-weight: 620;
  color: var(--t1);
  background: var(--bg);
  letter-spacing: .01em;
  position: relative;
  z-index: 50;
}

.statusbar .sb-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.statusbar svg { display: block; }

/* ==========================================================================
   导航栏
   ========================================================================== */

.navbar {
  flex: 0 0 auto;
  height: 46px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border-bottom: .5px solid var(--border);
  position: relative;
  z-index: 40;
}

.navbar.hidden { display: none; }
.navbar .nav-title {
  font-size: 16.5px;
  font-weight: 640;
  color: var(--t1);
  letter-spacing: -.2px;
  flex: 1 1 auto;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navbar .nav-title.left { text-align: left; padding-left: 2px; }

.nav-btn {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: none; background: transparent;
  color: var(--primary);
  cursor: pointer;
  border-radius: 9px;
  padding: 0;
}

.nav-btn:active { background: var(--surface-alt); }
.nav-btn.accent { color: var(--t2); font-size: 13.5px; width: auto; padding: 0 8px; }

.nav-spacer { width: 34px; flex: 0 0 auto; }

/* ==========================================================================
   TabBar
   ========================================================================== */

.tabbar {
  flex: 0 0 auto;
  display: flex;
  background: var(--surface-veil-88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--border);
  padding: 7px 0 calc(9px + env(safe-area-inset-bottom, 0px));
}

.tabbar.hidden { display: none; }

.tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--t3);
  font-size: 9.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  letter-spacing: .01em;
}

.tab.on { color: var(--primary); }
.tab svg { width: 23px; height: 23px; }

/* ==========================================================================
   通用 UI 组件
   ========================================================================== */

.page { padding: var(--s4) var(--s4) var(--s6); }

.page-tight { padding: var(--s3) var(--s4) var(--s6); }

.card {
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  margin-bottom: 10px;
}

.card.flush { padding: 0; overflow: hidden; }
.card.row { display: flex; align-items: center; gap: 12px; }

/* 工商核验的材料卡片。
   这里**不能**叫 .panel —— 桌面端左侧那块「说明与安装引导」就叫 .panel，
   而 @media (max-width: 900px) 与 body.standalone 都会把它 display:none。
   同名会让材料卡片在**所有手机宽度和主屏幕模式**下一并被隐藏：
   页面只剩横幅与进度条，四项材料一个都看不见（真机上必现，桌面预览看不到）。 */
.mat-card {
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 14px;
  font-weight: 640;
  color: var(--t1);
  margin-bottom: 3px;
  letter-spacing: -.1px;
}

.card-sub { font-size: 12px; color: var(--t3); line-height: 1.6; }

.sec-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--t3);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 18px 2px 8px;
}

.sec-title:first-child { margin-top: 2px; }

.row-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: .5px solid var(--border);
  cursor: pointer;
}

.row-line:last-child { border-bottom: none; }
.row-line:active { background: var(--surface-alt); }

.row-main { flex: 1 1 auto; min-width: 0; }
.row-t { font-size: 13.5px; color: var(--t1); font-weight: 520; }
.row-s { font-size: 11.5px; color: var(--t3); margin-top: 2px; line-height: 1.5; }
.row-r { flex: 0 0 auto; text-align: right; font-size: 12px; color: var(--t3); }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* 芯片 / 徽标 */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  line-height: 1;
  padding: 4.5px 7px;
  border-radius: 5px;
  font-weight: 550;
  white-space: nowrap;
}

.chip.gray { background: var(--surface-alt); color: var(--t2); }
.chip.brand { background: var(--primary-soft); color: var(--primary); }
.chip.ok { background: var(--success-bg); color: var(--success); }
.chip.warn { background: var(--warning-bg); color: var(--warning); }
.chip.bad { background: var(--danger-bg); color: var(--danger); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.gold { background: var(--accent-050); color: var(--accent-700); }

@media (prefers-color-scheme: dark) {
  .chip.gold { background: rgba(224, 172, 78, .16); color: var(--accent-text); }
}

/* 按钮 */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--r-md);
  border: none;
  font-size: 14.5px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  letter-spacing: -.1px;
  transition: opacity .12s;
}

.btn:active { opacity: .78; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-ghost { background: var(--surface-alt); color: var(--t1); }
.btn-line { background: transparent; color: var(--primary); border: 1px solid var(--border); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger-line); }
.btn-sm { width: auto; padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .42; pointer-events: none; }

/* 指标 */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.metric {
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 10px;
}

.metric .mv {
  font-size: 19px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -.5px;
  line-height: 1.15;
}

.metric .mv small { font-size: 11px; font-weight: 500; color: var(--t3); margin-left: 1px; }
.metric .ml { font-size: 10.5px; color: var(--t3); margin-top: 3px; }

/* 进度条 */
.bar { height: 6px; border-radius: 3px; background: var(--surface-alt); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
.bar.ok > i { background: var(--success); }
.bar.warn > i { background: var(--warning); }
.bar.bad > i { background: var(--danger); }

/* 评分环 */
.ring-wrap { display: flex; align-items: center; gap: 16px; }

.ring { width: 82px; height: 82px; flex: 0 0 auto; position: relative; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .ring-txt {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 750;
  color: var(--t1); letter-spacing: -.8px;
}
.ring .ring-txt small { font-size: 10px; color: var(--t3); font-weight: 500; margin-left: 1px; }

/* 维度条 */
.dim { margin-bottom: 11px; }
.dim-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 5px; }
.dim-name { font-size: 12.5px; color: var(--t1); font-weight: 540; flex: 1 1 auto; }
.dim-score { font-size: 12.5px; color: var(--t2); font-weight: 640; }
.dim-meta { font-size: 10.5px; color: var(--t3); margin-top: 4px; line-height: 1.55; }

/* 雷达图 */
.radar { display: block; margin: 0 auto; }

/* 空态 / 错误态 */
.state {
  padding: 46px 24px;
  text-align: center;
  color: var(--t3);
  font-size: 13px;
  line-height: 1.7;
}

.state .st-icon { font-size: 26px; margin-bottom: 10px; opacity: .5; }
.state .st-title { color: var(--t1); font-size: 14.5px; font-weight: 600; margin-bottom: 6px; }

.skel {
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border) 37%, var(--surface-alt) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  border-radius: 6px;
  height: 12px;
}

@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 表单 */
.field {
  width: 100%;
  padding: 12px 13px;
  border-radius: var(--r-md);
  border: .5px solid var(--border);
  background: var(--surface);
  color: var(--t1);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
}

.field:focus { border-color: var(--primary); }
.field::placeholder { color: var(--t3); }

/* 提示条 */
.banner {
  /* 原来是 display:flex（本该留给「图标 + 文字」两栏），但全站 banner 都只有文字。
     代价是：文字里只要有 <b>，它就成了独立 flex 项，被逐字挤成竖排
     （「升级不改认证状态」直接变成三列竖字）。没有图标就别用 flex。 */
  display: block;
  padding: 11px 13px;
  border-radius: var(--r-md);
  font-size: 12px;
  line-height: 1.62;
  margin-bottom: 10px;
}

/* 真需要「图标 + 文字」两栏时显式加这个类，别改回全局 flex */
.banner.row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.banner.warn { background: var(--warning-bg); color: var(--warning); }
.banner.ok { background: var(--success-bg); color: var(--success); }
.banner.bad { background: var(--danger-bg); color: var(--danger); }
.banner.info { background: var(--info-bg); color: var(--info); }

/* 作者样式永远压过 UA 的 [hidden]{display:none}（哪怕类选择器 specificity 相同），
   所以 .banner{display:block} 会把 hidden 属性整个吃掉 —— 分销中心里
   「二维码生成失败」的兜底提示在二维码正常时也一直挂着，就是这个原因。
   全局兜底一次，不再逐类打补丁。 */
[hidden] { display: none !important; }

/* 登录页 */
.login-page {
  min-height: 100%;
  padding: 0 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(120% 62% at 50% 0%, var(--primary-veil) 0%, transparent 62%),
    var(--bg);
}

.login-logo {
  width: 62px; height: 62px;
  border-radius: 16px;
  background: linear-gradient(150deg, var(--brand-600), var(--brand-800, #0E2B54));
  display: grid; place-items: center;
  color: var(--accent-200);
  font-size: 28px; font-weight: 700;
  margin-bottom: 20px;
  box-shadow: 0 10px 26px -10px rgba(26, 77, 150, .6);
}

.login-title { font-size: 25px; font-weight: 760; color: var(--t1); letter-spacing: -.7px; margin: 0 0 7px; }
.login-sub { font-size: 13px; color: var(--t3); line-height: 1.66; margin: 0 0 26px; }

.role-pick { display: flex; gap: 7px; margin-bottom: 12px; }

.role-opt {
  flex: 1 1 0;
  padding: 9px 6px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--t2);
  font-size: 12.5px;
  font-family: var(--font);
  cursor: pointer;
  transition: all .13s;
  text-align: center;
}

.role-opt.on {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.login-legal {
  font-size: 10.5px;
  color: var(--t3);
  line-height: 1.72;
  text-align: center;
  margin-top: 18px;
}

.login-legal a { color: var(--primary); text-decoration: none; }

/* 协议正文 */
.doc-section { margin-bottom: 18px; }
.doc-h { font-size: 13.5px; font-weight: 640; color: var(--t1); margin-bottom: 6px; }
.doc-p { font-size: 12.5px; color: var(--t2); line-height: 1.78; margin: 0 0 7px; }
.doc-p strong { color: var(--t1); font-weight: 620; }

/* 我的页 */
.profile-card {
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
}

.avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--brand-500), var(--brand-700));
  color: #fff;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 600;
  flex: 0 0 auto;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }

.menu-list { background: var(--surface); border: .5px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }

.menu-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12.5px 14px;
  border-bottom: .5px solid var(--border);
  cursor: pointer;
  background: none;
  border-left: none; border-right: none; border-top: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.menu-row:last-child { border-bottom: none; }
.menu-row:active { background: var(--surface-alt); }
.menu-row .mr-t { flex: 1 1 auto; font-size: 13.5px; color: var(--t1); }
.menu-row .mr-r { font-size: 11.5px; color: var(--t3); }

.chev { color: var(--t3); flex: 0 0 auto; opacity: .65; }

/* 项目卡片 */
.proj-card {
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 13px 14px;
  margin-bottom: 9px;
  cursor: pointer;
}

.proj-card:active { background: var(--surface-alt); }
.proj-head { display: flex; align-items: flex-start; gap: 8px; }
.proj-name { font-size: 14px; font-weight: 640; color: var(--t1); flex: 1 1 auto; letter-spacing: -.1px; }
.proj-meta { font-size: 11.5px; color: var(--t3); margin-top: 4px; line-height: 1.55; }
.proj-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; flex-wrap: wrap; }

/* 分数徽标 */
.score-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-size: 15px;
  font-weight: 720;
  color: var(--primary);
  letter-spacing: -.4px;
}

/* 时间轴 */
/* —— 甘特图（方案 EP9 US-9.1）—— */
/* 轨道用 flex + position:absolute 的条：条的位置按真实日期比例算，
   不是等分排列，所以「并行」与「空档」在图上能看出来。 */
.gantt { position: relative; }
.gantt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.gantt-row:last-child { margin-bottom: 0; }
.gantt-name { flex: 0 0 116px; font-size: 11.5px; color: var(--t1); line-height: 1.35; min-width: 0; }
.gantt-meta { font-size: 9.5px; color: var(--t3); margin-top: 2px; line-height: 1.4; }
.gantt-track { flex: 1 1 auto; position: relative; height: 22px; min-width: 0;
  background: var(--surface-alt); border-radius: 6px; }
.gantt-bar { position: absolute; top: 3px; height: 16px; border-radius: 5px;
  display: flex; align-items: center; overflow: hidden; }
.gantt-bar-t { font-size: 9.5px; color: #fff; padding: 0 5px; white-space: nowrap; }
.gantt-axis { position: relative; height: 15px; margin: 12px 0 5px; }
.gantt-tick { position: absolute; font-size: 9.5px; color: var(--t3);
  transform: translateX(-50%); white-space: nowrap; }

.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 1.5px;
  background: var(--border);
}

.tl-item { position: relative; margin-bottom: 15px; }

.tl-item::before {
  content: "";
  position: absolute;
  left: -19px; top: 4px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
}

.tl-item.done::before { background: var(--success); border-color: var(--success); }
.tl-item.now::before { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* 消息气泡 */
.msg { display: flex; margin-bottom: 11px; }
.msg .bubble {
  max-width: 74%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.6;
}

.msg.in .bubble { background: var(--surface); border: .5px solid var(--border); color: var(--t1); border-bottom-left-radius: 5px; }
.msg.out { justify-content: flex-end; }
.msg.out .bubble { background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 5px; }

/* 底部固定操作区 */
.footer-actions {
  flex: 0 0 auto;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--surface-veil-92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: .5px solid var(--border);
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   移动端 / 独立模式：去掉外框，全屏
   ========================================================================== */

body.standalone .stage {
  display: block;
  padding: 0;
  gap: 0;
  max-width: none;
  min-height: 100%;
  height: 100%;
}

body.standalone .panel { display: none; }

body.standalone .device-wrap {
  position: static;
  width: 100%;
  height: 100%;
}

body.standalone .device {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: var(--bg);
}

body.standalone .device::before { display: none; }

body.standalone .screen {
  border-radius: 0;
}

body.standalone .statusbar {
  height: calc(38px + env(safe-area-inset-top, 0px));
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
}

/* 手机浏览器（未添加到主屏幕）：也全屏，但保留状态栏空间 */
@media (max-width: 900px) {
  .stage { display: block; padding: 0; max-width: none; }
  .panel { display: none; }
  .device-wrap { position: static; width: 100%; height: 100vh; height: 100dvh; }
  .device {
    width: 100%; height: 100%;
    border-radius: 0; border: none; box-shadow: none;
    background: var(--bg);
  }
  .device::before { display: none; }
  .screen { border-radius: 0; }
  .statusbar {
    height: calc(38px + env(safe-area-inset-top, 0px));
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
  }
}

/* 桌面端小高度：整体缩放，避免外框被裁 */
@media (min-height: 0) and (max-height: 920px) and (min-width: 901px) {
  .device-wrap { transform: scale(.9); transform-origin: top center; margin-bottom: -85px; }
}

@media (max-height: 830px) and (min-width: 901px) {
  .device-wrap { transform: scale(.78); transform-origin: top center; margin-bottom: -187px; }
}

/* ==========================================================================
   轻提示
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%) translateY(14px);
  background: rgba(17, 24, 39, .93);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 9px 15px;
  border-radius: 9px;
  max-width: 300px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all .2s ease;
  z-index: 999;
  backdrop-filter: blur(8px);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}


/* ==========================================================================
   iPhone 上首次打开时的「添加到主屏幕」提示条
   --------------------------------------------------------------------------
   没有这条提示，用户在 iPhone Safari 里看到的就是一个 App 界面，
   不知道该"装"，只能每次输网址。只在 iOS + 非独立模式 + 未关闭过时出现。
   ========================================================================== */

.ios-tip {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  background: rgba(17, 24, 39, .95);
  color: #fff;
  border-radius: 13px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 34px -10px rgba(0, 0, 0, .7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  animation: tipIn .32s cubic-bezier(.2, .8, .3, 1);
}

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

.ios-tip .tip-txt {
  flex: 1 1 auto;
  font-size: 12px;
  line-height: 1.62;
  color: #E7EDF7;
}

.ios-tip .tip-txt b { color: #F6E6C6; font-weight: 650; }

.ios-tip .tip-x {
  flex: 0 0 auto;
  border: none;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 7px;
  font-family: var(--font);
  cursor: pointer;
}

/* hidden 属性必须真的不显示。
   坑：UA 样式表的 `[hidden] { display: none }` 优先级低于类选择器，
   所以上面 `.ios-tip { display: flex }` 会把它覆盖掉 —— 元素明明是 hidden，
   屏幕上却照样显示。必须显式兜一层。
   （之前的测试只查了 el.hidden 属性，没查渲染结果，因此报"正常"，属假绿。） */
.ios-tip[hidden] { display: none !important; }

/* 独立模式（已添加到主屏幕）绝不显示 */
body.standalone .ios-tip { display: none !important; }


/* ==========================================================================
   创业主线（创业者视角）
   ========================================================================== */

/* 快讯轮播：一次只显示一条，3.2 秒切换。不用横向跑马灯——那在手机上很难读 */
.brief-box {
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px 9px;
  margin-bottom: 12px;
  cursor: pointer;
}

.brief-box:active { background: var(--surface-alt); }

.brief-item { display: none; align-items: flex-start; gap: 7px; }
.brief-item.on { display: flex; animation: briefIn .34s ease; }

.brief-txt {
  flex: 1 1 auto;
  font-size: 12.5px;
  color: var(--t1);
  line-height: 1.52;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.brief-dots { display: flex; gap: 3px; margin-top: 8px; }
.brief-dots i { display: block; width: 12px; height: 2px; border-radius: 1px; background: var(--border); transition: background .2s; }
.brief-dots i.on { background: var(--primary); }

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

/* 小节头：左标题右「更多」。与 .sec-title（全大写小标签）区分开，
   这里承载的是内容板块，需要比标签更重 */
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 18px 2px 8px;
}

.sec-head > span {
  font-size: 14.5px;
  font-weight: 680;
  color: var(--t1);
  letter-spacing: -.15px;
}

.sec-head > button {
  border: none;
  background: none;
  font-size: 11.5px;
  color: var(--t3);
  font-family: var(--font);
  padding: 0;
  cursor: pointer;
}

.sec-head > button:active { color: var(--primary); }

/* 热文榜 */
.rank-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: .5px solid var(--border);
  cursor: pointer;
}

.rank-row:last-child { border-bottom: none; }
.rank-row:active { opacity: .66; }

.rank-no {
  flex: 0 0 17px;
  font-size: 13px;
  font-weight: 760;
  color: var(--t3);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.rank-no.hot { color: var(--danger); }

.rank-t {
  flex: 1 1 auto;
  font-size: 12.5px;
  color: var(--t1);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-v { flex: 0 0 auto; font-size: 10.5px; color: var(--t3); }

/* ==========================================================================
   推荐与排序偏好开关（算法备案要件）
   --------------------------------------------------------------------------
   为什么自己画开关而不用 <input type="checkbox">：
   系统复选框在 iOS 上有 15px 的最小点击区与自带的缩放手感，和这套
   14px 圆角的卡片放一起会明显「不像原生控件」；而 role="switch" +
   aria-checked 的可访问性语义与原生 input 完全等价（读屏会念「开关，已打开」）。
   关闭态必须**一眼看出是关的**：轨道与旋钮的明度差是唯一可靠的判据，
   不靠颜色区分（色弱用户看不出蓝/灰）。
   ========================================================================== */

.pref-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: .5px solid var(--border);
}
.pref-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.pref-row:first-child { padding-top: 2px; }

.pref-main { flex: 1 1 auto; min-width: 0; }

.pref-t {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--t1);
}

.pref-d {
  font-size: 11.5px;
  color: var(--t3);
  line-height: 1.65;
  margin-top: 4px;
}
.pref-d b { color: var(--t2); font-weight: 600; }

.pref-sw {
  flex: 0 0 auto;
  position: relative;
  width: 46px;
  height: 28px;
  margin-top: 2px;
  padding: 0;
  border-radius: 999px;
  border: .5px solid #B4BCC8;
  /* 关闭态必须用**中灰**而不是 surface-alt：
     浅色主题下 surface-alt(#F3F4F6) 与白卡片几乎同色，等于看不见轨道 */
  background: #C3CAD4;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.pref-sw::after {
  content: "";
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
  transition: transform .18s ease;
}
.pref-sw[aria-checked="true"] {
  background: var(--primary);
  border-color: var(--primary);
}
.pref-sw[aria-checked="true"]::after { transform: translateX(18px); }
.pref-sw[disabled] { opacity: .4; cursor: not-allowed; }
.pref-sw:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (prefers-color-scheme: dark) {
  .pref-sw { background: #3A475E; border-color: #4B596F; }
  .pref-sw::after { background: #F1F5F9; box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
  .pref-sw[aria-checked="true"] { background: var(--primary); border-color: var(--primary); }
  .pref-sw[aria-checked="true"]::after { background: #0B1220; }
}

@media (prefers-reduced-motion: reduce) {
  .pref-sw, .pref-sw::after { transition: none; }
}
