/* 文字一律黑色；小圆角；移动端优先 */
:root {
  --ink: #000;
  --bg: #fff;
  --surface: #fff;
  --primary: #223F5C;
  --accent: #F1772B;
  --deep: #382114;
  --line: #d9d9d9;
  --tint: rgba(34, 63, 92, .07);
  --hl: rgba(241, 119, 43, .14);
  --radius: 3px;
}
.theme-feiji {
  --bg: #FDFCFA; --surface: #fff;
  --primary: #223F5C; --accent: #F1772B; --deep: #382114;
  --line: #d6dbe1; --tint: rgba(34, 63, 92, .06); --hl: rgba(241, 119, 43, .14);
}
.theme-yibao {
  /* 档案蓝 / 青铜绿 / 暖金 / 竹简黄，朱砂红只作点缀 */
  --bg: #fff; --surface: #fff;
  --primary: #24466F; --accent: #4E7D6B; --gold: #C59A3E; --bamboo: #E3CF95; --cinnabar: #B8322A;
  --deep: #24466F;
  --line: #d5dbe3; --tint: rgba(36, 70, 111, .06); --hl: rgba(197, 154, 62, .18);
}
.theme-zhenghe {
  /* 复古航海：羊皮纸底 + 海蓝 */
  --bg: #F0E3C4; --surface: #FFFCF4;
  --primary: #1D5A80; --accent: #A0522D; --deep: #5B3A1E;
  --line: #d3c29b; --tint: rgba(29, 90, 128, .07); --hl: rgba(29, 90, 128, .12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
a { color: var(--ink); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { margin: 0; line-height: 1.35; }

/* ---------- 首页 ---------- */
.theme-home { background: #fff; }
.home-head { border-top: 6px solid #222; padding: 28px 0 8px; }
.home-head h1 { font-size: 24px; }
.home-head p { margin: 10px 0 0; font-size: 15px; }
.cards { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 14px; }
.card {
  display: block; text-decoration: none; padding: 18px 18px 16px; border: 1px solid #ccc;
  border-left-width: 8px; border-radius: var(--radius); background: #fff;
}
.card:active { transform: translateY(1px); }
.card span { display: block; }
.card-team { font-size: 13px; }
.card-title { font-size: 22px; font-weight: 700; margin-top: 2px; }
.card-sub { font-size: 14px; }
.card-count { font-size: 13px; margin-top: 8px; }
.card-feiji { border-left-color: #223F5C; box-shadow: inset 0 -3px 0 #F1772B; }
.card-yibao { border-left-color: #24466F; box-shadow: inset 0 -3px 0 #C59A3E; }
.card-zhenghe { border-left-color: #1D5A80; background: #F6ECD4; box-shadow: inset 0 -3px 0 #A0522D; }
.foot { font-size: 13px; margin: 24px 0 40px; }

/* ---------- 项目页头 ---------- */
.proj-head { background: var(--surface); border-top: 6px solid var(--primary); border-bottom: 1px solid var(--line); padding: 14px 0 16px; }
.back { font-size: 14px; text-decoration: none; display: inline-block; padding: 4px 0; }
.proj-team { margin-top: 6px; font-size: 13px; display: inline-block; padding: 1px 8px; border: 1px solid var(--primary); border-radius: var(--radius); }
.proj-head h1 { font-size: 26px; margin-top: 6px; }
.proj-sub { font-size: 14px; margin-top: 2px; }
.theme-feiji .proj-head { box-shadow: inset 0 -3px 0 var(--accent); }
.theme-yibao .proj-head { box-shadow: inset 0 -3px 0 var(--gold); }
.theme-yibao .proj-head h1::after { content: ""; display: inline-block; width: 9px; height: 9px; background: var(--cinnabar); margin-left: 8px; vertical-align: middle; }
.theme-zhenghe .proj-head { box-shadow: inset 0 -3px 0 var(--accent); }

/* 页码跳转条 */
.pnav {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px;
  background: var(--surface); border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.pnav::-webkit-scrollbar { display: none; }
.pnav a { flex: 0 0 auto; font-size: 13px; text-decoration: none; padding: 2px 9px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }

/* ---------- 整体建议 ---------- */
.overall { margin-top: 16px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); }
.overall h2 { font-size: 18px; }
.hint { font-size: 14px; margin: 4px 0 10px; }
.overall-list-head { font-size: 13px; margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }
.tip { margin: 18px 0 4px; font-size: 14px; padding: 8px 12px; background: var(--tint); border-radius: var(--radius); }

/* ---------- 正文 ---------- */
.page { margin-top: 18px; padding: 12px 12px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 52px; }
.page-no { font-size: 14px; display: inline-block; padding: 0 8px; color: #fff; background: var(--primary); border-radius: 2px; margin-bottom: 6px; }
.theme-yibao .page { border-left: 4px solid var(--bamboo); }
.theme-zhenghe .page-no { background: var(--primary); }
.sent-wrap { border-bottom: 1px dashed var(--line); }
.sent-wrap:last-child { border-bottom: 0; }
.sent {
  position: relative; display: block; padding: 8px 34px 8px 6px; margin: 0 -6px; cursor: pointer;
  border-radius: var(--radius); -webkit-tap-highlight-color: transparent; font-size: 17px;
}
.sent:hover { background: var(--tint); }
.sent:focus-visible { outline: 2px solid var(--primary); outline-offset: 0; }
.sent.has .sent-text { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.sent.open { background: var(--hl); }
.badge {
  position: absolute; right: 4px; top: 9px; min-width: 22px; height: 22px; padding: 0 6px; font-size: 12px; line-height: 22px;
  text-align: center; color: #fff; background: var(--accent); border-radius: 11px; font-weight: 700;
}
.theme-yibao .badge { background: var(--accent); }

/* 建议列表 */
.sug-list { list-style: none; margin: 8px 0 0; padding: 0; }
.sent-sugs { margin: 0 0 8px 6px; padding-left: 10px; border-left: 3px solid var(--accent); }
.sug { padding: 6px 0; border-bottom: 1px solid rgba(0, 0, 0, .06); font-size: 15px; }
.sug:last-child { border-bottom: 0; }
.sug-text { white-space: pre-wrap; word-break: break-word; }
.sug-meta { font-size: 12px; display: flex; gap: 10px; }
.sug-author { font-weight: 600; }
.sug-meta { align-items: center; flex-wrap: wrap; }
.sug-mine { padding: 0 5px; border: 1px solid var(--accent); border-radius: 2px; }
.sug-del { font-size: 12px; padding: 0 2px; margin-left: auto; }

/* 表单 */
.slot:not(:empty) { margin: 4px 0 10px; padding: 10px; background: var(--tint); border-radius: var(--radius); }
.form-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.link { background: none; border: 0; padding: 4px 2px; font-size: 13px; text-decoration: underline; color: var(--ink); cursor: pointer; }
.sug-form textarea, .sug-form input[type=text] {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1px solid #b9b9b9; border-radius: var(--radius); padding: 8px 10px;
}
.sug-form textarea { resize: vertical; min-height: 84px; display: block; }
.sug-form textarea:focus, .sug-form input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.form-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.form-row input[type=text] { flex: 1 1 auto; min-width: 0; }
.count { font-size: 12px; flex: 0 0 auto; }
.btn {
  flex: 0 0 auto; font: inherit; font-size: 16px; font-weight: 600; padding: 8px 18px; color: #fff; background: var(--primary);
  border: 0; border-radius: var(--radius); cursor: pointer;
}
.btn:disabled { opacity: .6; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: #111; color: #fff; padding: 10px 16px; border-radius: var(--radius); font-size: 15px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #8a1f17; }

@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .home-head h1 { font-size: 28px; }
}
