/* ==========================================================================
   역사야 놀자 (history.chatgpts.kr)
   "한자야 놀자" 스타일의 따뜻한 카드형 UI & 브라운/양피지 감성
   모바일 최적화 레이아웃 및 클린 애드센스 슬롯
   ========================================================================== */

:root {
  /* 호환성 변수 매핑 */
  --bg-color: var(--color-bg);
  --bg-parchment: var(--color-bg);
  --bg-subtle: var(--color-subtle-bg);
  --main-color: var(--color-primary);
  --main-dark: var(--color-primary-dark);
  --point-color: var(--color-point);
  --accent-red: var(--color-accent);
  --text-main: var(--color-text);
  --text-muted: var(--color-text-soft);
  --text-light: var(--color-text-light);
  --card-bg: var(--color-card);
  --border-color: var(--color-border);
  --border-dark: var(--color-point);
  --font-base: var(--font-main);

  --color-bg: #FDF9F0;
  --color-primary: #92400E;         /* 따뜻한 앰버 브라운 */
  --color-primary-dark: #78350F;    /* 깊이 있는 다크 브라운 */
  --color-point: #D97706;          /* 앤틱 골드 */
  --color-accent: #991B1B;         /* 고전 인장 다크레드 */
  --color-secondary: #047857;      /* 에메랄드 세이지 그린 */
  --color-text: #292524;           /* 먹빛 딥 차콜 */
  --color-text-soft: #78716C;      /* 부드러운 웜 그레이 */
  --color-text-light: #A8A29E;
  --color-card: #FFFFFF;
  --color-border: #FDE68A;         /* 따뜻한 양피지 골드 테두리 */
  --color-border-subtle: #FEF3C7;
  --color-subtle-bg: #FFFBEB;

  --shadow-soft: 0 8px 24px rgba(120, 53, 15, 0.07);
  --shadow-hover: 0 14px 32px rgba(120, 53, 15, 0.12);
  --shadow-sm: 0 2px 8px rgba(120, 53, 15, 0.05);

  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --radius-full: 9999px;

  --font-main: 'Gowun Dodum', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Jua', var(--font-main);
  --font-history: 'Noto Serif KR', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  scroll-behavior: smooth;
  word-break: keep-all;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* "한자야 놀자" 특유의 따뜻하고 은은한 배경 그라데이션 (양피지/고서 감성) */
body {
  background-image:
    radial-gradient(circle at 10% 8%, #FFF3DF 0%, transparent 45%),
    radial-gradient(circle at 90% 15%, #FDE8CF 0%, transparent 40%),
    radial-gradient(circle at 50% 95%, #FEF3C7 0%, transparent 45%);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ==================== 컨테이너 & 레이아웃 ==================== */
.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 18px 60px;
  position: relative;
}

/* ==================== 헤더 ("한자야 놀자" 시그니처 엠블럼) ==================== */
.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 249, 240, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 2.5px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 6px;
  margin-bottom: 8px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  transition: transform 0.2s ease;
}

.brand-logo:hover {
  transform: translateY(-1px);
}

/* "한자야 놀자"의 동그란 붓글씨 엠블럼 로고 형태 (史 : 역사 사) */
.brand-logo .logo-char {
  font-family: var(--font-history);
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, #FDE68A 0%, #D97706 100%);
  color: #78350F;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.28);
  border: 2px solid #FFFFFF;
}

.brand-logo .dot {
  color: var(--color-accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.family-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: #FFFFFF;
  border: 1.5px solid var(--color-border);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary-dark);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.family-btn:hover {
  background: var(--color-subtle-bg);
  border-color: var(--color-point);
  transform: translateY(-1px);
}

/* 패밀리 드롭다운 */
.family-nav-wrap {
  position: relative;
}

.family-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #FFFFFF;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  min-width: 175px;
  z-index: 1000;
  overflow: hidden;
}

.family-dropdown.show {
  display: flex;
  flex-direction: column;
}

.family-dropdown a {
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #F3F4F6;
  transition: background 0.15s ease;
}

.family-dropdown a:hover {
  background: var(--color-subtle-bg);
  color: var(--color-primary);
}

/* ==================== 상단 네비게이션 칩 스크롤 ==================== */
.nav-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 16px;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-scroll::-webkit-scrollbar {
  display: none;
}

.nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: #FFFFFF;
  border: 1.5px solid var(--color-border);
  color: var(--color-text-soft);
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.nav-chip:hover {
  border-color: var(--color-point);
  color: var(--color-primary-dark);
  background: var(--color-subtle-bg);
  transform: translateY(-2px);
}

.nav-chip.active {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(146, 64, 14, 0.25);
}

/* ==================== 애드센스 클린 슬롯 (다른 사이트 동일 방식) ==================== */
.ad-slot,
.ad-placeholder {
  margin: 22px auto;
  min-height: 1px;
  text-align: center;
  clear: both;
}

.ad-placeholder {
  display: none; /* 이전 노란색 박스 제거 및 무간섭 슬롯 처리 */
}

/* ==================== 섹션 공통 헤더 ("한자야 놀자" 패턴) ==================== */
.section-head {
  text-align: center;
  margin-bottom: 24px;
}

.section-head .eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--color-point);
  background: #FEF3C7;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--color-primary-dark);
  margin-bottom: 8px;
}

.section-head p {
  font-size: 14.5px;
  color: var(--color-text-soft);
  line-height: 1.55;
}

/* ==================== 메인 히어로 배너 ==================== */
.hero-banner {
  background: #FFFFFF;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 34px 24px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-soft);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '歷';
  font-family: var(--font-history);
  position: absolute;
  top: -20px;
  right: -10px;
  font-size: 140px;
  opacity: 0.04;
  color: var(--color-primary-dark);
  pointer-events: none;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--color-primary-dark);
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 15.5px;
  color: var(--color-text-soft);
  line-height: 1.6;
  margin-bottom: 22px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-stat-pill {
  background: var(--color-subtle-bg);
  border: 1px solid var(--color-border);
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary-dark);
  box-shadow: var(--shadow-sm);
}

