/* ============================================================
 * 品牌配色：改这里即可整体换色（与 questions.js 的 BRAND 对应）
 * ============================================================ */
:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #1f2733;
  --muted: #6b7785;
  --line: #e3e8ef;
  --brand: #0a66c2;        /* 主色 */
  --brand-d: #084a8c;      /* 主色深 */
  --accent: #f5a623;       /* 强调色 */
  --ok: #1a7f37;
  --warn: #b25a00;
  --bad: #c0392b;
  --shadow: 0 1px 3px rgba(16,24,40,.08), 0 6px 24px rgba(16,24,40,.06);
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 24px 18px 64px; }
.admin-wrap { max-width: 1180px; }

/* ===== 品牌头部 ===== */
header.top {
  background: linear-gradient(125deg, var(--brand) 0%, var(--brand-d) 100%);
  color: #fff; padding: 22px 0; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
header.top::after {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16), transparent 70%);
}
header.top .wrap { padding-top: 0; padding-bottom: 0; }
.brand-wrap { display: flex; align-items: center; gap: 16px; }
.brand-mark {
  width: 60px; height: 60px; flex: 0 0 60px; border-radius: 14px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.32);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.brand-logo { max-width: 100%; max-height: 100%; display: none; border-radius: 8px; }
.brand-logo-ph { font-weight: 800; font-size: 14px; letter-spacing: 1px; color: #fff; }
.brand-text h1 { margin: 0; font-size: 22px; letter-spacing: .5px; display: flex; align-items: center; flex-wrap: wrap; }
.brand-text p { margin: 6px 0 0; opacity: .9; font-size: 13.5px; }
.badge { display:inline-block; background: rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.3);
  padding: 2px 10px; border-radius: 999px; font-size: 12px; margin-left: 8px; font-weight: 500; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; margin: 18px 0; }
.card h2 { margin: 0 0 4px; font-size: 17px; }
.card .sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.section-no { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px;
  border-radius:50%; background: var(--brand); color:#fff; font-size:13px; font-weight:700; margin-right:8px; }

label.fld { display:block; margin: 12px 0 4px; font-weight:600; font-size:14px; }
input[type=text], select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; background:#fff; color: var(--ink);
}
input[type=text]:focus, select:focus { outline: 2px solid rgba(10,102,194,.25); border-color: var(--brand); }

