/* ============ Java冒险岛 · 游戏化学习 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink: #3b2f63;
  --accent: #ff7b2e;
  --accent2: #8b5cf6;
  --good: #22c55e;
  --bad: #ef4444;
  --card: #ffffff;
  --shadow: 0 8px 24px rgba(59, 47, 99, .18);
}
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: linear-gradient(160deg, #8ec5fc 0%, #b39df3 38%, #f6c1ea 72%, #ffd9a0 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ---------- 背景漂浮代码 ---------- */
.bg-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.float-chip {
  position: absolute;
  font-family: Consolas, monospace;
  font-weight: bold;
  color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  padding: 4px 12px;
  border-radius: 999px;
  animation: floaty 9s ease-in-out infinite;
  font-size: 15px;
}
.f1{top:12%;left:4%} .f2{top:28%;right:6%;animation-delay:-2s} .f3{top:55%;left:8%;animation-delay:-4s}
.f4{top:70%;right:10%;animation-delay:-1s} .f5{top:42%;left:15%;animation-delay:-6s;font-size:12px}
.f6{top:85%;left:22%;animation-delay:-3s} .f7{top:8%;right:22%;animation-delay:-5s} .f8{top:78%;left:55%;animation-delay:-7s;font-size:12px}
@keyframes floaty { 0%,100%{transform:translateY(0) rotate(-3deg)} 50%{transform:translateY(-26px) rotate(4deg)} }

