/* ============================================================
   全站样式 —— 简洁明了风格
   配色以白底 + 蓝灰主色为主，支持深色模式与自定义背景
   ============================================================ */

/* ---------- 1. 设计变量 ---------- */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f2f5f9;
  --border: #e4e9f0;
  --border-strong: #cdd7e3;

  --text: #1b2430;
  --text-soft: #4a5768;
  --text-muted: #7b8798;

  --primary: #2f6fed;
  --primary-soft: #eaf1ff;
  --primary-dark: #1f57c8;

  --ok: #17a673;
  --ok-soft: #e8f8f1;
  --warn: #e0a217;
  --warn-soft: #fdf5e3;
  --bad: #e04a4a;
  --bad-soft: #fdecec;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 35, 60, .05), 0 6px 20px rgba(20, 35, 60, .055);
  --shadow-lg: 0 10px 34px rgba(20, 35, 60, .11);

  --container: 1120px;
  --nav-h: 62px;

  --font: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei",
          system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;

  /* 供 JS 控制 */
  --bg-image: none;
  --bg-opacity: .55;
  --bg-filter: none;
  --card-alpha: .94;
  --glass-blur: 0px;
}

/* 自定义背景时，卡片默认带一点毛玻璃，正文依然清晰 */
:root.has-custom-bg .card,
:root.has-custom-bg .hobby,
:root.has-custom-bg .project,
:root.has-custom-bg .contact-card,
:root.has-custom-bg .hero {
  background: color-mix(in srgb, var(--surface) calc(var(--card-alpha) * 100%), transparent);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* 深色模式：既支持系统偏好，也支持手动切换（data-theme 优先） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10141c;
    --surface: #171d28;
    --surface-2: #1e2532;
    --border: #2a3341;
    --border-strong: #3a4657;
    --text: #e8edf4;
    --text-soft: #b3bfcf;
    --text-muted: #8593a5;
    --primary: #6d9cff;
    --primary-soft: #1c2942;
    --primary-dark: #8fb4ff;
    --ok-soft: #14301f;
    --warn-soft: #33290f;
    --bad-soft: #3a1c1c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 34px rgba(0, 0, 0, .45);
  }
}

:root[data-theme="dark"] {
  --bg: #10141c;
  --surface: #171d28;
  --surface-2: #1e2532;
  --border: #2a3341;
  --border-strong: #3a4657;
  --text: #e8edf4;
  --text-soft: #b3bfcf;
  --text-muted: #8593a5;
  --primary: #6d9cff;
  --primary-soft: #1c2942;
  --primary-dark: #8fb4ff;
  --ok-soft: #14301f;
  --warn-soft: #33290f;
  --bad-soft: #3a1c1c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 34px rgba(0, 0, 0, .45);
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 自定义背景图层（图片或渐变），由 JS 设置 --bg-image */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  opacity: var(--bg-opacity);
  filter: var(--bg-filter, none);
  transition: opacity .35s ease, filter .35s ease;
}