/* ==================== 오늘의 역사 카드 ==================== */
.today-history-box {
  background: #FFFFFF;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-soft);
}

.today-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--color-border-subtle);
  flex-wrap: wrap;
  gap: 8px;
}

.today-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.today-date-chip {
  background: #FEF3C7;
  color: var(--color-primary-dark);
  font-size: 12.5px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .today-grid {
    grid-template-columns: 1fr;
  }
}

.today-item {
  background: var(--color-bg);
  border: 1.5px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.today-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.today-item-type {
  font-size: 12px;
  font-weight: 800;
  color: var(--color-point);
  margin-bottom: 5px;
}

.today-item-title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--color-text);
  margin-bottom: 6px;
}

.today-item-desc {
  font-size: 13.5px;
  color: var(--color-text-soft);
  line-height: 1.5;
}

/* ==================== 6대 메인 CTA 카드 ("한자야 놀자" 스타일) ==================== */
.cta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}

@media (max-width: 640px) {
  .cta-grid {
    grid-template-columns: 1fr;
  }
}

.cta-card {
  background: #FFFFFF;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cta-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-point);
  box-shadow: var(--shadow-hover);
}

.cta-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--color-subtle-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 14px;
  border: 1.5px solid var(--color-border);
}

.cta-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-primary-dark);
  margin-bottom: 6px;
}

.cta-desc {
  font-size: 14px;
  color: var(--color-text-soft);
  line-height: 1.55;
  margin-bottom: 20px;
  flex-grow: 1;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--color-primary);
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 14.5px;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(146, 64, 14, 0.2);
  transition: all 0.2s ease;
}

.cta-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(146, 64, 14, 0.3);
}

/* ==================== 시대별 카드 (한국사/세계사) ==================== */
.period-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

