/* LinguaVoyage 语航 · 样式(暗色主题,自行演变) */
:root {
  --bg:#0b1020; --bg2:#111827; --panel:#1a1f35; --panel2:#222840;
  --line:rgba(255,255,255,.08);
  --acc:#6366f1; --acc2:#22d3ee; --acc3:#ffd166; --warn:#f87171; --ok:#34d399;
  --grad:linear-gradient(135deg,#6366f1,#22d3ee); --grad2:linear-gradient(135deg,#6366f1,#ec4899);
  --muted:#94a3b8; --dim:#64748b;
  --radius:12px; --shadow:0 8px 30px rgba(0,0,0,.35);
  --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --mono:'JetBrains Mono','Fira Code',Consolas,monospace;
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px;scroll-behavior:smooth}
body{font-family:var(--font);background:var(--bg);color:#e2e8f0;line-height:1.6;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font-family:inherit;font-size:inherit;color:inherit}

/* ── 布局 ── */
#topbar{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;gap:8px;
  background:rgba(17,24,39,.85);border-bottom:1px solid var(--line);
  position:sticky;top:0;z-index:100;backdrop-filter:blur(8px);flex-wrap:wrap}
#topbar.hidden{display:none}
.brand{display:flex;align-items:center;gap:6px;font-weight:700;font-size:15px;color:#fff;flex-shrink:0}
.logo{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;
  border-radius:8px;background:var(--grad);color:#fff;font-weight:800;font-size:13px;flex-shrink:0}
#nav{display:flex;gap:2px;flex-wrap:wrap}
#nav a{padding:5px 10px;border-radius:8px;font-size:13px;color:var(--muted);transition:all .2s;white-space:nowrap}
#nav a:hover,#nav a.active{color:#fff;background:rgba(255,255,255,.08)}
.top-right{display:flex;align-items:center;gap:8px;flex-shrink:0}
.xppill{font-size:13px;font-weight:700;padding:4px 12px;border-radius:20px;
  background:rgba(255,209,102,.12);color:#ffd166;border:1px solid rgba(255,209,102,.2)}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--grad);
  display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;color:#fff}

#app{min-height:calc(100vh - 62px)}
.container{max-width:1100px;margin:0 auto;padding:24px 20px}

/* ── 卡片 ── */
.card{background:var(--panel);border-radius:var(--radius);padding:20px;
  border:1px solid var(--line);transition:box-shadow .2s}
.card:hover{box-shadow:0 0 0 1px rgba(255,255,255,.06),0 8px 24px rgba(0,0,0,.25)}

/* ── 网格 ── */
.grid{display:grid;gap:16px}
.grid-2{grid-template-columns:repeat(2,1fr)}
.grid-3{grid-template-columns:repeat(3,1fr)}

/* ── Hero ── */
.hero{display:flex;flex-wrap:wrap;gap:20px;align-items:center;justify-content:space-between;
  background:var(--panel);border-radius:16px;padding:28px;margin-bottom:24px;
  border:1px solid rgba(255,255,255,.06)}
.hero h1{font-size:28px;font-weight:800;margin-bottom:8px}
.hero .sub{display:flex;flex-wrap:wrap;align-items:center;gap:10px;font-size:14px;color:var(--muted)}

/* ── 按钮 ── */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;
  padding:10px 20px;border-radius:10px;font-weight:600;font-size:14px;
  border:none;cursor:pointer;transition:all .2s;text-align:center}
.btn.primary{background:var(--grad);color:#fff}
.btn.ghost{background:transparent;border:1px solid var(--line);color:var(--muted)}
.btn.ghost:hover{color:#fff;border-color:rgba(255,255,255,.2)}
.btn.sm{padding:6px 14px;font-size:13px;border-radius:8px}
.btn:disabled{opacity:.4;cursor:not-allowed}
.btn.danger{background:rgba(248,113,113,.15);color:var(--warn);border:1px solid rgba(248,113,113,.3)}
.btn.block{width:100%}

/* ── 输入 ── */
.input{width:100%;padding:10px 14px;border-radius:10px;border:1px solid var(--line);
  background:var(--bg2);color:#e2e8f0;outline:none;transition:border-color .2s}
.input:focus{border-color:var(--acc)}
.input-group{display:flex;flex-direction:column;gap:6px}
.input-group label{font-size:13px;font-weight:600;color:var(--muted)}

/* ── 标签 ── */
.tag{display:inline-block;font-size:12px;font-weight:600;padding:2px 8px;
  border-radius:6px;border:1px solid rgba(255,255,255,.1);color:var(--muted)}
.streak-chip{display:inline-flex;align-items:center;gap:4px;padding:4px 12px;
  border-radius:20px;font-size:13px;font-weight:700;
  background:rgba(255,209,102,.1);color:#ffd166;border:1px solid rgba(255,209,102,.2)}

/* ── 统计数字 ── */
.stat-num{font-size:32px;font-weight:800;margin-bottom:2px}
.stat-label{font-size:13px;color:var(--muted)}

/* ── 进度条 ── */
.pbar{height:6px;border-radius:6px;background:rgba(255,255,255,.08);overflow:hidden;margin-top:6px}
.pbar i{display:block;height:100%;border-radius:6px;background:var(--grad);transition:width .4s ease;width:0}

/* ── 语言行 ── */
.lang-row{display:flex;align-items:center;gap:16px;padding:12px;border-radius:12px;
  border-bottom:1px solid var(--line)}
.lang-row:last-child{border-bottom:none}
.lang-row .meta{flex:1}

/* ── 推荐卡片 ── */
.rec-card{display:block;padding:16px;border-radius:12px;background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06)}
.rec-card .why{font-size:12px;color:var(--dim);margin-top:6px}

/* ── 柱状图 ── */
.bars{display:flex;align-items:flex-end;gap:8px;height:110px;margin-top:12px;padding:0 4px}
.bars .b{display:flex;flex-direction:column;align-items:center;gap:4px;flex:1}
.bars .b i{display:block;width:24px;border-radius:4px 4px 0 0;background:rgba(34,211,238,.3);min-width:24px}

/* ── 环境比较器(注册页用) ── */
.env-toggle{display:flex;align-items:center;gap:10px;margin:16px 0;font-size:14px}
.env-toggle .btn{min-width:100px}

/* ── Toast ── */
#toast{position:fixed;top:76px;right:20px;z-index:9999;display:flex;flex-direction:column;gap:8px}
.toast-msg{padding:12px 20px;border-radius:12px;background:var(--panel);border:1px solid var(--line);
  font-size:14px;animation:toastIn .3s ease;box-shadow:var(--shadow)}
.toast-msg.ok{border-left:3px solid var(--ok)}
.toast-msg.err{border-left:3px solid var(--warn)}
@keyframes toastIn{from{opacity:0;transform:translateX(30px)}to{opacity:1;transform:translateX(0)}}

/* ── 弹窗 / 模态 ── */
.modal-mask{position:fixed;inset:0;z-index:500;display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.55);animation:fadeIn .2s ease}
.modal-box{width:420px;max-width:90vw;background:var(--panel);border-radius:16px;padding:28px;
  border:1px solid var(--line);box-shadow:var(--shadow);animation:popIn .25s ease}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes popIn{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}

/* ── 认证页(登录 / 注册) ── */
.auth-page{display:flex;min-height:calc(100vh - 62px);align-items:center;justify-content:center;padding:20px}
.auth-card{width:420px;max-width:100%;background:var(--panel);border-radius:20px;padding:36px;
  border:1px solid var(--line);box-shadow:0 12px 40px rgba(0,0,0,.4)}
.auth-card h2{font-size:24px;margin-bottom:4px}
.auth-card .sub{font-size:14px;color:var(--muted);margin-bottom:24px}
.form-gap{display:flex;flex-direction:column;gap:16px}
.form-actions{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.form-hint{text-align:center;font-size:13px;color:var(--muted);margin-top:4px}
.form-hint a{color:var(--acc2);font-weight:600}

/* ── 课程列表 ── */
.course-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px}
.fcard{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:20px;
  transition:transform .2s,box-shadow .2s}
.fcard:hover{transform:translateY(-3px);box-shadow:0 10px 30px rgba(0,0,0,.3)}
.fcard .flag{width:48px;height:48px;border-radius:12px;overflow:hidden;margin-bottom:12px}
.fcard h3{font-size:18px;margin-bottom:4px}
.fcard .desc{font-size:13px;color:var(--muted);line-height:1.5;margin-bottom:12px}
.fcard .stats{font-size:12px;color:var(--dim);display:flex;gap:10px;flex-wrap:wrap}

/* ── 课节卡片 ── */
.lesson-card{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:12px;
  background:rgba(255,255,255,.02);border:1px solid rgba(255,255,255,.05)}
.lesson-card.locked{opacity:.4}
.lesson-card .icon{width:44px;height:44px;border-radius:12px;background:var(--grad);
  display:flex;align-items:center;justify-content:center;font-size:20px;color:#fff;flex:none}
.lesson-card.done .icon{background:rgba(52,211,153,.25);border:2px solid var(--ok)}
.lesson-card .info{flex:1}
.lesson-card .info h4{font-size:15px;margin-bottom:2px}
.lesson-card .info .desc{font-size:12px;color:var(--muted)}
.lesson-card .right{text-align:right}
.lesson-card .right .best{font-size:13px;font-weight:700}

/* ── 学习会话 ── */
.session{max-width:680px;margin:20px auto;padding:16px}
.session .prompt{font-size:20px;font-weight:700;margin-bottom:16px}
.session .opt-grid{display:flex;flex-direction:column;gap:10px}
.session .opt-btn{padding:14px 18px;border-radius:12px;background:var(--panel2);border:1px solid var(--line);
  text-align:left;cursor:pointer;transition:all .2s}
.session .opt-btn:hover{border-color:var(--acc)}
.session .opt-btn.correct{border-color:var(--ok);background:rgba(52,211,153,.1)}
.session .opt-btn.wrong{border-color:var(--warn);background:rgba(248,113,113,.1)}
.session .explanation{margin-top:16px;padding:14px;border-radius:12px;
  background:rgba(99,102,241,.06);border:1px solid rgba(99,102,241,.2);font-size:14px}

/* ── 进度条会话 ── */
.progress-bar-row{display:flex;align-items:center;gap:10px;margin:4px 0}
.progress-bar-row .bar{flex:1;height:6px;border-radius:6px;background:rgba(255,255,255,.08);overflow:hidden}
.progress-bar-row .bar i{display:block;height:100%;border-radius:6px;background:var(--grad)}

/* ── 社区 ── */
.channel-tabs{display:flex;gap:6px;margin-bottom:16px;overflow-x:auto}
.channel-tabs button{padding:6px 16px;border-radius:20px;border:1px solid var(--line);
  background:transparent;color:var(--muted);font-size:13px;cursor:pointer;white-space:nowrap}
.channel-tabs button.active{background:rgba(99,102,241,.15);border-color:var(--acc);color:#fff}
.post-card{display:block;padding:18px;border-radius:14px;background:var(--panel);
  border:1px solid var(--line);margin-bottom:12px}
.post-card .header{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.post-card .header .user{font-weight:600;font-size:14px}
.post-card .header .time{font-size:12px;color:var(--dim);margin-left:auto}
.post-card h4{font-size:16px;margin-bottom:6px}
.post-card .body{font-size:14px;color:var(--muted);line-height:1.6;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.post-card .footer{display:flex;gap:16px;margin-top:12px;font-size:13px;color:var(--dim)}

/* ── 成就 ── */
.ach-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}
.ach-card{display:flex;flex-direction:column;align-items:center;gap:8px;
  padding:20px;border-radius:14px;background:var(--panel);border:1px solid var(--line);text-align:center}
.ach-card .icon{font-size:32px}
.ach-card .title{font-size:14px;font-weight:700}
.ach-card .desc{font-size:12px;color:var(--muted)}
.ach-card.locked{opacity:.35}

/* ── 弹窗 / Toast扩展 ── */
.toast-msg.warn{border-left:3px solid #ffd166}

/* ── 加载失败页 ── */
.load-fail{display:flex;flex-direction:column;align-items:center;justify-content:center;
  min-height:50vh;gap:20px;text-align:center}
.load-fail h2{font-size:22px;color:var(--warn)}
.load-fail .msg{font-size:14px;color:var(--muted);max-width:400px}

/* ── 排行榜 ── */
.rank-row{display:flex;align-items:center;gap:12px;padding:10px 6px;border-bottom:1px solid var(--line)}
.rank-row:last-child{border-bottom:none}
.rank-row.me{background:linear-gradient(90deg,rgba(99,102,241,.12),transparent);border-radius:10px;padding-left:12px}
.rank-num{width:26px;height:26px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;
  font-size:12px;font-weight:800;background:var(--panel2);color:var(--muted)}
.rank-row:nth-child(-n+3) .rank-num{color:#0b1020;background:var(--grad)}
.rank-row .meta{flex:1;display:flex;flex-direction:column}

/* ── 趣味玩法 ── */
.task-row{display:flex;align-items:center;padding:8px 0}
.dw-row{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}
.dw-row:last-child{border-bottom:none}
.heatmap{display:flex;gap:4px;margin-top:12px;overflow-x:auto;padding-bottom:4px}
.hm-col{display:flex;flex-direction:column;gap:4px}
.hm-cell{width:13px;height:13px;border-radius:3px;background:rgba(255,255,255,.07);flex:none}
.hm-cell.h1{background:rgba(34,211,238,.25)}
.hm-cell.h2{background:rgba(34,211,238,.5)}
.hm-cell.h3{background:rgba(34,211,238,.75)}
.hm-cell.h4{background:#22d3ee}
.tile-in{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:38px;padding:0 8px;
  border-radius:9px;background:var(--grad);color:#fff;font-weight:700;font-size:18px}

/* ── 响应式 ── */
@media(max-width:900px){.grid-3{grid-template-columns:repeat(2,1fr)}.hero{flex-direction:column}}
@media(max-width:600px){.grid-2,.grid-3{grid-template-columns:1fr}#nav{display:none}}
/* ═══ 首页视觉特效 · Dashboard Visual Enhancements ═══ */

/* ── 全局入场动画 ── */
@keyframes dashFadeIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.container { animation: dashFadeIn .55s cubic-bezier(.22,.61,.36,1); }

/* ── Hero 区域 · 动态渐变 + 光点 ── */
@keyframes heroShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes heroParticle { 0% { transform: translateY(0) scale(1); opacity: .7; } 100% { transform: translateY(-120px) scale(0); opacity: 0; } }
.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(34,211,238,.12), rgba(99,102,241,.08)); background-size: 200% 200%; animation: heroShift 8s ease infinite; border: 1px solid rgba(99,102,241,.18); border-radius: 16px; padding: 28px 28px 24px; margin-bottom: 20px; }
.hero::before { content: ""
; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle at 20% 30%, rgba(99,102,241,.15) 0%, transparent 40%), radial-gradient(circle at 70% 60%, rgba(34,211,238,.1) 0%, transparent 40%), radial-gradient(circle at 50% 20%, rgba(255,209,102,.06) 0%, transparent 30%); animation: heroShift 12s ease infinite reverse; pointer-events: none; }
.hero::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(99,102,241,.5), rgba(34,211,238,.5), transparent); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { background: linear-gradient(135deg, #e0e7ff, #c7d2fe, #a5f3fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ── 统计卡片 · 玻璃拟态 + 悬浮 ── */
@keyframes cardRise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.grid-3 .card, .grid-2 .card { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06); border-radius: 14px; transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .4s ease, border-color .3s; }
.grid-3 .card:hover, .grid-2 .card:hover { transform: translateY(-4px); box-shadow: 0 12px 36px rgba(99,102,241,.12), 0 0 0 1px rgba(99,102,241,.18); border-color: rgba(99,102,241,.25); }
.grid-3 .card { animation: cardRise .5s ease both; }
.grid-3 .card:nth-child(1) { animation-delay: .1s; }
.grid-3 .card:nth-child(2) { animation-delay: .2s; }
.grid-3 .card:nth-child(3) { animation-delay: .3s; }

/* ── 统计数字 · 渐显脉冲 ── */
@keyframes numGlow { 0% { text-shadow: 0 0 0 rgba(99,102,241,0); } 60% { text-shadow: 0 0 18px rgba(99,102,241,.5), 0 0 4px rgba(34,211,238,.3); } 100% { text-shadow: 0 0 0 rgba(99,102,241,0); } }
.stat-num { font-size: 36px; font-weight: 800; background: linear-gradient(135deg, #818cf8, #22d3ee); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: numGlow 3s ease-in-out infinite; letter-spacing: -1px; }

/* ── 进度条 · 流光扫过 ── */
@keyframes shimmer { 0% { left: -60%; } 100% { left: 120%; } }
.pbar { position: relative; overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.06); height: 8px; }
.pbar i { display: block; height: 100%; border-radius: 10px; background: var(--grad); position: relative; transition: width .8s cubic-bezier(.22,.61,.36,1); }
.pbar i::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: shimmer 2.4s ease-in-out infinite; border-radius: 10px; }

/* ── 语言卡片 · 悬浮 ── */
.lang-row { transition: transform .25s ease, box-shadow .25s ease; border-radius: 12px; padding: 14px; margin: 2px 0; }
.lang-row:hover { transform: translateX(6px); box-shadow: 0 4px 16px rgba(99,102,241,.08); background: rgba(99,102,241,.04); }

/* ── 推荐卡片 · 悬浮扫光 ── */
.rec-card { position: relative; overflow: hidden; transition: transform .3s ease, box-shadow .3s ease; }
.rec-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(99,102,241,.14); }
.rec-card::after { content: ""; position: absolute; top: 0; left: -100%; width: 60%; height: 100%; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.03) 50%, transparent 70%); transition: left .6s ease; pointer-events: none; }
.rec-card:hover::after { left: 120%; }

/* ── 柱状图 · 渐入 ── */
@keyframes barGrow { from { height: 0 !important; } }
.bars .b i { background: linear-gradient(180deg, #6366f1, #22d3ee); border-radius: 4px 4px 0 0; width: 22px; min-width: 22px; transition: height .6s cubic-bezier(.22,.61,.36,1); animation: barGrow .8s ease both; }
.bars .b:nth-child(1) i { animation-delay: 0s; } .bars .b:nth-child(2) i { animation-delay: .1s; } .bars .b:nth-child(3) i { animation-delay: .2s; } .bars .b:nth-child(4) i { animation-delay: .3s; } .bars .b:nth-child(5) i { animation-delay: .4s; } .bars .b:nth-child(6) i { animation-delay: .5s; } .bars .b:nth-child(7) i { animation-delay: .6s; }

/* ── 打卡徽章 · 呼吸光 ── */
@keyframes streakGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(255,209,102,.4); } 50% { box-shadow: 0 0 0 8px rgba(255,209,102,0); } }
.streak-chip { animation: streakGlow 2.2s ease-in-out infinite; }

/* ── 按钮悬浮增强 ── */
.btn.primary:not(:disabled) { transition: transform .2s ease, box-shadow .25s ease, background .25s; }
.btn.primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,.35); }
.btn.primary:not(:disabled):active { transform: translateY(0); }

/* ── 热力图悬浮 ── */
.hm-cell { transition: transform .15s ease; }
.hm-cell:hover { transform: scale(1.45); z-index: 2; }

/* ── 顶栏毛玻璃 ── */
#topbar { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(11,16,32,.78); border-bottom: 1px solid rgba(255,255,255,.06); }

/* ── 响应式 ── */
@media (max-width: 860px) { .hero { padding: 20px 16px; border-radius: 12px; } .stat-num { font-size: 28px; } }

/* ── 亮色主题 ── */
.theme-light .hero { background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(34,211,238,.06), rgba(99,102,241,.04)); border-color: rgba(99,102,241,.12); }
.theme-light .grid-3 .card, .theme-light .grid-2 .card { background: rgba(255,255,255,.5); border-color: rgba(0,0,0,.06); }
.theme-light .grid-3 .card:hover, .theme-light .grid-2 .card:hover { border-color: rgba(99,102,241,.25); box-shadow: 0 8px 24px rgba(99,102,241,.1); }
.theme-light #topbar { background: rgba(255,255,255,.82); border-bottom: 1px solid rgba(0,0,0,.06); }
