/* ========================================================
   八字子平研习录 · 核心样式表
   东方玄学美学 · 玻璃拟态 · 五行流光动效
   ======================================================== */

:root {
  --bg-deep: #090a10;
  --bg-surface: rgba(18, 20, 29, 0.75);
  --bg-surface-elevated: rgba(28, 32, 48, 0.85);
  --bg-card: rgba(22, 26, 38, 0.65);
  --bg-card-hover: rgba(32, 38, 56, 0.85);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(212, 175, 55, 0.5);
  --border-focus: rgba(56, 189, 248, 0.5);

  --text-main: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --gold-accent: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.25);

  /* 五行核心色彩 */
  --color-wood: #10b981;
  --glow-wood: rgba(16, 185, 129, 0.35);
  --color-fire: #f43f5e;
  --glow-fire: rgba(244, 63, 94, 0.35);
  --color-earth: #f59e0b;
  --glow-earth: rgba(245, 158, 11, 0.35);
  --color-metal: #cbd5e1;
  --glow-metal: rgba(203, 213, 225, 0.35);
  --color-water: #38bdf8;
  --glow-water: rgba(56, 189, 248, 0.35);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-main);
  line-height: 1.65;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(244, 63, 94, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(56, 189, 248, 0.07) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
}

/* 顶部导航与大标题 */
.header-banner {
  background: rgba(10, 12, 18, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 24px;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #3a2e1d 0%, #15161e 100%);
  border: 1.5px solid var(--gold-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--gold-glow);
}

.brand-logo span {
  font-family: "Noto Serif SC", serif;
  font-size: 22px;
  color: var(--gold-accent);
  font-weight: bold;
}

.brand-title h1 {
  font-size: 1.25rem;
  letter-spacing: 1px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title h1 .badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-accent);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 20px;
}

.brand-title p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* 顶部学习指标栏 */
.header-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  font-size: 0.82rem;
}

.stat-pill .icon {
  font-size: 1rem;
}

.stat-pill .val {
  color: var(--gold-accent);
  font-weight: 600;
}

/* 主容器布局 - 全屏宽阔居中，不再被侧边栏挤压 */
.layout-container {
  max-width: 1200px;
  margin: 20px auto 80px;
  padding: 0 20px;
  display: block;
}

/* 抽屉遮罩层 */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* 侧滑抽屉导航 (Slide Drawer) */
.sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 330px;
  max-width: 86vw;
  height: 100vh;
  background: rgba(14, 16, 26, 0.98);
  backdrop-filter: blur(25px);
  border-right: 1px solid var(--border-subtle);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 10001;
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 15px 0 50px rgba(0, 0, 0, 0.85);
  overflow-y: auto;
}

.sidebar-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}

.drawer-close-btn:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: #f43f5e;
}

/* 抽屉唤起按钮 (顶部导航) */
.drawer-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 30px;
  color: var(--gold-accent);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.drawer-toggle-btn:hover {
  background: rgba(212, 175, 55, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 0 15px var(--gold-glow);
}

.lesson-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lesson-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition);
  cursor: pointer;
  overflow: hidden;
}

.lesson-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.lesson-item.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(16, 185, 129, 0.1));
  border-color: var(--gold-accent);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.lesson-item.locked {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.lesson-btn {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: inherit;
  font-size: 0.88rem;
  cursor: inherit;
}

.lesson-num {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  margin-right: 8px;
}

.lesson-item.active .lesson-num {
  background: var(--gold-accent);
  color: #000;
  font-weight: bold;
}

.lesson-status {
  font-size: 0.8rem;
}

/* 课程信息概览条 */
.lesson-hero {
  background: linear-gradient(135deg, rgba(30, 36, 56, 0.7), rgba(18, 20, 28, 0.85));
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.lesson-hero::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--gold-glow), transparent 70%);
  pointer-events: none;
}

.lesson-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-accent);
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.lesson-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.lesson-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 850px;
  line-height: 1.6;
}

