:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #dbe2ea;
  --primary: #2457d6;
  --primary-dark: #173e9e;
  --success: #14804a;
  --warning: #9a6700;
  --danger: #b42318;
  --soft: #eef3ff;
  --shadow: 0 12px 32px rgba(23, 32, 51, .08);
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--primary); }
.container { width: min(980px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  background: linear-gradient(135deg, #173e9e, #2b68ef);
  color: #fff;
  padding: 42px 0 56px;
}
.site-header .eyebrow { font-size: 14px; opacity: .82; margin-bottom: 6px; }
.site-header h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.2; letter-spacing: -.02em; }
.site-header p { max-width: 780px; margin: 14px 0 0; opacity: .9; }
.main-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: -28px auto 48px;
  overflow: hidden;
}
.progress-shell { padding: 20px 26px 0; }
.progress-meta { display:flex; justify-content:space-between; gap:12px; font-size:14px; color:var(--muted); margin-bottom:8px; }
.progress { height: 9px; background:#e8edf5; border-radius: 999px; overflow:hidden; }
.progress > span { display:block; height:100%; width:14%; background:var(--primary); transition:width .25s ease; }
.form-body { padding: 10px 26px 28px; }
.step { display:none; animation: fade .18s ease; }
.step.active { display:block; }
@keyframes fade { from{opacity:.4;transform:translateY(4px)} to{opacity:1;transform:none} }
.step-head { padding: 20px 0 8px; border-bottom:1px solid var(--line); margin-bottom:8px; }
.step-kicker { font-size:13px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--primary); }
.step-head h2 { margin:3px 0 4px; font-size:25px; }
.step-head p { margin:0 0 10px; color:var(--muted); }
.question { padding: 21px 0; border-bottom:1px solid #edf0f4; }
.question:last-child { border-bottom:0; }
.question label.title, .question .title { display:block; font-weight:700; margin-bottom:8px; font-size:17px; }
.req::after { content:" *"; color:var(--danger); }
.hint { color:var(--muted); font-size:14px; margin-top:-3px; margin-bottom:10px; }
.input, textarea, select {
  width:100%; border:1px solid var(--line); border-radius:11px; padding:12px 13px;
  font:inherit; color:var(--text); background:#fff; outline:none;
}
.input:focus, textarea:focus, select:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(36,87,214,.12); }
textarea { min-height:110px; resize:vertical; }
.choice-grid { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; }
.choice, .radio-card {
  display:flex; gap:10px; align-items:flex-start; border:1px solid var(--line); border-radius:12px;
  padding:11px 12px; background:#fff; cursor:pointer; transition:.15s ease;
}
.choice:hover, .radio-card:hover { border-color:#aebee4; background:#fbfcff; }
.choice input, .radio-card input { margin-top:4px; accent-color:var(--primary); }
.choice:has(input:checked), .radio-card:has(input:checked) { border-color:var(--primary); background:var(--soft); }
.level-list { display:grid; gap:9px; }
.level-list .radio-card { padding:13px 14px; }
.other-field { margin-top:9px; display:none; }
.notice { border:1px solid #bfd1ff; background:#f2f6ff; color:#244177; border-radius:13px; padding:13px 15px; margin:13px 0; }
.notice.warning { border-color:#f2d293; background:#fff9eb; color:#6d4a00; }
.error-box { border:1px solid #f1b3ae; background:#fff2f0; color:#8d1c13; border-radius:12px; padding:12px 14px; margin:14px 0; }
.form-actions { display:flex; justify-content:space-between; gap:12px; padding-top:24px; }
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:7px; border:0; border-radius:11px;
  padding:11px 18px; font:inherit; font-weight:700; cursor:pointer; text-decoration:none;
}
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover { background:var(--primary-dark); }
.btn-secondary { background:#eef1f6; color:#344054; }
.btn-danger { background:#fee4e2; color:#912018; }
.btn-small { padding:8px 12px; font-size:14px; }
.honeypot { position:absolute !important; left:-10000px !important; width:1px !important; height:1px !important; overflow:hidden !important; }
.footer { color:var(--muted); text-align:center; font-size:13px; padding:0 12px 28px; }

/* dashboard */
.dashboard-body { background:#f5f7fb; }
.topbar { position:sticky; top:0; z-index:20; background:rgba(255,255,255,.95); backdrop-filter:blur(8px); border-bottom:1px solid var(--line); }
.topbar .inner { width:min(1240px, calc(100% - 28px)); margin:auto; min-height:64px; display:flex; align-items:center; justify-content:space-between; gap:14px; }
.topbar .brand { font-weight:800; }
.topbar .actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.dash { width:min(1240px, calc(100% - 28px)); margin:24px auto 50px; }
.dash-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-end; margin-bottom:18px; }
.dash-head h1 { margin:0; font-size:28px; }
.dash-head p { margin:4px 0 0; color:var(--muted); }
.live { display:inline-flex; align-items:center; gap:7px; font-size:13px; color:var(--success); }
.live::before { content:""; width:8px; height:8px; border-radius:50%; background:var(--success); box-shadow:0 0 0 4px rgba(20,128,74,.12); }
.cards { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:14px; }
.metric { background:#fff; border:1px solid #e7ebf1; border-radius:15px; padding:16px; box-shadow:0 5px 16px rgba(23,32,51,.04); }
.metric .label { color:var(--muted); font-size:13px; }
.metric .value { font-size:29px; font-weight:800; line-height:1.2; margin:4px 0; }
.metric .sub { color:var(--muted); font-size:12px; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:14px; }
.panel { background:#fff; border:1px solid #e7ebf1; border-radius:15px; padding:17px; box-shadow:0 5px 16px rgba(23,32,51,.04); min-width:0; }
.panel h3 { margin:0 0 5px; font-size:18px; }
.panel .panel-sub { color:var(--muted); font-size:13px; margin-bottom:13px; }
.bar-list { display:grid; gap:10px; }
.bar-row { display:grid; grid-template-columns:minmax(130px, 1.25fr) 2fr 48px; gap:10px; align-items:center; font-size:13px; }
.bar-label { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bar-track { height:10px; border-radius:999px; background:#eef1f6; overflow:hidden; }
.bar-fill { height:100%; border-radius:999px; background:linear-gradient(90deg,#2b68ef,#6d8ff0); min-width:0; }
.bar-count { text-align:right; color:var(--muted); font-variant-numeric:tabular-nums; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th, td { padding:10px 9px; border-bottom:1px solid #edf0f4; text-align:left; vertical-align:top; white-space:nowrap; }
th { color:#475467; font-size:12px; background:#fafbfc; position:sticky; top:0; }
.tag { display:inline-block; padding:3px 8px; border-radius:999px; background:#eef3ff; color:#26488c; font-size:12px; }
.open-list { display:grid; gap:10px; }
.open-item { border:1px solid var(--line); border-radius:12px; padding:12px; }
.open-meta { color:var(--muted); font-size:12px; margin-bottom:4px; }
.open-item p { margin:0; white-space:pre-wrap; }
.open-item p + p { margin-top:7px; }
.login-shell { min-height:100vh; display:grid; place-items:center; padding:24px; background:linear-gradient(135deg,#eef3ff,#f8fafc); }
.login-card { width:min(420px,100%); background:#fff; border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow); padding:24px; }
.login-card h1 { margin:0 0 5px; font-size:24px; }
.login-card p { color:var(--muted); margin:0 0 18px; }
.login-card .field { margin:12px 0; }
.login-card .field label { font-size:13px; font-weight:700; display:block; margin-bottom:5px; }
.login-card .btn { width:100%; margin-top:10px; }
.settings-box { margin-top:14px; }
.status-ok { color:var(--success); }
.status-bad { color:var(--danger); }
.code { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:12px; background:#f5f7fa; padding:2px 5px; border-radius:5px; }

@media (max-width: 780px) {
  .container { width:min(100% - 20px, 980px); }
  .site-header { padding:30px 0 46px; }
  .main-card { margin-top:-22px; border-radius:15px; }
  .form-body, .progress-shell { padding-left:16px; padding-right:16px; }
  .choice-grid, .grid-2, .cards { grid-template-columns:1fr; }
  .bar-row { grid-template-columns:minmax(105px, 1fr) 1.5fr 42px; gap:7px; }
  .dash-head { align-items:flex-start; flex-direction:column; }
  .topbar .inner { align-items:flex-start; padding:10px 0; flex-direction:column; }
  .topbar { position:static; }
}
