:root {
  --bg: #f6f7fb; --bg-soft: #ffffff; --card: #ffffff; --line: #e6e8f0;
  --text: #1c2333; --muted: #6b7280; --accent: #2f6fed; --accent-soft: #e8f0ff;
  --ok: #16a34a; --warn: #d97706; --danger: #dc2626;
  --radius: 14px; --shadow: 0 1px 3px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.06);
  --font: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
html[data-theme="dark"] {
  --bg: #12141c; --bg-soft: #181b26; --card: #1d2130; --line: #2c3145;
  --text: #e7eaf3; --muted: #9aa3b8; --accent: #6d9bff; --accent-soft: #1e2b4a;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }

.container { max-width: 1600px; margin: 0 auto; padding: 0 24px; }

/* 顶栏：背景用兼容写法（不支持 color-mix 的老内核也能正常显示不透明顶栏） */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .topbar { background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); }
}
.topbar .container { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; min-height: 58px; padding-top: 6px; padding-bottom: 6px; }
.brand { font-weight: 800; font-size: 18px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand .logo { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, #2f6fed, #22c1a3); display: inline-block; }
.nav { display: flex; gap: 4px; margin-left: 8px; flex-wrap: wrap; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--accent); background: var(--accent-soft); }
.spacer { flex: 1; }
.theme-group { display: flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.theme-group button { border: 0; background: transparent; color: var(--muted); font-size: 13px; padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.theme-group button.active { background: var(--accent); color: #fff; }

/* 主页 */
.hero { padding: 64px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(26px, 4.5vw, 38px); margin: 0 0 12px; font-weight: 800; letter-spacing: .5px; }
.hero p { color: var(--muted); font-size: 16px; max-width: 820px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.trust { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 22px; color: var(--muted); font-size: 13px; }
.trust b { color: var(--ok); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; border-radius: 12px; font-size: 15px; font-weight: 600; padding: 12px 22px; transition: transform .05s, box-shadow .2s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(47,111,237,.35); }
.btn-ghost { background: var(--bg-soft); color: var(--text); border: 1px solid var(--line); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

.section { margin: 42px 0; }
.section h2 { font-size: 21px; margin: 0 0 16px; text-align: center; }
/* 卡片网格：限宽 + 水平居中（卡片组整体对称，而非铺满容器后偏左） */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; max-width: 1240px; margin: 0 auto; }
.grid-narrow { max-width: 1020px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card h4 { margin: 0 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.card a { display: block; }
.card .price { color: var(--accent); font-weight: 700; font-size: 14px; margin-top: 8px; }

/* 计算器 */
.steps { display: flex; gap: 8px; margin: 24px 0; flex-wrap: wrap; }
.step-tag { flex: 1; min-width: 140px; text-align: center; padding: 10px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.step-tag.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; border-color: var(--accent); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.panel h3 { margin: 0 0 16px; font-size: 17px; }
.tpl-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.tpl-btn { flex: 1; min-width: 130px; padding: 12px; border: 1.5px solid var(--line); background: var(--bg-soft); border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--text); font-weight: 600; }
.tpl-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
input[type="number"], input[type="text"], select { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--text); font-size: 14px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.narrow { width: 86px; }

.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.opt { display: flex; align-items: center; gap: 8px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.opt input { width: auto; }

/* 结果 */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.sum-card { background: linear-gradient(135deg, var(--accent-soft), transparent); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.sum-card .label { color: var(--muted); font-size: 13px; }
.sum-card .value { font-size: 24px; font-weight: 800; color: var(--accent); margin-top: 4px; }
.sum-card .extra { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tier-bar { display: flex; gap: 8px; margin: 12px 0; }
.tier-radio { flex: 1; text-align: center; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--bg-soft); }
.tier-radio.active { border-color: var(--accent); background: var(--accent-soft); }
.tier-radio b { display: block; font-size: 15px; }
.tier-radio span { font-size: 12.5px; color: var(--muted); }
.group-title { font-weight: 700; margin: 14px 0 4px; color: var(--accent); font-size: 13.5px; }
.amount { font-variant-numeric: tabular-nums; white-space: nowrap; }
.total-row td { font-weight: 800; font-size: 15px; border-top: 2px solid var(--line); }
.disc { background: var(--warn); color: #fff; }
.disc-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; }
.stars { color: var(--warn); letter-spacing: 2px; }

footer { margin-top: 60px; padding: 26px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
footer .promise { font-size: 14px; margin-bottom: 8px; }
footer .promise b { color: var(--ok); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; justify-content: flex-end; }
@media (max-width: 640px) { .nav { display: none; } .grid { grid-template-columns: 1fr 1fr; } }
/* 打印 / 导出 PDF */
.print-header { display: none; }
@media print {
  body { background: #fff; }
  .topbar, .steps, .toolbar, .tier-bar, .theme-group, #liveBar, .disc-note, footer, .badge { display: none !important; }
  .panel { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .summary, .sum-card { border: 0; box-shadow: none; background: none; padding: 0; gap: 6px; }
  .sum-card .value { font-size: 18px; }
  .print-header { display: block; }
  .print-header h1 { font-size: 22px; margin: 0 0 4px; }
  .ph-meta { font-size: 11px; color: #555; margin: 0 0 2px; }
  .ph-promise { font-size: 10px; color: #777; margin: 0 0 8px; }
  table { font-size: 11px; border-collapse: collapse; }
  th, td { border: 1px solid #ccc; padding: 4px 6px; }
  thead { display: table-header-group; }
  tr { page-break-inside: avoid; }
  .group-title { color: #000; background: #f3f3f3; }
  .total-row td { border-top: 2px solid #000; }
  a { color: #000; text-decoration: none; }
}

footer .icp { margin: 4px 0 0; font-size: 12px; }