/* 课程主标签切换器 */
.study-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.tab-btn.active {
  background: var(--gold-accent);
  color: #0d0f17;
  font-weight: 600;
  border-color: var(--gold-accent);
  box-shadow: 0 0 15px var(--gold-glow);
}

/* 面板内容区块 */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.35s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 五行全景卡片总揽 */
.five-elements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.element-pill-card {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.element-pill-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.element-pill-card.wood { border-left: 4px solid var(--color-wood); }
.element-pill-card.fire { border-left: 4px solid var(--color-fire); }
.element-pill-card.earth { border-left: 4px solid var(--color-earth); }
.element-pill-card.metal { border-left: 4px solid var(--color-metal); }
.element-pill-card.water { border-left: 4px solid var(--color-water); }

.element-pill-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.element-pill-title h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.element-pill-card.wood h3 { color: var(--color-wood); }
.element-pill-card.fire h3 { color: var(--color-fire); }
.element-pill-card.earth h3 { color: var(--color-earth); }
.element-pill-card.metal h3 { color: var(--color-metal); }
.element-pill-card.water h3 { color: var(--color-water); }

.element-pill-content {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 核心知识深度讲解卡片 */
.info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.info-card h3 {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-card h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--gold-accent);
  border-radius: 2px;
}

/* 十天干矩阵卡片 */
.stems-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.filter-btn.active[data-element="all"] {
  border-color: var(--gold-accent);
  color: var(--gold-accent);
}
.filter-btn.active[data-element="wood"] {
  border-color: var(--color-wood);
  color: var(--color-wood);
  box-shadow: 0 0 10px var(--glow-wood);
}
.filter-btn.active[data-element="fire"] {
  border-color: var(--color-fire);
  color: var(--color-fire);
  box-shadow: 0 0 10px var(--glow-fire);
}
.filter-btn.active[data-element="earth"] {
  border-color: var(--color-earth);
  color: var(--color-earth);
  box-shadow: 0 0 10px var(--glow-earth);
}
.filter-btn.active[data-element="metal"] {
  border-color: var(--color-metal);
  color: var(--color-metal);
  box-shadow: 0 0 10px var(--glow-metal);
}
.filter-btn.active[data-element="water"] {
  border-color: var(--color-water);
  color: var(--color-water);
  box-shadow: 0 0 10px var(--glow-water);
}

.stems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stem-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.stem-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

.stem-card.wood { border-top: 3px solid var(--color-wood); }
.stem-card.fire { border-top: 3px solid var(--color-fire); }
.stem-card.earth { border-top: 3px solid var(--color-earth); }
.stem-card.metal { border-top: 3px solid var(--color-metal); }
.stem-card.water { border-top: 3px solid var(--color-water); }

.stem-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.stem-img-wrap {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.stem-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.stem-card:hover .stem-img-wrap img {
  transform: scale(1.1);
}

.stem-name-box h4 {
  font-size: 1.3rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stem-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: normal;
}

.stem-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.stem-body {
  font-size: 0.85rem;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.stem-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.mini-tag {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.stem-mnemonic {
  background: rgba(0, 0, 0, 0.25);
  border-left: 2px solid var(--gold-accent);
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
  font-size: 0.8rem;
  color: #fef08a;
  margin-top: 6px;
  font-style: italic;
}

.stem-footer-btn {
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--gold-accent);
  font-size: 0.8rem;
  text-align: center;
  transition: var(--transition);
}

.stem-card:hover .stem-footer-btn {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.4);
}

/* 详情弹窗 Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 780px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--color-fire);
}

.modal-detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  margin-top: 20px;
}

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

.modal-stem-avatar {
  width: 130px;
  height: 130px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.4);
}

.modal-stem-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-section-title {
  font-size: 0.95rem;
  color: var(--gold-accent);
  font-weight: 600;
  margin: 16px 0 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 4px;
}

/* 关系交互研习台 (Section C) */
.combinations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.combo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  transition: var(--transition);
}

.combo-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.combo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.combo-formula {
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.combo-element-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.combo-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.combo-rule {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #cbd5e1;
}

/* 闪卡记忆 Flashcards (Section D) */
.flashcards-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 640px;
  margin: 0 auto;
}

.flashcard {
  width: 100%;
  min-height: 300px;
  perspective: 1000px;
  cursor: pointer;
  margin-bottom: 20px;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 300px;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-lg);
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.flashcard-front {
  background: linear-gradient(145deg, rgba(26, 30, 44, 0.9), rgba(16, 18, 26, 0.95));
}

.flashcard-back {
  background: linear-gradient(145deg, rgba(32, 28, 44, 0.95), rgba(18, 16, 28, 0.95));
  transform: rotateY(180deg);
  border-color: rgba(212, 175, 55, 0.3);
}

.card-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 16px;
}

