/* ============================================================
   山海奇谭 · 中国神话趣味图鉴 —— 中国风样式
   宣纸底 + 朱砂红 + 黛青 + 鎏金；日本神话章节以靛蓝/浅葱点缀
   ============================================================ */
:root {
  --paper: #f6efdd;
  --paper-2: #efe5cb;
  --card: #fffdf6;
  --ink: #33291f;
  --ink-2: #6f6353;
  --ink-3: #9a8d7a;
  --red: #a63a2b;
  --red-deep: #822b1f;
  --gold: #b8923d;
  --gold-soft: #d9c08a;
  --cyan: #3f5566;
  --green: #52705c;
  --indigo: #35597e;      /* 日本神话点缀 */
  --asagi: #4a9d9c;       /* 浅葱 */
  --line: #e3d5b4;
  --shadow: 0 6px 22px rgba(90, 70, 40, .10);
  --shadow-lift: 0 12px 30px rgba(90, 70, 40, .16);
  --font-brush: "Ma Shan Zheng", "STKaiti", "KaiTi", "DFKai-SB", serif;
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", "NSimSun", serif;
  --font-ui: "ZCOOL XiaoWei", "Noto Serif SC", "Microsoft YaHei", sans-serif;
  /* 图谱节点类别色 */
  --c-chuangshi: #8a6fb8;
  --c-shanggu: #a63a2b;
  --c-yingxiong: #3f5566;
  --c-yishou: #52705c;
  --c-riben: #35597e;
  --c-event: #b8923d;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background: var(--paper);
  font-family: var(--font-serif); font-size: 16px; line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
.paper-grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(184,146,61,.10), transparent 60%),
    radial-gradient(900px 420px at -10% 30%, rgba(166,58,43,.06), transparent 55%),
    repeating-linear-gradient(0deg, rgba(120,95,50,.022) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(120,95,50,.022) 0 1px, transparent 1px 3px);
}
img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-brush); font-weight: 400; line-height: 1.3; margin: 0; }
button { font-family: inherit; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 18px;
  padding: 10px 22px; background: rgba(246, 239, 221, .92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.brand-seal {
  width: 38px; height: 38px; display: grid; place-items: center; background: var(--red); color: #fff;
  border-radius: 8px; font-family: var(--font-brush); font-size: 24px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 3px 8px rgba(130,43,31,.35); transform: rotate(-3deg);
}
.brand-name { font-family: var(--font-brush); font-size: 24px; color: var(--ink); letter-spacing: 2px; }
.nav { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.nav a {
  padding: 7px 14px; border-radius: 999px; color: var(--ink-2); font-family: var(--font-ui);
  font-size: 15px; text-decoration: none !important; transition: all .2s;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a.active { background: var(--red); color: #fff; box-shadow: 0 3px 10px rgba(130,43,31,.28); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.streak-chip {
  font-size: 13px; color: var(--ink-2); background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; white-space: nowrap;
}
#navToggle { display: none; }

/* ---------------- 通用 ---------------- */
.app { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 26px 22px 60px; min-height: 60vh; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center; border: 1px solid transparent;
  cursor: pointer; text-decoration: none !important; border-radius: 10px; padding: 10px 20px;
  font-size: 15px; font-family: var(--font-ui); transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(130,43,31,.3); }
.btn-primary:hover { background: var(--red-deep); box-shadow: 0 6px 18px rgba(130,43,31,.4); }
.btn-gold { background: linear-gradient(135deg, #c9a24b, #b8923d); color: #fff; box-shadow: 0 4px 14px rgba(184,146,61,.35); }
.btn-indigo { background: var(--indigo); color: #fff; box-shadow: 0 4px 14px rgba(53,89,126,.35); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--gold); color: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }
.src { font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
.src::before { content: "❋"; color: var(--gold); font-size: 11px; }
.divider { height: 26px; margin: 34px 0; position: relative; background: linear-gradient(90deg, transparent, var(--gold-soft), transparent); mask: linear-gradient(#fff 0 0) top/100% 2px no-repeat; }
.divider::after { content: "❖"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); color: var(--gold); background: var(--paper); padding: 0 14px; font-size: 14px; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 18px; }
.section-title h2 { font-size: 30px; color: var(--ink); }
.section-title .sub { color: var(--ink-3); font-size: 14px; font-family: var(--font-ui); }
.section-title .tail { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .65s ease, transform .65s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------------- 首页 ---------------- */
.hero { position: relative; border-radius: 16px; overflow: hidden; min-height: 320px; display: flex; align-items: flex-end; box-shadow: var(--shadow-lift); border: 1px solid var(--line); }
.hero img.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,22,12,.42) 0%, rgba(30,22,12,.62) 45%, rgba(30,22,12,.88) 82%); }
.hero-inner { position: relative; padding: 34px 34px 30px; color: #fff; width: 100%; }
.hero-kicker { font-family: var(--font-ui); letter-spacing: 6px; font-size: 14px; opacity: .9; }
.hero-title { font-size: clamp(34px, 6vw, 56px); letter-spacing: 6px; text-shadow: 0 2px 14px rgba(0,0,0,.35); }
.hero-sub { max-width: 660px; opacity: .95; margin: 8px 0 16px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.progress-strip {
  display: flex; align-items: center; gap: 20px; margin-top: 18px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 20px; box-shadow: var(--shadow); flex-wrap: wrap;
}
.ring { width: 74px; height: 74px; flex: none; }
.ring text { font-family: var(--font-ui); }
.strip-stats { display: flex; gap: 26px; flex-wrap: wrap; flex: 1; }
.strip-stat b { font-size: 22px; font-family: var(--font-ui); color: var(--red); display: block; line-height: 1.2; }
.strip-stat span { font-size: 13px; color: var(--ink-3); }
.strip-badge-preview { display: flex; gap: 6px; align-items: center; }
.mini-seal {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--red);
  color: #fff; font-family: var(--font-brush); font-size: 17px; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); transform: rotate(-4deg);
}
.mini-seal.locked { background: #cfc4ae; }

/* 长卷导航 */
.scroll-wrap { position: relative; }
.scroll-track { display: flex; gap: 16px; overflow-x: auto; padding: 10px 4px 18px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--gold-soft) transparent; }
.scroll-track::-webkit-scrollbar { height: 8px; }
.scroll-track::-webkit-scrollbar-thumb { background: var(--gold-soft); border-radius: 99px; }
.dyn-card {
  scroll-snap-align: start; flex: 0 0 218px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); overflow: hidden; cursor: pointer; text-decoration: none !important;
  transition: transform .25s, box-shadow .25s; position: relative; box-shadow: var(--shadow); display: block;
}
.dyn-card:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: var(--shadow-lift); }
.dyn-card .dyn-img { height: 130px; position: relative; overflow: hidden; background: var(--paper-2); }
.dyn-card .dyn-img img, .dyn-card .dyn-img .fb-art { width: 100%; height: 100%; object-fit: cover; }
.dyn-card .dyn-tag { position: absolute; left: 10px; top: 10px; background: rgba(166,58,43,.92); color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 999px; font-family: var(--font-ui); }
.dyn-card.jp .dyn-tag { background: rgba(53,89,126,.94); }
.dyn-body { padding: 12px 14px 14px; }
.dyn-name { font-family: var(--font-brush); font-size: 26px; color: var(--ink); line-height: 1.15; }
.dyn-name em { font-style: normal; font-size: 14px; color: var(--gold); margin-left: 6px; }
.dyn-card.jp .dyn-name em { color: var(--asagi); }
.dyn-range { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.dyn-meta { font-size: 13px; color: var(--ink-2); margin-top: 6px; min-height: 38px; }
.dyn-progress { height: 6px; background: var(--paper-2); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.dyn-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); border-radius: 99px; transition: width .5s; }

/* 入口卡 */
.game-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.game-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  text-decoration: none !important; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s; position: relative; overflow: hidden;
}
.game-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.game-card .g-icon { font-size: 30px; }
.game-card h3 { font-size: 24px; margin: 6px 0 4px; }
.game-card p { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.game-card .g-best { margin-top: 10px; font-size: 12.5px; color: var(--gold); }

/* ---------------- 章节页 ---------------- */
.ch-hero { position: relative; border-radius: 16px; overflow: hidden; min-height: 300px; display: flex; align-items: flex-end; border: 1px solid var(--line); box-shadow: var(--shadow-lift); }
.ch-hero img, .ch-hero .fb-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ch-hero .hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,22,12,.36) 0%, rgba(30,22,12,.6) 45%, rgba(30,22,12,.88) 85%); }
.ch-hero.jp-shade .hero-shade { background: linear-gradient(180deg, rgba(12,20,32,.38) 0%, rgba(12,20,32,.62) 45%, rgba(12,20,32,.9) 85%); }
.ch-hero-inner { position: relative; padding: 28px 30px; color: #fff; width: 100%; }
.ch-title { font-size: clamp(30px, 5vw, 48px); letter-spacing: 4px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ch-title .tagline { font-size: 18px; color: #f3d9a4; letter-spacing: 2px; }
.ch-hero.jp-shade .ch-title .tagline { color: #a8d8e8; }
.ch-range { font-family: var(--font-ui); letter-spacing: 2px; opacity: .92; }
.back-link { font-family: var(--font-ui); font-size: 14px; display: inline-block; margin-bottom: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.stat-cell { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); }
.stat-cell b { color: var(--red); font-family: var(--font-ui); font-weight: 400; display: block; font-size: 15px; }
.stat-cell span { font-size: 14.5px; color: var(--ink); }
.ch-intro {
  margin-top: 18px; background: linear-gradient(135deg, #fffdf6, #fbf4e2); border: 1px solid var(--line);
  border-left: 4px solid var(--gold); border-radius: 12px; padding: 16px 20px; font-size: 16.5px; box-shadow: var(--shadow);
}

/* 神话剧场 */
.theater { display: grid; gap: 16px; }
.story-panel {
  background: linear-gradient(160deg, #fffdf6, #f9f0da); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 24px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.story-panel::before {
  content: "剧场"; position: absolute; right: 14px; top: 12px; font-family: var(--font-brush);
  font-size: 46px; color: rgba(184,146,61,.14); transform: rotate(-4deg);
}
.story-panel h3 { font-size: 23px; margin-bottom: 8px; color: var(--red-deep); }
.story-panel p { margin: 8px 0; font-size: 15.5px; color: var(--ink); }
.story-panel .src { margin-top: 6px; }

/* 图鉴卡（章节内收录） */
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card-col {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; cursor: pointer; position: relative;
}
.card-col:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
.card-col .cimg { height: 128px; background: var(--paper-2); position: relative; overflow: hidden; }
.card-col .cimg img, .card-col .cimg .fb-art { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card-col:hover .cimg img { transform: scale(1.06); }
.card-col .cbody { padding: 10px 14px 12px; }
.card-col h3 { font-size: 20px; }
.card-col .ctype { font-size: 12px; color: var(--ink-3); }
.card-col .collect-btn {
  margin-top: 8px; width: 100%; border: 1.5px dashed var(--gold); background: #fffdf3; color: var(--red);
  border-radius: 8px; padding: 6px 0; cursor: pointer; font-family: var(--font-ui); font-size: 13.5px; transition: all .2s;
}
.card-col .collect-btn:hover { background: var(--gold); color: #fff; }
.card-col.collected { border-color: var(--gold); }
.card-col.collected .collect-btn { border-style: solid; background: var(--green); border-color: var(--green); color: #fff; cursor: default; }
.card-col .collected-seal {
  position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; background: rgba(82,112,92,.95);
  color: #fff; border-radius: 9px; display: grid; place-items: center; font-family: var(--font-brush); font-size: 24px;
  transform: rotate(-6deg); box-shadow: inset 0 0 0 2px rgba(255,255,255,.45); animation: stampIn .45s cubic-bezier(.2,1.6,.4,1) both;
}
.card-col .ccredit { position: absolute; left: 8px; bottom: 6px; font-size: 10.5px; color: rgba(255,255,255,.85); background: rgba(40,30,15,.45); padding: 1px 8px; border-radius: 99px; }

/* 版本演变线 */
.evo { position: relative; margin-left: 26px; padding-left: 16px; }
.evo::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, var(--gold-soft), var(--red)); }
.evo-item { position: relative; padding-bottom: 16px; }
.evo-item::before { content: ""; position: absolute; left: -22px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 3px solid var(--gold); }
.evo-item b { font-family: var(--font-ui); color: var(--red); font-weight: 400; margin-right: 8px; }
.evo-item p { margin: 4px 0 0; font-size: 14.5px; color: var(--ink-2); }

/* 冷知识 */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
details.fact { background: var(--card); border: 1px dashed var(--gold-soft); border-radius: 12px; padding: 12px 16px; }
details.fact summary { cursor: pointer; font-family: var(--font-ui); color: var(--red); font-size: 15px; list-style: none; }
details.fact summary::-webkit-details-marker { display: none; }
details.fact summary::before { content: "❓ "; }
details.fact[open] summary::before { content: "💡 "; }
details.fact p { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }

.ch-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 26px; }
.ch-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; }
.read-done { background: var(--green); box-shadow: 0 4px 14px rgba(82,112,92,.3); }

/* ---------------- 体系图馆 ---------------- */
.diagram-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dia-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px;
  text-decoration: none !important; color: var(--ink); box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; display: block;
}
.dia-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); }
.dia-card .d-icon { font-size: 28px; }
.dia-card h3 { font-size: 22px; margin: 6px 0 4px; }
.dia-card p { margin: 0 0 10px; color: var(--ink-2); font-size: 13px; }
.dia-card .d-stats { display: flex; justify-content: space-between; font-size: 12px; color: var(--gold); }

.diagram-stage { position: relative; background: linear-gradient(150deg, #fbf5e4, #f4ead0); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.diagram-stage svg { display: block; width: 100%; height: 640px; touch-action: none; cursor: grab; }
.diagram-stage svg.dragging { cursor: grabbing; }
.dia-controls { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; z-index: 5; }
.dia-controls button {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,253,246,.95);
  font-size: 17px; cursor: pointer; color: var(--ink-2); box-shadow: 0 2px 8px rgba(90,70,40,.15);
}
.dia-controls button:hover { color: var(--red); border-color: var(--gold); }
.dia-hint { position: absolute; left: 14px; bottom: 14px; font-size: 12.5px; color: var(--ink-3); background: rgba(255,253,246,.9); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; z-index: 5; }

/* 图谱节点/边（SVG 内） */
.dnode { cursor: pointer; }
.dnode circle.node-bg { fill: #fffdf6; stroke-width: 3; transition: stroke-width .2s; filter: drop-shadow(0 2px 4px rgba(90,70,40,.25)); }
.dnode:hover circle.node-bg { stroke-width: 5; }
.dnode text.dname { font-family: var(--font-ui); font-size: 13px; fill: var(--ink); text-anchor: middle; }
.dnode text.dera { font-family: var(--font-ui); font-size: 10px; fill: var(--ink-3); text-anchor: middle; }
.dnode.seen circle.seen-mark { display: block; }
.dnode circle.seen-mark { display: none; }
.dedge line, .dedge path { stroke: #b9a888; stroke-width: 2; fill: none; }
.dedge.dashed line, .dedge.dashed path { stroke-dasharray: 6 5; stroke: #c9bb9b; stroke-width: 1.6; }
.dedge text { font-family: var(--font-ui); font-size: 10.5px; fill: #8a7a5c; text-anchor: middle; }
.dedge.dashed text { fill: #b3a486; font-size: 9.5px; }
.dia-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--ink-2); font-family: var(--font-ui); }
.dia-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* 节点详情卡 */
.node-pop {
  margin-top: 14px; background: var(--card); border: 1px solid var(--gold-soft); border-radius: 14px;
  padding: 16px 18px; box-shadow: var(--shadow-lift); display: flex; gap: 16px; animation: fadeUp .3s;
}
.node-pop .np-img { width: 108px; height: 132px; flex: none; border-radius: 10px; overflow: hidden; background: var(--paper-2); position: relative; }
.node-pop .np-img img, .node-pop .np-img .fb-art { width: 100%; height: 100%; object-fit: cover; }
.node-pop h3 { font-size: 24px; }
.node-pop .np-era { font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; }
.node-pop p { margin: 6px 0; font-size: 14px; color: var(--ink-2); }
.node-pop .np-close { position: absolute; right: 12px; top: 10px; }

/* ---------------- 我的图鉴 ---------------- */
.prog-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow); }
.panel h3 { font-size: 22px; margin-bottom: 12px; }
.prog-row { margin-bottom: 14px; }
.prog-row .pr-head { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.prog-row .pr-bar { height: 9px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.prog-row .pr-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--red)); transition: width .6s; }
.badge-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.badge-cell { text-align: center; padding: 14px 8px; border-radius: 12px; border: 1px dashed var(--line); background: #fff; }
.badge-cell .mini-seal { width: 46px; height: 46px; font-size: 26px; margin: 0 auto 8px; border-radius: 10px; }
.badge-cell b { display: block; font-family: var(--font-ui); font-weight: 400; font-size: 15px; }
.badge-cell span { font-size: 12px; color: var(--ink-3); display: block; margin-top: 2px; }
.badge-cell.locked { opacity: .55; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.stat-table td { padding: 7px 4px; border-bottom: 1px dashed var(--line); }
.stat-table td:last-child { text-align: right; font-family: var(--font-ui); color: var(--red); }

/* 图鉴墙 */
.dex-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.dex-cell { border-radius: 12px; border: 1px solid var(--line); background: #fff; overflow: hidden; text-align: center; box-shadow: var(--shadow); }
.dex-cell .dx-img { height: 84px; position: relative; background: var(--paper-2); overflow: hidden; }
.dex-cell .dx-img img, .dex-cell .dx-img .fb-art { width: 100%; height: 100%; object-fit: cover; }
.dex-cell.uncollected .dx-img img, .dex-cell.uncollected .dx-img .fb-art { filter: grayscale(1) brightness(.28); }
.dex-cell b { display: block; font-family: var(--font-ui); font-weight: 400; font-size: 13.5px; padding: 4px 2px 6px; }
.dex-cell.uncollected b { color: var(--ink-3); }
.dex-cell .dx-no { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; color: rgba(255,255,255,.85); font-family: var(--font-brush); }
.dex-cell.uncollected { cursor: pointer; }

/* ---------------- 每日一签 ---------------- */
.fortune-stage { text-align: center; padding: 30px 0 10px; }
.qian-box {
  width: 150px; height: 150px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #c9a24b, #8a6a24); box-shadow: 0 14px 34px rgba(138,106,36,.4), inset 0 0 0 6px rgba(255,255,255,.22);
  cursor: pointer; transition: transform .2s; position: relative;
}
.qian-box:hover { transform: scale(1.05) rotate(-2deg); }
.qian-box span { font-family: var(--font-brush); font-size: 64px; color: #fff; text-shadow: 0 3px 8px rgba(60,40,0,.4); }
.qian-card {
  max-width: 480px; margin: 0 auto; background: linear-gradient(160deg, #fffdf6, #f8ecd0); border: 2px solid var(--gold);
  border-radius: 16px; padding: 26px 28px; box-shadow: var(--shadow-lift); position: relative; animation: scrollOpen .6s cubic-bezier(.2,1.2,.3,1) both;
}
.qian-card .q-level {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%) rotate(-3deg); background: var(--red); color: #fff;
  font-family: var(--font-brush); font-size: 20px; padding: 4px 18px; border-radius: 8px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4), 0 4px 10px rgba(130,43,31,.4);
}
.qian-card .q-orig { font-size: 18px; color: var(--ink); margin: 12px 0 8px; letter-spacing: 1px; }
.qian-card .q-baihua { font-size: 14.5px; color: var(--ink-2); }
.qian-card .src { display: flex; justify-content: center; margin-top: 10px; }

/* ---------------- 参考资料 / 弹层 ---------------- */
.ref-list { columns: 2; column-gap: 34px; font-size: 14.5px; }
.ref-list li { margin-bottom: 8px; break-inside: avoid; }
.modal-mask { position: fixed; inset: 0; background: rgba(40,30,15,.5); z-index: 90; display: grid; place-items: center; padding: 20px; animation: fadeUp .25s; }
.modal {
  background: var(--card); border-radius: 16px; max-width: 460px; width: 100%; padding: 26px 28px;
  box-shadow: var(--shadow-lift); border: 1px solid var(--gold-soft); text-align: center; position: relative;
}
.modal .m-seal { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 12px; background: var(--red); color: #fff; display: grid; place-items: center; font-family: var(--font-brush); font-size: 34px; transform: rotate(-6deg); box-shadow: inset 0 0 0 2.5px rgba(255,255,255,.45); }
.modal h3 { font-size: 26px; margin-bottom: 6px; }
.modal p { color: var(--ink-2); margin: 6px 0 16px; font-size: 14.5px; }
.modal .m-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.scroll-anim { animation: scrollOpen .6s cubic-bezier(.2,1.2,.3,1) both; }
@keyframes scrollOpen { from { transform: scaleX(.1); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes stampIn { 0% { transform: scale(2.4) rotate(14deg); opacity: 0; } 60% { transform: scale(.92) rotate(-10deg); opacity: 1; } 100% { transform: scale(1) rotate(-8deg); opacity: 1; } }

#toastRoot { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: rgba(51,41,31,.92); color: #fff; padding: 9px 18px; border-radius: 999px; font-size: 14px; animation: fadeUp .3s; box-shadow: 0 6px 18px rgba(0,0,0,.25); max-width: 86vw; }
#confettiRoot { position: fixed; inset: 0; pointer-events: none; z-index: 98; overflow: hidden; }
.confetti-bit { position: absolute; width: 9px; height: 14px; top: -20px; animation: confFall linear both; }
@keyframes confFall { to { transform: translateY(105vh) rotate(720deg); opacity: .6; } }

/* SVG 兜底插画 */
.fb-box { width: 100%; height: 100%; }
.hero .fb-box, .ch-hero .fb-box { position: absolute; inset: 0; }
.fb-art { display: grid; place-items: center; width: 100%; height: 100%; background: linear-gradient(150deg, #f3e9cf, #e8d9b5); position: relative; }
.fb-art svg { width: 100%; height: 100%; }
.fb-label { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--ink-2); font-family: var(--font-ui); letter-spacing: 2px; }
.fb-seal { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; background: var(--red); color: #fff; border-radius: 7px; display: grid; place-items: center; font-family: var(--font-brush); font-size: 20px; transform: rotate(-5deg); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.jp .fb-seal { background: var(--indigo); }

/* 页脚 */
.footer { border-top: 1px solid var(--line); background: var(--paper-2); position: relative; z-index: 1; }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 26px 22px 34px; text-align: center; }
.footer-brand { font-family: var(--font-brush); font-size: 20px; margin: 0 0 8px; }
.seal-inline { display: inline-grid; place-items: center; width: 26px; height: 26px; background: var(--red); color: #fff; border-radius: 6px; font-size: 16px; margin-right: 6px; }
.footer-note { font-size: 12.5px; color: var(--ink-3); margin: 4px 0; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 960px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .diagram-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .prog-grid { grid-template-columns: 1fr; }
  .dex-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
  .app { padding: 16px 14px 46px; }
  .brand-name { font-size: 19px; white-space: nowrap; letter-spacing: 1px; }
  .brand-seal { width: 32px; height: 32px; font-size: 20px; }
  .nav {
    display: none; position: absolute; top: 58px; right: 14px; flex-direction: column;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px;
    box-shadow: var(--shadow-lift); min-width: 150px;
  }
  .nav.open { display: flex; }
  #navToggle { display: grid; place-items: center; background: transparent; border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 36px; font-size: 17px; color: var(--ink-2); }
  .hero-inner { padding: 22px 18px; }
  .game-grid, .diagram-grid, .card-grid, .facts { grid-template-columns: 1fr; }
  .dex-grid { grid-template-columns: repeat(3, 1fr); }
  .badge-wall { grid-template-columns: repeat(2, 1fr); }
  .diagram-stage svg { height: 440px; }
  .dia-hint { display: none; }
  .node-pop { flex-direction: column; }
  .node-pop .np-img { width: 100%; height: 150px; }
  .ref-list { columns: 1; }
  .dyn-card { flex-basis: 190px; }
  .strip-stats { gap: 16px; }
}
