:root {
  --sidebar-width: 220px;
  --sidebar-bg: #6C3FB7;
  --sidebar-hover: #7E52CF;
  --sidebar-active: #8B62D4;
  --bg-main: #FBF7F0;
  --card-bg: #FFFFFF;
  --text-primary: #2D2D2D;
  --text-secondary: #888888;
  --text-white: #FFFFFF;
  --accent-purple: #7C4DFF;
  --accent-blue: #4A90D9;
  --accent-yellow: #F5A623;
  --accent-green: #27AE60;
  --success: #27AE60;
  --warning: #F5A623;
  --progress-bg: #E8E0F0;
  --border-radius: 16px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font-main);
  background: #F0EBF8;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  user-select: none;
}
button { font: inherit; }
button, [data-action] { touch-action: manipulation; }
.pwa-standalone body {
  align-items: stretch;
  background: var(--bg-main);
}
.pwa-standalone .app-container {
  border-radius: 0;
  height: 100dvh;
  max-width: none;
  min-height: 0;
}
.app-container {
  display: flex;
  width: 100%;
  max-width: 1200px;
  height: 95vh;
  min-height: 700px;
  background: var(--bg-main);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: linear-gradient(180deg, #7B4FDB 0%, #5B2FB5 40%, #4A1F9E 100%);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  z-index: 10;
}
.sidebar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 8px;
}
.sidebar-logo {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, #FF8A65, #FF6B6B);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #FFF;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(255,107,107,0.3);
}
.sidebar-title {
  font-size: 15px; font-weight: 600; color: var(--text-white);
  letter-spacing: 1px; text-align: center; line-height: 1.4;
}
.sidebar-nav {
  flex: 1; display: flex; flex-direction: column;
  padding: 8px 12px; overflow-y: auto;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px; border: 0; width: 100%;
  color: rgba(255,255,255,0.7); cursor: pointer; background: transparent;
  transition: var(--transition); font-size: 14px; font-weight: 500;
  margin-bottom: 2px; text-decoration: none; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.12); color: #FFF; }
