@font-face { font-family: "Brush"; src: url(fonts/brush.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Song"; src: url(fonts/song.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Song"; src: url(fonts/song-bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #F1DFCB;      /* 与立绘宣纸底色一致 */
  --paper-2: #F7ECDF;
  --paper-3: #E8D3BA;
  --ink: #2A221D;
  --ink-2: #5B4D42;
  --ink-3: #8C7A6A;
  --line: rgba(74, 52, 36, .16);
  --red: #B23A2E;        /* 朱砂 */
  --red-d: #8F2A20;
  --gold: #A07D46;
  --song: "Song", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --brush: "Brush", "STKaiti", "KaiTi", var(--song);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--paper); overflow-x: hidden; }
body {
  font-family: var(--song); color: var(--ink); line-height: 1.75;
  background-color: var(--paper);
  /* 宣纸纤维：一层很淡的噪点 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  min-height: 100vh; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

.screen {
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  padding: 0 20px calc(40px + env(safe-area-inset-bottom));
  animation: fadeIn .5s ease both;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ 首页 ============ */
.home-top { display: flex; align-items: center; gap: 10px; padding-top: 22px; }
.mini-seal {
  width: 30px; height: 30px; border-radius: 4px; background: var(--red); color: #F6E6D6;
  font-family: var(--brush); font-size: 13px; line-height: 13px; text-align: center; padding-top: 2px;
  box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 3px rgba(246, 230, 214, .55);
}
.home-top-text { font-size: 12px; letter-spacing: .35em; color: var(--ink-3); }

.hero { position: relative; margin: 18px auto 0; width: 78%; }
.hero-frame {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 46%, #000 58%, transparent 100%);
          mask-image: radial-gradient(ellipse 72% 70% at 50% 46%, #000 58%, transparent 100%);
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity 1.2s ease, transform 6s ease-out; }
.hero-img.on { opacity: 1; transform: scale(1); }
.hero-name {
  position: absolute; right: -14%; top: 8%; writing-mode: vertical-rl; display: flex; align-items: center; gap: 8px;
}
.hero-name span { font-family: var(--brush); font-size: 34px; letter-spacing: .1em; color: var(--ink); }
.hero-name i { font-style: normal; font-size: 11px; letter-spacing: .4em; color: #F6E6D6; background: var(--red); padding: 8px 3px; border-radius: 2px; }

.home-title { margin-top: 8px; text-align: center; font-family: var(--brush); font-weight: 400; line-height: 1.15; color: var(--ink); }
.home-title span { display: block; }
.home-title span:first-child { font-size: 30px; letter-spacing: .3em; color: var(--ink-2); padding-left: .3em; }
.home-title span:last-child { font-size: 54px; letter-spacing: .08em; position: relative; display: inline-block; }
.title-seal {
  position: absolute; right: -34px; top: 4px; font-style: normal; font-size: 18px; line-height: 1;
  color: var(--red); border: 2px solid var(--red); border-radius: 4px; padding: 4px 3px; transform: rotate(8deg);
}
.home-sub { text-align: center; margin-top: 14px; font-size: 14px; color: var(--ink-2); letter-spacing: .08em; line-height: 2; }

.btn-seal {
  display: block; margin: 28px auto 0; position: relative; width: 220px; height: 58px;
  background: var(--red); color: #F8EADC; border-radius: 6px;
  font-family: var(--brush); font-size: 26px; letter-spacing: .3em;
  box-shadow: 0 10px 24px -10px rgba(143, 42, 32, .7), inset 0 0 0 3px var(--red), inset 0 0 0 4px rgba(248, 234, 220, .45);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-seal span { padding-left: .3em; }
.btn-seal:active { transform: translateY(2px) scale(.98); box-shadow: 0 4px 12px -6px rgba(143, 42, 32, .7), inset 0 0 0 3px var(--red), inset 0 0 0 4px rgba(248, 234, 220, .45); }
.btn-seal::after { /* 印泥斑驳 */
  content: ""; position: absolute; inset: 0; border-radius: 6px; pointer-events: none; opacity: .25; mix-blend-mode: screen;
  background: radial-gradient(circle at 18% 30%, #fff 0 1px, transparent 2px), radial-gradient(circle at 76% 70%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 60% 22%, #fff 0 1px, transparent 2px), radial-gradient(circle at 34% 78%, #fff 0 1px, transparent 2px);
}
.home-meta { text-align: center; margin-top: 12px; font-size: 12px; color: var(--ink-3); letter-spacing: .1em; }

.cast { margin-top: 44px; }
.cast-head { display: flex; align-items: center; gap: 12px; justify-content: center; font-size: 13px; letter-spacing: .2em; color: var(--ink-2); }
.cast-head i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line)); }
.cast-head i:last-child { transform: scaleX(-1); }
.cast-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 10px; margin-top: 18px; }
.cast-item { text-align: center; }
.cast-item .ph { aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden; background: var(--paper-3); box-shadow: 0 0 0 1px var(--line); }
.cast-item img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.cast-item b { display: block; margin-top: 6px; font-family: var(--brush); font-weight: 400; font-size: 17px; line-height: 1.2; }
.cast-item small { display: block; font-size: 10px; color: var(--ink-3); letter-spacing: .1em; }
.foot { text-align: center; margin-top: 36px; font-size: 11px; color: var(--ink-3); letter-spacing: .1em; }

/* ============ 答题 ============ */
.quiz-bar { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; height: 58px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink-2); border-radius: 50%; }
.icon-btn:disabled { opacity: .25; }
.quiz-count { font-size: 14px; letter-spacing: .15em; color: var(--ink-2); }
.quiz-count b { font-family: var(--brush); font-weight: 400; font-size: 24px; color: var(--red); margin: 0 2px; }
.quiz-count > span { color: var(--ink-3); font-size: 12px; }
.progress { height: 3px; background: var(--line); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red-d), var(--red)); border-radius: 3px; transition: width .45s ease; }

