:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2b4eff;
  --brand2: #00b8a9;
  --accent: #f59e0b;
  --danger: #e34d59;
  --ok: #10b981;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.logo {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff;
  font-weight: 800; letter-spacing: 1px;
}
.brand-text strong { display: block; font-size: 16px; }
.brand-text small { color: var(--muted); font-size: 12px; }
.nav a { margin-left: 22px; color: var(--muted); font-size: 14px; }
.nav a:hover { color: var(--brand); }

main { max-width: 1080px; margin: 0 auto; padding: 28px; min-height: 60vh; }
.loading { text-align: center; color: var(--muted); padding: 60px; }
.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 18px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px;
  background: var(--panel);
}

/* 通用卡片/按钮 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; border: none;
  background: var(--brand); color: #fff; padding: 11px 22px; border-radius: 10px; font-size: 15px; font-weight: 600;
  transition: transform .1s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(43,78,255,.25); }
.btn.secondary { background: #eef1ff; color: var(--brand); }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* 首页 Hero */
.hero { text-align: center; padding: 40px 20px 30px; }
.hero h1 { font-size: 34px; margin: 0 0 12px; letter-spacing: -0.5px; }
.hero .sub { color: var(--muted); font-size: 16px; max-width: 680px; margin: 0 auto 26px; }
.pill { display: inline-block; background: #eef1ff; color: var(--brand); border-radius: 999px; padding: 5px 14px; font-size: 13px; margin: 0 6px 10px; }

.dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 30px 0; }
.dim-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.dim-card h3 { margin: 0 0 6px; font-size: 17px; }
.dim-card .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dim-card p { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.member-box { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid #c7d2fe; border-color: var(--brand); }

/* 表单 */
.progress { height: 8px; background: #eef1ff; border-radius: 999px; overflow: hidden; margin: 6px 0 22px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand2)); transition: width .3s; }
.step-title { font-size: 20px; margin: 0 0 4px; }
.step-desc { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.field .hint { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; font-size: 14px;
  background: #fff; user-select: none; transition: all .15s;
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.question { border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.question .q { font-weight: 600; margin-bottom: 4px; }
.question .qhint { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.options { display: grid; gap: 8px; }
.opt {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; gap: 10px; transition: all .15s; background: #fff;
}
.opt:hover { border-color: #c7d2fe; }
.opt.active { border-color: var(--brand); background: #eef1ff; }
.opt .num { width: 22px; height: 22px; border-radius: 50%; background: #eef1ff; color: var(--brand); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.opt.active .num { background: var(--brand); color: #fff; }

/* 报告 */
.report-head { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.gauge-wrap { position: relative; width: 180px; height: 110px; flex: none; }
.gauge-center { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; }
.gauge-center .score { font-size: 34px; font-weight: 800; }
.gauge-center .of { color: var(--muted); font-size: 13px; }
.tier-badge { display: inline-block; padding: 6px 14px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 14px; }
.section { margin-top: 30px; }
.section h2 { font-size: 20px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.section .lead { color: var(--muted); font-size: 14px; margin: 0 0 16px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } .dims { grid-template-columns: 1fr; } }

.bar-row { margin-bottom: 14px; }
.bar-row .bl { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.bar-track { height: 12px; background: #eef1ff; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .6s; }

.sb-list { display: flex; flex-direction: column; gap: 10px; }
.sb-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.sb-rank { width: 26px; height: 26px; border-radius: 50%; background: var(--danger); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.sb-item .meta { flex: 1; }
.sb-item .meta small { color: var(--muted); }
.sb-score { font-weight: 700; }

.plan3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 820px) { .plan3 { grid-template-columns: 1fr; } }
.plan-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.plan-col h3 { margin: 0 0 4px; font-size: 16px; }
.plan-col .tag { font-size: 12px; color: var(--muted); margin-bottom: 12px; display: block; }
.plan-card { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fafbff; }
.plan-card .act { font-weight: 600; font-size: 14px; }
.plan-card .det { font-size: 13px; color: var(--muted); margin: 4px 0; }
.plan-card .tags { font-size: 12px; }
.tag-effort { background: #fef3c7; color: #b45309; border-radius: 6px; padding: 2px 8px; margin-right: 6px; }
.tag-impact { background: #dbeafe; color: #1d4ed8; border-radius: 6px; padding: 2px 8px; }
.tag-from { background: #eef1ff; color: var(--brand); border-radius: 6px; padding: 2px 8px; }

table.prio { width: 100%; border-collapse: collapse; font-size: 13px; }
table.prio th, table.prio td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.prio th { color: var(--muted); font-weight: 600; background: #fafbff; }
table.prio tr:hover td { background: #fafbff; }
.prio-score { font-weight: 800; color: var(--brand); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: #eef1ff; color: var(--brand); }
.badge.t1 { background: #fee2e2; color: #b91c1c; }
.badge.t2 { background: #fef3c7; color: #b45309; }
.badge.t3 { background: #d1fae5; color: #047857; }

.trend { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.trend .node { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; text-align: center; min-width: 90px; }
.trend .node .d { font-size: 12px; color: var(--muted); }
.trend .node .s { font-size: 20px; font-weight: 800; }
.trend .arrow { color: var(--muted); font-size: 18px; }
.trend .up { color: var(--ok); }
.trend .down { color: var(--danger); }

.note { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-top: 16px; }

/* 后台 */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 28px; }
.login-card { max-width: 360px; margin: 80px auto; }
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-card .n { font-size: 30px; font-weight: 800; }
.stat-card .l { color: var(--muted); font-size: 13px; }
table.admin { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--panel); }
table.admin th, table.admin td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
table.admin th { background: #fafbff; color: var(--muted); }
table.admin tr:hover td { background: #fafbff; cursor: pointer; }

@media print {
  .topbar, .footer, .nav, .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .card, .plan-col, .dim-card { box-shadow: none; }
}

/* ===== 嵌入模式（官网右侧栏 iframe 内） ===== */
.embed main { max-width: 100%; padding: 14px; }
.embed .topbar, .embed .footer { display: none; }
.embed .hero { padding: 16px 4px 10px; }
.embed .hero h1 { font-size: 21px; margin: 0 0 8px; }
.embed .hero .sub { font-size: 13px; margin: 0 auto 16px; }
.embed .dims { grid-template-columns: 1fr; gap: 10px; margin: 14px 0; }
.embed .card { padding: 16px; }
.embed .grid2, .embed .plan3 { grid-template-columns: 1fr; }
.embed .section { margin-top: 18px; }
.embed .section h2 { font-size: 17px; }
.embed .report-head { flex-direction: column; align-items: flex-start; gap: 12px; }
.embed .card svg, .embed .report-head svg { width: 100%; height: auto; max-width: 300px; display: block; margin: 0 auto; }
.embed table.prio { font-size: 12px; }
.embed table.prio th, .embed table.prio td { padding: 8px 9px; }

/* ===== 窄屏自适应（<=480px，含侧栏 iframe 内部） ===== */
@media (max-width: 480px) {
  main { padding: 14px; }
  .hero h1 { font-size: 24px; }
  .dims, .plan3, .grid2 { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .card svg { width: 100%; height: auto; max-width: 300px; }
  table.prio { font-size: 12px; }
  table.prio th, table.prio td { padding: 8px 9px; }
}
