/* ==========================================================================
   长大答 · 样式
   设计取向：纸感 + 克制。首页只有一个输入框，卡片正文用宋体，读起来像一页纸。
   颜色只有一个主色（深青），三级置信度各占一色，其余全部靠排版拉开层次。
   ========================================================================== */

:root {
  --paper: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --ink: #191a1a;
  --ink-2: #4a4b4a;
  --ink-3: #8a8680;
  --line: #e4dfd4;
  --line-soft: #eeebe3;

  --brand: #14584c;
  --brand-2: #1e7365;
  --brand-wash: #e7efeb;

  --lv-a: #15734a;
  --lv-a-wash: #e5f2ea;
  --lv-b: #2b5d9c;
  --lv-b-wash: #e6edf7;
  --lv-c: #847e72;
  --lv-c-wash: #efece5;

  --warn: #a8522a;
  --warn-wash: #f8ece2;

  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", "SimSun", Georgia, serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(25, 26, 26, 0.04), 0 8px 24px -12px rgba(25, 26, 26, 0.12);
  --maxw: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131519;
    --surface: #1a1d22;
    --surface-2: #1e2228;
    --ink: #eceae5;
    --ink-2: #b3b1ab;
    --ink-3: #7e7b75;
    --line: #2b2f36;
    --line-soft: #23272d;

    --brand: #55c3ab;
    --brand-2: #6fd3bd;
    --brand-wash: #16302b;

    --lv-a: #57c28d;
    --lv-a-wash: #14291f;
    --lv-b: #77a9e8;
    --lv-b-wash: #17202e;
    --lv-c: #a09a8d;
    --lv-c-wash: #23221f;

    --warn: #e08a5c;
    --warn-wash: #2b1f18;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand em {
  font-style: normal;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.topbar .spacer { flex: 1; }

.topnav { display: flex; gap: 4px; flex: 0 0 auto; }
.topnav a {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
  color: var(--ink-2);
}
.topnav a:hover { background: var(--brand-wash); color: var(--brand); text-decoration: none; }

/* 窄屏：让出副标题，保证「长大答」和两个导航不被挤成竖排 */
@media (max-width: 560px) {
  .brand em { display: none; }
  .brand { font-size: 18px; letter-spacing: 0.1em; }
  .topnav { gap: 2px; }
  .topnav a { padding: 6px 8px; font-size: 12.5px; }
}

/* ---------- 容器 ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 88px;
}

/* ---------- 首页 hero ---------- */
.hero { padding: 48px 0 8px; }

.kicker {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(28px, 7.4vw, 40px);
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero .sub {
  margin: 0 0 28px;
  color: var(--ink-2);
  font-size: 15px;
  max-width: 30em;
}

/* ---------- 搜索框 ---------- */
.searchbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.searchbar:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent), var(--shadow);
}

.searchbar input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
}
.searchbar input::placeholder { color: var(--ink-3); }

.searchbar .go {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
}
.searchbar .go svg { width: 20px; height: 20px; }
.searchbar .go:hover { background: var(--brand-2); }

@media (prefers-color-scheme: dark) {
  .searchbar .go { color: #0d1a17; }
}

.tryline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-3);
}
.tryline button {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
}
.tryline button:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-wash); }

/* ---------- 区块标题 ---------- */
.sec { margin-top: 46px; }
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.sec-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sec-head .note { font-size: 12px; color: var(--ink-3); }

/* ---------- 十个类目格 ---------- */
.packs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 620px) {
  .packs { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 359px) {
  .packs { grid-template-columns: 1fr; }
}

.pack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 0.16s, transform 0.16s, box-shadow 0.16s;
}
.pack:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.pack .ico { width: 21px; height: 21px; color: var(--brand); }
.pack .nm { font-size: 14px; font-weight: 600; letter-spacing: 0.01em; line-height: 1.3; }
.pack .ct { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }

/* ---------- 列表行 ---------- */
.rows { display: flex; flex-direction: column; gap: 2px; }

.row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 13px 12px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
}
.rows .row:first-child { border-top: 1px solid var(--line-soft); }
.row:hover { background: var(--surface); }
.row:hover .rowq { color: var(--brand); }

