/* ============================================================
   VS 学园 · 全站主题样式
   Visual Studio / VS Code 主题色 + 游戏化 UI
   ============================================================ */
:root {
  --vs-blue: #007acc;
  --vs-blue-light: #2ea8ff;
  --vs-dark: #1e1e1e;
  --vs-darker: #141418;
  --vs-panel: #252526;
  --vs-purple: #68217a;
  --gold: #ffc83d;
  --green: #4ec9b0;
  --orange: #f78c3c;
  --pink: #ff6b9d;
  --text: #e8e8ef;
  --text-dim: #9d9db4;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --mono: "Cascadia Code", Consolas, "Courier New", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(104, 33, 122, .35), transparent 60%),
    radial-gradient(1000px 500px at -10% 20%, rgba(0, 122, 204, .30), transparent 55%),
    linear-gradient(160deg, #12121a 0%, #1a1a2e 55%, #16213e 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: var(--vs-blue); color: #fff; }

a { color: var(--vs-blue-light); text-decoration: none; }

/* ---------- 漂浮背景装饰 ---------- */
#bgfx { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
#bgfx span {
  position: absolute;
  opacity: .10;
  font-size: 28px;
  animation: bgfloat linear infinite;
  user-select: none;
}
@keyframes bgfloat {
  0%   { transform: translateY(20vh) rotate(0deg); }
  100% { transform: translateY(-120vh) rotate(360deg); }
}

/* ---------- 顶部导航 ---------- */
#topnav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(20, 20, 30, .82);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: 1px; }
.logo .logo-ico {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--vs-blue), var(--vs-purple));
  font-size: 22px; box-shadow: 0 0 18px rgba(0, 122, 204, .6);
  animation: logoglow 2.4s ease-in-out infinite;
}
@keyframes logoglow { 0%,100% { box-shadow: 0 0 12px rgba(0,122,204,.5);} 50% { box-shadow: 0 0 26px rgba(110,168,255,.85);} }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-dim); padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 15px;
  transition: all .2s;
}
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, .08); transform: translateY(-2px); }
.nav-links a.active { color: #fff; background: linear-gradient(135deg, var(--vs-blue), #3a7bd5); box-shadow: 0 4px 14px rgba(0, 122, 204, .45); }

.xp-box { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lv-badge {
  padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; white-space: nowrap;
  background: linear-gradient(135deg, var(--gold), #ff9d3c); color: #3d2800;
  box-shadow: 0 3px 10px rgba(255, 184, 61, .4);
}
.xp-bar-wrap { width: 130px; }
.xp-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.xp-bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #00c6ff, var(--gold)); transition: width .6s ease; }
.xp-num { font-size: 11px; color: var(--text-dim); text-align: right; margin-top: 3px; }

.sound-btn {
  cursor: pointer; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06);
  border-radius: 10px; padding: 6px 10px; font-size: 16px; color: var(--text); transition: .2s;
}
.sound-btn:hover { background: rgba(255,255,255,.14); transform: scale(1.08); }

/* ---------- 通用布局 ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 34px 20px 80px; position: relative; z-index: 1; }

.section-title { text-align: center; margin: 46px 0 10px; font-size: clamp(24px, 3.4vw, 34px); font-weight: 900; }
.section-title em { font-style: normal; background: linear-gradient(90deg, #4fc3f7, var(--gold), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-sub { text-align: center; color: var(--text-dim); margin-bottom: 26px; font-size: 15px; }

.card {
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(0, 198, 255, .45); box-shadow: 0 16px 40px rgba(0, 122, 204, .30); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: none; border-radius: 999px; padding: 12px 26px;
  font-size: 16px; font-weight: 800; font-family: inherit; color: #fff;
  background: linear-gradient(135deg, var(--vs-blue), #3a7bd5);
  box-shadow: 0 6px 18px rgba(0, 122, 204, .45);
  transition: transform .15s ease, box-shadow .2s, filter .2s;
}
.btn:hover { transform: translateY(-3px) scale(1.03); filter: brightness(1.1); }
.btn:active { transform: scale(.96); }
.btn.gold { background: linear-gradient(135deg, #ffd34d, #ff9d3c); color: #4a2e00; box-shadow: 0 6px 18px rgba(255, 184, 61, .4); }
.btn.green { background: linear-gradient(135deg, #35e08c, #0aa860); box-shadow: 0 6px 18px rgba(30, 200, 120, .35); }
.btn.pink { background: linear-gradient(135deg, #ff6b9d, #d63d8f); box-shadow: 0 6px 18px rgba(255, 107, 157, .35); }
.btn.purple { background: linear-gradient(135deg, #a05ee0, #68217a); box-shadow: 0 6px 18px rgba(140, 70, 200, .4); }
.btn.ghost { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); box-shadow: none; }
.btn.small { padding: 8px 16px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.tag {
  display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(0, 198, 255, .15); color: #7fdcff; border: 1px solid rgba(0, 198, 255, .3);
}

kbd {
  font-family: var(--mono); font-size: .85em; padding: 3px 9px; border-radius: 7px;
  background: linear-gradient(180deg, #3a3a4a, #26263a);
  border: 1px solid rgba(255,255,255,.18); border-bottom-width: 3px;
  color: #ffe08a; white-space: nowrap;
}

/* ---------- Toast 通知 ---------- */
#toast-zone { position: fixed; top: 74px; right: 18px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: rgba(30, 30, 45, .95); border: 1px solid rgba(0, 198, 255, .4);
  border-radius: 14px; padding: 12px 18px; font-weight: 700; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: toastin .35s cubic-bezier(.2, 1.4, .4, 1);
}
.toast .t-ico { font-size: 22px; }
.toast.gold { border-color: rgba(255, 200, 61, .55); }
@keyframes toastin { from { transform: translateX(120%) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.out { animation: toastout .3s forwards; }
@keyframes toastout { to { transform: translateX(120%); opacity: 0; } }

/* ---------- 彩带礼花 ---------- */
.confetti-bit {
  position: fixed; z-index: 998; font-size: 20px; pointer-events: none;
  animation: confall 1.6s ease-in forwards;
}
@keyframes confall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--cx), var(--cy)) rotate(720deg); opacity: 0; }
}

