/**
 * Up2U.fun - 寓教于乐AI
 * 主样式文件 - 轻松活泼的设计风格
 */

/* ===== CSS Reset & Base ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* 品牌色 - 活力有趣 */
  --primary: #FF6B35;
  --primary-light: #FF8A5C;
  --primary-dark: #E85D2A;

  /* 辅助色 - 温暖柔和 */
  --secondary: #4ECDC4;
  --accent: #FFE66D;
  --success: #95E1D3;
  --warning: #FFA07A;
  --danger: #FF6B6B;

  /* 中性色 */
  --bg: #FAFAFA;
  --bg-light: #F5F5F5;
  --text: #2C3E50;
  --text-light: #7F8C8D;
  --text-lighter: #BDC3C7;

  /* 渐变 */
  --gradient-primary: linear-gradient(135deg, #FF6B35 0%, #FF8A5C 100%);
  --gradient-secondary: linear-gradient(135deg, #4ECDC4 0%, #95E1D3 100%);
  --gradient-accent: linear-gradient(135deg, #FFE66D 0%, #FFD93D 100%);

  /* 阴影 */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-xl: 0 12px 32px rgba(0,0,0,0.15);

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50%;

  /* 间距 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* 容器 */
  --container-max-width: 1200px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial,
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 移动端优化：增大基础字号 */
  font-size: 18px;
  /* 确保触摸目标最小尺寸 */
  -webkit-tap-highlight-color: transparent;
}

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  /* 移动端减少内边距 */
  width: 100%;
}

/* ===== Header ===== */
.header {
  background: white;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header.simple {
  box-shadow: var(--shadow-sm);
}

.header .header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.logo-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(255, 107, 53, 0.3));
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--gradient-secondary);
  color: white;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.nav {
  display: flex;
  gap: var(--spacing-md);
}

.nav-link {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.nav-link:hover {
  background: var(--bg-light);
  color: var(--primary);
}

.user-status {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.user-status:hover {
  background: var(--primary-light);
  color: white;
}

/* ===== Hero Section ===== */
.hero {
  padding: var(--spacing-2xl) 0;
  background: linear-gradient(180deg, #FFF5F0 0%, #FAFAFA 100%);
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-2xl);
  align-items: center;
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 20px;
  color: var(--text-light);
  margin-bottom: var(--spacing-xl);
}

.highlight {
  color: var(--primary);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.hero-stat {
  display: flex;
  gap: var(--spacing-xl);
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 14px;
  color: var(--text-light);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-xl);
  border: none;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-large {
  padding: var(--spacing-lg) var(--spacing-2xl);
  font-size: 18px;
}

/* ===== Hero Image / Floating Card ===== */
.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.floating-card {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.card-content {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-xl);
  min-width: 300px;
}

.poem-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.poem-author {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: var(--spacing-md);
}

.poem-content {
  margin-bottom: var(--spacing-md);
}

.poem-line {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--spacing-sm);
}

.pinyin {
  font-size: 12px;
  color: var(--text-light);
}

.chinese {
  font-size: 18px;
  font-weight: 500;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

/* ===== Features Section ===== */
.features {
  padding: var(--spacing-2xl) 0;
  background: white;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--spacing-xl);
  color: var(--text);
}

.section-title i {
  margin-right: var(--spacing-sm);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
}

.feature-card {
  background: var(--bg);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  text-align: center;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-md);
}

.feature-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.feature-desc {
  color: var(--text-light);
  font-size: 14px;
}

/* ===== Examples Section ===== */
.examples {
  padding: var(--spacing-2xl) 0;
  background: var(--bg-light);
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.example-card {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s;
}

.example-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.example-preview {
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, #FFF5F0 0%, #FFE4D6 100%);
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-poem {
  text-align: center;
}

.preview-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.preview-content {
  font-size: 14px;
  color: var(--text-light);
}

.example-info {
  padding: var(--spacing-md);
}

.example-info h4 {
  font-size: 16px;
  margin-bottom: var(--spacing-xs);
}

.example-info p {
  font-size: 13px;
  color: var(--text-light);
}

/* ===== CTA Section ===== */
.cta {
  padding: var(--spacing-2xl) 0;
  background: var(--gradient-primary);
  color: white;
}

.cta-content {
  text-align: center;
}

.cta-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: var(--spacing-md);
}

.cta-desc {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: var(--spacing-xl);
}

/* ===== About Section ===== */
.about {
  padding: var(--spacing-2xl) 0;
  background: white;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-content p {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: var(--spacing-md);
}

.about-list {
  list-style: none;
  margin: var(--spacing-lg) 0;
}

.about-list li {
  padding: var(--spacing-sm) 0;
  color: var(--text);
}

.about-motto {
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  color: var(--primary);
  margin-top: var(--spacing-xl);
}

/* ===== Footer ===== */
.footer {
  background: var(--text);
  color: white;
  padding: var(--spacing-xl) 0;
}

.footer.simple {
  padding: var(--spacing-md) 0;
  text-align: center;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.footer-section h4 {
  font-size: 16px;
  margin-bottom: var(--spacing-md);
}

.footer-section ul {
  list-style: none;
}

.footer-section a {
  color: var(--text-lighter);
  text-decoration: none;
  display: block;
  padding: var(--spacing-xs) 0;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: var(--accent);
}

.social-links {
  display: flex;
  gap: var(--spacing-md);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  color: white;
  text-decoration: none;
  transition: all 0.2s;
}

.social-link:hover {
  background: rgba(255,255,255,0.2);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-lg);
  border-top: 1px solid rgba(255,255,255,0.1);
  color: var(--text-lighter);
  font-size: 14px;
}

/* ===== Generate Page Styles ===== */
.page-generate .main-content {
  padding: var(--spacing-xl) 0;
}

.page-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.page-header h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
}

.page-header i {
  color: var(--primary);
}

.page-subtitle {
  font-size: 16px;
  color: var(--text-light);
}

/* ===== Step Sections ===== */
.step-section {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}

.step-section[style*="0.5"] {
  opacity: 0.5;
}

.step-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.step-header h2 {
  font-size: 20px;
  font-weight: 600;
}

/* ===== Search Box ===== */
.search-box {
  position: relative;
  margin-bottom: var(--spacing-md);
}

.search-box i {
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-lighter);
}

.search-input {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) var(--spacing-2xl);
  border: 2px solid var(--bg-light);
  border-radius: var(--radius-lg);
  font-size: 16px;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ===== Grade Filter ===== */
.grade-filter {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.grade-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg);
  border: 2px solid var(--bg-light);
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.grade-btn.active,
.grade-btn:hover {
  background: var(--gradient-secondary);
  border-color: transparent;
  color: white;
}

/* ===== Poem Grid ===== */
.poem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-md);
  max-height: 400px;
  overflow-y: auto;
}

