/* ===== 字体（tools/build_fonts.py 生成的子集，已改名以符合 OFL） ===== */
@font-face { font-family: "NW KuaiLe"; src: url("../fonts/nw-kuaile.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "NW Brush"; src: url("../fonts/nw-brush.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "NW HuangYou"; src: url("../fonts/nw-huangyou.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "NW Pixel"; src: url("../fonts/nw-pixel.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "NW Comic"; src: url("../fonts/nw-comic.woff2") format("woff2"); font-display: swap; }

:root {
  --nw-yellow: #EDC845;
  --nw-cream: #F1E3BF;
  --nw-line: #A9831C;
  --nw-brown: #6B4E0E;
  --nw-orange: #E8590C;
  --bg-top: #FFF8DC;
  --bg-bottom: #F7E6A6;
  --dot: rgba(169, 131, 28, .13);
  --ink: #3B2A12;
  --ink-soft: #75603F;
  --panel: rgba(255, 255, 255, .72);
  --panel-line: rgba(169, 131, 28, .38);
  --font-fun: "NW KuaiLe", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --smooth: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-top: #1E1A2E;
    --bg-bottom: #2C2340;
    --dot: rgba(237, 200, 69, .08);
    --ink: #FFF3C4;
    --ink-soft: #CDBF9A;
    --panel: rgba(40, 32, 58, .72);
    --panel-line: rgba(237, 200, 69, .3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-fun);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom)) fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
main { position: relative; z-index: 2; }
a { color: inherit; }
button { font: inherit; color: inherit; }
kbd {
  font-family: ui-monospace, monospace; font-size: .9em;
  padding: 1px 6px; border-radius: 6px; border: 1px solid var(--panel-line); background: var(--panel);
}

/* ===== 背景：波点 + 漂浮奶蛙 ===== */
.bg-dots {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(var(--dot) 2.5px, transparent 3px);
  background-size: 34px 34px;
  animation: dots-drift 40s linear infinite;
}
@keyframes dots-drift { to { background-position: 340px 340px; } }

.bg-float { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.bg-float .floater {
  position: absolute; bottom: -140px; width: var(--s); opacity: var(--o);
  animation: float-up var(--d) linear var(--delay) infinite;
}
.bg-float .floater > svg { width: 100%; height: auto; display: block; animation: sway 3.2s ease-in-out infinite alternate; }
@keyframes float-up { to { transform: translateY(calc(-100vh - 260px)) rotate(var(--r)); } }
@keyframes sway { from { transform: translateX(-14px) rotate(-8deg); } to { transform: translateX(14px) rotate(8deg); } }

/* ===== 顶栏 ===== */
.topbar {
  position: relative; z-index: 3;
  display: flex; align-items: center; gap: 18px;
  max-width: 1180px; margin: 0 auto; padding: 22px 20px 10px;
}
.emblem { position: relative; width: 86px; height: 86px; flex: none; cursor: pointer; }
.emblem-ring { width: 100%; height: 100%; animation: spin 24s linear infinite; }
.emblem-face { position: absolute; left: 25%; top: 20%; width: 50%; transition: transform .5s var(--spring); }
.emblem:hover .emblem-face { transform: scale(1.18) rotate(-8deg); }
@keyframes spin { to { transform: rotate(360deg); } }

.brand-h1 { margin: 0; font-weight: normal; }
.brand-name {
  display: block; font-size: clamp(26px, 4.4vw, 44px); line-height: 1.15; letter-spacing: 2px;
  color: var(--nw-yellow);
  -webkit-text-stroke: 1.5px var(--nw-brown);
  text-shadow: 0 3px 0 var(--nw-line), 0 6px 14px rgba(169, 131, 28, .35);
}
/* “龙”被划掉、“蛙”从上面掉下来 */
.strike { position: relative; display: inline-block; text-decoration: none; opacity: .55; }
.strike::after {
  content: ""; position: absolute; left: -8%; right: -8%; top: 52%; height: .12em;
  background: #E03131; border-radius: 4px; rotate: -12deg;
  transform-origin: left; animation: strike 0.6s var(--smooth) 1.4s both;
}
.swap {
  display: inline-block; text-decoration: none; color: #8FCB4F;
  font-size: .62em; vertical-align: super; margin: 0 .05em 0 -.1em; rotate: 8deg;
  animation: swap-in .8s var(--spring) 1.9s both;
}
@keyframes strike { from { transform: scaleX(0); } }
@keyframes swap-in { from { opacity: 0; translate: 0 -60px; scale: 2; } }
.brand-kw { display: block; margin-top: 4px; font-size: 14px; letter-spacing: 1px; color: var(--ink-soft); }
.brand-motto { margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); }
.motto-joke { display: inline-block; color: var(--nw-orange); animation: wobble 2.4s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(5deg) scale(1.12); } }

