/* =====================================================
   1day1eng — 오행(五行) 수채화 디자인 시스템
   PHP 5.6 / Apache 호환 순수 CSS
   ===================================================== */

/* ── 1. CSS 변수 ─────────────────────────────────── */
:root {
  /* 씨앗 水(수) — 하늘/물빛 */
  --seed-main:  #5B9BD5;
  --seed-light: #D6EAF8;
  --seed-wash:  rgba(91, 155, 213, 0.13);
  --seed-text:  #1A4A7A;

  /* 새싹 木(목) — 연두/민트 */
  --sprout-main:  #5EAD6E;
  --sprout-light: #D4EFDF;
  --sprout-wash:  rgba(94, 173, 110, 0.13);
  --sprout-text:  #1A5C2A;

  /* 잎새 火(화) — 살구/코랄 */
  --leaf-main:  #E8845A;
  --leaf-light: #FDEBD0;
  --leaf-wash:  rgba(232, 132, 90, 0.13);
  --leaf-text:  #7A2C0A;

  /* 가지 土(토) — 황토/머스타드 */
  --branch-main:  #C4974A;
  --branch-light: #FAF0D7;
  --branch-wash:  rgba(196, 151, 74, 0.13);
  --branch-text:  #6B4A10;

  /* 나무 金(금) — 라벤더/은빛보라 */
  --tree-main:  #9B7EC8;
  --tree-light: #EDE7F6;
  --tree-wash:  rgba(155, 126, 200, 0.13);
  --tree-text:  #4A2880;

  /* 공통 색상 */
  --bg:          #FAF8F5;
  --surface:     #FFFFFF;
  --border:      rgba(0, 0, 0, 0.08);
  --text:        #2C2C2C;
  --text-muted:  #7A7A7A;
  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 2px 16px rgba(0, 0, 0, 0.07);
  --shadow-hover:0 6px 24px rgba(0, 0, 0, 0.12);
  --transition:  0.22s ease;
}

/* ── 2. 리셋 & 기본 ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 10% 20%, rgba(91,155,213,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 88% 55%, rgba(94,173,110,0.09) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 95%, rgba(232,132,90,0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 10%, rgba(155,126,200,0.07) 0%, transparent 40%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── 3. 레이아웃 ──────────────────────────────────── */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-content {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ── 4. 헤더 ──────────────────────────────────────── */
.site-header {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-logo .logo-icon { font-size: 1.3rem; }
.site-logo .logo-text { color: var(--text); }
.site-logo .logo-sub  { color: var(--text-muted); font-weight: 400; font-size: 0.78rem; }

/* ── 5. 내비게이션 ────────────────────────────────── */
.site-nav { display: flex; gap: 4px; }

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  gap: 2px;
}
.nav-link .nav-icon { font-size: 1.15rem; line-height: 1; }
.nav-link:hover { background: var(--seed-wash); color: var(--seed-text); }
.nav-link.active { background: var(--seed-light); color: var(--seed-main); font-weight: 700; }

/* ── 6. 레벨 탭 ───────────────────────────────────── */
.level-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.level-tabs::-webkit-scrollbar { display: none; }

.level-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition);
  background: var(--surface);
  color: var(--text-muted);
  border-color: var(--border);
}
.level-tab:hover { transform: translateY(-1px); }

.level-tab.active[data-level="seed"]   { background: var(--seed-light);   color: var(--seed-text);   border-color: var(--seed-main);   }
.level-tab.active[data-level="sprout"] { background: var(--sprout-light); color: var(--sprout-text); border-color: var(--sprout-main); }
.level-tab.active[data-level="leaf"]   { background: var(--leaf-light);   color: var(--leaf-text);   border-color: var(--leaf-main);   }
.level-tab.active[data-level="branch"] { background: var(--branch-light); color: var(--branch-text); border-color: var(--branch-main); }
.level-tab.active[data-level="tree"]   { background: var(--tree-light);   color: var(--tree-text);   border-color: var(--tree-main);   }

