/* ===== Coze Studio 风格主题 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6c5ce7;
  --primary-light: #a29bfe;
  --primary-bg: rgba(108,92,231,.08);
  --accent: #4ecdc4;
  --accent-bg: rgba(78,205,196,.08);
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f5f6f8;
  --card-bg: #ffffff;
  --card-border: #e8ecf1;
  --text: #1a1a2e;
  --text-light: #4a4a6a;
  --text-muted: #9ca3af;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.1), 0 2px 4px rgba(0,0,0,.06);
  --shadow-card: 0 1px 3px rgba(0,0,0,.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== 页面切换 ===== */
.page { display: none !important; }
.page.active { display: block !important; }
#page-auth.active { display: flex !important; }
.view { display: none; }
.view.active { display: block; }

/* ==================== 登录页 ==================== */
#page-auth {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  background: linear-gradient(135deg, #f8f5ff 0%, #f0fdfa 50%, #f5f6f8 100%);
}

/* 装饰背景圆 */
#page-auth::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(108,92,231,.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
#page-auth::after {
  content: '';
  position: absolute;
  bottom: -150px; left: -150px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(78,205,196,.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-container {
  position: relative;
  z-index: 20;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 90%;
  max-width: 440px;
  box-shadow: var(--shadow-hover);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}
.auth-header h1 {
  font-size: 26px;
  color: var(--text);
  font-weight: 800;
}
.auth-header p {
  color: var(--text-light);
  font-size: 14px;
  margin-top: 8px;
}

.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  background: var(--bg);
  border-radius: 12px;
  padding: 4px;
}
.auth-tab {
  flex: 1; padding: 10px; border: none; background: none; cursor: pointer;
  font-size: 15px; color: var(--text-light); border-radius: 10px;
  transition: all .25s; font-weight: 500;
}
.auth-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(108,92,231,.25);
}

.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }
.auth-form input {
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 15px; color: var(--text);
  outline: none; transition: all .25s;
}
.auth-form input::placeholder { color: var(--text-muted); }
.auth-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,92,231,.1);
}