.nav-item.active {
  background: rgba(255,255,255,0.2); color: #FFF;
  font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: #FF6B6B; color: #FFF; font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.main-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px; background: var(--bg-main);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.header-left h1 { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.header-left .date { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.user-avatar { width: 38px; height: 38px; background: linear-gradient(135deg, #7C4DFF, #B388FF); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #FFF; font-size: 16px; font-weight: 600; }
.user-name { font-size: 14px; color: var(--text-primary); font-weight: 500; }
.points-badge { display: flex; align-items: center; gap: 6px; background: linear-gradient(135deg, #FFF8E1, #FFF3CD); padding: 8px 16px; border-radius: 20px; font-size: 14px; font-weight: 600; color: #E8A400; border: 1.5px solid #FFD54F; }
.points-icon { font-size: 20px; }
.page-content { flex: 1; padding: 24px 32px; overflow-y: auto; scroll-behavior: smooth; }
.page { display: none; animation: fadeIn 0.4s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--card-bg); border-radius: var(--border-radius); padding: 20px 24px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: var(--transition); }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card.colored { background: linear-gradient(135deg, #4A90D9, #5BA0E9); color: #FFF; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.stat-card.colored .stat-label { color: rgba(255,255,255,0.8); }
.stat-value { font-size: 32px; font-weight: 700; margin-bottom: 8px; }
.stat-progress { height: 8px; background: var(--progress-bg); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.stat-progress-bar { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.stat-progress-bar.purple { background: linear-gradient(90deg, #7C4DFF, #B388FF); }
.stats-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.mini-stat { background: var(--card-bg); border-radius: var(--border-radius); padding: 16px 20px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px; }
.mini-stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.mini-stat-icon.sun { background: #FFF8E1; }
.mini-stat-icon.badge { background: #FCE4EC; }
.mini-stat-info .mini-stat-label { font-size: 12px; color: var(--text-secondary); }
.mini-stat-info .mini-stat-value { font-size: 20px; font-weight: 700; margin-top: 2px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.primary-btn, .secondary-btn {
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.primary-btn { background: var(--accent-purple); color: #FFF; }
.primary-btn:hover { background: #6A3DE8; }
.secondary-btn { background: #F0ECFA; color: var(--accent-purple); }
.secondary-btn:hover { background: #E3D8F8; }
.student-strip {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.student-strip-name { font-size: 18px; font-weight: 700; }
.student-strip-meta { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.dashboard-hero {
  align-items: center;
  background: linear-gradient(135deg, #E8F5E9, #E3F2FD);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 22px 24px;
}
.dashboard-hero p { color: #2E7D32; font-size: 14px; font-weight: 700; margin: 0 0 6px; }
.dashboard-hero h2 { font-size: 24px; margin: 0 0 6px; }
.dashboard-hero span { color: var(--text-secondary); display: block; font-size: 13px; line-height: 1.5; }
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 16px;
  margin-bottom: 18px;
}
.dashboard-panel { min-width: 0; }
.weak-list, .growth-list {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.weak-row, .growth-row {
  align-items: center;
  border-bottom: 1px solid #F5F5F5;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}
.weak-row:last-child, .growth-row:last-child { border-bottom: 0; }
.weak-row strong, .growth-row strong { display: block; font-size: 14px; margin-bottom: 4px; }
.weak-row span, .growth-row span { color: var(--text-secondary); display: block; font-size: 12px; line-height: 1.5; }
.growth-row.ready { background: #F1F8E9; }
.growth-row em { color: #2E7D32; flex-shrink: 0; font-size: 12px; font-style: normal; font-weight: 700; }
.exam-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.exam-paper, .exam-report {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.exam-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 12px; }
.exam-head strong { font-size: 16px; }
.exam-head span { color: var(--text-secondary); font-size: 12px; }
.exam-question { display: block; margin-bottom: 12px; }
.exam-question span { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.exam-question input {
  border: 1px solid #E0E0E0;
  border-radius: 10px;
  font-family: var(--font-main);
  padding: 10px 12px;
  width: 100%;
}
.exam-score { align-items: baseline; display: flex; gap: 8px; margin-bottom: 12px; }
.exam-score strong { color: var(--accent-purple); font-size: 36px; }
.exam-score span { color: var(--text-secondary); font-size: 13px; }
.version-strip {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.version-strip strong { display: block; font-size: 16px; }
.version-strip span { display: block; color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.profile-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}
.profile-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.profile-card label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}
.profile-card input, .profile-card textarea, .practice-card input {
  border: 1.5px solid #E2DDED;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--font-main);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  background: #FFF;
}
.profile-card input:focus, .profile-card textarea:focus, .practice-card input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(124,77,255,0.10);
}
.profile-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-avatar {
  width: 58px; height: 58px; border-radius: 16px;
  background: linear-gradient(135deg, #7C4DFF, #B388FF);
  color: #FFF; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
}
.profile-name { font-size: 22px; font-weight: 700; }
.profile-grade { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.profile-stats div {
  background: #FAF8FF;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.profile-stats strong { display: block; color: var(--accent-purple); font-size: 20px; }
.profile-stats span { display: block; color: var(--text-secondary); font-size: 12px; margin-top: 4px; }
.profile-card .primary-btn, .profile-card .secondary-btn { min-height: 44px; }
.sync-card { grid-column: 1 / -1; }
.sync-card-head, .sync-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}
.sync-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}
.sync-status-pill {
  background: #F0ECFA;
  border-radius: 999px;
  color: var(--accent-purple);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 12px;
}
.sync-status-pill.synced { background: #E8F5E9; color: #2E7D32; }
.sync-status-pill.syncing, .sync-status-pill.pending { background: #FFF3E0; color: #EF6C00; }
.sync-status-pill.offline { background: #ECEFF1; color: #546E7A; }
.sync-meta {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0;
}
.sync-meta div {
  background: #FAF8FF;
  border-radius: 12px;
  padding: 12px;
}
.sync-meta span {
  color: var(--text-secondary);
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
}
.sync-meta strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.sync-actions { justify-content: flex-start; flex-wrap: wrap; }
.task-list { background: var(--card-bg); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.task-item { display: flex; align-items: center; width: 100%; text-align: left; background: transparent; border: 0; padding: 16px 20px; gap: 14px; border-bottom: 1px solid #F5F5F5; transition: var(--transition); cursor: pointer; color: inherit; }
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: #FAFAFA; }
.task-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.task-icon.poetry { background: #FFF3E0; }
.task-icon.chinese { background: #E3F2FD; }
.task-icon.math { background: #F3E5F5; }
.task-icon.english { background: #E0F7FA; }
.task-icon.reading { background: #E8F5E9; }
.task-icon.writing { background: #FCE4EC; }
.task-info { flex: 1; }
.task-name { font-size: 15px; font-weight: 500; margin-bottom: 2px; }
.task-desc { font-size: 12px; color: var(--text-secondary); }
.task-status { font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 12px; flex-shrink: 0; }
.task-status.done { background: #E8F5E9; color: var(--success); }
.task-status.pending { background: #F5F5F5; color: var(--text-secondary); }
.task-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #DDD; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: var(--transition); font-size: 12px; color: transparent; }
.task-check.checked { background: var(--success); border-color: var(--success); color: #FFF; }
.poetry-intro { background: linear-gradient(135deg, #FFF3E0, #FFF8E1); border-radius: var(--border-radius); padding: 16px 20px; margin-bottom: 20px; font-size: 14px; color: #8D6E00; display: flex; align-items: center; gap: 10px; }
.poetry-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.poem-card { background: var(--card-bg); border-radius: var(--border-radius); padding: 20px 22px; box-shadow: var(--shadow-sm); cursor: pointer; transition: var(--transition); border: 2px solid transparent; position: relative; overflow: hidden; text-align: left; }
.poem-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #D1C4E9; background: #FAF8FF; }
.poem-card.selected { border-color: var(--accent-purple); background: #F8F5FF; }
.poem-card .poem-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; color: #333; }
.poem-card .poem-author { font-size: 13px; color: var(--text-secondary); }
.poem-decorator { position: absolute; top: -20px; right: -20px; width: 60px; height: 60px; border-radius: 50%; opacity: 0.06; background: var(--accent-purple); }
.chinese-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.chinese-tab { padding: 8px 18px; border-radius: 20px; font-size: 14px; font-weight: 500; cursor: pointer; transition: var(--transition); background: #F0F0F0; color: #666; border: none; font-family: var(--font-main); }
.chinese-tab.active { background: var(--accent-purple); color: #FFF; }
.chinese-tab:hover:not(.active) { background: #E0E0E0; }
.lesson-breadcrumb { font-size: 14px; color: var(--accent-purple); font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 6px; }
.lesson-text { background: var(--card-bg); border-radius: var(--border-radius); padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 20px; line-height: 2; font-size: 15px; text-indent: 2em; color: #444; }
.char-section { background: var(--card-bg); border-radius: var(--border-radius); padding: 20px 24px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.char-section-header { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin-bottom: 16px; color: #4A90D9; }
.char-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.char-cell { background: #F8F5FF; border-radius: 12px; padding: 12px 8px; text-align: center; cursor: pointer; transition: var(--transition); border: 2px solid transparent; }
.char-cell:hover { background: #EDE7F6; border-color: #D1C4E9; transform: translateY(-2px); }
.char-cell .char { font-size: 28px; font-weight: 700; color: #333; }
.char-cell .pinyin { font-size: 12px; color: #888; margin-top: 4px; }
.explain-section { background: var(--card-bg); border-radius: var(--border-radius); padding: 20px 24px; box-shadow: var(--shadow-sm); }
.explain-section-header { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin-bottom: 14px; color: #F5A623; }
.explain-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; font-size: 14px; color: #555; line-height: 1.6; }
.explain-dot { width: 6px; height: 6px; border-radius: 50%; background: #F5A623; margin-top: 7px; flex-shrink: 0; }
.math-layout { display: grid; grid-template-columns: 0.9fr 1.3fr; gap: 16px; align-items: start; }
.english-layout { display: grid; grid-template-columns: 0.85fr 1.35fr; gap: 16px; align-items: start; }
.math-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.english-sidebar { display: grid; gap: 12px; }
.math-card { background: var(--card-bg); border-radius: var(--border-radius); padding: 20px; box-shadow: var(--shadow-sm); cursor: pointer; transition: var(--transition); border-left: 4px solid #7C4DFF; text-align: left; }
.english-unit-card {
  background: var(--card-bg);
  border: 0;
  border-left: 4px solid #4A90D9;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  color: inherit;
}
.english-unit-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.english-unit-card.selected { background: #F4FBFF; border-color: #F5A623; }
.english-unit-card span { display: block; color: var(--text-secondary); font-size: 12px; margin-bottom: 5px; }
.english-unit-card strong { display: block; font-size: 15px; margin-bottom: 8px; }
.english-unit-card em { font-style: normal; color: #1976D2; font-size: 12px; font-weight: 700; }
.math-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.math-card.selected { background: #F8F5FF; border-color: #F5A623; }
.math-card .math-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: #333; }
.math-card .math-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.math-tag { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; margin-right: 6px; }
.math-tag.formula { background: #E3F2FD; color: #1976D2; }
.math-tag.concept { background: #FFF3E0; color: #F57C00; }
.math-tag.apply { background: #E8F5E9; color: #388E3C; }
.math-panel {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.english-panel {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.math-lesson-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.math-lesson-header h2 { font-size: 22px; margin-top: 4px; }
.analysis-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.analysis-row div {
  background: #F8F5FF;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.analysis-row strong { display: block; font-size: 22px; color: var(--accent-purple); }
.analysis-row span { font-size: 12px; color: var(--text-secondary); }
.lesson-text.no-indent { text-indent: 0; }
.lesson-text.no-indent p { margin-bottom: 8px; }
.example-list, .practice-list, .wrongbook-list { display: grid; gap: 12px; }
.example-card, .practice-card, .wrong-card, .empty-state {
  background: #FAFAFA;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #F0F0F0;
}
.example-title, .practice-title, .wrong-title { font-weight: 700; margin-bottom: 8px; }
.example-solution { color: #388E3C; margin-top: 8px; font-size: 14px; }
.practice-answer-row { display: flex; gap: 10px; align-items: center; }
.practice-answer-row input { flex: 1; min-width: 0; }
.practice-feedback { margin-top: 10px; font-size: 13px; line-height: 1.6; }
.practice-feedback.correct { color: #27AE60; }
.practice-feedback.wrong { color: #D84315; }
.wrongbook-toolbar {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.wrong-card-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.wrong-card-head span { display: block; color: var(--text-secondary); font-size: 12px; margin-top: 3px; }
.wrong-card-head em { color: #D84315; font-style: normal; font-size: 13px; }
.wrong-answer { color: var(--text-secondary); font-size: 13px; margin-bottom: 10px; }
.analysis-note {
  background: #FFF8E1;
  color: #7A5B00;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.english-section {
  background: #FAFAFA;
  border: 1px solid #F0F0F0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.course-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.6fr;
  gap: 16px;
  align-items: start;
}
.course-sidebar, .course-main, .course-detail {
  min-width: 0;
}
.course-filter, .course-unit-list, .course-section-list {
  display: grid;
  gap: 12px;
}
.course-library-card, .course-unit-row {
  background: var(--card-bg);
  border: 0;
  border-left: 4px solid #7C4DFF;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}
.course-library-card:hover, .course-unit-row:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.course-library-card.selected, .course-unit-row.selected { background: #F8F5FF; border-color: #F5A623; }
.course-library-card span, .course-unit-row span { display: block; color: var(--text-secondary); font-size: 12px; margin-bottom: 5px; }
.course-library-card strong, .course-unit-row strong { display: block; font-size: 15px; margin-bottom: 8px; }
.course-library-card em { font-style: normal; color: #1976D2; font-size: 12px; font-weight: 700; }
.course-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.course-term-tab {
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  background: #F0F0F0;
  color: #666;
  cursor: pointer;
  font-weight: 600;
}
.course-term-tab.active { background: var(--accent-purple); color: #FFF; }
.course-browser {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 16px;
  align-items: start;
}
.course-detail {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.course-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.course-detail-head h2 { font-size: 22px; margin-top: 4px; }
.course-section-card {
  background: #FAFAFA;
  border: 1px solid #F0F0F0;
  border-radius: 12px;
  padding: 16px;
}
.course-section-card h3 { font-size: 16px; margin-bottom: 8px; }
.course-section-card p { color: #555; font-size: 14px; line-height: 1.7; margin-bottom: 8px; }
.sync-panel, .repository-panel {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}
.compact-header {
  margin-bottom: 0;
}
.compact-header p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-top: 6px;
}
.sync-summary, .repo-summary {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 14px;
}
.sync-source-card, .sync-unit-card, .repo-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.sync-source-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.sync-source-card span, .sync-unit-head span {
  color: var(--text-secondary);
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}
.sync-source-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}
.sync-source-card p, .sync-unit-card li {
  color: #555;
  font-size: 14px;
  line-height: 1.7;
}
.sync-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.sync-unit-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.sync-unit-head h3 {
  font-size: 17px;
}
.sync-status {
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  padding: 6px 10px;
  white-space: nowrap;
}
.sync-status.todo { background: #F5F5F5; color: #777; }
.sync-status.watching { background: #E3F2FD; color: #1976D2; }
.sync-status.done { background: #E8F5E9; color: #2E7D32; }
.sync-unit-card ul {
  margin: 12px 0;
  padding-left: 18px;
}
.sync-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.sync-link-grid a {
  background: #F8FAFF;
  border: 1px solid #E7ECFF;
  border-radius: 10px;
  color: inherit;
  display: block;
  padding: 10px;
  text-decoration: none;
}
.sync-link-grid a:hover {
  border-color: #7C4DFF;
}
.sync-link-grid strong {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}
.sync-link-grid span {
  color: var(--text-secondary);
  display: block;
  font-size: 12px;
  line-height: 1.5;
}
.sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.repo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.repo-card p {
  color: #555;
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.repo-card em {
  color: var(--text-secondary);
  font-size: 12px;
  font-style: normal;
}
.repo-section-title {
  color: #1976D2;
  font-size: 13px;
  font-weight: 800;
  margin: 12px 0 8px;
}
.repo-knowledge-list, .repo-practice-list {
  display: grid;
  gap: 8px;
}
.repo-knowledge-list div, .repo-practice-list div {
  background: #FAFAFA;
  border: 1px solid #F0F0F0;
  border-radius: 10px;
  padding: 10px;
}
.repo-knowledge-list strong, .repo-practice-list strong {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}
.repo-knowledge-list span, .repo-practice-list span {
  color: #555;
  display: block;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 5px;
}
.english-section h3 { font-size: 15px; margin-bottom: 10px; }
.english-section ul { padding-left: 18px; line-height: 1.8; color: #555; font-size: 14px; }
.word-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.word-grid div {
  background: #FFF;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #EFEFEF;
}
.word-grid strong { display: block; color: var(--accent-purple); }
.word-grid span { display: block; color: var(--text-secondary); font-size: 12px; margin-top: 4px; }
.flashcard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.flashcard {
  background: #FFF;
  border: 1px solid #EFEFEF;
  border-radius: 10px;
  padding: 12px;
}
.flashcard.mastered {
  border-color: #A5D6A7;
  background: #F1F8E9;
}
.flashcard-front {
  color: var(--accent-purple);
  font-size: 18px;
  font-weight: 700;
}
.flashcard-back {
  color: #333;
  font-size: 14px;
  margin-top: 5px;
}
.flashcard-example {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 8px;
}
.flashcard-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.flashcard-actions button {
  flex: 1;
  padding: 7px 8px;
  font-size: 12px;
}
.flashcard > span {
  display: inline-block;
  color: #2E7D32;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
}
.sentence-line {
  background: #FFF;
  border-radius: 10px;
  padding: 10px 12px;
  color: #333;
  margin-bottom: 8px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag-row span {
  background: #E3F2FD;
  color: #1976D2;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
}
.garden-container { background: var(--card-bg); border-radius: var(--border-radius); padding: 32px; box-shadow: var(--shadow-sm); text-align: center; }
.garden-scene { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 24px; }
.garden-plot { aspect-ratio: 1; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 32px; transition: var(--transition); cursor: pointer; }
.garden-plot.unlocked { background: #E8F5E9; border: 2px solid #A5D6A7; }
.garden-plot.locked { background: #F5F5F5; border: 2px dashed #DDD; opacity: 0.5; }
.garden-plot:hover { transform: scale(1.05); }
.garden-info { display: flex; justify-content: center; gap: 32px; margin-top: 16px; }
.garden-stat { text-align: center; }
.garden-stat .garden-stat-value { font-size: 28px; font-weight: 700; color: var(--accent-purple); }
.garden-stat .garden-stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.shop-section { margin-bottom: 24px; }
.shop-section-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.theme-card { background: var(--card-bg); border-radius: var(--border-radius); padding: 24px; box-shadow: var(--shadow-sm); text-align: center; transition: var(--transition); cursor: pointer; border: 2px solid transparent; }
.theme-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #D1C4E9; }
.theme-card .theme-icon { font-size: 48px; margin-bottom: 12px; }
.theme-card .theme-name { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.theme-card .theme-price { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: #F5A623; font-weight: 600; margin-bottom: 14px; }
.buy-btn { display: block; width: 100%; padding: 10px; background: var(--accent-purple); color: #FFF; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: var(--transition); font-family: var(--font-main); }
.buy-btn:hover { background: #6A3DE8; transform: scale(1.02); }
.buy-btn:active { transform: scale(0.98); }
.expand-card { background: var(--card-bg); border-radius: var(--border-radius); padding: 20px 24px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.expand-icon { font-size: 36px; }
.expand-info { flex: 1; }
.expand-info .expand-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.expand-info .expand-detail { font-size: 13px; color: var(--text-secondary); }
.expand-btn { padding: 8px 20px; background: var(--accent-purple); color: #FFF; border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: var(--transition); font-family: var(--font-main); white-space: nowrap; }
.expand-btn:hover { background: #6A3DE8; }
.expand-progress { display: flex; align-items: center; gap: 10px; }
.expand-progress .progress-text { font-size: 14px; font-weight: 600; color: var(--accent-purple); }
.progress-bar-mini { width: 100px; height: 8px; background: var(--progress-bg); border-radius: 4px; overflow: hidden; }
.progress-bar-mini-fill { height: 100%; background: linear-gradient(90deg, #7C4DFF, #B388FF); border-radius: 4px; }
.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.badge-card { background: var(--card-bg); border-radius: var(--border-radius); padding: 24px 16px; box-shadow: var(--shadow-sm); text-align: center; transition: var(--transition); cursor: pointer; }
.badge-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.badge-card.earned { border: 2px solid #FFD54F; }
.badge-card.locked { opacity: 0.5; filter: grayscale(0.5); }
.badge-icon { font-size: 48px; margin-bottom: 12px; }
.badge-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.badge-desc { font-size: 12px; color: var(--text-secondary); }
.lesson-complete {
  align-items: center;
  background: #F1F8E9;
  border: 1px solid #C5E1A5;
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 18px;
  padding: 16px 18px;
}
.lesson-complete strong { display: block; font-size: 14px; margin-bottom: 4px; }
.lesson-complete span { color: var(--text-secondary); display: block; font-size: 12px; }
.parent-hero {
  align-items: center;
  background: #F4F8FF;
  border-left: 4px solid #246BCE;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 18px 20px;
}
.parent-hero p { color: #246BCE; font-size: 13px; font-weight: 700; margin: 0 0 5px; }
.parent-hero h2 { font-size: 22px; margin: 0 0 5px; }
.parent-hero span { color: var(--text-secondary); font-size: 12px; }
.report-grid.parent-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.subject-mastery-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}
.subject-mastery-card {
  background: var(--card-bg);
  border: 1px solid #ECEFF1;
  border-top: 3px solid #246BCE;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.subject-mastery-card.english { border-top-color: #2E8B57; }
.subject-mastery-card.chinese { border-top-color: #D97706; }
.subject-mastery-card > div:first-child { display: flex; justify-content: space-between; }
.subject-mastery-card strong { font-size: 15px; }
.subject-mastery-card span { color: var(--text-secondary); font-size: 11px; }
.subject-mastery-card em {
  color: #246BCE;
  display: block;
  font-size: 26px;
  font-style: normal;
  font-weight: 700;
  margin: 12px 0 8px;
}
.subject-mastery-card.english em { color: #2E8B57; }
.subject-mastery-card.chinese em { color: #D97706; }
.subject-progress { background: #ECEFF1; border-radius: 999px; height: 7px; overflow: hidden; }
.subject-progress i { background: #246BCE; display: block; height: 100%; }
.subject-mastery-card.english .subject-progress i { background: #2E8B57; }
.subject-mastery-card.chinese .subject-progress i { background: #D97706; }
.trend-chart {
  background: var(--card-bg);
  border: 1px solid #ECEFF1;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  padding: 16px 18px;
}
.trend-legend { display: flex; gap: 18px; justify-content: flex-end; margin-bottom: 12px; }
.trend-legend span { color: var(--text-secondary); font-size: 11px; }
.trend-legend span::before {
  background: #246BCE;
  border-radius: 2px;
  content: "";
  display: inline-block;
  height: 8px;
  margin-right: 5px;
  width: 8px;
}
.trend-legend .english::before { background: #2E8B57; }
.trend-legend .chinese::before { background: #D97706; }
.trend-columns {
  border-bottom: 1px solid #E0E0E0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(54px, 1fr));
  min-width: 490px;
  padding-top: 4px;
}
.trend-column { min-width: 0; text-align: center; }
.trend-bars {
  align-items: flex-end;
  display: flex;
  gap: 3px;
  height: 140px;
  justify-content: center;
}
.trend-bars i {
  background: #246BCE;
  border-radius: 3px 3px 0 0;
  display: block;
  min-height: 3px;
  width: 9px;
}
.trend-bars i.english { background: #2E8B57; }
.trend-bars i.chinese { background: #D97706; }
.trend-bars.empty i { background: #E0E0E0; height: 3px !important; }
.trend-column strong { display: block; font-size: 11px; margin-top: 6px; }
.trend-column span { color: var(--text-secondary); display: block; font-size: 10px; margin: 3px 0 8px; }
.parent-dashboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}
.parent-list, .review-list {
  background: var(--card-bg);
  border: 1px solid #ECEFF1;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  overflow: hidden;
}
.parent-list-row, .exam-history-row, .review-reminder {
  align-items: center;
  border-bottom: 1px solid #F0F0F0;
  display: flex;
  gap: 12px;
  padding: 13px 16px;
}
.parent-list-row:last-child, .exam-history-row:last-child, .review-reminder:last-child { border-bottom: 0; }
.parent-list-row > div, .exam-history-row > div, .review-reminder > div { flex: 1; min-width: 0; }
.parent-list-row strong, .exam-history-row strong, .review-reminder strong { display: block; font-size: 13px; }
.parent-list-row span, .exam-history-row span, .review-reminder span {
  color: var(--text-secondary);
  display: block;
  font-size: 11px;
  line-height: 1.5;
  margin-top: 3px;
}
.parent-rank {
  align-items: center;
  background: #E8F0FE;
  border-radius: 50%;
  color: #246BCE !important;
  display: flex !important;
  flex: 0 0 26px;
  font-weight: 700;
  height: 26px;
  justify-content: center;
  margin: 0 !important;
}
.exam-history-row em { color: #246BCE; font-size: 18px; font-style: normal; font-weight: 700; }
.review-reminder { border-left: 3px solid #F5B942; }
.review-reminder.urgent { border-left-color: #E05252; }
.review-priority {
  background: #FFF7E0;
  border-radius: 4px;
  color: #8A5A00 !important;
  flex: 0 0 auto;
  font-weight: 700;
  margin: 0 !important;
  padding: 4px 6px;
}
.review-reminder.urgent .review-priority { background: #FDECEC; color: #B42318 !important; }
.record-list { background: var(--card-bg); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.report-card {
  background: var(--card-bg);
  border: 1px solid #EFEFEF;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  padding: 16px;
}
.report-card strong {
  color: var(--accent-purple);
  display: block;
  font-size: 24px;
}
.report-card span {
  color: var(--text-secondary);
  display: block;
  font-size: 12px;
  margin-top: 4px;
}
.mastery-list {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  overflow: hidden;
}
.mastery-row {
  align-items: center;
  border-bottom: 1px solid #F5F5F5;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 18px;
}
.mastery-row:last-child { border-bottom: 0; }
.mastery-row strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}
.mastery-row span {
  color: var(--text-secondary);
  display: block;
  font-size: 12px;
}
.mastery-score {
  min-width: 150px;
}
.mastery-score em {
  color: var(--accent-purple);
  display: block;
  font-style: normal;
  font-weight: 700;
  margin-bottom: 6px;
  text-align: right;
}
.mastery-score span {
  background: var(--progress-bg);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.mastery-score i {
  background: linear-gradient(90deg, #7C4DFF, #8BC34A);
  display: block;
  height: 100%;
}
.record-item { display: flex; align-items: center; padding: 14px 20px; gap: 14px; border-bottom: 1px solid #F5F5F5; }
.record-item:last-child { border-bottom: none; }
.record-date { font-size: 13px; color: var(--text-secondary); width: 80px; flex-shrink: 0; }
.record-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.record-icon.poetry { background: #FFF3E0; }
.record-icon.chinese { background: #E3F2FD; }
.record-icon.math { background: #F3E5F5; }
.record-icon.reading { background: #E8F5E9; }
.record-info { flex: 1; }
.record-name { font-size: 14px; font-weight: 500; }
.record-detail { font-size: 12px; color: var(--text-secondary); }
.record-points { font-size: 14px; font-weight: 600; color: #F5A623; flex-shrink: 0; }
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #333; color: #FFF; padding: 12px 24px; border-radius: 12px; font-size: 14px; font-weight: 500; z-index: 1000; animation: toastIn 0.4s ease, toastOut 0.4s ease 2s forwards; pointer-events: none; white-space: pre-line; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }
.page-content::-webkit-scrollbar { width: 6px; }
.page-content::-webkit-scrollbar-track { background: transparent; }
.page-content::-webkit-scrollbar-thumb { background: #DDD; border-radius: 3px; }
@media (max-width: 900px) {
  .app-container { flex-direction: column; height: auto; min-height: 100vh; border-radius: 0; }
  .sidebar { width: 100%; min-width: 100%; flex-direction: row; padding: 8px; overflow-x: auto; }
  .sidebar-header { display: none; }
  .sidebar-nav { flex-direction: row; padding: 0; }
  .nav-item { flex-shrink: 0; padding: 8px 12px; font-size: 12px; gap: 6px; width: auto; }
  .nav-item span:not(.nav-icon) { display: none; }
  .stats-row, .poetry-grid, .badge-grid, .math-grid, .math-layout, .english-layout, .course-layout, .course-browser, .sync-summary, .sync-grid, .sync-link-grid, .repo-summary, .repo-grid, .profile-grid, .sync-meta, .word-grid, .flashcard-grid, .report-grid, .report-grid.parent-summary-grid, .dashboard-grid, .subject-mastery-grid, .parent-dashboard-grid { grid-template-columns: 1fr; }
  .char-grid { grid-template-columns: repeat(3, 1fr); }
  .theme-grid { grid-template-columns: 1fr; }
  .garden-scene { grid-template-columns: repeat(3, 1fr); }
  .main-header { padding: 14px 16px; }
  .page-content { padding: 16px; }
  .student-strip, .version-strip, .math-lesson-header, .course-detail-head, .sync-source-card, .sync-card-head, .practice-answer-row, .wrongbook-toolbar, .mastery-row, .dashboard-hero, .weak-row, .growth-row, .exam-head, .lesson-complete, .parent-hero, .parent-list-row, .review-reminder { align-items: stretch; flex-direction: column; }
  .trend-chart { overflow-x: auto; }
}

@media (pointer: coarse) {
  .primary-btn, .secondary-btn, .buy-btn, .expand-btn, .chinese-tab,
  .flashcard-actions button, .exam-actions button {
    min-height: 44px;
  }
  .nav-item {
    min-height: 48px;
  }
  .profile-card input, .profile-card textarea, .practice-card input,
  .exam-question input {
    font-size: 16px;
    min-height: 46px;
  }
  .task-item {
    min-height: 72px;
  }
  .char-cell {
    min-height: 72px;
  }
  .poem-card:hover, .math-card:hover, .english-unit-card:hover,
  .char-cell:hover, .badge-card:hover {
    transform: none;
  }
}

@media (min-width: 700px) and (max-width: 1180px) {
  body {
    align-items: stretch;
  }
  .app-container {
    border-radius: 0;
    height: 100dvh;
    max-width: none;
    min-height: 0;
  }
  .main-content {
    min-height: 0;
  }
  .main-header {
    min-height: 76px;
  }
  .page-content {
    padding: 22px 24px;
  }
  .section-title {
    font-size: 19px;
  }
  .task-name, .math-card .math-title, .english-unit-card strong {
    font-size: 16px;
  }
  .task-desc, .math-card .math-desc, .english-unit-card span,
  .weak-row span, .growth-row span {
    font-size: 13px;
    line-height: 1.6;
  }
  .stat-card, .report-card, .subject-mastery-card {
    min-height: 112px;
  }
}

@media (min-width: 901px) and (max-width: 1180px) and (orientation: landscape) {
  :root {
    --sidebar-width: 190px;
  }
  .sidebar {
    padding: 16px 0;
  }
  .sidebar-header {
    padding-bottom: 14px;
  }
  .sidebar-logo {
    height: 48px;
    width: 48px;
  }
  .nav-item {
    font-size: 13px;
    padding: 10px 12px;
  }
  .main-header {
    padding: 16px 24px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(290px, 0.8fr);
  }
  .math-layout, .english-layout {
    grid-template-columns: minmax(250px, 0.8fr) minmax(0, 1.4fr);
  }
}

@media (min-width: 700px) and (max-width: 900px) and (orientation: portrait) {
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    flex: 0 0 auto;
    min-height: 64px;
    padding: max(8px, env(safe-area-inset-top)) 10px 8px;
  }
  .sidebar-nav {
    gap: 6px;
  }
  .nav-item {
    height: 48px;
    justify-content: center;
    min-width: 48px;
    padding: 8px 12px;
  }
  .nav-icon {
    font-size: 20px;
  }
  .main-header {
    padding: 16px 24px;
  }
  .header-left h1 {
    font-size: 22px;
  }
  .stats-row, .stats-mini, .report-grid,
  .report-grid.parent-summary-grid, .subject-mastery-grid,
  .math-grid, .word-grid, .flashcard-grid, .sync-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-grid, .parent-dashboard-grid,
  .math-layout, .english-layout {
    grid-template-columns: 1fr;
  }
  .char-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .garden-scene {
    grid-template-columns: repeat(5, 1fr);
  }
}