.row .idx {
  flex: 0 0 22px;
  padding-top: 1px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.row .body { flex: 1; min-width: 0; }
.rowq {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  transition: color 0.14s;
}
.rowmeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-3);
}

/* ---------- 置信度徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge.a { color: var(--lv-a); background: var(--lv-a-wash); }
.badge.b { color: var(--lv-b); background: var(--lv-b-wash); }
.badge.c { color: var(--lv-c); background: var(--lv-c-wash); }
.badge.stale { color: var(--warn); background: var(--warn-wash); }

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* ---------- 结果页 ---------- */
.qhead { padding: 28px 0 6px; }
.qhead .ask { font-size: 12px; letter-spacing: 0.16em; color: var(--ink-3); }
.qhead h1 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: clamp(22px, 5.6vw, 28px);
  line-height: 1.4;
  font-weight: 700;
  word-break: break-word;
}
.qhead .count { margin: 8px 0 0; font-size: 13px; color: var(--ink-3); }

.hit {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 16px 16px 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 0.16s, box-shadow 0.16s;
}
.hit:hover { border-color: var(--brand); box-shadow: var(--shadow); }

/* 结果跨类目时的分组标题。只在结果来自两个以上类目时出现，
   单个类目不显示——为一条结果加个标题是多余的。 */
.hit-group {
  margin-top: 20px;
}
.hit-group:first-of-type {
  margin-top: 22px;
}
.group-label {
  margin: 0 0 8px;
  padding-left: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.group-label::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  margin-left: 8px;
  vertical-align: middle;
  background: var(--line);
}

.hit .top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.hit .hitq {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}
.hit .concl {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hit .foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-3);
}

.empty {
  padding: 34px 22px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
}
.empty h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 19px;
}
.empty p { margin: 0 0 18px; color: var(--ink-2); font-size: 14px; }

/* ---------- 详情页（那张卡） ---------- */
.cardpage { padding-top: 22px; }

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--ink-3);
}
.backlink:hover { color: var(--brand); text-decoration: none; }

.cardhead .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.cardhead h1 {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: clamp(23px, 6vw, 31px);
  line-height: 1.38;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* 结论：整页最重要的一句 */
.verdict {
  padding: 20px 20px 20px 22px;
  background: var(--brand-wash);
  border-radius: var(--r-md);
  border-left: 3px solid var(--brand);
}
.verdict .lbl {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--brand);
  font-weight: 600;
}
.verdict p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(17px, 4.4vw, 20px);
  line-height: 1.62;
  color: var(--ink);
}

/* 段落 */
.blk { margin-top: 34px; }
.blk-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.blk-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--ink-3);
}
.blk-head .hint { font-size: 12px; color: var(--ink-3); }

/* 步骤 */
.steps { counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps li {
  position: relative;
  counter-increment: s;
  padding: 0 0 16px 40px;
  font-size: 15px;
  line-height: 1.72;
}
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--brand);
  border-radius: 50%;
  color: var(--brand);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 32px;
  bottom: 4px;
  width: 1px;
  background: var(--line);
}

/* 材料 / 成本 */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; }
.chip {
  padding: 4px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
}
.costline {
  margin: 0;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--ink-2);
}

/* 去哪儿 / 房间 / 办公时间 */
.placegrid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 1px;
  margin: 10px 0 0;
  overflow: hidden;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.placegrid > div { padding: 9px 12px; background: var(--surface-2); min-width: 0; }
.placegrid dt { font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; }
.placegrid dd { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; word-break: break-word; }

/* 坑点 */
.pits { margin: 0; padding: 0; list-style: none; }
.pits li {
  position: relative;
  padding: 0 0 14px 26px;
  font-size: 15px;
  line-height: 1.7;
}
.pits li::before {
  content: "×";
  position: absolute;
  left: 6px;
  top: -1px;
  color: var(--warn);
  font-size: 15px;
  font-weight: 700;
}
.pits li:last-child { padding-bottom: 0; }