/* ===== 通用按钮 ===== */
.btn-primary {
  padding: 14px 28px;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: all .25s;
  letter-spacing: 1px;
}
.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(108,92,231,.3);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  background: #d1d5db; color: #9ca3af;
  cursor: not-allowed; box-shadow: none; transform: none;
}
.btn-large { padding: 18px 36px; font-size: 18px; width: 100%; }
.btn-sm {
  padding: 7px 16px; font-size: 13px;
  background: var(--bg); color: var(--text-light);
  border: 1px solid var(--card-border); border-radius: 8px; cursor: pointer;
  transition: all .25s;
}
.btn-sm:hover { background: #e5e7eb; color: var(--text); }
.btn-danger {
  padding: 8px 16px; background: #fef2f2;
  color: var(--danger); border: 1px solid #fecaca;
  border-radius: 8px; cursor: pointer; font-size: 13px; transition: all .25s;
}
.btn-danger:hover { background: #fee2e2; }
.btn-outline {
  padding: 8px 16px; background: transparent;
  color: var(--primary); border: 1px solid rgba(108,92,231,.3);
  border-radius: 8px; cursor: pointer; font-size: 13px; transition: all .25s;
}
.btn-outline:hover { background: var(--primary-bg); }
.error-msg { color: var(--danger); font-size: 14px; margin-top: 12px; text-align: center; min-height: 20px; }

/* ==================== 侧边栏 ==================== */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 220px;
  background: #ffffff;
  border-right: 1px solid var(--card-border);
  display: flex; flex-direction: column;
  z-index: 100; padding: 24px 0;
  box-shadow: 1px 0 4px rgba(0,0,0,.03);
  overflow-y: auto;
}
.sidebar-brand {
  font-size: 16px; font-weight: 700;
  color: var(--primary);
  padding: 0 20px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  display: inline-block;
  animation: brand-pulse 2s ease-in-out infinite;
}
@keyframes brand-pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* 欢迎语 */
.sidebar-welcome {
  padding: 0 20px; margin-bottom: 12px;
  font-size: 13px; color: var(--text-light); font-weight: 500;
  min-height: 18px;
}

/* 日期倒计时卡片 */
.sidebar-date-block {
  margin: 0 14px 18px;
  padding: 16px 14px;
  background: linear-gradient(135deg, rgba(108,92,231,.04), rgba(78,205,196,.06));
  border: 1px solid rgba(108,92,231,.08);
  border-radius: var(--radius);
  text-align: center;
}
.sidebar-date {
  font-size: 18px; font-weight: 700; color: var(--text);
}
.sidebar-countdown-label {
  font-size: 11px; color: var(--text-muted); margin-top: 6px;
}
.sidebar-countdown-days {
  font-size: 30px; font-weight: 800;
  background: linear-gradient(135deg, #6c5ce7, #4ecdc4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.sidebar-countdown-unit {
  font-size: 12px; color: var(--text-muted);
}

/* 导航 */
.sidebar-nav {
  display: flex; flex-direction: column; gap: 2px;
  padding: 0 10px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; text-decoration: none;
  color: var(--text-light); border-radius: 10px;
  font-size: 14px; font-weight: 500;
  transition: all .2s;
}
.sidebar-link:hover {
  background: rgba(108,92,231,.06); color: var(--primary);
}
.sidebar-link.active-nav {
  background: var(--primary-bg); color: var(--primary); font-weight: 600;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

/* 侧边栏学习统计 */
.sidebar-stats {
  padding: 14px 14px 10px; margin-top: auto;
}
.sidebar-stats-title {
  font-size: 11px; color: var(--text-muted); font-weight: 600;
  text-align: center; margin-bottom: 8px;
  letter-spacing: 1px;
}
.sidebar-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.sidebar-stat-item {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 8px; padding: 12px 8px; text-align: center;
  transition: all .2s;
}
.sidebar-stat-item:hover {
  border-color: var(--primary-light);
}
.sidebar-stat-num {
  display: block; font-size: 20px; font-weight: 700;
  color: var(--primary);
}
.sidebar-stat-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* 用户区 */
.sidebar-user {
  padding: 14px 18px; border-top: 1px solid var(--card-border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-muted);
}

/* 主内容区 */
.main-content {
  margin-left: 220px;
  min-height: 100vh;
  background: var(--bg);
}

/* ==================== 通用卡片 ==================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.card h2 {
  font-size: 18px; color: var(--text); font-weight: 700;
  margin-bottom: 20px;
}
.card h2::before {
  content: '';
  display: inline-block;
  width: 4px; height: 18px;
  background: var(--primary);
  border-radius: 2px;
  margin-right: 10px;
  vertical-align: middle;
  margin-top: -2px;
}

/* ==================== 仪表盘 ==================== */
.dashboard-grid {
  display: grid; grid-template-columns: 1fr; gap: 20px;
  padding: 24px; max-width: 1100px; margin: 0 auto;
}
.today-card { }
.stats-card { }

/* 每日激励 — 背景图模式 */
.daily-motivation {
  margin-bottom: 24px;
  position: relative;
}
.daily-motivation.has-bg {
  min-height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.motivation-overlay {
  width: 100%;
  height: 100%;
  padding: 32px 28px;
  background: rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: var(--radius);
}
.motivation-label {
  font-size: 11px;
  color: rgba(255,255,255,.7);
  letter-spacing: 4px;
  margin-bottom: 12px;
  font-weight: 500;
}
.motivation-quote {
  font-size: 16px;
  color: #fff;
  font-weight: 600;
  line-height: 1.8;
  margin: 0 0 14px;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
  max-width: 500px;
}
.motivation-footer {
  font-size: 11px;
  color: rgba(255,255,255,.55);
}

/* 两列复习计划布局 */
.plan-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.plan-col-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.plan-col-card.empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px; color: var(--text-muted);
}
.plan-col-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--card-border);
}
.plan-col-topic {
  font-size: 16px; font-weight: 700; color: var(--text);
}

/* 层次感卡片 */
.plan-hierarchy { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 20px; }
.plan-section {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: all .25s;
}
.plan-section.key-points {
  background: rgba(108,92,231,.04);
  border: 1px solid rgba(108,92,231,.1);
  border-left: 3px solid var(--primary);
}
.plan-section.common-mistakes {
  background: rgba(245,158,11,.05);
  border: 1px solid rgba(245,158,11,.12);
  border-left: 3px solid var(--warning);
}
.plan-section.summary {
  background: rgba(78,205,196,.04);
  border: 1px solid rgba(78,205,196,.1);
  border-left: 3px solid var(--accent);
}
.plan-section:hover {
  transform: translateX(3px);
  box-shadow: var(--shadow-hover);
}
.plan-section-icon {
  font-size: 15px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; flex-shrink: 0; margin-top: 2px;
}
.key-points .plan-section-icon { background: var(--primary-bg); color: var(--primary); }
.common-mistakes .plan-section-icon { background: rgba(245,158,11,.12); color: var(--warning); }
.summary .plan-section-icon { background: var(--accent-bg); color: var(--accent); }
.plan-section-body { flex: 1; }
.plan-section-body strong {
  display: block; font-size: 13px; color: var(--text); margin-bottom: 4px;
}
.plan-section-body p {
  font-size: 13px; color: var(--text-light); line-height: 1.8; margin: 0;
}

/* 科目徽章 */
.subject-badge {
  font-size: 11px; padding: 3px 10px; border-radius: 20px; color: #fff;
  font-weight: 600; letter-spacing: 1px;
}
.badge-chinese {
  background: linear-gradient(135deg, #f97316, #ef4444);
}
.badge-math {
  background: linear-gradient(135deg, #818cf8, #6366f1);
}

/* 考试入口 */
.day-selector { display: flex; flex-direction: column; gap: 14px; }
.locked-day-info {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: rgba(245,158,11,.06);
  border: 1px solid rgba(245,158,11,.15);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-light);
}
.locked-day-icon { font-size: 18px; }
.locked-day-info strong { color: var(--primary); font-size: 14px; }

/* ==================== 学习计划页 ==================== */
#view-study-plan, #view-history, #view-error-book, #view-result {
  padding: 24px; max-width: 1100px; margin: 0 auto;
}
.plan-header h2 { margin-bottom: 18px; color: var(--text); font-size: 20px; }
.day-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.day-tab {
  width: 40px; height: 40px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-light);
  cursor: pointer; transition: all .2s;
}
.day-tab:hover {
  border-color: var(--primary); color: var(--primary);
}
.day-tab.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.day-tab.completed { border-color: var(--success); color: var(--success); }
.day-tab.future { border-style: dashed; opacity: .6; }