.q-stage { position: relative; margin-top: 26px; }
.q-card { position: relative; }
.q-card.out { animation: qOut .26s ease forwards; }
.q-card.in { animation: qIn .34s ease both; }
.q-card.in-back { animation: qInBack .34s ease both; }
@keyframes qOut { to { opacity: 0; transform: translateX(-24px); } }
@keyframes qIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes qInBack { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.hills { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; max-width: 480px; height: 200px; margin: 0 auto; pointer-events: none; z-index: -1; }
#quiz { position: relative; z-index: 0; }
.q-text { position: relative; font-size: 22px; font-weight: 700; line-height: 1.6; letter-spacing: .02em; min-height: 3.2em; padding-right: 8px; }
.q-opts { margin-top: 26px; display: grid; gap: 12px; }
.opt {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 16px 16px 16px 14px; border-radius: 10px; background: rgba(247, 236, 223, .72);
  box-shadow: 0 0 0 1px var(--line), 0 6px 16px -12px rgba(74, 52, 36, .5);
  font-size: 16px; line-height: 1.55; color: var(--ink);
  transition: background .2s ease, box-shadow .2s ease, transform .12s ease;
}
.opt:active { transform: scale(.985); }
.opt .lab {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--brush); font-size: 17px; color: var(--red); box-shadow: inset 0 0 0 1.5px rgba(178, 58, 46, .55);
  transition: all .2s ease;
}
.opt.sel { background: #FBF3E9; box-shadow: 0 0 0 1.5px var(--red), 0 8px 20px -12px rgba(143, 42, 32, .6); }
.opt.sel .lab { background: var(--red); color: #F8EADC; box-shadow: none; transform: rotate(-8deg); }

/* ============ 揭晓 ============ */
#reveal { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ink { position: relative; width: 160px; height: 160px; }
.ink i {
  position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle, rgba(42, 34, 29, .55), rgba(42, 34, 29, 0) 70%);
  animation: inkBloom 2.4s ease-out infinite;
}
.ink i:nth-child(2) { animation-delay: .8s; }
.ink i:nth-child(3) { animation-delay: 1.6s; }
.ink img {
  position: absolute; left: 50%; top: 50%; width: 96px; height: 128px; margin: -64px 0 0 -48px; object-fit: cover; object-position: 50% 20%;
  border-radius: 6px; opacity: .85; filter: blur(.6px) sepia(.2);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 45%, #000 50%, transparent 100%);
          mask-image: radial-gradient(ellipse 60% 60% at 50% 45%, #000 50%, transparent 100%);
}
@keyframes inkBloom { 0% { transform: scale(.2); opacity: 0; } 20% { opacity: 1; } 100% { transform: scale(8); opacity: 0; } }
.reveal-text { margin-top: 36px; font-family: var(--brush); font-size: 24px; letter-spacing: .3em; color: var(--ink-2); min-height: 1.5em; transition: opacity .3s; }

/* ============ 结果 ============ */
.r-pre { text-align: center; padding-top: 28px; font-size: 13px; letter-spacing: .4em; color: var(--ink-3); }
.r-hero { position: relative; margin: 10px -20px 0; overflow: hidden; } /* 印章入场放大时不撑出屏幕 */
.r-hero img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 8%, #000 66%, transparent 98%);
          mask-image: linear-gradient(180deg, transparent 0, #000 8%, #000 66%, transparent 98%);
}
.r-stamp {
  position: absolute; right: 22px; top: 22px; width: 76px; height: 76px; border-radius: 8px;
  border: 2.5px solid var(--red); color: var(--red); transform: rotate(9deg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(241, 223, 203, .55); backdrop-filter: blur(1px);
  box-shadow: inset 0 0 0 3px rgba(241, 223, 203, .6), inset 0 0 0 4.5px rgba(178, 58, 46, .7);
  animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) .5s both;
}
.r-stamp b { font-family: var(--brush); font-weight: 400; font-size: 34px; line-height: 1; }
.r-stamp span { font-size: 11px; letter-spacing: .1em; margin-top: 2px; }
@keyframes stamp { from { opacity: 0; transform: rotate(9deg) scale(2.2); } to { opacity: 1; transform: rotate(9deg) scale(1); } }
.r-name { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; }
.r-name h2 { font-family: var(--brush); font-weight: 400; font-size: 76px; line-height: 1; letter-spacing: .12em; padding-left: .12em; text-shadow: 0 0 18px var(--paper), 0 0 6px var(--paper); }
.r-name p { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; font-size: 13px; letter-spacing: .2em; color: var(--ink-2); }
.r-name p i { width: 4px; height: 4px; background: var(--red); transform: rotate(45deg); }

.r-tagline { margin-top: 22px; text-align: center; font-size: 19px; font-weight: 700; letter-spacing: .06em; line-height: 1.6; }
.r-tagline::before { content: "「"; color: var(--red); }
.r-tagline::after { content: "」"; color: var(--red); }
.r-keys { display: flex; justify-content: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.r-keys span { font-size: 13px; letter-spacing: .15em; padding: 3px 12px 3px 14px; border: 1px solid rgba(178, 58, 46, .4); color: var(--red-d); border-radius: 999px; }

.r-quote {
  position: relative; margin: 34px auto 0; display: flex; flex-direction: row-reverse; justify-content: center; align-items: stretch; gap: 0;
  padding: 26px 22px; background: rgba(247, 236, 223, .6); border-radius: 4px; box-shadow: 0 0 0 1px var(--line);
}
.r-quote::before, .r-quote::after { /* 卷轴两端的朱线 */
  content: ""; position: absolute; top: 10px; bottom: 10px; width: 2px; background: rgba(178, 58, 46, .55);
}
.r-quote::before { left: 10px; } .r-quote::after { right: 10px; }
.r-quote-text { display: flex; flex-direction: row-reverse; }
.r-quote-text span {
  writing-mode: vertical-rl; font-family: var(--brush); font-size: 28px; letter-spacing: .2em; line-height: 1;
  padding: 4px 13px; border-left: 1px solid var(--line); color: var(--ink);
}
.r-quote-text span:first-child { border-right: 1px solid var(--line); }
.r-quote-src { writing-mode: vertical-rl; align-self: flex-end; font-size: 12px; letter-spacing: .3em; color: var(--ink-3); padding-right: 10px; }

.sec { margin-top: 36px; }
.sec-h { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.sec-h span { font-family: var(--brush); font-size: 24px; letter-spacing: .1em; }
.sec-h::before { content: ""; width: 8px; height: 8px; background: var(--red); transform: rotate(45deg); flex: none; }
.sec-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.sec-p { margin-top: 12px; font-size: 15.5px; line-height: 2; color: var(--ink-2); text-align: justify; }
.sec-p.fact { padding: 14px 16px; border-left: 3px solid var(--gold); background: rgba(247, 236, 223, .6); border-radius: 0 8px 8px 0; font-size: 14.5px; line-height: 1.9; }

.r-list { list-style: none; margin-top: 14px; display: grid; gap: 10px; counter-reset: s; }
.r-list li { counter-increment: s; display: flex; gap: 12px; align-items: baseline; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.r-list li::before { content: counter(s, cjk-ideographic); flex: none; font-family: var(--brush); font-size: 20px; color: var(--red); width: 22px; }
.r-list li b { color: var(--ink); }
.r-weak { margin-top: 16px; display: flex; gap: 12px; align-items: baseline; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 14.5px; color: var(--ink-2); line-height: 1.8; }
.r-weak b { flex: none; font-weight: 400; font-family: var(--brush); font-size: 18px; color: var(--ink-3); }

.axes { margin-top: 16px; display: grid; gap: 16px; }
.axis { display: grid; grid-template-columns: 3em 1fr 3em; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .1em; }
.axis span { color: var(--ink-3); transition: color .3s; }
.axis span.on { color: var(--ink); font-weight: 700; }
.axis span:last-child { text-align: right; }
.axis .bar { position: relative; height: 2px; background: var(--line); }
.axis .bar::before { content: ""; position: absolute; left: 50%; top: -4px; width: 1px; height: 10px; background: var(--ink-3); opacity: .5; }
.axis .bar i {
  position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 4px rgba(178, 58, 46, .15); left: 50%;
  transition: left 1s cubic-bezier(.3, 1.3, .5, 1);
}

.r-modern { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.r-modern span { padding: 8px 16px; background: rgba(247, 236, 223, .8); box-shadow: 0 0 0 1px var(--line); border-radius: 6px; font-size: 14px; letter-spacing: .06em; }

.peers { margin-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.peer { text-align: center; background: rgba(247, 236, 223, .6); border-radius: 8px; padding: 8px 8px 10px; box-shadow: 0 0 0 1px var(--line); }
.peer .ph { aspect-ratio: 3 / 4; border-radius: 4px; overflow: hidden; }
.peer img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.peer.opp img { filter: grayscale(.7) contrast(.95); }
.peer b { display: block; margin-top: 6px; font-family: var(--brush); font-weight: 400; font-size: 20px; line-height: 1.2; }
.peer small { display: block; font-size: 11px; color: var(--ink-3); letter-spacing: .08em; }
.peer em { display: inline-block; margin-top: 4px; font-style: normal; font-size: 11px; letter-spacing: .1em; color: var(--red-d); }
.peer.opp em { color: var(--ink-3); }

.r-actions { margin-top: 40px; text-align: center; }
.btn-ghost { margin-top: 14px; padding: 10px 28px; font-size: 14px; letter-spacing: .3em; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; background: rgba(247, 236, 223, .5); }
.link-btn { display: block; margin: 10px auto 0; font-size: 13px; letter-spacing: .1em; color: var(--red-d); padding: 6px 10px; }

/* ============ 海报弹层 ============ */
.layer { position: fixed; inset: 0; z-index: 10; background: rgba(28, 22, 18, .82); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .3s ease both; }
.layer-inner { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 440px; max-height: 100%; }
.layer img { max-width: 100%; max-height: calc(100vh - 140px); width: auto; height: auto; border-radius: 6px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); -webkit-touch-callout: default; }
.layer-tip { margin-top: 14px; color: #EADBC8; font-size: 14px; letter-spacing: .15em; }
.layer-close { margin-top: 12px; color: #EADBC8; font-size: 13px; letter-spacing: .2em; padding: 6px 22px; border: 1px solid rgba(234, 219, 200, .4); border-radius: 999px; }

@media (min-width: 560px) {
  .screen { padding-top: 12px; }
}