/* 来源与时效 */
.srcbox {
  padding: 16px 16px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.srclist { margin: 0 0 14px; padding: 0; list-style: none; }
.srclist li {
  padding: 9px 0;
  font-size: 13px;
  line-height: 1.6;
  border-bottom: 1px dashed var(--line-soft);
}
.srclist li:first-child { padding-top: 0; }
.srclist li:last-child { border-bottom: 0; padding-bottom: 0; }
.srclist .stype {
  display: inline-block;
  margin-right: 7px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-3);
}
.srclist .sref { color: var(--ink-3); font-size: 12px; }

.factgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.factgrid > div { padding: 9px 12px; background: var(--surface-2); }
.factgrid dt { font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; }
.factgrid dd { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }

/* 待核验字段：虚线下划线 + 极浅底 */
.todo {
  padding: 0 2px;
  background: var(--warn-wash);
  border-bottom: 1px dashed var(--warn);
  color: var(--warn);
  font-size: 0.94em;
  border-radius: 2px;
  cursor: help;
}

/* 还差什么 / 待采集清单 */
.pending {
  margin-top: 34px;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
}
.pending summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
}
.pending summary::-webkit-details-marker { display: none; }
.pending summary .cnt {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--warn-wash);
  color: var(--warn);
  font-size: 11px;
  font-weight: 600;
}
.pending summary .arrow { margin-left: auto; color: var(--ink-3); transition: transform 0.2s; }
.pending[open] summary .arrow { transform: rotate(90deg); }
.pending .inner { padding: 0 16px 16px; }
.pending ol { margin: 0; padding-left: 20px; }
.pending li { padding: 6px 0; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.pending li .from { color: var(--ink-3); }
.pending .lead {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
}

/* 底部操作条 */
.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.actionbar .inner {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
}
.act {
  flex: 1;
  padding: 11px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.act:hover { border-color: var(--brand); color: var(--brand); }
.act.on {
  border-color: var(--brand);
  background: var(--brand-wash);
  color: var(--brand);
  font-weight: 600;
}

/* ---------- 六格筛选页 ---------- */
.packtitle {
  padding: 25px 0 4px;
}
.packtitle h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 700;
}
.packtitle p { margin: 6px 0 0; color: var(--ink-3); font-size: 13px; }

/* ---------- 关于页 ---------- */
.prose { font-size: 15px; line-height: 1.8; }
.prose h2 {
  margin: 40px 0 12px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.prose h2:first-child { margin-top: 26px; }
.prose p { margin: 0 0 14px; color: var(--ink-2); }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; color: var(--ink-2); }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose blockquote {
  margin: 0 0 18px;
  padding: 14px 18px;
  background: var(--brand-wash);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
}
.prose blockquote p { margin: 0; color: var(--ink); }

.lvtable {
  width: 100%;
  margin: 0 0 20px;
  border-collapse: collapse;
  font-size: 13px;
}
.lvtable th, .lvtable td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  line-height: 1.6;
}
.lvtable th {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.lvtable td:first-child { width: 92px; white-space: nowrap; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 0 20px;
  overflow: hidden;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.stat-row > div {
  padding: 16px 14px;
  background: var(--surface);
}
.stat-row b {
  display: block;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat-row span { font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }

/* 数据面板 */
.panel { font-size: 14px; }
.panel table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 22px;
  font-size: 13px;
}
.panel th, .panel td {
  padding: 9px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}
.panel th {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 600;
}
.panel td.num { text-align: right; font-variant-numeric: tabular-nums; }
.panel .btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.btn {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-2);
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn:disabled:hover { border-color: var(--line); color: var(--ink-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); color: #fff; }
.btn.primary:disabled:hover { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) {
  .btn.primary { color: #0d1a17; }
  .btn.primary:hover { color: #0d1a17; }
}

/* ---------- 提示条 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 90;
  transform: translate(-50%, 16px);
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 56px;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.8;
}
.foot p { margin: 0 0 6px; }
.foot a { color: var(--ink-2); }

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .fade { animation: fade 0.3s ease both; }
  @keyframes fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
  }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}


/* ==========================================================================
   提问墙
   ========================================================================== */

/* ---------- 列表页顶部动作区 ---------- */
.wall-bar { margin: 22px 0 18px; }
.wall-bar .btn.primary {
  display: block;
  padding: 12px 16px;
  text-align: center;
  font-size: 14px;
}
.wall-hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
  text-align: center;
}
@media (min-width: 620px) {
  .wall-bar { display: flex; align-items: center; gap: 14px; }
  .wall-bar .btn.primary { display: inline-block; padding: 10px 22px; }
  .wall-hint { margin: 0; text-align: left; }
}

/* ---------- 一条提问 ---------- */
.qitem {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 14px 16px 14px 19px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 0.16s, box-shadow 0.16s;
}
/* 左侧竖条：回答过的才有颜色，扫一眼就能分出「有答案的」 */
.qitem::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  bottom: 15px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}
.qitem.answered::before { background: var(--brand); }
.qitem:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.qitem:active { border-color: var(--brand); }

.qrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.qst {
  flex: 0 0 auto;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  border-radius: 999px;
}
.qst.answered { color: var(--brand); background: var(--brand-wash); }
.qst.open { color: var(--warn); background: var(--warn-wash); }
.qcat { font-size: 11px; color: var(--ink-3); }
.qtime {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
}
.qtitle {
  display: block;
  font-family: var(--serif);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  word-break: break-word;
}
.qmeta { display: block; margin-top: 7px; font-size: 12px; color: var(--ink-3); }

/* ---------- 加载骨架 ---------- */
.qskel {
  padding: 15px 16px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.skel {
  display: block;
  height: 10px;
  border-radius: 4px;
  background: var(--line-soft);
  animation: skelPulse 1.35s ease-in-out infinite;
}
.skel.s1 { width: 34%; height: 12px; }
.skel.s2 { width: 76%; height: 16px; margin-top: 11px; }
.skel.s3 { width: 26%; margin-top: 11px; }
@keyframes skelPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ---------- 详情页 ---------- */
.crumb { color: inherit; text-decoration: none; }
.crumb:hover { color: var(--brand); }
.qbyline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-3);
}
.qbyline .qtime { margin-left: 0; }
/* 提问人自己的补充说明：压低一级，不跟回答抢 */
.qdetail {
  margin: 20px 0 0;
  padding: 12px 16px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-2);
  background: var(--surface-2);
  border-left: 3px solid var(--line);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.answers { margin-top: 30px; }
.ans-head {
  padding-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-soft);
}
.ans-empty {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-3);
}
.qfoot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.answer {
  margin-top: 14px;
  padding: 14px 15px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.answer.staff {
  background: var(--brand-wash);
  border-color: var(--brand);
}
.answer-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.wall-time {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
}
.staff-tag {
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
}
.answer .body {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 表单 ---------- */
.fgroup { margin-top: 28px; }
.fgroup-head {
  padding-bottom: 8px;
  margin-bottom: 2px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-soft);
}
.flabel {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 18px 0 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.fgroup-head + .flabel { margin-top: 16px; }
.fneed,
.fopt {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
}
.finput {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
}
.finput:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-wash);
}
.finput::placeholder { color: var(--ink-3); opacity: 0.75; }
textarea.finput {
  resize: vertical;
  min-height: 96px;
}
.fcount {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.fhint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-3);
}
.fsubmit {
  display: block;
  width: 100%;
  margin-top: 32px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
}
.fnote {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
}

