:root {
  --ink: #13253f;
  --muted: #5f718a;
  --line: #d4dfec;
  --bg: #f7fbff;
  --card: #ffffff;
  --brand: #0a6db6;
  --ok: #17864e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% -20%, #fff3de, transparent 30%),
    radial-gradient(circle at 120% 20%, #e6f6ff, transparent 35%),
    var(--bg);
}

.summary-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.topbar {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2e5f89;
  font-size: 0.75rem;
  font-weight: 700;
}

h1 {
  margin: 8px 0;
  font-size: 1.7rem;
}

.meta {
  margin: 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.btn {
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
}

.btn.ghost {
  border: 1px solid var(--line);
  color: #395a7a;
  background: #fff;
}

.btn.primary {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--brand), #2f95cc);
}

.totals-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.total-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.total-card .label {
  color: var(--muted);
  font-size: 0.88rem;
}

.total-card .value {
  margin-top: 8px;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: 14px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
}

.question-grid {
  display: grid;
  gap: 12px;
}

.question-card {
  border: 1px solid #e4ebf5;
  border-radius: 12px;
  padding: 12px;
  background: #fcfdff;
}

.question-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.question-title {
  margin: 0;
  font-size: 0.98rem;
}

.question-meta {
  color: var(--muted);
  font-size: 0.83rem;
  white-space: nowrap;
}

.bars {
  display: grid;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(170px, 3fr) auto;
  gap: 8px;
  align-items: center;
}

.bar-label {
  color: #304a68;
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track {
  background: #e8eff8;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0f75c2, #34afd8);
}

.bar-value {
  color: var(--muted);
  font-size: 0.82rem;
}

.empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.avg-pill {
  font-weight: 800;
  color: var(--ok);
  font-size: 0.9rem;
}

.text-list {
  display: grid;
  gap: 10px;
}

.text-item {
  border: 1px solid #e5edf6;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
}

.text-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.text-line {
  margin: 6px 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.text-line strong {
  color: #234160;
}

@media (max-width: 820px) {
  .topbar {
    flex-direction: column;
  }

  .totals-grid {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .bar-label,
  .bar-value {
    white-space: normal;
  }
}
