/* ═══════════════════════════════════════════════════
   刀客学院 - 统一门户样式
   风格：简洁温暖、大字体（适合大班小朋友）
   ═══════════════════════════════════════════════════ */

:root {
  --warm-bg: #FFF8F0;
  --card-bg: #FFFFFF;
  --primary: #FF8C42;
  --primary-light: #FFB680;
  --primary-dark: #E6731C;
  --accent-green: #6BCB77;
  --accent-blue: #4D96FF;
  --accent-purple: #B983FF;
  --text-main: #3D2C1E;
  --text-light: #8B7355;
  --text-white: #FFFFFF;
  --border: #F0E0D0;
  --shadow: 0 4px 16px rgba(255, 140, 66, 0.12);
  --shadow-hover: 0 8px 28px rgba(255, 140, 66, 0.22);
  --radius: 20px;
  --radius-sm: 12px;
}

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

body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--warm-bg);
  color: var(--text-main);
  font-size: 18px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── 导航栏 ──────────────────────────────────────── */
.navbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(230, 115, 28, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-brand .logo {
  font-size: 36px;
}

.navbar-links {
  display: flex;
  gap: 8px;
}

.navbar-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 30px;
  transition: all 0.25s;
}

.navbar-links a:hover,
.navbar-links a.active {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ── 通用容器 ────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-main);
}

.page-subtitle {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 32px;
}

/* ── 门户首页卡片网格 ─────────────────────────────── */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 24px;
}

.portal-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  border: 3px solid transparent;
  text-decoration: none;
  color: inherit;
  display: block;
}

.portal-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

.portal-card .card-icon {
  font-size: 72px;
  margin-bottom: 16px;
  display: block;
}

.portal-card .card-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
}

.portal-card .card-desc {
  font-size: 16px;
  color: var(--text-light);
}

.portal-card.card-english { border-top: 6px solid var(--accent-blue); }
.portal-card.card-tracker { border-top: 6px solid var(--accent-green); }
.portal-card.card-football { border-top: 6px solid var(--primary); }

/* ── 今日任务卡片 ─────────────────────────────────── */
.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.task-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  position: relative;
  overflow: hidden;
}

.task-card:hover {
  transform: translateY(-3px);
}