.period-card {
  background: #FFFFFF;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: var(--shadow-soft);
  transition: all 0.25s ease;
}

.period-card:hover {
  border-color: var(--color-point);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.period-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.period-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FEF3C7;
  color: var(--color-primary-dark);
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.period-card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--color-primary-dark);
}

.period-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.keyword-tag {
  background: var(--color-bg);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text);
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
}

.period-events-list {
  background: var(--color-bg);
  border: 1.5px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.period-events-list h4 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.period-event-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  padding: 7px 0;
  border-bottom: 1px dashed #E7E5E4;
}

.period-event-row:last-child {
  border-bottom: none;
}

.event-year-badge {
  background: var(--color-primary);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  min-width: 68px;
  text-align: center;
  flex-shrink: 0;
}

.event-title-text {
  font-weight: 700;
  color: var(--color-text);
}

.period-exam-point {
  background: #FFFBEB;
  border-left: 4px solid var(--color-point);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13.5px;
  color: #78350F;
  margin-bottom: 16px;
  line-height: 1.5;
}

.period-action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ==================== 통합 연표 (Timeline) ==================== */
.timeline-controls {
  background: #FFFFFF;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
}

.filter-tab-group {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--color-text-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tab:hover {
  background: var(--color-subtle-bg);
  color: var(--color-primary-dark);
}

.filter-tab.active {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  outline: none;
  font-family: inherit;
  background: #FFFFFF;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(146, 64, 14, 0.12);
}

.timeline-stream {
  position: relative;
  padding-left: 28px;
  margin-bottom: 30px;
}

.timeline-stream::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 18px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 18px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-point);
  border: 3px solid #FFFFFF;
  box-shadow: 0 0 0 2px var(--color-primary);
  z-index: 2;
}

.timeline-card {
  background: #FFFFFF;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
  transition: all 0.2s ease;
}

.timeline-card:hover {
  transform: translateX(4px);
  border-color: var(--color-point);
  box-shadow: var(--shadow-hover);
}

.timeline-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}

.timeline-year-tag {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  font-weight: 800;
}

.timeline-type-pill {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

.timeline-type-pill.korea {
  background: #FEF3C7;
  color: #92400E;
}

.timeline-type-pill.world {
  background: #DBEAFE;
  color: #1E40AF;
}

.timeline-item-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--color-text);
  margin-bottom: 6px;
}

.timeline-item-summary {
  font-size: 14px;
  color: var(--color-text-soft);
  line-height: 1.55;
  margin-bottom: 10px;
}

.timeline-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--color-text-light);
}

.star-rating {
  color: #F59E0B;
}

/* ==================== 기출변형 문제 (Exam) ==================== */
.exam-disclaimer-box {
  background: #FFFBEB;
  border: 1.5px solid #FCD34D;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 13.5px;
  color: #92400E;
  line-height: 1.6;
}

.exam-disclaimer-box a {
  text-decoration: underline;
  font-weight: 800;
  color: var(--color-primary-dark);
}

.exam-card-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 30px;
}

.exam-card {
  background: #FFFFFF;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow-soft);
}

.exam-meta-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 12.5px;
}

.exam-type-tag {
  background: var(--color-primary);
  color: #FFFFFF;
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 800;
}

.exam-topic-tag {
  background: var(--color-subtle-bg);
  color: var(--color-primary-dark);
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 700;
}

.exam-kice-info {
  font-size: 12px;
  color: var(--color-text-soft);
  margin-left: auto;
}

.exam-question-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-text);
  margin-bottom: 14px;
  line-height: 1.5;
}

.exam-choice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.exam-choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border: 1.5px solid #E5E7EB;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  font-size: 14.5px;
  color: var(--color-text);
  text-align: left;
  transition: all 0.2s ease;
}

.exam-choice-btn:hover {
  background: var(--color-bg);
  border-color: var(--color-point);
}