.poem-card {
  background: var(--bg-light);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  cursor: pointer;
  transition: all 0.2s;
}

.poem-card:hover {
  border-color: var(--primary-light);
  background: white;
}

.poem-card.selected {
  border-color: var(--primary);
  background: #FFF5F0;
}

.poem-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
}

.poem-card-title {
  font-size: 15px;
  font-weight: 600;
}

.poem-card-badge {
  font-size: 11px;
  padding: 2px 6px;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
}

.poem-card-meta {
  font-size: 12px;
  color: var(--text-light);
}

.poem-card-preview {
  font-size: 12px;
  color: var(--text-lighter);
  margin-bottom: var(--spacing-sm);
}

.poem-card-tags {
  display: flex;
  gap: var(--spacing-xs);
}

.tag {
  font-size: 10px;
  padding: 2px 6px;
  background: white;
  border-radius: var(--radius-sm);
  color: var(--text-light);
}

/* ===== Selected Poem Display ===== */
.selected-poem {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-lg);
  background: #FFF5F0;
  border-radius: var(--radius-lg);
}

.selected-poem-content {
  display: flex;
  justify-content: space-between;
}

.poem-info {
  flex: 1;
}

.selected-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.selected-meta {
  font-size: 14px;
  color: var(--text-light);
}

.selected-grade {
  color: var(--primary);
  font-weight: 500;
}

.poem-preview {
  margin-top: var(--spacing-md);
}

.preview-line {
  margin-bottom: var(--spacing-sm);
}

.line-pinyin {
  font-size: 12px;
  color: var(--text-light);
}

.line-chinese {
  font-size: 18px;
  font-weight: 500;
}

/* ===== Options Grid ===== */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.option-item {
  display: flex;
  padding: var(--spacing-md);
  background: var(--bg-light);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
}

.option-item:hover {
  border-color: var(--primary-light);
}

.option-item input[type="checkbox"] {
  margin-right: var(--spacing-md);
}

.option-label {
  display: flex;
  align-items: center;
  font-weight: 500;
  font-size: 14px;
}