/* ---------- 顶栏 ---------- */
#topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 18px rgba(59,47,99,.15);
  flex-wrap: wrap;
}
.logo { font-size: 22px; font-weight: 900; cursor: pointer; user-select: none; white-space: nowrap; }
.logo span { background: linear-gradient(90deg, #f97316, #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.player { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #fca5a5);
  display: grid; place-items: center; font-size: 24px;
  border: 3px solid #fff; box-shadow: var(--shadow);
}
.pinfo .pname { font-size: 13px; font-weight: 700; }
.xpbar { width: 130px; height: 10px; border-radius: 99px; background: #e5e0f5; overflow: hidden; margin-top: 3px; }
.xpfill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #34d399, #3b82f6); transition: width .6s ease; }
.pstats { display: flex; flex-direction: column; font-size: 13px; font-weight: 800; }
.lv { color: var(--accent2); }
.coins b { color: #d97706; }
.topnav { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.topnav button {
  border: none; cursor: pointer; font-weight: 700; font-size: 14px;
  padding: 8px 14px; border-radius: 12px; color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #ede9fe);
  box-shadow: 0 3px 0 #c4b5fd;
  transition: transform .12s, box-shadow .12s;
}
.topnav button:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #c4b5fd; }
.topnav button:active { transform: translateY(2px); box-shadow: 0 1px 0 #c4b5fd; }

/* ---------- 主区域 ---------- */
main { position: relative; z-index: 1; max-width: 1060px; margin: 0 auto; padding: 24px 16px 60px; }
.site-foot { position: relative; z-index: 1; text-align: center; padding: 22px; font-size: 12px; color: rgba(59,47,99,.65); }

/* ---------- 通用按钮/卡片 ---------- */
.btn {
  border: none; cursor: pointer; font-weight: 800; font-size: 16px;
  padding: 12px 26px; border-radius: 14px; color: #fff;
  background: linear-gradient(135deg, #ff8c42, #ff5e62);
  box-shadow: 0 4px 0 #d94f2b, var(--shadow);
  transition: transform .12s;
}
.btn:hover { transform: translateY(-2px) scale(1.02); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #d94f2b; }
.btn.purple { background: linear-gradient(135deg, #a78bfa, #7c3aed); box-shadow: 0 4px 0 #5b21b6, var(--shadow); }
.btn.purple:active { box-shadow: 0 1px 0 #5b21b6; }
.btn.green { background: linear-gradient(135deg, #4ade80, #16a34a); box-shadow: 0 4px 0 #15803d, var(--shadow); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 4px 0 #ddd6fe; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.card {
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow);
  padding: 20px;
}

/* ---------- 地图 ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  border-radius: 24px; padding: 42px 20px 52px; margin-bottom: 30px;
  background: linear-gradient(135deg, #6d28d9, #8b5cf6 45%, #ec4899);
  color: #fff; box-shadow: var(--shadow);
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.14);
}
.hero::before { width: 220px; height: 220px; top: -80px; right: -60px; }
.hero::after { width: 140px; height: 140px; bottom: -50px; left: -30px; }
.hero h1 { font-size: clamp(26px, 4.5vw, 42px); margin-bottom: 10px; text-shadow: 0 3px 0 rgba(0,0,0,.18); }
.hero p { font-size: 16px; opacity: .95; max-width: 620px; margin: 0 auto 18px; }
.hero .mascot { font-size: 64px; display: inline-block; animation: bounce 2.2s ease-in-out infinite; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
.hero-stats { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; position: relative; z-index: 1; }
.hero-stats span { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35); padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; }

.map-wrap { position: relative; padding: 10px 0 30px; }
.map-wrap::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0;
  border-left: 5px dashed rgba(255,255,255,.75);
  transform: translateX(-50%);
}
.lrow { position: relative; display: flex; justify-content: center; margin: 34px 0; }
.lrow:nth-child(odd) { justify-content: flex-start; padding-left: 8%; }
.lrow:nth-child(even) { justify-content: flex-end; padding-right: 8%; }
.lnode {
  display: flex; align-items: center; gap: 16px;
  position: relative; z-index: 1;
}
.lnum {
  position: relative;
  width: 86px; height: 86px; flex: 0 0 86px; border-radius: 50%;
  display: grid; place-items: center; font-size: 40px; cursor: pointer;
  background: radial-gradient(circle at 30% 25%, #fff, #ffe9c7);
  border: 4px solid #fff; box-shadow: 0 8px 0 rgba(0,0,0,.12), var(--shadow);
  transition: transform .15s; user-select: none;
}
.lnum:hover { transform: scale(1.08) rotate(-4deg); }
.lnum.locked { filter: grayscale(1); opacity: .55; cursor: not-allowed; background: #d1d5db; }
.lnum .star { position: absolute; top: -10px; right: -6px; font-size: 22px; }
.lcard {
  background: var(--card); border-radius: 16px; padding: 12px 18px;
  box-shadow: var(--shadow); max-width: 240px; cursor: pointer;
  transition: transform .15s;
}
.lcard:hover { transform: translateY(-3px); }
.lcard h3 { font-size: 16px; margin-bottom: 3px; }
.lcard p { font-size: 12px; color: #7c6fa8; }
.lcard .state { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 10px; border-radius: 99px; margin-top: 6px; }
.state.done { background: #dcfce7; color: #15803d; }
.state.now { background: #fef3c7; color: #b45309; }
.state.lock { background: #e5e7eb; color: #6b7280; }

/* ---------- 课程页 ---------- */
.backbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.backbar .mini-btn {
  border: none; background: rgba(255,255,255,.85); cursor: pointer;
  padding: 8px 16px; border-radius: 99px; font-weight: 700; font-size: 14px; color: var(--ink);
  box-shadow: var(--shadow);
}
.lesson-hero {
  position: relative; overflow: hidden; text-align: center;
  border-radius: 24px; padding: 34px 20px; color: #fff; margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.lesson-hero .big { font-size: 76px; display: inline-block; animation: bounce 2.4s infinite; filter: drop-shadow(0 6px 8px rgba(0,0,0,.25)); }
.lesson-hero h2 { font-size: clamp(22px, 4vw, 34px); text-shadow: 0 3px 0 rgba(0,0,0,.2); }
.lesson-hero .deco-sun { position: absolute; top: -34px; left: -34px; font-size: 90px; opacity: .8; transform: rotate(-12deg); }
.story {
  display: flex; gap: 12px; align-items: flex-start; margin: 0 auto 26px; max-width: 760px;
  background: #fffbeb; border: 2px dashed #fbbf24; border-radius: 18px; padding: 16px 18px;
}
.story .bot { font-size: 38px; flex: 0 0 auto; }
.story p { font-size: 15px; line-height: 1.8; }
.story b { color: #b45309; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 26px; }
.kcard {
  background: #fff; border-radius: 18px; padding: 18px; box-shadow: var(--shadow);
  border-top: 5px solid var(--accent2); transition: transform .15s;
}
.kcard:hover { transform: translateY(-4px) rotate(-.5deg); }
.kcard:nth-child(4n+1){border-top-color:#f97316} .kcard:nth-child(4n+2){border-top-color:#8b5cf6}
.kcard:nth-child(4n+3){border-top-color:#06b6d4} .kcard:nth-child(4n+4){border-top-color:#ec4899}
.kcard .kicon { font-size: 34px; margin-bottom: 8px; }
.kcard h3 { font-size: 16px; margin-bottom: 6px; }
.kcard p { font-size: 13.5px; line-height: 1.75; color: #55497e; }
.kcard code { background: #f3f0ff; padding: 1px 6px; border-radius: 6px; font-family: Consolas, monospace; color: #7c3aed; font-size: 12.5px; }

.code-panel { margin-bottom: 26px; }
.code-panel h3 { margin-bottom: 12px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.codebox {
  position: relative; background: #1e1b33; border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow);
}
.codebox .bar {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  background: #2a2647; font-size: 12px; color: #a5a1c8;
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r{background:#ff5f57}.dot.y{background:#febc2e}.dot.g{background:#28c840}
.codebox .run {
  margin-left: auto; border: none; cursor: pointer; font-weight: 800; font-size: 12px;
  background: linear-gradient(135deg,#4ade80,#16a34a); color: #fff;
  padding: 5px 14px; border-radius: 99px;
}
.codebox pre {
  padding: 16px 18px; overflow-x: auto; color: #e9e6ff;
  font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 1.7;
  min-height: 60px;
}
.codebox .console { border-top: 2px dashed #4c477e; padding: 12px 18px; color: #86efac; font-family: Consolas, monospace; font-size: 13.5px; white-space: pre-wrap; display: none; }
.codebox .console.show { display: block; animation: fadeUp .3s; }
.com { color: #7f7ba8; font-style: italic; }
.kw { color: #ff7edb; font-weight: bold; }
.str { color: #ffd479; }
.num { color: #6ee7ff; }

.tips { margin-bottom: 30px; }
.tips h3 { margin-bottom: 12px; font-size: 18px; }
.tip-item { display: flex; gap: 10px; align-items: flex-start; background: #fff; border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); margin-bottom: 10px; font-size: 14px; line-height: 1.7; }
.quiz-cta { text-align: center; padding: 26px; background: rgba(255,255,255,.55); border-radius: 22px; }
.quiz-cta .stars-big { font-size: 30px; margin-top: 10px; letter-spacing: 4px; }

/* ---------- 题目浮层 ---------- */
#overlay { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 16px; }
#overlay.show { display: flex; }
.overlay-mask { position: absolute; inset: 0; background: rgba(30, 20, 60, .55); backdrop-filter: blur(4px); }
.sheet {
  position: relative; z-index: 1; width: min(680px, 100%);
  max-height: 92vh; overflow-y: auto;
  background: linear-gradient(160deg, #ffffff, #f4f1ff);
  border-radius: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
  padding: 26px; animation: pop .25s ease;
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeUp { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet h2 { text-align: center; margin-bottom: 14px; }

.qhead { display: flex; justify-content: space-between; align-items: center; font-weight: 800; margin-bottom: 12px; flex-wrap: wrap; gap: 6px; }
.hearts { font-size: 18px; letter-spacing: 2px; }
.combo { color: #ea580c; }
.qtext { background: #fff; border-radius: 16px; padding: 20px; font-size: 17px; font-weight: 700; line-height: 1.7; box-shadow: var(--shadow); margin-bottom: 16px; }
.qtext code { font-family: Consolas, monospace; background:#f3f0ff; padding: 1px 6px; border-radius: 6px; color:#7c3aed; }
.opts { display: grid; gap: 10px; }
.opt {
  border: 2px solid #e4dcff; background: #fff; cursor: pointer;
  border-radius: 14px; padding: 13px 16px; text-align: left;
  font-size: 15px; font-weight: 600; color: var(--ink);
  transition: transform .12s, border-color .12s; display: flex; gap: 10px; align-items: center;
}
.opt .oicon { font-size: 20px; flex: 0 0 auto; }
.opt:hover:not(:disabled) { transform: translateX(4px); border-color: var(--accent2); }
.opt.right { background: #dcfce7; border-color: #22c55e; animation: shake .4s; }
.opt.wrong { background: #fee2e2; border-color: #ef4444; animation: shake .4s; }
.opt:disabled { cursor: default; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.qtip { margin-top: 14px; background: #fffbeb; border-left: 4px solid #f59e0b; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.7; display: none; }
.qtip.show { display: block; animation: fadeUp .3s; }
.qfoot { display: flex; justify-content: flex-end; margin-top: 16px; gap: 10px; }
.qprog { display: flex; gap: 6px; }
.qprog i { width: 22px; height: 8px; border-radius: 99px; background: #ddd6fe; }
.qprog i.on { background: var(--accent2); }

.result { text-align: center; padding: 10px 0; }
.result .remoji { font-size: 66px; animation: bounce 2s infinite; }
.result .rstars { font-size: 40px; letter-spacing: 8px; margin: 8px 0; }
.result .rline { font-size: 16px; margin: 6px 0; }
.reward-chips { display: flex; gap: 10px; justify-content: center; margin: 14px 0; flex-wrap: wrap; }
.reward-chips span { background: #fef3c7; color: #92400e; font-weight: 800; padding: 6px 16px; border-radius: 99px; font-size: 14px; }
.result .rbtns { display: flex; gap: 12px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* ---------- 游戏厅 ---------- */
.arcade-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.gcard {
  position: relative; overflow: hidden; background: #fff; border-radius: 20px;
  padding: 22px; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .16s; border-bottom: 5px solid #ddd6fe;
}
.gcard:hover { transform: translateY(-6px) scale(1.02); }
.gcard .gicon { font-size: 46px; }
.gcard h3 { margin: 8px 0 4px; }
.gcard p { font-size: 13px; color: #7c6fa8; line-height: 1.6; }
.gcard .best { position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 800; background: #fef3c7; color: #b45309; padding: 3px 10px; border-radius: 99px; }
.gcard .gtag { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(90deg,#8b5cf6,#ec4899); padding: 3px 12px; border-radius: 99px; }

.game-shell { max-width: 760px; margin: 0 auto; }
.game-head { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,.85); border-radius: 14px; padding: 10px 18px; font-weight: 800; box-shadow: var(--shadow); margin-bottom: 14px; flex-wrap: wrap; gap: 6px; }
.game-tip { text-align: center; font-size: 13px; color: #6d5fa5; margin-top: 12px; }
.game-board { background: rgba(255,255,255,.6); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }

/* 翻牌 */
.memo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.memo-card { aspect-ratio: 4/3; perspective: 700px; cursor: pointer; }
.memo-inner { position: relative; width: 100%; height: 100%; transition: transform .4s; transform-style: preserve-3d; }
.memo-card.open .memo-inner { transform: rotateY(180deg); }
.memo-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 12px;
  display: grid; place-items: center; font-weight: 800; padding: 6px; text-align: center;
  font-size: 13px; line-height: 1.4;
}
.memo-front { background: linear-gradient(135deg, #7c3aed, #ec4899); color: #fff; font-size: 26px; }
.memo-back { transform: rotateY(180deg); background: #fff; border: 3px solid #c4b5fd; color: var(--ink); }
.memo-back.mean { background: #ecfdf5; border-color: #34d399; color: #065f46; }
.memo-card.ok .memo-inner { animation: pop .4s; }
.memo-card.ok .memo-back { border-color: #22c55e; background: #dcfce7; }

/* 打地鼠 */
.whack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 420px; margin: 0 auto; }
.hole {
  position: relative; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #6b4f2a, #3f2d16 70%);
  box-shadow: inset 0 8px 14px rgba(0,0,0,.5), 0 4px 0 #92693a; cursor: pointer;
}
.mole {
  position: absolute; left: 0; right: 0; bottom: -100%; text-align: center;
  font-size: 44px; line-height: 1.2; transition: bottom .18s ease-out; user-select: none;
}
.hole.up .mole { bottom: 8%; }
.hp { letter-spacing: 2px; }

/* 代码排序 */
.order-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.order-col { min-height: 200px; border-radius: 14px; padding: 10px; }
.order-col.pool { background: #ede9fe; }
.order-col.ans { background: #dcfce7; }
.order-col h4 { text-align: center; font-size: 13px; margin-bottom: 8px; color: #6d5fa5; }
.oline {
  font-family: Consolas, monospace; font-size: 12.5px; background: #fff; margin-bottom: 8px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.1);
  border-left: 4px solid var(--accent2); user-select: none; word-break: break-all;
}
.oline:hover { transform: translateX(3px); }
.oline.good { border-left-color: #22c55e; background: #f0fdf4; }
.oline.badd { border-left-color: #ef4444; background: #fef2f2; }
.order-hint { text-align: center; font-size: 14px; font-weight: 700; margin-bottom: 10px; }

/* 打字 */
.type-src {
  background: #1e1b33; color: #e9e6ff; border-radius: 14px; padding: 16px;
  font-family: Consolas, monospace; font-size: 16px; line-height: 1.8; letter-spacing: .5px;
  margin-bottom: 12px; min-height: 58px;
}
.type-src .tc { color: #6b6796; }
.type-src .tok { color: #4ade80; }
.type-src .terr { color: #f87171; background: #451a1a; border-radius: 4px; }
.type-input {
  width: 100%; padding: 14px; font-size: 16px; border-radius: 14px;
  border: 3px solid #c4b5fd; outline: none; font-family: Consolas, monospace;
}
.type-input:focus { border-color: var(--accent2); }
.type-stats { display: flex; gap: 10px; margin-top: 12px; justify-content: center; flex-wrap: wrap; }
.type-stats span { background: #fff; padding: 6px 16px; border-radius: 99px; font-weight: 800; font-size: 13px; box-shadow: var(--shadow); }

/* 贪吃蛇 */
.snake-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#snakeCanvas { border-radius: 16px; box-shadow: var(--shadow); background: #14122b; max-width: 100%; }
.snake-pad { display: grid; grid-template-columns: repeat(3, 54px); gap: 6px; }
.snake-pad button {
  height: 46px; border: none; border-radius: 12px; font-size: 20px; cursor: pointer;
  background: #fff; box-shadow: 0 3px 0 #c4b5fd; font-weight: 900;
}
.snake-pad button:active { transform: translateY(2px); box-shadow: none; }

/* 快问快答 */
.rapid-timer { font-size: 26px; }
.rapid-combo { color: #ea580c; }

/* ---------- 成就 / 商店 ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.badge {
  text-align: center; background: #fff; border-radius: 16px; padding: 16px 10px;
  box-shadow: var(--shadow); border: 3px solid transparent;
}
.badge.got { border-color: #fbbf24; background: linear-gradient(160deg, #fffbeb, #fef3c7); }
.badge.locked { filter: grayscale(1); opacity: .55; }
.badge .bicon { font-size: 40px; }
.badge h4 { font-size: 14px; margin: 6px 0 3px; }
.badge p { font-size: 11.5px; color: #7c6fa8; line-height: 1.5; }
.shop-item { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.shop-item .sname { font-weight: 800; flex: 1; }
.buy-btn { border: none; cursor: pointer; font-weight: 800; padding: 8px 16px; border-radius: 12px; color: #fff; background: linear-gradient(135deg,#fbbf24,#f59e0b); box-shadow: 0 3px 0 #b45309; }
.buy-btn.owned { background: #e5e7eb; color: #6b7280; box-shadow: none; }
.buy-btn.equipped { background: linear-gradient(135deg,#4ade80,#16a34a); box-shadow: 0 3px 0 #15803d; }

/* ---------- 提示 / 彩带 ---------- */
#toast { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast-item {
  background: rgba(30, 20, 60, .92); color: #fff; font-weight: 700; font-size: 14px;
  padding: 10px 22px; border-radius: 99px; box-shadow: 0 8px 24px rgba(0,0,0,.3);
  animation: fadeUp .3s;
}
.confetti { position: fixed; top: -24px; width: 10px; height: 15px; z-index: 200; border-radius: 2px; animation: fall 2.8s linear forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(108vh) rotate(760deg); } }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .topnav { width: 100%; margin-left: 0; }
  .topnav button { flex: 1; font-size: 13px; padding: 7px 6px; }
  .lrow:nth-child(odd), .lrow:nth-child(even) { justify-content: center; padding: 0; }
  .lnum { width: 64px; height: 64px; flex-basis: 64px; font-size: 30px; }
  .order-cols { grid-template-columns: 1fr; }
  .memo-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .memo-face { font-size: 10.5px; }
  .xpbar { width: 90px; }
}