.flashcard-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
}

.fc-btn {
  padding: 10px 22px;
  border-radius: 30px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.fc-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.fc-btn.mastered {
  border-color: var(--color-wood);
  color: var(--color-wood);
}
.fc-btn.mastered:hover {
  background: rgba(16, 185, 129, 0.15);
}

/* 测试闯关题库 (Section E) */
.quiz-dashboard {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.quiz-score-circle {
  display: flex;
  align-items: center;
  gap: 16px;
}

.score-display {
  font-size: 2.2rem;
  font-weight: bold;
  color: var(--gold-accent);
}

.quiz-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}

.quiz-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-accent), var(--color-wood));
  transition: width 0.3s ease;
}

.question-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  transition: var(--transition);
}

.question-box.correct {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.question-box.incorrect {
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.1);
}

.q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.q-badge {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-accent);
}

.q-text {
  font-size: 1.08rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 18px;
  line-height: 1.6;
}

.q-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-btn:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.option-btn.selected {
  border-color: var(--border-focus);
  background: rgba(56, 189, 248, 0.1);
}

.option-btn.correct {
  border-color: var(--color-wood) !important;
  background: rgba(16, 185, 129, 0.18) !important;
  color: #a7f3d0 !important;
  font-weight: 600;
}

.option-btn.wrong {
  border-color: var(--color-fire) !important;
  background: rgba(244, 63, 94, 0.18) !important;
  color: #fecdd3 !important;
}