.option-label i {
  margin-right: var(--spacing-sm);
  color: var(--primary);
}

.option-desc {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-top: var(--spacing-xs);
}

/* ===== Grade Selection ===== */
.grade-selection {
  margin-top: var(--spacing-lg);
}

.grade-selection h4 {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: var(--spacing-md);
}

.grade-options {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.grade-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-md);
  background: var(--bg-light);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 80px;
}

.grade-option:hover {
  border-color: var(--primary-light);
}

.grade-option.active {
  border-color: var(--primary);
  background: #FFF5F0;
}

.grade-icon {
  font-size: 24px;
  margin-bottom: var(--spacing-xs);
}

.grade-label {
  font-size: 13px;
  font-weight: 500;
}

.grade-age {
  font-size: 11px;
  color: var(--text-light);
}

/* ===== Generate Button ===== */
.generate-btn {
  width: 100%;
  padding: var(--spacing-xl);
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.generate-hint {
  text-align: center;
  font-size: 14px;
  color: var(--text-light);
  margin-top: var(--spacing-md);
}

/* ===== Loading State ===== */
.loading-state {
  text-align: center;
  padding: var(--spacing-2xl) 0;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
}

.loading-dots span {
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.loading-text {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin-top: var(--spacing-md);
}

.loading-subtext {
  font-size: 14px;
  color: var(--text-light);
}

/* ===== Result Container ===== */
.result-container {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-lg);
  margin-top: var(--spacing-lg);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.result-header h3 {
  font-size: 20px;
  font-weight: 600;
}

.result-actions {
  display: flex;
  gap: var(--spacing-sm);
}

.action-btn {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-light);
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--primary-light);
  color: white;
}

.action-btn.primary {
  background: var(--gradient-primary);
  color: white;
}

/* ===== Result Sections ===== */
.result-section {
  padding: var(--spacing-lg);
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-md);
}

.result-section-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.result-section-title i {
  color: var(--primary);
}

.result-section-title h3 {
  font-size: 18px;
  font-weight: 600;
}

/* ===== Poem Display in Results ===== */
.poem-display {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
}

.poem-content-full {
  text-align: center;
  font-size: 18px;
  line-height: 2;
}

.poem-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 14px;
  color: var(--text-light);
}

.meta-item i {
  color: var(--primary);
}

.meta-tag {
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
  font-size: 12px;
}

/* ===== Interpretation ===== */
.interpretation-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  line-height: 1.8;
}

/* ===== Activities ===== */
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
}

.activity-item {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
}

.activity-item h4 {
  font-size: 16px;
  margin-bottom: var(--spacing-xs);
}

.activity-instructions {
  font-size: 13px;
  color: var(--text-light);
}

/* ===== Exercises ===== */
.exercises-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.exercise-item {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
}

.exercise-title {
  font-size: 16px;
  margin-bottom: var(--spacing-md);
}

.question {
  padding: var(--spacing-sm);
  background: var(--bg-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-xs);
}

.answer {
  display: block;
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
}

/* ===== Flashcard ===== */
.flashcard-container {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
}

.flashcard-front,
.flashcard-back {
  background: #FFF5F0;
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  text-align: center;
}

.flashcard-front h4 {
  font-size: 20px;
  margin-bottom: var(--spacing-lg);
}

.flashcard-back h4 {
  font-size: 16px;
  margin-bottom: var(--spacing-md);
}

.flashcard-back p {
  font-size: 14px;
  line-height: 1.8;
}

/* ===== Memory Card ===== */
.memory-card {
  background: var(--gradient-accent);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
}

.memory-card h4 {
  font-size: 16px;
  margin-bottom: var(--spacing-md);
}

.memory-card ul {
  list-style: none;
}

.memory-card li {
  padding: var(--spacing-sm) 0;
  font-size: 14px;
}

/* ===== Games ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
}

.game-item {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
}

.game-item h4 {
  font-size: 15px;
  margin-bottom: var(--spacing-xs);
}

/* ===== Tips ===== */
.tips-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.tip-item {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
}

.tip-item h4 {
  font-size: 15px;
  margin-bottom: var(--spacing-xs);
  color: var(--primary);
}

.tip-text {
  font-size: 14px;
  margin-bottom: var(--spacing-xs);
}

.tip-method {
  font-size: 13px;
  color: var(--text-light);
}

/* ===== Watermark ===== */
.result-watermark {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px dashed var(--text-lighter);
  text-align: center;
}