/* ==================== 考试页 ==================== */
.exam-header {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 16px 24px;
  box-shadow: var(--shadow-card);
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 14px;
  margin-bottom: 20px;
  position: sticky; top: 0; z-index: 50;
}
.exam-info { display: flex; align-items: center; gap: 18px; }
#exam-day-label { font-size: 15px; color: var(--text-light); font-weight: 500; }
.exam-timer {
  font-size: 30px; font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 100px;
}
.exam-timer.warning { color: var(--warning); animation: pulse .8s infinite; }
.exam-timer.danger { color: var(--danger); animation: pulse .4s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.exam-progress { display: flex; gap: 18px; font-size: 13px; color: var(--text-light); }
.exam-progress b { color: var(--primary); }

.question-list { display: flex; flex-direction: column; gap: 16px; }
.question-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px 28px;
  box-shadow: var(--shadow-card);
  border-left: 4px solid transparent;
  transition: all .25s;
}
.question-card:hover { border-left-color: var(--primary); box-shadow: var(--shadow-hover); }
.question-card.answered { border-left-color: var(--success); }
.question-card .q-header {
  display: flex; justify-content: space-between; margin-bottom: 14px;
  font-size: 12px; color: var(--text-muted);
}
.question-card .q-text {
  font-size: 15px; margin-bottom: 16px; line-height: 1.9; color: var(--text); white-space: pre-line;
}
.question-card .q-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-option {
  padding: 16px 20px;
  background: var(--bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 16px; color: var(--text-light);
  transition: all .2s; user-select: none;
  display: flex; align-items: center; gap: 12px;
}
.q-opt-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(0,0,0,.04);
  font-weight: 700; font-size: 15px;
  flex-shrink: 0;
  transition: all .2s;
}
.q-option:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.q-option:hover .q-opt-letter {
  background: rgba(108,92,231,.12); color: var(--primary);
}
.q-option.selected {
  border-color: var(--primary);
  background: rgba(108,92,231,.1);
  color: var(--text); font-weight: 600;
}
.q-option.selected .q-opt-letter {
  background: var(--primary); color: #fff;
}