/* ── 7. 문장 카드 ─────────────────────────────────── */
.sentence-panel { display: none; }
.sentence-panel.active { display: block; }

.sentence-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.sentence-card:hover { box-shadow: var(--shadow-hover); }

/* 장면 이모지 배너 */
.scene-banner {
  padding: 32px 24px 24px;
  text-align: center;
  position: relative;
}
.scene-banner[data-bg="seed"]   { background: var(--seed-wash);   }
.scene-banner[data-bg="sprout"] { background: var(--sprout-wash); }
.scene-banner[data-bg="leaf"]   { background: var(--leaf-wash);   }
.scene-banner[data-bg="branch"] { background: var(--branch-wash); }
.scene-banner[data-bg="tree"]   { background: var(--tree-wash);   }

.scene-img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  display: block;
}
.scene-emoji-big { font-size: 4rem; line-height: 1; margin-bottom: 8px; }
.scene-situation {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 999px;
  display: inline-block;
  margin-top: 4px;
}
.scene-banner[data-bg="seed"]   .scene-situation { background: var(--seed-light);   color: var(--seed-text);   }
.scene-banner[data-bg="sprout"] .scene-situation { background: var(--sprout-light); color: var(--sprout-text); }
.scene-banner[data-bg="leaf"]   .scene-situation { background: var(--leaf-light);   color: var(--leaf-text);   }
.scene-banner[data-bg="branch"] .scene-situation { background: var(--branch-light); color: var(--branch-text); }
.scene-banner[data-bg="tree"]   .scene-situation { background: var(--tree-light);   color: var(--tree-text);   }

/* 문장 본문 */
.card-body { padding: 24px; }

.sentence-en {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 8px;
}
.sentence-ko {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* 팁 */
.sentence-tip {
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  margin-bottom: 20px;
}
.sentence-panel[data-level="seed"]   .sentence-tip { background: var(--seed-wash);   border-color: var(--seed-main);   color: var(--seed-text);   }
.sentence-panel[data-level="sprout"] .sentence-tip { background: var(--sprout-wash); border-color: var(--sprout-main); color: var(--sprout-text); }
.sentence-panel[data-level="leaf"]   .sentence-tip { background: var(--leaf-wash);   border-color: var(--leaf-main);   color: var(--leaf-text);   }
.sentence-panel[data-level="branch"] .sentence-tip { background: var(--branch-wash); border-color: var(--branch-main); color: var(--branch-text); }
.sentence-panel[data-level="tree"]   .sentence-tip { background: var(--tree-wash);   border-color: var(--tree-main);   color: var(--tree-text);   }

/* 단어 칩 */
.word-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

.word-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.word-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.word-chip .chip-en { font-weight: 700; }
.word-chip .chip-ko { color: var(--text-muted); }
.word-chip .chip-add { font-size: 1rem; margin-left: 2px; opacity: 0.5; }
.word-chip.saved .chip-add { opacity: 1; color: #E8845A; }

/* 액션 버튼 영역 */
.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--transition);
  border: 2px solid transparent;
}

.btn-tts {
  background: var(--text);
  color: #FFF;
}
.btn-tts:hover { opacity: 0.85; }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }

/* ── 7-1. 성별 토글 ───────────────────────────────── */
.tts-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.voice-toggle {
  display: flex;
  border-radius: 999px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--bg);
}
.voice-btn {
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  line-height: 1;
}
.voice-btn.active {
  background: var(--text);
  color: #fff;
}
.voice-btn:first-child { border-radius: 999px 0 0 999px; }
.voice-btn:last-child  { border-radius: 0 999px 999px 0; }

