/* ==========================================================================
   康康聊ai · AI 场景提示词手册　样式表
   纯静态、零依赖：不引用任何 CDN，断网也能正常显示。
   ========================================================================== */

:root {
  --ink: #0b1220;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e6eaf2;
  --line-strong: #d3dae6;
  --bg: #f5f7fb;
  --card: #ffffff;

  --brand: #4338ca;
  --brand-2: #7c3aed;
  --brand-soft: #eef0ff;
  --accent: #0891b2;
  --accent-soft: #e0f7fb;
  --warn: #b45309;
  --warn-soft: #fef6e7;
  --danger: #be123c;
  --danger-soft: #fef1f4;
  --ok: #047857;
  --ok-soft: #e9f7f1;

  --m1: #4338ca;
  --m2: #0891b2;
  --m3: #be185d;
  --m4: #047857;
  --m5: #b45309;
  --m6: #7c3aed;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow: 0 2px 6px rgba(15, 23, 42, .06), 0 10px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .14);
  --maxw: 1100px;
  --navh: 53px;                     /* 导航条高度，由 JS 实测后覆盖，让吸顶元素精确贴合 */
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;              /* 防止手机上被长代码块撑出横向滚动 */
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; height: auto; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ------------------------------------------------------------------ 顶部 */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 12% -10%, #6d5cf0 0%, transparent 60%),
    radial-gradient(760px 380px at 92% 8%, #22b8d6 0%, transparent 58%),
    linear-gradient(160deg, #1b1b46 0%, #2b1f63 45%, #171a3a 100%);
  color: #fff;
  padding: 60px 0 52px;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .5;
  pointer-events: none;
}
/* 顶部的二维码去掉后，用这个光晕补住右侧的视觉重心 */
.hero-deco {
  position: absolute; right: -120px; top: -140px;
  width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(124,58,237,.55), rgba(34,184,214,.18) 55%, transparent 72%);
  filter: blur(6px);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1, .hero .lead { max-width: 40em; }

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  color: #e9e7ff;
  padding: 5px 13px; border-radius: 999px;
  font-size: 13px; letter-spacing: .2px;
  backdrop-filter: blur(6px);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.25); }

