/* =======================================================================
 *  AI 成长学院 —— 视觉系统
 *  调性：年轻、有活力（娱乐直播气质），暗色 + 霓虹渐变，专业可读
 * ======================================================================= */
:root {
  --bg: #0b0c12;
  --bg-soft: #14161f;
  --card: rgba(255,255,255,.035);
  --card-solid: #161922;
  --card-hover: rgba(255,255,255,.06);
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.16);
  --text: #f1f2f7;
  --muted: #9aa1b5;
  --primary: #7c5cff;
  --primary-2: #c44be6;
  --pink: #ff5da2;
  --grad: linear-gradient(120deg, #7c5cff 0%, #c44be6 50%, #ff5da2 100%);
  --green: #34d27b;
  --blue: #4aa8ff;
  --purple: #b06bff;
  --orange: #ffae42;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 40px rgba(0,0,0,.45);
  --glow: 0 0 0 1px rgba(124,92,255,.5), 0 14px 40px rgba(124,92,255,.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* 背景极光 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(680px 380px at 82% -8%, rgba(124,92,255,.28), transparent 60%),
    radial-gradient(560px 360px at 12% 6%, rgba(255,93,162,.16), transparent 55%),
    radial-gradient(700px 500px at 50% 108%, rgba(74,168,255,.12), transparent 60%);
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
code { background: rgba(255,255,255,.08); padding: 2px 7px; border-radius: 6px; font-size: .9em; }

/* 进场动画 */
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page-in { animation: pageIn .4s cubic-bezier(.22,.7,.3,1); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,12,18,.72); backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 18px; letter-spacing: .2px; }
.brand-logo {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--grad); border-radius: 10px; font-size: 14px; color: #fff;
  box-shadow: 0 6px 18px rgba(196,75,230,.4);
}
.main-nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.main-nav a { padding: 8px 13px; border-radius: 10px; font-size: 14px; color: var(--muted); transition: .15s; }
.main-nav a:hover { color: var(--text); background: var(--card-hover); }
.main-nav a.active { color: #fff; background: linear-gradient(120deg, rgba(124,92,255,.9), rgba(196,75,230,.9)); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 23px; margin-left: auto; cursor: pointer; }
.nav-back { display: none; width: 38px; height: 38px; border: 0; background: none; color: var(--text);
  font-size: 32px; line-height: 1; cursor: pointer; padding: 0; margin: 0 -2px 0 -6px; }
.tabbar { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 52px 0 30px; }
.hero-glow {
  position: absolute; inset: -40px -10% auto; height: 280px; z-index: 0; pointer-events: none;
  background: radial-gradient(520px 220px at 70% 30%, rgba(124,92,255,.30), transparent 70%);
  filter: blur(8px);
}
.hero-row { position: relative; z-index: 1; display: flex; gap: 36px; align-items: center; justify-content: space-between; }
.hero-text { max-width: 640px; }
.eyebrow {
  display: inline-block; font-size: 12.5px; letter-spacing: .4px; color: #d9c9ff;
  background: rgba(124,92,255,.14); border: 1px solid rgba(124,92,255,.3);
  padding: 5px 12px; border-radius: 99px; margin-bottom: 16px;
}
.hero h1 { font-size: 46px; margin: 0 0 14px; line-height: 1.12; letter-spacing: -.5px; font-weight: 800; }
.hero .hl { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 18px; color: var(--muted); }
.hero-actions { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stat { flex: 0 0 auto; text-align: center; }

/* 进度环 */
.ring { position: relative; width: 150px; height: 150px; margin: 0 auto 10px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.ring .ring-bg { stroke: rgba(255,255,255,.08); }
.ring .ring-fg { stroke: url(#gradStroke); stroke: var(--primary-2); transition: stroke-dashoffset 1s cubic-bezier(.2,.7,.3,1); filter: drop-shadow(0 0 6px rgba(196,75,230,.6)); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font-size: 30px; display: block; line-height: 1; }
.ring-label span { font-size: 12px; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 12px 22px; border-radius: 12px;
  font-size: 15px; font-weight: 700; background: var(--card-solid); border: 1px solid var(--line-strong);
  color: var(--text); cursor: pointer; transition: .18s; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); border-color: var(--primary); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 26px rgba(196,75,230,.35); }
.btn.primary:hover { filter: brightness(1.07); box-shadow: 0 14px 32px rgba(196,75,230,.5); }
.btn.ghost { background: rgba(255,255,255,.04); }
.btn.small { padding: 7px 14px; font-size: 13px; }

/* ---------- Section headings ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 46px 0 16px; flex-wrap: wrap; }
.section-title { margin: 44px 0 16px; font-size: 23px; font-weight: 800; letter-spacing: -.3px; }
.section-head .section-title { margin: 0; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 18px; }
.stage-grid { grid-template-columns: repeat(2, 1fr); }
.quick-grid { grid-template-columns: repeat(4, 1fr); }
.role-grid { grid-template-columns: repeat(3, 1fr); }
.tool-grid { grid-template-columns: repeat(3, 1fr); }
.case-grid { grid-template-columns: repeat(2, 1fr); }
.badge-grid { grid-template-columns: repeat(5, 1fr); }
.quiz-grid { grid-template-columns: repeat(3, 1fr); }

/* ---------- Cards ---------- */
.card {
  position: relative; display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; transition: .2s; backdrop-filter: blur(6px);
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); background: var(--card-hover); }
.card h3 { margin: 10px 0 6px; font-size: 19px; font-weight: 700; }
.card-sub { display: inline-block; margin-top: 14px; font-weight: 700; font-size: 14px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Stage cards */
.stage-card { overflow: hidden; }
.stage-card::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; border-radius: 4px; opacity: .9; }
.stage-card.green::after { background: var(--green); }
.stage-card.blue::after { background: var(--blue); }
.stage-card.purple::after { background: var(--purple); }
.stage-card.orange::after { background: var(--orange); }
.stage-card.pink::after { background: var(--pink); }
.stage-card:hover::after { box-shadow: 0 0 16px currentColor; }
.stage-top { display: flex; align-items: center; justify-content: space-between; }
.stage-badge { font-size: 30px; }
.stage-pill { font-size: 12.5px; font-weight: 700; color: var(--muted); background: rgba(255,255,255,.06); border: 1px solid var(--line); padding: 4px 11px; border-radius: 99px; }
.stage-goal { color: var(--muted); font-size: 14.5px; margin: 6px 0 0; }
.mini-bar { height: 6px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; margin: 16px 0 2px; }
.mini-bar span { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .6s; }

/* Mini quick cards */
.mini { text-align: center; padding: 22px 16px; }
.mini span { font-size: 30px; display: block; margin-bottom: 8px; }
.mini b { display: block; font-size: 15px; }

/* Badges */
.badge { text-align: center; padding: 20px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); transition: .2s; }
.badge.on { border-color: rgba(196,75,230,.45); box-shadow: 0 0 0 1px rgba(196,75,230,.25), 0 10px 30px rgba(124,92,255,.15); }
.badge.off { opacity: .55; }
.badge:hover { transform: translateY(-3px); }
.badge-ic { font-size: 34px; line-height: 1; margin-bottom: 8px; }
.badge.on .badge-ic { filter: drop-shadow(0 0 10px rgba(255,174,66,.5)); }
.badge b { display: block; font-size: 15px; margin-bottom: 3px; }

/* Role cards */
.role-card { }
.role-icon { width: 56px; height: 56px; display: grid; place-items: center; font-size: 30px; border-radius: 15px;
  background: linear-gradient(135deg, rgba(124,92,255,.22), rgba(255,93,162,.18)); border: 1px solid var(--line); }
.role-icon.big { width: 76px; height: 76px; font-size: 42px; border-radius: 20px; }

.tool-card b { font-size: 16px; }

/* ---------- Stage / role head ---------- */
.stage-head { display: flex; gap: 18px; align-items: flex-start; padding: 24px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); margin: 10px 0 26px; backdrop-filter: blur(6px); }
.stage-head .stage-badge { font-size: 38px; }
.stage-head h1 { margin: 0 0 4px; font-size: 27px; }
.stage-head.green { box-shadow: inset 4px 0 0 var(--green); }
.stage-head.blue { box-shadow: inset 4px 0 0 var(--blue); }
.stage-head.purple { box-shadow: inset 4px 0 0 var(--purple); }
.stage-head.orange { box-shadow: inset 4px 0 0 var(--orange); }
.stage-head.pink { box-shadow: inset 4px 0 0 var(--pink); }
.role-head { display: flex; gap: 20px; align-items: center; margin: 10px 0 12px; }
.role-head h1 { margin: 0 0 4px; }

/* ---------- Lesson list ---------- */
.lesson-list { display: flex; flex-direction: column; gap: 11px; }
.lesson-row {
  display: flex; align-items: center; gap: 16px; padding: 17px 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: .16s;
}
.lesson-row:hover { border-color: var(--primary); transform: translateX(5px); background: var(--card-hover); }
.lesson-row.done { opacity: .68; }
.lesson-num { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.08); font-weight: 800; font-size: 14px; }
.lesson-row.done .lesson-num { background: var(--green); color: #05230f; }
.lesson-main { display: flex; flex-direction: column; flex: 1; }
.lesson-main b { font-size: 15.5px; }
.lesson-main em { font-style: normal; font-size: 13px; color: var(--muted); }
.lesson-mins { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---------- Lesson body ---------- */
.lesson { max-width: 780px; }
.lesson h1 { font-size: 30px; margin-bottom: 4px; letter-spacing: -.3px; }
.lesson-body { margin: 22px 0 28px; font-size: 16px; }
.lesson-body h3 { margin: 26px 0 10px; font-size: 19px; }
.lesson-body ul { padding-left: 22px; }
.lesson-body li { margin: 6px 0; }

.callout {
  background: linear-gradient(120deg, rgba(124,92,255,.12), rgba(74,168,255,.07));
  border: 1px solid rgba(124,92,255,.28); border-left: 4px solid var(--primary);
  padding: 15px 18px; border-radius: 12px; margin: 20px 0;
}
.callout.warn { border-color: rgba(255,174,66,.3); border-left-color: var(--orange);
  background: linear-gradient(120deg, rgba(255,174,66,.12), rgba(255,93,162,.06)); }
.callout a { font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Lesson prev/next */
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.lesson-nav .btn { max-width: 48%; overflow: hidden; text-overflow: ellipsis; }
.lesson-nav .nav-next { margin-left: auto; }

/* ---------- Task table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.task-table { width: 100%; border-collapse: collapse; background: var(--card); }
.task-table th, .task-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.task-table th { background: rgba(255,255,255,.04); font-size: 13.5px; color: var(--muted); font-weight: 700; }
.task-table tr:last-child td { border-bottom: 0; }
.task-table tbody tr { transition: .12s; }
.task-table tbody tr:hover { background: var(--card-hover); }
.tools-cell { font-size: 14px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; }

/* ---------- Prompts ---------- */
.prompt-toolbar { margin: 20px 0; display: flex; flex-direction: column; gap: 13px; }
.search-input { width: 100%; padding: 12px 16px; border-radius: 12px; font-size: 15px;
  background: var(--card-solid); border: 1px solid var(--line-strong); color: var(--text); font-family: inherit; }
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,92,255,.2); }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { padding: 7px 15px; border-radius: 99px; font-size: 13px; cursor: pointer; transition: .15s;
  background: var(--card-solid); border: 1px solid var(--line-strong); color: var(--muted); font-family: inherit; }
.chip:hover { color: var(--text); border-color: var(--primary); }
.chip.active { background: var(--grad); border-color: transparent; color: #fff; font-weight: 700; }
.prompt-list { display: flex; flex-direction: column; gap: 15px; }
.prompt-card { padding: 20px; }
.prompt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.tag { font-size: 12px; padding: 4px 11px; border-radius: 99px; background: var(--grad); color: #fff; font-weight: 700; }
.prompt-text { white-space: pre-wrap; background: rgba(0,0,0,.32); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font-size: 14px; color: #d6dbec; margin: 0 0 13px; font-family: inherit; line-height: 1.75; }

/* ---------- Cases ---------- */
.case-card h3 { margin: 12px 0 8px; }

/* ---------- Quiz ---------- */
.quiz-card .stage-badge { font-size: 32px; }
.quiz-q { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 16px 0; }
.quiz-stem { margin: 0 0 15px; font-size: 16.5px; }
.quiz-options { display: flex; flex-direction: column; gap: 11px; }
.quiz-opt { text-align: left; padding: 12px 16px; border-radius: 11px; font-size: 15px; cursor: pointer;
  background: var(--card-solid); border: 1px solid var(--line-strong); color: var(--text); font-family: inherit; transition: .13s; }
.quiz-opt:hover { border-color: var(--primary); transform: translateX(3px); }
.quiz-opt.chosen { border-color: var(--primary); background: rgba(124,92,255,.16); }
.quiz-opt.right { border-color: var(--green); background: rgba(52,210,123,.14); }
.quiz-opt.wrong { border-color: var(--pink); background: rgba(255,93,162,.14); }
.quiz-explain { margin-top: 13px; padding: 11px 15px; border-radius: 10px;
  background: rgba(74,168,255,.1); border-left: 3px solid var(--blue); font-size: 14px; color: #cfd6ea; }
.quiz-bar { display: flex; align-items: center; gap: 18px; margin: 24px 0 8px; flex-wrap: wrap; }
.quiz-score { font-size: 17px; font-weight: 700; }
.quiz-score.pass { color: var(--green); }
.quiz-score.fail { color: var(--orange); }

/* ---------- Crumb ---------- */
.crumb { font-size: 13px; color: var(--muted); margin: 24px 0 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb a:hover { color: var(--text); }
.crumb .sep { opacity: .45; }

/* ---------- Assistant ---------- */
.assistant-fab { position: fixed; right: 24px; bottom: 24px; width: 58px; height: 58px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center; font-size: 25px; box-shadow: 0 10px 30px rgba(196,75,230,.5); z-index: 60; transition: .18s; }
.assistant-fab:hover { transform: scale(1.1) rotate(-6deg); }
.assistant-placeholder { margin-top: 20px; height: 320px; display: grid; place-items: center; font-size: 18px; color: var(--muted);
  background: var(--card); border: 2px dashed var(--line-strong); border-radius: var(--radius); }

/* ---------- Logo image ---------- */
.brand-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 70px; padding: 30px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.site-footer p { margin: 4px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stage-grid, .role-grid, .tool-grid, .case-grid, .quiz-grid { grid-template-columns: 1fr; }
  .quick-grid, .badge-grid { grid-template-columns: repeat(2, 1fr); }

  /* 内容不被底部 Tab 栏 / 悬浮按钮遮挡 */
  #app { padding-bottom: 92px; }

  /* 顶部返回键：非首页显示 */
  body:not(.at-home) .nav-back { display: grid; place-items: center; }

  /* 底部快捷导航栏 */
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    background: rgba(11,12,18,.92); backdrop-filter: blur(16px) saturate(1.3);
    border-top: 1px solid var(--line); padding: 6px 4px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 11px; color: var(--muted); padding: 6px 0; border-radius: 10px; transition: .15s; }
  .tabbar a span { font-size: 21px; line-height: 1; }
  .tabbar a.active { color: #fff; }
  .tabbar a.active span { filter: drop-shadow(0 0 8px rgba(196,75,230,.75)); }

  /* 悬浮答疑按钮上移，避开底部栏 */
  .assistant-fab { width: 50px; height: 50px; right: 16px; bottom: 80px; font-size: 21px; }

  /* Hero：标题/行动优先，进度做成下方紧凑卡片 */
  .hero { padding: 30px 0 16px; }
  .hero-row { flex-direction: column; align-items: stretch; gap: 18px; }
  .hero h1 { font-size: 32px; }
  .hero-sub { font-size: 16px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 100%; justify-content: center; text-align: center; white-space: normal; }
  .hero-stat { display: flex; align-items: center; gap: 16px; text-align: left;
    padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
  .hero-stat .center { text-align: left; margin: 0; }
  .ring { width: 88px; height: 88px; margin: 0; flex: 0 0 88px; }
  .ring-label b { font-size: 23px; }

  /* 标题区在窄屏换行更自然 */
  .section-head { margin: 34px 0 14px; }

  .nav-toggle { display: block; }
  .main-nav { position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 8px; display: none;
    max-height: calc(100vh - 66px); overflow-y: auto; box-shadow: var(--shadow); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px; border-radius: 9px; }
}