.q { padding: 14px 0; border-top: 1px dashed var(--line); }
.q:first-child { border-top: none; }
.q .qt { font-weight: 600; font-size: 14.5px; margin-bottom: 10px; }
.q .qt .n { color: var(--brand); font-weight: 700; margin-right: 6px; }
.opt { display:flex; align-items:flex-start; gap:10px; padding:9px 12px; border:1px solid var(--line);
  border-radius:8px; margin:7px 0; cursor:pointer; transition:.15s; background:#fcfdff; }
.opt:hover { border-color: var(--brand); }
.opt.sel { border-color: var(--brand); background:#eef5ff; }
.opt input { margin-top:4px; }
.opt .t { font-size:14px; }

.btn { display:inline-flex; align-items:center; gap:8px; background: var(--brand); color:#fff; border:none;
  padding: 11px 22px; border-radius: 9px; font-size: 15px; font-weight:600; cursor:pointer; transition:.15s; }
.btn:hover { background: var(--brand-d); }
.btn.ghost { background:#fff; color: var(--brand); border:1px solid var(--brand); }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-row { display:flex; gap:12px; align-items:center; margin-top:18px; flex-wrap: wrap; }

.progress { height: 8px; background: #e9eef5; border-radius: 999px; overflow:hidden; margin: 6px 0 2px; }
.progress > i { display:block; height:100%; width:0; background: linear-gradient(90deg,var(--brand),#36a3ff); transition: width .3s; }
.progress-cap { font-size:12px; color: var(--muted); }

.err { color: var(--bad); font-size:13px; margin-top:8px; min-height:18px; }

/* 完成页 / 回执页 */
.done { text-align:center; padding: 30px 10px; }
.done .ico { width:64px;height:64px;border-radius:50%;background:var(--ok);color:#fff;display:flex;
  align-items:center;justify-content:center;font-size:34px;margin:0 auto 14px; }
.done h2 { margin:0 0 6px; }
.receipt-link { display:flex; gap:8px; align-items:center; margin:14px 0 6px; }
.receipt-link input { flex:1; font-size:12.5px; color:var(--muted); background:#f4f7fb; }
.copy-ok { color: var(--ok); font-size:12.5px; }

/* ===== 后台 ===== */
.toolbar { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.kpis { display:grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin: 8px 0 4px; }
.kpi { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:14px 16px; box-shadow:var(--shadow); }
.kpi .v { font-size:26px; font-weight:800; }
.kpi .l { font-size:12.5px; color:var(--muted); }
table.grid { width:100%; border-collapse:collapse; font-size:13px; }
table.grid th, table.grid td { border:1px solid var(--line); padding:7px 9px; text-align:left; vertical-align:top; }
table.grid th { background:#f0f4f9; position:sticky; top:0; }
table.grid tr:nth-child(even) td { background:#fafcff; }
.score-pill { display:inline-block; padding:2px 9px; border-radius:999px; color:#fff; font-weight:700; font-size:12px; }
.cat-bar { display:flex; align-items:center; gap:8px; margin:6px 0; font-size:13px; }
.cat-bar .name { width:84px; color:var(--muted); }
.cat-bar .track { flex:1; height:12px; background:#eef2f7; border-radius:999px; overflow:hidden; }
.cat-bar .fill { height:100%; background:var(--brand); }
.cat-bar .val { width:42px; text-align:right; font-variant-numeric:tabular-nums; }
.detail { background:#f8fafc; border:1px solid var(--line); border-radius:8px; padding:12px 14px; margin-top:8px; font-size:13px; }
.detail .row { padding:5px 0; border-bottom:1px dashed var(--line); }
.detail .row:last-child { border-bottom:none; }
.muted { color: var(--muted); }
.tag { display:inline-block; padding:1px 8px; border-radius:6px; font-size:11.5px; background:#eef2f7; color:#475569; margin:2px 3px 0 0; cursor:pointer; }
.login { max-width:360px; margin:60px auto; }
.hide { display:none !important; }
.scored { color: var(--ok); font-weight:700; }
.flawed { color: var(--bad); font-weight:700; }
@media (max-width: 640px){
  .cat-bar .name { width:64px; }
  .brand-text h1 { font-size: 18px; }
}

/* 调查横幅（index / admin 分析头） */
.banner { display:flex; align-items:center; gap:14px; }
.banner-ico { font-size:26px; line-height:1; }
.banner-title { font-size:17px; font-weight:700; color:var(--ink); }
.banner-sub { font-size:13px; margin-top:2px; }
.landing { max-width:520px; margin:48px auto; text-align:center; }
.landing .ico, .done .ico { font-size:40px; }

/* 新建调查弹窗 */
.modal-mask { position:fixed; inset:0; background:rgba(15,23,42,.45); display:flex; align-items:center; justify-content:center; padding:20px; z-index:50; }
.modal { background:#fff; border-radius:14px; max-width:460px; width:100%; padding:22px 24px; box-shadow:0 18px 50px rgba(2,6,23,.25); }
.modal h2 { margin:0 0 6px; }
.ok-ico { display:inline-flex; width:30px; height:30px; border-radius:50%; background:#e7f7ec; color:var(--ok); align-items:center; justify-content:center; font-weight:800; margin:10px 0; }
.receipt-link { display:flex; gap:8px; margin:8px 0; }
.receipt-link input { flex:1; padding:8px 10px; border:1px solid var(--line); border-radius:8px; font-size:13px; background:#f8fafc; }

/* 轻提示 */
.toast { position:fixed; left:50%; bottom:26px; transform:translateX(-50%); background:rgba(15,23,42,.9); color:#fff; padding:8px 16px; border-radius:20px; font-size:13px; z-index:60; }
