/* ============================================================
   术数 · Decision & Insight
   浅纸、墨字、钴蓝；编辑式排版，不用印章 / 八卦 / 星盘套路。
   品牌只出现在顶栏、登录页小标与页面标题里。
   ============================================================ */

:root {
  --bg: #f2efe8;
  --bg-2: #e9e4da;
  --surface: #fffdf8;
  --surface-2: #f7f3eb;
  --surface-3: #efebe2;
  --ink: #131416;
  --ink-2: #393a3e;
  --muted: #66645e;
  --line: rgba(19, 20, 22, .12);
  --line-strong: rgba(19, 20, 22, .24);
  --accent: #2f55ff;
  --accent-soft: rgba(47, 85, 255, .09);
  --method-a: #2f55ff;
  --method-a-soft: rgba(47, 85, 255, .09);
  --method-b: #7a4bd0;
  --method-b-soft: rgba(122, 75, 208, .09);
  --method-c: #0d8668;
  --method-c-soft: rgba(13, 134, 104, .09);
  --danger: #c94444;
  --danger-soft: rgba(201, 68, 68, .09);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(19, 20, 22, .08);
  --sans: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --display: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --serif: "Georgia", "Times New Roman", "Songti SC", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  min-height: 100vh;
  font: 15px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(900px 520px at 82% -12%, rgba(47, 85, 255, .07), transparent 62%),
    radial-gradient(700px 460px at 0% 8%, rgba(122, 75, 208, .045), transparent 58%),
    var(--bg);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .5;
  background-image:
    linear-gradient(rgba(19, 20, 22, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 20, 22, .035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
}
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button, input, select, textarea { font-family: inherit; }

.app { min-height: 100vh; display: flex; flex-direction: column; }
.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 8px 28px 72px; flex: 1; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.eyebrow-line { width: 30px; height: 1px; background: var(--accent); }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.icon { flex: none; }

/* ── 顶栏 ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(242, 239, 232, .88);
  backdrop-filter: blur(18px) saturate(120%);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { color: var(--ink); flex: none; }
.brand-text {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .12em;
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.nav-link small { color: var(--muted); font-size: 10px; letter-spacing: .06em; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.on { border-color: var(--line); background: var(--surface); color: var(--ink); font-weight: 600; }
.nav-link.on small { color: var(--accent); }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.soon {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}
.top-actions { display: flex; align-items: center; gap: 8px; }

/* ── 账号入口 ── */
.auth-actions { display: flex; align-items: center; gap: 6px; }
.auth-link {
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 12px;
  text-decoration: none;
}
.auth-link:hover { background: var(--surface-2); color: var(--ink); }
.auth-link.primary { background: var(--ink); color: #fff; font-weight: 600; }
.auth-link.primary:hover { background: var(--accent); }
.quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
}
.quota-pill:hover { border-color: var(--ink); color: var(--ink); }
.quota-pill.low { border-color: rgba(201, 68, 68, .35); color: var(--danger); }
.quota-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--method-c); box-shadow: 0 0 0 4px var(--method-c-soft); }
.quota-pill.low .quota-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }

.user-menu { position: relative; }
.user-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.user-trigger:hover { border-color: var(--line-strong); }
.user-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.user-avatar.lg { width: 40px; height: 40px; font-size: 16px; }
.user-avatar.xl { width: 60px; height: 60px; font-size: 22px; }
.user-avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.user-name { max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.user-chevron { color: var(--muted); font-size: 12px; transition: transform .16s ease; }
.user-chevron.open { transform: rotate(180deg); }
.user-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 244px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: pop-in .14s ease both;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.user-pop-head { display: flex; gap: 10px; padding: 7px 7px 11px; border-bottom: 1px solid var(--line); }
.user-pop-head strong { display: block; font-size: 13px; }
.user-pop-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; word-break: break-all; }
.user-pop-links { display: grid; gap: 1px; padding-top: 7px; }
.user-pop-links a, .user-pop-links button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.user-pop-links a:hover, .user-pop-links button:hover { background: var(--surface-2); color: var(--ink); }