.speed-toggle {
  display: flex;
  border-radius: 999px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--bg);
}
.speed-btn {
  padding: 7px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.speed-btn.active {
  background: var(--text);
  color: #fff;
}
.speed-btn:first-child { border-radius: 999px 0 0 999px; }
.speed-btn:last-child  { border-radius: 0 999px 999px 0; }

/* ── 7-2. 학습 섹션 공통 ──────────────────────────── */
.learn-section {
  margin-bottom: 18px;
}

.learn-heading {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* 발음 가이드 박스 */
.pronun-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}
.pronun-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.pronun-row:last-child { border-bottom: none; }
.pronun-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 60px;
  flex-shrink: 0;
}
.pronun-val { color: var(--text); line-height: 1.5; }
.pronun-val.ipa {
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  color: var(--seed-text);
}
.stress-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--seed-light);
  color: var(--seed-text);
  font-size: 0.78rem;
  font-weight: 700;
  margin: 2px 3px 2px 0;
}

/* 단어 카드 */
.word-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

.word-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  width: 100%;
}
.word-card:hover { box-shadow: var(--shadow); border-color: var(--text-muted); }
.word-card.saved { border-color: var(--leaf-main); background: var(--leaf-wash); }

.wc-word  { font-size: 1.1rem; font-weight: 800; min-width: 70px; }
.wc-pronun {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 80px;
}
.wc-ipa    { font-family: 'Courier New', monospace; font-size: 0.75rem; color: var(--seed-text); }
.wc-ko     { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; }
.wc-pos    { font-size: 0.7rem; padding: 2px 7px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap; }
.wc-meaning { flex: 1; font-size: 0.88rem; font-weight: 600; }
.wc-explain { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; margin-top: 2px; display: none; }
.word-card.open .wc-explain { display: block; }
.wc-save   { font-size: 1rem; opacity: 0.3; margin-left: auto; flex-shrink: 0; transition: opacity var(--transition); }
.word-card.saved .wc-save  { opacity: 1; color: var(--leaf-main); }

/* 어순 분해 */
.word-order-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.wo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.wo-en { font-weight: 800; font-size: 0.95rem; }
.wo-ko { font-size: 0.7rem; color: var(--text-muted); }
.wo-arrow { color: var(--text-muted); font-size: 0.8rem; padding: 0 2px; }

/* 변형 표현 */
.variation-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.variation-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  border-left: 3px solid var(--border);
  font-size: 0.85rem;
}
.variation-item.negative { border-color: #E8845A; }
.variation-item.question { border-color: var(--seed-main); }
.variation-label { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); margin-bottom: 3px; }
.variation-en   { font-weight: 700; }
.variation-ko   { color: var(--text-muted); font-size: 0.82rem; }

