/* ============================================================
 * ShellVerse · 扩展样式（测验/游戏/考场/成就/特效）
 * 在 style.css 之后加载
 * ============================================================ */

/* ---------------- 首页星空与徽章 ---------------- */
#heroStars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero { position: relative; }
.hero .hero-kicker, .hero h1, .hero .hero-sub, .hero .hero-cta, .hero .hero-terminal { position: relative; z-index: 2; }
.hero-badge {
  position: relative; z-index: 2; display: inline-block; margin-top: 22px;
  font-size: 13px; padding: 8px 16px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  color: var(--text-2, #aaa); letter-spacing: .5px;
}
.arcade-card .track-desc { margin-top: 6px; }
#comboBadge {
  position: fixed; right: 26px; bottom: 26px; z-index: 90;
  padding: 10px 18px; border-radius: 14px; font-weight: 700; font-size: 15px;
  color: #fff; background: linear-gradient(135deg,#ff6482,#f2994a);
  box-shadow: 0 8px 30px rgba(255,100,130,.4); opacity: 0; pointer-events: none;
}
#comboBadge.pop { animation: comboPop .9s ease forwards; }
@keyframes comboPop {
  0% { opacity: 0; transform: translateY(14px) scale(.8); }
  18% { opacity: 1; transform: translateY(0) scale(1.08); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: translateY(-8px) scale(.96); }
}

