/* 互动学习网站 - 样式层（明亮、适龄、卡片式） */

:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #1f2937;
  --text-sub: #64748b;
  --text-hint: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --brand: #2563eb;
  --brand-soft: #eff6ff;
  --brand-deep: #1e40af;
  --shadow: 0 2px 10px rgba(15, 23, 42, .06);
  --shadow-hover: 0 8px 24px rgba(15, 23, 42, .12);
  --radius: 16px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 顶部全局导航 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-deep);
  white-space: nowrap;
}
.logo-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.topnav { display: flex; gap: 6px; margin-left: auto; }
.topnav a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-sub);
  transition: .15s;
}
.topnav a:hover { background: var(--brand-soft); color: var(--brand); }
.topnav a.active { background: var(--brand); color: #fff; }

/* ---------- 页面容器 ---------- */
.wrap { max-width: 1160px; margin: 0 auto; padding: 24px; }

/* 面包屑 */
.crumbs {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px; font-size: 13px; color: var(--text-sub); margin-bottom: 20px;
}
.crumbs a { padding: 3px 6px; border-radius: 6px; }
.crumbs a:hover { color: var(--brand); background: var(--brand-soft); }
.crumbs .sep { color: var(--text-hint); }
.crumbs .cur { color: var(--text); font-weight: 600; }

/* 页头 */
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--text-sub); font-size: 14px; }

/* 提示条 */
.note {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--brand-soft); border: 1px solid #dbeafe;
  color: var(--brand-deep); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 13px; margin-bottom: 22px;
}
.note b { font-weight: 600; }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  display: block;
}
a.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand);
}

/* 学段卡 */
.stage-card { padding: 26px; }
.stage-card h2 { margin: 0 0 4px; font-size: 22px; }
.stage-card .range { color: var(--text-sub); font-size: 14px; }
.stage-card .arrow { margin-top: 18px; color: var(--brand); font-weight: 600; }

/* 年级卡 */
.grade-card { text-align: center; padding: 22px 12px; }
.grade-num {
  width: 52px; height: 52px; margin: 0 auto 12px;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 22px; font-weight: 700;
}
.grade-card .gname { font-weight: 600; font-size: 15px; }

/* 学科卡 */
.subject-card { position: relative; padding: 18px; }
.subj-icon {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 700; margin-bottom: 12px;
}
.subj-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.subj-phases { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.subj-phases span {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: var(--surface-soft); color: var(--text-sub);
  border: 1px solid var(--border);
}

/* 色调（学科 / 环节共用） */
.tone-red    .subj-icon, .chip.tone-red    { background: #fef2f2; color: #dc2626; }
.tone-blue   .subj-icon, .chip.tone-blue   { background: #eff6ff; color: #2563eb; }
.tone-amber  .subj-icon, .chip.tone-amber  { background: #fffbeb; color: #d97706; }
.tone-teal   .subj-icon, .chip.tone-teal   { background: #f0fdfa; color: #0d9488; }
.tone-green  .subj-icon, .chip.tone-green  { background: #f0fdf4; color: #16a34a; }
.tone-purple .subj-icon, .chip.tone-purple { background: #faf5ff; color: #9333ea; }
.tone-pink   .subj-icon, .chip.tone-pink   { background: #fdf2f8; color: #db2777; }

/* ---------- 环节入口大卡（L3） ---------- */
.phase-card { padding: 26px; border-left: 5px solid var(--border-strong); }
.phase-card.tone-blue  { border-left-color: #2563eb; }
.phase-card.tone-amber { border-left-color: #d97706; }
.phase-card.tone-green { border-left-color: #16a34a; }
.phase-badge {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  font-size: 18px; font-weight: 700; margin-bottom: 12px;
}
.phase-card h3 { margin: 0 0 4px; font-size: 18px; }
.phase-card p { margin: 0; color: var(--text-sub); font-size: 13px; }
.phase-card .go { margin-top: 16px; color: var(--brand); font-size: 13px; font-weight: 600; }

/* ---------- 横向切换条 ---------- */
.switchbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 18px;
}
.switchbar .lbl { font-size: 12px; color: var(--text-hint); margin-right: 4px; white-space: nowrap; }
.switchbar a {
  font-size: 13px; padding: 5px 11px; border-radius: 8px;
  color: var(--text-sub); transition: .15s; white-space: nowrap;
}
.switchbar a:hover { background: var(--surface-soft); color: var(--text); }
.switchbar a.on { background: var(--brand); color: #fff; font-weight: 600; }

/* 环节 Tab */
.phasetabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.phasetabs a {
  flex: 1; min-width: 150px; text-align: center;
  padding: 14px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 14px; color: var(--text-sub); transition: .15s;
}
.phasetabs a:hover { border-color: var(--brand); color: var(--brand); }
.phasetabs a.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.phasetabs small { display: block; font-size: 11px; opacity: .8; margin-top: 3px; font-weight: 400; }

/* ---------- 内容预留槽位（虚线占位） ---------- */
.slot {
  border: 2px dashed var(--border-strong);
  background: repeating-linear-gradient(45deg, #fbfcfe, #fbfcfe 10px, #f6f8fb 10px, #f6f8fb 20px);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--text-sub);
}
.slot-tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  color: var(--brand); background: var(--brand-soft);
  padding: 3px 10px; border-radius: 999px; margin-bottom: 12px;
}
.slot-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.slot-hint { font-size: 12px; color: var(--text-hint); }
.slot-lg { min-height: 260px; display: flex; flex-direction: column; justify-content: center; }

/* 环节正文区版式 */
.phase-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.side-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.side-panel h4 { margin: 0 0 12px; font-size: 13px; color: var(--text-sub); }
.side-item {
  padding: 9px 10px; border-radius: 8px; font-size: 13px;
  color: var(--text-sub); margin-bottom: 4px;
}
.side-item.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* 进度条占位 */
.progress-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 20px;
}
.progress-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-sub); margin-bottom: 8px; }
.progress-track { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--brand); border-radius: 999px; }

/* 页脚 */
.footer { text-align: center; color: var(--text-hint); font-size: 12px; padding: 32px 24px 48px; }

/* 404 */
.notfound { text-align: center; padding: 80px 20px; }
.notfound h1 { font-size: 48px; margin: 0 0 8px; color: var(--brand); }

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .phase-layout { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .page-head h1 { font-size: 22px; }
  .wrap { padding: 16px; }
}