.exam-choice-btn.selected {
  border-color: var(--color-primary);
  background: var(--color-subtle-bg);
}

.exam-choice-btn.correct {
  background: #ECFDF5 !important;
  border-color: #10B981 !important;
  color: #065F46 !important;
  font-weight: 800;
}

.exam-choice-btn.wrong {
  background: #FEF2F2 !important;
  border-color: #EF4444 !important;
  color: #991B1B !important;
}

.choice-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #F3F4F6;
  font-size: 12.5px;
  font-weight: 800;
  flex-shrink: 0;
}

.exam-explain-box {
  display: none;
  background: var(--color-subtle-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.65;
}

.exam-explain-box.show {
  display: block;
}

.explain-section-title {
  font-weight: 900;
  color: var(--color-primary-dark);
  margin-bottom: 8px;
  font-size: 15px;
}

.explain-wrong-options {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
  color: #57534E;
}

.explain-timeline-flow {
  margin-top: 12px;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  color: var(--color-primary-dark);
}

/* ==================== 연표 프린트 만들기 (Print) ==================== */
.print-builder-card {
  background: #FFFFFF;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-soft);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 800;
  font-size: 14.5px;
  color: var(--color-primary-dark);
  margin-bottom: 10px;
}

.pill-select-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  background: #FFFFFF;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-text-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-radio:hover {
  background: var(--color-subtle-bg);
  color: var(--color-primary-dark);
}

.pill-radio.active {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}

.print-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.worksheet-area {
  background: #FFFFFF;
  border: 2px solid #D1D5DB;
  border-radius: var(--radius-sm);
  padding: 38px 32px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-soft);
  font-family: var(--font-history);
}

.worksheet-header {
  border-bottom: 2px solid #1C1917;
  padding-bottom: 16px;
  margin-bottom: 26px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.worksheet-title {
  font-size: 24px;
  font-weight: 900;
  color: #1C1917;
}

.worksheet-score-box {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

.worksheet-item {
  margin-bottom: 22px;
  line-height: 1.75;
  font-size: 15px;
}

.worksheet-answer-key {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 2px dashed #9CA3AF;
}

/* ==================== 역사 퀴즈 (Quiz) ==================== */
.quiz-stage-box {
  background: #FFFFFF;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.quiz-progress-bar-wrap {
  width: 100%;
  height: 9px;
  background: #F3F4F6;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 20px;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #D97706);
  width: 0%;
  transition: width 0.35s ease;
}

.quiz-meta-info {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--color-text-soft);
  margin-bottom: 18px;
}

.quiz-question-text {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--color-primary-dark);
  margin-bottom: 24px;
  line-height: 1.5;
}

.quiz-choices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

@media (max-width: 600px) {
  .quiz-choices-grid {
    grid-template-columns: 1fr;
  }
}

.quiz-choice-btn, .choice-btn {
  padding: 16px 18px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-size: 15px;
  font-weight: 800;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.quiz-choice-btn:hover, .choice-btn:hover {
  border-color: var(--color-point);
  background: var(--color-subtle-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.quiz-choice-btn.correct {
  background: #ECFDF5 !important;
  border-color: #10B981 !important;
  color: #065F46 !important;
}

.quiz-choice-btn.wrong {
  background: #FEF2F2 !important;
  border-color: #EF4444 !important;
  color: #991B1B !important;
}

.quiz-feedback-box {
  display: none;
  background: var(--color-subtle-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 14.5px;
  text-align: left;
  line-height: 1.6;
}

.quiz-feedback-box.show {
  display: block;
}

/* ==================== 로그인 & 내 학습실 (Auth) ==================== */
.auth-card {
  background: #FFFFFF;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  max-width: 440px;
  margin: 0 auto 30px;
  box-shadow: var(--shadow-soft);
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 11px;
  font-family: var(--font-display);
  font-size: 16.5px;
  color: var(--color-text-soft);
  text-align: center;
  border-bottom: 3.5px solid transparent;
  margin-bottom: -2.5px;
  transition: all 0.2s ease;
}

.auth-tab.active {
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-primary);
  font-weight: 800;
}

.auth-form label {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 14px;
}

.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  margin-top: 6px;
  outline: none;
  font-family: inherit;
  background: #FFFFFF;
}

.auth-form input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(146, 64, 14, 0.12);
}

.auth-submit-btn {
  width: 100%;
  padding: 13px;
  background: var(--color-primary);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 15px;
  margin-top: 10px;
  box-shadow: 0 4px 12px rgba(146, 64, 14, 0.25);
  transition: all 0.2s ease;
}

.auth-submit-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border: 1.5px solid #D1D5DB;
  border-radius: var(--radius-full);
  background: #FFFFFF;
  color: #374151;
  font-weight: 800;
  font-size: 14px;
  margin-top: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-google:hover {
  background: #F9FAFB;
  border-color: #9CA3AF;
  transform: translateY(-1px);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--color-text-light);
  font-size: 12px;
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #E5E7EB;
}

