/* ==========================================================================
   车研学堂 AutoTech Academy — 新能源汽车技术在线学习平台
   Theme: Light platform + purple/blue gradient
   ========================================================================== */

/* ------------------------------- Tokens -------------------------------- */
:root {
  --brand: #2563EB;
  --brand-2: #0EA5E9;
  --brand-3: #1D4ED8;
  --brand-soft: #E8F0FE;
  --brand-soft-2: #E0F2FE;
  --grad: linear-gradient(120deg, #1D4ED8 0%, #2563EB 50%, #0EA5E9 100%);
  --grad-soft: linear-gradient(120deg, #E8F0FE 0%, #E0F2FE 100%);

  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #64748B;
  --muted-2: #94A3B8;

  --bg: #F5F8FF;
  --card: #FFFFFF;
  --line: #E3EAF5;
  --line-2: #D2DDEE;
  --dark: #0B1B3A;
  --dark-2: #12275A;

  --warn: #F59E0B;
  --danger: #EF4444;
  --success: #10B981;

  /* 渐变面上的前景色 */
  --on-neon: #FFFFFF;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 26px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 24px 56px -22px rgba(15, 23, 42, 0.28);
  --shadow-brand: 0 14px 34px -14px rgba(37, 99, 235, 0.5);

  --nav-h: 68px;
  --maxw: 1240px;
  --sidebar: 264px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* -------------------------------- Reset -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(820px 460px at 10% -6%, rgba(37, 99, 235, 0.1), transparent 62%),
    radial-gradient(760px 420px at 94% 4%, rgba(14, 165, 233, 0.09), transparent 62%),
    radial-gradient(900px 520px at 50% 108%, rgba(29, 78, 216, 0.07), transparent 66%),
    linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px);
  background-size: auto, auto, auto, 64px 64px, 64px 64px;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat, repeat;
  background-attachment: fixed, fixed, fixed, fixed, fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; color: var(--ink); }
p { margin: 0; }
table { border-collapse: collapse; width: 100%; }

::selection { background: rgba(37, 99, 235, 0.18); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #EAF0FA; }
::-webkit-scrollbar-thumb { background: #C3D0E6; border-radius: 6px; border: 2px solid #EAF0FA; }
::-webkit-scrollbar-thumb:hover { background: #A9BAD6; }

/* ------------------------------- Layout -------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 64px 0; }
.section-sm { padding: 44px 0; }
.section-white { background: var(--card); }
.section-tint { background: linear-gradient(180deg, #FFFFFF, var(--bg)); }

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.sec-head .sec-title {
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sec-head .sec-title::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 3px;
  background: var(--grad);
}
.sec-sub { font-size: 13.5px; color: var(--muted); margin-top: 6px; padding-left: 16px; }
.sec-more {
  font-size: 13.5px;
  color: var(--brand);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
}
.sec-more:hover { gap: 8px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ------------------------------- Buttons ------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s, border-color 0.18s, color 0.18s;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 18px 40px -16px rgba(37, 99, 235, 0.7); }

.btn-ghost {
  background: #fff;
  border-color: var(--line-2);
  color: var(--ink-2);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: #E7E1FD; }

.btn-outline { background: transparent; border-color: var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1E293B; }

.btn-sm { padding: 8px 16px; font-size: 13.5px; border-radius: 9px; }
.btn-lg { padding: 14px 30px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* -------------------------------- Header -------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  height: var(--nav-h);
  background: #fff;
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s;
}
.site-header.scrolled { box-shadow: 0 6px 22px -12px rgba(16, 24, 40, 0.22); }

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  height: var(--nav-h);
}
.nav.solo { justify-content: space-between; }

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-brand);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 16.5px; font-weight: 800; letter-spacing: 0.01em; }
.brand-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-links > a,
.nav-more > button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 0;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}
.nav-links > a:hover,
.nav-more > button:hover { color: var(--brand); background: var(--brand-soft); }
.nav-links > a.active { color: var(--brand); background: var(--brand-soft); }

.nav-more { position: relative; }
.nav-more > button::after {
  content: "";
  width: 5px; height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.nav-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 176px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  display: none;
}
.nav-more:hover .nav-more-menu { display: block; }
.nav-more-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  color: var(--ink-2);
}
.nav-more-menu a:hover { background: var(--brand-soft); color: var(--brand); }

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.auth-slot { display: flex; align-items: center; }
/* .btn 的 display:inline-flex 会盖掉 hidden 属性，这里显式提高优先级 */
.nav-actions [data-mine][hidden], .auth-slot [hidden] { display: none; }

/* 已登录：头像 + 姓名 + 下拉菜单 */
.user-menu { position: relative; }
.user-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.user-btn:hover { border-color: var(--brand); box-shadow: 0 4px 14px -6px rgba(37, 99, 235, 0.45); }
.user-menu.open .user-btn { border-color: var(--brand); background: var(--brand-soft); }
.user-avatar {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user-meta b { font-size: 13.5px; font-weight: 600; color: var(--ink); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { font-size: 11px; color: var(--muted); letter-spacing: 0.2px; }
.user-caret { color: var(--muted); transition: transform 0.2s; }
.user-menu.open .user-caret { transform: rotate(180deg); }

.user-drop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 208px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px -18px rgba(16, 24, 40, 0.36);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  z-index: 60;
}
.user-menu.open .user-drop { opacity: 1; visibility: visible; transform: translateY(0); }
.ud-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px 11px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.ud-head b { font-size: 14px; color: var(--ink); }
.ud-head span { font-size: 12px; color: var(--muted); }
.ud-head .ud-org { color: var(--brand); }
.user-drop a, .user-drop button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}
.user-drop a:hover { background: var(--brand-soft); color: var(--brand); }
.user-drop button { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 11px; border-radius: 0 0 9px 9px; color: #B42318; }
.user-drop button:hover { background: #FEF3F2; }

/* 登录页：已登录卡片 */
.auth-logged { text-align: center; padding: 12px 4px 4px; }
.auth-logged[hidden] { display: none; }
.al-avatar {
  display: grid;
  place-items: center;
  width: 62px; height: 62px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
}
.auth-logged h2 { font-size: 21px; margin-bottom: 8px; }
.auth-logged .al-sub { font-size: 14px; color: var(--muted); }
.auth-logged .al-sub b { color: var(--ink); }
.auth-logged .al-acts { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.al-logout {
  margin-top: 16px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}
.al-logout:hover { color: #B42318; }
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #fff;
  place-items: center;
}
.nav-toggle span { display: block; width: 18px; height: 1.6px; background: var(--ink); position: relative; }
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 1.6px; background: var(--ink);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* 顶部搜索（header 内） */
.nav-search {
  flex: 1;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 40px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  transition: border-color 0.2s, background 0.2s;
}
.nav-search:focus-within { border-color: var(--brand); background: #fff; }
.nav-search input {
  flex: 1;
  border: 0;
  background: none;
  outline: none;
  font-size: 14px;
  color: var(--ink);
  min-width: 0;
}
.nav-search input::placeholder { color: var(--muted-2); }

/* -------------------------------- Hero -------------------------------- */
.hero {
  position: relative;
  background:
    radial-gradient(120% 120% at 12% 0%, rgba(37, 99, 235, 0.45) 0%, transparent 55%),
    radial-gradient(120% 120% at 92% 20%, rgba(34, 211, 238, 0.42) 0%, transparent 55%),
    linear-gradient(150deg, #08132B 0%, #10224A 60%, #08132B 100%);
  color: #fff;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 75%);
  pointer-events: none;
}
/* 两栏：左侧文案 + 右侧技术方向概览；统计条横跨两栏。
   之前左侧文案被 max-width 限制在 700px，右侧约 540px 是空的，
   而统计条却满宽，同一个区块一半空一半满。 */
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(0, 0.86fr);
  column-gap: 52px;
  align-items: center;
  padding: 62px 0 54px;
}
.hero-copy { grid-column: 1; min-width: 0; }
.hero-aside { grid-column: 2; min-width: 0; }
.hero-stats { grid-column: 1 / -1; }

/* Hero 右侧：六大技术方向 + 各方向课程数 */
.ha-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.ha-head span { font-size: 13.5px; font-weight: 600; color: #fff; }
.ha-head small { font-size: 12px; color: rgba(255, 255, 255, 0.55); }
.ha-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hero-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 15px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #fff;
  font-size: 13px;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.hero-chip:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
}
.hc-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.hc-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-n { font-family: var(--mono); font-size: 11.5px; color: rgba(255, 255, 255, 0.55); flex: none; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
  backdrop-filter: blur(6px);
}
.hero-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #38BDF8;
  box-shadow: 0 0 10px #38BDF8;
}

.hero h1 {
  color: #fff;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #93C5FD, #7DD3FC);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  color: rgba(255, 255, 255, 0.76);
  font-size: 16px;
  max-width: 640px;
  margin-bottom: 28px;
}

.hero-search {
  display: flex;
  gap: 10px;
  max-width: 700px;
  margin-bottom: 16px;
}
.hero-search .field-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 18px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
}
.hero-search input {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 15px;
  color: var(--ink);
  min-width: 0;
}
.hero-search .btn { height: 52px; padding: 0 30px; border-radius: 12px; font-size: 15.5px; }

.hot-words {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}
.hot-words a {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  transition: background 0.2s;
}
.hot-words a:hover { background: rgba(255, 255, 255, 0.2); }

.hero-stats {
  display: grid;
  /* 3 项指标（在线课程 / 累计学习人次 / 技术方向），列数跟着项数走 */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.hero-stat .n {
  font-family: var(--mono);
  font-size: 27px;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
}
.hero-stat .n small { font-size: 14px; font-weight: 500; margin-left: 3px; color: rgba(255, 255, 255, 0.65); }
.hero-stat .l { font-size: 13px; color: rgba(255, 255, 255, 0.62); margin-top: 3px; }

/* ----------------------------- Domain nav ----------------------------- */
.domain-bar {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.domain-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  scrollbar-width: none;
}
.domain-bar-inner::-webkit-scrollbar { display: none; }
.domain-bar-inner a {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.domain-bar-inner a:hover { color: var(--brand); border-color: rgba(37, 99, 235, 0.35); background: var(--brand-soft); }

/* ----------------------------- Course card ----------------------------- */
.course-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s, border-color 0.24s;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.28);
}

.cc-cover {
  position: relative;
  height: 132px;
  /* 兜底：背景图没加载出来时，仍然是一块该领域的品牌色 */
  background-color: var(--c1, #1D4ED8);
  /* 上层是本课程的主题图，下层是领域图（前者缺失时自动顶上） */
  background-image: var(--cover), var(--cover-domain);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  overflow: hidden;
}
/* 领域色叠层：压在主题照片上。
   两层——上层是顶部浅暗角，保证左上角白色标签（训练营 / 公开课 / 免费）在
   亮色照片上也读得清；下层是领域渐变，保留各领域的色彩识别。
   opacity 控制整体浓度：调大更像纯色块，调小照片更清楚。 */
.cc-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 18, 30, 0.5) 0%, rgba(10, 18, 30, 0.05) 44%),
    linear-gradient(135deg, var(--c1, #1D4ED8), var(--c2, #3B82F6));
  opacity: 0.55;
}
.cc-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 78% 22%, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 78% 22%, #000, transparent 70%);
}
/* 课程卡封面主题图的地址由脚本注入（见 assets/js/main.js 的 courseCard）：
     --cover         每门课自己的图 assets/img/courses/<课程id>.jpg
     --cover-domain  该领域的通用图 assets/img/domains/<领域id>.jpg
   两层叠放：某门课还没配图（文件不存在）时，下层领域图会自动顶上来，
   不会出现空白封面。新增课程只要把图按「课程id.jpg」丢进 courses 目录即可。 */
.cc-badges { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; z-index: 1; }
.cc-tag {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #fff;
  backdrop-filter: blur(6px);
}
.cc-free {
  background: #fff;
  border-color: #fff;
  color: #1D4ED8;
  font-weight: 700;
}

.cc-body { padding: 16px 16px 18px; display: flex; flex-direction: column; flex: 1; }
.cc-title {
  font-size: 15.5px;
  line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
}
.course-card:hover .cc-title { color: var(--brand); }
.cc-org {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.cc-org .org-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cc-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.cc-meta span { display: inline-flex; align-items: center; gap: 5px; }

.cc-foot {
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.price {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  color: var(--brand);
}
.price .cur { font-size: 13px; margin-right: 1px; }
.price-origin {
  font-size: 12.5px;
  color: var(--muted-2);
  text-decoration: line-through;
  margin-left: 6px;
  font-family: var(--mono);
}
.price-free { color: var(--success); }
.cc-level {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* 横向紧凑课程条（公开课列表） */
.course-row {
  display: grid;
  grid-template-columns: 152px 1fr auto;
  gap: 18px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  transition: box-shadow 0.22s, border-color 0.22s, transform 0.22s;
}
.course-row:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.28);
  transform: translateY(-2px);
}
.cr-thumb {
  display: block;
  height: 88px;
  border-radius: var(--r-md);
  /* 兜底：两张图都没加载出来时，仍是一块该领域的品牌色 */
  background-color: var(--c1, #1D4ED8);
  /* 上层是这门课自己的主题图，下层是该领域的通用图（前者缺失时自动顶上）。
     地址由脚本注入，见 assets/js/main.js 的 courseRow。 */
  background-image: var(--cover), var(--cover-domain);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
}
/* 领域色叠层：压在主题照片上。
   比课程卡（.cc-cover）的遮罩更淡一些——这里缩略图只有 152×88，
   压太浓就看不清照片里到底是什么内容了。 */
.cr-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 18, 30, 0.34) 0%, rgba(10, 18, 30, 0.04) 46%),
    linear-gradient(135deg, var(--c1, #1D4ED8), var(--c2, #3B82F6));
  opacity: 0.4;
}
.cr-main h4 { font-size: 15.5px; margin-bottom: 7px; }
.course-row:hover .cr-main h4 { color: var(--brand); }
.cr-main .cc-meta { margin-bottom: 0; }
.cr-side { text-align: right; }

/* 以下 .major-* 规则已无引用（组合包功能整站移除），保留以备将来复用 */
.major-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.24s, transform 0.24s, border-color 0.24s;
}
.major-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.28);
}
.major-top {
  padding: 20px;
  background: linear-gradient(135deg, var(--c1, #1D4ED8), var(--c2, #3B82F6));
  color: #fff;
  position: relative;
  overflow: hidden;
}
.major-top::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.13) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at 85% 15%, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 85% 15%, #000, transparent 70%);
}
.major-top h3 { color: #fff; font-size: 18px; position: relative; z-index: 1; }
.major-top p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  margin-top: 8px;
  position: relative;
  z-index: 1;
}
.major-top .major-kpi {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 18px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 13px;
}
.major-top .major-kpi b { font-size: 17px; font-weight: 700; }
.major-body { padding: 16px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.major-list { display: grid; gap: 10px; margin-bottom: 18px; flex: 1; }
.major-list li {
  display: flex;
  gap: 9px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.major-list li::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
  margin-top: 9px;
}
.major-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* ------------------------------- 机构 card ----------------------------- */
.org-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: box-shadow 0.22s, border-color 0.22s;
}
.org-card:hover { box-shadow: var(--shadow-md); border-color: rgba(37, 99, 235, 0.28); }
.org-logo {
  width: 50px; height: 50px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  color: var(--brand);
  background: var(--brand-soft);
  flex-shrink: 0;
}
.org-info { min-width: 0; flex: 1; }
.org-info h4 { font-size: 14.5px; margin-bottom: 3px; }
.org-info .org-meta { font-size: 12.5px; color: var(--muted); }

/* ------------------------------ 统计/亮点 ------------------------------ */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.feature-strip > div {
  padding: 22px 20px;
  border-right: 1px solid var(--line);
}
.feature-strip > div:last-child { border-right: none; }
.fs-ic {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 12px;
}
.fs-t { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.fs-d { font-size: 13px; color: var(--muted); line-height: 1.55; }

/* ------------------------------- Footer -------------------------------- */
.site-footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.72);
  padding: 52px 0 26px;
  margin-top: 20px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 34px;
  padding-bottom: 34px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-brand .brand-name { color: #fff; }
.footer-brand p { font-size: 13.5px; margin-top: 14px; max-width: 300px; line-height: 1.7; }
.footer-col h4 {
  font-size: 13.5px;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}
.footer-col a, .footer-col li {
  display: block;
  font-size: 13.5px;
  padding: 4px 0;
  color: rgba(255, 255, 255, 0.68);
  transition: color 0.2s;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
}

/* --------------------------- 页面标题条（内页） --------------------------- */
.page-head {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 26px 0 24px;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.crumbs a:hover { color: var(--brand); }
.crumbs span.sep { color: var(--muted-2); }
.page-head h1 { font-size: clamp(23px, 3vw, 30px); margin-bottom: 8px; }
.page-head .page-desc { font-size: 14px; color: var(--muted); max-width: 780px; }

/* ------------------------------ 课程树 / 侧栏 ------------------------------ */
.layout-side {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}
.side-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.side-card + .side-card { margin-top: 18px; }
.side-head {
  padding: 15px 18px;
  font-size: 14.5px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #F7FCF9);
}
.tree { padding: 8px; }
.tree-group > button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: left;
  transition: background 0.18s, color 0.18s;
}
.tree-group > button:hover { background: var(--brand-soft); color: var(--brand); }
.tree-group.open > button { color: var(--brand); }
.tree-group > button .arrow {
  margin-left: auto;
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.25s;
  flex-shrink: 0;
}
.tree-group.open > button .arrow { transform: rotate(225deg) translate(-2px, -2px); }
.tree-group .dot {
  width: 8px; height: 8px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--c1, #1D4ED8), var(--c2, #3B82F6));
  flex-shrink: 0;
}
.tree-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.tree-sub-inner { padding: 2px 0 8px; }
.tree-sub-inner a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 8px 30px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  transition: background 0.18s, color 0.18s;
}
.tree-sub-inner a:hover, .tree-sub-inner a.active { background: var(--brand-soft); color: var(--brand); }
.tree-sub-inner a .cnt { font-size: 12px; color: var(--muted-2); font-family: var(--mono); }

.side-stat { padding: 16px 18px; display: grid; gap: 12px; }
.side-stat div { display: flex; justify-content: space-between; font-size: 13.5px; }
.side-stat div dt { color: var(--muted); }
.side-stat div dd { margin: 0; font-weight: 700; font-family: var(--mono); color: var(--ink); }

/* -------------------------------- 筛选条 -------------------------------- */
.filter-bar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 7px 0;
}
.filter-row + .filter-row { border-top: 1px dashed var(--line); }
.filter-label {
  flex-shrink: 0;
  width: 60px;
  font-size: 13.5px;
  color: var(--muted);
  padding-top: 4px;
}
.filter-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-opts button {
  padding: 5px 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  font-size: 13.5px;
  color: var(--ink-2);
  transition: all 0.18s;
}
.filter-opts button:hover { color: var(--brand); background: var(--brand-soft); }
.filter-opts button.active {
  background: var(--grad);
  color: #fff;
  font-weight: 600;
}
.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 13.5px;
  color: var(--muted);
}
.result-bar b { color: var(--brand); font-family: var(--mono); }

.empty-state {
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
}

/* ----------------------------- 课程详情页 ----------------------------- */
.detail-hero {
  background: linear-gradient(150deg, #08132B, #12275A);
  color: #fff;
  padding: 34px 0 38px;
}
.detail-hero h1 { color: #fff; font-size: clamp(22px, 3vw, 31px); margin-bottom: 14px; }
.detail-hero .crumbs { color: rgba(255, 255, 255, 0.6); }
.detail-hero .crumbs a:hover { color: #fff; }
.detail-hero .crumbs span.sep { color: rgba(255, 255, 255, 0.35); }
.detail-hero .page-desc { color: rgba(255, 255, 255, 0.76); font-size: 14.5px; max-width: 780px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.detail-tags span {
  font-size: 12.5px;
  padding: 4px 11px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}
.detail-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.detail-facts div .k { font-size: 12.5px; color: rgba(255, 255, 255, 0.6); }
.detail-facts div .v { font-size: 15.5px; font-weight: 700; font-family: var(--mono); color: #fff; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 328px;
  gap: 28px;
  align-items: start;
}
.detail-side { position: sticky; top: calc(var(--nav-h) + 20px); }

.buy-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.buy-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.buy-price .price { font-size: 30px; }
.buy-price .price-origin { font-size: 14px; }
.buy-note { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.buy-list { display: grid; gap: 10px; margin: 18px 0; padding-top: 16px; border-top: 1px dashed var(--line); }
.buy-list li { display: flex; gap: 9px; font-size: 13.5px; color: var(--ink-2); }
.buy-list li::before {
  content: "";
  width: 15px; height: 15px;
  flex-shrink: 0;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--brand-soft)
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 15 15'%3E%3Cpath d='M4 7.6l2.4 2.4L11 5.4' stroke='%232563EB' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center/15px no-repeat;
}

/* 播放器占位 */
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 220px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(37, 99, 235, 0.4), transparent 60%),
    linear-gradient(150deg, #0C1B3D, #060F24);
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 20px;
}
.player::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 50% 50%, #000, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 72%);
}
.player-inner { position: relative; z-index: 1; text-align: center; color: rgba(255, 255, 255, 0.82); }
.play-btn {
  width: 68px; height: 68px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--brand);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.7);
  transition: transform 0.22s;
}
.play-btn:hover { transform: scale(1.06); }
.player-inner .pt { font-size: 15px; font-weight: 600; color: #fff; }
.player-inner .ps { font-size: 12.5px; margin-top: 5px; color: rgba(255, 255, 255, 0.6); }
/* 未登录时的登录引导，占住播放器位置，不加载任何视频 */
.player-lock .lock-ic {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}
.player-lock .lock-t { font-size: 17px; font-weight: 600; color: #fff; }
.player-lock .lock-s { font-size: 13px; margin-top: 7px; color: rgba(255, 255, 255, 0.64); }
.player-lock .lock-acts {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}
.player-lock .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.34); background: transparent; }
.player-lock .btn-ghost:hover { color: #fff; border-color: #fff; background: rgba(255, 255, 255, 0.12); }
.player-lock .lock-meta {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* 章节列表 */
.chapter-list { display: grid; gap: 8px; }
.chapter {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chapter.open { border-color: rgba(37, 99, 235, 0.35); box-shadow: var(--shadow-sm); }
.chapter-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  background: none;
  text-align: left;
}
.chapter-head .no {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 3px 8px;
  flex-shrink: 0;
}
.chapter-head .t { flex: 1; font-size: 14.5px; font-weight: 600; }
.chapter-head .d { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.chapter-head .arrow {
  width: 6px; height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.25s;
  flex-shrink: 0;
}
.chapter.open .chapter-head .arrow { transform: rotate(225deg) translate(-2px, -2px); border-color: var(--brand); }
.chapter-body { max-height: 0; overflow: hidden; transition: max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1); }
.lesson {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px 11px 22px;
  border-top: 1px dashed var(--line);
  font-size: 14px;
  color: var(--ink-2);
}
.lesson:hover { background: #F7FCF9; }
.lesson .lic {
  width: 20px; height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 10px;
}
.lesson .lt { flex: 1; }
.lesson .ltime { font-size: 12.5px; color: var(--muted-2); font-family: var(--mono); }
.lesson .preview {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(37, 99, 235, 0.1);
  color: #1D4ED8;
  border: 1px solid rgba(37, 99, 235, 0.28);
}

/* 详情区 Tab */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative;
  padding: 12px 18px;
  border: 0;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--brand); }
.tabs button.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--grad);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.35s ease both; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.prose h2 { font-size: 18px; margin: 28px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--ink-2); margin-bottom: 12px; font-size: 14.5px; }
.prose ul { display: grid; gap: 9px; margin: 12px 0 18px; }
.prose ul li { display: flex; gap: 9px; font-size: 14.5px; color: var(--ink-2); }
.prose ul li::before {
  content: "";
  width: 5px; height: 5px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

.comment {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px dashed var(--line);
}
.comment:last-child { border-bottom: none; }
.cm-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--c1, #1D4ED8), var(--c2, #3B82F6));
}
.cm-top { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; flex-wrap: wrap; }
.cm-top .who { font-size: 14.5px; font-weight: 600; }
.cm-top .when { font-size: 12.5px; color: var(--muted-2); }
.stars { color: var(--warn); font-size: 13px; letter-spacing: 1px; }
.cm-text { font-size: 14px; color: var(--ink-2); }