/* 응용 예문 */
.example-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.example-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1px solid var(--border);
}
.example-en     { font-weight: 700; font-size: 0.92rem; }
.example-ko     { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.example-pronun { font-size: 0.75rem; color: var(--seed-text); margin-top: 3px; font-style: italic; }

/* 정보 박스들 (팁, 실수, 문화 등) */
.info-box {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 10px;
}
.info-box.tip      { background: #FFFDE7; border-left: 3px solid #F9A825; }
.info-box.mistake  { background: #FFF3F3; border-left: 3px solid #E57373; }
.info-box.culture  { background: #E8F5E9; border-left: 3px solid #66BB6A; }
.info-box.memory   { background: #F3E5F5; border-left: 3px solid #AB47BC; }
.info-box.fun      { background: #E3F2FD; border-left: 3px solid #42A5F5; }
.info-box.daily    { background: #FFF8E1; border-left: 3px solid #FFCA28; }
.info-box.grammar  { background: var(--seed-wash); border-left: 3px solid var(--seed-main); }

/* 퀴즈 섹션 */
.quiz-section {
  margin-top: 24px;
  border-top: 2px dashed var(--border);
  padding-top: 20px;
}
.quiz-heading {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.quiz-list { display: flex; flex-direction: column; gap: 12px; }

.quiz-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.quiz-q {
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.5;
}
.quiz-q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  margin-right: 6px;
  flex-shrink: 0;
}
.quiz-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 12px;
}
.quiz-choice {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface);
  cursor: default;
}
.quiz-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 12px;
}
.quiz-word-chip {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 0.85rem;
  font-weight: 700;
}

details.quiz-reveal { border-top: 1px solid var(--border); }
details.quiz-reveal summary {
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
details.quiz-reveal summary::-webkit-details-marker { display: none; }
details.quiz-reveal summary::before {
  content: '▶';
  font-size: 0.65rem;
  transition: transform var(--transition);
}
details.quiz-reveal[open] summary::before { transform: rotate(90deg); }
details.quiz-reveal[open] summary { color: #2E7D32; }

.quiz-answer {
  padding: 10px 14px 12px;
  background: #F1F8E9;
  border-top: 1px solid #C8E6C9;
}
.quiz-answer-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #2E7D32;
  margin-bottom: 4px;
}
.quiz-answer-explain {
  font-size: 0.8rem;
  color: #4CAF50;
  line-height: 1.5;
}

/* ── 8. 날짜 헤더 ─────────────────────────────────── */
.date-header {
  text-align: center;
  margin-bottom: 20px;
}
.date-header .date-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.date-header .date-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

/* ── 9. 아카이브 페이지 ───────────────────────────── */
.archive-list { display: flex; flex-direction: column; gap: 12px; }

.archive-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow var(--transition);
}
.archive-item:hover { box-shadow: var(--shadow); }

.archive-date { font-size: 0.82rem; color: var(--text-muted); min-width: 80px; }
.archive-sentence { flex: 1; font-weight: 600; font-size: 0.95rem; }
.archive-badge {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── 10. 단어장 페이지 ────────────────────────────── */
.wordbook-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.wordbook-empty .empty-icon { font-size: 3rem; margin-bottom: 12px; }

.wordbook-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .wordbook-grid { grid-template-columns: 1fr; } }

.wordbook-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wordbook-word  { font-weight: 700; font-size: 1rem; }
.wordbook-mean  { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.wordbook-remove {
  font-size: 1.1rem;
  opacity: 0.3;
  transition: opacity var(--transition);
  flex-shrink: 0;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
}
.wordbook-remove:hover { opacity: 1; }

/* ── 11. 페이지 헤더 ──────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── 12. 푸터 ─────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 16px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* ── 13. 헤더 인증 버튼 ────────────────────────────── */
.header-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.auth-nickname {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-login, .btn-register, .btn-logout {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  border: none;
}
.btn-login {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-login:hover { border-color: var(--sprout-main); color: var(--sprout-main); }
.btn-register {
  background: var(--sprout-main);
  color: #fff;
}
.btn-register:hover { background: var(--sprout-text); }
.btn-logout {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-family: inherit;
}
.btn-logout:hover { border-color: #e55; color: #e55; }

/* ── 14. 로그인/회원가입 페이지 ─────────────────────── */
.auth-main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px;
  min-height: 60vh;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.auth-logo {
  font-size: 3rem;
  margin-bottom: 8px;
}
.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--text);
}
.auth-form {
  text-align: left;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-group .optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
  transition: border-color var(--transition);
}
.form-group input:focus {
  outline: none;
  border-color: var(--sprout-main);
  background: #fff;
}
.btn-auth-submit {
  width: 100%;
  padding: 13px;
  background: var(--sprout-main);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  transition: var(--transition);
}
.btn-auth-submit:hover:not(:disabled) { background: var(--sprout-text); }
.btn-auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-error {
  background: #fff0f0;
  border: 1px solid #ffccc0;
  color: #c0392b;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  text-align: left;
}
.auth-switch {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.auth-switch a {
  color: var(--sprout-main);
  font-weight: 600;
  text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

/* ── 15. 정책 페이지 ──────────────────────────────── */
.policy-page { padding: 32px 16px; }
.policy-wrap {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 40px;
}
.policy-wrap h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.policy-updated {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 28px;
}
.policy-wrap h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 28px 0 8px;
  color: var(--sprout-text);
}
.policy-wrap p, .policy-wrap li {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text);
}
.policy-wrap ul { padding-left: 20px; }
.policy-wrap a { color: var(--sprout-main); }

/* 동의 체크박스 */
.form-agree { margin-top: 8px; }
.agree-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1.5;
}
.agree-label input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--sprout-main);
}
.agree-label a { color: var(--sprout-main); font-weight: 600; }
.required-mark { color: #e55; font-size: 0.78rem; }

/* 푸터 링크 */
.footer-links {
  margin-top: 6px;
  font-size: 0.75rem;
}

/* ── 16. 마이페이지 ───────────────────────────────── */
.mypage-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.mypage-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.mypage-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
/* 통계 그리드 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px 8px;
  text-align: center;
}
.stat-icon { font-size: 1.5rem; margin-bottom: 6px; }
.stat-num  { font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-date { font-size: 0.8rem !important; }
.stat-label{ font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
/* 폼 */
.mypage-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.form-row input, .form-row select {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition);
}
.form-row input:focus, .form-row select:focus {
  outline: none; border-color: var(--sprout-main); background: #fff;
}
.input-disabled { opacity: 0.55; cursor: not-allowed; }
.btn-mypage-save {
  padding: 10px;
  background: var(--sprout-main);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  align-self: flex-start;
  min-width: 100px;
}
.btn-mypage-save:hover { background: var(--sprout-text); }
/* 탈퇴 */
.mypage-danger { border: 1.5px solid #ffccc0; }
.danger-desc { font-size: 0.83rem; color: var(--text-muted); margin-bottom: 12px; }
.btn-mypage-delete {
  padding: 10px;
  background: #fff;
  color: #c0392b;
  border: 1.5px solid #e74c3c;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  align-self: flex-start;
  min-width: 100px;
}
.btn-mypage-delete:hover { background: #e74c3c; color: #fff; }
/* 메시지 */
.mypage-msg { padding: 9px 12px; border-radius: var(--radius-sm); font-size: 0.83rem; margin-bottom: 8px; }
.mypage-msg-ok  { background: #eafaf1; color: #1e8449; border: 1px solid #a9dfbf; }
.mypage-msg-err { background: #fff0f0; color: #c0392b; border: 1px solid #ffccc0; }
/* 닉네임 링크 */
a.auth-nickname {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.auth-nickname:hover { color: var(--sprout-main); }

/* ── 17. 이야기 페이지 ────────────────────────────── */
.story-title-block { text-align: center; padding: 20px 16px 0; }
.story-title-en { font-size: 1.4rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.story-title-ko { font-size: 0.9rem; color: var(--text-muted); }
.story-badge-wrap { position: absolute; bottom: 10px; left: 12px; }
.story-theme-badge {
  background: rgba(255,255,255,0.88);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.story-body { display: flex; flex-direction: column; gap: 16px; }
.story-sentence { border-left: 3px solid var(--border); padding-left: 12px; }
.story-en { font-size: 1.1rem; font-weight: 600; color: var(--text); line-height: 1.6; margin-bottom: 4px; }
.story-ko { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 2px; }
.story-pronun { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }
.btn-tts-story {
  background: var(--sprout-main); color: #fff; border: none;
  border-radius: 24px; padding: 10px 24px;
  font-size: 0.95rem; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: var(--transition);
}
.btn-tts-story:hover { background: var(--sprout-text); }
.moral-box {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--seed-light); border-radius: var(--radius-sm); padding: 14px 16px;
}
.moral-icon { font-size: 1.2rem; flex-shrink: 0; }
.moral-box p { font-size: 0.9rem; color: var(--seed-text); font-weight: 500; line-height: 1.6; }

/* ── 18. 반응형 ───────────────────────────────────── */
@media (max-width: 600px) {
  .sentence-en { font-size: 1.4rem; }
  .scene-emoji-big { font-size: 3rem; }
  .nav-link { padding: 6px 10px; font-size: 0.72rem; }
  .header-auth { gap: 4px; }
  .auth-nickname { max-width: 50px; }
  .btn-login, .btn-register, .btn-logout { padding: 4px 8px; font-size: 0.72rem; }
  .auth-card { padding: 28px 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .policy-wrap { padding: 24px 16px; }
}