.auth-divider span {
  padding: 0 10px;
}

/* ==================== 놀자 패밀리 배너 ("한자야 놀자" 스타일) ==================== */
.nolja-family-banner {
  background: #FFFFFF;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  margin-bottom: 30px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.nolja-family-banner h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-primary-dark);
  margin-bottom: 14px;
}

.family-link-chips {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.family-chip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.family-chip-link:hover {
  border-color: var(--color-point);
  color: var(--color-primary-dark);
  background: var(--color-subtle-bg);
  transform: translateY(-2px);
}

/* ==================== 푸터 & 안내문 ==================== */
.site-foot {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 2px solid var(--color-border);
  text-align: center;
  color: var(--color-text-soft);
}

.disclaimer-box {
  background: #FFFFFF;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
  margin-bottom: 20px;
  color: var(--color-text-soft);
}

.disclaimer-box strong {
  color: var(--color-primary-dark);
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
}

.footer-nav-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.footer-nav-links a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.footer-copy {
  font-size: 12px;
  color: var(--color-text-light);
}

/* ==================== 공통 버튼 ==================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--color-primary);
  color: #FFFFFF;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(146, 64, 14, 0.25);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #FFFFFF;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  padding: 11px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--color-point);
  color: var(--color-primary-dark);
  background: var(--color-subtle-bg);
  transform: translateY(-2px);
}

/* 토스트 메시지 */
.toast-msg {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(41, 37, 36, 0.95);
  color: #FFFFFF;
  padding: 11px 24px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==================== @media print ==================== */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 12pt !important;
  }

  .site-head,
  .nav-scroll,
  .page-header,
  .print-builder-card,
  .ad-slot,
  .ad-placeholder,
  .nolja-family-banner,
  .site-foot,
  .toast-msg {
    display: none !important;
  }

  .wrap {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .worksheet-area {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .worksheet-header {
    border-bottom: 2pt solid #000000 !important;
  }

  .worksheet-item {
    page-break-inside: avoid;
  }
}

/* ==================== 연상 기억 팁 (Mnemonic) ==================== */
.event-mnemonic-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
  line-height: 1.3;
}

.event-mnemonic-pill i {
  color: #D97706;
}

.timeline-mnemonic-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FFFBEB;
  color: #78350F;
  border: 1px dashed #D97706;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 4px;
}

.today-mnemonic-box {
  margin-top: 10px;
  background: #FFFBEB;
  border-left: 3px solid #D97706;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: #78350F;
  line-height: 1.45;
}

.print-mnemonic-text {
  color: #92400E;
  font-size: 12px;
  font-weight: 600;
}

.cta-icon-wrap, .cta-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--color-subtle-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 14px;
  border: 1.5px solid var(--color-border);
}

/* ==================== 지도에서 보는 역사 (map.html) ==================== */
.map-controls {
  margin-bottom: 20px;
}