/* ---------------------------- 学习中心 ---------------------------- */
.learn-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 26px; align-items: start; }
.learn-nav { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; }
.learn-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.18s, color 0.18s;
}
.learn-nav a:hover { background: var(--brand-soft); color: var(--brand); }
.learn-nav a.active { background: var(--grad); color: #fff; }

.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
}
.kpi .kv { font-family: var(--mono); font-size: 25px; font-weight: 700; color: var(--brand); line-height: 1.15; }
.kpi .kv small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.kpi .kl { font-size: 13px; color: var(--muted); margin-top: 4px; }

.learn-item {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  transition: box-shadow 0.22s, border-color 0.22s;
}
.learn-item + .learn-item { margin-top: 14px; }
.learn-item:hover { box-shadow: var(--shadow-md); border-color: rgba(37, 99, 235, 0.28); }
.li-thumb {
  height: 84px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--c1, #1D4ED8), var(--c2, #3B82F6));
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--mono);
  font-weight: 700;
  position: relative;
  overflow: hidden;
}
.li-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 20px 20px;
}
.li-main h4 { font-size: 15px; margin-bottom: 6px; }
.li-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
.progress {
  height: 7px;
  border-radius: 999px;
  background: #E8F1EC;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--grad);
  width: 0;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 7px;
}
.progress-label b { color: var(--brand); font-family: var(--mono); }