/* ---------- 首页 Hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 34px; align-items: center; padding: 46px 0 10px; }
.hero h1 { font-size: clamp(32px, 4.6vw, 54px); line-height: 1.2; font-weight: 900; }
.hero h1 .hl { background: linear-gradient(90deg, #4fc3f7, #b388ff, #ffd54f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { margin: 16px 0 24px; color: var(--text-dim); font-size: 17px; line-height: 1.8; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-art { position: relative; display: grid; place-items: center; }
.hero-art .mascot {
  font-size: clamp(90px, 12vw, 150px);
  animation: bob 3s ease-in-out infinite;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .5));
}
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-3deg);} 50% { transform: translateY(-16px) rotate(3deg);} }
.float-chip {
  position: absolute; padding: 8px 14px; border-radius: 12px; font-weight: 800; font-size: 14px;
  background: rgba(30,30,50,.9); border: 1px solid rgba(255,255,255,.16); box-shadow: var(--shadow);
  animation: bob 3.6s ease-in-out infinite;
}
.float-chip.c1 { top: 8%; left: 2%; animation-delay: .3s; }
.float-chip.c2 { bottom: 14%; right: 0%; animation-delay: .9s; }
.float-chip.c3 { top: 40%; right: -2%; animation-delay: 1.5s; }
.float-chip.c4 { bottom: 4%; left: 12%; animation-delay: .6s; }

/* ---------- 统计条 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 30px 0 8px; }
.stat-cell { text-align: center; padding: 16px 8px; }
.stat-cell .num { font-size: 30px; font-weight: 900; background: linear-gradient(90deg, #4fc3f7, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-cell .lab { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* ---------- 游戏大厅卡片 ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.game-card { position: relative; overflow: hidden; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.game-card .g-emoji {
  font-size: 56px; line-height: 1;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.45));
  transition: transform .3s cubic-bezier(.2, 1.6, .4, 1);
}
.game-card:hover .g-emoji { transform: scale(1.22) rotate(-8deg); }
.game-card h3 { font-size: 20px; }
.game-card p { color: var(--text-dim); font-size: 14px; line-height: 1.7; flex: 1; }
.game-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); flex-wrap: wrap; }
.diff { color: var(--gold); letter-spacing: 2px; }
.game-card .best { color: var(--green); font-weight: 800; }
.game-card::before {
  content: ""; position: absolute; inset: -60% -20% auto auto; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(0,198,255,.18), transparent 70%); pointer-events: none;
}
.game-card .glow-tag { position: absolute; top: 14px; right: 14px; }

/* ---------- 学习路线图 ---------- */
.roadmap { position: relative; display: grid; gap: 18px; margin-top: 10px; }
.roadmap::before {
  content: ""; position: absolute; left: 39px; top: 20px; bottom: 20px; width: 4px;
  background: linear-gradient(180deg, var(--vs-blue-light), var(--purple, #a05ee0), var(--pink)); border-radius: 4px; opacity: .5;
}
.road-item { display: flex; gap: 18px; align-items: center; padding: 16px 20px; cursor: pointer; position: relative; }
.road-item .r-ico {
  width: 64px; height: 64px; min-width: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 32px;
  background: linear-gradient(135deg, #26264a, #1b1b30); border: 2px solid rgba(0,198,255,.35);
  box-shadow: 0 0 16px rgba(0, 122, 204, .25); z-index: 1;
  transition: transform .25s;
}
.road-item:hover .r-ico { transform: scale(1.14) rotate(-6deg); }
.road-item h4 { font-size: 17px; margin-bottom: 4px; }
.road-item p { color: var(--text-dim); font-size: 13.5px; line-height: 1.6; }
.road-item .r-go { margin-left: auto; font-size: 22px; opacity: .6; transition: .2s; }
.road-item:hover .r-go { transform: translateX(6px); opacity: 1; }
.road-item.done .r-ico { border-color: #35e08c; box-shadow: 0 0 16px rgba(53, 224, 140, .4); }

/* ---------- 知识翻牌 ---------- */
.flip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.flip-card { perspective: 900px; height: 190px; cursor: pointer; background: none; border: none; }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.3, 1.2, .4, 1); transform-style: preserve-3d; }
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 18px; text-align: center;
  background: linear-gradient(150deg, #232345, #191932); border: 1px solid rgba(255,255,255,.12); box-shadow: var(--shadow);
}
.flip-face.back { transform: rotateY(180deg); background: linear-gradient(150deg, #0e3a5c, #123d54); border-color: rgba(0,198,255,.4); }
.flip-face .f-emoji { font-size: 44px; }
.flip-face h4 { font-size: 16px; }
.flip-face p { font-size: 12.5px; color: var(--text-dim); line-height: 1.7; }
.flip-hint { font-size: 12px; color: var(--text-dim); }

/* ---------- 成就墙 ---------- */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.ach-card { padding: 20px 16px; text-align: center; }
.ach-card .a-ico { font-size: 42px; filter: grayscale(1) opacity(.35); transition: .4s; }
.ach-card h5 { margin-top: 8px; font-size: 15px; }
.ach-card p { font-size: 12px; color: var(--text-dim); margin-top: 5px; line-height: 1.6; }
.ach-card.unlocked { border-color: rgba(255, 200, 61, .5); background: linear-gradient(160deg, rgba(255,200,61,.10), rgba(255,157,60,.05)); }
.ach-card.unlocked .a-ico { filter: none; animation: bob 2.6s ease-in-out infinite; }
.ach-card.unlocked h5 { color: var(--gold); }

/* ---------- 学习页课程卡 ---------- */
.lesson {
  padding: 28px; margin: 26px 0; scroll-margin-top: 90px;
  border-left: 5px solid var(--vs-blue);
}
.lesson.purple { border-left-color: #a05ee0; }
.lesson.green { border-left-color: var(--green); }
.lesson.orange { border-left-color: var(--orange); }
.lesson.pink { border-left-color: var(--pink); }
.lesson.gold { border-left-color: var(--gold); }
.lesson-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.lesson-head .l-emoji { font-size: 40px; }
.lesson-head h3 { font-size: 22px; }
.lesson-body { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.lesson-body .txt { line-height: 1.9; font-size: 14.5px; color: #cfd0e0; }
.lesson-body .txt b { color: #fff; }
.lesson-fig { background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 14px; display: grid; place-items: center; }
.lesson-fig svg { max-width: 100%; height: auto; }
.tip-box {
  margin-top: 14px; padding: 12px 16px; border-radius: 12px; font-size: 13.5px; line-height: 1.8;
  background: rgba(0, 198, 255, .08); border: 1px dashed rgba(0, 198, 255, .35); color: #bfeaff;
}
.lesson-actions { margin-top: 16px; display: flex; align-items: center; gap: 12px; }
.lesson.done-lesson { border-left-color: #35e08c; }
.done-flag { color: #35e08c; font-weight: 800; font-size: 14px; display: none; }
.lesson.done-lesson .done-flag { display: inline; }
.lesson.done-lesson .mark-btn { display: none; }

.hotkey-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hotkey-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.hotkey-table tr:hover td { background: rgba(255,255,255,.04); }

.ext-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ext-cell { text-align: center; padding: 14px 8px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); transition: .2s; }
.ext-cell:hover { transform: translateY(-4px); border-color: rgba(0,198,255,.4); }
.ext-cell .e-ico { font-size: 30px; }
.ext-cell h6 { margin-top: 6px; font-size: 13px; }
.ext-cell p { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

/* ---------- 页脚 ---------- */
footer { border-top: 1px solid rgba(255,255,255,.08); margin-top: 60px; position: relative; z-index: 1; }
.foot-inner { max-width: 1180px; margin: 0 auto; padding: 26px 20px; text-align: center; color: var(--text-dim); font-size: 13px; line-height: 2; }
.foot-inner .heart { color: var(--pink); }

/* ---------- 通用游戏页布局 ---------- */
.game-shell { max-width: 900px; margin: 0 auto; }
.game-topbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 24px 0 18px; }
.game-topbar .gt-title { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 900; }
.hud { display: flex; gap: 12px; margin-left: auto; flex-wrap: wrap; }
.hud .h-cell {
  padding: 8px 16px; border-radius: 12px; text-align: center; min-width: 86px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
}
.hud .h-cell .h-num { font-size: 20px; font-weight: 900; color: var(--gold); }
.hud .h-cell .h-lab { font-size: 11px; color: var(--text-dim); }
.arena {
  border-radius: var(--radius); padding: 30px; min-height: 320px;
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.1); box-shadow: var(--shadow);
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.center-msg { text-align: center; }
.center-msg .big { font-size: 64px; }
.center-msg h3 { margin: 10px 0 6px; font-size: 22px; }
.center-msg p { color: var(--text-dim); font-size: 14px; margin-bottom: 18px; line-height: 1.8; }

/* 弹跳提示 */
@keyframes popin { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.popin { animation: popin .3s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes shake { 0%,100% { transform: translateX(0);} 25% { transform: translateX(-8px);} 75% { transform: translateX(8px);} }
.shake { animation: shake .3s; }
@keyframes rise-fade { to { transform: translateY(-50px); opacity: 0; } }
.rise-fade { animation: rise-fade .8s forwards; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-cta { justify-content: center; }
  .hero-art { order: -1; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .lesson-body { grid-template-columns: 1fr; }
  .roadmap::before { left: 31px; }
  .road-item .r-ico { width: 48px; height: 48px; min-width: 48px; font-size: 26px; }
  .xp-box { width: 100%; justify-content: flex-start; }
}