.map-tab-group {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.map-tab-btn {
  flex: 1;
  padding: 12px 18px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  background: #FFFFFF;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--color-text-soft);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.map-tab-btn:hover {
  border-color: var(--color-point);
  background: var(--color-subtle-bg);
  transform: translateY(-2px);
}

.map-tab-btn.active {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(146, 64, 14, 0.25);
}

.map-interactive-container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  margin-bottom: 30px;
  align-items: start;
}

@media (max-width: 768px) {
  .map-interactive-container {
    grid-template-columns: 1fr;
  }
}

.map-visual-box {
  background: #FDF6E2;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.map-visual-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--color-primary-dark);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1.5px dashed var(--color-border);
  flex-wrap: wrap;
  gap: 6px;
}

.map-guide-hint {
  font-size: 12px;
  color: var(--color-point);
  font-weight: 700;
}

.map-viewport {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #FAF0D7;
  border-radius: var(--radius-md);
  position: relative;
  border: 1.5px solid #F3DFC1;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(120, 53, 15, 0.08);
}

.map-svg-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* 인터랙티브 핀 */
.map-marker {
  position: absolute;
  transform: translate(-50%, -100%);
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}

.map-marker:hover,
.map-marker.active {
  transform: translate(-50%, -115%) scale(1.15);
  z-index: 30;
}

.marker-pin {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  background: var(--color-point);
  position: relative;
  transform: rotate(-45deg);
  box-shadow: 0 4px 10px rgba(120, 53, 15, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
}

.map-marker.active .marker-pin {
  background: var(--color-accent);
  border-color: #FEF3C7;
  box-shadow: 0 0 16px rgba(153, 27, 27, 0.6);
}

.marker-dot {
  width: 12px;
  height: 12px;
  background: #FFFFFF;
  border-radius: 50%;
  position: absolute;
}

.marker-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(41, 37, 36, 0.88);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  margin-top: 4px;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.map-marker.active .marker-label {
  background: var(--color-primary-dark);
  border: 1px solid #FEF3C7;
}

/* 거점 상세 정보 카드 */
.map-detail-card {
  background: #FFFFFF;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  min-height: 360px;
}

.map-detail-placeholder {
  text-align: center;
  padding: 50px 16px;
  color: var(--color-text-soft);
}

.map-detail-placeholder h4 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-primary-dark);
  margin-bottom: 8px;
}

.map-detail-placeholder p {
  font-size: 14px;
  line-height: 1.6;
}

.map-detail-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  background: #FEF3C7;
  color: var(--color-primary-dark);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
}

.map-detail-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--color-primary-dark);
  margin-bottom: 6px;
}

.map-detail-period {
  font-size: 13.5px;
  color: var(--color-point);
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-detail-desc {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 18px;
}

.map-detail-events {
  background: var(--color-subtle-bg);
  border: 1.5px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.map-detail-events h4 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin-bottom: 10px;
}

.map-detail-events ul {
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--color-text);
  line-height: 1.6;
  list-style-type: disc;
}