/* ── 首页 ── */
.home { padding-top: 0; }
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(300px, .84fr);
  gap: clamp(34px, 6vw, 78px);
  align-items: center;
  padding: clamp(48px, 8vw, 92px) 0 clamp(38px, 5vw, 58px);
}
.hero-main { min-width: 0; }
.hero-eyebrow { margin-bottom: 22px; }
.home-hero h1 {
  font-family: var(--display);
  font-size: clamp(44px, 5.9vw, 74px);
  line-height: 1.07;
  letter-spacing: -.03em;
  font-weight: 700;
}
.hero-line { white-space: nowrap; }
.home-hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub { margin-top: 22px; max-width: 35em; color: var(--ink-2); font-size: 15px; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; color: var(--muted); font-size: 11px; }
.hero-proof span { display: inline-flex; align-items: center; gap: 6px; }
.hero-proof .icon { color: var(--accent); }
.hero-oracle { display: flex; align-items: center; justify-content: center; }
.hero-index {
  width: 100%;
  max-width: 390px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(19, 20, 22, .07);
}
.index-head { display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.index-row {
  display: grid;
  grid-template-columns: 30px 1fr auto 16px;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.index-row:hover { color: var(--accent); }
.index-row.future { color: var(--muted); opacity: 1; }
.index-num { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.index-row strong { font-size: 14px; font-weight: 600; }
.index-row em { color: var(--muted); font-size: 11px; font-style: normal; }
.index-row .icon { color: var(--muted); }
.index-rule { width: 28px; height: 2px; margin: 20px 0 12px; background: var(--accent); }
.index-note { color: var(--muted); font-size: 11px; line-height: 1.9; }

.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-stats div { padding: 18px 22px; border-right: 1px solid var(--line); }
.hero-stats div:last-child { border-right: 0; }
.hero-stats strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.hero-stats span { color: var(--muted); font-size: 11px; line-height: 1.6; }

.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 46px; }
.door {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 408px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.door-l { --accent: var(--method-a); }
.door-z { --accent: var(--method-b); }
.door:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.door-index {
  position: absolute;
  right: 24px;
  top: 16px;
  color: rgba(19, 20, 22, .055);
  font-family: var(--serif);
  font-size: 74px;
  line-height: 1;
  pointer-events: none;
}
.door-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; }
.door-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.door-kind { color: var(--muted); font-size: 11px; }
.door-top .soon { margin-left: 2px; }
.door h2 { position: relative; z-index: 1; margin: 42px 0 12px; max-width: 13em; font-size: clamp(24px, 2.5vw, 31px); line-height: 1.3; letter-spacing: -.025em; font-weight: 650; }
.door > p { position: relative; z-index: 1; max-width: 30em; color: var(--muted); font-size: 12px; line-height: 1.85; }
.door-meta { position: relative; z-index: 1; display: grid; gap: 7px; margin-top: 22px; font-size: 11px; }
.door-meta div { display: grid; grid-template-columns: 44px 1fr; gap: 10px; }
.door-meta dt { color: var(--muted); }
.door-meta dd { color: var(--ink-2); }
.door-cta { position: relative; z-index: 1; align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 24px; color: var(--accent); font-size: 12px; font-weight: 700; }
.door:hover .door-cta .icon { transform: translateX(3px); }
.door-cta .icon { transition: transform .18s ease; }

.six-art { display: flex; flex-direction: column; gap: 5px; width: 52px; flex: none; margin-left: auto; }
.six-art span { height: 4px; border-radius: 2px; background: var(--ink); opacity: .82; }
.six-art span.yin { background: linear-gradient(to right, var(--ink) 0 41%, transparent 41% 59%, var(--ink) 59% 100%); }
.six-art span.moving { background: var(--method-a); opacity: 1; }

.palace-art { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 4px; width: min(300px, 100%); aspect-ratio: 1; }
.palace-art span { border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface-2); }
.palace-art b { grid-area: 2 / 2 / 4 / 4; display: grid; place-items: center; border: 1px dashed var(--method-b); border-radius: 6px; background: var(--method-b-soft); color: var(--method-b); font-size: 20px; font-weight: 700; }
.palace-art.mini { width: 52px; gap: 2px; flex: none; margin-left: auto; }
.palace-art.mini span { border-radius: 2px; }
.palace-art.mini b { font-size: 10px; border-radius: 3px; }

.how-band { margin-top: 62px; padding-top: 34px; border-top: 1px solid var(--line); }
.section-kicker { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-kicker span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.section-kicker strong { color: var(--ink); font-size: clamp(20px, 2.3vw, 26px); font-weight: 650; letter-spacing: -.02em; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.how-step { padding: 20px 24px 24px 0; border-right: 1px solid var(--line); }
.how-step:not(:first-child) { padding-left: 24px; }
.how-step:last-child { border-right: 0; }
.how-step > span { color: var(--accent); font-family: var(--serif); font-size: 12px; }
.how-step strong { display: block; margin: 12px 0 6px; font-size: 14px; }
.how-step p { color: var(--muted); font-size: 11px; line-height: 1.8; }

.guide { display: grid; grid-template-columns: 210px 1fr; gap: 34px; margin-top: 54px; padding-top: 28px; border-top: 1px solid var(--line); }
.guide h2 { font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.guide-list { display: grid; }
.guide-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 12px; }
.guide-row:first-child { border-top: 1px solid var(--line); }
.side-note { margin-top: 14px; color: var(--muted); font-size: 11px; line-height: 1.8; }

.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 9px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.tag.liuyao { background: var(--method-a-soft); color: var(--method-a); }
.tag.ziwei { background: var(--method-b-soft); color: var(--method-b); }

.resume { display: flex; align-items: center; gap: 16px; margin-top: 4px; padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--surface); }
.resume-copy { flex: 1; min-width: 0; }
.resume-label { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.resume-copy p { margin-top: 3px; overflow: hidden; color: var(--ink-2); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.resume-link { color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none; }

/* ── 通用按钮 / 表单 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--ink); }
.btn.lg { padding: 12px 21px; font-size: 13px; }
.btn.primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.btn.primary.liuyao { background: var(--method-a); border-color: var(--method-a); }
.btn.primary.liuyao:hover:not(:disabled) { background: #2448dd; border-color: #2448dd; }
.btn.primary.ziwei { background: var(--method-b); border-color: var(--method-b); }
.btn.primary.ziwei:hover:not(:disabled) { background: #6940b8; border-color: #6940b8; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(201, 68, 68, .3); color: var(--danger); }
.btn.danger:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-soft); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 11px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.link-btn:hover { color: var(--ink); }

.panel { padding: clamp(20px, 3vw, 28px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 10px 40px rgba(19, 20, 22, .035); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-head h2 { margin-top: 5px; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span { color: var(--ink-2); font-size: 11px; font-weight: 600; }
.field small { color: var(--muted); font-size: 10px; line-height: 1.6; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  line-height: 1.7;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 118px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #8a877f; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { opacity: .55; background: var(--surface-2); }
select option { background: var(--surface); }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.form-error { padding: 10px 12px; border: 1px solid rgba(201, 68, 68, .28); border-radius: 8px; background: var(--danger-soft); color: #9f3030; font-size: 11px; line-height: 1.6; }
.form-ok { color: var(--method-c); font-size: 11px; }
.page-error { margin: 18px 0; }
.page-ok { margin: 18px 0; padding: 10px 12px; border: 1px solid rgba(13, 134, 104, .22); border-radius: 8px; background: var(--method-c-soft); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 62px; }
.password-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.password-toggle:hover { color: var(--accent); background: var(--surface-2); }

/* ── 六爻对话 ── */
.chat-page { max-width: 860px; margin: 0 auto; padding-bottom: 160px; }
.chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 0 15px; border-bottom: 1px solid var(--line); }
.chat-head-main { min-width: 0; }
.chat-status { margin-left: 4px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 9px; }
.chat-question { margin-top: 8px; color: var(--ink); font-size: 16px; font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; }
.chat-thread { display: flex; flex-direction: column; gap: 14px; padding: 20px 0 8px; }
.chat-msg { display: flex; align-items: flex-start; gap: 10px; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.wide .chat-bubble { flex: 1; max-width: 100%; }
.chat-avatar { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--method-a-soft); color: var(--method-a); font-size: 13px; font-weight: 700; }
.chat-bubble { max-width: 620px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; border-top-left-radius: 4px; background: var(--surface); color: var(--ink-2); font-size: 14px; line-height: 1.8; }
.chat-msg.user .chat-bubble { border-color: var(--ink); border-radius: 14px; border-bottom-right-radius: 4px; background: var(--ink); color: #fff; }
.chat-bubble p { margin: 0 0 8px; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble .prose p { margin-bottom: 12px; }
.chat-label { margin-bottom: 8px; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.chat-muted { color: var(--muted); font-size: 11px; }
.chat-msg.user .chat-muted, .chat-msg.user .chat-label { color: rgba(255, 255, 255, .65); }
.chat-error { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border: 1px solid rgba(201, 68, 68, .25); border-radius: 9px; background: var(--danger-soft); color: #9f3030; font-size: 11px; }
.chat-spacer { height: 140px; }
.chat-composer { position: fixed; left: 50%; bottom: 16px; z-index: 25; width: min(860px, calc(100vw - 32px)); transform: translateX(-50%); }
.composer-box { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(255, 253, 248, .94); backdrop-filter: blur(16px); box-shadow: 0 16px 44px rgba(19, 20, 22, .12); }
.composer-box input { flex: 1; min-width: 0; padding: 9px 10px; border: 0; background: transparent; box-shadow: none; }
.composer-box input:focus { box-shadow: none; }
.composer-box .btn { flex: none; padding: 9px 17px; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 0 4px; }
.composer-note { color: var(--muted); font-size: 10px; }
.caret { display: inline-block; width: 6px; height: 1em; margin-left: 3px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.style-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 0 0; }
.style-label { color: var(--muted); font-size: 10px; }
.style-note { flex: 1 1 220px; color: var(--muted); font-size: 10px; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.seg { padding: 5px 11px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 10px; cursor: pointer; }
.seg.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(19, 20, 22, .08); }
.seg:disabled { cursor: not-allowed; opacity: .6; }

.prompt-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 4px 40px; }
.prompt-chip { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 10px; cursor: pointer; transition: border-color .16s ease, color .16s ease, background .16s ease; }
.prompt-chip:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.toss-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.toss-head strong { color: var(--ink); font-size: 16px; }
.toss-head span { color: var(--muted); font-size: 10px; }
.toss-coins { display: flex; gap: 10px; margin: 16px 0 10px; }
.coin { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 16px; font-weight: 600; }
.coin.heads { border-color: var(--method-a); background: var(--method-a-soft); color: var(--method-a); }
.coin.tails { color: var(--ink-2); }
.toss-coins.shaking .coin { animation: coin-shake .35s ease-in-out infinite alternate; }
@keyframes coin-shake { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-4px) rotate(2deg); } }
.toss-result { margin: 0 0 12px; color: var(--method-a); font-size: 12px; font-weight: 600; }
.toss-note { margin-top: 9px; }
.toss-question { margin-bottom: 8px; color: var(--ink); font-size: 12px; font-weight: 600; }

.hex-lines { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.hex-line { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 12px; }
.hex-tag { color: var(--muted); font-size: 10px; }
.hex-bars { display: flex; gap: 8px; width: min(280px, 100%); }
.hex-bars .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--ink-2); }
.hex-bars.yin .bar { flex: 0 0 calc(50% - 4px); }
.hex-line.moving .bar { background: var(--method-a); }
.hex-line.moving .hex-tag { color: var(--method-a); font-weight: 700; }
.hex-line.pending .hex-tag { color: var(--line-strong); }
.hex-bars.pending .bar.placeholder { flex: 1; background: transparent; border: 1px dashed var(--line-strong); }
.cast-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.cast-title strong { color: var(--ink); font-size: 32px; line-height: 1.1; font-weight: 700; }
.cast-title span { color: var(--muted); font-size: 12px; }
.chart-toggle { margin-top: 4px; }
.chart-embed { margin-top: 12px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.chart-embed iframe { display: block; width: 100%; height: min(70vh, 780px); min-height: 420px; border: 0; border-radius: 8px; background: #fff; }
.missing-block { margin-bottom: 12px; }
.options { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.option { padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 11px; cursor: pointer; }
.option:hover { border-color: var(--accent); color: var(--accent); }

/* 过程面板 */
.process { margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 10px; }
.process.live { border-color: rgba(47, 85, 255, .3); background: var(--accent-soft); }
.process-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.process-state { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-weight: 600; }
.process-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--line-strong); }
.process.live .process-dot { background: var(--accent); animation: process-pulse 1.2s ease-in-out infinite; }
.process-elapsed { color: var(--muted); font-weight: 400; }
.process-body { margin-top: 10px; }
.process-steps { display: grid; gap: 6px; }
.process-step { display: flex; gap: 8px; color: var(--muted); line-height: 1.55; }
.process-step.done { color: var(--ink-2); }
.process-step.active { color: var(--accent); }
.process-check { width: 14px; flex: none; text-align: center; font-weight: 700; }
.process-step strong { margin-right: 6px; font-weight: 600; }
.process-step span { color: var(--muted); }
.process-mini-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: process-pulse 1s infinite; }
.process-ticker { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--accent); font-size: 9px; }
.ticker-bar { width: 26px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: ticker-slide 1.4s linear infinite; }
.process-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.6; }
.process-note { margin-top: 8px; color: var(--muted); font-size: 9px; }
.process-reasoning { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.process-sub { margin-bottom: 4px; color: var(--ink-2); font-weight: 600; }
.process-reasoning pre { max-height: 220px; margin: 0; padding: 8px 9px; overflow: auto; border-radius: 6px; background: var(--surface); color: var(--ink-2); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.process-muted { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
@keyframes process-pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(47, 85, 255, .18); } 50% { opacity: .55; box-shadow: 0 0 0 5px rgba(47, 85, 255, 0); } }
@keyframes ticker-slide { from { transform: translateX(-4px); opacity: .45; } to { transform: translateX(4px); opacity: 1; } }

.prose p { margin-bottom: 12px; line-height: 1.95; white-space: pre-wrap; word-break: break-word; }
.prose p:last-child { margin-bottom: 0; }
.prose-list { margin: 0 0 12px; padding-left: 20px; line-height: 1.9; }
.prose-list li { margin-bottom: 4px; }
.prose-list li:last-child { margin-bottom: 0; }
.prose .lead { padding-left: 14px; border-left: 2px solid var(--accent); color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.9; }

/* ── 紫微 ── */
.ziwei-page { max-width: 980px; margin: 0 auto; }
.ziwei-hero { padding: clamp(28px, 5vw, 50px) 0 28px; border-bottom: 1px solid var(--line); }
.method-line { display: flex; align-items: center; gap: 9px; margin-bottom: 2px; }
.ziwei-hero h1 { margin: 14px 0 10px; font-size: clamp(40px, 5.6vw, 60px); line-height: 1.08; letter-spacing: -.045em; font-weight: 700; }
.ziwei-body { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: clamp(30px, 5vw, 62px); align-items: start; padding-top: 32px; }
.ziwei-map-wrap { display: grid; gap: 12px; justify-items: center; }
.ziwei-info { display: grid; gap: 18px; }
.info-list { display: grid; gap: 13px; }
.info-list div { display: grid; grid-template-columns: 76px 1fr; gap: 16px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.info-list dt { color: var(--muted); font-size: 11px; }
.info-list dd { color: var(--ink-2); font-size: 12px; line-height: 1.8; }

/* ── 旧稿 ── */
.archive-page { max-width: 980px; margin: 0 auto; }
.archive-hero { padding: clamp(28px, 5vw, 46px) 0 22px; }
.archive-hero h1 { margin-bottom: 8px; font-size: clamp(38px, 5.4vw, 56px); line-height: 1.08; letter-spacing: -.045em; font-weight: 700; }
.archive-toolbar { display: flex; gap: 7px; margin-bottom: 16px; }
.chip { padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 11px; cursor: pointer; }
.chip.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.chip-note { margin-left: 5px; font-size: 9px; }
.archive-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.archive-row { display: grid; grid-template-columns: 108px minmax(0, 1fr) minmax(0, .9fr); gap: 18px; width: 100%; padding: 15px 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.archive-row:last-child { border-bottom: 0; }
.archive-row:hover { background: var(--surface-2); }
.archive-date { padding-top: 2px; color: var(--muted); font-size: 10px; }
.archive-main { display: grid; gap: 4px; min-width: 0; }
.archive-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.archive-q { overflow: hidden; color: var(--ink-2); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.archive-excerpt { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.65; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.empty-panel { display: grid; gap: 14px; justify-items: start; }

/* ── 弹层 ── */
.modal-mask { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(19, 20, 22, .55); backdrop-filter: blur(4px); }
.modal { width: min(780px, 100%); max-height: 88vh; overflow: auto; padding: clamp(22px, 4vw, 34px); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 30px 90px rgba(19, 20, 22, .25); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin-top: 5px; font-size: 20px; font-weight: 650; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.folio-body { font-size: 13px; line-height: 1.95; }
.folio-hex { margin-bottom: 10px; color: var(--ink); font-size: 16px; font-weight: 700; }
.folio-body h4 { margin: 20px 0 8px; padding-left: 10px; border-left: 2px solid var(--accent); color: var(--ink); font-size: 12px; font-weight: 700; }
.folio-body h4 + p { color: var(--ink); font-size: 14px; font-weight: 600; }
.folio-body p { margin-bottom: 10px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.folio-body ul { display: grid; gap: 3px; margin: 0 0 14px; padding: 0; list-style: none; }
.folio-body li { color: var(--muted); font-size: 11px; }

/* ── 登录 / 注册 ── */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(380px, .98fr); background: var(--bg); }
.auth-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(38px, 6vw, 76px); overflow: hidden; border-right: 1px solid var(--line); background: #121316; color: #fff; }
.auth-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(620px 420px at 18% 8%, rgba(47, 85, 255, .22), transparent 65%), radial-gradient(520px 380px at 92% 92%, rgba(122, 75, 208, .14), transparent 62%); pointer-events: none; }
.auth-art > * { position: relative; z-index: 1; }
.auth-art-copy { max-width: 470px; }
.auth-art-copy .eyebrow { color: rgba(255, 255, 255, .5); }
.auth-art-copy h1 { margin: 18px 0 16px; font-size: clamp(40px, 5vw, 58px); line-height: 1.06; letter-spacing: -.045em; font-weight: 700; }
.auth-art-copy p { max-width: 34em; color: rgba(255, 255, 255, .62); font-size: 13px; line-height: 1.9; }
.auth-index { margin-top: 54px; border-top: 1px solid rgba(255, 255, 255, .16); }
.auth-index-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.auth-index-row span { color: rgba(255, 255, 255, .4); font-size: 10px; font-variant-numeric: tabular-nums; }
.auth-index-row strong { font-size: 13px; font-weight: 600; }
.auth-index-row em { color: rgba(255, 255, 255, .45); font-size: 10px; font-style: normal; }
.auth-index-row.future { opacity: .45; }
.auth-card { display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 430px; margin: 0 auto; padding: clamp(34px, 6vw, 66px) clamp(24px, 5vw, 38px); }
.auth-brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 40px; color: var(--ink); font-size: 14px; font-weight: 700; letter-spacing: .1em; text-decoration: none; }
.auth-brand .brand-mark { color: var(--ink); }
.auth-card-head { margin-bottom: 24px; }
.auth-card-head .eyebrow { color: var(--accent); }
.auth-card-head h2 { margin: 11px 0 8px; font-size: 32px; line-height: 1.15; letter-spacing: -.035em; font-weight: 700; }
.auth-card-head p { color: var(--muted); font-size: 12px; line-height: 1.8; }
.auth-form { display: grid; }
.auth-submit { width: 100%; margin-top: 6px; padding: 12px 20px; }
.auth-hint { margin-top: 11px; color: var(--accent); font-size: 10px; line-height: 1.7; }
.auth-switch { display: flex; justify-content: center; gap: 6px; margin-top: 20px; color: var(--muted); font-size: 11px; }
.auth-switch a { color: var(--accent); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-back { display: block; margin-top: 16px; color: var(--muted); font-size: 10px; text-align: center; text-decoration: none; }
.auth-back:hover { color: var(--ink); }
.notice { margin-top: 18px; padding: 15px; border: 1px solid rgba(47, 85, 255, .22); border-radius: 10px; background: var(--accent-soft); color: var(--ink-2); font-size: 11px; line-height: 1.8; }
.notice strong { display: block; margin-bottom: 6px; color: var(--accent); }
.notice p { margin-bottom: 12px; }
.auth-gate { display: flex; gap: 24px; align-items: flex-start; margin-top: 24px; padding: clamp(24px, 4vw, 38px); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 18px 50px rgba(19, 20, 22, .05); }
.auth-gate.compact { max-width: 740px; }
.auth-gate-art { display: grid; place-items: center; width: 68px; height: 68px; flex: none; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--ink); }
.auth-gate h2 { margin: 8px 0; font-size: 25px; letter-spacing: -.03em; font-weight: 700; }
.auth-gate p { max-width: 46em; color: var(--muted); font-size: 12px; line-height: 1.85; }
.auth-gate-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }

/* ── 账户 ── */
.account-page { max-width: 980px; margin: 0 auto; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: clamp(30px, 5vw, 50px) 0 26px; border-bottom: 1px solid var(--line); }
.section-head h1 { margin: 11px 0 8px; font-size: clamp(36px, 4.8vw, 50px); line-height: 1.08; letter-spacing: -.045em; font-weight: 700; }
.section-head p { color: var(--muted); font-size: 12px; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.account-profile { display: flex; flex-direction: column; }
.profile-head { display: flex; gap: 15px; align-items: center; }
.profile-head h2 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.profile-head p { margin: 3px 0 8px; color: var(--muted); font-size: 11px; word-break: break-all; }
.role-badge { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 4px; font-size: 9px; font-weight: 700; }
.role-badge.admin { background: var(--accent-soft); color: var(--accent); }
.role-badge.user { background: var(--surface-2); color: var(--ink-2); }
.account-meta { display: grid; gap: 9px; margin: 20px 0; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.account-meta div { display: flex; justify-content: space-between; gap: 16px; font-size: 11px; }
.account-meta dt { color: var(--muted); }
.account-meta dd { color: var(--ink-2); }
.account-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: auto; }
.quota-panel { display: flex; flex-direction: column; }
.quota-reset { color: var(--muted); font-size: 9px; }
.credit-hero { display: flex; align-items: baseline; gap: 9px; margin: 4px 0 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.credit-hero strong { color: var(--ink); font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.credit-hero span { color: var(--ink-2); font-size: 11px; }
.credit-meta { display: grid; gap: 8px; margin-bottom: 16px; }
.credit-meta div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: 11px; }
.credit-meta span { color: var(--muted); }
.credit-meta strong { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.credit-meta strong.ok { color: var(--method-c); }
.quota-token-row { margin-top: auto; }
.meter-row { margin: 6px 0 17px; }
.meter-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.meter-label span { color: var(--ink-2); font-size: 11px; }
.meter-label strong { color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.meter { height: 5px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s ease; }
.meter.gold > span { background: var(--method-b); }
.quota-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 10px; }
.quota-panel .muted { margin-top: 11px; font-size: 10px; }
.stack-form { display: grid; }
.account-page > .form-error { margin-top: 18px; }

/* ── 后台 ── */
.admin-page { max-width: 1180px; margin: 0 auto; }
.admin-head-actions { display: flex; align-items: center; gap: 11px; }
.admin-live { display: inline-flex; align-items: center; gap: 7px; color: var(--method-c); font-size: 10px; }
.admin-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--method-c); box-shadow: 0 0 0 4px var(--method-c-soft); }
.admin-tabs { display: flex; gap: 3px; margin: 20px 0 18px; padding: 3px; width: fit-content; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.admin-tab { padding: 7px 17px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; }
.admin-tab:hover { color: var(--ink); }
.admin-tab.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(19, 20, 22, .08); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { display: grid; gap: 4px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.stat-icon { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.stat-label { color: var(--muted); font-size: 10px; }
.stat-card strong { color: var(--ink); font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.03em; }
.stat-note { color: var(--muted); font-size: 9px; }
.admin-toolbar-right { display: flex; align-items: center; gap: 10px; }
.admin-toolbar-right .btn { padding: 6px 11px; font-size: 10px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.search-box { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 330px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--muted); }
.search-box input { padding: 8px 0; border: 0; background: transparent; box-shadow: none; font-size: 11px; }
.search-box input:focus { box-shadow: none; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.admin-table th { padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-align: left; white-space: nowrap; }
.admin-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: var(--surface-2); }
.table-user { display: flex; align-items: center; gap: 9px; min-width: 180px; }
.table-user strong { display: block; color: var(--ink); font-size: 11px; }
.table-user span:not(.user-avatar) { display: block; color: var(--muted); font-size: 9px; }
.table-actions { text-align: right; }
.badge-row { display: flex; flex-wrap: wrap; gap: 5px; }
.status-badge { display: inline-flex; align-items: center; height: 19px; padding: 0 6px; border-radius: 4px; font-size: 9px; }
.status-badge.active { background: var(--method-c-soft); color: var(--method-c); }
.status-badge.pending { background: var(--method-b-soft); color: var(--method-b); }
.status-badge.disabled { background: var(--danger-soft); color: var(--danger); }
.table-empty { padding: 28px !important; color: var(--muted) !important; text-align: center; }
.admin-pager { display: flex; align-items: center; justify-content: flex-end; gap: 13px; margin-top: 14px; }
.admin-pager .btn { padding: 6px 11px; font-size: 10px; }
.settings-panel { max-width: 680px; }
.settings-form { display: grid; gap: 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.switch-row strong { display: block; font-size: 12px; }
.switch-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.switch { position: relative; width: 42px; height: 23px; flex: none; padding: 0; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-3); cursor: pointer; transition: background .16s ease, border-color .16s ease; }
.switch span { position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--muted); transition: transform .16s ease, background .16s ease; }
.switch.on { background: var(--accent-soft); border-color: var(--accent); }
.switch.on span { transform: translateX(19px); background: var(--accent); }
.admin-denied { display: grid; justify-items: start; gap: 12px; max-width: 540px; margin: 60px auto; }
.admin-denied h1 { font-size: 28px; letter-spacing: -.03em; font-weight: 700; }
.admin-denied p { color: var(--muted); font-size: 12px; }
.admin-editor { width: min(680px, 100%); }

/* ── 页脚 ── */
.footer { width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.footer p { flex: 1; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.boot { display: grid; place-items: center; min-height: 40vh; color: var(--muted); }

/* ── 响应式 ── */

/* ── 可访问性与新组件 ── */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.judgment-card {
  margin: 12px 0;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--surface-2);
}
.judgment-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.judgment-confidence { padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 9px; letter-spacing: .04em; }
.judgment-row { display: grid; grid-template-columns: 34px 1fr; gap: 10px; margin-bottom: 6px; font-size: 12px; line-height: 1.7; }
.judgment-row span { color: var(--muted); }
.judgment-row strong { color: var(--ink); font-weight: 650; }
.judgment-evidence { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 11px; line-height: 1.8; }
.judgment-note { margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.reading-trust { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.7; }
.reading-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; align-items: center; }
.reading-meta .link-btn { font-size: 10px; }

.archive-search { display: flex; align-items: center; gap: 7px; flex: 1; margin-left: auto; max-width: 390px; }
.archive-search input { padding: 8px 11px; font-size: 11px; }
.archive-search .btn { flex: none; padding: 7px 12px; font-size: 10px; white-space: nowrap; }
.archive-count { margin: 0 0 10px; color: var(--muted); font-size: 10px; }
.archive-more { display: flex; justify-content: center; padding: 16px 0 0; }
.archive-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.archive-actions { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.archive-row.pending { opacity: .55; }
.skeleton-list { padding: 6px 0; }
.skeleton-row { height: 58px; margin-bottom: 8px; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: skeleton 1.4s ease-in-out infinite; }
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.sample-note { display: inline-flex; width: fit-content; justify-self: start; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; background: var(--method-b-soft); color: var(--method-b); font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.sample-reading { padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.sample-reading strong { display: block; margin-bottom: 7px; font-size: 14px; }
.sample-reading p { color: var(--ink-2); font-size: 11px; line-height: 1.8; }
.sample-reading p.muted { margin-top: 8px; color: var(--muted); font-size: 10px; }
.waitlist-form { padding-top: 2px; }
.waitlist-form .field { margin-bottom: 10px; }
.waitlist-form .form-ok, .waitlist-form .form-error { margin-top: 8px; }

.provider-block { padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.provider-block:last-of-type { border-bottom: 0; }
.provider-edit { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; margin-top: 4px; }
.provider-edit .field { margin-bottom: 0; }
.provider-xl { display: none; }
.provider-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.provider-row:last-of-type { border-bottom: 0; }
.provider-row strong { font-size: 12px; }
.provider-row p { margin-top: 2px; font-size: 10px; word-break: break-all; }
.profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.profile-card { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.profile-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.profile-card-head strong { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.profile-card .field { margin-bottom: 10px; }
.profile-card .field > span { font-size: 9px; }
.profile-card input { padding: 7px 9px; font-size: 11px; }
.usage-bars { display: grid; gap: 8px; }
.usage-row { display: grid; grid-template-columns: 42px 1fr 78px 40px; align-items: center; gap: 10px; font-size: 10px; }
.usage-row > span { color: var(--muted); }
.usage-row > strong { text-align: right; font-variant-numeric: tabular-nums; font-size: 10px; }
.usage-row > em { color: var(--muted); font-style: normal; text-align: right; }
.usage-track { height: 6px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.usage-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.composer-box textarea {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 38px;
  max-height: 132px;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
  resize: none;
  overflow-y: auto;
  line-height: 1.6;
}
.composer-box textarea:focus { box-shadow: none; }
.composer-box textarea:disabled { background: transparent; }


.onboarding-panel { margin-bottom: 16px; border-left: 3px solid var(--accent); }
.onboarding-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.onboarding-list li { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(0, 1.6fr) auto; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.onboarding-list li:last-child { border-bottom: 0; }
.onboarding-list strong { font-size: 12px; }
.onboarding-list span { color: var(--muted); line-height: 1.7; }
.admin-warning { margin-bottom: 14px; padding: 11px 13px; border: 1px solid rgba(201, 68, 68, .25); border-radius: 9px; background: var(--danger-soft); color: #9f3030; font-size: 11px; line-height: 1.7; }
@media (max-width: 720px) {
  .onboarding-list li { grid-template-columns: 1fr auto; }
  .onboarding-list span { grid-column: 1 / -1; }
}


.privacy-page { max-width: 980px; margin: 0 auto; }
.privacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.privacy-grid h2 { margin-bottom: 10px; font-size: 17px; letter-spacing: -.02em; }
.privacy-grid p { color: var(--ink-2); font-size: 12px; line-height: 1.85; margin-bottom: 9px; }
.privacy-grid .prose-list { margin-bottom: 0; }


.feedback-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 10px; }
.feedback-btn { padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 10px; cursor: pointer; }
.feedback-btn:hover { border-color: var(--accent); color: var(--accent); }
.feedback-done { margin-top: 10px; color: var(--method-c); font-size: 10px; }

@media (max-width: 980px) {
  .home-hero { grid-template-columns: 1fr; gap: 30px; align-items: start; }
  .hero-oracle { justify-content: flex-start; }
  .hero-index { max-width: 520px; }
  .doors { grid-template-columns: 1fr; }
  .door { min-height: 0; }
  .door h2 { margin-top: 32px; }
  .guide { grid-template-columns: 1fr; gap: 14px; }
  .profile-grid { grid-template-columns: 1fr; }
  .provider-edit { grid-template-columns: 1fr; }
  .archive-toolbar { flex-wrap: wrap; }
  .archive-search { flex: 1 0 100%; max-width: none; margin-left: 0; }
  .ziwei-body { grid-template-columns: 1fr; }
  .ziwei-map-wrap { justify-items: start; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .account-grid { grid-template-columns: 1fr; }
  .privacy-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-toolbar { flex-wrap: wrap; }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .brand-text { font-size: 16px; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; padding-top: 2px; }
  .nav-link { padding: 7px 10px; font-size: 11px; }
  .top-actions { margin-left: auto; gap: 6px; }
  .quota-pill { padding: 6px 9px; font-size: 10px; }
  .user-name { display: none; }
  .page { padding: 4px 16px 54px; }
  .home-hero { padding-top: 36px; }
  .home-hero h1 { font-size: clamp(37px, 10vw, 48px); }
  .hero-sub { font-size: 13px; }
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stats div { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 4px; }
  .hero-stats div:last-child { border-bottom: 0; }
  .hero-index { padding: 20px; }
  .doors { margin-top: 32px; }
  .door { padding: 21px; }
  .door h2 { font-size: 23px; margin-top: 26px; }
  .door-index { font-size: 58px; right: 16px; top: 12px; }
  .how-grid { grid-template-columns: 1fr; border-top: 0; }
  .how-step, .how-step:not(:first-child) { padding: 16px 0; border-right: 0; border-top: 1px solid var(--line); }
  .section-kicker { display: block; }
  .section-kicker strong { display: block; margin-top: 8px; }
  .footer { flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px 16px; }
  .footer p { flex: none; }
  .chat-page { padding-bottom: 170px; }
  .chat-bubble { padding: 11px 12px; font-size: 13px; }
  .chat-avatar { width: 27px; height: 27px; font-size: 12px; }
  .chat-composer { bottom: 8px; width: calc(100vw - 20px); }
  .composer-foot { flex-wrap: wrap; }
  .chart-embed iframe { height: 68vh; min-height: 390px; }
  .archive-row { grid-template-columns: 1fr; gap: 5px; padding: 14px 15px; }
  .archive-date { padding: 0; font-size: 11px; }
  .archive-excerpt { display: none; }
  .archive-q { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .archive-search { flex: 1 0 100%; }
  .usage-row { grid-template-columns: 38px 1fr 64px; }
  .usage-row em { display: none; }
  .segmented { flex: 1; }
  .seg { flex: 1; }
  .field-row { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 15px; }
  .stat-card strong { font-size: 22px; }
  .admin-tabs { width: 100%; }
  .admin-tab { flex: 1; }
  .admin-head-actions { flex-wrap: wrap; }
  .admin-table th:nth-child(5), .admin-table td:nth-child(5) { display: none; }
  .auth-gate { flex-direction: column; gap: 16px; }
  .auth-card { padding-top: 38px; }
  .auth-brand { margin-bottom: 28px; }
  .auth-card-head h2 { font-size: 28px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .account-grid { gap: 12px; }
  .hero-actions .btn { flex: 1; }
  .auth-gate-actions .btn { flex: 1; }
  .admin-table th:nth-child(4), .admin-table td:nth-child(4) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