/* ==================== 成绩页 ==================== */
.result-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.result-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 22px;
  text-align: center; box-shadow: var(--shadow-card);
  transition: all .25s;
}
.result-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.result-item .r-num { font-size: 36px; font-weight: 800; }
.result-item .r-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.r-chinese .r-num { color: #f97316; }
.r-math .r-num { color: #6366f1; }
.r-total .r-num { color: var(--primary); }

.result-evaluation {
  background: var(--primary-bg);
  border: 1px solid rgba(108,92,231,.12);
  border-radius: var(--radius); padding: 20px 24px;
  margin-bottom: 24px;
  font-size: 14px; line-height: 2; color: var(--text-light);
}
.result-evaluation strong { color: var(--primary); }

.result-answers { display: flex; flex-direction: column; gap: 12px; }
.result-q {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm); padding: 18px 22px;
  box-shadow: var(--shadow-card);
  border-left: 4px solid var(--success);
}
.result-q.wrong { border-left-color: var(--danger); }
.result-q .rq-header { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.result-q .rq-text { font-size: 14px; color: var(--text); margin-bottom: 12px; white-space: pre-line; }
.result-q .rq-user-answer { font-size: 13px; margin-bottom: 6px; }
.result-q .rq-correct-answer { font-size: 13px; color: var(--success); font-weight: 600; }
.result-q .rq-explanation {
  margin-top: 10px; padding: 12px 16px;
  background: rgba(245,158,11,.06);
  border: 1px solid rgba(245,158,11,.15);
  border-radius: 8px;
  font-size: 13px; color: var(--text-light); line-height: 1.8;
}

/* ==================== 历史记录页 ==================== */
.history-table {
  width: 100%; border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--card-border);
}
.history-table th {
  background: var(--bg);
  padding: 14px 16px; text-align: left;
  font-size: 12px; color: var(--text-muted); font-weight: 600;
  border-bottom: 1px solid var(--card-border);
}
.history-table td {
  padding: 14px 16px; font-size: 13px;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-light);
}
.history-table tr:hover td { background: rgba(108,92,231,.03); }

/* ==================== 错题本 ==================== */
.error-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px; margin-bottom: 20px;
}
.error-header h2 { color: var(--text); }
.error-filters { display: flex; gap: 10px; }
.error-filters select {
  padding: 10px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text);
  cursor: pointer; outline: none; transition: all .25s;
}
.error-filters select:focus { border-color: var(--primary); }
.error-filters select option { background: #fff; color: var(--text); }

.error-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 18px 22px;
  box-shadow: var(--shadow-card); margin-bottom: 12px;
  border-left: 4px solid var(--danger);
  transition: all .25s;
}
.error-card.marked { border-left-color: var(--warning); background: rgba(245,158,11,.03); }
.error-card .ec-header {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted); margin-bottom: 10px;
}
.error-card .ec-text { font-size: 14px; color: var(--text); margin-bottom: 10px; }
.error-card .ec-user { color: var(--danger); font-size: 13px; margin-bottom: 4px; }
.error-card .ec-correct { color: var(--success); font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.error-card .ec-explanation {
  margin-top: 10px; padding: 12px;
  background: rgba(245,158,11,.06);
  border: 1px solid rgba(245,158,11,.12);
  border-radius: 8px;
  font-size: 13px; color: var(--text-light); line-height: 1.8;
}
.error-card .ec-actions { display: flex; gap: 10px; margin-top: 12px; }

/* ==================== 动效特效 ==================== */

/* —— 主内容区浮动装饰 —— */
.main-content {
  position: relative;
  overflow: hidden;
}
.main-content::before {
  content: '';
  position: fixed;
  top: -180px; right: -120px;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(108,92,231,.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: float-orb-1 12s ease-in-out infinite;
}
.main-content::after {
  content: '';
  position: fixed;
  bottom: -100px; left: 240px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(78,205,196,.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: float-orb-2 15s ease-in-out infinite;
}
@keyframes float-orb-1 {
  0%,100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(-30px,20px) scale(1.1); }
  66% { transform: translate(10px,-15px) scale(.95); }
}
@keyframes float-orb-2 {
  0%,100% { transform: translate(0,0) scale(1); }
  25% { transform: translate(25px,-18px) scale(1.08); }
  50% { transform: translate(-15px,10px) scale(.92); }
  75% { transform: translate(10px,22px) scale(1.05); }
}

/* —— 仪表盘卡片浮动装饰 —— */
.dashboard-grid {
  position: relative;
}
.dashboard-grid::before {
  content: '';
  position: absolute;
  top: 60px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(245,158,11,.04) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: float-orb-3 10s ease-in-out infinite;
}
@keyframes float-orb-3 {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  50% { transform: translate(-20px,-20px) rotate(10deg); }
}

/* —— 视图淡入动画 —— */
.view.active {
  animation: viewFadeIn .4s ease-out;
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* —— 卡片交错入场 —— */
.card {
  animation: cardSlideUp .45s ease-out both;
}
.today-card { animation-delay: .05s; }
.stats-card { animation-delay: .15s; }
@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* —— 开始答题按钮脉冲 —— */
.btn-large {
  position: relative;
  overflow: hidden;
}
.btn-large:not(:disabled)::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 50%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
  transform: skewX(-20deg);
  animation: btnShimmer 2.5s ease-in-out infinite;
}
@keyframes btnShimmer {
  0% { left: -60%; }
  100% { left: 120%; }
}
.btn-large:not(:disabled) {
  animation: btnPulse 2s ease-in-out infinite;
}
@keyframes btnPulse {
  0%,100% { box-shadow: 0 2px 8px rgba(108,92,231,.2); }
  50% { box-shadow: 0 6px 20px rgba(108,92,231,.35); }
}

/* —— 每日激励卡片光扫 —— */
.daily-motivation.has-bg {
  position: relative;
  overflow: hidden;
}
.daily-motivation.has-bg::before {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  transform: skewX(-15deg);
  animation: shimmerSweep 4s ease-in-out infinite;
  z-index: 2; pointer-events: none;
}
@keyframes shimmerSweep {
  0% { left: -80%; }
  100% { left: 150%; }
}

/* —— 侧边栏导航图标互动 —— */
.sidebar-link .nav-icon {
  transition: transform .25s ease;
}
.sidebar-link:hover .nav-icon {
  transform: scale(1.25) rotate(-8deg);
}
.sidebar-link.active-nav .nav-icon {
  animation: iconBounce .5s ease-out;
}
@keyframes iconBounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  70% { transform: scale(.9); }
  100% { transform: scale(1); }
}

/* —— 答题选项选中弹跳 —— */
.q-option.selected {
  animation: optPop .3s ease-out;
}
@keyframes optPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* —— 题目卡片标记动画 —— */
.question-card.answered {
  animation: cardMarked .35s ease-out;
}
@keyframes cardMarked {
  0% { border-left-color: transparent; }
  50% { border-left-color: var(--accent); }
  100% { border-left-color: var(--success); }
}

/* —— 统计数字脉冲 —— */
.sidebar-stat-num {
  animation: statPop .6s ease-out both;
}

/* —— 成绩数字弹入 —— */
.result-item .r-num {
  animation: scoreBounce .6s cubic-bezier(.34,1.56,.64,1) both;
}
.result-item:nth-child(1) .r-num { animation-delay: .1s; }
.result-item:nth-child(2) .r-num { animation-delay: .2s; }
.result-item:nth-child(3) .r-num { animation-delay: .3s; }
.result-item:nth-child(4) .r-num { animation-delay: .4s; }
.result-item:nth-child(5) .r-num { animation-delay: .5s; }
.result-item:nth-child(6) .r-num { animation-delay: .6s; }
.result-item:nth-child(7) .r-num { animation-delay: .7s; }
@keyframes scoreBounce {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* —— 评语淡入 —— */
.result-evaluation {
  animation: evalFadeIn .5s ease-out .8s both;
}
@keyframes evalFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* —— 登录页容器入场 —— */
.auth-container {
  animation: authSlideUp .5s ease-out;
}
@keyframes authSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* —— 计划卡片悬停 —— */
.plan-col-card {
  transition: transform .3s ease, box-shadow .3s ease;
}
.plan-col-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* —— 错题卡片悬停微动 —— */
.error-card {
  transition: all .3s ease;
}
.error-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-hover);
}

