/* ============================================
   红队成长路线 · 深色科技风样式
   52huanke.com/roadmap
   ============================================ */

:root {
  --bg: #0a0e17;
  --bg2: #0d1420;
  --card: #111827;
  --card2: #16203a;
  --border: #1f2b47;
  --border-hi: #2d3f66;
  --text: #e6edf3;
  --text2: #8b98b3;
  --text3: #5a6880;
  --green: #00e676;
  --cyan: #00d4ff;
  --purple: #8b5cf6;
  --red: #ff5252;
  --yellow: #ffd740;
  --grad: linear-gradient(135deg, #00d4ff, #00e676);
  --grad2: linear-gradient(135deg, #8b5cf6, #00d4ff);
  --glow: 0 0 24px rgba(0, 212, 255, .25);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 920px; margin: 0 auto; padding: 0 18px 90px; }

/* ===== 顶栏（毛玻璃） ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 23, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  margin-bottom: 0;
}
.topbar .wrap { padding-bottom: 0; display: flex; align-items: center; justify-content: space-between; }
.topbar .brand { font-size: 15px; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: .5px; font-family: Consolas, "Courier New", monospace; }
.topbar .brand::before {
  content: '>_ ';
  color: var(--green);
  font-weight: 800;
  text-shadow: 0 0 8px rgba(0, 230, 118, .85);
}
.topbar .brand::after {
  content: '▊';
  color: var(--green);
  margin-left: 5px;
  animation: brandBlink 1.1s step-end infinite;
}
@keyframes brandBlink { 50% { opacity: 0; } }
.topbar .brand .dot { color: var(--green); }
.topbar .brand span { font-weight: 400; color: var(--cyan); text-shadow: 0 0 10px rgba(0, 212, 255, .45); opacity: .95; font-size: 13px; margin-left: 8px; }
.topbar .back { color: var(--text2); text-decoration: none; font-size: 13px; border: 1px solid var(--border-hi); padding: 4px 13px; border-radius: 20px; transition: all .2s; }
.topbar .back:hover { color: var(--cyan); border-color: var(--cyan); box-shadow: var(--glow); }

/* ===== HERO ===== */
.hero {
  position: relative;
  text-align: center;
  padding: 72px 20px 56px;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0, 212, 255, .13), transparent),
    radial-gradient(ellipse 40% 40% at 80% 20%, rgba(139, 92, 246, .10), transparent);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(45, 63, 102, .18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 63, 102, .18) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000, transparent);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000, transparent);
  pointer-events: none;
}
.hero h1 {
  position: relative;
  font-size: 38px; font-weight: 800; letter-spacing: 1px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 14px;
}
.hero .sub { position: relative; color: var(--text2); font-size: 15px; margin-bottom: 22px; }
.hero .type-line {
  position: relative;
  display: inline-block;
  font-family: Consolas, Monaco, monospace;
  font-size: 14px; color: var(--green);
  background: rgba(0, 230, 118, .07);
  border: 1px solid rgba(0, 230, 118, .25);
  border-radius: 8px;
  padding: 8px 18px;
  min-height: 38px;
}
.hero .type-line::after {
  content: '▊';
  animation: blink 1s step-end infinite;
  color: var(--green);
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* ===== 总进度 ===== */
.overall {
  display: flex; align-items: center; justify-content: center; gap: 26px;
  margin: 30px 0 8px; position: relative;
}
.ring {
  --p: 0;
  width: 92px; height: 92px; border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--card2) 0);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.ring::before {
  content: '';
  position: absolute; inset: 7px; border-radius: 50%;
  background: var(--bg);
}
.ring .num { position: relative; font-size: 20px; font-weight: 800; color: var(--green); font-family: Consolas, monospace; }
.overall .desc { text-align: left; }
.overall .desc .t1 { font-size: 15px; font-weight: 600; }
.overall .desc .t2 { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* ===== 阶段卡片 ===== */
.stage-list { margin-top: 34px; }

.stage {
  position: relative;
  display: block;
  background: linear-gradient(180deg, var(--card), var(--bg2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 26px 22px 30px;
  margin-bottom: 16px;
  text-decoration: none; color: inherit;
  overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.stage:hover { transform: translateY(-3px); border-color: var(--border-hi); box-shadow: 0 10px 30px rgba(0, 0, 0, .45), var(--glow); }
.stage .big-num {
  position: absolute; right: 14px; top: -18px;
  font-size: 96px; font-weight: 900;
  color: rgba(139, 152, 179, .07);
  font-family: Consolas, monospace;
  pointer-events: none; line-height: 1;
}
.stage .head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.stage .icon { font-size: 24px; }
.stage .title { font-size: 17px; font-weight: 700; }
.stage .badge {
  font-size: 11px; padding: 2px 10px; border-radius: 12px;
  border: 1px solid var(--border-hi); color: var(--text2);
}
.stage .badge.done { color: var(--green); border-color: rgba(0, 230, 118, .45); background: rgba(0, 230, 118, .08); }
.stage .badge.ready { color: var(--cyan); border-color: rgba(0, 212, 255, .45); background: rgba(0, 212, 255, .08); }
.stage .badge.soon { color: var(--text3); }
.stage .desc { font-size: 13.5px; color: var(--text2); margin-bottom: 12px; }
.stage .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.stage .tag {
  font-size: 12px; color: var(--cyan);
  background: rgba(0, 212, 255, .08);
  border: 1px solid rgba(0, 212, 255, .2);
  padding: 2px 10px; border-radius: 6px;
}
.stage .bar { height: 6px; background: var(--card2); border-radius: 3px; overflow: hidden; }
.stage .bar i { display: block; height: 100%; background: var(--grad); border-radius: 3px; width: 0; transition: width .6s ease; }
.stage .pct { font-size: 12px; color: var(--text2); margin-top: 7px; font-family: Consolas, monospace; }
.stage.locked { opacity: .68; }
.stage.locked:hover { transform: none; box-shadow: none; }

/* ===== 内容页通用 ===== */
.page-head { text-align: center; padding: 40px 16px 26px; position: relative; }
.page-head .stage-no {
  display: inline-block; font-family: Consolas, monospace; font-size: 12px;
  color: var(--green); border: 1px solid rgba(0, 230, 118, .35);
  background: rgba(0, 230, 118, .07);
  padding: 3px 14px; border-radius: 20px; margin-bottom: 14px; letter-spacing: 2px;
}
.page-head h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.page-head .meta { font-size: 13px; color: var(--text2); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 30px;
  margin-bottom: 22px;
}

/* ===== 讲解区 ===== */
.lesson h2 {
  font-size: 17px; color: var(--cyan);
  margin: 30px 0 12px; padding-left: 12px;
  border-left: 3px solid var(--cyan);
}
.lesson h2:first-child { margin-top: 0; }
.lesson h3 { font-size: 15px; color: var(--text); margin: 20px 0 8px; }
.lesson p { margin-bottom: 12px; font-size: 14.5px; color: #c3cddd; }
.lesson ul, .lesson ol { margin: 0 0 14px 22px; font-size: 14.5px; color: #c3cddd; }
.lesson li { margin-bottom: 6px; }
.lesson .highlight {
  background: rgba(0, 212, 255, .07); border-left: 3px solid var(--cyan);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 14px 0;
  font-size: 13.5px; color: #9fdcff;
}
.lesson .warning {
  background: rgba(255, 215, 64, .07); border-left: 3px solid var(--yellow);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 14px 0;
  font-size: 13.5px; color: #ffe082;
}
.lesson .case {
  background: rgba(0, 230, 118, .07); border-left: 3px solid var(--green);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 14px 0;
  font-size: 13.5px; color: #7dffb8;
}
.lesson code {
  background: rgba(139, 92, 246, .12); padding: 2px 7px; border-radius: 4px;
  font-family: Consolas, Monaco, monospace; font-size: 13px; color: #c9b6ff;
}
.lesson pre {
  background: #0a0f1c; border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px; margin: 12px 0;
  overflow-x: auto;
}
.lesson pre code {
  background: none; padding: 0; color: #8fe3b0;
  font-size: 13px; line-height: 1.6;
}

/* ===== 答题区 ===== */
.quiz-section-title { font-size: 19px; font-weight: 800; margin: 40px 0 6px; text-align: center; }
.quiz-progress { text-align: center; font-size: 13px; color: var(--text2); margin-bottom: 20px; font-family: Consolas, monospace; }

.q-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px 26px; margin-bottom: 16px;
}
.q-stem { font-size: 14.5px; font-weight: 600; margin-bottom: 14px; }
.q-stem .q-no { color: var(--cyan); margin-right: 6px; font-family: Consolas, monospace; }
.q-stem .q-type {
  font-size: 11px; font-weight: 400; background: rgba(0, 212, 255, .1);
  color: var(--cyan); padding: 2px 8px; border-radius: 10px; margin-left: 8px; vertical-align: middle;
}

.q-options { list-style: none; }
.q-option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; margin-bottom: 8px;
  border: 1.5px solid var(--border); border-radius: 8px;
  cursor: pointer; transition: all .15s; font-size: 14px; color: #c3cddd;
}
.q-option:hover { border-color: var(--border-hi); background: rgba(0, 212, 255, .04); }
.q-option.selected { border-color: var(--cyan); background: rgba(0, 212, 255, .08); color: var(--text); }
.q-option .opt-key {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--card2); color: var(--text2); font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.q-option.selected .opt-key { background: var(--cyan); color: #04121f; }
.q-option.correct { border-color: var(--green); background: rgba(0, 230, 118, .08); }
.q-option.correct .opt-key { background: var(--green); color: #04170c; }
.q-option.wrong { border-color: var(--red); background: rgba(255, 82, 82, .08); }
.q-option.wrong .opt-key { background: var(--red); color: #fff; }
.q-option.locked { pointer-events: none; }

.q-actions { margin-top: 14px; display: flex; align-items: center; gap: 12px; }
.btn {
  border: 0; border-radius: 8px; padding: 9px 26px; font-size: 14px;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.btn-primary { background: var(--grad); color: #04121f; font-weight: 700; }
.btn-primary:hover { box-shadow: var(--glow); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: var(--card2); color: var(--text2); }
.btn-ghost:hover { color: var(--text); }

.q-result { margin-top: 12px; padding: 12px 16px; border-radius: 8px; font-size: 13.5px; display: none; }
.q-result.show { display: block; }
.q-result.right { background: rgba(0, 230, 118, .07); border: 1px solid rgba(0, 230, 118, .35); color: #7dffb8; }
.q-result.wrong { background: rgba(255, 82, 82, .07); border: 1px solid rgba(255, 82, 82, .35); color: #ff9d9d; }
.q-result .ans-line { font-weight: 600; margin-bottom: 6px; }
.q-result .explain { font-weight: 400; color: #aab6c9; }
.q-result .explain code { background: rgba(139, 92, 246, .12); padding: 1px 6px; border-radius: 4px; color: #c9b6ff; }

/* ===== 底部导航 ===== */
.chapter-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; }
.chapter-nav a {
  text-decoration: none; color: var(--cyan); font-size: 13.5px;
  padding: 11px 20px; border-radius: 9px;
  background: var(--card); border: 1px solid var(--border);
  transition: all .2s;
}
.chapter-nav a:hover { border-color: var(--cyan); box-shadow: var(--glow); }
.chapter-nav a.disabled { opacity: .4; pointer-events: none; }

/* ===== 页脚 ===== */
.foot {
  text-align: center; padding: 30px 16px;
  color: var(--text3); font-size: 12.5px;
  border-top: 1px solid var(--border); margin-top: 50px;
}
.foot a { color: var(--text2); text-decoration: none; }
.foot a:hover { color: var(--cyan); }

/* ===== 移动端 ===== */
@media (max-width: 640px) {
  .wrap { padding: 0 13px 70px; }
  .hero { padding: 50px 14px 40px; }
  .hero h1 { font-size: 26px; }
  .hero .sub { font-size: 13.5px; }
  .card { padding: 20px 16px; }
  .stage { padding: 20px 16px 18px 20px; }
  .stage .big-num { font-size: 68px; }
  .q-card { padding: 18px 15px; }
  .topbar .brand span { display: none; }
  .chapter-nav { flex-direction: column; }
  .overall { flex-direction: column; gap: 14px; }
  .overall .desc { text-align: center; }
}

/* ============================================
   黑客风增强包 v2（全站视觉强化）
   ============================================ */

/* 1. 全局 CRT 扫描线 */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(0deg,
    rgba(0, 0, 0, .14) 0px, rgba(0, 0, 0, .14) 1px,
    transparent 1px, transparent 3px);
  pointer-events: none;
  z-index: 99999;
  opacity: .28;
}

/* 2. 自定义滚动条（霓虹渐变） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0e17; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #00d4ff, #00e676);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: #00e676; }

/* 3. 文字选中 */
::selection { background: rgba(0, 230, 118, .35); color: #fff; }

/* 4. 顶栏霓虹底线 */
.topbar {
  border-bottom: 1px solid rgba(0, 212, 255, .3);
  box-shadow: 0 2px 24px rgba(0, 212, 255, .12);
}

/* 5. 标题终端前缀 */
.page-head h1::before {
  content: '// ';
  color: var(--green);
  opacity: .75;
}
.lesson h2::before {
  content: '> ';
  color: var(--green);
  font-family: Consolas, monospace;
}

/* 6. 阶段卡片扫描光效 */
.stage { position: relative; }
.stage::before {
  content: '';
  position: absolute; top: 0; left: -110%;
  width: 55%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, .09), transparent);
  transition: left .65s ease;
  pointer-events: none;
}
.stage:hover::before { left: 130%; }

/* 7. Hero 标题霓虹呼吸 */
.hero h1 { animation: heroGlow 3.2s ease-in-out infinite; }
@keyframes heroGlow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(0, 212, 255, .3)); }
  50% { filter: drop-shadow(0 0 26px rgba(0, 230, 118, .5)); }
}

/* 8. 页脚终端风 */
.foot { font-family: Consolas, "Courier New", monospace; font-size: 12px; }

/* 9. 答题卡片 hover 微光 */
.q-card:hover { border-color: rgba(0, 212, 255, .35); }

/* 10. 统计卡片数字脉冲 */
.stat-card .num { animation: numPulse 2.8s ease-in-out infinite; }
@keyframes numPulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(0, 212, 255, .25)); }
  50% { filter: drop-shadow(0 0 14px rgba(0, 230, 118, .45)); }
}
