/* =========================================================
   诗途 · 小学必背古诗 · 青绿山水风格
   ========================================================= */
:root {
  --bg: #FBF7EE;
  --card: #FFFFFF;
  --primary: #3BA59A;
  --primary-dark: #2C8A80;
  --primary-soft: #E2F3EF;
  --red: #E8613C;
  --red-soft: #FDEBE4;
  --yellow: #F2B544;
  --yellow-soft: #FDF2DA;
  --ink: #33415C;
  --ink-soft: #55607A;
  --muted: #8A93A6;
  --line: #EAE4D6;
  --off: #E3DDD0;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 6px 22px rgba(51, 65, 92, .08);
  --shadow-btn: 0 6px 14px rgba(44, 138, 128, .28);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-kai: "Kaiti SC", "STKaiti", "KaiTi", "楷体", "BiauKai", "Noto Serif CJK SC", "Songti SC", serif;
  --poem-size: 30px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
body[data-font="large"] { --poem-size: 36px; }
body[data-font="xlarge"] { --poem-size: 42px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.kai { font-family: var(--font-kai); }
.muted { color: var(--muted); }
.center { text-align: center; }
.accent { color: var(--red); }
.hint { font-size: 14px; color: var(--muted); margin: 10px 4px; }
.hint.warn, .warn { color: #C0582F; }
.danger { color: #C0392B !important; }

/* ---------- 页面背景与框架 ---------- */
.page-bg {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 300px;
  background: url("../images/bg-header.webp") 70% top / cover no-repeat;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
  opacity: .9;
  pointer-events: none;
  z-index: 0;
}
.is-bare .page-bg { height: 380px; }
.shell {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px calc(96px + var(--safe-b));
}
.is-bare .shell { padding-bottom: 24px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 64px;
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar:empty { min-height: 8px; }
.topbar-title {
  flex: 1;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
}
.icon-btn, .icon-btn-space { width: 48px; height: 48px; flex: none; }
.icon-btn {
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .75);
  box-shadow: var(--shadow);
}
.home-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.home-user .nick { font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-user + .topbar-title { flex: none; }
.topbar .fire-pill { flex: 1; justify-content: flex-end; display: flex; }

.loading { padding: 120px 0; text-align: center; color: var(--muted); }
.loading-dot {
  display: inline-block; width: 10px; height: 10px; margin-right: 8px;
  border-radius: 50%; background: var(--primary);
  animation: pulse 1s infinite alternate;
}
@keyframes pulse { to { opacity: .2; transform: scale(.6); } }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: space-around;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 8px calc(8px + var(--safe-b));
  background: rgba(255, 255, 255, .96);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -4px 20px rgba(51, 65, 92, .08);
  backdrop-filter: blur(8px);
}
.tabbar a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 56px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 14px;
  border-radius: 14px;
}
.tabbar a i { width: 28px; height: 28px; }
.tabbar a.active { color: var(--primary); font-weight: 700; }
.tabbar a.active span::after {
  content: ""; display: block; height: 3px; width: 22px; margin: 1px auto 0;
  border-radius: 2px; background: var(--primary);
}

/* ---------- 图标（SVG 蒙版，颜色随文字） ---------- */
[class^="ico-"], [class*=" ico-"] {
  display: inline-block;
  width: 1.1em; height: 1.1em;
  vertical-align: -.18em;
  background-color: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
  flex: none;
}
.ico-home { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3 11.2 12 3.5l9 7.7V20a1.5 1.5 0 0 1-1.5 1.5H15v-6.2H9v6.2H4.5A1.5 1.5 0 0 1 3 20z'/></svg>"); }
.ico-poems, .ico-book { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M2.5 5.2C5.6 3.8 8.6 3.9 11.2 5.6v15c-2.6-1.6-5.6-1.7-8.7-.4zM21.5 5.2c-3.1-1.4-6.1-1.3-8.7.4v15c2.6-1.6 5.6-1.7 8.7-.4z'/></svg>"); }
.ico-game { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill-rule='evenodd' d='M7 6.5h10a5.5 5.5 0 0 1 5.5 5.5v1.5a4 4 0 0 1-7.2 2.4L14.5 15h-5l-.8.9A4 4 0 0 1 1.5 13.5V12A5.5 5.5 0 0 1 7 6.5zM6.2 9.5v1.8H4.4v1.6h1.8v1.8h1.6v-1.8h1.8v-1.6H7.8V9.5zM16.5 10a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4zm2.3 2.3a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4z'/></svg>"); }
.ico-me { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='7.8' r='4.6'/><path d='M3 21.5c0-4.8 4-8 9-8s9 3.2 9 8z'/></svg>"); }
.ico-back { width: 24px; height: 24px; --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M15 4 7 12l8 8' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.ico-arrow { width: .9em; height: .9em; margin-left: 4px; --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m9 4 8 8-8 8' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.ico-play { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 4.2v15.6c0 .8.9 1.3 1.6.8l11.5-7.8a1 1 0 0 0 0-1.6L8.6 3.4C7.9 2.9 7 3.4 7 4.2z'/></svg>"); }
.ico-stop { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='5.5' y='5.5' width='13' height='13' rx='2.5'/></svg>"); }
.ico-fire { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12.5 1.8s5.8 4.6 5.8 11.2a6.3 6.3 0 0 1-12.6 0c0-3.3 2-5.4 2-5.4s.4 3 2.6 3.3C10.300 7 12.5 4.800 12.5 1.8z'/></svg>"); }
.ico-check { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m4.5 12.5 5 5L19.5 7' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.ico-check-circle { width: 1.3em; height: 1.3em; margin-right: 8px; --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill-rule='evenodd' d='M12 1.5a10.5 10.5 0 1 1 0 21 10.5 10.5 0 0 1 0-21zm4.6 6.4-6 6.3-3-3-1.7 1.7 4.7 4.7 7.7-8z'/></svg>"); }
.ico-lock { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='4.5' y='10' width='15' height='11.5' rx='2.5'/><path d='M8 10.5V7.5a4 4 0 0 1 8 0v3' fill='none' stroke='black' stroke-width='2.6'/></svg>"); }
.ico-leaf { color: var(--primary); --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3.5 20.5C3.5 10.500 9.500 3.500 21 3.500c0 11.500-7 17-17.500 17z'/></svg>"); }
.ico-hill { color: var(--primary); --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M1.5 20.5 8.5 8l4.200 6.500L16 10l6.500 10.500z'/></svg>"); }
.ico-pen { --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M3.5 20.5 4.600 15 15.600 4a2.100 2.100 0 0 1 3 0l1.400 1.400a2.100 2.100 0 0 1 0 3L9 19.400z'/></svg>"); }

/* ---------- 通用组件 ---------- */
.card {
  display: block;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: transform .12s, box-shadow .12s, opacity .12s;
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #47B5A9, var(--primary-dark));
  box-shadow: var(--shadow-btn);
}
.btn-ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn-danger { background: var(--red); color: #fff; }
.btn-soft-yellow { background: var(--yellow-soft); color: #B9802A; border: 2px solid #F6DFAE; }
.btn-soft-red { background: var(--red-soft); color: #D4552F; border: 2px solid #F8D3C6; }
.btn-text { background: none; color: var(--muted); font-weight: 500; font-size: 15px; min-height: 44px; padding: 0 8px; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 16px; }
.btn-xl { min-height: 64px; font-size: 22px; letter-spacing: 3px; }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; gap: 12px; margin: 14px 0; }
.btn-row > .btn { flex: 1; }
.btn-xl .ico-arrow { width: 1em; height: 1em; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  min-height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .85);
  box-shadow: var(--shadow);
  font-weight: 600;
  white-space: nowrap;
}
.fire-pill { flex: none !important; color: var(--red); background: #FFF4EC; font-size: 16px; }
.fire-pill b { font-size: 24px; line-height: 1; }
.fire-pill i { width: 22px; height: 22px; background: linear-gradient(#F7B53E, #E8613C); }
.fire-pill.is-off { color: var(--muted); background: #fff; }
.fire-pill.is-off i { background: var(--off); }

.bar { height: 10px; border-radius: 999px; background: #ECE8DF; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4BB8AB, var(--primary-dark)); transition: width .5s; }
.bar-lg { height: 16px; }

.input {
  width: 100%;
  min-height: 54px;
  padding: 12px 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: #FDFBF6;
  font-size: 18px;
  outline: none;
}
.input:focus { border-color: var(--primary); background: #fff; }

.switch {
  appearance: none; -webkit-appearance: none;
  position: relative;
  width: 60px; height: 34px;
  margin: 0;
  border-radius: 999px;
  background: var(--off);
  transition: background .2s;
  flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
  transition: transform .2s;
}
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(26px); }
.switch-label { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; cursor: pointer; }

.sec-title { display: flex; align-items: center; gap: 8px; font-size: 20px; margin-bottom: 12px; }
.sec-title i { width: 22px; height: 22px; }
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 2px 12px;
  font-size: 22px;
}
.sec-head span { padding-left: 12px; border-left: 5px solid var(--primary); line-height: 1.1; }
.sec-head em, .sec-head a { font-style: normal; font-size: 15px; color: var(--muted); font-weight: 500; display: flex; align-items: center; min-height: 44px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 16px;
  font-weight: 600;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-sm { min-height: 38px; padding: 0 14px; font-size: 15px; }
.chips-sub .chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }

/* 头像 */
.avatar {
  position: relative;
  display: inline-grid; place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--primary-soft);
  overflow: hidden;
  flex: none;
}
.avatar em { font-style: normal; font-size: 2.1em; line-height: 1; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 44px; height: 44px; font-size: 12px; }
.avatar.md { width: 56px; height: 56px; font-size: 14px; border: 3px solid #fff; box-shadow: var(--shadow); }
.avatar.lg { width: 84px; height: 84px; font-size: 22px; border: 4px solid #fff; box-shadow: var(--shadow); }

/* 星级（朱红印章星） */
.stars { display: inline-flex; gap: 3px; vertical-align: middle; }
.seal-star {
  width: 20px; height: 20px;
  background: var(--off);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 1.8a1.300 1.300 0 0 1 1.200.8l2.400 5 5.400.7a1.300 1.300 0 0 1 .700 2.300l-4 3.700 1 5.400a1.300 1.300 0 0 1-1.900 1.400L12 18.500l-4.800 2.600a1.300 1.300 0 0 1-1.900-1.400l1-5.400-4-3.700a1.300 1.300 0 0 1 .700-2.300l5.400-.7 2.400-5A1.300 1.300 0 0 1 12 1.800z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 1.8a1.300 1.300 0 0 1 1.200.8l2.400 5 5.400.7a1.300 1.300 0 0 1 .700 2.300l-4 3.700 1 5.400a1.300 1.300 0 0 1-1.900 1.400L12 18.500l-4.800 2.600a1.300 1.300 0 0 1-1.900-1.400l1-5.400-4-3.700a1.300 1.300 0 0 1 .700-2.300l5.400-.7 2.400-5A1.300 1.300 0 0 1 12 1.800z'/></svg>") center / contain no-repeat;
}
.seal-star.on { background: linear-gradient(160deg, #F07A50, #D9472A); }
.stars.big { gap: 6px; }
.stars.big .seal-star { width: 40px; height: 40px; }

/* 段位印章 */
.rank-seal {
  flex: none;
  display: grid; place-items: center;
  width: 64px; min-height: 104px;
  padding: 8px 6px;
  border: 3px solid #fff;
  outline: 3px solid var(--red);
  border-radius: 12px;
  background: linear-gradient(160deg, #EE7550, #D9472A);
  color: #fff;
  font-family: var(--font-kai);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  writing-mode: vertical-rl;
  letter-spacing: 4px;
  box-shadow: 0 6px 16px rgba(217, 71, 42, .3);
  transform: rotate(-3deg);
}
.rank-seal.big { margin: 4px auto 14px; width: 84px; min-height: 140px; font-size: 44px; }

/* 提示条 */
.toast-box {
  position: fixed; left: 0; right: 0; top: calc(16px + env(safe-area-inset-top, 0px));
  z-index: 100;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast, .inline-toast {
  max-width: calc(100% - 32px);
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(51, 65, 92, .94);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  animation: toast-in .25s ease-out;
  transition: opacity .35s, transform .35s;
}
.toast.ok, .inline-toast.ok { background: var(--primary-dark); }
.toast.warn, .inline-toast.warn { background: #D4552F; }
.toast.out, .inline-toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
.inline-toast {
  position: fixed; left: 50%; top: 40%;
  transform: translateX(-50%);
  z-index: 90;
  text-align: center;
  white-space: nowrap;
}
.inline-toast.out { transform: translate(-50%, -10px); }

/* 弹窗 */
.modal-wrap {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(40, 48, 66, .45);
  opacity: 0;
  transition: opacity .2s;
}
.modal-wrap.show { opacity: 1; }
.modal {
  width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto;
  padding: 24px 20px 18px;
  border-radius: 26px;
  background: var(--bg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .2);
  transform: scale(.92);
  transition: transform .2s;
}
.modal-wrap.show .modal { transform: none; }
.modal-title { font-size: 22px; text-align: center; margin-bottom: 12px; }
.modal-text { font-size: 18px; margin: 6px 0 16px; line-height: 1.7; }
.modal .input { margin-bottom: 12px; }
.note-title { font-size: 34px; color: var(--primary-dark); text-align: center; }
.code-box { font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; resize: none; }
.preview-box { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius-sm); background: var(--primary-soft); margin-bottom: 6px; }

.celebrate { text-align: center; position: relative; }
.celebrate h2 { font-size: 30px; margin: 12px 0 6px; color: var(--red); }
.celebrate p { font-size: 17px; margin-bottom: 8px; }
.celebrate .btn { margin-top: 16px; }
.celebrate .stars { margin-top: 10px; }
.celebrate .seal-star.on { animation: pop .5s backwards; }
.celebrate .seal-star.on:nth-child(2) { animation-delay: .08s; }
.celebrate .seal-star.on:nth-child(3) { animation-delay: .16s; }
.celebrate .seal-star.on:nth-child(4) { animation-delay: .24s; }
.celebrate .seal-star.on:nth-child(5) { animation-delay: .32s; }
.burst {
  position: absolute; left: 50%; top: 30px; width: 220px; height: 220px; margin-left: -110px; margin-top: -80px;
  background: repeating-conic-gradient(rgba(242, 181, 68, .22) 0 10deg, transparent 10deg 20deg);
  border-radius: 50%;
  animation: spin 8s linear infinite;
  z-index: -1;
}
@keyframes pop { from { transform: scale(0) rotate(-30deg); } 70% { transform: scale(1.3); } }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-card { text-align: center; color: var(--ink-soft); padding: 24px 18px; }
.empty-card .btn { margin-top: 14px; }
.load-error { margin-top: 60px; }
.load-error h2 { margin-bottom: 10px; }
.load-error pre { background: var(--bg); padding: 10px; border-radius: 10px; overflow-x: auto; }

/* ---------- 首次进入 ---------- */
.welcome-hero { position: relative; display: flex; align-items: center; min-height: 230px; margin: 0 -16px 8px; padding: 0 16px; }
.hero-mascot { width: 46%; max-width: 230px; margin-left: -8px; filter: drop-shadow(0 6px 10px rgba(51, 65, 92, .12)); }
.hero-text { flex: 1; padding-left: 4px; }
.hero-text h1 { font-size: clamp(38px, 11vw, 56px); line-height: 1.15; }
.hero-text p { margin-top: 10px; font-size: clamp(12px, 3.6vw, 16px); color: var(--ink-soft); white-space: nowrap; }
.form-card .sec-title { font-size: 20px; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.avatar-pick {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px 0;
  border: 0; background: none;
  font-size: 15px; font-weight: 600;
}
.avatar-pick .avatar { width: min(72px, 18vw); height: min(72px, 18vw); font-size: 15px; border: 3px solid transparent; transition: transform .15s; }
.avatar-pick.selected .avatar { border-color: var(--primary); transform: scale(1.05); box-shadow: 0 0 0 3px var(--primary-soft); }
.avatar-pick.selected::after {
  content: ""; position: absolute; top: 0; right: 6%;
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #fff;
  background: var(--primary) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m5 12.500 4.500 4.500L19 7.500' fill='none' stroke='white' stroke-width='3.400' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 70% no-repeat;
}
.avatar-grid.sm { margin-bottom: 12px; }
.avatar-grid.sm .avatar { width: 56px; height: 56px; }
.grade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grade-grid.sm { margin-bottom: 6px; }
.grade-btn {
  position: relative;
  min-height: 56px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #FAF8F3;
  font-size: 18px; font-weight: 700;
}
.grade-btn.selected { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-btn); }
#start { margin-top: 6px; }
.welcome-foot {
  height: 130px; margin: 6px -16px 0;
  background: url("../images/bg-footer.webp") center bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(transparent, #000 45%);
  mask-image: linear-gradient(transparent, #000 45%);
}

/* ---------- 首页 ---------- */
.rank-card {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  min-height: 170px;
  padding: 20px 20px 20px 22px;
  overflow: hidden;
  background: linear-gradient(115deg, #fff 55%, rgba(255, 255, 255, .7)), url("../images/bg-header.webp") center / cover;
}
.rank-body { flex: 1; position: relative; z-index: 1; min-width: 0; padding-right: 112px; }
.rank-text { font-size: clamp(13px, 3.8vw, 15px); font-weight: 600; margin-bottom: 10px; line-height: 1.7; white-space: nowrap; }
.rank-text b { font-size: 20px; color: var(--primary-dark); margin: 0 2px; }
.rank-num { text-align: center; color: var(--primary-dark); font-weight: 700; margin-top: 4px; }
.rank-figure {
  position: absolute; right: 4px; bottom: 0;
  height: 100%; width: 128px;
  cursor: pointer;
}
.rank-scholar { position: absolute; right: 18px; bottom: 0; height: 96%; max-height: 190px; width: auto; filter: drop-shadow(0 4px 6px rgba(51, 65, 92, .16)); }
.rank-pet { position: absolute; left: -6px; bottom: -2px; height: 38%; max-height: 66px; width: auto; filter: drop-shadow(0 3px 4px rgba(51, 65, 92, .16)); }

.poem-row { display: flex; align-items: center; gap: 14px; padding: 12px; }
.thumb { width: 92px; height: 80px; border-radius: 14px; object-fit: cover; flex: none; background: var(--primary-soft); }
.poem-row-body { flex: 1; min-width: 0; }
.poem-row h4, .poem-item h4 { font-size: 22px; line-height: 1.3; }
.poem-row .muted { font-size: 14px; }
.line1 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft); }
.poem-row .btn { flex: none; padding: 0 14px; }

.rec-card { position: relative; padding: 0; overflow: hidden; min-height: 200px; }
.rec-img {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 58%; height: 100%; object-fit: cover;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%);
  mask-image: linear-gradient(90deg, transparent, #000 45%);
}
.rec-body { position: relative; padding: 20px; max-width: 66%; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.rec-body h4 { font-size: 26px; }
.rec-lines { font-size: 17px; line-height: 1.8; color: var(--ink-soft); }
.rec-body .btn { margin-top: 6px; }

/* ---------- 列表 ---------- */
.list-count { font-size: 14px; margin: 4px 4px 10px; }
.poem-list { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.poem-item { display: flex; align-items: center; gap: 14px; padding: 12px; }
.poem-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.poem-item .muted { font-size: 14px; }
.grade-tag { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-dark); font-size: 12px; }

/* ---------- 诗词详情 ---------- */
.seg-tabs {
  display: flex;
  max-width: 420px;
  margin: 0 auto 12px;
  padding: 5px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
}
.seg-tab {
  flex: 1;
  display: grid; place-items: center;
  min-height: 50px;
  border-radius: 999px;
  font-size: 22px; font-weight: 700;
  color: var(--ink-soft);
}
.seg-tab.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-btn); }
.poem-status { display: flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; margin: 0 auto 12px; padding: 4px 14px; border-radius: 999px; background: rgba(255, 255, 255, .85); font-size: 14px; }

.poem-card { position: relative; text-align: center; padding: 22px 14px 18px; overflow: hidden; }
.poem-title { font-size: calc(var(--poem-size) * .95); line-height: 1.3; }
.poem-title.is-long { font-size: min(calc(var(--poem-size) * .78), calc((min(100vw, 720px) - 84px) / (var(--tlen, 10) + 2))); }
.poem-title.is-long.with-py { flex-wrap: nowrap; font-size: min(calc(var(--poem-size) * .78), calc((min(100vw, 720px) - 84px) / (var(--tlen, 10) * 1.2 + 1.6))); }
.poem-title.is-long.with-py .zi { min-width: 1.18em; }
.poem-title.with-py .bk { flex: none; width: .7em; }
.poem-title.with-py { display: flex; justify-content: center; align-items: flex-end; flex-wrap: wrap; }
.poem-title.with-py .zi { font-size: 1em; }
.poem-title .bk { padding-bottom: .05em; }
.poem-subtitle { font-size: 16px; color: var(--ink-soft); margin-top: 2px; }
.poem-author { font-size: 17px; color: var(--ink-soft); margin: 4px 0 14px; letter-spacing: 2px; }
.seg-title { border-radius: 16px; padding: 4px 0; transition: background .2s; }
.seg-title.is-reading { background: var(--primary-soft); }

.poem-lines {
  position: relative; z-index: 1;
  font-family: var(--font-kai);
  font-size: min(var(--poem-size), calc((min(100vw, 720px) - 76px) / 9.6));
}
.poem-line { display: flex; justify-content: center; align-items: flex-end; flex-wrap: wrap; margin: .2em 0; line-height: 1.25; }
.poem-line.plain { display: block; margin: .25em 0; }
.seg { display: inline-flex; align-items: flex-end; border-radius: .25em; padding: 0 .05em; transition: background .2s, transform .2s, color .2s; }
.seg.is-reading { background: var(--primary-soft); color: var(--primary-dark); transform: scale(1.06); }
.zi { display: inline-flex; flex-direction: column; align-items: center; min-width: 1.32em; }
.zi .py { font-family: var(--font); font-style: normal; font-size: .36em; line-height: 1.3; color: var(--ink-soft); white-space: nowrap; letter-spacing: 0; }
.seg.is-reading .py { color: var(--primary-dark); }
.zi b { font-weight: 700; }
.pc { display: inline-block; width: .55em; text-align: left; font-weight: 700; }
.has-py .poem-line { margin: .35em 0; }
.poem-art {
  width: calc(100% + 28px);
  max-width: none;
  margin: -6px -14px -18px;
  height: clamp(130px, 32vw, 220px);
  object-fit: cover;
  object-position: center 60%;
  -webkit-mask-image: linear-gradient(transparent, #000 35%);
  mask-image: linear-gradient(transparent, #000 35%);
}

.speed-switch {
  display: flex; max-width: 400px; margin: 16px auto 8px;
  padding: 5px; border-radius: 999px; background: #fff; box-shadow: var(--shadow);
}
.speed-btn { flex: 1; min-height: 48px; border: 0; border-radius: 999px; background: none; font-size: 18px; font-weight: 600; color: var(--ink-soft); }
.speed-btn.active { background: var(--primary); color: #fff; }
.play-row { display: flex; align-items: center; justify-content: space-between; max-width: 420px; margin: 8px auto 0; }
.play-side { flex: 1; display: flex; justify-content: flex-end; }
.play-btn {
  display: grid; place-items: center;
  width: 92px; height: 92px;
  margin: 0 16px;
  border: 6px solid #fff;
  border-radius: 50%;
  background: linear-gradient(160deg, #4CBBAE, var(--primary-dark));
  color: #fff;
  box-shadow: 0 10px 24px rgba(44, 138, 128, .35);
  transition: transform .15s;
}
.play-btn i { width: 40px; height: 40px; margin-left: 4px; }
.play-btn.playing { background: linear-gradient(160deg, #F07A50, #D9472A); box-shadow: 0 10px 24px rgba(217, 71, 42, .3); animation: breathe 1.6s ease-in-out infinite; }
.play-btn.playing i { margin-left: 0; width: 34px; height: 34px; }
.play-btn:active { transform: scale(.94); }
.play-btn:disabled { opacity: .4; }
@keyframes breathe { 50% { box-shadow: 0 10px 34px rgba(217, 71, 42, .5), 0 0 0 10px rgba(232, 97, 60, .12); } }

.voice-tag { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-dark); font-size: 12px; font-weight: 600; }

/* 懂 */
.note-word {
  border: 0; padding: 0 .02em; margin: 0;
  background: linear-gradient(transparent 70%, rgba(242, 181, 68, .45) 70%);
  border-bottom: 2px dashed var(--yellow);
  font: inherit; color: inherit;
  cursor: pointer;
}
.info-card p { font-size: 17px; line-height: 1.85; }
.notes { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: baseline; }
.notes dt { font-size: 20px; font-weight: 700; color: var(--primary-dark); }
.notes dd { margin: 0; font-size: 16px; }

/* 背 */
.fade-steps { display: flex; gap: 6px; margin-bottom: 10px; }
.fade-step {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 74px;
  padding: 8px 2px 6px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 13px; font-weight: 700;
  color: var(--ink-soft);
}
.fade-step .badge {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 16px;
}
.fade-step .badge i { width: 16px; height: 16px; }
.fade-step.done .badge { background: var(--primary); color: #fff; }
.fade-step.open .badge { background: var(--red); color: #fff; }
.fade-step.locked { background: #F1EEE7; box-shadow: none; color: var(--muted); }
.fade-step.locked .badge { background: #E2DED4; color: #A7A196; }
.fade-step.current { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-3px); }
.fade-step .name { white-space: nowrap; }
.level-desc { font-size: 15px; color: var(--ink-soft); margin: 4px 4px 12px; }
.level-desc b { color: var(--primary-dark); }

.recite-card .poem-lines { font-size: min(var(--poem-size), calc((min(100vw, 720px) - 76px) / 9)); }
.poem-line.recite { gap: .14em; margin: .3em 0; align-items: center; }
.tian {
  display: inline-grid; place-items: center;
  width: 1.2em; height: 1.2em;
  border: 2px solid #C9D3D6;
  border-radius: 4px;
  background:
    linear-gradient(to right, transparent calc(50% - .5px), rgba(201, 211, 214, .7) calc(50% - .5px), rgba(201, 211, 214, .7) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(to bottom, transparent calc(50% - .5px), rgba(201, 211, 214, .7) calc(50% - .5px), rgba(201, 211, 214, .7) calc(50% + .5px), transparent calc(50% + .5px)),
    #FDFCF9;
  font-weight: 700;
  line-height: 1;
}
.tian.show { border-color: transparent; background: none; }
.tian.revealed { color: var(--red); animation: fade-in .3s; }
.tian.sm { line-height: 1; width: .9em; height: .9em; vertical-align: -.05em; margin: 0 .05em; }
.recite .pc { width: .45em; }
@keyframes fade-in { from { opacity: 0; } }
.quiz-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 10px; font-size: 20px; font-weight: 700; }
.quiz-retry { text-align: center; margin-top: 14px; }
.quiz-retry p { font-size: 17px; margin-bottom: 10px; }

.review-info h2 { font-size: 26px; margin-bottom: 6px; }

/* ---------- 游戏 ---------- */
.games-home > .muted { margin: 4px 0 14px; }
.game-entry { display: flex; align-items: center; gap: 16px; padding: 20px; min-height: 120px; transition: transform .15s; }
.game-entry:active { transform: scale(.98); }
.game-entry.disabled { opacity: .5; pointer-events: none; }
.game-entry h3 { font-size: 26px; margin-bottom: 4px; }
.game-ico {
  flex: none;
  display: grid; place-items: center;
  width: 76px; height: 76px;
  border-radius: 20px;
  color: #fff;
  font-family: var(--font-kai);
  font-size: 40px; font-weight: 700;
  box-shadow: var(--shadow-btn);
}
.game-ico::after { content: attr(data-ico); }
.game-ico.tone-teal { background: linear-gradient(160deg, #4CBBAE, var(--primary-dark)); }
.game-ico.tone-red { background: linear-gradient(160deg, #F07A50, #D9472A); box-shadow: 0 6px 14px rgba(217, 71, 42, .28); }
.game-ico.tone-yellow { background: linear-gradient(160deg, #F7C860, #E39A1F); box-shadow: 0 6px 14px rgba(227, 154, 31, .3); }
.game-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.game-entry { position: relative; }
.game-entry.is-new::after {
  content: "新"; position: absolute; top: 10px; right: 12px;
  padding: 0 8px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 13px; font-weight: 700; line-height: 22px;
}

.game-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.score-pill { color: var(--ink-soft); }
.score-pill b { color: var(--red); font-size: 22px; }
.star-ico { width: 22px; height: 22px; background: linear-gradient(#F7C548, #EFA21F); -webkit-mask: inherit; }
.score-pill .star-ico {
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l3 6.300 7 .900-5.100 4.800 1.300 6.900L12 17.600 5.800 20.900l1.300-6.900L2 9.200l7-.9z'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l3 6.300 7 .900-5.100 4.800 1.300 6.900L12 17.600 5.800 20.900l1.300-6.900L2 9.200l7-.9z'/></svg>") center / contain no-repeat;
}
.progress-pill { flex-direction: column; align-items: stretch; gap: 4px; min-width: 130px; font-size: 14px; color: var(--ink-soft); padding: 6px 16px; }
.progress-pill .bar { height: 8px; }
.game-poem-title { text-align: center; margin: 6px 0 12px; }
.game-poem-title h2 { font-size: 32px; }
.game-poem-title p { font-size: 17px; color: var(--ink-soft); letter-spacing: 2px; }

.order-slots { padding: 14px; }
.order-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.order-num {
  flex: none;
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-dark);
  font-weight: 700; font-size: 18px;
}
.order-num.is-filled { background: var(--primary); color: #fff; }
.order-slot { flex: 1; min-height: 62px; border-radius: 16px; }
.order-slot.is-empty { border: 2px dashed #A9D8D0; background: #F8FCFB; }
.order-slot.is-drop { border-color: var(--red); background: var(--red-soft); }
.order-card {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 62px;
  padding: 8px 14px;
  border-radius: 16px;
  font-size: clamp(22px, 6.4vw, 28px);
  font-weight: 700;
  letter-spacing: 2px;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
  cursor: grab;
}
.order-slot.order-card { background: var(--primary-soft); border: 2px solid #9ED3CA; }
.order-slot.order-card.is-right { background: #DDF3E6; border-color: #5BBE86; }
.order-slot.order-card.is-wrong { background: var(--red-soft); border-color: var(--red); animation: shake .4s; }
.order-tip { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 10px; color: var(--ink-soft); font-size: 15px; font-weight: 600; text-align: center; }
.order-tip .leaf { width: 14px; height: 8px; border-radius: 50% 0; background: #8FCFC4; flex: none; }
.order-pool { min-height: 80px; }
.pool-card { justify-content: space-between; margin-bottom: 12px; background: #fff; box-shadow: var(--shadow); }
.pool-card .grip {
  flex: none; width: 14px; height: 24px; opacity: .45;
  background-image: radial-gradient(circle, var(--ink) 2px, transparent 2.5px);
  background-size: 7px 8px;
}
.order-card.is-dragging { opacity: .35; }
.order-pool-empty { text-align: center; color: var(--muted); padding: 20px 0; }
.drag-ghost {
  position: fixed !important; z-index: 120; margin: 0 !important;
  pointer-events: none;
  background: #fff;
  box-shadow: 0 14px 30px rgba(51, 65, 92, .25);
  opacity: .96;
}
.order-submit { margin-top: 4px; }
.order-game.is-solved .order-slots { animation: glow 1s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(91, 190, 134, .35); } }

.fill-progress { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-weight: 600; color: var(--ink-soft); }
.fill-card { text-align: center; padding: 22px 16px; }
.fill-source { font-size: 18px; color: var(--ink-soft); }
.fill-line { line-height: 1.2; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .08em; margin: 18px 0 10px; font-size: min(42px, calc((min(100vw, 720px) - 80px) / 8.4)); font-weight: 700; }
.fill-blank {
  display: inline-grid; place-items: center;
  width: 1.2em; height: 1.2em;
  line-height: 1; box-sizing: border-box;
  border: 3px dashed var(--red);
  border-radius: 10px;
  background: var(--red-soft);
}
.fill-blank.is-revealed { border-style: solid; color: var(--red); animation: pop .35s; }
.fill-ask { color: var(--muted); margin-bottom: 14px; }
.fill-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.fill-opt {
  min-height: 76px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #FDFBF6;
  font-size: 38px; font-weight: 700;
  transition: transform .12s;
}
.fill-opt:active:not(:disabled) { transform: scale(.95); }
.fill-opt.is-right { background: #DDF3E6; border-color: #5BBE86; color: #2D8A57; }
.fill-opt.is-wrong { background: var(--red-soft); border-color: var(--red); color: var(--red); animation: shake .4s; }
.fill-opt:disabled:not(.is-right):not(.is-wrong) { opacity: .5; }
.fill-feedback { margin-top: 14px; }
.fill-feedback p { font-size: 17px; margin-bottom: 12px; }
.fb-ok { color: #2D8A57; font-weight: 700; font-size: 20px !important; }
.fb-bad { color: #C0582F; }

.game-result { text-align: center; padding: 28px 18px; }
.game-result h2 { font-size: 30px; }
.result-stars { display: flex; justify-content: center; gap: 10px; margin: 16px 0; }
.result-stars .seal-star { width: 48px; height: 48px; }
.result-stars .seal-star.on { animation: pop .5s backwards; }
.result-stars .seal-star:nth-child(2) { animation-delay: .1s; }
.result-stars .seal-star:nth-child(3) { animation-delay: .2s; }
.result-score { font-size: 20px; }
.result-score b { font-size: 40px; color: var(--red); margin-left: 6px; }

/* ---------- 新游戏：通用 ---------- */
.combo-bar { display: flex; align-items: center; gap: 10px; margin: 0 2px 12px; }
.combo { flex: none; padding: 4px 12px; border-radius: 999px; background: #F1EEE7; color: var(--muted); font-weight: 700; font-size: 15px; }
.combo b { font-size: 18px; }
.combo.on { background: var(--red-soft); color: var(--red); }
.combo.bump { animation: bump .3s; }
.timer { flex: 1; height: 12px; border-radius: 999px; background: #ECE8DF; overflow: hidden; }
.timer i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #F2B544, #EFA21F); transition: width 1s linear; }
.timer.urgent i { background: linear-gradient(90deg, #F07A50, #D9472A); }
.timer.urgent { animation: pulse-bar .6s infinite alternate; }
.timer-num { flex: none; width: 32px; text-align: right; font-weight: 700; font-size: 18px; color: var(--ink-soft); }
@keyframes bump { 50% { transform: scale(1.25); } }
@keyframes pulse-bar { to { opacity: .6; } }
.shake { animation: shake .4s; }

/* 字块拼诗句 */
.pinju-card { text-align: center; }
.pinju-card.is-done { animation: glow 1s; }
.pinju-src { font-size: 16px; color: var(--ink-soft); }
.pinju-prev { font-size: 20px; color: var(--muted); margin: 6px 0 10px; }
.pinju-slots { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; font-size: min(36px, calc((min(100vw, 720px) - 100px) / 8.6)); font-weight: 700; }
.pinju-slot {
  display: inline-grid; place-items: center;
  width: 1.25em; height: 1.25em;
  line-height: 1; box-sizing: border-box;
  border: 2px dashed #A9D8D0; border-radius: 10px; background: #F8FCFB;
}
.pinju-slot.filled { border: 2px solid var(--primary); background: var(--primary-soft); color: var(--primary-dark); animation: pop .3s; }
.pinju-slot.missed { border: 2px solid var(--red); background: var(--red-soft); color: var(--red); }
.pinju-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.pinju-tile {
  aspect-ratio: 1;
  border: 0; border-radius: 16px;
  background: #fff; box-shadow: 0 4px 0 #E3DDD0, var(--shadow);
  font-size: 32px; font-weight: 700;
  animation: drop-in .35s backwards;
  transition: transform .1s, opacity .25s;
}
.pinju-tile:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #E3DDD0; }
.pinju-tile.used { opacity: 0; transform: scale(.4); pointer-events: none; }
.pinju-tile.shake { background: var(--red-soft); color: var(--red); }
@keyframes drop-in { from { opacity: 0; transform: translateY(-14px) scale(.8); } }

/* 上下句配对（翻牌） */
.pair-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; perspective: 900px; }
.pair-grid.many { grid-template-columns: repeat(3, 1fr); }
.pair-card { position: relative; height: 104px; padding: 0; border: 0; background: none; }
.pair-inner { position: absolute; inset: 0; transition: transform .45s; transform-style: preserve-3d; }
.pair-card.flipped .pair-inner { transform: rotateY(180deg); }
.pair-back, .pair-front {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 16px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: var(--shadow);
}
.pair-back {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .25) 0 30%, transparent 31%),
    linear-gradient(160deg, #4CBBAE, var(--primary-dark));
  border: 3px solid #fff;
}
.pair-back b { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px; background: var(--red); color: #fff; font-size: 26px; transform: rotate(-6deg); }
.pair-front { background: #fff; transform: rotateY(180deg); padding: 6px; border: 2px solid var(--line); }
.pair-front em { font-style: normal; font-size: 12px; padding: 0 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-dark); }
.pair-front span { font-size: clamp(15px, 4.4vw, 20px); font-weight: 700; line-height: 1.3; }
.pair-card.miss .pair-front { border-color: var(--red); background: var(--red-soft); }
.pair-card.matched .pair-front { border-color: #5BBE86; background: #DDF3E6; }
.pair-card.matched { animation: matched .6s forwards .1s; pointer-events: none; }
@keyframes matched { 40% { transform: scale(1.08); } to { transform: scale(.92); opacity: .35; } }

/* 飞花令 */
.feihua-key { display: flex; align-items: center; gap: 14px; margin: 0 2px 12px; }
.feihua-key p.kai { font-size: 20px; font-weight: 700; }
.feihua-key .muted { font-size: 14px; }
.seal-char {
  flex: none; display: grid; place-items: center;
  width: 72px; height: 72px; border-radius: 14px;
  background: linear-gradient(160deg, #EE7550, #D9472A); color: #fff;
  font-size: 44px; font-weight: 700;
  border: 3px solid #fff; outline: 3px solid var(--red);
  transform: rotate(-4deg);
  animation: pop .45s;
}
.feihua-list { display: grid; gap: 10px; }
.feihua-line {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0;
  min-height: 60px; padding: 8px 16px;
  border: 2px solid transparent; border-radius: 16px;
  background: #fff; box-shadow: var(--shadow);
  font-size: clamp(20px, 5.8vw, 26px); font-weight: 700; text-align: left;
  animation: drop-in .3s backwards;
}
.feihua-line:nth-child(2) { animation-delay: .05s; } .feihua-line:nth-child(3) { animation-delay: .1s; }
.feihua-line:nth-child(4) { animation-delay: .15s; } .feihua-line:nth-child(5) { animation-delay: .2s; }
.feihua-line:nth-child(6) { animation-delay: .25s; }
.feihua-line em { font-family: var(--font); font-style: normal; font-size: 12px; color: var(--muted); font-weight: 500; }
.feihua-line mark { background: none; color: var(--red); text-decoration: underline wavy var(--red); text-underline-offset: 5px; }
.feihua-line.is-right { border-color: #5BBE86; background: #DDF3E6; }
.feihua-line.is-wrong { border-color: var(--red); background: var(--red-soft); animation: shake .4s; opacity: .7; }
.feihua-line.is-missed { border-color: var(--yellow); background: var(--yellow-soft); }

/* ---------- 每日闯关 + 吉祥物 ---------- */
.quest-card { padding: 16px 14px 18px; background: linear-gradient(180deg, #F6FBF9, #fff 60%); }
.quest-head { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 8px; }
.mascot-btn { flex: none; width: 84px; height: 84px; padding: 0; border: 0; background: none; }
.mascot-btn img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.mascot-btn.hop { animation: hop .5s; }
@keyframes hop { 30% { transform: translateY(-14px) rotate(-6deg); } 60% { transform: translateY(0) rotate(4deg); } }
.bubble {
  position: relative; flex: 1;
  margin-bottom: 18px; padding: 10px 14px;
  border-radius: 16px; border: 2px solid var(--primary-soft);
  background: #fff; font-size: 15px; line-height: 1.6;
  box-shadow: var(--shadow);
}
.bubble::before {
  content: ""; position: absolute; left: -9px; bottom: 14px;
  border: 8px solid transparent; border-right-color: #fff; border-left: 0;
  filter: drop-shadow(-2px 0 0 var(--primary-soft));
}
.bubble.pop { animation: bubble-pop .35s; }
@keyframes bubble-pop { from { opacity: 0; transform: translateY(6px) scale(.96); } }
.quest-title { display: flex; justify-content: space-between; align-items: baseline; margin: 0 4px 10px; font-size: 20px; font-weight: 700; }
.quest-title em { font-style: normal; font-size: 15px; color: var(--primary-dark); }
.quest-map { position: relative; display: flex; justify-content: space-between; padding: 0 2px; }
.quest-map::before {
  content: ""; position: absolute; left: 30px; right: 30px; top: 27px;
  border-top: 3px dashed #CFE6E1;
}
.q-node {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 20%; padding: 0; border: 0; background: none;
  font: inherit; color: inherit;
}
.q-node:nth-child(even) { transform: translateY(10px); }
.q-dot {
  display: grid; place-items: center;
  width: 54px; height: 54px; border-radius: 50%;
  background: #fff; border: 3px solid #CFE6E1;
  color: var(--primary-dark); font-size: 24px;
  box-shadow: var(--shadow);
  transition: transform .2s;
}
.q-dot b { font-size: 24px; }
a.q-node .q-dot { border-color: var(--primary); animation: beckon 1.8s ease-in-out infinite; }
a.q-node:active .q-dot { transform: scale(.92); }
.q-node.done .q-dot { background: var(--primary); border-color: var(--primary); color: #fff; animation: none; }
.q-node.done .q-dot i { width: 26px; height: 26px; }
.q-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.q-node.done .q-label { color: var(--primary-dark); }
.q-node.chest .q-dot { font-size: 28px; background: #FFF7E6; border-color: #F6DFAE; }
.q-node.chest:disabled { opacity: 1; cursor: default; }
.q-node.chest:disabled:not(.done) .q-dot { filter: grayscale(.8); opacity: .7; }
.q-node.chest.ready .q-dot { border-color: var(--yellow); animation: chest-shake 1.2s ease-in-out infinite; box-shadow: 0 0 0 6px rgba(242, 181, 68, .25); }
.q-node.chest.done .q-dot { background: var(--yellow-soft); border-color: var(--yellow); }
@keyframes beckon { 50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(59, 165, 154, .15); } }
@keyframes chest-shake { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-10deg); } 80% { transform: rotate(10deg); } 90% { transform: rotate(-6deg); } }

.rank-figure.wiggle { animation: wiggle .6s; transform-origin: bottom center; }
@keyframes wiggle { 25% { transform: rotate(-6deg); } 50% { transform: rotate(5deg); } 75% { transform: rotate(-3deg); } }
.celebrate-mascot { width: 96px; margin: -8px auto 4px; animation: hop .7s .2s; }
.chest-big { font-size: 72px; line-height: 1; animation: pop .6s; }
.chest-quote { font-size: 22px; color: var(--primary-dark); margin-top: 12px !important; }

.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 150; pointer-events: none; }

/* ---------- 我的 ---------- */
.me-card { display: flex; align-items: center; gap: 16px; }
.me-info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.me-info h2 { font-size: 24px; word-break: break-all; }
.me-card .rank-seal { width: 56px; min-height: 92px; font-size: 26px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 12px 4px; border-radius: 16px; background: #FAF7F0; text-align: center; }
.stat b { font-size: 26px; color: var(--primary-dark); line-height: 1.3; }
.stat span { font-size: 13px; color: var(--muted); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 600; }
.set-row:last-of-type { border-bottom: 0; }
.mini-seg { display: flex; padding: 4px; border-radius: 999px; background: #F3EFE6; }
.mini-seg button { min-width: 56px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: none; font-size: 16px; font-weight: 600; color: var(--ink-soft); }
.mini-seg button.active { background: var(--primary); color: #fff; }

/* ---------- 电脑端 ---------- */
@media (min-width: 640px) {
  .page-bg { height: 360px; }
  .poem-list, .game-grid { grid-template-columns: 1fr 1fr; }
  .pair-grid.many { grid-template-columns: repeat(4, 1fr); }
  .rank-figure { right: 8px; }
  .shell { padding-left: 24px; padding-right: 24px; }
  .welcome-hero { margin: 0 -24px 8px; padding: 0 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ===== 诗途 · 品牌与段位书生 ===== */
.seal {
  display: inline-grid; place-items: center;
  width: 1.15em; height: 1.15em;
  border-radius: 6px;
  background: var(--red); color: #fff;
  font-family: var(--font-kai); font-style: normal; font-weight: 700;
  line-height: 1; font-size: .78em;
  transform: rotate(-4deg);
  box-shadow: 0 2px 4px rgba(232, 97, 60, .3);
}
.brand-line { display: flex; align-items: center; gap: 8px; font-size: clamp(22px, 7vw, 30px); font-weight: 700; color: var(--ink); margin-bottom: 6px; letter-spacing: 3px; }
.brand-title { display: flex; align-items: center; justify-content: center; gap: 6px; }
.brand-title .seal { font-size: 15px; }
.hero-text p { white-space: normal; }

.scholar-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.scholar-pick {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px 12px;
  border: 3px solid transparent; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--primary-soft), #fff);
  font-size: 17px; font-weight: 700; color: var(--ink);
  transition: transform .15s, border-color .15s;
}
.scholar-pick img { height: min(190px, 44vw); width: auto; filter: drop-shadow(0 4px 6px rgba(51, 65, 92, .15)); }
.scholar-pick.selected { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 0 0 4px var(--primary-soft); }
.scholar-pick.selected::after {
  content: ""; position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff;
  background: var(--primary) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='m5 12.500 4.500 4.500L19 7.500' fill='none' stroke='white' stroke-width='3.400' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 70% no-repeat;
}

.celebrate-stage { position: relative; height: 188px; margin: -6px auto 0; }
.celebrate-scholar { height: 100%; width: auto; animation: hop .7s .1s; filter: drop-shadow(0 6px 8px rgba(51, 65, 92, .2)); }
.celebrate-pet { position: absolute; left: 50%; bottom: 2px; margin-left: -140px; height: 76px; width: auto; animation: hop .7s .3s; }

.ladder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ladder-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  text-align: center;
}
.ladder-item img { height: 96px; width: auto; max-width: 100%; object-fit: contain; filter: grayscale(1) brightness(.55); opacity: .45; }
.ladder-item b { font-size: 17px; color: var(--muted); }
.ladder-item span { font-size: 12px; color: var(--muted); }
.ladder-item.on img { filter: none; opacity: 1; }
.ladder-item.on b { color: var(--ink); }
.ladder-item.on span { color: var(--primary-dark); }
.ladder-item.cur { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.ladder-item.cur span { font-weight: 700; }


/* ===== 更新：修正人物比例（全局 img 的 max-width 会把书生图横向压窄） ===== */
.rank-scholar, .rank-pet, .celebrate-scholar, .celebrate-pet, .celebrate-mascot, .hero-mascot { max-width: none; }
.rank-figure { width: 150px; }
.rank-scholar { right: 0; height: 100%; width: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.rank-pet { left: -14px; aspect-ratio: 400 / 420; }
.scholar-pick img { width: 100%; max-width: 200px; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.celebrate-scholar { aspect-ratio: 1 / 1; object-fit: contain; margin: 0 auto; }
.celebrate-pet { aspect-ratio: 400 / 420; }
.rank-body { padding-right: 132px; }

/* ===== 游戏图标 ===== */
.game-badge { flex: none; width: 76px; height: 76px; border-radius: 50%; box-shadow: 0 6px 14px rgba(51, 65, 92, .18); }
.game-title { display: flex; align-items: center; justify-content: center; gap: 8px; }
.title-ico { width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 2px 6px rgba(51, 65, 92, .2); }

/* ===== 游戏动效 ===== */
.float-text {
  position: fixed; z-index: 400; pointer-events: none;
  transform: translate(-50%, -50%);
  font-weight: 800; font-size: 22px; white-space: nowrap;
  color: var(--primary-dark); text-shadow: 0 2px 0 #fff, 0 0 8px rgba(255, 255, 255, .9);
  animation: float-up 1s ease-out forwards;
}
.float-text.gold { color: #D98A12; }
.float-text.red { color: #D9472A; }
.float-text.big { font-size: 30px; letter-spacing: 1px; animation-duration: 1.2s; }
@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.5); }
  20% { opacity: 1; transform: translate(-50%, -80%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -230%) scale(1); }
}
.spark {
  position: fixed; z-index: 399; pointer-events: none;
  width: 9px; height: 9px; margin: -4px 0 0 -4px; border-radius: 50%;
  animation: spark-fly .7s ease-out forwards;
}
.spark.petal { width: 11px; height: 8px; border-radius: 60% 40% 60% 40%; }
@keyframes spark-fly {
  to { transform: translate(var(--dx), var(--dy)) scale(.2) rotate(160deg); opacity: 0; }
}
.flash-bad { animation: flash-bad .45s; }
.flash-good { animation: flash-good .55s; }
@keyframes flash-bad { 0% { box-shadow: inset 0 0 0 0 rgba(232, 97, 60, 0); } 30% { box-shadow: inset 0 0 40px 6px rgba(232, 97, 60, .35); } 100% { box-shadow: inset 0 0 0 0 rgba(232, 97, 60, 0); } }
@keyframes flash-good { 0% { box-shadow: inset 0 0 0 0 rgba(91, 190, 134, 0); } 30% { box-shadow: inset 0 0 44px 8px rgba(91, 190, 134, .35); } 100% { box-shadow: inset 0 0 0 0 rgba(91, 190, 134, 0); } }

.countdown { display: grid; justify-items: center; gap: 6px; padding: 30px 0 60px; text-align: center; }
.cd-ico { width: 96px; height: 96px; border-radius: 50%; box-shadow: var(--shadow); animation: hop .8s infinite alternate; }
.cd-title { font-size: 28px; font-weight: 700; margin-top: 10px; }
.cd-num { font-size: 120px; line-height: 1.1; font-weight: 800; color: var(--red); }
.cd-num.go { font-size: 76px; color: var(--primary-dark); }
.cd-num.beat { animation: cd-beat .7s ease-out; }
@keyframes cd-beat { 0% { transform: scale(2.2); opacity: 0; } 35% { transform: scale(.92); opacity: 1; } 100% { transform: scale(1); } }

.result-stars .seal-star { transform: scale(0); }
.result-stars .seal-star.on { animation: star-in .6s var(--d, 0s) cubic-bezier(.2, 1.6, .4, 1) forwards; }
.result-stars .seal-star:not(.on) { transform: scale(1); opacity: .5; animation: none; }
@keyframes star-in { from { transform: scale(0) rotate(-120deg); } to { transform: scale(1) rotate(0); } }
.game-result { animation: pop-card .4s; }
@keyframes pop-card { from { transform: translateY(24px) scale(.94); opacity: 0; } }
.result-score b { font-size: 40px; color: var(--red); }

/* 排序：落位弹跳、答对后卡片依次抬起 */
.order-slot.just-placed { animation: place-in .35s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes place-in { from { transform: scale(.7) translateY(-10px); } }
.order-game.is-solved .order-row { animation: lift .6s calc(var(--i, 0) * 90ms) both; }
@keyframes lift { 40% { transform: translateY(-6px) scale(1.02); } }
.order-slots.shake, .fill-card.shake, .pinju-card.shake { animation: shake .45s; }
.fill-opt.is-right { animation: pop-ok .5s; }
@keyframes pop-ok { 40% { transform: scale(1.12); } }
.pinju-slot.filled { animation: pop .3s; }
.pinju-card.is-done { animation: glow 1s; }
.combo.bump { animation: bump .35s; }
.pair-card.matched { animation: matched .5s forwards; }
.pair-card.miss { animation: shake .45s; }

/* 飞花令：诗卡（只写诗题和作者，想不起来就要靠记忆） */
.feihua-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.feihua-card {
  position: relative;
  min-height: 92px; padding: 10px 10px;
  border: 2px solid var(--line); border-radius: 16px;
  background: linear-gradient(160deg, #fff, #F7F3E9); box-shadow: var(--shadow);
  text-align: center; color: var(--ink);
  animation: drop-in .35s backwards;
  transition: transform .15s;
}
.feihua-card:active { transform: scale(.97); }
.feihua-card:disabled { cursor: default; }
.fc-back, .fc-front { display: grid; gap: 4px; justify-items: center; align-content: center; min-height: 70px; }
.fc-back b, .fc-front b { font-size: 20px; line-height: 1.3; }
.fc-back em { font-family: var(--font); font-style: normal; font-size: 12px; color: var(--muted); }
.fc-line { font-size: 17px; font-weight: 700; line-height: 1.4; }
.fc-line mark { background: none; color: var(--red); font-size: 22px; text-decoration: underline wavy var(--red); text-underline-offset: 5px; }
.fc-none { font-size: 14px; color: var(--muted); }
.feihua-card.is-right { border-color: #5BBE86; background: #E3F5EA; animation: pop-ok .5s; }
.feihua-card.is-wrong { border-color: var(--red); background: var(--red-soft); opacity: .75; }
.feihua-card.is-missed { border-color: var(--yellow); background: var(--yellow-soft); }
.feihua-card.is-hint { border-color: var(--yellow); box-shadow: 0 0 0 4px rgba(242, 181, 68, .35), var(--shadow); animation: hint-glow 1s infinite alternate; }
@keyframes hint-glow { to { box-shadow: 0 0 0 8px rgba(242, 181, 68, .15), var(--shadow); } }
.feihua-tools { display: flex; justify-content: center; margin-top: 14px; }
.fh-left { color: var(--red); font-size: 17px; }

/* ===== 背诵热力图 ===== */
.heat-wrap { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.heat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.heat-head b { font-size: 18px; }
.heat-head .muted { font-size: 13px; }
.hm-months { display: grid; grid-template-columns: repeat(var(--w), 1fr); gap: 3px; font-size: 11px; color: var(--muted); margin-bottom: 3px; min-height: 14px; }
.hm-months span { white-space: nowrap; overflow: visible; }
.heatmap { display: grid; grid-template-columns: repeat(var(--w), 1fr); grid-template-rows: repeat(7, auto); grid-auto-flow: column; gap: 3px; }
.hm-cell { display: block; aspect-ratio: 1 / 1; border-radius: 4px; background: #ECE8DF; }
.hm-cell.lv1 { background: #CFEAE4; }
.hm-cell.lv2 { background: #8FD0C4; }
.hm-cell.lv3 { background: #3BA59A; }
.hm-cell.lv4 { background: #1F7C72; }
.hm-cell.future { background: transparent; }
.hm-cell.today { outline: 2px solid var(--red); outline-offset: 1px; }
.hm-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 8px; font-size: 12px; }
.hm-legend .hm-cell { width: 14px; height: 14px; }

/* ===== 古诗地图 ===== */
.seg-switch { display: flex; gap: 4px; padding: 4px; margin: 0 0 12px; border-radius: 999px; background: #EFEADF; }
.seg-switch a { flex: 1; text-align: center; padding: 9px 0; border-radius: 999px; font-weight: 700; color: var(--ink-soft); }
.seg-switch a.active { background: #fff; color: var(--primary-dark); box-shadow: var(--shadow); }
.map-card { padding: 14px 12px 12px; }
.map-head b { font-size: 20px; }
.map-head .muted { font-size: 13px; margin-top: 2px; }
.map-head .muted b { font-size: 15px; color: var(--red); }
.map-stage { position: relative; margin-top: 4px; border-radius: 16px; overflow: hidden; background: linear-gradient(180deg, #F3F8F5, #E8F1EE); }
.cn-map { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.cn-map:active { cursor: grabbing; }
.prov { fill: #FFFFFF; stroke: #B9D8D0; stroke-linejoin: round; }
.prov-name { fill: #7A8BA3; font-family: var(--font-kai); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.cn-map.far .prov-name { opacity: .75; }
.pin { cursor: pointer; }
.pin-hit { fill: transparent; }
.pin-halo { fill: rgba(91, 105, 140, .12); }
.pin-dot { fill: #A7B2C4; stroke: #fff; stroke-width: 1.2; }
.pin.on .pin-dot { fill: #F2B544; }
.pin.all .pin-dot { fill: var(--red); }
.pin.on .pin-halo { fill: rgba(232, 97, 60, .18); animation: halo 2.4s infinite; transform-box: fill-box; transform-origin: center; }
.pin.loose .pin-dot { stroke: var(--ink-soft); stroke-dasharray: 2 2; }
.pin.sel .pin-dot { stroke: var(--primary-dark); stroke-width: 2.4; }
.pin-n { fill: #fff; font-weight: 800; pointer-events: none; }
@keyframes halo { 50% { transform: scale(1.35); opacity: .5; } }
.map-zoom { position: absolute; right: 8px; top: 8px; display: grid; gap: 6px; }
.map-zoom button {
  min-width: 40px; height: 40px; padding: 0 8px; border: 0; border-radius: 12px;
  background: rgba(255, 255, 255, .92); box-shadow: var(--shadow);
  font-size: 18px; font-weight: 700; color: var(--ink);
}
.map-zoom #z-reset { font-size: 13px; }
.map-legend { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
.lg-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #A7B2C4; margin-right: 5px; vertical-align: -1px; border: 2px solid #fff; box-shadow: 0 0 0 1px #D8DEE8; }
.lg-dot.on { background: var(--red); }
.lg-dot.loose { background: #fff; box-shadow: 0 0 0 1.5px var(--ink-soft); }
.map-panel { margin-top: 12px; padding: 14px; min-height: 80px; }
.mp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mp-head h4 { font-size: 20px; }
.mp-pin { width: 14px; height: 14px; border-radius: 50%; background: var(--red); border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--red); }
.mp-pin.loose { background: #fff; box-shadow: 0 0 0 1.5px var(--ink-soft); }
.mp-tag { font-style: normal; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--yellow-soft); color: #B07A12; }
.mp-list { display: grid; gap: 8px; }
.mp-poem { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; background: var(--bg); }
.mp-thumb { width: 72px; height: 54px; border-radius: 10px; object-fit: cover; flex: none; }
.mp-poem b { font-size: 18px; }
.mp-poem .muted { font-size: 13px; }
.map-none { margin-top: 12px; padding: 12px 14px; }
.map-none summary { font-weight: 700; cursor: pointer; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.map-src { font-size: 12px; margin-top: 12px; }

/* 段位卡：上排段位牌 + 人物，下排文字与进度条通栏 */
.rank-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "seal fig" "body body";
  align-items: center; gap: 4px 12px;
  min-height: 0; padding: 16px 18px 18px;
}
.rank-card .rank-seal { grid-area: seal; justify-self: start; }
.rank-figure { position: relative; grid-area: fig; justify-self: end; width: 168px; height: 158px; right: auto; bottom: auto; }
.rank-scholar { position: absolute; right: 0; bottom: 0; height: 100%; width: auto; max-height: none; }
.rank-pet { position: absolute; left: -6px; bottom: -2px; height: 46%; width: auto; max-height: none; }
.rank-body { grid-area: body; padding-right: 0; }
.rank-text { white-space: normal; font-size: clamp(14px, 3.9vw, 16px); }


/* ===================== 第三轮：段位卡 / 全屏背景 / 诗词山河 ===================== */

/* ---------- 首页段位卡：紧凑，只有一个书生 ---------- */
.rank2 {
  position: relative;
  display: flex; align-items: flex-end; gap: 6px;
  padding: 12px 16px 14px 6px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 0% 100%, rgba(59, 165, 154, .14), transparent 60%),
    linear-gradient(160deg, #FFFFFF 40%, #F6F1E4);
}
.rank2::after {
  content: ""; position: absolute; right: -30px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 181, 68, .18), transparent 70%); pointer-events: none;
}
.rank2 .rank-figure { position: relative; flex: none; width: 104px; height: 118px; margin: -4px 0 -14px; cursor: pointer; }
.rk-scholar { position: absolute; left: 50%; bottom: 0; height: 132px; width: 132px; max-width: none; transform: translateX(-50%); object-fit: contain; filter: drop-shadow(0 4px 6px rgba(51, 65, 92, .18)); }
.rk-main { position: relative; z-index: 1; flex: 1; min-width: 0; padding-bottom: 2px; }
.rk-head { display: flex; align-items: center; gap: 10px; }
.rk-name {
  display: inline-block; padding: 3px 14px 3px 16px;
  border-radius: 10px; letter-spacing: 6px;
  font-size: 22px; font-weight: 700; color: #fff;
  background: linear-gradient(160deg, #EE7550, #C9432A);
  box-shadow: 0 4px 10px rgba(201, 67, 42, .3), inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.rk-step { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.rk-tip { margin: 8px 0 8px; font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.rk-tip b { font-size: 18px; color: var(--red); margin: 0 2px; }
.rk-tip .rk-next-name { color: var(--primary-dark); font-size: 17px; }
.xp { display: flex; align-items: center; gap: 8px; }
.xp-track {
  position: relative; flex: 1; height: 16px; border-radius: 999px;
  background: linear-gradient(180deg, #E4DCCB, #F3EDE0);
  box-shadow: inset 0 2px 3px rgba(80, 60, 20, .18), 0 1px 0 #fff;
  overflow: hidden;
}
.xp-fill {
  position: relative; height: 100%; border-radius: inherit; min-width: 0;
  background: linear-gradient(90deg, #F7D06A, #F2B544 45%, #EE8A3A 85%, #E8613C);
  box-shadow: 0 0 10px rgba(242, 181, 68, .65);
  animation: xp-grow 1.2s cubic-bezier(.2, .9, .3, 1) both;
  overflow: hidden;
}
.xp-fill::before { content: ""; position: absolute; left: 6px; right: 6px; top: 2px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .5); }
.xp-shine {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .75) 48%, transparent 62%);
  background-size: 220% 100%;
  animation: xp-shine 2.6s 1.2s infinite;
}
.xp-ticks i { position: absolute; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; border-radius: 2px; background: rgba(255, 255, 255, .75); }
@keyframes xp-grow { from { width: 0; } }
@keyframes xp-shine { from { background-position: 160% 0; } to { background-position: -60% 0; } }
.xp-next {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; background: var(--primary-soft);
  border: 2px solid #fff; box-shadow: 0 0 0 2px #F2B544, 0 3px 8px rgba(0, 0, 0, .12);
  filter: saturate(.55);
}
.xp-crown { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(160deg, #F7D06A, #E39A1F); color: #fff; font-family: var(--font-kai); font-weight: 700; }
.xp-meta { display: flex; justify-content: space-between; margin-top: 6px; padding-right: 44px; font-size: 12px; color: var(--muted); }
.xp-meta b { color: var(--primary-dark); font-size: 15px; }
.rank2 .rank-figure.wiggle { animation: wiggle .6s; transform-origin: bottom center; }

/* ---------- 全屏半透明背景 ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0; transition: opacity .45s;
  background-size: cover; background-position: center;
}
.backdrop::after { content: ""; position: absolute; inset: 0; }
.has-backdrop .backdrop { opacity: 1; }
.has-backdrop .page-bg { opacity: 0; }
.bd-poem .backdrop::after {
  background: linear-gradient(180deg, rgba(251, 247, 238, .62) 0%, rgba(251, 247, 238, .80) 22%, rgba(251, 247, 238, .74) 58%, rgba(251, 247, 238, .38) 100%);
}
.bd-place .backdrop { background-position: center bottom; }
.bd-place .backdrop::after {
  background: linear-gradient(180deg, rgba(251, 247, 238, .94) 0%, rgba(251, 247, 238, .78) 34%, rgba(251, 247, 238, .25) 66%, rgba(251, 247, 238, 0) 100%);
}
/* 诗词页：卡片变成半透明，让背景透出来；原来卡片里的配图不再单独显示 */
.bd-poem .card {
  background: rgba(255, 255, 255, .52);
  -webkit-backdrop-filter: blur(6px) saturate(1.1); backdrop-filter: blur(6px) saturate(1.1);
  box-shadow: 0 6px 22px rgba(51, 65, 92, .06);
  border: 1px solid rgba(255, 255, 255, .55);
}
.bd-poem .poem-card { background: rgba(255, 255, 255, .38); }
.bd-poem .poem-art { display: none; }
.bd-poem .poem-status { background: rgba(255, 255, 255, .6); }
.bd-poem .seg-tabs { background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.bd-poem .topbar .icon-btn { background: rgba(255, 255, 255, .6); }
.bd-poem .tabbar { background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* ---------- 诗词山河：竖版全屏地图 ---------- */
.smap { position: fixed; inset: 0; z-index: 5; overflow: hidden; background: linear-gradient(180deg, #E9EFEA, #DCE9E7); }
.smap-stage { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.smap-stage:active { cursor: grabbing; }
.smap-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.smap .prov { fill: #F4ECDC; stroke: #B79F7B; stroke-linejoin: round; }
.smap .prov.has { fill: #BFE6D3; }
.smap .prov-name { fill: #9C8C70; font-family: var(--font-kai); text-anchor: middle; dominant-baseline: central; pointer-events: none; opacity: .8; }
.smap-marks { position: absolute; inset: 0; pointer-events: none; }
.mk {
  position: absolute; pointer-events: auto;
  display: flex; align-items: flex-end; gap: 0;
  padding: 0; border: 0; background: none;
  transform: translate(-50%, -100%);
  transition: opacity .2s;
}
.mk-ico { width: 46px; height: 46px; max-width: none; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(80, 60, 20, .25)); pointer-events: none; }
.mk.big .mk-ico { width: 58px; height: 58px; }
.mk-tag {
  position: relative; order: -1;
  display: flex; flex-direction: column; align-items: center;
  margin-right: -6px; padding: 14px 3px 6px;
  border-radius: 3px;
  background: linear-gradient(180deg, #FFFDF6, #F6EBD2);
  box-shadow: 0 2px 6px rgba(120, 90, 30, .25), inset 0 0 0 1px rgba(201, 160, 80, .55);
  pointer-events: none;
}
.mk-tag b { writing-mode: vertical-rl; font-size: 15px; font-weight: 700; color: #7A4A12; letter-spacing: 2px; line-height: 1; }
.mk-tag em {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  display: grid; place-items: center; width: 22px; height: 22px;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: linear-gradient(135deg, #E6A23C, #B8700F);
  color: #fff; font-style: normal; font-size: 11px; font-weight: 800;
}
.mk .mk-dot { display: none; }
.mk:not(.lit) .mk-ico { filter: grayscale(.55) opacity(.85) drop-shadow(0 3px 3px rgba(80, 60, 20, .2)); }
.mk:not(.lit) .mk-tag b { color: #8C7A5C; }
.mk.lit .mk-tag { background: linear-gradient(180deg, #FFF8E6, #F9E2B0); }
.mk.mini { transform: translate(-50%, -50%); }
.mk.mini .mk-ico, .mk.mini .mk-tag { display: none; }
.mk.mini .mk-dot { display: block; width: 12px; height: 12px; border-radius: 50%; background: #C9A15C; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.mk.mini.lit .mk-dot { background: var(--red); }
.mk-cnt { display: none; }

.smap-top { position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; pointer-events: none; }
.smap-top > * { pointer-events: auto; }
.smap-back, .place-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 14px 8px 10px; border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 252, 240, .95), rgba(240, 225, 190, .85));
  box-shadow: 0 3px 10px rgba(120, 90, 30, .2);
  color: #7A4A12; font-size: 17px; font-weight: 700;
}
.smap-filters { display: flex; gap: 6px; }
.smap-select {
  appearance: none; -webkit-appearance: none;
  padding: 8px 26px 8px 12px; border: 0; border-radius: 999px;
  background: rgba(255, 252, 240, .92) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%237A4A12' stroke-width='1.8' stroke-linecap='round'/></svg>") right 10px center / 10px no-repeat;
  box-shadow: 0 3px 10px rgba(120, 90, 30, .18);
  color: #7A4A12; font-size: 15px; font-weight: 700;
}
.smap-title {
  position: absolute; right: 0; top: 34%; z-index: 2;
  writing-mode: vertical-rl; letter-spacing: 6px;
  padding: 16px 8px 16px 10px; border-radius: 18px 0 0 18px;
  background: linear-gradient(90deg, rgba(255, 248, 230, .95), rgba(238, 215, 165, .9));
  box-shadow: -3px 4px 12px rgba(120, 90, 30, .2);
  color: #7A4A12; font-size: 20px; font-weight: 700; pointer-events: none;
}
.smap-zoom { position: absolute; right: 10px; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 2; display: grid; gap: 6px; }
.smap-zoom button { min-width: 42px; height: 42px; padding: 0 8px; border: 0; border-radius: 12px; background: rgba(255, 252, 240, .94); box-shadow: 0 3px 10px rgba(120, 90, 30, .18); color: #7A4A12; font-size: 19px; font-weight: 700; }
.smap-zoom #z-reset { font-size: 13px; }
.smap-foot {
  position: absolute; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 16px; border-radius: 16px;
  background: rgba(255, 252, 240, .9); box-shadow: 0 4px 14px rgba(120, 90, 30, .18);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  pointer-events: none;
}
.smap-foot .kai { font-size: 17px; font-weight: 700; color: #7A4A12; }
.smap-foot b { color: var(--red); font-size: 20px; }
.smap-foot .muted { font-size: 13px; }

/* ---------- 地区页 ---------- */
.place { position: relative; min-height: 100vh; min-height: 100dvh; padding: calc(10px + env(safe-area-inset-top, 0px)) 4px 30px; display: flex; flex-direction: column; }
.place-bar { display: flex; justify-content: flex-start; margin-bottom: 8px; }
.place-head { display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 14px; padding: 4px 6px 0; }
.place-name {
  writing-mode: vertical-rl; margin: 0;
  font-size: clamp(64px, 20vw, 96px); line-height: 1.05; font-weight: 800; letter-spacing: 6px;
  background: linear-gradient(180deg, #E9B44C 0%, #B8741A 45%, #D9A13C 70%, #8A5512 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 2px rgba(120, 70, 10, .25));
  animation: place-in .7s cubic-bezier(.2, .9, .3, 1) both;
}
.place-sub { display: flex; flex-direction: row-reverse; gap: 10px; max-height: 300px; animation: fade-in .8s .2s both; }
.place-sub b { writing-mode: vertical-rl; font-size: 22px; color: #8A5512; letter-spacing: 4px; padding-left: 10px; border-left: 1px solid rgba(138, 85, 18, .35); }
.place-sub p { writing-mode: vertical-rl; font-size: 16px; line-height: 1.9; color: #5A4A30; letter-spacing: 2px; max-height: 300px; }
@keyframes place-in { from { opacity: 0; transform: translateY(-20px); filter: blur(4px); } }
.place-poems {
  display: flex; flex-direction: row-reverse; gap: 12px;
  margin-top: 22px; padding: 6px 6px 12px;
  overflow-x: auto; scrollbar-width: none;
}
.place-poems::-webkit-scrollbar { display: none; }
.tablet {
  position: relative; flex: none;
  display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 2px;
  min-height: 170px; padding: 16px 8px 14px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(255, 253, 246, .92), rgba(248, 236, 208, .86));
  box-shadow: 0 4px 12px rgba(120, 90, 30, .2), inset 0 0 0 1px rgba(201, 160, 80, .6), inset 0 0 0 4px rgba(255, 255, 255, .5);
  animation: tablet-in .5s cubic-bezier(.2, 1.3, .4, 1) both;
}
.tablet:active { transform: translateY(2px); }
.tb-title { writing-mode: vertical-rl; font-size: 24px; font-weight: 800; color: #3A2A10; letter-spacing: 4px; line-height: 1.1; }
.tb-author { writing-mode: vertical-rl; font-size: 13px; color: #8A6A3A; letter-spacing: 2px; margin-top: 4px; }
.tb-stars { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; color: #E8613C; background: #FFF8E6; padding: 0 5px; border-radius: 999px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.tb-new { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; color: #8A6A3A; background: #FFF8E6; padding: 0 6px; border-radius: 999px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.tb-loose { position: absolute; top: -8px; right: -6px; font-size: 10px; padding: 0 5px; border-radius: 999px; background: var(--yellow); color: #fff; }
.tablet.learned { background: linear-gradient(180deg, rgba(255, 250, 235, .95), rgba(250, 226, 170, .9)); }
@keyframes tablet-in { from { opacity: 0; transform: translateY(18px); } }
.place-badge {
  margin-top: auto; align-self: flex-start;
  display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 8px;
  padding: 8px 14px 8px 8px; border-radius: 16px;
  background: rgba(255, 252, 240, .82); box-shadow: 0 3px 10px rgba(120, 90, 30, .18);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.place-badge img { grid-row: span 2; width: 64px; height: 64px; object-fit: contain; }
.pb-n { display: none; }
.pb-name { font-size: 20px; font-weight: 800; color: #7A4A12; }
.pb-lit { font-size: 13px; color: var(--ink-soft); }
.xp-ticks i { background: rgba(255, 255, 255, .85); box-shadow: 0 0 0 .5px rgba(140, 100, 40, .25); }
/* 竖牌放在左侧（西部地区诗少，不挡江南的名胜） */
.smap-title { right: auto; left: 0; top: 40%; border-radius: 0 18px 18px 0; padding: 14px 10px 14px 8px; font-size: 18px; box-shadow: 3px 4px 12px rgba(120, 90, 30, .2); }
/* 诗签：更透一些，长诗题缩小字号 */
.tablet { background: linear-gradient(180deg, rgba(255, 253, 246, .80), rgba(248, 236, 208, .70)); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.tablet.learned { background: linear-gradient(180deg, rgba(255, 250, 235, .86), rgba(250, 226, 170, .78)); }
.tablet.long .tb-title { font-size: 19px; letter-spacing: 2px; }
.tablet.xlong .tb-title { font-size: 16px; letter-spacing: 1px; }
.place-poems { margin-top: 18px; }
.place-badge { margin-top: 16px; }
/* 诗词页：诗文直接写在淡化的画面上（中间淡、四周透出画面），不再加卡片底 */
.bd-poem .backdrop::after {
  background:
    radial-gradient(ellipse 95% 62% at 50% 46%, rgba(251, 247, 238, .86) 0%, rgba(251, 247, 238, .70) 55%, rgba(251, 247, 238, .30) 100%),
    linear-gradient(180deg, rgba(251, 247, 238, .55) 0%, rgba(251, 247, 238, 0) 18%, rgba(251, 247, 238, 0) 80%, rgba(251, 247, 238, .5) 100%);
}
.bd-poem .poem-card { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border: 0; box-shadow: none; }
.bd-poem .poem-card .poem-line, .bd-poem .poem-title, .bd-poem .poem-author { text-shadow: 0 0 12px rgba(251, 247, 238, .95), 0 0 2px rgba(251, 247, 238, .9); }
.bd-poem .card:not(.poem-card) { background: rgba(255, 255, 255, .6); }
/* 背诵格子：一句诗始终排在一行（七言 + 标点），字号随屏宽自动缩小，标点不再被挤到下一行 */
.poem-line.recite { flex-wrap: nowrap; font-size: min(1em, calc((min(100vw, 720px) - 72px) / 10.3)); }

/* ===================== 第四轮 ===================== */

/* ---------- 学习页背景：遮罩更淡、不再加毛玻璃，画面更清楚 ---------- */
.bd-poem .backdrop::after {
  background:
    radial-gradient(ellipse 88% 50% at 50% 44%, rgba(251, 247, 238, .64) 0%, rgba(251, 247, 238, .40) 58%, rgba(251, 247, 238, .06) 100%),
    linear-gradient(180deg, rgba(251, 247, 238, .45) 0%, rgba(251, 247, 238, 0) 14%, rgba(251, 247, 238, 0) 86%, rgba(251, 247, 238, .35) 100%);
}
.bd-poem .card, .bd-poem .seg-tabs { -webkit-backdrop-filter: none; backdrop-filter: none; }
.bd-poem .card:not(.poem-card) { background: rgba(255, 255, 255, .74); }
.bd-poem .poem-card .poem-line, .bd-poem .poem-title, .bd-poem .poem-author, .bd-poem .recite-card .poem-lines {
  text-shadow: 0 0 3px #FBF7EE, 0 0 8px rgba(251, 247, 238, .98), 0 0 16px rgba(251, 247, 238, .9), 0 0 28px rgba(251, 247, 238, .7);
}
.bd-poem .zi .py { text-shadow: 0 0 4px #FBF7EE, 0 0 8px #FBF7EE; }
.bd-poem .seg-tabs { background: rgba(255, 255, 255, .78); }

/* ---------- 段位印章 ---------- */
.seal-badge { position: relative; flex: none; display: inline-grid; place-items: center; width: 64px; height: 64px; }
.seal-badge img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(150, 40, 20, .28)); }
.seal-badge b {
  position: relative; writing-mode: vertical-rl;
  color: #FFF7EC; font-weight: 800; line-height: 1; letter-spacing: 2px;
  font-size: 22px; text-shadow: 0 1px 0 rgba(120, 20, 0, .35);
}
.seal-badge.sm { width: 58px; height: 58px; }
.seal-badge.sm b { font-size: 19px; }
.seal-badge.md { width: 72px; height: 72px; transform: rotate(-4deg); }
.seal-badge.md b { font-size: 24px; }
.seal-badge.big { display: grid; width: 132px; height: 132px; margin: 4px auto 10px; animation: seal-stamp .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.seal-badge.big b { font-size: 44px; letter-spacing: 4px; }
.sb-7 b { color: #FFE9A8; }
@keyframes seal-stamp { 0% { transform: scale(2.2) rotate(-14deg); opacity: 0; } 60% { transform: scale(.92) rotate(-3deg); opacity: 1; } 100% { transform: scale(1) rotate(-4deg); } }
.rk-head { gap: 10px; }
.rank2 .rk-head .seal-badge { margin: -6px 0 -4px -2px; }
.me-card .seal-badge { margin-left: auto; }

/* ---------- 首页：版本说明入口 ---------- */
.notes-entry {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 10px;
  background: linear-gradient(100deg, #FFF6DD, #FFFDF6 60%);
  border: 2px solid #F0D9A0;
}
.ne-art { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex: none; }
.ne-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ne-text b { font-size: 19px; color: #8A5512; }
.ne-text em { font-style: normal; font-size: 13px; color: var(--ink-soft); }
.ne-new {
  position: absolute; top: -8px; right: 12px;
  padding: 1px 8px; border-radius: 999px;
  background: var(--red); color: #fff; font-style: normal; font-size: 12px; font-weight: 800;
  box-shadow: 0 3px 8px rgba(232, 97, 60, .4); animation: bump 1.2s infinite;
}

/* ---------- 版本说明页 ---------- */
.vnotes {
  display: block;
  margin-top: 4px; padding: 14px 12px 20px;
  border-radius: 22px; border: 3px solid #E7C98A;
  background: linear-gradient(180deg, #FFF9EA, #FBF1DA);
  box-shadow: 0 10px 30px rgba(120, 90, 30, .15);
}
.notes-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 18px;
  background: linear-gradient(110deg, #FFE7A6, #FFF3D0 60%, #FFF9EA);
  border: 2px solid #F2C46A;
}
.nb-art { width: 92px; height: 92px; border-radius: 16px; object-fit: cover; flex: none; box-shadow: 0 4px 10px rgba(120, 90, 30, .2); }
.nb-text h2 { display: flex; align-items: center; gap: 6px; font-size: 24px; color: #7A3E0C; }
.nb-text h2 span { color: var(--red); }
.nb-text h2 .seal { font-size: 18px; }
.nb-text p { font-size: 14px; line-height: 1.7; margin-top: 4px; color: #4A3A20; }
.nb-text .muted { font-size: 12px; }
.notes-sec { display: flex; align-items: center; gap: 10px; margin: 20px 2px 12px; font-size: 20px; color: #4A3A10; }
.notes-sec span { white-space: nowrap; }
.notes-sec::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #8CCB6E, transparent); }
.notes-sec.future::after { background: linear-gradient(90deg, #F2B544, transparent); }
.notes-sec em { order: 2; font-style: normal; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--yellow); color: #fff; }
.notes-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .notes-grid { grid-template-columns: 1fr 1fr; } }
.note-card {
  overflow: hidden; border-radius: 16px; background: #fff;
  border: 2px solid #EFDDB0; box-shadow: 0 4px 12px rgba(120, 90, 30, .1);
  animation: pop-card .45s backwards;
}
.nc-shot { position: relative; aspect-ratio: 4 / 3; height: auto; overflow: hidden; background: #F4EEDD; border-bottom: 2px solid #EFDDB0; }
.nc-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.nc-shot.art { aspect-ratio: 4 / 3; height: auto; }
.nc-shot.art img { object-position: center; }
.nc-body { padding: 10px 14px 14px; }
.nc-body h4 { display: flex; align-items: center; gap: 6px; font-size: 18px; color: #3A2A10; margin-bottom: 4px; }
.nc-body p { font-size: 14px; line-height: 1.75; color: #5A4A30; }
.nc-hot, .nc-soon {
  position: absolute; top: 10px; right: 10px;
  padding: 2px 10px; border-radius: 999px; font-style: normal; font-size: 13px; font-weight: 800; color: #fff;
}
.nc-soon { background: rgba(59, 165, 154, .92); }
.nc-hot { background: linear-gradient(135deg, #FF7A45, #E8463C); box-shadow: 0 0 0 0 rgba(232, 70, 60, .5); animation: hot-pulse 1.4s infinite; }
@keyframes hot-pulse { 0% { box-shadow: 0 0 0 0 rgba(232, 70, 60, .55); } 100% { box-shadow: 0 0 0 12px rgba(232, 70, 60, 0); } }
.note-card.hot { border-color: #F5A28A; }
.notes-foot { margin-top: 18px; text-align: center; font-size: 16px; color: #8A6A3A; }

.seal-badge.sm { width: 66px; height: 66px; }
.seal-badge.sm b { font-size: 21px; }
/* 学习页底部提示小字：压在画面上时加浅色底 */
.bd-poem .hint { display: block; width: fit-content; margin-left: auto; margin-right: auto; padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, .82); color: var(--ink-soft); }
/* 朗读页底部的简洁提示：实心小胶囊，不和背景混在一起 */
.read-tip {
  width: fit-content; margin: 12px auto 4px; padding: 5px 14px;
  border-radius: 999px; background: rgba(44, 138, 128, .88); color: #fff;
  font-size: 13px; letter-spacing: 1px; box-shadow: 0 3px 10px rgba(44, 138, 128, .25);
}

/* ---------- 顶栏版本号 ---------- */
.brand-title { position: relative; }
.ver-chip {
  align-self: flex-start; margin: 2px 0 0 2px;
  padding: 0 6px; border-radius: 999px;
  background: #FFF1D0; border: 1px solid #F0C978;
  color: #9A5B10; font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: 0; line-height: 17px;
}

/* ---------- 首次打开的版本说明弹窗 ---------- */
.modal-notes { padding: 0 0 16px; overflow-x: hidden; background: linear-gradient(180deg, #FFF9EA, #FBF1DA); border: 3px solid #E7C98A; }
.np-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: linear-gradient(110deg, #FFE7A6, #FFF3D0 70%); border-bottom: 2px solid #F2C46A; }
.np-head img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; flex: none; box-shadow: 0 3px 8px rgba(120, 90, 30, .2); }
.np-head h3 { display: flex; align-items: center; gap: 6px; font-size: 22px; color: #7A3E0C; }
.np-head h3 .seal { font-size: 16px; }
.np-head p { font-size: 12px; color: #9A7A4A; margin-top: 2px; }
.np-sec { display: flex; align-items: center; gap: 8px; margin: 14px 16px 8px; font-size: 16px; color: #4A3A10; }
.np-sec::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #8CCB6E, transparent); }
.np-sec.future::after { background: linear-gradient(90deg, #F2B544, transparent); }
.np-sec em { order: 2; font-style: normal; font-size: 11px; padding: 0 7px; border-radius: 999px; background: var(--yellow); color: #fff; }
.np-list { list-style: none; margin: 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.np-list li { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 10px; background: #fff; border: 1px solid #EFDDB0; font-size: 13px; }
.np-list b { font-weight: 700; color: #3A2A10; line-height: 1.3; }
.np-future { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 16px; }
.np-f { position: relative; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid #EFDDB0; }
.np-f img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.np-f b { display: block; padding: 5px 6px 7px; font-size: 12px; line-height: 1.35; color: #3A2A10; }
.np-f i { position: absolute; top: 5px; right: 5px; padding: 0 6px; border-radius: 999px; font-style: normal; font-size: 10px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #FF7A45, #E8463C); animation: hot-pulse 1.4s infinite; }
.np-f.hot { border-color: #F5A28A; }
.modal-notes .btn-row { margin: 16px 16px 0; }
/* 顶栏版本号 + 提示语 */
.ver-chip { display: inline-flex; align-items: center; gap: 3px; padding: 0 7px 0 6px; }
.ver-chip em { font-style: normal; font-weight: 600; color: #B0741E; }
.ver-chip em::after { content: "›"; margin-left: 2px; font-weight: 800; }
/* 品牌名下方放版本号，不挤占昵称 */
.brand-title { flex-direction: column; gap: 2px; line-height: 1.1; }
.brand-row { display: flex; align-items: center; gap: 6px; }
.brand-title .ver-chip { align-self: center; margin: 0; font-size: 10.5px; line-height: 16px; }


/* ===== 诗途新 logo：所有 <i class="seal">诗</i> 统一显示为生成的徽标 ===== */
.seal {
  color: transparent; overflow: hidden; text-indent: -999px;
  background: url(../images/logo.webp) center / contain no-repeat;
  box-shadow: none; transform: none; border-radius: 0;
  width: 1.2em; height: 1.2em;
}

/* ===== 激活码弹窗与锁定卡片 ===== */
.act-modal { position: relative; padding: 0 20px 18px; overflow-x: hidden; }
.act-x { position: absolute; top: 8px; right: 10px; z-index: 2; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.7); color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.act-art { display: block; width: calc(100% + 40px); max-width: none; margin: 0 -20px; aspect-ratio: 2 / 1; object-fit: cover; mix-blend-mode: multiply; }
.act-title { font-size: 22px; text-align: center; color: var(--ink); margin: -6px 0 4px; }
.act-sub { text-align: center; font-size: 14px; color: var(--ink-soft); margin: 0 0 14px; line-height: 1.6; }
.act-field { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 0 14px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.act-field:focus-within { border-color: var(--red); }
.act-field span { flex: none; width: 3em; font-size: 15px; color: var(--ink-soft); }
.act-field input { flex: 1; min-width: 0; padding: 13px 0; border: 0; outline: 0; background: transparent; font-size: 17px; color: var(--ink); font-family: inherit; }
.act-field .act-code { font-family: ui-monospace, Menlo, monospace; font-size: 21px; letter-spacing: 3px; text-transform: uppercase; }
.act-msg { min-height: 22px; margin-bottom: 6px; font-size: 14px; color: var(--red); text-align: center; }
.act-tip { margin: 12px 0 0; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }
.locked-card .locked-pet { width: 96px; height: auto; margin-bottom: 4px; }
.locked-card h3 { font-size: 20px; margin-bottom: 6px; color: var(--ink); }


/* ===== 作者落款：印章 + 文字的矢量 logo，放在关键位置，不遮挡诗文 ===== */
.poem-card { padding-bottom: 64px; }
.poem-card::after {
  content: "";
  position: absolute; right: 10px; bottom: 8px; width: 170px; height: 46px;
  background: url(../images/brand-lockup.svg) center / 152px 41px no-repeat, rgba(253, 248, 238, .9);
  border-radius: 12px; box-shadow: 0 2px 8px rgba(120, 80, 50, .16);
  pointer-events: none; user-select: none;
}
.credit {
  display: block; width: fit-content; max-width: calc(100% - 24px);
  margin: 28px auto 10px; padding: 8px 18px 8px 12px;
  background: rgba(253, 248, 238, .9); border-radius: 18px; box-shadow: 0 2px 10px rgba(120, 80, 50, .16);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  user-select: none;
}
.credit img { display: block; height: 46px; width: auto; max-width: 100%; pointer-events: none; -webkit-user-drag: none; }
.credit.big img { height: 58px; }
.act-brand { display: block; height: 38px; width: auto; margin: 14px auto 0; opacity: .95; }
