:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1c1f23;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #1f6feb;
  --brand-soft: #e8f0fe;
  --warn: #b45309;
  --danger: #b91c1c;
  --ok: #15803d;
  --radius: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  padding: 0 0 48px;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 960px; }

header.hero {
  background: linear-gradient(135deg, #1f6feb, #0b4fc4);
  color: #fff;
  padding: 26px 20px 30px;
  border-radius: 0 0 20px 20px;
  margin-bottom: 18px;
}
header.hero h1 { margin: 0 0 6px; font-size: 20px; letter-spacing: .3px; }
header.hero p { margin: 0; font-size: 13px; opacity: .9; line-height: 1.6; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card h2 { font-size: 16px; margin: 0 0 4px; }
.card .sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

label.field { display: block; margin-bottom: 14px; }
label.field > span.lbl {
  display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px;
}
label.field > span.hint {
  display: block; font-size: 12px; color: var(--muted); margin-top: 5px;
}
input[type=text], input[type=number], input[type=password], textarea, select {
  width: 100%; padding: 11px 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea { resize: vertical; min-height: 84px; }

.btn {
  display: block; width: 100%; padding: 13px 16px;
  background: var(--brand); color: #fff; border: 0; border-radius: 10px;
  font-size: 16px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn-sm { display: inline-block; width: auto; padding: 8px 14px; font-size: 14px; }

.choices { display: grid; gap: 9px; }
.choice {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; cursor: pointer; background: #fff;
  font-size: 14px;
}
.choice input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; margin: 0; }
.choice.checked { border-color: var(--brand); background: var(--brand-soft); }
.choices-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.alert {
  border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px;
}
.alert-err { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-info { background: var(--brand-soft); color: #123a7a; border: 1px solid #c7dbfa; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 6px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: 11px;
  padding: 13px 14px;
}
.kpi .v { font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.5px; }
.kpi .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi .k { font-size: 12px; color: var(--muted); margin-top: 3px; }

.bar { margin-bottom: 11px; }
.bar .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.bar .top b { font-weight: 600; }
.bar .track { height: 9px; background: #eef1f5; border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 99px; background: var(--brand); }
.bar .fill.warn { background: #e0a800; }
.bar .fill.danger { background: #dc2626; }
.bar .fill.ok { background: #16a34a; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.note { font-size: 12px; color: var(--muted); line-height: 1.7; }
.tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px;
  background: var(--brand-soft); color: #12408f; font-weight: 600;
}
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 0 0; }
.back { display: inline-block; margin-top: 14px; font-size: 14px; }

@media (min-width: 640px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .choices-grid { grid-template-columns: 1fr 1fr 1fr; }
}