.timeline { display: grid; gap: 0; }
.tl-item {
  display: grid;
  grid-template-columns: 108px 16px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 22px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-date { font-size: 12.5px; color: var(--muted); font-family: var(--mono); padding-top: 2px; text-align: right; }
.tl-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand);
  margin-top: 6px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
  position: relative;
}
.tl-item:not(:last-child) .tl-dot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 16px;
  bottom: -28px;
  width: 1px;
  transform: translateX(-50%);
  background: var(--line-2);
}
.tl-body h4 { font-size: 14.5px; margin-bottom: 4px; }
.tl-body p { font-size: 13.5px; color: var(--muted); }

/* ------------------------------- 表单 ------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field > label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field > label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.textarea { min-height: 110px; resize: vertical; }
.input.invalid, .select.invalid, .textarea.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.err-msg { font-size: 12.5px; color: var(--danger); display: none; }
.field.has-error .err-msg { display: block; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input {
  appearance: none;
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: #fff;
  transition: all 0.18s;
}
.check input:checked {
  border-color: transparent;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.4 3.4L11 1.6' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), var(--grad);
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
  background-size: 12px 10px, auto;
}
.check a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

.form-success {
  display: none;
  text-align: center;
  padding: 40px 26px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.07), #fff);
}
.form-success.show { display: block; animation: fadeIn 0.45s ease both; }
.success-icon {
  width: 62px; height: 62px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--success);
}
.form-success h3 { font-size: 20px; margin-bottom: 10px; }
.form-success p { color: var(--ink-2); max-width: 460px; margin: 0 auto; font-size: 14.5px; }

/* ------------------------------- 登录页 ------------------------------- */
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) 424px; gap: 50px; align-items: center; }
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg);
  margin-bottom: 24px;
}
.auth-tabs button {
  flex: 1;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s;
}
.auth-tabs button.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }
.auth-pane { display: none; }
.auth-pane.active { display: block; animation: fadeIn 0.35s ease both; }
.auth-pane .form-grid { grid-template-columns: 1fr; gap: 16px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 18px; }
.auth-link { font-size: 13.5px; color: var(--brand); }
.auth-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.btn-code {
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}
.btn-code:hover:not(:disabled) { background: #E7E1FD; }
.btn-code:disabled { color: var(--muted-2); border-color: var(--line-2); background: var(--bg); cursor: not-allowed; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  font-size: 12.5px;
  color: var(--muted-2);
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.oauth-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 13.5px;
  color: var(--ink-2);
  transition: all 0.2s;
}
.btn-oauth:hover { border-color: var(--brand); color: var(--brand); }
/* 注册方式切换（手机号 / 微信）：比登录注册大标签更轻，避免两级标签视觉打架 */
.reg-methods {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg);
  margin-bottom: 20px;
}
.reg-methods button {
  flex: 1;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s;
}
.reg-methods button.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }
/* 微信注册面板：二维码 + 人工开通说明 */
.reg-wechat { text-align: center; padding: 4px 0 8px; }
.reg-wechat img {
  display: block;
  margin: 0 auto 16px;
  width: 168px;
  height: 168px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-sizing: content-box;
}
.reg-wechat .rw-tip { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.reg-wechat .rw-sub { font-size: 13.5px; color: var(--muted); line-height: 1.75; margin-bottom: 14px; }
.reg-wechat .rw-tel { font-size: 14px; font-weight: 600; color: var(--brand); }
/* 表单级错误条：服务端返回的「手机号已注册」「密码不正确」等整体错误 */
.form-alert {
  margin-top: 16px;
  padding: 10px 13px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.06);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
}
.auth-side h1 { font-size: clamp(24px, 3vw, 33px); margin-bottom: 16px; }
.auth-side .lead { color: var(--ink-2); font-size: 15.5px; max-width: 500px; }
.auth-feats { display: grid; gap: 18px; margin-top: 30px; }
.auth-feat { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.auth-feat .ic {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.auth-feat h4 { font-size: 15px; margin-bottom: 4px; }
.auth-feat p { font-size: 13.5px; color: var(--muted); }

/* ------------------------------ 通用组件 ------------------------------ */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
}
.panel + .panel { margin-top: 18px; }
.panel > h3 { font-size: 16.5px; margin-bottom: 14px; display: flex; align-items: center; gap: 9px; }
.panel > h3::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--grad); }