.map-detail-mnemonic {
  background: #FFFBEB;
  border: 1.5px dashed #D97706;
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.map-detail-mnemonic .mnemonic-head {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-detail-mnemonic .mnemonic-body {
  font-size: 14px;
  font-weight: 700;
  color: #78350F;
  line-height: 1.5;
}

/* 하단 거점 칩 목록 */
.map-location-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.map-location-chip {
  padding: 8px 16px;
  background: #FFFFFF;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-primary-dark);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.map-location-chip:hover {
  background: var(--color-subtle-bg);
  border-color: var(--color-point);
  transform: translateY(-2px);
}

.map-location-chip.active {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}

/* ==================== 메인 히어로 큰 CTA 버튼 ==================== */
.hero-cta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 620px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .hero-cta-row {
    grid-template-columns: 1fr;
  }
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  text-align: left;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-cta-ico {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}

.hero-cta-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-cta-text strong {
  font-family: var(--font-display);
  font-size: 17.5px;
  letter-spacing: -0.01em;
}

.hero-cta-text small {
  font-size: 12.5px;
  font-weight: 700;
  opacity: 0.82;
}

/* 1순위: 진한 브라운 채움 버튼 */
.hero-cta-main {
  background: linear-gradient(135deg, #A45309 0%, #78350F 100%);
  color: #FFFFFF;
  border-color: #78350F;
  box-shadow: 0 6px 18px rgba(120, 53, 15, 0.28);
}

.hero-cta-main:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(120, 53, 15, 0.36);
}

/* 2순위: 골드 테두리 버튼 */
.hero-cta-sub {
  background: #FFFDF7;
  color: var(--color-primary-dark);
  border-color: var(--color-point);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.16);
}

.hero-cta-sub:hover {
  background: #FFF7E6;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(217, 119, 6, 0.26);
}

/* ==================== 핵심 기능 카드 4개 ==================== */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

@media (max-width: 900px) {
  .feature-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .feature-strip {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  background: #FFFFFF;
  border: 1.5px solid var(--color-border);
  border-top: 4px solid var(--color-point);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.feature-ico {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 10px;
}

.feature-title {
  font-family: var(--font-display);
  font-size: 16.5px;
  color: var(--color-primary-dark);
  line-height: 1.35;
  margin-bottom: 7px;
}

.feature-desc {
  font-size: 13.5px;
  color: var(--color-text-soft);
  line-height: 1.55;
  margin-bottom: 14px;
  flex-grow: 1;
}

.feature-link {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 800;
  color: var(--color-primary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.feature-card:hover .feature-link {
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-point);
}

/* 카드별 포인트 컬러 (아이보리 톤 유지 + 상단 라인만 구분) */
.feature-korea { border-top-color: #B45309; }
.feature-world { border-top-color: #0E7490; }
.feature-exam  { border-top-color: #991B1B; }
.feature-print { border-top-color: #047857; }

.feature-korea:hover { border-color: #E8C39B; }
.feature-world:hover { border-color: #A9CFD9; }
.feature-exam:hover  { border-color: #E7BDBD; }
.feature-print:hover { border-color: #A7D5C3; }

/* ==================== 오늘의 역사 카드 계열별 배경 ==================== */
.today-item-korea {
  background: #FDF3E7;
  border-color: #E8C39B;
}

.today-item-korea .today-item-type {
  color: #B45309;
}

.today-item-world {
  background: #EDF6F8;
  border-color: #AFD3DD;
}

.today-item-world .today-item-type {
  color: #0E7490;
}

.today-item-quiz {
  background: #FFFAE6;
  border-color: #FBD24E;
}

.today-item-quiz .today-item-type {
  color: #A16207;
}

/* ==================== 핵심 연표 미리보기 ==================== */
.tl-preview {
  background: #FFFFFF;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-soft);
}

.tl-preview-head {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--color-border-subtle);
}

.tl-preview-head h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--color-primary-dark);
  margin-bottom: 6px;
}

.tl-preview-head p {
  font-size: 13.5px;
  color: var(--color-text-soft);
  line-height: 1.55;
}

.tl-preview-list {
  list-style: none;
  position: relative;
  margin: 0 0 18px;
  padding: 2px 0 2px 0;
}

/* 세로 타임라인 축 */
.tl-preview-list::before {
  content: '';
  position: absolute;
  left: 74px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, #FDE68A 0%, #D97706 50%, #FDE68A 100%);
  border-radius: 2px;
}

.tl-preview-item {
  position: relative;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 26px;
  align-items: flex-start;
  padding: 10px 0;
}

/* 축 위의 점 */
.tl-preview-item::before {
  content: '';
  position: absolute;
  left: 69px;
  top: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-point);
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 0 0 2px var(--color-border);
  transition: all 0.2s ease;
}

.tl-preview-item:hover::before {
  background: var(--color-accent);
  transform: scale(1.15);
}

.tl-preview-year {
  font-family: var(--font-history);
  font-size: 14px;
  font-weight: 900;
  color: var(--color-primary-dark);
  text-align: right;
  padding-top: 2px;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.tl-preview-body {
  background: var(--color-subtle-bg);
  border: 1.5px solid var(--color-border-subtle);
  border-left: 4px solid var(--color-point);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  transition: all 0.2s ease;
}

.tl-preview-item:hover .tl-preview-body {
  border-color: var(--color-border);
  border-left-color: var(--color-accent);
  transform: translateX(3px);
}

.tl-preview-title {
  font-family: var(--font-display);
  font-size: 15.5px;
  color: var(--color-text);
  margin-bottom: 3px;
}

.tl-preview-desc {
  font-size: 13px;
  color: var(--color-text-soft);
  line-height: 1.5;
}

.tl-preview-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #FFFFFF;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(146, 64, 14, 0.2);
  transition: all 0.2s ease;
}

.tl-preview-more:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(146, 64, 14, 0.3);
}

@media (max-width: 560px) {
  .tl-preview {
    padding: 20px 16px;
  }

  .tl-preview-list::before {
    left: 5px;
  }

  .tl-preview-item {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 0 8px 24px;
  }

  .tl-preview-item::before {
    left: 0;
    top: 14px;
  }

  .tl-preview-year {
    text-align: left;
    font-size: 13.5px;
    color: var(--color-point);
  }

  .tl-preview-more {
    display: flex;
    width: 100%;
  }
}

/* ==================== 내 학습실 - 통계 카드 ==================== */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .dash-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dash-stat {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  text-align: center;
  background: var(--color-subtle-bg);
}

.dash-stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-soft);
  margin-bottom: 6px;
}

.dash-stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.1;
  color: var(--color-primary-dark);
}

.dash-stat-value span {
  font-size: 13px;
  margin-left: 2px;
  opacity: 0.75;
}

.dash-stat-correct { background: #ECFDF5; border-color: #A7F3D0; }
.dash-stat-correct .dash-stat-label { color: #065F46; }
.dash-stat-correct .dash-stat-value { color: #059669; }

.dash-stat-exam { background: #EFF6FF; border-color: #BFDBFE; }
.dash-stat-exam .dash-stat-label { color: #1E40AF; }
.dash-stat-exam .dash-stat-value { color: #2563EB; }

.dash-stat-wrong { background: #FEF2F2; border-color: #FECACA; }
.dash-stat-wrong .dash-stat-label { color: #991B1B; }
.dash-stat-wrong .dash-stat-value { color: #DC2626; }

/* ==================== 내 학습실 - 오답 노트 ==================== */
.wrong-note-box {
  background: #FFFFFF;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
}

.wrong-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--color-border-subtle);
}

.wrong-note-head h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.wrong-note-retry {
  background: var(--color-accent);
  color: #FFFFFF;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(153, 27, 27, 0.22);
  transition: all 0.2s ease;
}

.wrong-note-retry:hover {
  background: #7F1D1D;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(153, 27, 27, 0.3);
}

#wrong-note-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
}

.wrong-note-item {
  display: block;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border-subtle);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: all 0.2s ease;
}

.wrong-note-item:hover {
  background: #FFFDF7;
  border-color: var(--color-border);
  border-left-color: var(--color-accent);
  transform: translateX(3px);
}

.wrong-note-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.wrong-note-tag {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

.wrong-note-tag.is-exam {
  background: #EFF6FF;
  color: #1E40AF;
}

.wrong-note-tag.is-quiz {
  background: #FEF3C7;
  color: #92400E;
}

.wrong-note-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-accent);
}

.wrong-note-text {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.5;
}

.wrong-note-empty {
  font-size: 13.5px;
  color: var(--color-text-soft);
  line-height: 1.6;
  text-align: center;
  padding: 24px 8px;
}