.hero h1 {
  font-size: clamp(27px, 4.6vw, 44px);
  line-height: 1.24;
  margin: 16px 0 12px;
  letter-spacing: -.4px;
  font-weight: 800;
}
.hero h1 .hl {
  background: linear-gradient(90deg, #a5b4fc, #67e8f9);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { margin: 0 0 22px; color: #cfd3ee; font-size: 16.5px; max-width: 46em; }
.hero p.lead b { color: #fff; font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: .18s ease;
}
.btn-primary { background: #fff; color: #2b1f63; box-shadow: 0 6px 18px rgba(0,0,0,.22); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,.28); }
.btn-ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.3); }
.btn-ghost:hover { background: rgba(255,255,255,.18); }

.stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 28px; }
.stat b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.stat span { font-size: 12.5px; color: #a9aed6; }

.qr-card {
  background: rgba(255,255,255,.96);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  color: var(--ink);
}
.qr-card img { width: 100%; border-radius: 12px; }
.qr-card .qr-name { font-weight: 700; margin: 12px 0 2px; font-size: 16px; }
.qr-card .qr-hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* ------------------------------------------------------------- 导航条 */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 10px 20px; max-width: var(--maxw); margin: 0 auto; }
.nav-inner::-webkit-scrollbar { display: none; }
.nav a {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px;
  font-size: 14.5px; color: var(--ink-2); font-weight: 500; white-space: nowrap;
  transition: .15s;
}
.nav a:hover { background: var(--brand-soft); color: var(--brand); }
.nav a.active { background: var(--brand); color: #fff; }
.nav .spacer { flex: 1 1 auto; }
.nav .nav-cta {
  flex: 0 0 auto; background: #0f172a; color: #fff; padding: 7px 16px;
  border-radius: 999px; font-size: 14px; font-weight: 600;
}
.nav .nav-cta:hover { background: #1e293b; color: #fff; }

/* ------------------------------------------------------------- 区块 */
section { padding: 52px 0 8px; }
section:last-of-type { padding-bottom: 40px; }

.sec-head { margin-bottom: 24px; }
.sec-kicker {
  font-size: 12.5px; font-weight: 700; letter-spacing: 1.4px;
  color: var(--brand); text-transform: uppercase;
}
.sec-head h2 {
  font-size: clamp(21px, 3vw, 28px); margin: 6px 0 8px;
  letter-spacing: -.3px; font-weight: 800;
}
.sec-head p { margin: 0; color: var(--muted); font-size: 15.5px; max-width: 52em; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------------- 万能公式 */
.formula-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.part {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; position: relative; overflow: hidden;
}
.part::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); }
.part:nth-child(2)::before { background: var(--accent); }
.part:nth-child(3)::before { background: var(--m3); }
.part h3 { margin: 0 0 6px; font-size: 16.5px; }
.part .role { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.part p { margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.72; }

.code-card { margin-bottom: 14px; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.code-head h3 { margin: 0; font-size: 15.5px; }
.code-head .hint { font-size: 12.5px; color: var(--faint); }
pre.code {
  margin: 0; padding: 16px; overflow-x: auto;
  background: #0f172a; color: #e2e8f0;
  border-radius: 0 0 var(--r) var(--r);
  font-family: var(--mono); font-size: 13px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word;
}

.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ex details { border: 1px solid var(--line); border-radius: var(--r); background: #fff; overflow: hidden; }
.ex summary {
  cursor: pointer; padding: 14px 16px; font-weight: 600; font-size: 14.5px;
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.ex summary::-webkit-details-marker { display: none; }
.ex summary::after { content: "＋"; color: var(--faint); font-weight: 400; }
.ex details[open] summary::after { content: "−"; }
.ex details[open] summary { border-bottom: 1px solid var(--line); background: #fbfcfe; }

.tips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 20px; }
.tip { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.tip .n {
  width: 26px; height: 26px; border-radius: 8px; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 13.5px; margin-bottom: 10px;
}
.tip h4 { margin: 0 0 6px; font-size: 15px; }
.tip p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.65; }

/* ---------------------------------------------------- 提示词库 */
.toolbar {
  position: sticky; top: var(--navh); z-index: 30;   /* 高度由 JS 实测写入，手机上不会错位 */
  background: rgba(245,247,251,.94); backdrop-filter: blur(10px);
  padding: 12px 0; margin-bottom: 18px; border-bottom: 1px solid var(--line);
}
.search-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.search-box {
  flex: 1 1 auto; position: relative;
}
.search-box input {
  width: 100%; padding: 12px 14px 12px 40px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--ink);
  outline: none; transition: .15s;
}
.search-box input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(67,56,202,.12); }
.search-box .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 15px; }
.count { font-size: 13px; color: var(--muted); white-space: nowrap; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; font-size: 13.5px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2);
  cursor: pointer; transition: .15s; font-family: inherit;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.mod-block { margin-bottom: 30px; }
.mod-title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px;
  font-size: 17px; font-weight: 700;
}
.mod-title .bar { width: 4px; height: 18px; border-radius: 2px; background: var(--brand); }
.mod-title .tag {
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: #eef1f7; padding: 2px 9px; border-radius: 999px;
}

.p-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.p-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; display: flex; flex-direction: column; transition: .18s;
}
.p-card:hover { border-color: #c7cdf5; box-shadow: var(--shadow); transform: translateY(-1px); }
.p-card.dim { display: none; }
.p-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.p-no {
  flex: 0 0 auto; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 9px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.p-title { font-size: 15.5px; font-weight: 700; line-height: 1.45; margin: 3px 0 0; }
.p-flags { margin-left: auto; display: flex; gap: 5px; }
.flag { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; font-weight: 600; }
.flag.star { background: #fff7e6; color: #b45309; }
.flag.warn { background: var(--danger-soft); color: var(--danger); }

.p-body {
  background: #f8fafc; border: 1px solid #edf1f7; border-left: 3px solid var(--brand);
  border-radius: 10px; padding: 12px 13px; margin: 0 0 10px;
  font-size: 14px; line-height: 1.78; color: #1f2937;
  white-space: pre-wrap; word-break: break-word;
  max-height: 260px; overflow: hidden; position: relative;
}
.p-card.open .p-body { max-height: none; }
.p-body .fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 54px;
  background: linear-gradient(transparent, #f8fafc);
}
.p-card.open .p-body .fade { display: none; }

.p-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; flex-wrap: wrap; }
.p-tool { font-size: 12.8px; color: var(--muted); flex: 1 1 auto; min-width: 0; }
.p-tool b { color: var(--ink-2); font-weight: 600; }
.mini {
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2);
  font-family: inherit; transition: .15s; white-space: nowrap;
}
.mini:hover { border-color: var(--brand); color: var(--brand); }
.mini.copy { background: var(--ink); color: #fff; border-color: var(--ink); }
.mini.copy:hover { background: #1e293b; color: #fff; }
.mini.copy.done { background: var(--ok); border-color: var(--ok); }
.p-note {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 10px;
  background: var(--danger-soft); border: 1px solid #f7d4dd; color: #9f1239;
  font-size: 13px; line-height: 1.65;
}
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }

/* ---------------------------------------------------- 学习地图 */
.course-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mod-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mod-card header {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; background: #fbfcfe;
}
.mod-card header h3 { margin: 0; font-size: 15.5px; }
.mod-card header .origin { margin-left: auto; font-size: 12px; color: var(--faint); }
.scene-row { display: flex; gap: 10px; padding: 11px 16px; border-bottom: 1px dashed #eef1f7; font-size: 14px; }
.scene-row:last-child { border-bottom: 0; }
.scene-row .s-name { flex: 1 1 auto; font-weight: 500; }
.scene-row .s-tool { flex: 0 0 auto; max-width: 46%; text-align: right; color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------- 工具表 */
.tbl-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.tbl th, table.tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.tbl th { background: #fbfcfe; font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl td:first-child { font-weight: 600; white-space: nowrap; }
table.tbl td .alt { color: var(--muted); font-size: 13.5px; }
table.tbl td .oversea { color: var(--faint); font-size: 13.5px; }
.pick3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.pick {
  background: linear-gradient(180deg, #fff, #fbfcff);
  border: 1px solid var(--line); border-radius: var(--r); padding: 16px;
}
.pick .k { font-size: 13px; color: var(--brand); font-weight: 700; }
.pick h4 { margin: 6px 0 6px; font-size: 15.5px; }
.pick p { margin: 0; font-size: 13.8px; color: var(--muted); }

/* ---------------------------------------------------- 红线 */
.safety-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.redline { background: #fff; border: 1px solid #f3d6de; border-radius: var(--r); padding: 16px; }
.redline h4 { margin: 0 0 8px; font-size: 15.5px; color: #9f1239; display: flex; gap: 8px; }
.redline p { margin: 0; font-size: 14.2px; color: var(--ink-2); line-height: 1.72; }
.notice {
  margin-top: 18px; background: var(--warn-soft); border: 1px solid #f6e0b8;
  border-radius: var(--r); padding: 16px 18px; font-size: 14.2px; color: #7c4a03; line-height: 1.75;
}
.notice b { color: #7c2d12; }

/* ---------------------------------------------------- 后续资料位 */
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.more-item { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.more-item .kind { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .5px; }
.more-item h4 { margin: 6px 0 6px; font-size: 15px; }
.more-item p { margin: 0 0 10px; font-size: 13.6px; color: var(--muted); }
.more-item a { font-size: 13.6px; font-weight: 600; color: var(--brand); }

/* ---------------------------------------------------- 页脚 */
.foot {
  margin-top: 30px; padding: 40px 0 34px;
  background: #0f172a; color: #cbd5e1; font-size: 14px;
}
.foot-grid { display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: center; }
.foot h3 { color: #fff; margin: 0 0 8px; font-size: 18px; }
.foot p { margin: 0 0 8px; color: #94a3b8; line-height: 1.75; }
.foot .qr-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.foot .qr-box { background: #fff; border-radius: 14px; padding: 10px; text-align: center; }
.foot .qr-box img { border-radius: 8px; }
.foot .qr-box .n { color: #0f172a; font-weight: 700; font-size: 13.5px; margin-top: 7px; }
.foot .qr-box .cap { color: #64748b; font-size: 11.5px; line-height: 1.45; margin-top: 7px; }
.foot .icp { margin-top: 20px; }
.foot .icp a { color: #94a3b8; font-size: 12.8px; }
.foot .icp a:hover { color: #e2e8f0; }
.foot .meta { margin-top: 12px; padding-top: 14px; border-top: 1px solid #1e293b; color: #64748b; font-size: 12.8px; }

/* ---------------------------------------------------- 悬浮加微 */
.fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  font-size: 14.5px; font-weight: 700; font-family: inherit;
  box-shadow: 0 10px 26px rgba(67,56,202,.4);
}
.fab:active { transform: scale(.97); }
.modal {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(15,23,42,.55); backdrop-filter: blur(3px);
}
.modal.on { display: flex; }
.modal-box {
  background: #fff; border-radius: var(--r-lg); padding: 22px; text-align: center;
  max-width: 320px; width: 100%; box-shadow: var(--shadow-lg);
}
.modal-box img { width: 100%; border-radius: 12px; }
.modal-box h3 { margin: 14px 0 4px; font-size: 17px; }
.modal-box p { margin: 0 0 14px; color: var(--muted); font-size: 13.6px; }
.modal-box button {
  width: 100%; padding: 10px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: #fff; font-family: inherit; font-size: 14.5px; cursor: pointer; color: var(--ink-2);
}

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 12px);
  background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 70;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------- 留言板 */
.board-form {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.board-fields { margin-bottom: 10px; }
.board-form input[type="text"], .board-form textarea {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 10px; background: #fbfcfe;
  padding: 11px 13px; outline: none; transition: .15s; resize: vertical;
}
.board-form input[type="text"] { max-width: 280px; }
.board-form textarea { line-height: 1.7; min-height: 96px; display: block; }
.board-form input:focus, .board-form textarea:focus {
  border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(67,56,202,.1);
}
.board-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.board-actions {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap;
}
.board-hint { flex: 1 1 auto; font-size: 12.6px; color: var(--faint); line-height: 1.5; }
.btn-submit {
  flex: 0 0 auto; border: 0; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  padding: 11px 26px; border-radius: 999px; font-size: 15px; font-weight: 600;
  box-shadow: 0 6px 16px rgba(67,56,202,.28); transition: .18s;
}
.btn-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(67,56,202,.34); }
.btn-submit:disabled { opacity: .6; cursor: default; box-shadow: none; }

.board-status {
  padding: 12px 14px; border-radius: var(--r); font-size: 14px;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 14px;
}
.board-status.warn { background: var(--warn-soft); color: #7c4a03; }
.board-status.err { background: var(--danger-soft); color: var(--danger); }

.board-list { display: grid; gap: 10px; }
.msg {
  display: flex; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 16px;
}
.msg-avatar {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.msg-main { flex: 1 1 auto; min-width: 0; }
.msg-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.msg-name { font-size: 14.5px; }
.msg-time { font-size: 12.4px; color: var(--faint); }
.msg-del {
  margin-left: auto; border: 1px solid #f3d6de; background: var(--danger-soft); color: var(--danger);
  font-size: 12px; padding: 2px 10px; border-radius: 999px; cursor: pointer; font-family: inherit;
}
.msg-text { margin: 6px 0 0; font-size: 14.8px; color: var(--ink-2); line-height: 1.75; word-break: break-word; }
.board-more { text-align: center; margin-top: 14px; }

/* ---------------------------------------------------- 响应式 */
/* 平板 / 小笔记本 */
@media (max-width: 900px) {
  .formula-grid, .tips, .pick3, .more-grid { grid-template-columns: 1fr 1fr; }
  .p-grid, .course-grid, .safety-grid, .ex-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .foot .qr-pair { max-width: 340px; }
  .p-body { max-height: none; }        /* 窄屏不需要折叠，直接铺开更好读 */
  .p-body .fade { display: none; }
  .js-more { display: none; }
}

/* 手机：表格改成卡片式、加大点击区域、收紧留白 */
@media (max-width: 620px) {
  body { font-size: 15.5px; }
  .hero { padding: 34px 0 30px; }
  .hero-deco { width: 340px; height: 340px; right: -140px; top: -120px; }
  .hero h1 { font-size: 26px; }
  .lead { font-size: 15px; }
  section { padding: 34px 0 6px; }
  .sec-head h2 { font-size: 21px; }
  .formula-grid, .tips, .pick3, .more-grid { grid-template-columns: 1fr; }
  .stats { gap: 16px 22px; margin-top: 22px; }
  .stat b { font-size: 20px; }
  .stat span { font-size: 12px; }
  .wrap { padding: 0 14px; }
  .nav-inner { padding: 9px 14px; gap: 4px; }
  .nav a { padding: 8px 12px; font-size: 14px; }     /* 加大点击区域 */
  .hero-actions .btn { padding: 12px 18px; }

  /* 工具表：窄屏下每一行变成一张小卡片，字段名靠 data-label 显示，不再隐藏列 */
  table.tbl thead { display: none; }
  table.tbl, table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
  table.tbl tr {
    border-bottom: 1px solid var(--line); padding: 12px 14px;
  }
  table.tbl tr:last-child { border-bottom: 0; }
  table.tbl td {
    border: 0; padding: 3px 0; font-size: 14.5px;
    display: flex; gap: 10px; align-items: baseline;
  }
  table.tbl td::before {
    content: attr(data-label);
    flex: 0 0 76px; color: var(--muted); font-size: 12.5px; font-weight: 500;
  }
  table.tbl td:first-child { font-size: 16px; margin-bottom: 4px; }
  table.tbl td:first-child::before { display: none; }
  table.tbl td.alt, table.tbl td.oversea { color: var(--ink-2); }

  .scene-row { flex-direction: column; gap: 3px; }
  .scene-row .s-tool { text-align: left; max-width: none; }
  pre.code { font-size: 12.2px; padding: 14px; }
  .board-actions { flex-direction: column; align-items: stretch; }
  .btn-submit { width: 100%; padding: 13px; }
  .board-hint { order: 2; text-align: center; }
  .fab { right: 12px; bottom: 12px; padding: 10px 15px; font-size: 14px; }
  .toast { bottom: 74px; max-width: 90vw; text-align: center; }
}