.result-watermark p {
  font-size: 14px;
  color: var(--text-light);
}

.watermark-qr {
  margin-top: var(--spacing-md);
}

.watermark-qr img {
  width: 120px;
  height: 120px;
  background: var(--bg-light);
  border-radius: var(--radius-md);
}

.watermark-qr p {
  font-size: 12px;
  color: var(--text-light);
}

/* ===== Interactive Activities ===== */
.activities-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.activity-item {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  border-left: 4px solid var(--primary);
}

.activity-item.role-play {
  border-left-color: #FF6B6B;
}

.activity-item.draw {
  border-left-color: #4ECDC4;
}

.activity-item.sing {
  border-left-color: #FFE66D;
}

.activity-desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}

.activity-steps {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--bg-light);
  border-radius: var(--radius-md);
}

.step-num {
  background: var(--primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}

.step-text {
  font-size: 14px;
  line-height: 1.6;
}

.draw-area {
  margin-top: var(--spacing-md);
  padding: var(--spacing-lg);
  background: linear-gradient(135deg, #FFF5F0 0%, #FFE4CC 100%);
  border-radius: var(--radius-lg);
  text-align: center;
}

.draw-hint {
  font-size: 14px;
  color: var(--text-light);
}

.lyrics-box {
  background: #FFF9E6;
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-top: var(--spacing-sm);
}

.lyrics-box pre {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 2;
  margin: 0;
  white-space: pre-wrap;
}

.sing-btn {
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-lg);
  background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  transition: transform 0.2s;
}

.sing-btn:hover {
  transform: scale(1.05);
}

.sing-btn.playing {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ===== Interactive Games ===== */
.games-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.game-item {
  padding: var(--spacing-lg);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.game-item h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--spacing-sm);
}

.game-item > p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: var(--spacing-md);
}

.game-instruction {
  color: var(--primary);
  font-size: 13px;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: #EFF6FF;
  border-radius: var(--radius-md);
}

/* Fill Game - 点击选择模式（适合幼儿） */
.fill-game-area {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.fill-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  transition: all 0.3s;
}

.fill-display {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  letter-spacing: 2px;
  text-align: center;
  font-weight: 500;
}

.fill-blanks {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

.fill-blank {
  min-width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 3px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.fill-blank:hover:not(.filled) {
  border-color: var(--primary);
  transform: scale(1.05);
}

/* 选中状态 */
.fill-blank.selected {
  border-color: var(--primary);
  background: #DBEAFE;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* 提示下一个 */
.fill-blank.hint-next {
  animation: hintGlow 1.5s ease;
}

@keyframes hintGlow {
  0%, 100% { border-color: var(--border); }
  50% { border-color: var(--primary); }
}

/* 提示脉冲 */
.fill-blank.hint-pulse {
  animation: hintPulse 1s ease;
}

@keyframes hintPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); border-color: var(--warning); }
}

.blank-placeholder {
  font-size: 28px;
  color: var(--text-light);
}

.fill-blank.filled {
  border-color: var(--primary);
  background: #DBEAFE;
  cursor: default;
}

/* 检查后的状态 */
.fill-blank.correct {
  border-color: #10B981;
  background: #D1FAE5;
}

.fill-blank.wrong {
  border-color: #EF4444;
  background: #FEE2E2;
}

.fill-blank.missing {
  border-color: #F59E0B;
  background: #FEF3C7;
}

.filled-char {
  font-size: 32px;
  font-weight: bold;
  color: #065F46;
}

.fill-blank.wrong .filled-char {
  color: #991B1B;
  font-size: 20px;
}

.fill-feedback {
  min-height: 32px;
  text-align: center;
}

.fill-feedback .success {
  color: #10B981;
  font-size: 18px;
  font-weight: bold;
}

.fill-feedback .error {
  color: #EF4444;
  font-size: 16px;
}

.fill-options {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
  padding: var(--spacing-md);
  background: #F8FAFC;
  border-radius: var(--radius-lg);
}

.fill-option-btn {
  min-width: 60px;
  min-height: 60px;
  font-size: 32px;
  font-weight: bold;
  padding: var(--spacing-sm) var(--spacing-lg);
  background: white;
  border: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.fill-option-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.fill-option-btn:active {
  transform: translateY(0);
}

.game-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  margin-top: var(--spacing-md);
}

.check-all-btn {
  padding: var(--spacing-md) var(--spacing-xl);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: background 0.2s;
}

