:root {
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e7ebf1;
  --line-2: #d5dbe4;
  --bg: #f5f7fb;
  --card: #ffffff;
  --soft: #f2f5f9;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-deep: #0f2c52;
  --accent-soft: #e8f0fe;
  --ok-bg: #e8f5e9;
  --ok-line: #bfe3c2;
  --ok-ink: #1e7b34;
  --warn-bg: #fdf3e0;
  --warn-ink: #9a5b06;
  --bad-bg: #fdecec;
  --bad-line: #f5c6c6;
  --bad-ink: #b42323;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, 0.05), 0 6px 16px rgba(16, 24, 40, 0.07);
  --ring: 0 0 0 3.5px rgba(37, 99, 235, 0.16);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}
.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16.5px;
  color: var(--ink);
  letter-spacing: 0.2px;
  white-space: nowrap;
  flex: none;
}
.brand::before {
  content: "";
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 3px, transparent 3.5px),
    linear-gradient(135deg, #2f7cf6, #1d4ed8);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35);
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--accent); }
.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  font-size: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--ink-2);
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--soft); text-decoration: none; }
.nav a.on { color: var(--accent-2); font-weight: 600; background: var(--accent-soft); }

.userbox { flex: none; }
.loginlink {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff !important;
  background: linear-gradient(135deg, #2f7cf6, #1d4ed8);
  padding: 7px 15px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.35);
}
.loginlink:hover { text-decoration: none; filter: brightness(1.06); }
.usermenu { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; }
.usermenu .uname { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
a.uname:hover { color: var(--accent); text-decoration: none; }
.usermenu .uname small {
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
  font-size: 12px;
}
.usermenu a { color: var(--muted); font-size: 13px; }
.usermenu a:hover { color: var(--bad-ink); }

/* ---------- 通用排版 ---------- */
h1 { font-size: 27px; line-height: 1.28; margin: 34px 0 10px; letter-spacing: -0.4px; font-weight: 700; }
h2 { font-size: 18px; margin: 32px 0 12px; letter-spacing: -0.2px; }
h3 { font-size: 15.5px; margin: 22px 0 8px; }
p { margin: 10px 0; }
.lede { color: var(--muted); margin: 0 0 24px; font-size: 15.5px; }
.muted { color: var(--muted); font-size: 13px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }

/* ---------- 卡片 ---------- */
.cards { display: grid; gap: 14px; margin: 18px 0; }
@media (min-width: 620px) { .cards.two { grid-template-columns: 1fr 1fr; } }
@media (min-width: 700px) { .cards.three { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: inherit;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.card:hover {
  border-color: #b9d2f9;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.card .t { font-weight: 600; font-size: 16px; }
.card .d { color: var(--muted); font-size: 13.5px; margin-top: 5px; line-height: 1.65; }
.card .k { font-size: 12.5px; color: var(--accent); margin-top: 10px; font-weight: 500; }
.card.dl .t .badge { margin-left: 2px; }

.linklist { border-top: 1px solid var(--line); margin: 14px 0 8px; }
.linklist a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  border-radius: 10px;
}
.linklist a:hover { text-decoration: none; background: #fff; box-shadow: var(--shadow-sm); }
.linklist .t { font-weight: 500; font-size: 15px; }
.linklist .d { color: var(--muted); font-size: 13px; margin-top: 2px; }
.linklist .arrow { color: var(--muted); font-size: 14px; flex: none; }
.linklist a:hover .arrow { color: var(--accent); }

/* ---------- 表单 ---------- */
form.calc { margin: 20px 0 8px; }
.grid { display: grid; gap: 14px; }
@media (min-width: 560px) { .grid.c2 { grid-template-columns: 1fr 1fr; } .grid.c3 { grid-template-columns: repeat(3, 1fr); } }
.field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 6px;
  font-weight: 500;
}
.field .hint { font-weight: 400; color: var(--muted); }

.mini {
  margin-left: auto;
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  overflow: hidden;
  flex: none;
}
.mini button {
  border: 0;
  background: #fff;
  font-family: inherit;
  font-size: 11.5px;
  line-height: 1.5;
  padding: 3px 9px;
  color: var(--muted);
  cursor: pointer;
}
.mini button.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 500; }

input[type="text"], input:not([type]), input[type="number"], input[type="password"], input[type="email"], select, textarea {
  width: 100%;
  font-size: 16.5px;
  font-family: inherit;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm);
}
textarea { font-size: 15.5px; line-height: 1.7; resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: #98a2b3; }
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.field.bad input { border-color: #d9534f; }

.seg { display: flex; gap: 0; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
.seg button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 11px 0;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink-2);
  cursor: pointer;
}
.seg button.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 500; }

.actions { display: flex; gap: 10px; margin-top: 18px; }
.btn {
  border: 0;
  background: linear-gradient(135deg, #2f7cf6, #1d4ed8);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: filter 0.15s, transform 0.1s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.btn.ghost {
  background: #fff;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }

/* ---------- 结果 ---------- */
.result {
  margin: 24px 0 6px;
  border: 1px solid #cfe0f7;
  background: linear-gradient(180deg, #f5f9ff, #ffffff);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  box-shadow: var(--shadow-sm);
}
.result .cap { font-size: 12px; color: var(--accent-2); letter-spacing: 0.6px; margin-bottom: 10px; font-weight: 600; }
.rx {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: 0.5px;
  line-height: 1.35;
  color: var(--accent-deep);
  word-break: break-word;
}
.rx small { font-size: 15px; font-weight: 400; color: var(--ink-2); }
.rx + .rx { margin-top: 2px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin-top: 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.flag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.flag.ok { background: var(--ok-bg); color: var(--ok-ink); }
.flag.warn { background: var(--warn-bg); color: var(--warn-ink); }
.flag.bad { background: var(--bad-bg); color: var(--bad-ink); }

.err { color: var(--bad-ink); font-size: 13.5px; margin-top: 10px; }

/* ---------- 提示块 ---------- */
.note {
  border-left: 3px solid var(--line-2);
  padding: 2px 0 2px 14px;
  color: var(--ink-2);
  font-size: 14px;
  margin: 20px 0;
}
.note.warn {
  border-left-color: #e2a33c;
  background: var(--warn-bg);
  padding: 13px 15px;
  border-radius: 0 10px 10px 0;
}
.note b { color: var(--ink); }

.formula {
  background: var(--soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 18px 0;
}
.formula code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--accent-2);
}

.disclaimer {
  margin: 34px 0 44px;
  padding: 15px 17px;
  background: var(--soft);
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}
.disclaimer b { color: var(--ink-2); }

/* ---------- 宽版与双栏工具 ---------- */
/* 全站统一容器宽度；宽版类保留但不再加宽（历史页面还在传 wide: true） */
.wrap.wide { max-width: 1000px; }

/* 阅读型内容在统一容器内收窄，行长才舒服 */
.reading { max-width: 730px; margin-inline: auto; }

.split { display: grid; gap: 16px; margin: 22px 0 8px; }
.split > * { min-width: 0; }
@media (min-width: 880px) {
  .split { grid-template-columns: 330px 1fr; align-items: start; gap: 20px; }
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  background: var(--card);
  min-width: 0;
  box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 16px; }
.panel-title {
  font-size: 12px;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  color: var(--accent-deep);
}
.stat .v small { font-size: 14px; color: var(--muted); font-weight: 400; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

tr.hl td { background: var(--accent-soft); font-weight: 500; }
td .name-en { color: var(--muted); font-size: 12px; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent-2);
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 500;
}
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }

details {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 15px;
  margin: 10px 0;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
summary { cursor: pointer; font-weight: 500; font-size: 14px; }
details[open] summary { margin-bottom: 6px; }
details p { margin: 8px 0 2px; color: var(--ink-2); font-size: 14px; }

.figure { margin: 14px 0 6px; }
.figure svg { width: 100%; height: auto; display: block; }

/* ---------- 线性图例 ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- 结论卡 ---------- */
.verdict {
  border: 1px solid #cfe0f7;
  background: #f5f9ff;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.verdict .k { font-size: 12px; color: var(--accent-2); letter-spacing: 0.6px; font-weight: 600; }
.verdict .head { font-size: 19px; font-weight: 600; margin: 6px 0 8px; line-height: 1.4; color: var(--ink); }
.verdict p { margin: 0; font-size: 14px; color: var(--ink-2); }
.verdict .band, .band {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent-2);
  letter-spacing: 0.5px;
}

.tone-good { color: var(--ok-ink); }
.tone-warn { color: var(--warn-ink); }
.tone-bad { color: var(--bad-ink); }

/* ---------- 分段切换与标尺 ---------- */
.tabs { display: flex; gap: 6px; margin: 10px 0 6px; }
.tab {
  flex: 1;
  text-align: center;
  padding: 9px 10px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  background: #fff;
  transition: all 0.15s;
}
.tab:hover { color: var(--accent); }
.tab.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); font-weight: 600; }
.hidden { display: none !important; }
.calbox { border: 1px dashed var(--line-2); border-radius: 6px; margin: 12px 0 10px; }
.rulerwrap { overflow-x: auto; margin: 10px 0; -webkit-overflow-scrolling: touch; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* ---------- 社区 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 20px; }
.chip {
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on {
  background: linear-gradient(135deg, #2f7cf6, #1d4ed8);
  border-color: transparent;
  color: #fff;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.35);
}

.feed { display: grid; gap: 14px; }
@media (min-width: 700px) { .feed { grid-template-columns: 1fr 1fr; } }

.post-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 17px 19px 15px;
  color: inherit;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.post-card:hover {
  border-color: #b9d2f9;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.post-tag {
  display: inline-block; font-size: 11.5px; padding: 2.5px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-2); letter-spacing: .5px; font-weight: 500;
}
.post-tag.qc { background: var(--warn-bg); color: var(--warn-ink); }
.post-tag.ask { background: var(--bad-bg); color: var(--bad-ink); }
.post-tag.help { background: #e8f4fd; color: #1c6ea4; }
.post-tag.rant { background: #f3e8fd; color: #7c3aed; }
.post-tag.lens { background: var(--ok-bg); color: var(--ok-ink); }
.post-tag.gear { background: #f2f0ea; color: #5f5e5a; }
.post-card .t { font-size: 16px; font-weight: 600; margin: 9px 0 6px; line-height: 1.4; }
.post-card .d { color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.post-card .m { color: var(--muted); font-size: 12.5px; margin-top: 11px; display: flex; gap: 12px; flex-wrap: wrap; }

.article h1 { margin-top: 22px; }
.article { max-width: 730px; margin-inline: auto; }
.article .meta { color: var(--muted); font-size: 13px; margin-bottom: 18px; display: flex; gap: 14px; flex-wrap: wrap; }
.article .body { font-size: 15.5px; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap; }
.article .cover { width: 100%; border-radius: var(--radius); margin: 16px 0; border: 1px solid var(--line); }

.likebar { display: flex; gap: 10px; align-items: center; margin: 24px 0; padding-top: 16px; border-top: 1px solid var(--line); }
.like-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-2); background: #fff; border-radius: 999px;
  padding: 8px 17px; font-family: inherit; font-size: 14px; color: var(--ink-2); cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.like-btn:hover { border-color: var(--accent); color: var(--accent); }
.like-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }

/* ---------- 评论区 ---------- */
.cmt-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin-top: 18px;
}
.cmt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.cmt-head h3 { margin: 0; font-size: 15.5px; }
.cmt-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
}
.cmt-tip { font-size: 12px; color: var(--muted); margin-left: auto; }
.composer { display: flex; gap: 12px; }
.composer .cbox { flex: 1; min-width: 0; }
.identity { margin-bottom: 10px; }
.identity input { font-size: 14px; padding: 8px 12px; width: auto; min-width: 200px; }
.who-line { font-size: 13.5px; color: var(--ink-2); }
.who-line b { color: var(--ink); }
.who-login { font-size: 12.5px; margin-left: 10px; }
.composer textarea { width: 100%; min-height: 84px; resize: vertical; }
.composer-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px;
}
.cnt.warn { color: var(--bad-ink); font-weight: 600; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 15px; flex: none;
  user-select: none; letter-spacing: 0;
}
.comment {
  display: flex; gap: 12px;
  padding: 16px 2px;
  border-top: 1px solid var(--line);
}
.comment:first-child { border-top: 0; }
.comment .avatar { width: 34px; height: 34px; font-size: 13.5px; margin-top: 1px; }
.comment .cbody { flex: 1; min-width: 0; }
.comment .who { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.comment .when { font-size: 12px; color: var(--muted); margin-left: 8px; font-weight: 400; }
.comment .txt { font-size: 14.5px; color: var(--ink-2); margin-top: 4px; white-space: pre-wrap; line-height: 1.65; overflow-wrap: break-word; }

.notice { padding: 11px 15px; border-radius: 10px; font-size: 13.5px; margin: 14px 0; }
.notice.ok { background: var(--ok-bg); color: var(--ok-ink); }
/* ---------- 社区列表 ---------- */
.feed-stat { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.notice.bad { background: var(--bad-bg); color: var(--bad-ink); }

.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 48px 0; }

/* ---------- 投稿表单 ---------- */
.post-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 22px 24px 20px;
  margin: 20px 0 8px;
}
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip {
  border: 1px solid var(--line-2); background: #fff; color: var(--ink-2);
  border-radius: 999px; padding: 7px 15px; font-size: 13.5px;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.cat-chip:hover { border-color: var(--accent); color: var(--accent); }
.cat-chip.on {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent-2); font-weight: 600;
}
.title-row { position: relative; }
.title-row input { padding-right: 74px; }
.title-count {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.title-count.warn, .cnt.warn { color: var(--bad-ink); font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; }
.body-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.cnt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.upload-box {
  border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 22px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted); font-size: 13.5px; cursor: pointer;
  transition: all 0.15s; background: #fbfcfe;
}
.upload-box:hover { border-color: var(--accent); color: var(--accent); background: #fafcff; }
.upload-thumb { position: relative; display: inline-block; }
.upload-thumb img {
  max-width: 100%; max-height: 300px; border-radius: 12px;
  border: 1px solid var(--line); display: block;
}
.upload-remove {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(15, 23, 42, 0.65); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s;
}
.upload-remove:hover { background: rgba(15, 23, 42, 0.85); }

/* ---------- 质检 ---------- */
.qc-verdict {
  border-radius: var(--radius); padding: 17px 19px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  box-shadow: var(--shadow-sm);
}
.qc-verdict.pass { background: var(--ok-bg); border: 1px solid var(--ok-line); }
.qc-verdict.fail { background: var(--bad-bg); border: 1px solid var(--bad-line); }
.qc-verdict .big { font-size: 22px; font-weight: 600; }
.qc-verdict.pass .big { color: var(--ok-ink); }
.qc-verdict.fail .big { color: var(--bad-ink); }
.qc-verdict .sub { font-size: 13px; color: var(--muted); }

.ok-mark { color: var(--ok-ink); font-weight: 500; }
.bad-mark { color: var(--bad-ink); font-weight: 500; }

/* ---------- 登录墙与账号 ---------- */
.authwall {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f8faff);
  box-shadow: var(--shadow-sm);
  padding: 44px 24px;
  text-align: center;
  margin: 20px 0 28px;
}
.aw-icon {
  width: 58px; height: 58px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-2);
}
.aw-t { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.aw-d { color: var(--muted); font-size: 14px; max-width: 400px; margin: 8px auto 18px; }
.authwall .btn { display: inline-block; padding: 11px 30px; }
.aw-note { color: var(--muted); font-size: 12.5px; margin-top: 14px; }

.authpage { display: flex; justify-content: center; padding: 26px 0 10px; }
.authcard {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  padding: 26px 28px 24px;
}
.authcard .tabs { margin: 0 0 4px; }
.authcard .btn { width: 100%; margin-top: 4px; }

/* 邮箱验证码输入组：输入框与按钮等高、同圆角 */
.code-row { display: flex; gap: 10px; align-items: stretch; }
.code-row input { flex: 1; min-width: 0; letter-spacing: 4px; }
.code-row .code-btn {
  flex: none;
  width: auto;          /* 覆盖 .authcard .btn 的 width:100%，别把输入框挤没了 */
  margin-top: 0;
  padding: 0 18px;
  font-size: 14px;
  white-space: nowrap;
}

/* ---------- 个人中心 ---------- */
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar {
  width: 58px; height: 58px; flex: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2f7cf6, #1d4ed8);
  color: #fff; font-size: 24px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.3);
}
.ph-main { flex: 1; min-width: 160px; }
.ph-name { font-size: 18px; }
.ph-name .badge { margin-left: 8px; }
.ph-points { min-width: 130px; }
.ph-points .stat { text-align: center; }

/* ---------- Markdown 正文与编辑器 ---------- */
.md-toolbar {
  display: flex; align-items: center; gap: 2px;
  border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: var(--soft); padding: 5px 8px;
}
.md-toolbar button {
  border: 0; background: transparent; color: var(--ink-2);
  width: 30px; height: 28px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-family: inherit; font-size: 12.5px;
}
.md-toolbar button:hover { background: #e6ebf2; color: var(--accent); }
.md-tools-right { margin-left: auto; display: inline-flex; gap: 4px; }
.md-tools-right button { width: auto; padding: 0 12px; font-weight: 500; }
.md-tools-right button.on { background: var(--accent-soft); color: var(--accent-2); }
.field textarea#body { border-radius: 0 0 10px 10px; }
.md-preview {
  border: 1px solid var(--line-2); border-radius: 10px;
  background: #fff; padding: 14px 16px; min-height: 180px;
  font-size: 15px; line-height: 1.8;
}
.md-body h3, .md-body h4, .md-body h5, .md-body h6 { margin: 18px 0 8px; }
.md-body blockquote {
  margin: 12px 0; padding: 6px 0 6px 14px;
  border-left: 3px solid var(--accent); color: var(--ink-2);
  background: #f8faff; border-radius: 0 8px 8px 0;
}
.md-body pre {
  background: #0f172a; color: #e2e8f0; border-radius: 10px;
  padding: 12px 14px; overflow-x: auto; font-size: 13.5px; margin: 12px 0;
}
.md-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  background: var(--soft); border-radius: 4px; padding: 1px 5px;
}
.md-body pre code { background: transparent; padding: 0; color: inherit; }
.md-body ul, .md-body ol { padding-left: 22px; margin: 10px 0; }
.md-body li { margin: 4px 0; }
.md-body .md-img { max-width: 100%; border-radius: 10px; margin: 10px 0; }
.md-body hr { margin: 16px 0; }

/* ---------- 后台 ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 18px 0 4px; }
.stat-cards .stat { text-align: center; padding: 14px 10px; }
.stat-cards .stat .v { font-size: 24px; }
.stat.tone-bad { background: var(--bad-bg); border-color: var(--bad-line); }
.stat.tone-bad .v { color: var(--bad-ink); }
.stat.tone-warn { background: var(--warn-bg); border-color: #eed3a8; }
.stat.tone-warn .v { color: var(--warn-ink); }

.admin-item { margin: 12px 0; }
.ai-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ai-head .post-tag { flex: none; }
.ai-body {
  font-size: 14px; color: var(--ink-2); line-height: 1.7;
  background: var(--soft); border-radius: 10px; padding: 10px 13px;
  white-space: pre-wrap; word-break: break-word;
}
.ai-ops { display: flex; gap: 8px; margin-top: 10px; }
.ai-ops .btn { padding: 8px 16px; font-size: 13.5px; }
.btn.danger { color: var(--bad-ink); }
.btn.danger:hover { border-color: var(--bad-ink); }
.adj { display: inline-flex; gap: 6px; align-items: center; }
.adj input { font-size: 14px !important; box-shadow: none; }

/* ---------- 图标 ---------- */
.cicon {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-2);
  margin-bottom: 12px;
}
.card:hover .cicon { background: linear-gradient(135deg, #2f7cf6, #1d4ed8); color: #fff; }
.cicon svg { display: block; }
.dl-icon { background: var(--ok-bg); color: var(--ok-ink); }
.card:hover .dl-icon { background: linear-gradient(135deg, #34a853, #1e7b34); color: #fff; }

.pts-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--warn-ink); background: var(--warn-bg);
  border-radius: 999px; padding: 2px 9px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
/* 资料下载的未登录入口：小锁形胶囊，不挡内容 */
.dl-lock {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-2);
  background: var(--soft); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 7px 14px;
  text-decoration: none; transition: all 0.15s;
}
.dl-lock:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- 通用弹窗 ---------- */
.ui-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: ui-fade 0.15s ease-out;
}
@keyframes ui-fade { from { opacity: 0; } to { opacity: 1; } }
.ui-modal {
  background: #fff; border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3);
  max-width: 380px; width: 100%;
  padding: 24px 26px 22px;
  animation: ui-pop 0.18s ease-out;
  text-align: center;
}
@keyframes ui-pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ui-title { margin: 0 0 10px; font-size: 17px; color: var(--ink); }
.ui-msg { font-size: 14px; line-height: 1.75; color: var(--ink-2); margin-bottom: 18px; overflow-wrap: break-word; }
.ui-modal .btn { min-width: 140px; }

/* 联系卡：邮箱 + 微信一行放下 */
.contact-card {
  display: flex; gap: 26px; align-items: center; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-sm); padding: 20px 24px; margin: 16px 0 8px;
}
.cc-left { flex: 1; min-width: 260px; }
.cc-label {
  font-size: 12px; color: var(--muted); font-weight: 600;
  letter-spacing: 0.5px; margin-bottom: 5px;
}
.cc-mail { font-size: 17px; font-weight: 600; }
.cc-note { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 8px 0 0; }
.cc-right { display: flex; align-items: center; gap: 14px; }
.cc-right img {
  width: 108px; height: auto; border-radius: 10px;
  border: 1px solid var(--line); display: block;
}

/* ---------- 打印用 PD 尺 ---------- */
.printarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 16px 0;
  background: #fff;
}
.printarea h3 { margin-top: 0; }
.calibline { width: 85.6mm; max-width: 100%; height: 5mm; border: 0.3mm solid #111; }
.printnote { font-size: 13px; color: var(--muted); }

/* 打印尺必须是真实尺寸，不能被全局 svg 规则拉成 100% */
svg#printruler { width: 187mm; height: 26mm; display: block; }

@media print {
  .topbar, footer, .noprint, .wrap > h1, .wrap > .lede, .wrap > h2,
  .wrap > .panel, .wrap > .split, .wrap > .linklist, .wrap > .recent,
  .authwall, #authwall { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .printarea { display: block !important; border: 0; padding: 0; margin: 0; }
  body { font-size: 11pt; background: #fff; }
}

.tablewrap { overflow-x: auto; margin: 16px 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; color: var(--ink-2); background: var(--soft); font-size: 12.5px; letter-spacing: 0.3px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: #f7faff; }

.ver {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 18px 0;
  font-size: 13.5px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.ver dl { display: grid; grid-template-columns: 84px 1fr; gap: 6px 12px; margin: 0; }
.ver dt { color: var(--muted); }
.ver dd { margin: 0; }

/* ---------- 文章 ---------- */
article.post { max-width: 730px; margin-inline: auto; }
article.post h2 { margin-top: 32px; }
article.post ul, article.post ol { padding-left: 22px; }
article.post li { margin: 6px 0; }
article.post blockquote {
  margin: 18px 0;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--accent);
  color: var(--ink-2);
}
article.post .meta { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

/* ---------- 首页 hero ---------- */
.hero {
  background:
    radial-gradient(1100px 380px at 85% -60%, rgba(96, 165, 250, 0.4), transparent 60%),
    radial-gradient(800px 320px at 8% 130%, rgba(37, 99, 235, 0.35), transparent 55%),
    linear-gradient(135deg, #0d2b57 0%, #123c7a 55%, #1d5fd1 100%);
  border-radius: 20px;
  padding: 40px 36px 38px;
  margin: 26px 0 8px;
  color: #fff;
  box-shadow: 0 8px 28px rgba(13, 43, 87, 0.28);
}
.hero h1 {
  margin: 0 0 10px;
  font-size: 30px;
  letter-spacing: -0.5px;
  color: #fff;
}
.hero p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 15.5px;
  max-width: 560px;
  margin: 0;
}
.hero .btn {
  background: #fff;
  color: var(--accent-deep);
  box-shadow: 0 2px 8px rgba(4, 20, 48, 0.35);
}
.hero .btn:hover { filter: brightness(0.96); }
.hero .btn.ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: none;
  backdrop-filter: blur(4px);
}
.hero .btn.ghost:hover { background: rgba(255, 255, 255, 0.2); filter: none; }

.sect-label {
  font-size: 12px;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin: 36px 0 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.steps { counter-reset: s; list-style: none; padding: 0; margin: 16px 0; }
.steps li { position: relative; padding-left: 32px; margin: 12px 0; }
.steps li::before {
  counter-increment: s;
  content: counter(s);
  position: absolute; left: 0; top: 2px;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-2);
  font-size: 12px; text-align: center; line-height: 21px; font-weight: 600;
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 54px;
  padding: 24px 0 44px;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
}
footer .links { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
footer .links a { color: var(--ink-2); }
footer .links a:hover { color: var(--accent); }

.recent { margin: 16px 0 0; }
.recent .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.recent .chip {
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm);
}
.recent .chip:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 640px) {
  .hero { padding: 30px 22px 28px; border-radius: 16px; }
  .hero h1 { font-size: 24px; }
}

@media (max-width: 480px) {
  h1 { font-size: 22px; }
  .rx { font-size: 23px; }
  .topbar .wrap { height: 54px; gap: 10px; }
  .brand { font-size: 15.5px; }
  .brand::before { width: 20px; height: 20px; }
  .nav a { padding: 5px 7px; }
  .loginlink { padding: 6px 12px; font-size: 12.5px; }
  .usermenu .uname small { display: none; }
}
