:root {
  --ink: #10201a;
  --paper: #f5ead4;
  --paper-soft: #e9d8b9;
  --gold: #d5b36d;
  --gold-deep: #a67b3d;
  --jade: #6f907c;
  --red: #a64e39;
  --serif: "Songti SC", "Noto Serif SC", "STSong", serif;
  --sans: "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: #0c1712; color: var(--paper); font-family: var(--sans);
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.grain {
  position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.83' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
.ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.ambient:before, .ambient:after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 58%; background-size: cover; background-position: center;
  opacity: .23; filter: blur(2px) saturate(.65) brightness(.7);
}
.ambient:before { left: 0; background-image: url("assets/cover-yesu.jpg"); transform: scale(1.05); }
.ambient:after { right: 0; background-image: url("assets/cover-wangyue.jpg"); background-position: 62% center; transform: scale(1.05); }
body:after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 18, 13, .9), rgba(8, 18, 13, .54) 45%, rgba(8, 18, 13, .83)),
    linear-gradient(180deg, rgba(8, 18, 13, .58), transparent 25%, rgba(8, 18, 13, .9));
}
.ambient-moon {
  position: absolute; width: 280px; height: 280px; border-radius: 50%; top: 7%; right: 9%;
  border: 1px solid rgba(244, 217, 155, .16);
  box-shadow: 0 0 90px rgba(248, 214, 138, .12), inset 0 0 80px rgba(248, 214, 138, .06);
}
.ambient-fire { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #f3ce7c; box-shadow: 0 0 14px 4px rgba(245, 204, 112, .4); animation: drift 9s ease-in-out infinite; }
.ambient-fire.a { left: 18%; top: 34%; animation-delay: -3s; }
.ambient-fire.b { left: 67%; top: 23%; animation-delay: -6s; }
.ambient-fire.c { left: 78%; top: 59%; animation-delay: -1s; }
@keyframes drift { 0%, 100% { transform: translate(0, 0); opacity: .2; } 50% { transform: translate(18px, -24px); opacity: .9; } }

.top {
  position: relative; z-index: 10; max-width: 1260px; margin: 0 auto; height: 82px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 34px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.seal {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(238, 211, 155, .55);
  display: grid; place-items: center; color: #f1d392; font-family: var(--serif); font-size: 22px;
}
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy b { font-family: var(--serif); font-size: 16px; font-weight: 500; letter-spacing: .09em; color: #f7ecd7; }
.brand-copy em { font-style: normal; color: rgba(237, 221, 193, .52); font-size: 14px; letter-spacing: .08em; }
.top-right { display: flex; align-items: center; gap: 18px; }
.count { color: rgba(239, 221, 188, .52); font-size: 14px; letter-spacing: .08em; }
.sound {
  height: 33px; padding: 0 13px; border-radius: 999px; cursor: pointer;
  background: rgba(22, 39, 31, .44); color: rgba(245, 230, 201, .75);
  border: 1px solid rgba(235, 208, 155, .22); font-size: 14px; letter-spacing: .06em;
}
.sound:hover { border-color: rgba(237, 206, 143, .55); color: #f8ead0; }

.hub { position: relative; z-index: 10; max-width: 1260px; margin: 0 auto; padding: 5vh 34px 0; }
.hero { max-width: 780px; margin-bottom: 31px; }
.hero-kicker { display: flex; align-items: center; gap: 10px; color: #d8b872; font-size: 14px; letter-spacing: .28em; }
.hero-kicker i { width: 30px; height: 1px; background: rgba(218, 184, 113, .65); }
.hero h1 {
  margin: 16px 0 12px; font-family: var(--serif); font-weight: 500;
  font-size: clamp(47px, 6.2vw, 82px); line-height: 1.08; letter-spacing: .07em; color: #f8efdd;
  text-shadow: 0 8px 34px rgba(0, 0, 0, .24);
}
.hero h1 em { font-style: normal; color: #dfc07e; }
.hero p { margin: 0; color: rgba(241, 228, 202, .7); font-family: var(--serif); font-size: 14px; line-height: 1.95; letter-spacing: .04em; }
.hero-meta { display: flex; gap: 23px; margin-top: 20px; color: rgba(238, 220, 187, .54); font-size: 14px; letter-spacing: .1em; }
.hero-meta b { color: #e5c47e; font-family: var(--serif); font-size: 19px; font-weight: 500; margin-right: 3px; }

.poem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.poem-card {
  position: relative; min-height: 458px; overflow: hidden; border-radius: 4px;
  border: 1px solid rgba(243, 223, 184, .22); box-shadow: 0 26px 70px rgba(0, 0, 0, .33);
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .35s cubic-bezier(.22, .8, .25, 1), border-color .35s, box-shadow .35s;
  isolation: isolate;
}
.poem-card:hover { transform: translateY(-6px); border-color: rgba(242, 211, 146, .62); box-shadow: 0 34px 86px rgba(0, 0, 0, .46); }
.card-bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; transition: transform 1s ease; }
.poem-card:hover .card-bg { transform: scale(1.05); }
.poem-card.night .card-bg { background-image: url("assets/cover-yesu.jpg"); }
.poem-card.day .card-bg { background-image: url("assets/cover-wangyue.jpg"); background-position: center 42%; }
.card-shade {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(6, 16, 12, .1) 0%, rgba(6, 16, 12, .25) 38%, rgba(6, 16, 12, .91) 100%);
}
.poem-card.day .card-shade { background: linear-gradient(180deg, rgba(9, 20, 14, .04) 0%, rgba(9, 20, 14, .3) 38%, rgba(8, 19, 14, .91) 100%); }
.card-top { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 17px 18px 0; }
.chapter { color: rgba(250, 233, 200, .78); font-size: 14px; letter-spacing: .17em; }
.open { color: #edcf91; font-size: 14px; letter-spacing: .08em; border-bottom: 1px solid rgba(236, 204, 140, .4); padding-bottom: 3px; }
.open i { font-style: normal; margin-left: 4px; }
.card-body { position: relative; padding: 0 20px; align-self: flex-end; width: 100%; }
.poem-no { color: rgba(239, 216, 173, .44); font-family: var(--serif); font-size: 14px; letter-spacing: .16em; }
.card-body h2 { margin: 4px 0 2px; font-family: var(--serif); font-size: clamp(37px, 4.4vw, 55px); font-weight: 500; letter-spacing: .13em; line-height: 1.08; color: #fbf2df; text-shadow: 0 4px 26px rgba(0, 0, 0, .3); }
.author { color: rgba(242, 223, 189, .64); font-family: var(--serif); font-size: 14px; letter-spacing: .18em; }
.lines { margin: 15px 0 10px; font-family: var(--serif); font-size: 14px; line-height: 1.75; color: rgba(246, 233, 208, .84); letter-spacing: .05em; }
.tags { display: flex; gap: 7px; flex-wrap: wrap; }
.tags span { border: 1px solid rgba(241, 219, 175, .2); border-radius: 999px; padding: 3px 7px; font-size: 14px; color: rgba(243, 226, 194, .6); letter-spacing: .04em; }
.card-bottom { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 13px 18px 15px; margin-top: 10px; border-top: 1px solid rgba(241, 220, 180, .16); color: rgba(242, 224, 190, .56); font-size: 14px; letter-spacing: .05em; }
.arrow { color: #e6c47f; font-size: 19px; transition: transform .3s; }
.poem-card:hover .arrow { transform: translateX(5px); }

.timeline { position: relative; margin: 29px 0 0; padding: 0 3px; }
.timeline-label { color: rgba(239, 221, 187, .44); font-size: 14px; letter-spacing: .25em; margin-bottom: 10px; }
.timeline-line { display: flex; align-items: center; gap: 10px; }
.timeline-node { display: flex; align-items: baseline; gap: 7px; color: rgba(243, 227, 198, .58); padding: 5px 0; }
.timeline-node b { width: 21px; height: 21px; border-radius: 50%; border: 1px solid rgba(241, 215, 167, .26); display: grid; place-items: center; font-family: var(--serif); font-size: 14px; font-weight: 400; color: rgba(244, 230, 203, .6); }
.timeline-node span { font-family: var(--serif); font-size: 14px; letter-spacing: .07em; }
.timeline-node em { font-style: normal; font-size: 14px; opacity: .5; letter-spacing: .05em; }
.timeline-node.done b { background: rgba(198, 157, 85, .22); border-color: rgba(237, 203, 134, .6); color: #f0d294; }
.timeline-node.locked { opacity: .33; }
.rail { flex: 1; height: 1px; max-width: 140px; background: linear-gradient(90deg, rgba(213, 179, 109, .35), rgba(213, 179, 109, .1)); }
.rail.ghost { opacity: .3; }
.foot { position: relative; z-index: 10; max-width: 1260px; margin: 18px auto 0; padding: 15px 34px 22px; display: flex; justify-content: space-between; color: rgba(239, 223, 193, .35); font-size: 14px; letter-spacing: .08em; border-top: 1px solid rgba(235, 213, 175, .1); }

@media (max-width: 960px) {
  .top { height: 72px; padding: 0 20px; }
  .hub { padding: 3vh 20px 0; }
  .poem-grid { gap: 12px; }
  .poem-card { min-height: 390px; }
  .card-body h2 { font-size: 40px; }
}
@media (max-width: 720px) {
  .top-right .count { display: none; }
  .brand-copy em { display: none; }
  .hub { padding: 2vh 14px 0; }
  .hero { margin-bottom: 20px; }
  .hero h1 { font-size: 46px; }
  .hero p { font-size: 14px; }
  .poem-grid { grid-template-columns: 1fr; }
  .poem-card { min-height: 360px; }
  .timeline-line { flex-wrap: wrap; }
  .rail { display: none; }
  .timeline { margin-top: 22px; }
  .foot { padding: 14px 16px 20px; flex-direction: column; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* third poem */
.poem-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.poem-card.river .card-bg { background-image: url("assets/cover-wtm.jpg"); background-position: center 48%; }
.poem-card.river .card-shade { background: linear-gradient(180deg, rgba(6, 18, 13, .02) 0%, rgba(6, 18, 13, .24) 38%, rgba(6, 18, 13, .92) 100%); }
.poem-card.river .tags span { color: rgba(243, 226, 194, .7); }
@media (max-width: 1100px) {
  .poem-grid { grid-template-columns: 1fr 1fr; }
  .poem-card.river { grid-column: 1 / -1; min-height: 360px; }
}
@media (max-width: 720px) {
  .poem-grid { grid-template-columns: 1fr; }
  .poem-card.river { grid-column: auto; }
}

/* ---------- 4:3 poem cards ---------- */
.poem-grid .poem-card {
  aspect-ratio: 4 / 3;
  min-height: 0 !important;
  height: auto;
}
.poem-grid .poem-card .card-body h2 {
  font-size: clamp(30px, 3.1vw, 42px);
}
.poem-grid .poem-card .lines {
  margin: 10px 0 8px;
  font-size: 14px;
  line-height: 1.7;
}
.poem-grid .poem-card .card-bottom {
  padding-top: 9px;
  padding-bottom: 11px;
  margin-top: 6px;
}
@media (max-width: 1100px) {
  .poem-grid .poem-card.river { grid-column: auto; }
}
@media (max-width: 720px) {
  .poem-grid .poem-card { aspect-ratio: 4 / 3; min-height: 0 !important; }
  .poem-grid .poem-card .card-body h2 { font-size: 34px; }
  .poem-grid .poem-card .lines { font-size: 14px; }
}

/* readable "enter adventure" chip on bright/day cards */
.poem-card .open {
  border-bottom: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(7, 19, 13, .52);
  color: #f4d99e;
  backdrop-filter: blur(8px);
}

/* MIN_FONT_14: no readable text below 14px */
body, button, input, select, textarea { font-size: 14px; }

@media (max-width: 720px) {
  .hero-meta { flex-direction: column; align-items: flex-start; gap: 5px; }
}

/* ---------- play progress on cards ---------- */
.count b { color: #ffd877; font-family: var(--serif); font-size: 16px; font-weight: 500; }
.card-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; font-size: 14px; }
.card-progress:empty { display: none; }
.cp-new { color: #f3d99a; padding: 2px 10px; border-radius: 999px; background: rgba(7, 19, 13, .45); animation: cp-wink 2.4s ease-in-out infinite; }
@keyframes cp-wink { 50% { color: #fff1c8; box-shadow: 0 0 14px rgba(255, 214, 120, .35); } }
.cp-row { display: flex; align-items: center; gap: 8px; color: #f6e6c4; }
.cp-bar { width: 74px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.cp-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8fc39b, #f2cf6c); }
.cp-row b { font-weight: 500; }
.cp-stars { color: #ffd877; }
.cp-levels { display: flex; align-items: center; gap: 8px; color: #f2c35a; letter-spacing: .04em; }
.cp-trophy { margin-left: 2px; padding: 1px 9px; border-radius: 999px; background: rgba(240, 180, 69, .22); border: 1px solid rgba(255, 216, 120, .45); color: #ffe3a0; letter-spacing: 0; font-size: 13px; }
.card-body:has(.card-progress:not(:empty)) .tags { display: none; }
.poem-card.is-done .poem-no:after { content: " · 已通关"; color: #b9d3ae; letter-spacing: .08em; }
.poem-card.is-perfect .poem-no:after { content: " · 全三星"; color: #ffd877; }
.timeline-node.current b { border-color: #f0d294; color: #f0d294; animation: node-pulse 1.8s ease-in-out infinite; }
.timeline-node.current span { color: #f6e2b4; }
@keyframes node-pulse { 50% { box-shadow: 0 0 0 5px rgba(240, 210, 148, .18); } }
@media (prefers-reduced-motion: reduce) {
  .cp-new, .timeline-node.current b { animation: none; }
}

/* app download entry */
.download-link {
  display: inline-flex; align-items: center; height: 33px; padding: 0 13px;
  border-radius: 999px; border: 1px solid rgba(226, 192, 123, .48);
  background: rgba(83, 54, 25, .42); color: #f4d79a; font-size: 14px;
  letter-spacing: .04em; text-decoration: none; white-space: nowrap;
}
.download-link:hover { background: rgba(123, 82, 35, .62); border-color: #e8c477; }

/* ---------- lan QR scan ---------- */
.lan-qr-btn {
  height: 33px; padding: 0 12px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 1px solid rgba(232, 196, 119, .55); background: rgba(25, 43, 34, .45);
  color: #f0d9a4; font-size: 14px; letter-spacing: .06em;
}
.lan-qr-btn:hover { border-color: #e8c477; color: #fff1d2; background: rgba(123, 82, 35, .35); }
.lan-qr-modal {
  position: fixed; inset: 0; z-index: 320; display: none; align-items: center; justify-content: center; padding: 20px;
}
.lan-qr-modal.is-open { display: flex; }
.lan-qr-backdrop { position: absolute; inset: 0; background: rgba(4, 13, 9, .72); backdrop-filter: blur(8px); }
.lan-qr-card {
  position: relative; z-index: 1; width: min(360px, 100%); padding: 26px 24px 22px; text-align: center;
  border-radius: 6px; border: 1px solid rgba(255, 255, 255, .4);
  background: linear-gradient(145deg, #f8efda, #ead9bc);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .45); color: #3c4538;
}
.lan-qr-close {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(120, 92, 55, .28); background: transparent; color: #7b674d; cursor: pointer; font-size: 18px; line-height: 1;
}
.lan-qr-close:hover { background: rgba(255, 250, 240, .65); }
.lan-qr-card h2 { margin: 0 0 6px; font-family: var(--serif); font-weight: 500; font-size: 24px; letter-spacing: .08em; color: #334c3d; }
.lan-qr-tip { margin: 0 0 14px; color: #7b6d58; font-size: 14px; line-height: 1.5; min-height: 1.5em; }
.lan-qr-frame {
  width: 236px; height: 236px; margin: 0 auto 12px; padding: 8px; border-radius: 10px;
  background: #f5ead4; border: 1px solid rgba(120, 92, 55, .18); display: grid; place-items: center;
}
.lan-qr-frame img { display: block; width: 220px; height: 220px; object-fit: contain; background: #f5ead4; }
.lan-qr-pick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 0 10px; }
.lan-qr-ip {
  border: 1px solid rgba(120, 92, 55, .28); background: rgba(255, 251, 241, .7); color: #5a4a34;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.lan-qr-ip.on { background: #9d4a37; border-color: #9d4a37; color: #fff0d5; }
.lan-qr-url {
  display: block; width: 100%; border: 0; background: transparent; cursor: pointer; text-align: center;
  color: #6f5a3d; font-size: 12px; line-height: 1.45; word-break: break-all; padding: 4px 2px;
}
.lan-qr-url:hover { color: #9d4a37; }
@media (max-width: 620px) {
  .lan-qr-btn { padding: 0 9px; }
  .count { display: none; }
}

/* ---------- auth slot / modal ---------- */
.auth-slot { display: inline-flex; align-items: center; gap: 6px; position: relative; z-index: 30; }
.auth-menu { position: relative; }
.auth-avatar {
  width: 42px; height: 42px; padding: 0; border-radius: 50%; overflow: hidden; flex: 0 0 42px;
  border: 2px solid #f0d294; box-shadow: 0 0 0 2px rgba(12, 23, 18, .65);
  background: #3a2a22; cursor: pointer;
}
.auth-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 28% 32%; display: block; }
.auth-avatar:hover, .auth-avatar[aria-expanded="true"] { border-color: #fff1cc; }
.auth-pop {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 50;
  width: 188px; padding: 8px; display: grid;
  border-radius: 16px; border: 1px solid rgba(240, 210, 148, .42);
  background: #163028;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .48);
}
.auth-pop::before {
  content: ""; position: absolute; top: -6px; right: 15px; width: 12px; height: 12px;
  background: #163028; border-top: 1px solid rgba(240, 210, 148, .42); border-left: 1px solid rgba(240, 210, 148, .42);
  transform: rotate(45deg);
}
.auth-pop[hidden] { display: none; }
.auth-pop-user {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  margin: 2px 4px 6px; padding: 4px 4px 10px;
  border-bottom: 1px solid rgba(240, 210, 148, .2);
}
.auth-pop-user img {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: 28% 32%; flex: 0 0 28px;
}
.auth-pop-user b {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #f8edd4; font-weight: 500; font-size: 15px; font-family: var(--serif);
}
.auth-pop-item {
  display: flex; align-items: center; width: 100%; height: 38px; padding: 0 12px;
  border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  color: #f4e7cf; font-size: 14px; letter-spacing: .04em; text-align: left;
}
.auth-pop-item:hover { background: rgba(240, 210, 148, .14); color: #fff8ea; }
#logoutBtn.auth-pop-item { color: #efc3b4; }
.auth-entry, .auth-logout {
  height: 33px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(235, 208, 155, .32); background: rgba(25, 43, 34, .45);
  color: rgba(248, 234, 208, .9); font-size: 14px; letter-spacing: .04em;
}
.auth-entry:hover, .auth-logout:hover { border-color: rgba(241, 205, 137, .65); color: #fff1d2; }
.auth-me {
  height: 33px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; white-space: nowrap;
  border: 1px solid rgba(232, 196, 119, .6); background: rgba(123, 82, 35, .42); color: #f6dfa8; font-size: 14px; letter-spacing: .04em;
}
.auth-me:hover { background: rgba(123, 82, 35, .62); border-color: #e8c477; }
.auth-name { max-width: 95px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #eed39b; font-size: 14px; }
.auth-modal {
  position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-modal.is-open { display: flex; }
.auth-backdrop { position: absolute; inset: 0; background: rgba(4, 13, 9, .7); backdrop-filter: blur(9px); }
.auth-card {
  position: relative; z-index: 1; width: min(430px, 100%); padding: 28px 30px 22px;
  border-radius: 5px; border: 1px solid rgba(255, 255, 255, .45);
  background: linear-gradient(135deg, #f9efdb, #ecddc1);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .44), inset 0 0 70px rgba(255, 251, 240, .25);
  color: #3c4538;
}
.auth-card:before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(137, 105, 61, .18); pointer-events: none; }
.auth-close { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(120, 92, 55, .28); background: transparent; color: #7b674d; cursor: pointer; font-size: 14px; }
.auth-close:hover { background: rgba(255, 250, 240, .65); }
.auth-brand { display: flex; align-items: center; gap: 8px; color: #7a6447; font-family: var(--serif); font-size: 14px; letter-spacing: .08em; }
.auth-seal { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: #f4dfb4; background: #9d4a37; border: 1px solid rgba(252, 234, 199, .7); font-size: 14px; }
.auth-tabs { display: flex; gap: 16px; margin-top: 19px; border-bottom: 1px solid rgba(113, 89, 54, .22); }
.auth-tab { padding: 7px 2px 9px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #95846a; font-family: var(--serif); font-size: 16px; letter-spacing: .08em; cursor: pointer; }
.auth-tab.active { color: #3f5c49; border-bottom-color: #9a7440; }
.auth-card h2 { position: relative; margin: 18px 0 5px; font-family: var(--serif); font-size: 28px; font-weight: 500; color: #334c3d; letter-spacing: .06em; }
.auth-sub { position: relative; margin: 0 0 16px; color: #7b6d58; font-size: 14px; line-height: 1.65; }
.auth-form { position: relative; display: grid; gap: 12px; }
.auth-field { display: grid; gap: 5px; }
.auth-field > span { color: #76664e; font-size: 14px; letter-spacing: .05em; }
.auth-field input {
  height: 42px; width: 100%; padding: 0 11px; border-radius: 6px;
  border: 1px solid rgba(116, 91, 56, .28); background: rgba(255, 251, 241, .74);
  color: #3a3a2f; font-size: 15px; outline: none;
}
.auth-field input:focus { border-color: #8d9f83; box-shadow: 0 0 0 3px rgba(105, 137, 110, .1); }
.auth-error { min-height: 19px; color: #a14836; font-size: 14px; line-height: 1.4; }
.auth-submit {
  height: 45px; border: 1px solid rgba(232, 207, 159, .4); border-radius: 7px; cursor: pointer;
  background: linear-gradient(135deg, #a24f3a, #7f3429); color: #fff0d5;
  font-size: 15px; letter-spacing: .08em;
}
.auth-submit:hover { background: linear-gradient(135deg, #b35c43, #8d3b2e); }
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-demo { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; padding-top: 12px; border-top: 1px dashed rgba(127, 99, 61, .25); color: #8c7b62; font-size: 14px; }
.auth-demo b { color: #916e42; font-weight: 500; }
.auth-demo span { color: #4f654f; font-family: var(--serif); }
.auth-demo i { color: #b7a58a; font-style: normal; }
.auth-policy { margin: 10px 0 0; text-align: center; color: #a2947f; font-size: 14px; line-height: 1.5; }
@media (max-width: 620px) {
  .auth-card { padding: 23px 20px 18px; }
  .auth-card h2 { font-size: 25px; }
  .auth-slot .auth-name { max-width: 68px; }
  .auth-entry, .auth-logout { padding: 0 9px; }
}

.auth-realname[hidden] { display: none !important; }

/* grade 4 poem sections */
.grade-section { margin-top: 34px; }
.grade-head { display: flex; align-items: center; gap: 12px; margin: 0 2px 14px; }
.grade-head span { font-family: var(--serif); color: #e5c98b; font-size: 20px; letter-spacing: .1em; }
.grade-head i { flex: 1; height: 1px; background: rgba(234, 210, 166, .16); }
.grade-head em { color: rgba(237, 220, 186, .42); font-style: normal; font-size: 14px; letter-spacing: .06em; }
.grade-grid { margin-bottom: 6px; }
.grade-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .grade-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grade-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grade-grid, .grade-grid.two { grid-template-columns: 1fr; }
  .grade-section { margin-top: 24px; }
  .grade-head span { font-size: 18px; }
}

/* grade cards: long poem titles fit 4:3 cards */
.grade-grid .poem-card .card-body h2 {
  font-size: clamp(28px, 2.6vw, 34px);
  line-height: 1.14;
  letter-spacing: .05em;
}

/* high school poem scroll cards */
.high-grid .poem-card .card-body h2 { font-size: clamp(27px, 2.35vw, 32px); }
.high-grid .poem-card .card-body .author { letter-spacing:.03em; }
.high-grid .poem-card .card-progress .cp-new { color: rgba(238, 219, 180, .66); }

.card-note { margin-top: 8px; font-size:14px; }
.card-note .cp-new { color: rgba(238,219,180,.68); }

/* touch devices: no double-tap zoom or grey tap flash; ~50 blurred chips re-blur on every scroll frame on phones */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  .poem-card .open { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(7, 19, 13, .7); }
}
/* phones: logged-in header (name, logout, sound, download) no longer wraps the brand into a column */
@media (max-width: 480px) {
  .top { padding: 0 12px; }
  .top-right { gap: 8px; }
  .brand-copy { display: none; }
  .sound, .auth-entry, .auth-logout { white-space: nowrap; padding: 0 9px; }
}

/* lite tier, chosen on the game pages (shared/engine.js) */
html.perf-lite *, html.perf-lite *::before, html.perf-lite *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html.perf-lite .grain { display: none; }
html.perf-lite .ambient:before, html.perf-lite .ambient:after { filter: saturate(.65) brightness(.7); }

/* middle school collapsible grade sections */
.middle-school { margin-top: 38px; }
.grade-details { border-top: 1px solid rgba(228,201,154,.14); padding: 0; }
.grade-details summary {
  display:flex; align-items:center; gap:12px; cursor:pointer; list-style:none;
  padding:16px 2px; color:#e5c98b; font-family:var(--serif); font-size:20px; letter-spacing:.1em;
}
.grade-details summary::-webkit-details-marker { display:none; }
.grade-details summary i { flex:1; height:1px; background:rgba(234,210,166,.16); }
.grade-details summary em { color:rgba(237,220,186,.42); font-style:normal; font-size:14px; letter-spacing:.06em; }
.grade-details summary:after { content:"＋"; color:rgba(231,201,143,.65); font-family:var(--sans); font-size:18px; }
.grade-details[open] summary:after { content:"−"; }
.grade-details[open] summary { padding-bottom:14px; }
.grade-existing { margin:-2px 2px 14px; color:rgba(238,219,180,.55); font-size:14px; }
.grade-existing a { color:#e6c98f; text-decoration:none; border-bottom:1px solid rgba(230,201,143,.45); padding-bottom:1px; }
.grade-existing a:hover { color:#fff0cf; }
.middle-grid .poem-card .card-body h2 { font-size:clamp(26px,2.25vw,31px); }
.middle-grid .poem-card .card-body .lines { font-size:14px; }
@media (max-width:720px) {
  .grade-details summary { font-size:18px; padding:14px 1px; }
}

/* 全部诗词：互动设计趣味快评，不是诗歌文学评分 */
.fun-score {
  --score-color: #a9c7e8;
  display: grid; grid-template-columns: auto minmax(36px, 1fr) auto; align-items: center; gap: 8px;
  margin-top: 8px; padding: 5px 8px; border-radius: 8px;
  color: rgba(246, 233, 208, .72); background: rgba(7, 19, 13, .48);
  border: 1px solid rgba(241, 219, 175, .15); backdrop-filter: blur(5px);
}
.fun-score[data-tier="top"] { --score-color: #ffd877; }
.fun-score[data-tier="high"] { --score-color: #a9d4bd; }
.fun-score-label { font-size: 14px; white-space: nowrap; }
.fun-score-track { display: block; height: 4px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .12); }
.fun-score-track i { display: block; height: 100%; border-radius: inherit; background: var(--score-color); box-shadow: 0 0 8px var(--score-color); }
.fun-score-value { color: var(--score-color); font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1; white-space: nowrap; }
.fun-score-value small { margin-left: 2px; color: rgba(246, 233, 208, .48); font-family: var(--sans); font-size: 14px; font-weight: 400; }
@media (hover: none) { .fun-score { backdrop-filter: none; } }
@media (max-width: 480px) {
  .fun-score { gap: 7px; padding: 5px 7px; }
  .fun-score-label { font-size: 14px; }
}
/* Scores are real content: let cards grow instead of clipping their bottom row. */
.poem-grid .poem-card { aspect-ratio: auto; }

/* 今日挑战 + 奖章墙 */
.daily { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; margin: -8px 0 28px; }
.daily-card {
  position: relative; display: grid; gap: 6px; padding: 16px 18px; border-radius: 16px; text-decoration: none; color: var(--paper);
  background: linear-gradient(135deg, rgba(166, 78, 57, .55), rgba(213, 179, 109, .28)); box-shadow: inset 0 0 0 1px rgba(229, 196, 126, .45), 0 10px 26px rgba(0, 0, 0, .25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.daily-card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(255, 216, 119, .8), 0 14px 30px rgba(0, 0, 0, .3); }
.daily-card.done { background: linear-gradient(135deg, rgba(111, 144, 124, .55), rgba(213, 179, 109, .2)); }
.daily-tag { justify-self: start; padding: 2px 10px; border-radius: 999px; background: #ffd877; color: #5a3a08; font-size: 13px; font-weight: 700; }
.daily-card b { font-family: var(--serif); font-size: 24px; font-weight: 600; color: #ffe8b0; }
.daily-card small { color: rgba(245, 234, 212, .8); font-size: 13px; line-height: 1.6; }
.daily-go { justify-self: end; color: #ffd877; font-size: 14px; }
.medal-wall { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.medal-wall div { display: grid; place-content: center; gap: 4px; padding: 10px 4px; border-radius: 14px; text-align: center; background: rgba(245, 234, 212, .07); box-shadow: inset 0 0 0 1px rgba(213, 179, 109, .25); }
.medal-wall b { color: #ffe1a0; font-family: var(--serif); font-size: 20px; font-weight: 600; white-space: nowrap; }
.medal-wall span { color: rgba(238, 220, 187, .62); font-size: 12px; }
.poem-card.is-daily { box-shadow: 0 0 0 2px #ffd877, 0 0 24px rgba(255, 216, 119, .45); }
.poem-card.is-daily .card-body::before { content: "🎯 今日挑战"; display: inline-block; margin-bottom: 6px; padding: 2px 9px; border-radius: 999px; background: #ffd877; color: #5a3a08; font-size: 12px; font-weight: 700; }
@media (max-width: 760px) {
  .daily { grid-template-columns: 1fr; }
  .medal-wall { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .medal-wall b { font-size: 16px; }
  .medal-wall span { font-size: 11px; }
}

/* ========== 国风 PNG 图标（本地 GPU 生成，见 tools/icon_jobs.json） ========== */
.ui-ico { display: inline-block; width: 1em; height: 1em; vertical-align: -0.13em; object-fit: contain; }
.medal-wall b .ui-ico { width: 20px; height: 20px; vertical-align: -4px; margin-right: 1px; }
.daily-tag .ui-ico, .daily-go .ui-ico { width: 1em; height: 1em; }
.poem-card.is-daily .card-body::before { content: "今日挑战"; padding-left: 26px; background: #ffd877 url(/assets/icons/target.png) no-repeat 8px center/18px 18px; }
.ui-star { display: inline-block; width: 1em; height: 1em; vertical-align: -0.12em; margin: 0 1px; object-fit: contain; }
.cp-levels .ui-star { width: 14px; height: 14px; }

/* ========== 首页导航 / 搜索 / 移动端优化（2026-11） ========== */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* 吸顶诗词导航 */
.quickbar {
  position: sticky; top: 0; z-index: 90;
  background: rgba(9, 19, 14, .78);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  backdrop-filter: blur(14px) saturate(1.05);
  border-bottom: 1px solid rgba(236, 209, 156, .14);
}
.qb-inner { max-width: 1260px; margin: 0 auto; padding: 8px 34px; display: flex; align-items: center; gap: 14px; }
.qb-home {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid rgba(238, 211, 155, .45); color: #f1d392;
  display: grid; place-items: center; font-family: var(--serif); font-size: 14px; text-decoration: none;
}
.qb-tabs { display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1 1 auto; }
.qb-tabs::-webkit-scrollbar { display: none; }
.qb-tab {
  flex: 0 0 auto; padding: 3px 10px; border-radius: 999px;
  border: 1px solid rgba(236, 209, 156, .16); color: rgba(245, 232, 206, .68);
  text-decoration: none; font-size: 13px; letter-spacing: .04em; white-space: nowrap; transition: .2s;
}
.qb-tab:hover { color: #fff3d8; border-color: rgba(236, 209, 156, .5); }
.qb-tab.on { background: rgba(213, 179, 109, .16); border-color: rgba(236, 209, 156, .6); color: #ffe8b8; }
.qb-search {
  flex: 0 1 230px; min-width: 0; display: flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px; border-radius: 999px;
  border: 1px solid rgba(236, 209, 156, .2); background: rgba(255, 250, 235, .05);
}
.qb-search:focus-within { border-color: rgba(236, 209, 156, .55); background: rgba(255, 250, 235, .09); }
.qb-search-ico { color: rgba(240, 220, 180, .55); font-size: 15px; }
.qb-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #f6ecd6; font: inherit; font-size: 13px; }
.qb-search input::placeholder { color: rgba(238, 222, 190, .42); }
.qb-search input::-webkit-search-cancel-button { display: none; }
.qb-clear {
  flex: 0 0 auto; width: 18px; height: 18px; border: 0; border-radius: 50%;
  background: rgba(236, 209, 156, .18); color: #f6ecd6; cursor: pointer; font-size: 13px; line-height: 1;
  display: grid; place-items: center;
}
.qb-count { flex: 0 0 auto; font-size: 12px; color: rgba(240, 224, 192, .6); white-space: nowrap; }
@media (max-width: 900px) {
  .qb-inner { padding: 7px 14px; gap: 8px; flex-wrap: wrap; }
  .qb-home { display: none; }
  .qb-tabs { order: 2; flex: 1 0 100%; }
  .qb-search { order: 1; flex: 1 1 auto; }
  .qb-count { order: 1; }
}

/* 搜索时隐藏 hero / 今日挑战，聚焦结果 */
body.is-searching .hero, body.is-searching .daily { display: none; }
.is-hidden { display: none !important; }

/* Hero 操作按钮与数字 */
.hero-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.hero-cta {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 26px; border-radius: 999px;
  background: linear-gradient(135deg, #b06a3c, #8a4a2b); border: 1px solid rgba(247, 216, 165, .5);
  color: #fff3d8; text-decoration: none; font-size: 15px; letter-spacing: .08em;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .32);
}
.hero-cta:hover { filter: brightness(1.08); }
.hero-cta i { font-style: normal; transition: transform .2s; }
.hero-cta:hover i { transform: translateX(4px); }
.hero-ghost {
  color: rgba(240, 224, 192, .62); text-decoration: none; font-size: 14px; letter-spacing: .06em;
  border-bottom: 1px solid rgba(236, 209, 156, .28); padding-bottom: 2px;
}
.hero-ghost:hover { color: #ffe8b8; border-color: rgba(236, 209, 156, .6); }
@media (min-width: 1200px) {
  .hero { position: relative; }
  .hero::after {
    content: "会当凌绝顶\A一览众山小"; white-space: pre;
    writing-mode: vertical-rl; position: absolute; right: -250px; top: -6px;
    font-family: var(--serif); font-size: 26px; letter-spacing: .5em; line-height: 2;
    color: rgba(232, 209, 160, .14); pointer-events: none;
  }
}

/* 回到顶部 */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 95;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(236, 209, 156, .4); background: rgba(12, 25, 19, .78); color: #f2d9a6;
  font-size: 18px; cursor: pointer; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .25s;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: rgba(236, 209, 156, .75); color: #fff; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

/* 锚点滚动留出吸顶导航高度 */
.grade-section, .middle-school, .daily { scroll-margin-top: 76px; }

/* 长列表图片已懒加载；不用 content-visibility，避免锚点滚动时页面高度跳动 */

/* 移动端头部：保证 390px 不溢出 */
@media (max-width: 620px) {
  .lan-qr-btn { display: none; }
  .top { height: 64px; padding: 0 12px; gap: 8px; }
  .brand, .brand-copy { min-width: 0; }
  .brand-copy b { font-size: 14px; }
  .top-right { gap: 6px; min-width: 0; }
  .dl-long { display: none; }
  .dl-short { display: inline; }
  .download-link { height: 30px; padding: 0 10px; font-size: 13px; }
  .sound, .auth-entry, .auth-logout { height: 30px; font-size: 13px; padding: 0 9px; }
  .hero-actions { margin-top: 18px; }
  .hero-cta { height: 42px; padding: 0 22px; font-size: 14px; }
}
@media (min-width: 621px) { .dl-short { display: none; } }

/* 触屏设备减少实时模糊 */
@media (hover: none) {
  .fun-score, .poem-card .open { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* 头部不挤压、搜索清空按钮隐藏 */
.top-right { flex: 0 0 auto; }
.top-right > * { flex: 0 0 auto; }
.brand { min-width: 0; }
.brand-copy { min-width: 0; overflow: hidden; }
.brand-copy b, .brand-copy em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qb-clear[hidden] { display: none !important; }
@media (max-width: 380px) {
  .download-link { display: none; }
}

/* 已登录头像区在手机上收紧，避免"我的闯关 + 昵称 + 退出"挤爆头部 */
@media (max-width: 620px) {
  .auth-pop { width: 176px; }
  .auth-me { height: 30px; padding: 0 10px; font-size: 13px; white-space: nowrap; }
  .auth-logout { height: 30px; padding: 0 9px; font-size: 13px; }
}

/* ========== 两屏首页：精选信息 + 年级切换 + 横向诗卡 ========== */
.top { height: 68px; overflow: visible; z-index: 120; }
.auth-slot { flex: 0 0 auto; }
.hub { max-width: 1380px; padding-top: 22px; }
.hero {
  max-width: none; margin-bottom: 16px; padding: 18px 24px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; align-items: end;
  border: 1px solid rgba(236, 209, 156, .2); border-radius: 22px;
  background: linear-gradient(115deg, rgba(29, 50, 39, .8), rgba(26, 39, 31, .38));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .2);
}
.hero-kicker { grid-column: 1 / -1; }
.hero h1 { margin: 8px 0; font-size: clamp(34px, 4vw, 52px); line-height: 1.12; }
.hero h1 br { display: none; }
.hero h1 em::before { content: " "; }
.hero p { grid-column: 1; line-height: 1.65; }
.hero p br { display: none; }
.hero-meta { grid-column: 2; grid-row: 2; flex-direction: column; align-items: flex-end; gap: 4px; margin: 0; white-space: nowrap; }
.hero-actions { grid-column: 2; grid-row: 3; margin-top: 10px; }
.hero::after { display: none !important; }
.hero-cta { height: 42px; padding: 0 22px; }
.daily { grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); gap: 12px; margin: 0 0 16px; }
.daily-card { padding: 12px 16px; gap: 4px; border-radius: 16px; }
.daily-card b { font-size: 20px; }
.daily-card small { line-height: 1.45; }
.medal-wall div { padding: 8px 4px; }
.hub > .poem-grid, .timeline { display: none; }
.grade-section, .middle-school { margin-top: 14px; }
.grade-section[hidden], .middle-school[hidden] { display: none; }
.grade-head { margin-bottom: 9px; }
.grade-head span { font-size: 19px; }
.grade-grid {
  display: flex; gap: 14px; margin: 0; padding: 4px 4px 14px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: rgba(213, 179, 109, .5) rgba(255, 255, 255, .05);
}
.grade-grid::-webkit-scrollbar { height: 6px; }
.grade-grid::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(213, 179, 109, .45); }
.grade-grid .poem-card {
  flex: 0 0 clamp(250px, 24vw, 310px); height: 252px; min-height: 252px !important;
  border-radius: 16px; scroll-snap-align: start;
}
.grade-grid .card-top { padding: 12px 14px 0; }
.grade-grid .card-body { padding: 0 16px; }
.grade-grid .poem-card .card-body h2 { font-size: 27px; line-height: 1.15; }
.grade-grid .lines, .grade-grid .tags, .grade-grid .card-bottom, .grade-grid .cp-levels { display: none; }
.grade-grid .card-progress { margin-top: 6px; }
.grade-grid .fun-score { margin-top: 6px; padding: 4px 7px; }
.grade-grid .poem-card.is-daily .card-body::before { margin-bottom: 4px; }
.grade-details summary { padding: 10px 2px; font-size: 17px; }
.grade-details[open] summary { padding-bottom: 10px; }
.grade-existing { display: none; }
.foot { margin-top: 10px; padding-top: 12px; padding-bottom: 16px; }
body.is-searching .hub > .poem-grid { display: none; }
body.is-searching .grade-grid { flex-wrap: wrap; overflow: visible; }
body.is-searching .grade-grid .poem-card { flex-basis: calc(25% - 11px); }

@media (max-width: 1000px) {
  .hero { column-gap: 20px; padding: 16px 20px; }
  .hero h1 { font-size: 38px; }
  .hero-meta span:last-child { display: none; }
  .daily { grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr); }
  .grade-grid .poem-card { flex-basis: 270px; }
  body.is-searching .grade-grid .poem-card { flex-basis: calc(33.333% - 10px); }
}
@media (max-width: 760px) {
  .hub { padding-top: 14px; }
  .hero { display: block; padding: 16px 18px; }
  .hero h1 { font-size: 34px; }
  .hero-meta { flex-direction: row; align-items: center; gap: 16px; margin-top: 10px; }
  .hero-actions { margin-top: 12px; }
  .daily { grid-template-columns: minmax(240px, .9fr) minmax(0, 1.1fr); }
  .daily-card small { display: none; }
  .medal-wall { gap: 5px; }
  .medal-wall div { padding: 8px 2px; }
  .grade-grid .poem-card { flex-basis: 250px; height: 240px; min-height: 240px !important; }
  body.is-searching .grade-grid .poem-card { flex-basis: calc(50% - 7px); }
}
@media (max-width: 600px) {
  .hero { border-radius: 18px; }
  .hero-kicker { font-size: 13px; }
  .hero h1 { font-size: 31px; }
  .hero p { font-size: 14px; }
  .hero-meta { gap: 13px; }
  .daily { grid-template-columns: 1fr; }
  .daily-card { min-height: 100px; }
  .daily-card small { display: block; }
  .medal-wall div { padding: 7px 2px; }
  .grade-grid .poem-card { flex-basis: 78vw; }
  .foot { margin-top: 6px; }
}

/* 五、六年级先提供可检索的诗词档案，游戏完成后再开放入口。 */
.poem-card.upcoming { cursor: default; }
.poem-card.upcoming:hover { transform: none; border-color: rgba(243, 223, 184, .22); box-shadow: 0 18px 45px rgba(0, 0, 0, .28); }
.poem-card.upcoming .card-bg { background: radial-gradient(circle at 78% 18%, rgba(229, 201, 139, .26), transparent 30%), linear-gradient(145deg, #294337, #14271f 68%, #3b3023); }
.poem-card.upcoming .card-bg::before,
.poem-card.upcoming .card-bg::after { content: ""; position: absolute; left: -8%; right: -8%; bottom: 20%; height: 42%; border-radius: 50% 50% 0 0; transform: rotate(-7deg); background: rgba(115, 145, 119, .16); }
.poem-card.upcoming .card-bg::after { bottom: 4%; left: 22%; transform: rotate(9deg); background: rgba(213, 179, 109, .1); }
.poem-card.upcoming .card-bg[data-bg]::before,
.poem-card.upcoming .card-bg[data-bg]::after { display: none; }
.poem-card.upcoming .card-shade { background: linear-gradient(180deg, rgba(6, 16, 12, .02), rgba(6, 16, 12, .55)); }
.poem-card.upcoming .open { color: rgba(245, 227, 192, .72); background: rgba(7, 19, 13, .36); }
.poem-card.upcoming .lines { display: block; margin: 12px 0 8px; font-size: 14px; line-height: 1.7; }

.rail-nav { display: none; }
/* ========== iPad：竖屏 744–900，横屏到 12.9 寸 1366 ========== */
@media (min-width: 744px) and (max-width: 1400px) {
  .top { height: 72px; padding: 0 24px; }
  .top-right { gap: 10px; }
  .sound, .lan-qr-btn, .download-link, .auth-entry, .auth-logout, .auth-me {
    height: 40px; padding: 0 14px;
  }
  .qb-inner { flex-wrap: nowrap; align-items: center; padding: 8px 24px; gap: 10px; }
  .qb-home { display: grid; width: 36px; height: 36px; }
  .qb-tabs { order: 0; flex: 1 1 auto; gap: 6px; }
  .qb-search { order: 0; flex: 0 1 180px; height: 40px; }
  .qb-tabs.is-overflow {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent);
  }
  .qb-search input { font-size: 14px; }
  .qb-count { order: 0; font-size: 14px; }
  .qb-tab {
    order: 0; min-height: 40px; padding: 0 13px; font-size: 14px;
    display: inline-flex; align-items: center;
  }
  .hub { padding-left: 24px; padding-right: 24px; }
  .hero { padding: 18px 22px; }
  .hero-cta { height: 46px; padding: 0 24px; }
  .daily-card { min-height: 112px; }
  .medal-wall b { font-size: 22px; }
  .medal-wall span { font-size: 14px; }
  .grade-details summary { min-height: 48px; padding: 12px 4px; }
  .grade-grid {
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 2px;
    gap: 14px;
    padding-bottom: 16px;
  }
  .grade-grid .poem-card {
    flex-basis: calc((100% - 16px) / 2.22);
    height: 276px;
    min-height: 276px !important;
    scroll-snap-align: start;
  }
  .grade-grid .poem-card .card-body h2 { font-size: 28px; }
  .rail-wrap { position: relative; }
  .rail-nav {
    position: absolute; left: 0; right: 0; top: 0; bottom: 16px; z-index: 3;
    display: flex; align-items: center; justify-content: space-between; pointer-events: none;
  }
  .rail-btn {
    pointer-events: none; opacity: 0; width: 44px; height: 44px; margin: 0 4px;
    border-radius: 50%; border: 1px solid rgba(236, 209, 156, .55);
    background: rgba(12, 25, 19, .82); color: #f6e7c8; font-size: 26px; line-height: 1;
    cursor: pointer; box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
  }
  .rail-wrap.can-prev .rail-btn.prev,
  .rail-wrap.can-next .rail-btn.next { opacity: 1; pointer-events: auto; }
  .rail-wrap.can-next .grade-grid {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 52px), transparent);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 52px), transparent);
  }
  .rail-wrap.can-prev.can-next .grade-grid {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 52px, #000 calc(100% - 52px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 52px, #000 calc(100% - 52px), transparent);
  }
  .rail-wrap.can-prev:not(.can-next) .grade-grid {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 52px, #000 100%);
    mask-image: linear-gradient(90deg, transparent, #000 52px, #000 100%);
  }
  body.is-searching .rail-nav { display: none; }
  body.is-searching .grade-grid {
    -webkit-mask-image: none; mask-image: none;
  }
  .foot { padding-left: 24px; padding-right: 24px; }
}
@media (min-width: 1080px) and (max-width: 1400px) {
  .grade-grid .poem-card { flex-basis: calc((100% - 32px) / 3.28); }
  .hero h1 { font-size: 44px; }
  .hero-meta span:last-child { display: inline; }
}
@media (min-width: 744px) and (max-width: 900px) {
  .top .count { display: none; }
  .brand-copy em { display: none; }
  .qb-inner { flex-wrap: wrap; row-gap: 8px; }
  .qb-search { order: 1; flex: 1 1 auto; min-width: 0; }
  .qb-count { order: 2; }
  .qb-tabs { order: 3; flex: 1 0 100%; }
  .hero { display: block; }
  .hero h1 { font-size: 40px; }
  .hero-meta { flex-direction: row; align-items: center; gap: 16px; margin-top: 12px; white-space: normal; }
  .hero-actions { margin-top: 14px; }
  .daily { grid-template-columns: 1fr; }
  .daily-card small { display: block; }
}
@media (hover: none) {
  .poem-card:hover, .daily-card:hover { transform: none; }
  .poem-card:active { transform: scale(.985); }
  .hero-cta:active, .qb-tab:active, .daily-card:active, .rail-btn:active { filter: brightness(1.12); }
}
.poem-card.upcoming .card-note { margin-top: 8px; }
.poem-card.upcoming .cp-new { animation: none; color: rgba(243, 226, 194, .72); background: rgba(7, 19, 13, .36); }

/* 首页只留玩法与推荐；诗集是可排序列表 */
.grade-section, .middle-school { display: none !important; }
.qb-tabs { display: none !important; }
.qb-views { display: flex; gap: 6px; flex: 0 0 auto; }
.qb-view, .qb-sort .qb-tab {
  min-height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(236, 209, 156, .28); background: transparent;
  color: rgba(245, 232, 206, .78); font-size: 14px;
}
.qb-view.on, .qb-sort .qb-tab.on { background: rgba(213, 179, 109, .2); border-color: rgba(236, 209, 156, .7); color: #ffe8b8; }
.qb-sort { display: flex; gap: 6px; flex: 1 1 auto; min-width: 0; }
.qb-sort[hidden] { display: none !important; }
.play-intro {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px;
}
.play-intro article {
  padding: 14px 16px; border-radius: 16px;
  border: 1px solid rgba(236, 209, 156, .18);
  background: rgba(16, 32, 24, .45);
}
.play-intro b {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(236, 209, 156, .45); color: #f0d294; font-family: var(--serif); font-weight: 500;
}
.play-intro h2 { margin: 8px 0 4px; font-family: var(--serif); font-size: 18px; font-weight: 500; color: #f6ecd8; }
.play-intro p { margin: 0; color: rgba(241, 228, 202, .72); font-size: 14px; line-height: 1.65; }
.featured { margin-bottom: 8px; }
.poem-list { display: grid; gap: 8px; }
.poem-group { display: flex; align-items: center; gap: 12px; margin: 14px 2px 4px; }
.poem-group span { font-family: var(--serif); color: #e5c98b; font-size: 18px; letter-spacing: .08em; }
.poem-group i { flex: 1; height: 1px; background: rgba(234, 210, 166, .16); }
.poem-group em { color: rgba(237, 220, 186, .5); font-style: normal; font-size: 14px; }
.poem-row {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  min-height: 68px; padding: 8px 14px 8px 8px; border-radius: 14px; text-decoration: none; color: inherit;
  border: 1px solid rgba(236, 209, 156, .16); background: rgba(16, 32, 24, .42);
}
.poem-row:active { transform: scale(.995); }
.poem-row-cover {
  width: 72px; height: 48px; border-radius: 10px; background: #1c3328 center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(236, 209, 156, .22);
}
.poem-row-cover.is-plain {
  display: grid; place-items: center; font-family: var(--serif); font-size: 18px; color: #f0d294;
  background: radial-gradient(circle at 78% 18%, rgba(229, 201, 139, .26), transparent 42%), linear-gradient(145deg, #294337, #14271f 70%);
}
.poem-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.poem-row-main strong { font-family: var(--serif); font-size: 18px; font-weight: 500; color: #fbf2df; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poem-row-main em { font-style: normal; color: rgba(242, 223, 189, .64); font-size: 14px; }
.poem-row-meta { color: rgba(237, 220, 186, .62); font-size: 14px; white-space: nowrap; }
.poem-row-go { color: #edcf91; font-size: 14px; }
.poem-row.is-soon { cursor: default; }
.poem-row.is-soon .poem-row-go { color: rgba(237, 220, 186, .45); }
.poem-empty { margin: 12px 2px; color: rgba(237, 220, 186, .6); }
body.view-home .collection { display: none; }
body.view-shiji .hero,
body.view-shiji .play-intro,
body.view-shiji .featured,
body.view-shiji .daily { display: none; }
body.view-home .qb-search { flex: 1 1 240px; max-width: 420px; }
.brand-copy em, .count, .qb-home, .dl-long { display: none !important; }
.dl-short { display: inline !important; }
@media (max-width: 800px) {
  .play-intro { grid-template-columns: 1fr; }
  .poem-row { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .poem-row-cover { width: 64px; height: 44px; }
  .poem-row-meta { display: none; }
  body.view-shiji .qb-sort { flex: 1 0 100%; order: 3; }
}

/* 精彩推荐改为纵向瀑布式卡片区，不再横向滑动。 */
#featuredGrid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  padding: 4px; overflow: visible; scroll-snap-type: none;
  -webkit-mask-image: none !important; mask-image: none !important;
}
#featuredGrid::-webkit-scrollbar { display: none; }
#featuredGrid .poem-card {
  width: auto; height: 270px; min-height: 270px !important;
  scroll-snap-align: none;
}
#featured .rail-nav { display: none !important; }
@media (max-width: 1080px) {
  #featuredGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  #featuredGrid { grid-template-columns: 1fr; gap: 14px; }
  #featuredGrid .poem-card { height: 250px; min-height: 250px !important; }
}
