/*
 * 敢学-词根词缀 - 极简主义设计
 * 原则：Less is More
 * 设计师：偏执的完美主义者
 */

/* ===== 重置与基础 ===== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 颜色系统（极简） */
  --color-text: #0F172A;
  --color-text-secondary: #64748B;
  --color-text-tertiary: #94A3B8;
  --color-accent: #FBBF24;
  --color-accent-dark: #F59E0B;
  --color-border: #E2E8F0;
  --color-bg: #FFFFFF;
  --color-bg-secondary: #F8FAFC;
  --color-bg-hover: #F8FAFC;

  /* 间距系统（8px网格） */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* 字体系统 */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* 阴影系统（极浅） */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
  --shadow-md: 0 2px 8px 0 rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 16px 0 rgba(0, 0, 0, 0.06);

  /* 圆角（统一） */
  --radius: 8px;
  --radius-lg: 12px;

  /* 过渡 */
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

/* ===== 排版系统 ===== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
  font-weight: 600;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

p {
  margin-bottom: var(--space-md);
}

/* ===== 布局容器 ===== */

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ===== 按钮系统 ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 48px;
  white-space: nowrap;
}

.btn:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  color: var(--color-text);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: var(--color-text);
}

.btn-large {
  padding: 18px 48px;
  font-size: 1.125rem;
  font-weight: 600;
  min-height: 56px;
}

.btn-text {
  background: transparent;
  border: none;
  padding: 8px 16px;
  color: var(--color-text-secondary);
}

.btn-text:hover {
  background: transparent;
  color: var(--color-text);
  border: none;
  transform: none;
  box-shadow: none;
}

.tts-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.tts-sentence-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.tts-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
}

.tts-button:hover:not(:disabled) {
  background: var(--color-bg);
  border-color: var(--color-text);
  color: var(--color-text);
}

.tts-button.is-playing {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text);
}

.tts-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tts-settings-panel {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-top: var(--space-lg);
  overflow: hidden;
}

.tts-settings-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg);
  cursor: pointer;
}

.tts-settings-summary::-webkit-details-marker {
  display: none;
}

.tts-settings-summary::after {
  content: '展开';
  flex: 0 0 auto;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.tts-settings-panel[open] .tts-settings-summary::after {
  content: '收起';
}

.tts-settings-summary-text {
  display: none;
}

.tts-settings-content {
  padding: 0 var(--space-lg) var(--space-lg);
}

.tts-settings-header {
  margin-bottom: var(--space-md);
}

.tts-settings-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.tts-settings-description {
  margin-top: var(--space-xs);
  margin-bottom: 0;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}

.tts-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
}

.tts-setting-field {
  display: grid;
  gap: var(--space-sm);
}

.tts-setting-field-wide {
  grid-column: 1 / -1;
}

.tts-setting-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.tts-setting-control {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
}

.tts-rate-control {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.tts-rate-slider {
  flex: 1 1 auto;
  accent-color: var(--color-accent-dark);
}

.tts-rate-value {
  min-width: 52px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text);
}

.tts-settings-status {
  margin-top: var(--space-md);
  margin-bottom: 0;
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  line-height: 1.6;
}

.is-hidden {
  display: none !important;
}

/* ===== Vocabulary Catalog ===== */

.catalog-page-main {
  padding-top: 80px;
}

.intro-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 24px;
}

.page-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.page-subtitle,
.catalog-summary {
  max-width: 820px;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.quick-action {
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 200ms ease;
}

.quick-action:hover {
  background: white;
  color: var(--color-text);
}

.quick-action.active {
  background: white;
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-bar {
  position: sticky;
  top: 60px;
  z-index: 10;
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
  margin-bottom: 24px;
}

.filter-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  gap: 16px;
}

.filter-primary-row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.search-box {
  flex: 0 1 320px;
  width: 320px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.9375rem;
  transition: all 200ms ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
  width: 20px;
  height: 20px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  background: var(--color-bg-secondary);
  padding: 4px;
  border-radius: 8px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 200ms ease;
}

.filter-tab:hover {
  background: white;
  color: var(--color-text);
}

.filter-tab.active {
  background: white;
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.source-filter-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.source-filter-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  padding-top: 10px;
  white-space: nowrap;
}

.source-tabs {
  flex: 1 1 720px;
}

.stats-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-left: auto;
}

