@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+KR:wght@300;400;500;700;900&family=Fira+Code:wght@400;500&display=swap');

:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --panel: #ffffff;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-light: #f0fdfa;
  --accent-2: #be185d;
  --warn: #ea580c;
  --warn-light: #fff7ed;
  --success: #10b981;
  
  --hero-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --chapter-bg: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  --card-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.03), 0 2px 4px -1px rgba(15, 23, 42, 0.02);
  --card-shadow-hover: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  color: var(--ink);
  background-color: var(--bg);
  font-family: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease; }
a:hover { color: var(--accent-hover); }

/* --- [기존 뷰어 화면 레이아웃 안전 보존] --- */
.surface-shell { max-width: 1880px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.surface-topbar, .study-spread { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: var(--card-shadow); }
.surface-topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; }
.surface-topbar h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.subtitle { margin-top: 4px; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.top-actions a { min-height: 38px; display: inline-flex; align-items: center; padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); font-size: 13px; font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.top-actions a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.study-spread { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: start; overflow: hidden; min-height: calc(100vh - 120px); }
.pdf-pane { background: #ffffff; padding: 4px; display: flex; flex-direction: column; }
.pdf-stage { width: 100%; min-height: 480px; padding: 8px; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: flex-start; overflow: auto; background: #f1f5f9; border-radius: 12px; }
.canvas-frame { width: 100%; max-width: 820px; overflow: hidden; background: #ffffff; box-shadow: 0 4px 12px rgba(0,0,0,0.06); border-radius: 8px; margin-bottom: 8px; }
.canvas-card { width: 100%; background: #ffffff; line-height: 0; }
canvas.page-canvas { display: block; width: 100% !important; height: auto !important; background: #ffffff; }
.pdf-loading { width: 100%; color: var(--muted); padding: 24px; text-align: center; font-weight: 500; }
.study-pane { padding: 16px; background: #f8fafc; border-left: 1px solid var(--line); overflow: auto; display: grid; gap: 12px; align-content: start; height: 100%; }
.hero-line { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 8px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
h1 { margin: 0 0 12px; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
h2 { margin: 0 0 10px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
h3 { margin: 20px 0 8px; font-size: 16px; font-weight: 700; }
.score { min-width: 80px; padding: 12px 14px; text-align: center; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; font-weight: 800; font-size: 18px; color: var(--accent); box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.badge-row, .chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.badge, .chip { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: #f1f5f9; font-size: 12px; font-weight: 600; }
.chip.soft { background: var(--accent-light); color: var(--accent); border-color: rgba(13, 148, 136, 0.2); }
.badge-partial-practice, .badge-needs-check { background: var(--warn-light); border-color: rgba(234, 88, 12, 0.3); color: var(--warn); }
.meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.meta-grid div, .panel { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; box-shadow: var(--card-shadow); }
.meta-grid div { padding: 12px; }
.meta-grid span { display: block; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.meta-grid strong { display: block; font-size: 18px; font-weight: 800; margin-top: 2px; color: var(--ink); }
.panel { padding: 20px; margin: 16px 0; }
.attempt { border-left: 4px solid var(--accent); }
.review, .candidate, .uncertain { border-left: 4px solid var(--warn); }
summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.tool-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.tool-table th, .tool-table td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; text-align: left; }
.tool-table th { font-weight: 700; color: var(--muted); }
code { font-family: "Fira Code", "Cascadia Mono", Consolas, monospace; font-size: 0.9em; background: #f1f5f9; padding: 2px 4px; border-radius: 4px; }
.muted, .mini { color: var(--muted); font-size: 13px; }
.quote { margin-top: 8px; padding-left: 12px; border-left: 4px solid var(--line); color: #475569; font-size: 13px; font-style: italic; }
.candidate-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; background: #fffdfa; }
.candidate-title { font-weight: 700; color: var(--warn); margin-bottom: 6px; }
.problem-text { white-space: pre-wrap; border-top: 1px solid var(--line); padding-top: 12px; font-family: inherit; font-size: 14px; }

/* ==========================================================================
   [1안 독점 혁신: Split-Panel Sidebar Layout]
   ========================================================================== */
.index-shell {
  max-width: 1740px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 32px;
  height: 100vh;
  overflow: hidden;
}

/* 왼쪽 사이드바 고정 히어로 */
.portal-hero {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background: var(--hero-bg);
  padding: 32px 28px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
}

.portal-hero::-webkit-scrollbar {
  width: 4px;
}
.portal-hero::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}

.portal-hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -20%;
  width: 250px;
  height: 250px;
  background: var(--accent);
  filter: blur(80px);
  opacity: 0.2;
  pointer-events: none;
}

.portal-hero .eyebrow {
  color: #2dd4bf;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  margin-bottom: 6px;
}

.portal-hero h1 {
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
  line-height: 1.25;
}

.portal-hero p {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* 세션 탭 버튼들을 사이드바 세로 탭으로 전면 개편 */
.mode-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
  width: 100%;
}

.mode-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none;
  width: 100%;
}

.mode-nav a:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.08);
}

.mode-nav a.active, .mode-nav a:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.mode-nav a.active:hover, .mode-nav a:first-child:hover {
  transform: none;
  background: var(--accent-hover);
}

/* KPI 위젯 사이드바 맞춤 2열 정렬 */
.portal-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: auto; /* 하단 밀착 배치 */
}

.portal-kpis div {
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.portal-kpis div:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.portal-kpis span {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

.portal-kpis strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* 오른쪽 메인 챕터 목록 (독립 스크롤 영역) */
.section-group {
  margin-top: 0;
  height: calc(100vh - 48px);
  overflow-y: auto;
  padding-right: 12px;
}

/* 아름다운 스크롤바 코팅 */
.section-group::-webkit-scrollbar {
  width: 8px;
}
.section-group::-webkit-scrollbar-track {
  background: transparent;
}
.section-group::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}
.section-group::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  border-bottom: 2px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0 0 2px;
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.sort-controls { display: none; } /* 편의성을 위해 무용한 컨트롤 숨김 */

/* 챕터 카드 그룹 */
.chapter-group {
  margin-top: 24px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--chapter-bg);
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}

.chapter-group:first-child {
  margin-top: 0;
}

.chapter-group:hover {
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.04);
}

.chapter-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.chapter-heading span {
  display: none; /* Chapter X 중복 숨김 */
}

.chapter-heading h2 {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.chapter-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

/* 챕터 그리드 3열 */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

/* 개별 카드 리디자인 */
.portal-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-height: 180px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--card-shadow);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.portal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.portal-card.no-exam {
  background: #ffffff;
  border-color: var(--line);
}

.portal-card.has-exam {
  background: var(--accent-light);
  border-color: rgba(13, 148, 136, 0.18);
}

.portal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
}

.portal-card-head span {
  display: none; /* section X.X 중복 숨김 */
}

.portal-card-head em {
  color: var(--warn);
  font-style: normal;
  font-weight: 700;
  background: var(--warn-light);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  border: 1px solid rgba(234, 88, 12, 0.15);
}

.portal-card.no-exam .portal-card-head em {
  color: var(--muted);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.portal-card strong {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  margin-top: 2px;
  margin-bottom: auto;
}

.portal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 0;
}

.portal-meta .chip {
  min-height: 22px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #334155;
}

/* 칩 정밀 컬러 매핑 */
.portal-meta .chip[class*="grade"] { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.portal-meta .chip[class*="grade A"] { background: #fee2e2; color: #991b1b; border-color: #f87171; }
.portal-meta .chip[class*="grade B"] { background: #fef3c7; color: #92400e; border-color: #fbbf24; }
.portal-meta .chip[class*="grade C"] { background: #e0f2fe; color: #075985; border-color: #60a5fa; }
.portal-meta .chip[class*="grade D"] { background: #f3e8ff; color: #6b21a8; border-color: #c084fc; }
.portal-meta .chip[class*="grade E"] { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.portal-meta .chip.foundation { background: #ecfdf5; color: #065f46; border-color: #34d399; }
.portal-meta .chip.direct { background: #fff7ed; color: #9a3412; border-color: #fb923c; }
.portal-meta .chip.support { background: #f8fafc; color: #334155; border-color: #cbd5e1; }
.portal-meta .chip.must-study { background: #f0fdf4; color: #166534; border-color: #4ade80; }
.portal-meta .chip.solid-study { background: #eff6ff; color: #1e40af; border-color: #60a5fa; }
.portal-meta .chip.skim-ok { background: #fffbeb; color: #854d0e; border-color: #fbbf24; }
.portal-meta .chip.skip-for-now, .portal-meta .chip.reference-only { background: #f8fafc; color: #475569; border-color: #cbd5e1; }

.portal-card small {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 4px;
  align-self: flex-start;
  font-family: "Fira Code", Consolas, monospace;
}

/* 액션 링크 버튼화 */
.portal-links {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
}

.portal-links a, .portal-links .disabled-link {
  flex: 1;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-links a[href*="sections/"] {
  border: 1px solid var(--accent);
  background: var(--panel);
  color: var(--accent);
}
.portal-links a[href*="sections/"]:hover {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.12);
}
.portal-links a[href*="exam_problem_surface"] {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
}
.portal-links a[href*="exam_problem_surface"]:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}
.portal-links .disabled-link {
  border: 1px solid var(--line);
  color: var(--muted);
  background: #f1f5f9;
  cursor: not-allowed;
  user-select: none;
}

/* 반응형 모바일 브레이크포인트 */
@media (max-width: 920px) {
  .index-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
    padding: 16px;
  }
  
  .portal-hero {
    height: auto;
    overflow: visible;
    padding: 24px;
  }
  
  .mode-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .mode-nav a {
    width: auto;
    flex: 1;
    min-width: 140px;
  }
  
  .portal-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 20px;
  }
  
  .section-group {
    height: auto;
    overflow: visible;
    padding-right: 0;
    margin-top: 20px;
  }
  
  .chapter-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   [기출 서브 페이지 전용 디자인 큐 오버라이드 (Teal/Slate) ]
   ========================================================================== */
/* 무효화: 메인 디자인 통일\n.exam-surface-body .index-shell {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  height: auto;
  overflow: visible;
}\n*/

/* 무효화: 메인 디자인 통일\n.exam-surface-body .mode-nav {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  width: auto;
}\n*/

/* 무효화: 메인 디자인 통일\n.exam-surface-body .mode-nav a {
  width: auto;
  border-radius: 999px;
  padding: 8px 20px;
  min-height: auto;
  text-align: center;
  justify-content: center;
  transform: none;
  background: #f1f5f9;
  border-color: var(--line);
  color: var(--muted);
  box-shadow: none;
}\n*/
/* 무효화: 메인 디자인 통일\n.exam-surface-body .mode-nav a:hover {
  transform: translateY(-2px);
  color: var(--ink);
  border-color: #cbd5e1;
  background: #e2e8f0;
}\n*/
/* 무효화: 메인 디자인 통일\n.exam-surface-body .mode-nav a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}\n*/

.exam-surface-body h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 8px;
}

.exam-surface-body p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 32px;
}

/* 기출 섹션 그룹 */
.exam-surface-body .section-group {
  height: auto;
  overflow: visible;
  padding-right: 0;
  margin-top: 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  padding: 24px 28px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}
.exam-surface-body .section-group:hover {
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.04);
}

.exam-surface-body .section-heading {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exam-surface-body .section-heading h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.exam-surface-body .section-heading p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.exam-surface-body .section-actions {
  display: flex;
  gap: 8px;
}
.exam-surface-body .section-actions a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.exam-surface-body .section-actions a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* 아이템 그리드 및 카드 */
.exam-surface-body .item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.exam-surface-body .item-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  transition: all 0.2s ease;
  box-shadow: var(--card-shadow);
}
.exam-surface-body .item-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--card-shadow-hover);
}

.exam-surface-body .item-card span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.exam-surface-body .item-card strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  margin: 6px 0;
}

.exam-surface-body .item-card em {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  font-style: normal;
}

.exam-surface-body .item-card small {
  font-family: "Fira Code", Consolas, monospace;
  font-size: 10px;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 6px;
  align-self: flex-start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* 정렬 컨트롤 */
.exam-surface-body .sort-controls {
  display: block;
  margin-bottom: 24px;
}
.exam-surface-body .sort-controls button {
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.exam-surface-body .sort-controls button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* 통계 그리드 및 카드 (기출 분석 전용) */
.exam-surface-body .stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.exam-surface-body .stat-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.exam-surface-body .stat-card span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.exam-surface-body .stat-card strong {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}

/* 분석 그래프 (기출 분석 전용) */
.exam-surface-body .analysis-block {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
}
.exam-surface-body .analysis-block h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.exam-surface-body .bar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.exam-surface-body .bar-list li {
  display: grid;
  grid-template-columns: 320px 1fr 80px;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}
.exam-surface-body .bar-list li span {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.exam-surface-body .bar-list li .bar {
  height: 8px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.exam-surface-body .bar-list li .bar i {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}
.exam-surface-body .bar-list li strong {
  text-align: right;
  font-weight: 700;
  color: var(--muted);
}

/* 모바일 브레이크포인트 */
@media (max-width: 768px) {
  .exam-surface-body .bar-list li {
    grid-template-columns: 1fr;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
  }
  .exam-surface-body .bar-list li strong {
    text-align: left;
  }
}

\n
\n
\n
\n
\n
\n
\n
\n
/* [디자인 큐 통합] 기출 서브 페이지 우측 콘텐츠 스크롤 영역 스타일 */
body.exam-surface-body {
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.exam-content-scroll {
  margin-top: 0;
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  min-height: 0;
  overflow-y: auto;
  padding-right: 12px;
}
.exam-content-scroll::-webkit-scrollbar {
  width: 8px;
}
.exam-content-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.exam-content-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}
.exam-content-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 테마별 스크롤바 컬러 오버라이드 대응 */
.theme-gold .exam-content-scroll::-webkit-scrollbar-thumb {
  background: rgba(212, 163, 89, 0.2);
}
.theme-gold .exam-content-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 163, 89, 0.4);
}
.theme-cyber .exam-content-scroll::-webkit-scrollbar-thumb {
  background: rgba(129, 140, 248, 0.25);
}
.theme-cyber .exam-content-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.4);
}

/* 기출 서브 페이지 사이드바 5탭 대응 패딩 컴팩트 오버라이드 */
.exam-surface-body .portal-hero {
  height: 100%;
  min-height: 0;
  padding: 24px 20px;
  overflow-y: auto;
}
.exam-surface-body .portal-hero::-webkit-scrollbar {
  width: 4px;
}
.exam-surface-body .portal-hero::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
}
.exam-surface-body .portal-hero p {
  margin-bottom: 16px;
}
.exam-surface-body .mode-nav {
  margin-bottom: 20px;
  gap: 6px;
}
.exam-surface-body .mode-nav a,
.exam-surface-body .log-trigger-btn {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 12.5px;
}

/* 기출 서브용 KPI 마진 탑 오버라이드 (margin-top: auto flexbox 계산 오류 방지) */
.exam-surface-body .portal-kpis {
  margin-top: 20px !important;
}

/* 기출 서브 페이지에서는 첫 번째 탭(통합 홈)의 강제 활성화 하이라이트를 해제 */
.exam-surface-body .mode-nav a:first-child {
  border-color: var(--line) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  color: var(--muted) !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  transform: none !important;
}
.exam-surface-body .mode-nav a:first-child:hover {
  border-color: var(--accent) !important;
  color: #ffffff !important;
  background: var(--accent-light) !important;
}

/* cyber/gold/teal 테마 하에서 hover 텍스트 컬러 보정 */
.theme-cyber.exam-surface-body .mode-nav a:first-child:hover {
  color: #ffffff !important;
}
.theme-gold.exam-surface-body .mode-nav a:first-child:hover {
  color: #ffffff !important;
}
.theme-teal.exam-surface-body .mode-nav a:first-child:hover {
  color: var(--accent) !important;
}