.breadcrumb-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  padding: 14px 0;
}

.tag {
  display: inline-block;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.tag-gray { background: var(--bg); color: var(--muted); font-weight: 500; }

.cta-band {
  border-radius: var(--r-xl);
  padding: 40px 44px;
  background:
    radial-gradient(100% 140% at 6% 0%, rgba(37, 99, 235, 0.35), transparent 58%),
    radial-gradient(100% 140% at 94% 100%, rgba(34, 211, 238, 0.35), transparent 58%),
    linear-gradient(150deg, #08132B, #12275A);
  color: #fff;
  display: grid;
  grid-template-columns: 1.5fr auto;
  gap: 28px;
  align-items: center;
}
.cta-band h2 { color: #fff; font-size: clamp(21px, 2.6vw, 28px); margin-bottom: 10px; }
.cta-band p { color: rgba(255, 255, 255, 0.74); font-size: 14.5px; max-width: 560px; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 1120px) {
  .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Hero 收成单栏，方向概览移到文案下方 */
  .hero-inner { grid-template-columns: 1fr; row-gap: 34px; }
  .hero-copy, .hero-aside, .hero-stats { grid-column: 1; }
  .ha-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-top { grid-template-columns: 1.4fr repeat(2, 1fr); gap: 28px; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .auth-layout { grid-template-columns: 1fr; gap: 36px; }
  .feature-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-strip > div:nth-child(2n) { border-right: none; }
  .feature-strip > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-side { grid-template-columns: 1fr; }
  .learn-wrap { grid-template-columns: 1fr; }
  .learn-nav { display: flex; gap: 6px; overflow-x: auto; }
  .learn-nav a { white-space: nowrap; }
  .nav-search { display: none; }
  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 16px 20px 22px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 34px -22px rgba(16, 24, 40, 0.4);
    transform: translateY(-135%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links > a, .nav-more > button { padding: 13px 14px; font-size: 15.5px; }
  .nav-more-menu { position: static; display: block; box-shadow: none; border: 0; padding: 0 0 0 14px; min-width: 0; }
  .nav-toggle { display: grid; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .container { padding: 0 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
  .hero-inner { padding: 42px 0 40px; }
  .hero-search { flex-direction: column; }
  .hero-search .btn { width: 100%; }
  .course-row { grid-template-columns: 104px 1fr; }
  .course-row .cr-side { grid-column: 1 / -1; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .cr-thumb { height: 72px; font-size: 16px; }
  .learn-item { grid-template-columns: 104px minmax(0, 1fr); }
  .learn-item .li-side { grid-column: 1 / -1; }
  .li-thumb { height: 72px; }
  .form-grid { grid-template-columns: 1fr; }
  .cta-band { grid-template-columns: 1fr; padding: 30px 24px; }
  .cta-actions .btn { width: 100%; }
  .tl-item { grid-template-columns: 16px minmax(0, 1fr); }
  .tl-date { grid-column: 2; text-align: left; padding-top: 0; margin-bottom: 2px; }
  .tl-dot { grid-row: 1 / span 2; margin-top: 4px; }
  .filter-label { width: 100%; padding-top: 0; }
  .filter-row { flex-direction: column; gap: 6px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .kpi-row { grid-template-columns: 1fr; }
  .ha-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 窄屏只留头像，姓名放进下拉菜单，避免撑破页头 */
  .user-meta { display: none; }
  .user-btn { padding: 5px; }
  .user-drop { min-width: 190px; right: -4px; }
  .auth-logged .al-acts .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------------------- 列表页专用搜索框（不随导航隐藏） ---------------------- */
.list-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 14px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line-2);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.list-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.list-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 14.5px;
  color: var(--ink);
}
.list-search input::placeholder { color: var(--muted-2); }


/* ---------------------- 视频播放器（已配置视频地址时） ---------------------- */
.player-media {
  padding: 0;
  background: #05101E;
}
.player-media::after { display: none; }
/* 防下载：隐藏 Chromium / WebKit 播放器自带的下载按钮 */
.player-media video::-internal-media-controls-download-button { display: none; }
.player-media video::-webkit-media-controls-enclosure { overflow: hidden; }
.player-media video,
.player-media iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
  object-fit: contain;
}
.ps-hint { color: var(--muted-2); }

/* 课时条目可点击 */
.lesson { cursor: pointer; transition: background 0.18s; }
.lesson.active { background: rgba(37, 99, 235, 0.08); }
.lesson.active .lt { color: var(--brand); font-weight: 600; }
.lesson.active .lic { background: var(--grad); color: #fff; }


/* ---------------------- 右侧悬浮客服二维码 ----------------------
   站点内容宽 1240px，宽屏下容器两侧留白。这张卡片固定在右侧留白里、
   上下居中，滚动时始终可见。
   只在视口足够宽时才显示：卡片 150 + 右距 18 + 间隙 8 = 176，
   需要 (视口 - 1240) / 2 ≥ 176，即视口 ≥ 1592px。
   窄屏下留白不足，硬放会压住正文，所以直接隐藏（不占位、不报错）。 */
.qr-float {
  display: none;
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  width: 150px;
  padding: 10px 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: box-shadow 0.22s ease;
}
.qr-float:hover { box-shadow: var(--shadow-lg); }
.qr-float img {
  width: 130px;
  height: 130px;
  object-fit: contain;
  margin: 0 auto;
  border-radius: var(--r-sm);
  background: #fff;
}
.qr-float .qr-line {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  white-space: nowrap;
}
.qr-float .qr-name { margin-top: 8px; color: var(--ink, #0F172A); font-weight: 600; }
.qr-float .qr-tel { letter-spacing: 0.2px; }

@media (min-width: 1600px) {
  .qr-float { display: block; }
}

/* ICP link */
.icp-link { color: inherit; text-decoration: none; }
.icp-link:hover { color: #fff; text-decoration: underline; }