.topbar-tools { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  border: 2px solid var(--nw-line); background: var(--panel); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; font-size: 14px;
  box-shadow: 0 3px 0 var(--nw-line);
  transition: transform .25s var(--spring), box-shadow .2s;
}
.chip:hover { transform: translateY(-2px) rotate(-2deg); }
.chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--nw-line); }
.chip[aria-pressed="true"], .chip-hot { background: var(--nw-yellow); color: #3B2A12; }

/* ===== 快讯滚动条 ===== */
.ticker {
  position: relative; z-index: 3;
  display: flex; align-items: center; gap: 12px;
  max-width: 1140px; margin: 8px auto 0; padding: 8px 12px;
  border: 2px dashed var(--panel-line); border-radius: 14px; background: var(--panel);
  backdrop-filter: blur(6px);
}
.ticker-tag {
  flex: none; background: var(--nw-orange); color: #fff; padding: 3px 10px; border-radius: 8px; font-size: 14px;
  animation: tag-pulse 1.6s ease-in-out infinite;
}
@keyframes tag-pulse { 50% { transform: scale(1.08) rotate(-3deg); } }
.ticker-viewport { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-track { display: inline-flex; gap: 48px; white-space: nowrap; animation: ticker var(--ticker-d, 60s) linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track span { font-size: 15px; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ===== 奶蛙大军 ===== */
.army { max-width: 1180px; margin: 30px auto 0; padding: 0 20px; }
.army-label { margin: 0 0 4px; font-size: 14px; color: var(--ink-soft); text-align: center; }
.army-track { position: relative; height: 96px; overflow: hidden; border-bottom: 4px dotted var(--panel-line); }
.soldier { position: absolute; bottom: 0; left: 0; width: 58px; animation: march var(--march-d, 36s) linear var(--delay) infinite; }
.soldier .waddle { animation: waddle .55s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.soldier svg { width: 100%; height: auto; display: block; }
.soldier.trip .waddle { animation: trip 1.6s var(--smooth) forwards; }
@keyframes march { from { transform: translateX(-90px); } to { transform: translateX(calc(min(1180px, 100vw) + 20px)); } }
@keyframes waddle { from { transform: rotate(-7deg) translateY(0); } to { transform: rotate(7deg) translateY(-6px); } }
@keyframes trip {
  0% { transform: rotate(0); }
  18% { transform: rotate(80deg) translateY(4px); }
  60% { transform: rotate(84deg) translateY(4px); }
  75% { transform: rotate(-12deg) translateY(-16px); }
  100% { transform: rotate(0); }
}

/* ===== 页脚 ===== */
.foot {
  position: relative; z-index: 2;
  max-width: 900px; margin: 10px auto 0; padding: 18px 20px 46px;
  text-align: center; font-size: 13px; line-height: 1.8; color: var(--ink-soft);
}
.foot p { margin: 2px 0; }

/* ===== 特效层：点击爆奶蛙、奶蛙雨、教导主任 ===== */
.fx-layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.fx-layer > * { position: absolute; left: 0; top: 0; will-change: transform, opacity; }
.fx-mini { width: 46px; }
.fx-mini svg, .fx-rain svg { width: 100%; height: auto; display: block; }
.fx-word {
  font-size: 20px; color: var(--nw-orange); white-space: nowrap;
  -webkit-text-stroke: .6px #fff; text-shadow: 0 2px 0 #fff;
}
.fx-rain { width: var(--s, 60px); }

.dean {
  position: fixed; z-index: 60; bottom: 10vh; width: 130px; cursor: pointer;
  pointer-events: auto; border: 0; padding: 0; background: none;
}
.dean.left { left: 0; transform: translateX(-130%); }
.dean.right { right: 0; transform: translateX(130%); }
.dean svg { width: 100%; height: auto; display: block; }
.dean .dean-say {
  position: absolute; bottom: 100%;
  background: #fff; color: #222; border: 3px solid #C92A2A; border-radius: 14px;
  padding: 6px 10px; font-size: 15px; white-space: nowrap;
}
.dean.left .dean-say { left: 30%; }
.dean.right .dean-say { right: 36%; }

/* ===== 光标跟屁虫 ===== */
.cursor-pal {
  position: fixed; left: 0; top: 0; z-index: 70; width: 36px; pointer-events: none;
  opacity: 0; transition: opacity .3s;
}
.cursor-pal.on { opacity: 1; }
.cursor-pal svg { width: 100%; height: auto; display: block; transition: transform .35s var(--spring); }
.cursor-pal.excited svg { transform: scale(1.35) rotate(-12deg); }

/* ===== 小屏 ===== */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 12px; padding: 16px 16px 6px; }
  .emblem { width: 64px; height: 64px; }
  .topbar-tools { width: 100%; justify-content: flex-start; margin-left: 0; }
  .ticker { margin: 8px 16px 0; }
  .army { padding: 0 16px; }
  .dean { width: 100px; }
}

/* ===== 减少动态效果 ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .bg-float, .army, .cursor-pal { display: none; }
}