.option-key {
  display: inline-block;
  width: 26px;
  height: 26px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.q-explanation {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid var(--gold-accent);
  font-size: 0.86rem;
  color: #cbd5e1;
  line-height: 1.6;
  display: none;
}

.q-explanation.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

.q-explanation-source {
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* 底部操作区与通关证书 */
.quiz-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 30px 0;
}

.btn-primary {
  padding: 12px 28px;
  border-radius: 30px;
  background: linear-gradient(135deg, #d4af37, #f59e0b);
  border: none;
  color: #0d0f17;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--gold-glow);
  transition: var(--transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
  padding: 12px 24px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* 通关成功横幅 */
.congrats-banner {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(16, 185, 129, 0.2));
  border: 1.5px solid var(--gold-accent);
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  margin: 20px 0;
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.congrats-banner.show {
  display: block;
}

.congrats-title {
  font-size: 1.6rem;
  color: var(--gold-accent);
  font-weight: bold;
  margin-bottom: 8px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .layout-container {
    padding: 0 16px;
    margin-top: 16px;
  }
  .lesson-hero {
    padding: 20px;
  }
  .lesson-title {
    font-size: 1.4rem;
  }
  .modal-card {
    padding: 20px;
  }
}

/* ========================================================
   多巴胺上瘾级奖励系统 & 特效组件样式
   ======================================================== */

/* 全屏画布层 */
#particleCanvas, #confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}
#particleCanvas {
  z-index: -1;
  opacity: 0.65;
}

/* 顶部多巴胺蓄力槽 */
.dopamine-meter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  padding: 4px 14px;
}

.dopamine-icon {
  font-size: 1.1rem;
  animation: pulseFire 1.8s infinite;
}

@keyframes pulseFire {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px #f59e0b); }
  50% { transform: scale(1.2); filter: drop-shadow(0 0 8px #ef4444); }
}

.dopamine-progress-outer {
  width: 90px;
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.dopamine-progress-fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, #f59e0b, #ef4444, #ec4899);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.dopamine-val-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: #facc15;
}

/* 浮动多巴胺 +15 动画徽章 */
.dopamine-pop-badge {
  position: fixed;
  transform: translate(-50%, -50%);
  font-size: 1.15rem;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 20px currentColor;
  pointer-events: none;
  z-index: 10000;
  animation: floatUpFade 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes floatUpFade {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.6); }
  25% { opacity: 1; transform: translate(-50%, -70%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -150%) scale(0.9); }
}

/* 沉浸刷卡模式 (短视频/Reel 体验) */
.shorts-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 580px;
  margin: 0 auto;
}

.shorts-card {
  width: 100%;
  background: linear-gradient(160deg, rgba(25, 30, 48, 0.95), rgba(14, 16, 26, 0.98));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.shorts-card.active {
  border-color: rgba(212, 175, 55, 0.4);
}

.shorts-hero-img {
  width: 100%;
  height: 240px;
  border-radius: var(--radius-md);
  object-fit: cover;
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle);
  background: #000;
}

.shorts-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.like-btn:hover {
  transform: scale(1.08);
  background: rgba(244, 63, 94, 0.25);
}

.like-btn.liked {
  background: #f43f5e;
  color: #fff;
  border-color: #f43f5e;
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.5);
}

/* 现实映照与费曼大声说小卡 */
.life-anchor-box {
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid #38bdf8;
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 0.88rem;
}

.life-anchor-input {
  width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: #fff;
  font-size: 0.85rem;
}

.life-anchor-input:focus {
  outline: none;
  border-color: #38bdf8;
}

.feynman-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 78, 59, 0.2));
  border: 1px dashed var(--color-wood);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 14px;
  text-align: center;
}

.feynman-btn {
  padding: 8px 20px;
  border-radius: 20px;
  background: var(--color-wood);
  border: none;
  color: #052e16;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  margin-top: 8px;
  transition: var(--transition);
}

.feynman-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 15px var(--glow-wood);
}

/* 15分钟大脑重启·多巴胺排毒静修室 */
.zen-chamber {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 30px;
  background: radial-gradient(circle at center, rgba(30, 24, 48, 0.8), rgba(9, 10, 16, 0.95));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.breathing-circle-outer {
  width: 200px;
  height: 200px;
  margin: 30px auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breathing-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.25) 0%, rgba(59, 130, 246, 0.05) 70%);
  border: 2px solid rgba(147, 197, 253, 0.5);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: breathCycle 12s infinite ease-in-out;
}

@keyframes breathCycle {
  0%, 100% { transform: scale(0.9); border-color: rgba(147, 197, 253, 0.3); } /* 呼气到底 */
  33% { transform: scale(1.35); border-color: rgba(56, 189, 248, 0.8); box-shadow: 0 0 40px rgba(56, 189, 248, 0.5); } /* 吸气完成 */
  66% { transform: scale(1.35); border-color: rgba(16, 185, 129, 0.8); } /* 屏息驻留 */
}

.zen-timer-digits {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: monospace;
  color: #e0f2fe;
}

.zen-stage-hint {
  font-size: 0.82rem;
  color: #93c5fd;
  margin-top: 4px;
}

/* 番茄 25分钟专注挑战 */
.pomodoro-box {
  text-align: center;
  max-width: 540px;
  margin: 0 auto;
  padding: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.pomo-ring-container {
  width: 180px;
  height: 180px;
  margin: 20px auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pomo-time-text {
  font-size: 2.5rem;
  font-weight: bold;
  font-family: monospace;
  color: var(--gold-accent);
}

/* 连击 Combo 条 */
.combo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  padding: 4px 12px;
  border-radius: 20px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: bold;
  animation: bounce 0.4s ease;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ========================================================
   第二课：十二地支与支藏人元专属样式
   ======================================================== */

.branch-clans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0 24px;
}

.branch-clan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  position: relative;
  transition: var(--transition);
}

