:root {
  --bg: #f7f7f5;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #111827;
  --soft: #f1f5f9;
  --good: #ecfdf5;
  --good-line: #a7f3d0;
  --warn: #fffbeb;
  --warn-line: #fde68a;
  --risk: #fff7ed;
  --risk-line: #fed7aa;
  --danger: #fef2f2;
  --danger-line: #fecaca;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: radial-gradient(circle at top left, #fff 0, var(--bg) 48%);
  color: var(--text);
  line-height: 1.6;
}

.app {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.hero, .panel {
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, .06);
}

.hero {
  padding: 32px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 13px;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.04em;
}

.intro {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.panel {
  min-height: 560px;
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.progress-wrap { margin-bottom: 24px; }

.progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-weight: 800;
}

#scoreText { color: var(--muted); }

.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
}

#progressFill {
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width .25s ease;
}

.question-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(24px, 5vw, 48px);
  background: #fff;
}

.category {
  color: var(--muted);
  font-weight: 800;
  margin: 0 0 12px;
}

.question-card h2 {
  font-size: clamp(28px, 5vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 18px;
}

.question-card p {
  margin: 0;
  color: var(--muted);
  font-size: 19px;
}

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 30px;
}

.option {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--text);
  border-radius: 20px;
  padding: 18px;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  text-align: left;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.option:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.option.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.result {
  border-radius: 28px;
  border: 1px solid var(--line);
  padding: clamp(24px, 5vw, 42px);
  background: var(--soft);
}

.result.good { background: var(--good); border-color: var(--good-line); }
.result.warn { background: var(--warn); border-color: var(--warn-line); }
.result.risk { background: var(--risk); border-color: var(--risk-line); }
.result.danger { background: var(--danger); border-color: var(--danger-line); }

.result h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: -0.03em;
}

.result .score {
  font-weight: 900;
  margin-bottom: 18px;
}

.result p { color: var(--muted); }

.suggestions {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.suggestions li {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
  padding: 12px 14px;
}

.hidden { display: none; }

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  font-size: 16px;
}

button.secondary {
  background: var(--soft);
  color: var(--text);
}

button:disabled {
  opacity: .38;
  cursor: not-allowed;
}

footer {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

@media (max-width: 640px) {
  .app { width: min(100% - 20px, 860px); padding: 20px 0; }
  .hero, .panel { padding: 22px; border-radius: 22px; }
  .progress-text { align-items: flex-start; flex-direction: column; }
  .options { grid-template-columns: 1fr; }
  .actions { flex-direction: column-reverse; }
  button { width: 100%; }
}