/* 背景层之上的柔化遮罩，保证正文始终清晰可读 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg) 62%, transparent) 0%,
    color-mix(in srgb, var(--bg) 78%, transparent) 40%,
    color-mix(in srgb, var(--bg) 88%, transparent) 100%);
}

img { max-width: 100%; display: block; }

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

h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }

code, pre, .mono { font-family: var(--mono); font-size: .9em; }

::selection { background: var(--primary-soft); color: var(--text); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 3. 布局 ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

.page { padding: 30px 0 70px; }

.section { margin-bottom: 46px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; display: flex; align-items: center; gap: 9px; }
.section-head .sub { color: var(--text-muted); font-size: .9rem; }

/* ---------- 4. 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--primary); }
.brand .dot {
  width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #7aa8ff);
  color: #fff; display: grid; place-items: center;
  font-size: .85rem; font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: .93rem;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-links a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: 4px; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }

.nav-toggle { display: none; }

/* ---------- 5. 卡片 ---------- */
.card {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card.flush { padding: 0; overflow: hidden; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-auto-sm { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* 爱好卡片 */
.hobby {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.hobby:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.hobby .ico { font-size: 1.7rem; line-height: 1; margin-bottom: 10px; }
.hobby h3 { margin: 0 0 6px; font-size: 1rem; }
.hobby p { margin: 0; color: var(--text-soft); font-size: .9rem; }

/* ---------- 6. 首页 Hero ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 30px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--shadow);
  margin-bottom: 42px;
}
.hero .avatar {
  width: 108px; height: 108px; flex: 0 0 108px;
  border-radius: 26px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.hero h1 { margin: 0 0 6px; font-size: 1.75rem; }
.hero .slogan { color: var(--primary); font-weight: 600; font-size: .98rem; margin-bottom: 10px; }
.hero .intro { color: var(--text-soft); margin: 0 0 14px; max-width: 62ch; }

.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.tag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: .81rem;
  white-space: nowrap;
}
.tag.primary { background: var(--primary-soft); border-color: transparent; color: var(--primary); font-weight: 600; }

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 17px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(.94); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 9px; }

/* ---------- 8. 表单控件 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .87rem; font-weight: 600; margin-bottom: 6px; color: var(--text-soft); }
.field .hint { font-size: .8rem; color: var(--text-muted); margin-top: 5px; line-height: 1.6; }

input[type="text"], input[type="password"], input[type="number"], input[type="email"],
input[type="url"], input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  padding: 9px 12px;
  font-family: inherit;
  font-size: .93rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.7; }
select { cursor: pointer; }

input[type="range"] { width: 100%; accent-color: var(--primary); cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); cursor: pointer; }

.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline label { margin: 0; }

/* ---------- 9. 进度条 / 技能 ---------- */
.goal { margin-bottom: 18px; }
.goal:last-child { margin-bottom: 0; }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 7px; }
.goal-top .t { font-weight: 600; font-size: .95rem; }
.goal-top .p { color: var(--primary); font-weight: 700; font-size: .88rem; font-variant-numeric: tabular-nums; }
.goal .note { font-size: .83rem; color: var(--text-muted); margin-top: 6px; }

.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.bar > i {
  display: block; height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #74a6ff);
  transition: width .7s cubic-bezier(.22,.8,.3,1);
}
.bar.ok > i { background: linear-gradient(90deg, var(--ok), #4fd0a0); }
.bar.warn > i { background: linear-gradient(90deg, var(--warn), #f0c451); }

/* ---------- 10. 时间线 ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 7px; bottom: 7px; width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--border));
  border-radius: 2px;
}
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -26px; top: 7px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--primary);
}
.tl-date { font-size: .8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tl-title { font-weight: 600; margin: 2px 0 3px; }
.tl-desc { color: var(--text-soft); font-size: .9rem; }

/* ---------- 11. 列表 / 表格 ---------- */
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 11px 0; border-bottom: 1px dashed var(--border); }
.list li:last-child { border-bottom: none; }
.list .k { font-weight: 600; }
.list .v { color: var(--text-soft); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: .85rem; background: var(--surface-2); }
tbody tr:hover { background: var(--surface-2); }

/* ---------- 12. 题库 ---------- */
.qb-layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 20px; align-items: start; }

.qb-side { position: sticky; top: calc(var(--nav-h) + 18px); }

.subject-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  padding: 11px 13px; margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit; font-size: .92rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.subject-item:hover { background: var(--surface-2); }
.subject-item.active { border-color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.subject-item .ico { font-size: 1.15rem; }
.subject-item .count { margin-left: auto; font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.qb-main { min-width: 0; }

.qb-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 16px; margin-bottom: 16px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.qb-toolbar select, .qb-toolbar input[type="text"] { width: auto; min-width: 112px; }
.qb-toolbar .spacer { margin-left: auto; }

/* 工具栏里的「标签 + 控件」组合，保证不换行 */
.toolbar-field {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .86rem; color: var(--text-soft); white-space: nowrap;
  min-width: 0;
}
.toolbar-field select { padding: 7px 10px; min-width: 0; }
.toolbar-field > select { max-width: 46vw; }

.q-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; font-size: .82rem; color: var(--text-muted); }
.q-index { font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }

.q-stem { font-size: 1.06rem; font-weight: 600; line-height: 1.8; margin-bottom: 18px; white-space: pre-wrap; }

.opt {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 15px; margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  font-size: .96rem;
}
.opt:hover { border-color: var(--border-strong); background: var(--surface-2); }
.opt.selected { border-color: var(--primary); background: var(--primary-soft); }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.locked { cursor: default; }
.opt .badge {
  flex: 0 0 25px; height: 25px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: .82rem; font-weight: 700; color: var(--text-soft);
}
.opt.selected .badge, .opt.correct .badge, .opt.wrong .badge { background: rgba(255,255,255,.7); color: var(--text); }
:root[data-theme="dark"] .opt.selected .badge,
:root[data-theme="dark"] .opt.correct .badge,
:root[data-theme="dark"] .opt.wrong .badge { background: rgba(0,0,0,.25); color: var(--text); }
.opt .txt { flex: 1; padding-top: 1px; }

.result-box {
  margin-top: 16px; padding: 15px 17px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--border-strong);
  background: var(--surface-2);
  font-size: .93rem;
}
.result-box.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.result-box.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.result-box .verdict { font-weight: 700; margin-bottom: 7px; display: flex; align-items: center; gap: 7px; }
.result-box .explain { color: var(--text-soft); white-space: pre-wrap; }
.result-box .explain strong { color: var(--text); }

.ai-box {
  margin-top: 14px; padding: 16px 17px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  font-size: .93rem;
}
.ai-box .ai-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; margin-bottom: 10px; color: var(--primary);
}
.ai-output { white-space: pre-wrap; line-height: 1.85; color: var(--text-soft); }
.ai-output:empty::before { content: "等待生成…"; color: var(--text-muted); }
.blink::after { content: "▍"; animation: blink 1s steps(2) infinite; color: var(--primary); }
@keyframes blink { 50% { opacity: 0; } }

.q-nav { display: flex; gap: 9px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.q-nav .spacer { margin-left: auto; }

/* 答题卡 */
.answer-sheet { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet-cell {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .8rem;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
  transition: transform .1s;
}
.sheet-cell:hover { transform: scale(1.08); }
.sheet-cell.correct { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); font-weight: 700; }
.sheet-cell.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); font-weight: 700; }
.sheet-cell.current { outline: 2px solid var(--primary); outline-offset: 1px; }

/* 统计 */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 11px; }
.stat {
  padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}
.stat .n { font-size: 1.5rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .l { font-size: .8rem; color: var(--text-muted); margin-top: 3px; }

/* ---------- 13. 项目卡片 ---------- */
.project {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  display: flex; flex-direction: column;
}
.project:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.project .cover {
  height: 148px;
  background: linear-gradient(135deg, var(--primary-soft), var(--surface-2));
  display: grid; place-items: center;
  font-size: 2.6rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.project .cover img { width: 100%; height: 100%; object-fit: cover; }
.project .body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.project h3 { margin: 0 0 6px; font-size: 1.05rem; }
.project .summary { color: var(--text-soft); font-size: .9rem; margin-bottom: 12px; }
.project .tech-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 13px; }
.project .tech {
  font-size: .74rem; padding: 2px 9px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-weight: 600;
}
.project .links { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.project .desc { font-size: .89rem; color: var(--text-soft); margin-bottom: 12px; }
.project ul.points { margin: 0 0 12px; padding-left: 19px; font-size: .88rem; color: var(--text-soft); }
.project ul.points li { margin-bottom: 4px; }

.status-pill { font-size: .74rem; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.status-已完成 { background: var(--ok-soft); color: var(--ok); }
.status-开发中 { background: var(--warn-soft); color: var(--warn); }
.status-计划中 { background: var(--surface-2); color: var(--text-muted); }

/* 筛选 */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); font-size: .87rem; cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ---------- 14. 联系方式 ---------- */
.contact-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  transition: transform .15s, border-color .15s;
  color: var(--text);
}
.contact-card:hover { transform: translateY(-2px); border-color: var(--primary); text-decoration: none; color: var(--text); }
.contact-card .ico { font-size: 1.5rem; width: 42px; height: 42px; display: grid; place-items: center; background: var(--surface-2); border-radius: 11px; flex: 0 0 42px; }
.contact-card .l { font-size: .8rem; color: var(--text-muted); }
.contact-card .v { font-weight: 600; word-break: break-all; font-size: .93rem; }

/* ---------- 15. 提示 / 空状态 ---------- */
.empty {
  padding: 44px 20px; text-align: center; color: var(--text-muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.empty .ico { font-size: 2rem; margin-bottom: 10px; }

.note {
  padding: 13px 16px; border-radius: var(--radius-sm);
  background: var(--warn-soft); border-left: 4px solid var(--warn);
  font-size: .89rem; color: var(--text-soft); margin-bottom: 16px;
}
.note.info { background: var(--primary-soft); border-left-color: var(--primary); }
.note.ok { background: var(--ok-soft); border-left-color: var(--ok); }
.note.bad { background: var(--bad-soft); border-left-color: var(--bad); }

.toast-wrap {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column; gap: 9px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 20px; border-radius: 999px;
  background: var(--text); color: var(--surface);
  font-size: .89rem; box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
  max-width: 90vw;
}
.toast.ok { background: var(--ok); color: #fff; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- 16. 模态框 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 22, 33, .5);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 560px;
  max-height: 86vh; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  animation: modalIn .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal h3 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

/* ---------- 17. 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  padding: 26px 0;
  margin-top: 30px;
  font-size: .87rem;
  color: var(--text-muted);
}
.site-footer .inner { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; }
.site-footer a { color: var(--text-soft); }

.back-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 80;
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-soft); cursor: pointer; font-size: 1.05rem;
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s, transform .15s;
}
.back-top.show { opacity: 1; visibility: visible; }
.back-top:hover { transform: translateY(-2px); color: var(--primary); }

/* ---------- 18. 动画 ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .55s ease, transform .55s cubic-bezier(.22,.8,.3,1); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 19. 响应式 ---------- */
@media (max-width: 900px) {
  .qb-layout { grid-template-columns: 1fr; }
  .qb-side { position: static; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  :root { --nav-h: 56px; }
  body { font-size: 15px; }

  .nav { gap: 10px; }
  .brand span.name { display: none; }

  /* 手机端工具栏：每项占满一行，避免横向溢出 */
  .qb-toolbar { gap: 9px; }
  .qb-toolbar .toolbar-field { width: 100%; justify-content: space-between; }
  .qb-toolbar .toolbar-field > select { flex: 1; max-width: none; margin-left: 10px; }
  /* 复选框那行：让勾选框和文字挨在一起 */
  .qb-toolbar .toolbar-field:has(input[type="checkbox"]) { justify-content: flex-start; }
  .qb-toolbar .spacer { display: none; }
  .qb-toolbar #btnStart { width: 100%; }

  .nav-toggle { display: grid; }
  .nav-links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 14px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease, padding .25s ease;
    margin-left: 0;
  }
  .nav-links.open { max-height: 70vh; overflow-y: auto; }
  .nav-links a { padding: 11px 12px; }
  .nav-actions { margin-left: auto; }

  .hero { flex-direction: column; align-items: flex-start; text-align: left; padding: 22px; gap: 18px; }
  .hero .avatar { width: 82px; height: 82px; flex-basis: 82px; border-radius: 20px; }
  .hero h1 { font-size: 1.45rem; }

  .grid-2, .grid-3, .grid-auto, .grid-auto-sm { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  h1 { font-size: 1.6rem; }
  .section { margin-bottom: 34px; }
  .modal { padding: 20px; }
  .q-stem { font-size: 1rem; }
}

@media (max-width: 420px) {
  .container { padding: 0 14px; }
  .sheet-cell { width: 29px; height: 29px; font-size: .75rem; }
}

/* ---------- 20. 打印 ---------- */
@media print {
  .site-header, .site-footer, .qb-side, .qb-toolbar, .back-top, .no-print, body::before { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .project, .opt { box-shadow: none; border-color: #ccc; }
  .qb-layout { grid-template-columns: 1fr; }
}