.branch-clan-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.branch-clan-card.cardinals { border-top: 3px solid #f43f5e; }
.branch-clan-card.beginnings { border-top: 3px solid #10b981; }
.branch-clan-card.graveyards { border-top: 3px solid #f59e0b; }

.hidden-stems-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 10px;
}

.hidden-stem-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.76rem;
  margin: 2px 4px 2px 0;
}

.hidden-stem-tag.main {
  background: rgba(212, 175, 55, 0.2);
  color: #fde047;
  border: 1px solid rgba(212, 175, 55, 0.4);
  font-weight: 600;
}

.hidden-stem-tag.mid {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.hidden-stem-tag.sub {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.rhyme-table-container {
  overflow-x: auto;
  margin-top: 16px;
}

.rhyme-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.rhyme-table th, .rhyme-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.rhyme-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--gold-accent);
  font-weight: 600;
}

.rhyme-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ========================================================
   十神六亲肌肉记忆训练营专属样式
   ======================================================== */

.drill-box {
  background: radial-gradient(circle at top, rgba(30, 36, 60, 0.95), rgba(14, 16, 26, 0.98));
  border: 1.5px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 680px;
  margin: 0 auto 30px;
  position: relative;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.drill-timer-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin: 14px 0 20px;
}

.drill-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #38bdf8, #10b981, #f59e0b);
  transition: width 0.1s linear;
}

.drill-question-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-bottom: 22px;
  line-height: 1.6;
}

.drill-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 500px) {
  .drill-options-grid {
    grid-template-columns: 1fr;
  }
}

.sandbox-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

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

.sandbox-select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #fff;
  font-size: 0.92rem;
  outline: none;
}

/* ========================================================
   移动端深度优化与触控体验 (Outdoor Mobile Optimization)
   ======================================================== */
@media (max-width: 768px) {
  .header-banner {
    padding: 10px 14px;
  }
  .header-container {
    gap: 10px;
  }
  .brand-section {
    width: 100%;
    justify-content: flex-start;
  }
  .brand-title p {
    display: none; /* 移动端隐藏过长副标题，节约竖向空间 */
  }
  .brand-title h1 {
    font-size: 1.25rem;
  }
  .header-stats {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .stat-pill {
    padding: 5px 9px;
    font-size: 0.78rem;
    flex-shrink: 0;
  }
  .dopamine-meter-bar {
    padding: 4px 10px;
    flex-shrink: 0;
  }
  .layout-container {
    padding: 0 12px;
    margin: 12px auto 60px;
  }
  .lesson-hero {
    padding: 18px 16px;
    margin-bottom: 16px;
  }
  .lesson-title {
    font-size: 1.35rem;
  }
  .lesson-desc {
    font-size: 0.86rem;
  }
  .study-tabs {
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 18px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .study-tabs::-webkit-scrollbar {
    display: none;
  }
  .tab-btn {
    padding: 8px 14px;
    font-size: 0.82rem;
  }
  .shorts-card {
    padding: 18px 16px;
  }
  .shorts-hero-img {
    height: 180px;
  }
  .combinations-grid {
    grid-template-columns: 1fr;
  }
  .stems-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }
  .stem-card {
    padding: 14px 12px;
  }
  .stem-header {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  .stem-img-wrap {
    margin: 0 auto;
  }
  .stem-name-box h4 {
    font-size: 1.15rem;
  }
  .option-btn {
    padding: 12px 14px;
    font-size: 0.88rem;
    min-height: 48px; /* 舒适指尖触控热区 */
  }
  .drill-box {
    padding: 18px 14px;
  }
  .drill-question-title {
    font-size: 1.15rem;
  }
}