.stat-chip {
  background: var(--color-bg-secondary);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

.stat-chip strong {
  color: var(--color-text);
  font-weight: 600;
}

.pagination-bar {
  max-width: 1200px;
  margin: 0 auto 24px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.pagination-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-button {
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  background: white;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all 200ms ease;
}

.pagination-button:hover:not(:disabled) {
  border-color: var(--color-accent);
  background: var(--color-bg-secondary);
}

.pagination-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.words-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 96px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.word-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
  transition: all 200ms ease;
}

.word-card:hover,
.word-card[open] {
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.word-card summary {
  list-style: none;
  cursor: pointer;
}

.word-card summary::-webkit-details-marker {
  display: none;
}

.word-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.word-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: 'Courier New', monospace;
}

.word-root {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.word-levels,
.root-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.word-chip,
.root-link {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  text-decoration: none;
  border: none;
}

.root-link:hover {
  color: var(--color-text);
  background: #fff7dd;
}

.word-meaning {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
  line-height: 1.7;
}

.word-meta {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.word-meta p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.word-expand {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  white-space: nowrap;
}

.sentence-pair {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px;
}

.sentence-pair p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.7;
}

.sentence-pair p + p {
  margin-top: 6px;
  color: var(--color-text-secondary);
}

.empty-state {
  max-width: 600px;
  margin: 96px auto;
  text-align: center;
  color: var(--color-text-secondary);
  padding: 0 24px;
}

.empty-state h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .filter-primary-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    width: 100%;
    flex-basis: auto;
  }

  .stats-bar {
    margin-left: 0;
    justify-content: flex-start;
  }

  .source-filter-label {
    padding-top: 0;
  }

  .words-grid {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 2.25rem;
  }
}

/* ===== Root Index ===== */

.roots-page-main {
  padding-top: 80px;
}

.roots-filter-bar {
  margin-bottom: 32px;
}

.roots-filter-container {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.roots-search-box {
  flex: 0 0 auto;
  width: 280px;
}

.roots-filter-tabs {
  flex-wrap: nowrap;
}

.roots-stats-bar {
  white-space: nowrap;
}

.roots-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 96px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.root-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 200ms ease;
}

.root-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.root-card-link {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
}

.root-mastered-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--color-accent);
  color: var(--color-text);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.root-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.root-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: 'Courier New', monospace;
}

.root-origin {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  padding: 4px 8px;
  border-radius: 4px;
}

.root-meaning {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.root-meaning-en {
  font-size: 0.8125rem;
  color: var(--color-text-tertiary);
  margin-top: 4px;
}

.root-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.example-tag {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
}

.root-id {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  margin-top: 8px;
  text-align: right;
}

.root-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.root-stat-chip {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  padding: 4px 10px;
  border-radius: 999px;
}

@media (max-width: 768px) {
  .roots-filter-container {
    flex-direction: column;
    align-items: stretch;
  }

  .roots-search-box {
    order: 1;
    width: 100%;
  }

  .roots-filter-tabs {
    order: 2;
    flex-wrap: wrap;
  }

  .roots-stats-bar {
    order: 3;
    text-align: center;
  }

  .roots-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Flashcard ===== */

.flashcard-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 120px 24px 96px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 24px;
}

.flashcard-container > .tts-settings-panel {
  width: 100%;
}

.flashcard {
  width: 100%;
  height: 720px;
  perspective: 1000px;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  cursor: pointer;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px;
  background: white;
  border: 2px solid var(--color-border);
  overflow: hidden;
  pointer-events: none;
}

.flashcard-front {
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  border: none;
  justify-content: center;
  pointer-events: auto;
  visibility: visible;
  z-index: 2;
}

.flashcard-back {
  transform: rotateY(180deg);
  align-items: stretch;
  justify-content: flex-start;
  overflow-y: auto;
  padding-top: 40px;
  text-align: left;
  visibility: hidden;
  z-index: 1;
}

.flashcard.flipped .flashcard-front {
  pointer-events: none;
  visibility: hidden;
  z-index: 1;
}

.flashcard.flipped .flashcard-back {
  pointer-events: auto;
  visibility: visible;
  z-index: 2;
}

.flashcard-root {
  font-size: 5rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: var(--color-text);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.flashcard-root-back {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.flashcard-front .flashcard-root {
  color: white;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.flashcard-meaning {
  font-size: 2rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 16px;
}

.flashcard-origin {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 8px;
}

.flashcard-description {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  max-height: none;
  overflow-y: visible;
  text-align: left;
}

.flashcard-description-en {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-tertiary);
}

.flashcard-examples {
  width: 100%;
  max-height: none;
  overflow-y: visible;
  margin-top: 16px;
}

.flashcard-example {
  font-size: 0.875rem;
  color: var(--color-text);
  margin-bottom: 8px;
  padding: 10px;
  background: var(--color-bg-secondary);
  border-radius: 8px;
  text-align: left;
}

.flashcard-example strong {
  color: var(--color-accent);
  font-family: 'Courier New', monospace;
}

.flashcard-levels {
  margin-bottom: 6px;
}

.flashcard-level-badge {
  display: inline-block;
  margin-right: 6px;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.75rem;
}

.flashcard-word-row {
  margin-bottom: 6px;
}

.flashcard-meaning-en {
  margin-top: 6px;
  color: var(--color-text-secondary);
}

.flashcard-sentence {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}

.flashcard-sentence-text {
  color: var(--color-text);
  line-height: 1.6;
}

.flashcard-sentence-zh {
  margin-top: 4px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.flashcard-more-actions {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.flashcard-more-btn {
  padding: 10px 18px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: white;
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
}

.flashcard-more-btn:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-hover);
}

.flashcard-review-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.flashcard-review-btn {
  padding: 10px 20px;
  background: white;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: all 200ms ease;
  font-size: 0.9375rem;
}

.flashcard-review-btn-primary {
  background: var(--color-accent);
  border: none;
}

.flashcard-controls {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.flashcard-btn {
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 1.125rem;
  font-weight: 600;
  border: 2px solid var(--color-border);
  background: white;
  color: var(--color-text);
  cursor: pointer;
  transition: all 200ms ease;
}

.flashcard-btn:hover,
.flashcard-review-btn:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-hover);
}

.flashcard-btn.primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text);
}