/* appearance:none 之后必须自己给箭头，否则看不出是下拉 */
select.finput {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  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.5L6 6.5l5-5' fill='none' stroke='%238a8680' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

@media (prefers-color-scheme: dark) {
  .staff-tag {
    color: #0d1a17;
  }
}


/* ==========================================================================
   底部导航
   ========================================================================== */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  backdrop-filter: saturate(1.5) blur(16px);
  -webkit-backdrop-filter: saturate(1.5) blur(16px);
  border-top: 1px solid var(--line-soft);
}
.tabbar[hidden] { display: none; }

.tab {
  flex: 1 1 0;
  max-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px 5px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}
.tab svg { width: 21px; height: 21px; }
.tab:active { background: var(--brand-wash); }
.tab.on { color: var(--brand); }
.tab.on span { font-weight: 600; }

body.has-tabbar .wrap { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }


/* ==========================================================================
   账号：登录、注册、我的
   ========================================================================== */

.authcard {
  margin-top: 26px;
  padding: 22px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.authcard h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 19px;
}
.authcard .sub { margin: 0 0 18px; font-size: 13px; color: var(--ink-3); line-height: 1.7; }

.whocard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.avatar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--brand-wash);
  color: var(--brand);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
}
.whoname { font-size: 17px; font-weight: 600; color: var(--ink); }
.whosub { margin-top: 3px; font-size: 12px; color: var(--ink-3); }