/* ---------------- 难度与导航 ---------------- */
.pill.lv-easy { color: #6fcf97; border-color: rgba(111,207,151,.4); }
.pill.lv-mid  { color: #f2c94c; border-color: rgba(242,201,76,.4); }
.pill.lv-hard { color: #ff6482; border-color: rgba(255,100,130,.4); }
#soundToggle {
  background: none; border: none; cursor: pointer; font-size: 17px;
  color: var(--text-2, #aaa); padding: 6px 8px; border-radius: 8px; line-height: 1;
}
#soundToggle:hover { background: rgba(255,255,255,.08); }

/* ---------------- 正文扩展块 ---------------- */
.sec-list { margin: 10px 0 0; padding-left: 22px; color: var(--text-2, #bbb); line-height: 1.9; }
.sec-list li::marker { color: var(--accent, #2997ff); }

.data-table-wrap { overflow-x: auto; margin: 16px 0 4px; border-radius: 12px; border: 1px solid rgba(255,255,255,.08); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; padding: 10px 14px; white-space: nowrap;
  background: rgba(255,255,255,.045); color: var(--text-1, #eee);
  font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.08);
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.05); color: var(--text-2, #bbb); }
.data-table tr:last-child td { border-bottom: none; }
.data-table code { color: #8ecbff; background: rgba(41,151,255,.08); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }

.callout { border-radius: 12px; padding: 14px 18px; margin: 14px 0 4px; font-size: 14px; line-height: 1.75; border: 1px solid; position: relative; }
.callout b { display: inline-block; margin-bottom: 4px; font-size: 13.5px; letter-spacing: .5px; }
.callout p { margin: 0; color: var(--text-2, #bbb); }
.callout.tip  { background: rgba(48,209,88,.07);  border-color: rgba(48,209,88,.25); }
.callout.tip b  { color: #6fcf97; }
.callout.warn { background: rgba(255,214,10,.06); border-color: rgba(255,214,10,.28); }
.callout.warn b { color: #ffd60a; }
.callout.fun  { background: rgba(191,90,242,.08); border-color: rgba(191,90,242,.3); }
.callout.fun b  { color: #d99cff; }

/* ---------------- 测验 ---------------- */
.quiz-head { margin-top: 46px; }
.quiz-card {
  background: var(--card-bg, rgba(255,255,255,.03)); border: 1px solid var(--card-border, rgba(255,255,255,.08));
  border-radius: 14px; padding: 18px 20px; margin: 14px 0; transition: border-color .3s;
}
.quiz-card.solved { border-color: rgba(48,209,88,.35); }
.quiz-tag {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(191,90,242,.15); color: #d99cff; font-weight: 700; font-size: 12.5px;
}
.quiz-card.solved .quiz-tag { background: rgba(48,209,88,.15); color: #6fcf97; }
.quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
@media (max-width: 720px) { .quiz-opts { grid-template-columns: 1fr; } }
.quiz-opt {
  text-align: left; padding: 12px 14px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.09);
  color: var(--text-2, #ccc); font-size: 13.5px; line-height: 1.55; transition: all .2s;
}
.quiz-opt b { color: var(--accent, #2997ff); margin-right: 6px; }
.quiz-opt:hover:not(:disabled) { border-color: rgba(41,151,255,.5); background: rgba(41,151,255,.07); transform: translateY(-1px); }
.quiz-opt:disabled { cursor: default; opacity: .55; }
.quiz-opt.right { border-color: rgba(48,209,88,.7); background: rgba(48,209,88,.12); color: #c9f5d4; opacity: 1; }
.quiz-opt.right b { color: #6fcf97; }
.quiz-opt.wrong { border-color: rgba(255,100,130,.7); background: rgba(255,100,130,.1); color: #ffc4d1; opacity: 1; }
.quiz-explain { margin-top: 12px; font-size: 13px; color: var(--text-2, #aaa); line-height: 1.7; display: none; }
.quiz-explain.show { display: block; animation: fadeUp .35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shakeKf { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.shake { animation: shakeKf .45s ease; }

/* ---------------- 游戏大厅 ---------------- */
.games-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; max-width: 1100px; margin: 0 auto; padding: 0 24px 80px;
}
.game-card {
  display: block; padding: 26px 24px; border-radius: 18px; text-decoration: none;
  background: var(--card-bg, rgba(255,255,255,.03)); border: 1px solid var(--card-border, rgba(255,255,255,.08));
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.game-card:hover { transform: translateY(-5px); border-color: rgba(191,90,242,.5); box-shadow: 0 16px 40px rgba(191,90,242,.15); }
.game-icon { font-size: 34px; display: block; margin-bottom: 12px; }
.game-name { font-size: 18px; font-weight: 700; color: var(--text-1, #fff); margin-bottom: 8px; }
.game-desc { font-size: 13.5px; color: var(--text-2, #aaa); line-height: 1.7; margin: 0 0 12px; }
.game-best { font-size: 12.5px; color: #ffd60a; }

/* 游戏通用页 */
.game-page { max-width: 900px; margin: 0 auto; padding: 130px 24px 80px; }
.game-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 14px; flex-wrap: wrap; }
.game-back { color: var(--text-2, #aaa); text-decoration: none; font-size: 13.5px; }
.game-back:hover { color: #fff; }
.game-title-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.game-title-row .game-icon { margin: 0; font-size: 40px; }
.match-stats { font-size: 13.5px; color: var(--text-2, #aaa); }
.match-stats b { color: #ffd60a; font-size: 15px; }
.match-intro { text-align: center; padding-top: 160px; }
.match-rules { color: var(--text-2, #aaa); font-size: 14px; line-height: 1.8; margin-bottom: 18px; }

/* 管道拼图 */
.level-dots { display: flex; gap: 8px; flex-wrap: wrap; }
.ldot {
  width: 32px; height: 32px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  color: var(--text-2, #aaa); font-size: 12.5px; font-weight: 600;
}
.ldot.cleared { background: rgba(48,209,88,.14); border-color: rgba(48,209,88,.4); color: #6fcf97; }
.ldot.cur { border-color: #bf5af2; color: #d99cff; box-shadow: 0 0 12px rgba(191,90,242,.35); }
.pipeline-task { text-align: center; margin-bottom: 24px; }
.pipeline-task h2 { margin: 12px 0 8px; font-size: 21px; }
.pipeline-task p { color: var(--text-2, #aaa); font-size: 13.5px; }
.pipe-build {
  min-height: 64px; display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 10px; padding: 14px; margin-bottom: 18px;
  border: 1.5px dashed rgba(255,255,255,.18); border-radius: 14px; background: rgba(255,255,255,.02);
}
.pipe-slot { font-family: var(--mono, monospace); font-size: 13px; padding: 9px 14px; border-radius: 9px; }
.pipe-slot.empty { color: var(--text-3, #666); font-family: inherit; }
.pipe-slot.filled { background: rgba(41,151,255,.13); border: 1px solid rgba(41,151,255,.4); color: #8ecbff; display: inline-flex; gap: 10px; align-items: center; }
.pipe-arrow { color: #ffd60a; font-style: normal; font-weight: 700; }
.pipe-bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 22px; }
.pipe-chip {
  font-family: var(--mono, monospace); font-size: 13px; padding: 11px 16px; cursor: pointer;
  border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14);
  color: var(--text-1, #eee); transition: all .2s;
}
.pipe-chip:hover:not(:disabled) { border-color: #2997ff; color: #8ecbff; transform: translateY(-2px); }
.pipe-chip:disabled { opacity: .28; cursor: default; }
.pipe-actions { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.pipe-attempts { color: var(--text-3, #777); font-size: 13px; }
.pipe-attempts b { color: #ff6482; }
.pipe-result { margin-top: 22px; }
.pipe-win { text-align: center; animation: fadeUp .4s ease; }
.pipe-stars { font-size: 30px; margin-bottom: 10px; }
.pipe-explain { color: var(--text-2, #bbb); font-size: 14px; line-height: 1.7; margin: 8px 0 12px; }
.pipe-final { display: block; padding: 13px 16px; border-radius: 10px; background: rgba(48,209,88,.08); border: 1px solid rgba(48,209,88,.3); color: #8ee6a3; font-size: 13px; word-break: break-all; }
.pipe-allclear { margin-top: 14px; color: #ffd60a; font-weight: 600; }

/* 命令配对 */
.match-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .match-grid { grid-template-columns: repeat(3, 1fr); } }
.match-card {
  aspect-ratio: 3 / 2.2; perspective: 600px; cursor: pointer;
  background: none; border: none; padding: 0;
}
.match-face {
  position: absolute; inset: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 8px; font-size: 12.5px; line-height: 1.4; backface-visibility: hidden;
  transition: transform .45s, opacity .45s;
}
.match-card { position: relative; }
.match-front { background: linear-gradient(135deg, rgba(41,151,255,.16), rgba(191,90,242,.16)); border: 1px solid rgba(255,255,255,.14); color: #8ecbff; font-size: 24px; font-weight: 700; }
.match-back { background: var(--card-bg, rgba(255,255,255,.05)); border: 1px solid rgba(255,255,255,.18); color: var(--text-2, #ccc); transform: rotateY(180deg); }
.match-back.c { font-family: var(--mono, monospace); color: #8ecbff; font-size: 12px; }
.match-card.open .match-front { transform: rotateY(180deg); }
.match-card.open .match-back { transform: rotateY(0); }
.match-card.matched .match-back { border-color: rgba(48,209,88,.6); background: rgba(48,209,88,.12); color: #8ee6a3; }
.match-card.matched { animation: matchPulse .5s ease; }
@keyframes matchPulse { 0% { transform: scale(1); } 50% { transform: scale(1.07); } 100% { transform: scale(1); } }

/* 打字竞技 */
.type-arena { background: var(--card-bg, rgba(255,255,255,.03)); border: 1px solid var(--card-border, rgba(255,255,255,.09)); border-radius: 16px; padding: 30px; text-align: center; }
.type-label { color: var(--text-3, #777); font-size: 12.5px; letter-spacing: 2px; margin-bottom: 12px; }
.type-target {
  font-family: var(--mono, monospace); font-size: clamp(15px, 2.6vw, 21px); color: #ffd60a;
  min-height: 56px; display: flex; align-items: center; justify-content: center; margin-bottom: 18px; word-break: break-all;
}
.type-input { width: 100%; max-width: 560px; text-align: center; font-family: var(--mono, monospace) !important; }
.type-hint { margin-top: 12px; color: var(--text-3, #666); font-size: 12px; }

/* 综合考场 */
.exam-rules { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; color: var(--text-2, #aaa); font-size: 14px; }
.exam-bar { height: 5px; border-radius: 4px; background: rgba(255,255,255,.07); overflow: hidden; margin-bottom: 22px; }
.exam-bar i { display: block; height: 100%; background: linear-gradient(90deg,#2997ff,#bf5af2); transition: width .4s; }
.exam-q .ex-q { align-items: flex-start; }
#eTime.danger { color: #ff6482 !important; animation: blinkKf 1s infinite; }
@keyframes blinkKf { 50% { opacity: .4; } }
.exam-result { text-align: center; animation: fadeUp .4s ease; }
.exam-score { font-size: 64px; font-weight: 800; margin: 10px 0 4px; }
.exam-score span { font-size: 26px; }
.exam-score.pass { color: #6fcf97; text-shadow: 0 0 30px rgba(48,209,88,.4); }
.exam-score.fail { color: #ff6482; }
.exam-rank { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.exam-note { color: var(--text-2, #aaa); font-size: 13.5px; margin-bottom: 8px; }
.exam-review { margin: 26px 0; text-align: left; display: flex; flex-direction: column; gap: 12px; }
.exam-wrong { background: rgba(255,100,130,.06); border: 1px solid rgba(255,100,130,.25); border-radius: 12px; padding: 14px 16px; }
.exam-wrong-q { font-size: 13.5px; color: var(--text-1, #eee); margin-bottom: 8px; font-weight: 600; }
.exam-wrong-a { font-size: 13px; color: var(--text-2, #bbb); line-height: 1.7; }
.exam-perfect { text-align: center; color: #ffd60a; padding: 16px; }
.exam-actions { display: flex; gap: 14px; justify-content: center; }

/* ---------------- 进度页扩展 ---------------- */
.xp-card { margin: 18px 0 20px; padding: 16px 18px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--card-border, rgba(255,255,255,.08)); }
.xp-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 10px; }
.xp-top b { color: #ffd60a; }
.xp-top span { color: var(--text-2, #aaa); font-family: var(--mono, monospace); }
.xp-bar { height: 8px; border-radius: 6px; background: rgba(255,255,255,.07); overflow: hidden; }
.xp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg,#ffd60a,#ff9f0a); border-radius: 6px; transition: width 1s ease; }
.xp-next { margin-top: 8px; font-size: 12px; color: var(--text-3, #777); }
.c-purple { color: #d99cff; }

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; max-width: 1100px; margin: 0 auto 40px; padding: 0 24px; }
.ach-card {
  text-align: center; padding: 20px 12px; border-radius: 14px;
  background: var(--card-bg, rgba(255,255,255,.03)); border: 1px solid var(--card-border, rgba(255,255,255,.07));
  opacity: .45; filter: grayscale(.9); transition: all .3s;
}
.ach-card.got { opacity: 1; filter: none; border-color: rgba(255,214,10,.35); box-shadow: 0 6px 24px rgba(255,214,10,.08); }
.ach-card.got:hover { transform: translateY(-4px) rotate(-1deg); }
.ach-icon { font-size: 30px; margin-bottom: 8px; }
.ach-name { font-size: 13.5px; font-weight: 700; color: var(--text-1, #eee); margin-bottom: 4px; }
.ach-desc { font-size: 11.5px; color: var(--text-3, #888); line-height: 1.5; }
.map-title { max-width: 1100px; margin: 40px auto 18px; padding: 0 24px; font-size: 20px; }

/* ---------------- 复制按钮微光 ---------------- */
.copy-btn { transition: all .2s; }
.copy-btn:hover { color: #8ecbff; border-color: rgba(41,151,255,.5) !important; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
  .game-page { padding-top: 110px; }
  .match-grid { gap: 8px; }
}
