/* ============================================================
   Helpme · 软考科目页样式
   基调：酷黑 + 蓝紫渐变，与首页 index.html 保持一致
   ============================================================ */

:root {
  --bg: #000000;
  --bg-soft: #0a0a0a;
  --bg-card: #0d0d0f;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent-1: #6366f1;
  --accent-2: #a855f7;
  --radius: 14px;
  --nav-height: 64px;
  --sidebar-width: 280px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ---------- 顶部导航栏（与首页一致） ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}

.navbar.scrolled {
  background: rgba(0, 0, 0, 0.85);
}

.navbar-inner {
  max-width: 1400px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.16);
}

/* ---------- Hero（单导航：全局导航 64px，覆盖 style.css 的 hero 留白） ---------- */
.hero {
  min-height: 72vh;
  padding: calc(var(--nav-height) + 40px) 24px 64px;
}

/* ---------- 科目卡片（后端页 frame-card 增强） ---------- */
.subj-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.subj-card .frame-desc {
  flex: 1;
}

.subj-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.subj-pct {
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subj-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  overflow: hidden;
}

.subj-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.subj-enter {
  align-self: flex-start;
  border: none;
  cursor: pointer;
}

/* ---------- 页面主体布局 ---------- */
.layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 32px) 24px 80px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* ---------- 左侧侧边栏 ---------- */
.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 32px);
  width: var(--sidebar-width);
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 16px 12px;
  max-height: calc(100vh - var(--nav-height) - 64px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  padding: 8px 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

/* 一级菜单（初级/中级/高级） */
.lv-group {
  position: relative;
}

.lv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lv-item .arrow {
  font-size: 12px;
  opacity: 0.6;
  transition: transform 0.25s ease;
}

.lv-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.lv-item:hover .arrow,
.lv-group:hover .lv-item .arrow {
  transform: rotate(90deg);
}

/* 二级下拉菜单：hover 展开（桌面端） */
.lv-sub {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.lv-group:hover .lv-sub,
.lv-group.open .lv-sub {
  display: flex;
}

.sub-link {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: background 0.2s ease, color 0.2s ease;
}

.sub-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.sub-link.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.22));
  color: #fff;
  font-weight: 600;
}

/* ---------- 右侧内容区 ---------- */
.content {
  flex: 1;
  min-width: 0;
}

/* 默认引导 */
.placeholder {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 64px 40px;
  text-align: center;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height) - 120px);
}

.placeholder-icon {
  font-size: 56px;
  margin-bottom: 20px;
}

.placeholder-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 12px;
}

.placeholder-desc {
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto;
}

/* 复习进度条模块 */
.progress-wrap {
  width: 100%;
  max-width: 560px;
  padding: 44px 48px 40px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(99, 102, 241, 0.10), transparent 60%),
    var(--bg-card);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.progress-icon {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 22px;
}

.progress-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.4px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.progress-title span,
.progress-subtitle span,
.progress-label {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.progress-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 34px;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.progress-note {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.progress-label {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.55);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-hint {
  margin-top: 22px;
  font-size: 14px;
  color: var(--text-muted);
}

/* 科目计划头 */
.plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.plan-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.plan-level {
  display: inline-block;
  margin: 6px 0 8px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(168, 85, 247, 0.28));
  color: #fff;
}

.plan-desc {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 640px;
}

.plan-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-chip {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-card);
}

.stat-chip b {
  color: var(--text-primary);
  font-size: 15px;
  margin-right: 4px;
}

/* 学习进度 chip */
.progress-chip {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.08);
  color: #fff;
}
.progress-chip em {
  font-style: normal;
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 4px;
}

/* 计划页入口按钮（错题集 / 模拟考试） */
.plan-entry {
  align-self: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  text-decoration: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.plan-entry:hover {
  opacity: 0.88;
  transform: translateY(-2px);
}

/* 切换科目小按钮 */
.btn-switch-subj {
  align-self: center;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-switch-subj:hover {
  border-color: rgba(99, 102, 241, 0.65);
  color: #fff;
  background: rgba(99, 102, 241, 0.12);
}

/* 系统集成：计算题专项入口按钮（错题集旁，紫色高亮） */
.calc-entry {
  background: linear-gradient(90deg, #a855f7, #ec4899);
  box-shadow: 0 6px 18px rgba(168, 85, 247, 0.25);
}

/* 章节知识目录 */
.ch-section {
  margin: 8px 0 34px;
}

.ch-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.ch-section-title {
  font-size: 19px;
  color: var(--text-primary);
}

.ch-section-title small {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 4px;
}

.ch-section-head .entry-btn {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--accent-2);
  border: 1px solid rgba(168, 85, 247, 0.45);
  text-decoration: none;
  transition: all 0.2s ease;
}

.ch-section-head .entry-btn:hover {
  background: rgba(168, 85, 247, 0.14);
  color: #fff;
}

.ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.ch-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.ch-card:hover {
  border-color: rgba(99, 102, 241, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.ch-no {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.85), rgba(168, 85, 247, 0.85));
}

.ch-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.4;
}

.ch-card .ch-meta {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-muted);
}

.ch-card.key .ch-meta {
  color: #d4b56a;
}

.ch-go {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.subj-pct small {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
}

@media (max-width: 720px) {
  .ch-grid {
    grid-template-columns: 1fr;
  }
  .ch-section-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 周分组 */
.week {
  margin-bottom: 20px;
}

.week-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.week-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.week-bar {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.week-range {
  font-size: 12px;
  color: var(--text-muted);
}

/* 每日计划卡片 */
.day-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  margin-bottom: 8px;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.day-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.03);
}

/* 每日卡片链接（点击跳转每日学习页） */
.day-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: inherit;
  border-radius: 12px;
}

/* 每日得分徽章（全对绿 / 有错红 / 未答灰） */
.day-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 1px solid var(--border);
  pointer-events: none;
}

.day-badge.badge-green {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
}

.day-badge.badge-red {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
}

.day-badge.badge-gray {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

.day-num {
  flex-shrink: 0;
  width: 56px;
  text-align: center;
  padding: 6px 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.day-num small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: inherit;
  opacity: 0.75;
}

/* 阶段配色 */
.phase-base .day-num   { background: rgba(99, 102, 241, 0.16); color: #a5b4fc; }
.phase-strong .day-num { background: rgba(168, 85, 247, 0.16); color: #d8b4fe; }
.phase-exam .day-num   { background: rgba(244, 114, 182, 0.16); color: #f9a8d4; }
.phase-sprint .day-num { background: rgba(34, 197, 94, 0.16); color: #86efac; }

.day-body { flex: 1; min-width: 0; }

.day-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.phase-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- 滚动渐入 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    max-height: none;
  }

  /* 移动端改为点击展开（js 控制 .open） */
  .lv-sub {
    display: none;
  }

  .lv-group.open .lv-sub {
    display: flex;
  }
}

@media (max-width: 768px) {
  /* 本页顶部已有汉堡下拉菜单，移动端不再重复显示横向导航 */
  .nav-links {
    display: none;
  }

  .navbar-inner {
    padding: 0 16px;
  }

  .nav-link {
    padding: 8px 8px;
    font-size: 13px;
  }

  .layout {
    padding: calc(var(--nav-height) + 20px) 16px 60px;
    gap: 20px;
  }

  .plan-title {
    font-size: 24px;
  }

  .day-card {
    flex-direction: column;
    gap: 10px;
  }

  .day-num {
    width: 100%;
  }
}