/* —— 历史表格行悬停 —— */
.history-table tbody tr {
  transition: all .2s ease;
}
.history-table tbody tr:hover {
  transform: scale(1.005);
}

/* ==================== 撒花特效 ==================== */
.confetti-container {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9999;
}
.confetti-piece {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 3px;
  animation: confettiFall 3s ease-out forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(-120px) rotate(0deg) scale(1); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg) scale(.3); opacity: 0; }
}


/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
    padding: 16px 0;
  }
  .sidebar-brand { font-size: 0; padding: 0; justify-content: center; }
  .sidebar-brand .brand-dot { width: 10px; height: 10px; }
  .sidebar-welcome { display: none; }
  .sidebar-date-block { display: none; }
  .sidebar-stats { display: none; }
  .sidebar-link { font-size: 0; justify-content: center; padding: 12px; }
  .sidebar-link .nav-icon { font-size: 18px; width: auto; }
  .sidebar-user { flex-direction: column; gap: 8px; padding: 12px 6px; }
  .sidebar-user span { font-size: 0; }
  .sidebar-user .btn-sm { font-size: 10px; padding: 4px 8px; }
  .main-content { margin-left: 60px; }

  .dashboard-grid { padding: 16px; }
  .q-options { grid-template-columns: 1fr; }
  .exam-header { flex-direction: column; align-items: stretch; }
  .exam-info { justify-content: space-between; }
  .auth-container { padding: 32px 24px; }
  .result-summary { grid-template-columns: repeat(2, 1fr); }
  #view-study-plan, #view-history, #view-error-book, #view-result { padding: 16px; }
  .plan-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .sidebar { width: 48px; }
  .main-content { margin-left: 48px; }
  .day-tab { width: 34px; height: 34px; font-size: 11px; }
}