.statrow {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.statbox {
  flex: 1 1 0;
  padding: 12px 8px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.statbox b { display: block; font-family: var(--serif); font-size: 20px; color: var(--ink); }
.statbox span { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-3); }

.roletag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-wash);
  border-radius: 999px;
  vertical-align: middle;
}

.mylist { margin-top: 8px; }
.myitem {
  display: block;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 8px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.myitem:hover { border-color: var(--brand); }
.myitem .t { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.myitem .m { margin-top: 5px; font-size: 11px; color: var(--ink-3); }

.logout {
  display: block;
  width: 100%;
  margin-top: 26px;
  padding: 12px;
  font-size: 14px;
  color: var(--warn);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.logout:hover { border-color: var(--warn); }


/* ==========================================================================
   论坛
   ========================================================================== */

.forum-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 14px;
}
.forum-actions .btn.primary { flex: 0 0 auto; padding: 9px 20px; text-align: center; }
.forum-actions .segmented { margin-left: auto; }

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}
.segmented a {
  padding: 5px 13px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
  text-decoration: none;
  border-radius: 999px;
  white-space: nowrap;
}
.segmented a.on {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07);
}

.boardchips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.boardchips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 5px 13px;
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .chip.on { color: #0d1a17; }
}

.postcard {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 14px 16px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 0.16s, box-shadow 0.16s;
}
.postcard:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.postrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.boardtag {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}
.pintag {
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  color: var(--warn);
  background: var(--warn-wash);
  border-radius: 999px;
}
.posttime { margin-left: auto; font-size: 11px; color: var(--ink-3); }
.posttitle {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  word-break: break-word;
}
.postmeta {
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.postmeta .dot { opacity: 0.5; }

/* 帖子详情 */
.postbyline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-3);
}
.postbyline .qtime { margin-left: 0; }
.postbody {
  margin-top: 20px;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  white-space: pre-wrap;
  word-break: break-word;
}

.replies { margin-top: 4px; }
.reply {
  padding: 14px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.reply:last-child { border-bottom: 0; }
.reply-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 13px;
  color: var(--ink-2);
}
.reply-top b { font-weight: 600; }
.floornum { font-size: 11px; color: var(--ink-3); }
.reply .body {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.loginprompt {
  margin-top: 24px;
  padding: 18px;
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
}
.loginprompt p { margin: 0 0 14px; font-size: 13px; color: var(--ink-3); }

.replyform {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}
.replyform .btn { align-self: flex-end; padding: 10px 26px; }

/* 发帖：选板块 */
.boardpick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.boardopt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 13px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.boardopt b { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.boardopt span { font-size: 11px; color: var(--ink-3); }
.boardopt.on { border-color: var(--brand); background: var(--brand-wash); }
.boardopt.on b { color: var(--brand); }


/* ==========================================================================
   管理后台
   ========================================================================== */

.admintabs { margin: 22px 0 4px; }

.adminsum {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 20px;
}
.adminsum span {
  padding: 7px 12px;
  font-size: 12px;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}
.adminsum b {
  margin-right: 4px;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
}

.adminitem {
  padding: 16px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.adminq {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  word-break: break-word;
}
.admindetail {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-3);
  word-break: break-word;
}
.adminmeta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-3);
}
.adminanswers { margin-top: 12px; }
.adminanswers .answer { margin-top: 8px; }
.staff-tag.plain {
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-weight: 500;
}

.adminops {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.adminops .btn { font-size: 12px; padding: 7px 13px; }

.rejectbox { margin-top: 12px; }

.draft {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.draft-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-soft);
}
.draft-head .minibtn { margin-left: auto; }
.minibtn {
  padding: 4px 11px;
  font-size: 11px;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: 999px;
}
.draft pre {
  margin: 0;
  padding: 12px;
  max-height: 340px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--paper);
}

.userrow { display: flex; align-items: center; gap: 12px; }