.task-card .subject-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.subject-tag.tag-英语 { background: #E8F0FF; color: var(--accent-blue); }
.subject-tag.tag-语文 { background: #FFF0E8; color: var(--primary); }
.subject-tag.tag-数学 { background: #E8FFF0; color: var(--accent-green); }
.subject-tag.tag-足球 { background: #F5E8FF; color: var(--accent-purple); }

.task-card .task-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}

.task-card .task-desc {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.task-card .checkin-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  padding: 10px 0;
}

.checkin-status.done { color: var(--accent-green); }
.checkin-status.pending { color: var(--text-light); }

.checkin-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.checkin-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(255, 140, 66, 0.4);
}

.checkin-btn.done-btn {
  background: linear-gradient(135deg, #6BCB77, #4CAF50);
}

.checkin-btn.done-btn:hover {
  box-shadow: 0 4px 12px rgba(107, 203, 119, 0.4);
}

/* ── 进度条 ──────────────────────────────────────── */
.progress-section {
  margin-top: 16px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
}

.progress-bar {
  height: 14px;
  background: #F5EDE3;
  border-radius: 7px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 7px;
  transition: width 0.5s ease;
}

.progress-fill.complete {
  background: linear-gradient(90deg, var(--accent-green), #8EE99B);
}

/* ── 里程碑 ──────────────────────────────────────── */
.milestones {
  margin-top: 12px;
}

.milestone {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  padding: 6px 0;
  cursor: pointer;
}

.milestone .checkbox {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.milestone.done .checkbox {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.milestone.done .checkbox::after {
  content: '✓';
  color: white;
  font-size: 16px;
  font-weight: 800;
}

.milestone.done .milestone-text {
  text-decoration: line-through;
  color: var(--text-light);
}

.milestone-text {
  flex: 1;
}

/* ── 打卡弹窗 ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(61, 44, 30, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 36px 32px;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.modal .modal-subtitle {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 24px;
}

.attitude-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.attitude-option {
  border: 3px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 17px;
  font-weight: 600;
}

.attitude-option:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.attitude-option.selected {
  border-color: var(--primary);
  background: #FFF5EC;
}

.attitude-option .emoji {
  font-size: 40px;
  display: block;
  margin-bottom: 6px;
}

.modal textarea {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 20px;
}

.modal textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.btn-primary:hover { transform: scale(1.02); }

.btn-secondary {
  background: #F5EDE3;
  color: var(--text-light);
}

.btn-secondary:hover { background: #EDE0D0; }

/* ── 态度趋势 ────────────────────────────────────── */
.trend-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.trend-section h3 {
  font-size: 22px;
  margin-bottom: 20px;
}

.trend-chart {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.trend-day {
  text-align: center;
  flex: 1;
  min-width: 70px;
}

.trend-day .trend-emoji {
  font-size: 36px;
  display: block;
  margin-bottom: 4px;
}

.trend-day .trend-date {
  font-size: 14px;
  color: var(--text-light);
}

.trend-day .trend-weekday {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ── Review 记录 ──────────────────────────────────── */
.review-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.review-section h3 {
  font-size: 22px;
  margin-bottom: 20px;
}

.review-item {
  border-left: 4px solid var(--primary);
  padding: 12px 0 12px 20px;
  margin-bottom: 16px;
}

.review-item:last-child { margin-bottom: 0; }

.review-date {
  font-size: 15px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 4px;
}

.review-summary {
  font-size: 17px;
  line-height: 1.6;
}

/* ── 总进度概览 ───────────────────────────────────── */
.overview-bar {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.overview-bar .overview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.overview-bar .overview-label {
  font-size: 20px;
  font-weight: 700;
}

.overview-bar .overview-percent {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.overview-bar .progress-bar {
  height: 18px;
}

/* ── 足球文章 ────────────────────────────────────── */
.football-article {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  max-width: 800px;
  margin: 0 auto;
}

.football-article h1 { font-size: 30px; margin-bottom: 20px; }
.football-article h2 { font-size: 24px; margin: 24px 0 12px; }
.football-article h3 { font-size: 20px; margin: 20px 0 10px; }
.football-article p { font-size: 17px; margin-bottom: 12px; line-height: 1.8; }
.football-article ul, .football-article ol { padding-left: 24px; margin-bottom: 12px; }
.football-article li { margin-bottom: 6px; }
.football-article code {
  background: #F5EDE3;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 15px;
}
.football-article blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 16px;
  margin: 16px 0;
  color: var(--text-light);
}

/* ── 欢迎区 ──────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, #FFB680 0%, #FF8C42 100%);
  border-radius: var(--radius);
  padding: 40px 36px;
  margin-bottom: 32px;
  color: white;
  box-shadow: var(--shadow);
}

.welcome-banner h1 {
  font-size: 36px;
  margin-bottom: 8px;
}

.welcome-banner p {
  font-size: 20px;
  opacity: 0.9;
}

/* ── 响应式 ──────────────────────────────────────── */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .navbar { padding: 12px 16px; flex-direction: column; gap: 10px; }
  .navbar-brand { font-size: 22px; }
  .navbar-links a { font-size: 15px; padding: 6px 14px; }
  .container { padding: 20px 16px; }
  .page-title { font-size: 26px; }
  .portal-card .card-icon { font-size: 56px; }
  .portal-card .card-title { font-size: 22px; }
  .task-grid { grid-template-columns: 1fr; }
  .attitude-grid { grid-template-columns: repeat(2, 1fr); }
  .trend-day .trend-emoji { font-size: 28px; }
}

/* ── 验证码门禁 ───────────────────────────────────── */
.gate-overlay {
  position: fixed;
  inset: 0;
  background: var(--warm-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}
.gate-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.gate-box {
  background: var(--card-bg);
  border-radius: 24px;
  box-shadow: var(--shadow-hover);
  padding: 48px 40px;
  text-align: center;
  max-width: 360px;
  width: 90%;
}
.gate-box .gate-icon {
  font-size: 56px;
  margin-bottom: 16px;
}
.gate-box .gate-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}
.gate-box .gate-subtitle {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 28px;
}
.gate-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 24px;
  text-align: center;
  letter-spacing: 8px;
  border: 2px solid var(--border);
  border-radius: 16px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.gate-input:focus {
  border-color: var(--primary);
}
.gate-input.gate-error {
  border-color: #E74C3C;
  animation: shake 0.4s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
.gate-btn {
  width: 100%;
  padding: 16px;
  margin-top: 20px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-white);
  background: var(--primary);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.gate-btn:active {
  transform: scale(0.97);
}
.gate-btn:hover {
  background: var(--primary-dark);
}

/* ═══════════════════════════════════════════════════
   学习追踪台 - 新增样式
   ═══════════════════════════════════════════════════ */

/* ── 打卡两步流程 ────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F0E0D0;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  transition: all 0.2s;
}

.step-dot.active {
  background: var(--primary);
  color: white;
}

.step-line {
  width: 40px;
  height: 3px;
  background: #F0E0D0;
  border-radius: 2px;
}

.milestone-checklist {
  margin-bottom: 20px;
}

.ms-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
}

.ms-check-item:hover {
  border-color: var(--primary-light);
  background: #FFFBF6;
}

.ms-check-item.already-done {
  opacity: 0.65;
}

.ms-check-box {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 3px solid var(--primary-light);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ms-check-box.checked {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.ms-check-box.checked::after {
  content: '✓';
  color: white;
  font-size: 18px;
  font-weight: 800;
}

.ms-check-text {
  flex: 1;
  font-weight: 600;
}

.ms-done-tag {
  font-size: 13px;
  color: var(--accent-green);
  font-weight: 700;
  background: #E8FFF0;
  padding: 2px 10px;
  border-radius: 12px;
}

.modal-actions-3 {
  gap: 8px;
}

.btn-no-progress {
  background: #F5EDE3;
  color: var(--text-light);
  flex: 1.3;
}

.btn-no-progress:hover {
  background: #EDE0D0;
  color: var(--primary-dark);
}

/* ── 学习进度趋势柱状图 ──────────────────────────── */
.progress-trend-chart {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.progress-trend-day {
  text-align: center;
  flex: 1;
  min-width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.progress-trend-bar-wrap {
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  margin-bottom: 6px;
}

.progress-trend-bar {
  width: 60%;
  max-width: 48px;
  min-height: 4px;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
  transition: height 0.5s ease;
}

.progress-trend-bar.empty {
  background: #F0E0D0;
}

.progress-trend-count {
  font-size: 16px;
  font-weight: 800;
  color: white;
}

.progress-trend-date {
  font-size: 14px;
  color: var(--text-light);
}

.progress-trend-weekday {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ── Review 头部 + 视图切换 ──────────────────────── */
.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.review-header h3 {
  margin-bottom: 0;
}

.review-tabs {
  display: flex;
  gap: 4px;
  background: #F5EDE3;
  border-radius: 30px;
  padding: 4px;
}

.review-tab {
  padding: 8px 20px;
  border: none;
  background: transparent;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}

.review-tab:hover {
  color: var(--text-main);
}

.review-tab.active {
  background: var(--primary);
  color: white;
}

/* ── Review 四维度展示 ───────────────────────────── */
.review-dims {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.review-dim {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  line-height: 1.5;
}

.review-dim.dim-good {
  background: #E8FFF0;
  border-left: 4px solid var(--accent-green);
}

.review-dim.dim-warn {
  background: #FFF4E8;
  border-left: 4px solid var(--primary);
}

.dim-icon {
  margin-right: 4px;
}

.dim-label {
  font-weight: 700;
  color: var(--text-main);
  margin-right: 6px;
}

.dim-text {
  color: var(--text-main);
}

/* ── Review 表单 ────────────────────────────────── */
.review-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.form-row textarea,
.form-row select {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  background: var(--card-bg);
  color: var(--text-main);
}

.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row select {
  min-height: auto;
  cursor: pointer;
}

#reviewSubmit {
  align-self: flex-start;
  min-width: 180px;
  flex: 0 0 auto;
}

/* ── 响应式补充 ──────────────────────────────────── */
@media (max-width: 768px) {
  .review-dims { grid-template-columns: 1fr; }
  .modal-actions-3 { flex-direction: column; gap: 10px; }
  .modal-actions-3 .btn { width: 100%; }
  .progress-trend-bar-wrap { height: 90px; }
  .review-header { flex-direction: column; align-items: flex-start; }
}

/* ── 页内打卡（无弹窗）────────────────────── */
.inline-checkin-card { display: flex; flex-direction: column; gap: 12px; }
.task-card-header { display: flex; justify-content: space-between; align-items: center; }
.checkin-status-inline { font-size: 14px; font-weight: 600; padding: 4px 10px; border-radius: 8px; }
.checkin-status-inline.done { background: #6BCB7722; color: #4a9d54; }
.checkin-status-inline.pending { background: #FF8C4222; color: #E6731C; }

.inline-section { display: flex; flex-direction: column; gap: 8px; }
.inline-section-label { font-size: 14px; font-weight: 700; color: var(--text-light); }
.inline-milestones { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-milestone {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px;
  border: 2px solid var(--border); border-radius: 12px; cursor: pointer;
  transition: all 0.2s; background: var(--card-bg); font-size: 15px;
}
.inline-milestone:hover { border-color: var(--primary-light); }
.inline-milestone.already-done { opacity: 0.7; }

.math-module-section { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px dashed #e0d6c5; }
.math-module-section:last-child { border-bottom: none; }
.math-module-title { font-size: 18px; font-weight: bold; color: #8B5E3C; margin: 16px 0 8px; padding: 4px 0 4px 12px; border-left: 4px solid #f5a623; }
.math-module-history-hint { font-size: 12px; color: #999; text-align: right; margin-top: 6px; }
.inline-ms-box {
  width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  color: var(--text-white); transition: all 0.2s;
}
.inline-ms-box.checked { background: var(--accent-green); border-color: var(--accent-green); }
.inline-ms-text { color: var(--text-main); }
.inline-ms-tag { font-size: 12px; color: var(--accent-green); font-weight: 600; }

.inline-no-progress-btn {
  padding: 8px 16px; border: 2px dashed var(--border); border-radius: 12px;
  background: transparent; color: var(--text-light); font-size: 14px;
  cursor: pointer; transition: all 0.2s; align-self: flex-start;
}
.inline-no-progress-btn:hover { border-color: var(--primary); color: var(--primary); }
.inline-no-progress-btn.active { border-style: solid; border-color: var(--primary); background: var(--primary); color: var(--text-white); }

.inline-attitudes { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-attitude {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  border: 2px solid var(--border); border-radius: 12px; cursor: pointer;
  transition: all 0.2s; background: var(--card-bg);
}
.inline-attitude:hover { border-color: var(--primary-light); }
.inline-attitude.selected { transform: scale(1.05); }
.inline-att-emoji { font-size: 20px; }
.inline-att-label { font-size: 14px; font-weight: 600; color: var(--text-main); }

.inline-submit-btn {
  padding: 14px; border: none; border-radius: 14px; font-size: 18px; font-weight: 700;
  background: var(--primary); color: var(--text-white); cursor: pointer; transition: all 0.2s;
}
.inline-submit-btn:hover:not(.disabled) { background: var(--primary-dark); transform: translateY(-1px); }
.inline-submit-btn:active:not(.disabled) { transform: scale(0.98); }
.inline-submit-btn.disabled { background: var(--border); color: var(--text-light); cursor: not-allowed; }

.review-dim { padding: 10px 14px; border-radius: 10px; font-size: 15px; margin-bottom: 8px; }
.review-dim.dim-good { background: #6BCB7718; color: #3a7d42; }
.review-dim.dim-warn { background: #FF8C4218; color: #b5601a; }

/* ═══════════════════════════════════════════════════
   启发式学数学 - 样式
   配色：做得好=绿色，需提升=橙色，建议=蓝色，原理=灰色
   ═══════════════════════════════════════════════════ */

/* ── 区块标题 ──────────────────────────────────────── */
.math-section-title {
  font-size: 24px;
  font-weight: 800;
  margin: 36px 0 16px;
  color: var(--text-main);
}

/* 首页卡片：启发式学数学 */
.portal-card.card-math { border-top: 6px solid #FFC857; }

/* ── 周总结横幅 ────────────────────────────────────── */
.math-weekly-banner {
  background: linear-gradient(135deg, #FFE8B0 0%, #FFD080 100%);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}
.math-weekly-label {
  font-size: 18px;
  font-weight: 800;
  color: #8a5a10;
  margin-bottom: 8px;
}
.math-weekly-text {
  font-size: 20px;
  line-height: 1.7;
  color: #5a3a08;
  font-weight: 600;
}

/* ── 最新 session 卡片 ─────────────────────────────── */
.math-session-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  border-top: 6px solid var(--primary);
}
.math-session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.math-session-date {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
}
.math-kp-tag {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 700;
  background: #E8FFF0;
  color: var(--accent-green);
}
.math-session-topic {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.4;
}
.math-session-summary {
  font-size: 17px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: #FFFBF6;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary-light);
}

/* ── 方法标签 ──────────────────────────────────────── */
.math-methods { margin-bottom: 20px; }
.math-method-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.math-method-tag {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
  background: #FFF5EC;
  color: var(--primary-dark);
  border: 2px solid var(--primary-light);
}

/* ── 区块（做得好 / 需提升 / 建议 / 原理）────────── */
.math-section {
  margin-bottom: 22px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
}
.math-section-label {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
}
.math-section-good {
  border-left: 5px solid var(--accent-green);
  background: #F4FFF6;
}
.math-section-improve {
  border-left: 5px solid var(--primary);
  background: #FFF8F0;
}
.math-section-suggestion {
  border-left: 5px solid var(--accent-blue);
  background: #F4F8FF;
}
.math-section-principle {
  border-left: 5px solid var(--text-light);
  background: #F5F2EE;
}

/* ── 条目卡片 ──────────────────────────────────────── */
.math-item-list { display: flex; flex-direction: column; gap: 10px; }
.math-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 16px;
  line-height: 1.6;
  transition: transform 0.15s;
}
.math-item:hover { transform: translateY(-1px); }
.math-item-good { border: 2px solid #9ED9A6; }
.math-item-improve { border: 2px solid var(--primary-light); }
.math-item-suggestion { border: 2px solid #9EC4FF; }

.math-item-icon { margin-right: 6px; flex-shrink: 0; }
.math-item-text { color: var(--text-main); }

/* 可展开条目 */
.math-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.math-item-preview {
  flex: 1;
  color: var(--text-main);
}
.math-item-toggle {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.math-item-full {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  color: var(--text-main);
  line-height: 1.7;
}
.math-item.expanded .math-item-full { display: block; }
.math-item.expanded .math-item-preview { display: none; }

/* ── 背后原理（默认折叠，长文小字）────────────────── */
.math-principle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.math-principle-toggle {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
}
.math-principle-body {
  display: none;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-light);
  white-space: pre-wrap;
}
.math-section-principle.open .math-principle-body { display: block; }

/* ── 历史记录列表 ──────────────────────────────────── */
.math-history-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
  border-left: 5px solid var(--primary-light);
  transition: border-color 0.2s;
}
.math-history-item.open { border-left-color: var(--primary); }
.math-history-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  cursor: pointer;
}
.math-history-head:hover { background: #FFFBF6; }
.math-history-date {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
}
.math-history-topic {
  flex: 1;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-main);
}
.math-history-toggle {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.math-history-body {
  padding: 0 24px 24px;
}

/* ── 周总结列表 ────────────────────────────────────── */
.math-weekly-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  border-left: 4px solid #FFD080;
}
.math-weekly-week {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 6px;
}
.math-weekly-summary {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-main);
}

/* ── 空状态 ────────────────────────────────────────── */
.math-empty {
  color: var(--text-light);
  font-size: 15px;
}

/* ── 响应式 ────────────────────────────────────────── */
@media (max-width: 768px) {
  .math-session-card { padding: 20px; }
  .math-session-topic { font-size: 22px; }
  .math-section { padding: 14px; }
  .math-section-label { font-size: 16px; }
  .math-weekly-banner { padding: 20px; }
  .math-weekly-text { font-size: 17px; }
  .math-history-head { flex-wrap: wrap; padding: 16px; }
}