.check-all-btn:hover {
  background: var(--primary-dark);
}

.game-hints {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-md);
}

.hint-tag {
  padding: var(--spacing-xs) var(--spacing-sm);
  background: #FEF3C7;
  color: #92400E;
  border-radius: var(--radius-full);
  font-size: 12px;
}

.game-reset-btn {
  padding: var(--spacing-md) var(--spacing-lg);
  background: white;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  transition: background 0.2s;
}

.game-reset-btn:hover {
  background: var(--bg-light);
}

/* 游戏结果 */
.game-result {
  margin-top: var(--spacing-md);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  text-align: center;
}

.game-result.success {
  background: #D1FAE5;
  border: 2px solid #10B981;
}

.game-result.partial {
  background: #DBEAFE;
  border: 2px solid #3B82F6;
}

.game-result.wrong {
  background: #FEE2E2;
  border: 2px solid #EF4444;
}

.result-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-sm);
}

.result-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: var(--spacing-xs);
}

.result-score {
  font-size: 16px;
  color: var(--text-secondary);
}

/* 庆祝动画 */
.fill-game.celebrate {
  position: relative;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: 0;
  animation: confettiFall 2s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(300px) rotate(720deg);
    opacity: 0;
  }
}
  background: #F8FAFC;
  border-radius: var(--radius-lg);
}

