/* ==========================================================================
   考试大师 · 全站公共样式层  (V2 第一批 UI · 只升级视觉，不改业务)
   引入方式: 各页 <head> 内联 <style> 之后加载本文件，用于：
     1) 统一设计 token（色板/字阶/圆角/阴影/字体栈）
     2) 提供公共组件（按钮/toast/搜索/chips/学生门户条/统计副文案）
     3) 数学课程卡「1 列手机 / 2 列平板横屏 / 3 列 PC」响应式
   页面自身内联样式保持原样保留。
   ========================================================================== */

:root {
  /* 色板（沿用现有 深蓝 + 浅蓝，不引入陌生色） */
  --brand: #052659;          /* 主深蓝（登录/播放/我的 顶栏与主按钮） */
  --brand-deep: #021024;     /* 更深蓝（hover/视频底） */
  --brand-2: #0F4C81;        /* 次深蓝 */
  --accent: #2563EB;         /* 交互高亮 */
  --sky: #5483B3;            /* 次级文字蓝 */
  --sky2: #7DA0CA;           /* 更浅蓝 */
  --ice: #C1E8FF;            /* 浅蓝描边/胶囊 */
  --ice-soft: #EDF5FA;       /* 页面底 */
  --bg: #F4F7FB;
  --ink: #0A2B44;            /* 标题 */
  --text: #1E293B;           /* 正文 */
  --muted: #64748B;          /* 次级文字 */
  --muted3: #94A3B8;         /* 三级文字 */
  --line: #E2E8F0;
  --blue-tag: #2563EB; --blue-bg: #EFF6FF;
  --red: #DC2626;  --red-bg: #FEF2F2;
  --green: #16A34A; --green-bg: #F0FDF4;

  /* 圆角 / 阴影 / 字体 */
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --sh1: 0 1px 3px rgba(0,0,0,.05);
  --sh2: 0 8px 24px rgba(5,38,89,.09);
  --sh3: 0 15px 35px rgba(5,38,89,.16);
  --font: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- 全局基础收敛（比页面内联晚加载，仅统一字体/选区/焦点） ---- */
body { font-family: var(--font); }
::selection { background: #DBEAFE; color: var(--brand-deep); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---- 公共按钮（仅用于新增元素，不影响各页私有按钮类） ---- */
.exm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; cursor: pointer; font-family: inherit; font-weight: 600;
  font-size: .95rem; text-decoration: none; border-radius: var(--r-pill);
  transition: all .22s ease; white-space: nowrap; user-select: none;
}
.exm-btn-primary { background: var(--brand); color: #fff; padding: 10px 22px; box-shadow: 0 6px 16px rgba(5,38,89,.22); }
.exm-btn-primary:hover { background: var(--brand-deep); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(5,38,89,.28); }
.exm-btn-ghost { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); padding: 9px 20px; }
.exm-btn-ghost:hover { background: var(--brand); color: #fff; }

/* ---- Toast 轻提示（页面内，替代打断学习的浏览器 alert） ---- */
.exm-toast-wrap {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(92vw, 560px);
}
.exm-toast {
  pointer-events: auto; background: #fff; border-radius: 12px;
  box-shadow: var(--sh3); padding: 10px 18px; font-size: .9rem; font-weight: 500;
  color: var(--text); display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-left-width: 4px;
  animation: exmToastIn .25s ease;
}
.exm-toast.ok   { border-left-color: var(--green); }
.exm-toast.warn { border-left-color: #F59E0B; }
.exm-toast.err  { border-left-color: var(--red); }
.exm-toast.out  { animation: exmToastOut .3s ease forwards; }
@keyframes exmToastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes exmToastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---- 目录搜索 + k-tag 轻量筛选（math_zk 专用，样式层放公共） ---- */
.catalog-toolbar { display: flex; flex-direction: column; gap: 12px; margin: 0 0 24px; }
.catalog-row1 { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.catalog-search {
  flex: 1 1 240px; display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1.5px solid var(--ice); border-radius: 14px;
  padding: 10px 14px; transition: border-color .2s, box-shadow .2s;
}
.catalog-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.10); }
.catalog-search input {
  flex: 1; border: 0; outline: none; background: transparent;
  font: inherit; font-size: .95rem; color: var(--text); min-width: 0;
}
.catalog-search input::placeholder { color: var(--muted3); }
.catalog-meta { font-size: .82rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.catalog-meta b { color: var(--brand); font-variant-numeric: tabular-nums; }

.catalog-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
  padding: 6px 14px; border-radius: var(--r-pill); transition: all .18s ease;
  font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: var(--sky2); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(5,38,89,.18); }

.catalog-empty {
  display: none; text-align: center; padding: 56px 16px; color: var(--muted3);
  background: #fff; border: 1px dashed var(--line); border-radius: var(--r-lg);
}
.catalog-empty.show { display: block; }

/* ---- 数学课程卡（math_zk）响应式与"学习按钮" ---- */
/* 默认 2 列（覆盖原 auto-fill；手机 1 列 / 平板横屏 2 列 / PC 3 列见下方媒体查询） */
.lesson-grid { grid-template-columns: repeat(2, 1fr); }
.lesson-card {
  background: #fff; border: 1px solid #E9EEF3; border-radius: var(--r-md);
  padding: 14px 16px; gap: 14px; min-width: 0;
}
.lesson-num {
  font-size: 1.1rem; min-width: 34px; text-align: center;
  background: var(--blue-bg); color: var(--accent); border-radius: 9px;
  padding: 6px 4px; flex: 0 0 auto; line-height: 1.1;
}
.lesson-info { flex: 1 1 auto; min-width: 0; }
.lesson-title { font-size: 1rem; }
/* 卡内显式"学习按钮"：整卡仍是 <a>，此视觉元素不承载独立交互 */
.lesson-card::after {
  content: "学习 ▶"; flex: 0 0 auto; align-self: center;
  font-size: .78rem; font-weight: 700; color: #fff; background: var(--brand);
  padding: 7px 15px; border-radius: var(--r-pill); white-space: nowrap;
  box-shadow: 0 4px 10px rgba(5,38,89,.16); transition: background .2s ease;
}
.lesson-card:hover::after { background: var(--accent); }

/* 手机 1 列 */
@media (max-width: 820px) {
  .lesson-grid { grid-template-columns: 1fr; }
  .lesson-card { padding: 13px 14px; gap: 12px; }
}
/* PC 大屏（精细指针）3 列；平板横屏触屏在 820–1180 保持默认 2 列 */
@media (min-width: 1180px) and (pointer: fine) {
  .lesson-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- 首页学生门户条（index，位于品牌 Hero 之下、课程目录之上） ---- */
.student-strip {
  max-width: 1080px; margin: 0 auto 10px; padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  background: #fff; border: 1px solid #F1F5F9; border-radius: var(--r-lg);
  box-shadow: var(--sh1);
}
.student-strip-avatar {
  width: 52px; height: 52px; flex: 0 0 auto; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #0A3A7A);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.student-strip-body { flex: 1 1 auto; min-width: 0; }
.student-strip-hello { font-size: 1.15rem; font-weight: 800; color: var(--ink); line-height: 1.4; }
.student-strip-hello b { color: var(--brand); }
.student-strip-sub { font-size: .85rem; color: var(--muted); line-height: 1.5; }
.student-strip-cta { flex: 0 0 auto; }
@media (max-width: 640px) {
  .student-strip { flex-wrap: wrap; padding: 14px 16px; margin-left: 12px; margin-right: 12px; }
  .student-strip-cta { width: 100%; }
}

/* ---- my 学习中心：统计卡副文案 ---- */
.stat-sub { font-size: .72rem; color: #94A3B8; margin-top: 3px; line-height: 1.4; }
/* 第三指标单位 "节"→"条"：仅 CSS 呈现层调整，不改统计 JS */
#courseCount span { display: none; }
#courseCount::after { content: "条"; font-size: 1rem; font-weight: 600; color: #5483B3; margin-left: 4px; }