.flashcard-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.flashcard-progress {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  font-weight: 600;
}

.flashcard-hint {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-align: center;
}

.flashcard-hint kbd {
  display: inline-block;
  padding: 4px 8px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: monospace;
  margin: 0 4px;
}

@media (max-width: 768px) {
  .flashcard-container {
    padding: 104px 16px 72px;
  }

  .flashcard {
    height: 640px;
  }

  .flashcard-root {
    font-size: 3.5rem;
  }

  .flashcard-meaning {
    font-size: 1.5rem;
  }

  .flashcard-controls {
    flex-direction: column;
    gap: 12px;
  }

  .flashcard-btn {
    width: 100%;
  }

  .flashcard-front, .flashcard-back {
    padding: 24px;
  }

  .flashcard-back {
    padding-top: 28px;
  }
}

/* ===== 卡片系统 ===== */

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--color-text);
}

.card-simple {
  border: none;
  padding: var(--space-lg);
}

/* ===== 导航栏 ===== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.nav-logo {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-toggle-lines,
.nav-toggle-lines::before,
.nav-toggle-lines::after {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle-lines {
  position: relative;
}

.nav-toggle-lines::before,
.nav-toggle-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-lines::before {
  top: -6px;
}

.nav-toggle-lines::after {
  top: 6px;
}

.nav.is-open .nav-toggle-lines {
  transform: rotate(45deg);
}

.nav.is-open .nav-toggle-lines::before {
  transform: translateY(6px) rotate(90deg);
}

.nav.is-open .nav-toggle-lines::after {
  opacity: 0;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.nav-link:hover {
  color: var(--color-text);
}

/* ===== Hero Section ===== */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-4xl) var(--space-lg);
}

.hero-title {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-lg);
  max-width: 800px;
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3xl);
  max-width: 600px;
}

/* ===== 词根拆解演示 ===== */

.demo {
  background: var(--color-bg-hover);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  margin: var(--space-3xl) 0;
  max-width: 600px;
}

.demo-word {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.demo-breakdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.demo-part {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
}

.demo-part.prefix {
  background: rgba(239, 68, 68, 0.1);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.demo-part.root {
  background: rgba(59, 130, 246, 0.1);
  color: #3B82F6;
  border: 2px solid rgba(59, 130, 246, 0.3);
}

.demo-part.suffix {
  background: rgba(245, 158, 11, 0.1);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.demo-meaning {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.demo-arrow {
  color: var(--color-text-secondary);
  font-weight: 400;
}

/* ===== 进度指示器 ===== */

.progress {
  margin: var(--space-2xl) 0;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: var(--space-sm);
  text-align: right;
}

/* ===== 选项按钮（测试题） ===== */

.option {
  width: 100%;
  text-align: left;
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
}

.option:hover:not(:disabled) {
  border-color: var(--color-text);
  background: var(--color-bg-hover);
}

.option:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.option.correct {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text);
}

.option.wrong {
  background: #FEE2E2;
  border-color: #EF4444;
  color: #DC2626;
}

/* ===== 反馈消息 ===== */

.feedback {
  padding: var(--space-lg);
  border-radius: var(--radius);
  margin: var(--space-lg) 0;
  font-weight: 500;
}

.feedback.success {
  background: rgba(251, 191, 36, 0.1);
  color: var(--color-text);
  border: 1px solid var(--color-accent);
}

.feedback.error {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #EF4444;
}

/* ===== 统计卡片 ===== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-3xl) 0;
}

.stat-card {
  text-align: center;
  padding: var(--space-2xl);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.stat-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.stat-label {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

/* ===== Footer ===== */

.footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

.footer-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--color-text);
}

/* ===== 工具类 ===== */

.text-center {
  text-align: center;
}

.text-secondary {
  color: var(--color-text-secondary);
}

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

/* ===== 响应式 ===== */

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.125rem;
  }

  .demo-word {
    font-size: 1.75rem;
  }

  .nav-container {
    padding: 10px var(--space-md);
  }

  .nav-logo {
    max-width: calc(100% - 56px);
    font-size: 0.9375rem;
    line-height: 1.3;
  }

  .nav-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    left: var(--space-md);
    right: var(--space-md);
    display: grid;
    gap: 4px;
    padding: 8px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity var(--transition), transform var(--transition);
  }

  .nav.is-open .nav-links {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-link {
    display: block;
    min-height: 44px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--color-text);
  }

  .nav-link:hover,
  .nav-link.active {
    background: #F8FAFC;
  }

  .stat-value {
    font-size: 2rem;
  }
}

/* ===== 无障碍 ===== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 焦点样式 ===== */

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ===== 选择样式 ===== */

::selection {
  background: var(--color-accent);
  color: var(--color-text);
}