.fill-option-btn {
  min-width: 56px;
  min-height: 56px;
  font-size: 28px;
  font-weight: bold;
  padding: var(--spacing-sm) var(--spacing-lg);
  background: white;
  border: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.fill-option-btn:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.fill-option-btn:active {
  transform: translateY(0);
}

.fill-feedback {
  min-height: 32px;
  text-align: center;
}

.fill-feedback .success {
  color: #10B981;
  font-size: 18px;
  font-weight: bold;
}

.fill-feedback .error {
  color: #EF4444;
  font-size: 16px;
}

/* Order Game - 点击数字模式（适合幼儿） */
.order-game-area {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.shuffled-lines {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

.order-line-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
}

.order-line-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
  transform: translateY(-2px);
}

.order-line-card.selected {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

.line-number-btn {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  font-size: 20px;
  font-weight: bold;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.line-text {
  flex: 1;
  font-size: 16px;
  text-align: center;
}

.ordered-lines {
  padding: var(--spacing-md);
  background: #F8FAFC;
  border-radius: var(--radius-lg);
  min-height: 120px;
}

.order-hint {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: var(--spacing-md);
}

.ordered-result {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.ordered-line {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: white;
  border-radius: var(--radius-md);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.order-num {
  min-width: 32px;
  font-size: 18px;
  color: var(--primary);
  font-weight: bold;
}

.order-text {
  flex: 1;
  font-size: 15px;
}

.check-order-btn {
  width: 100%;
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: background 0.2s;
}

.check-order-btn:hover {
  background: var(--primary-dark);
}

.game-feedback {
  min-height: 40px;
  text-align: center;
  margin-top: var(--spacing-sm);
}

.game-feedback .success {
  color: #10B981;
  font-size: 16px;
  font-weight: bold;
}

.game-feedback .error {
  color: #EF4444;
  font-size: 15px;
}

.game-feedback .info {
  color: var(--text-secondary);
  font-size: 14px;
}

.game-result {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 15px;
}

.game-result.correct {
  background: #D1FAE5;
  color: #065F46;
}

.game-result.wrong {
  background: #FEE2E2;
  color: #991B1B;
}

/* Rhythm Game */
.rhythm-game {
  background: linear-gradient(135deg, #FFF5E6 0%, #FFE4C4 100%);
}

.rhythm-pattern {
  margin-bottom: var(--spacing-md);
}

.rhythm-lines {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.rhythm-line {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm);
  background: white;
  border-radius: var(--radius-sm);
}

.rhythm-text {
  display: flex;
  gap: 4px;
  justify-content: center;
  font-size: 16px;
}

.rhythm-text .char {
  padding: 2px 4px;
  border-radius: 2px;
}

.rhythm-text .char.strong {
  background: #FFE4E4;
  font-weight: bold;
}

.rhythm-text .char.weak {
  background: #E8F4FD;
}

.rhythm-beats {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.rhythm-beats .beat {
  font-size: 14px;
}

.rhythm-tips {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-md);
}

.rhythm-tips p {
  font-size: 13px;
  margin-bottom: var(--spacing-xs);
}

/* ===== Responsive ===== */
/* 移动端优先优化 */
@media (max-width: 768px) {
  /* 基础字号增大，便于阅读 */
  html {
    font-size: 16px;
  }

  .container {
    padding: 0 var(--spacing-md);
    max-width: 100%;
  }

  /* 头部优化 */
  .header-content {
    flex-wrap: wrap;
    gap: var(--spacing-sm);
  }

  .logo-text {
    font-size: 18px;
  }

  /* 页面标题 */
  .page-header h1 {
    font-size: 24px;
  }

  .page-subtitle {
    font-size: 14px;
  }

  /* 步骤区域 */
  .step-header {
    flex-wrap: wrap;
  }

  .step-number {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .step-header h2 {
    font-size: 18px;
  }

  /* 古诗卡片 */
  .poem-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  .poem-card {
    padding: var(--spacing-sm);
  }

  .poem-card-title {
    font-size: 16px;
  }

  /* 选项网格 */
  .options-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  .option-item {
    padding: var(--spacing-sm);
  }

  /* 年级选择 */
  .grade-options {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }

  .grade-option {
    padding: var(--spacing-sm);
  }

  .grade-icon {
    font-size: 20px;
  }

  .grade-label {
    font-size: 13px;
  }

  .grade-age {
    font-size: 11px;
  }

  /* 生成按钮 */
  .generate-btn {
    width: 100%;
    padding: var(--spacing-md);
    font-size: 16px;
  }

  /* 结果区域 */
  .result-section {
    padding: var(--spacing-md);
  }

  .result-section-title h3 {
    font-size: 16px;
  }

  /* 游戏区域移动端优化 */
  .shuffled-lines {
    grid-template-columns: 1fr;
  }

  .order-line-card {
    padding: var(--spacing-sm);
  }

  .line-number-btn {
    min-width: 40px;
    min-height: 40px;
    font-size: 18px;
  }

  .line-text {
    font-size: 14px;
  }

  .fill-option-btn {
    min-width: 48px;
    min-height: 48px;
    font-size: 24px;
  }

  .fill-blank {
    min-width: 44px;
    height: 44px;
  }

  .filled-char {
    font-size: 24px;
  }

  /* 活动列表 */
  .activity-item {
    padding: var(--spacing-sm);
  }

  .activity-item h4 {
    font-size: 15px;
  }

  .step-item {
    font-size: 14px;
  }

  /* 英雄区域 */
  .hero-content {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  /* 功能网格 */
  .features-grid,
  .examples-grid {
    grid-template-columns: 1fr;
  }

  /* 筛选按钮 */
  .grade-filter {
    flex-wrap: wrap;
    gap: var(--spacing-xs);
  }

  .grade-btn {
    flex: 1 1 calc(50% - var(--spacing-xs));
    min-width: 100px;
    font-size: 13px;
    padding: var(--spacing-xs) var(--spacing-sm);
  }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 var(--spacing-sm);
  }

  .page-header h1 {
    font-size: 20px;
  }

  .page-header i {
    display: none;
  }

  /* 选项更紧凑 */
  .option-label {
    font-size: 14px;
  }

  .option-desc {
    font-size: 12px;
  }

  /* 年级选项单列 */
  .grade-options {
    grid-template-columns: 1fr;
  }

  /* 触摸友好的按钮最小尺寸 */
  .fill-option-btn {
    min-width: 52px;
    min-height: 52px;
    font-size: 26px;
  }

  /* 搜索框 */
  .search-input {
    font-size: 16px; /* 防止iOS自动缩放 */
  }

  /* 选中的古诗显示 */
  .selected-poem {
    padding: var(--spacing-sm);
  }

  .selected-title {
    font-size: 18px;
  }

  .selected-meta {
    font-size: 13px;
  }
}

/* 平板和大屏 */
@media (min-width: 769px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
  }
}

/* ===== Hot Content Section ===== */
.hot-content-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.hot-content-section .section-title {
  color: white;
}

.hot-content-section .example-card {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
}

.hot-content-section .example-preview {
  background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
  border: 2px solid rgba(102, 126, 234, 0.3);
}

.hot-content-section .preview-title {
  color: #667eea;
}

.hot-content-section .preview-content {
  color: var(--text-light);
}

.hot-content-section .example-info {
  background: white;
}

.hot-content-section .example-info h4 {
  color: var(--text);
}

.hot-content-section .example-info p {
  color: var(--text-light);
}

.hot-content-section .example-card:hover {
  background: white;
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}
