:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #d9e0ea;
  --text: #142033;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-soft: #dbeafe;
  --success: #0f9f6e;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #f59e0b;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #eef4ff 0%, var(--bg) 100%);
  color: var(--text);
}
button, input, textarea { font: inherit; }
.app-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #0f172a;
  color: #fff;
  padding: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.brand-badge {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
}
.brand h1 { font-size: 20px; margin: 0 0 4px; }
.brand p { margin: 0; color: #cbd5e1; font-size: 13px; }
.exam-card, .progress-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
}
.exam-card h3 { margin: 0 0 8px; font-size: 18px; }
.exam-card p { margin: 6px 0; color: #cbd5e1; font-size: 14px; }
.progress-header { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.progress-bar { height: 10px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; }
.progress-bar > div { height: 100%; width: 0%; background: linear-gradient(90deg, #60a5fa, #34d399); }
.nav-title { margin: 24px 0 12px; font-size: 13px; color: #94a3b8; letter-spacing: .08em; }
.question-nav { display: grid; gap: 8px; }
.nav-item {
  width: 100%; text-align: left; background: rgba(255,255,255,0.04); color: #e2e8f0;
  border: 1px solid transparent; border-radius: 12px; padding: 10px 12px; cursor: pointer;
}
.nav-item.active { border-color: #60a5fa; background: rgba(96,165,250,0.18); }
.nav-item.done::after { content: "済"; float: right; color: #86efac; }
.main-content { padding: 28px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-bottom: 20px;
}
.eyebrow { margin: 0 0 4px; color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.topbar h2 { margin: 0; font-size: 28px; }
.topbar-actions { display: flex; gap: 12px; }
.primary-btn, .secondary-btn {
  border: none; border-radius: 12px; padding: 12px 18px; cursor: pointer; font-weight: 700;
}
.primary-btn { background: var(--primary); color: #fff; }
.secondary-btn { background: #e2e8f0; color: #0f172a; }
.panel, .question-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.intro-panel { padding: 22px; margin-bottom: 20px; }
.intro-panel ul { margin: 12px 0 0 18px; color: var(--muted); }
.questions { display: grid; gap: 18px; }
.question-card { padding: 22px; }
.question-header { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 14px; }
.question-index { color: var(--primary); font-weight: 700; font-size: 13px; }
.question-type {
  font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary);
}
.question-title { margin: 6px 0 8px; font-size: 20px; }
.question-desc { margin: 0; color: var(--muted); }
.options { display: grid; gap: 12px; margin-top: 18px; }
.option {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; gap: 12px; align-items: start;
}
.option input { margin-top: 4px; }
.text-input, .textarea-input {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #fff; margin-top: 18px;
}
.textarea-input { min-height: 120px; resize: vertical; }
.help-text { color: var(--muted); font-size: 13px; margin-top: 10px; }
.result-panel { padding: 24px; margin-top: 20px; }
.result-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin: 18px 0 22px;
}
.metric {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 16px; padding: 16px;
}
.metric-label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.metric-value { font-size: 28px; font-weight: 800; }
.feedback-list { display: grid; gap: 14px; }
.feedback-item {
  border-radius: 16px; padding: 16px; border: 1px solid var(--line); background: #fff;
}
.feedback-item.correct { border-color: #bbf7d0; background: #f0fdf4; }
.feedback-item.incorrect { border-color: #fecaca; background: #fef2f2; }
.feedback-status { font-weight: 800; margin-bottom: 8px; }
.feedback-links a { color: var(--primary); text-decoration: none; }
.hidden { display: none; }
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .result-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .main-content { padding: 18px; }
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-actions { flex-direction: column; }
  .result-summary { grid-template-columns: 1fr; }
}


.bottom-submit-bar {
  display: flex;
  justify-content: center;
  margin: 24px 0 8px;
}

.bottom-submit-btn {
  min-width: 280px;
  padding: 14px 28px;
  font-size: 16px;
  box-shadow: var(--shadow);
}
