/* 温柔月下主题。沿用 style.css 的布局、牌扇坐标、3D 翻牌和全部动画时序。 */
:root {
  color-scheme: light;
  --abyss-0: #faf7f2; --abyss-1: #f7f2f8; --abyss-2: #eee5f3;
  --silver: #443a52; --mist: #766d7d; --mist-dim: #817588;
  --gold: #846a98; --gold-hi: #654d79; --lav: #846a98;
  --paper: #fffdf9; --petal: #f0e9f4; --line: #e3dae6;
  --pac1: #c8aedb; --pac2: #9879af; --pa-deep: #eee5f3; --pa-accent: #846a98;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
body[data-persona="azhen"] { --pa-deep: #f5e7e5; --pa-accent: #a96058; }
body[data-persona="sumian"] { --pa-deep: #e8edf7; --pa-accent: #6179a6; }
body[data-persona="xiaoman"] { --pa-deep: #f7efdd; --pa-accent: #957129; }
body[data-persona="xuanye"] { --pa-deep: #eee4f7; --pa-accent: #82619e; }
body[data-persona="laochen"] { --pa-deep: #e7efe5; --pa-accent: #577d5b; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.stage { overflow: clip; background: radial-gradient(100% 80% at 50% 20%, var(--pa-deep), transparent 70%), var(--abyss-0); }
.brand { color: var(--gold); }
#topright { pointer-events: none; } /* 隐藏的会话工具容器不能遮住首页登录；可见按钮自行恢复命中。 */
.veil { background: radial-gradient(135% 100% at 50% 42%, transparent 44%, #b9a3cc18); }
.luna .lart { mask-image: none; -webkit-mask-image: none; width: min(76vw, 400px); }
.luna.here.faded { opacity: .3; }
.luna .orbfx { background: radial-gradient(circle, #a98db830, transparent 70%); mix-blend-mode: multiply; }
.luna .orbits i { background: #9d7cb4; box-shadow: 0 0 10px #b39ac7; }

/* 首页的可滚动版式与实际应用共用同一套入口。 */
#intro { display: block; overflow-y: auto; overscroll-behavior: contain; background: var(--abyss-0); cursor: default; text-align: left; font-family: var(--sans); }
#intro [hidden] { display: none !important; }
#intro button { font-family: inherit; cursor: pointer; }
#intro a { color: inherit; text-decoration: none; }
.home-shell { max-width: 1240px; margin: 0 auto; padding: 0 52px; }
.home-header { height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.home-wordmark { display: flex; align-items: center; gap: 12px; }
.home-moon { font: 40px Georgia, serif; color: var(--gold); }
#intro .cn { display: inline-block; font: 400 22px var(--serif); letter-spacing: .15em; text-indent: 0; color: var(--silver); text-shadow: none; opacity: 1; animation: none; }
.home-wordmark small { display: block; font-size: 8px; letter-spacing: .18em; color: var(--mist); margin-top: 7px; }
.home-header nav { display: flex; gap: 26px; align-items: center; }
.home-header button { background: none; border: none; font-size: 12px; color: var(--mist); padding: 12px 0; }
.home-header button:hover { color: var(--gold-hi); }
#introAuth:empty { display: none; }
.home-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; min-height: 604px; padding: 36px 0 30px; }
.home-copy { padding-left: 26px; }
.home-eyebrow { font-size: 9px; letter-spacing: .18em; color: var(--gold); }
.home-status { font-size: 12px; color: var(--gold); margin-top: 16px; }
.home-hero h1 { font: 400 clamp(42px, 4.8vw, 64px)/1.42 var(--serif); letter-spacing: .035em; margin: 27px 0 21px; }
.home-hero h1 span { color: #957ca5; }
.home-description { color: var(--mist); font-size: 14px; line-height: 2.1; letter-spacing: .04em; }
.home-actions { margin-top: 34px; max-width: 290px; }
#intro .home-start { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 54px; padding: 0 22px; border: 1px solid #8d72a2; border-radius: 12px; background: #8d72a2; color: #fffdfa; font-size: 14px; letter-spacing: .06em; transition: background .2s, transform .2s; }
#intro .home-start:hover { background: #7c6094; transform: translateY(-2px); }
#intro .home-start .go { font: inherit; color: inherit; background: none; border: none; padding: 0; margin: 0; box-shadow: none; text-shadow: none; letter-spacing: inherit; text-indent: 0; opacity: 1; animation: none; }
.home-actions p { font-size: 10px; color: var(--mist); margin-top: 14px; letter-spacing: .04em; }
#intro .home-signature { font: 11px var(--serif); letter-spacing: .1em; text-transform: none; margin-top: 42px; color: var(--mist); opacity: 1; animation: none; }
.home-art { margin: 0; width: 100%; height: 510px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.home-art img { display: block; width: 100%; height: 470px; object-fit: contain; animation: homeFloat 9s ease-in-out infinite; }
.home-art figcaption { font-size: 8px; letter-spacing: .22em; color: var(--gold); margin-top: 8px; text-align: center; }
@keyframes homeFloat { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-5px) rotate(.5deg); } }
.home-daily { width: 100%; display: flex; align-items: center; gap: 25px; margin-top: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--petal); padding: 24px 30px; text-align: left; color: var(--silver); }
.home-daily:hover { background: #e9dfef; }
.home-daily img { flex: none; border-radius: 4px; transform: rotate(-8deg); }
.home-daily strong { font: 21px var(--serif); display: block; }
.home-daily small { display: block; font-size: 12px; color: var(--mist); margin-top: 12px; }
.home-daily-action { margin-left: auto; font-size: 12px; color: var(--gold-hi); white-space: nowrap; }
.home-topics { margin-top: 70px; }
.home-topics h2 { font: 400 26px/1.5 var(--serif); margin: 15px 0 25px; }
.home-topic-list { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.home-topic-list button { display: flex; gap: 14px; align-items: flex-start; padding: 25px 18px 25px 0; background: none; border: none; text-align: left; color: var(--silver); }
.home-topic-list button + button { border-left: 1px solid var(--line); padding-left: 23px; }
.home-topic-list button:hover { background: #f2ecf5; }
.home-topic-list i { font: italic 13px Georgia, serif; color: #9b87a7; margin-top: 5px; }
.home-topic-list strong { display: block; font: 18px var(--serif); }
.home-topic-list small { display: block; font-size: 10px; line-height: 1.7; color: var(--mist); margin-top: 13px; }
.home-topic-list b { margin-left: auto; font: 24px Georgia, serif; color: #a58db4; }
.home-closing { padding: 60px 0 50px; text-align: center; font: 18px/2.8 var(--serif); }
.home-closing small { display: block; font: 12px var(--serif); color: var(--mist); margin-top: 12px; }
.home-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 24px 0 30px; border-top: 1px solid var(--line); font-size: 10px; color: var(--mist); }
.home-footer address { font-style: normal; font-size: 11px; }
.home-footer address span { white-space: nowrap; margin-left: 8px; }
.home-footer strong { font-weight: 500; color: var(--silver); user-select: all; }
.stardust { z-index: 2; }

/* 表面、文本及按钮的配色；不覆盖交互状态、transform 或 animation。 */
#resetBtn, #shareBtn, #soundBtn, #acctBtn, #dailyBtn, #skipBtn,
.ik-card, .ik-ta, .ik-sub, .ik-pachip, .daily-share, .daily-hook,
.sheet input, .sheet-codebtn, .share-actions button, .row input, #micBtn,
.detail-btn, .rseg, #rask .row input, .cut-btn, .orient-item,
.cal-nav .mv, .cal-cell, .cal-badge .bi, .hall-btn, .hall-x, .zoom-x, .pg-x {
  background: var(--paper); border-color: var(--line);
}
.intake { background: radial-gradient(120% 70% at 50% 0%, var(--pa-deep), transparent 70%), var(--abyss-0); padding-top: max(64px, calc(env(safe-area-inset-top) + 55px)); }
.ik-card.sel, .ik-card:active, .ik-parow.sel { background: var(--petal); border-color: #b49ac6; }
.ik-padrop, .sheet { background: var(--paper); border-color: var(--line); box-shadow: 0 16px 60px #6a517323; }
.sheet-mask { background: #55415d55; }
.sheet-hint { color: #a45a5b; }
.sheet { max-height: 94dvh; overflow-y: auto; }
.sheet-submit, .sheet-submit.ghost, .ik-go, .gbtn, .row button, #rask .row button,
.cut-btn.go, .share-actions #shareSys, .rseg b.on, .detail-btn.on,
.hall-btn.solid, .cal-hallbtn.letter, .pg-go {
  color: #fffdfa; background: #8d72a2; border-color: transparent; box-shadow: 0 6px 22px #846a9826;
}
.sheet-submit.ghost, .gbtn.dim { background: var(--petal); color: var(--gold-hi); border: 1px solid var(--line); }
.sheet-submit:disabled, .ik-go:disabled { opacity: .45; }
.chips button, .chip, .hist-tabs b, .cal-hallbtn { border-color: var(--line); background: var(--petal); color: var(--gold-hi); }
.sheet-fine, .fine { color: var(--mist); }
.msg.bot .bx, .msg.bot.key .bx, #rtext .qlu, #readbox { background: #fffdf9eb; border-color: var(--line); }
.msg.me .bx, #rtext .qme { background: var(--petal); border-color: var(--line); }
#readbox { box-shadow: 0 8px 30px #7659820c; }
.soul-box, .acct-stats .cell, .daily-col, .daily-color, .share-tabs button,
#dailyReflect, .soul-set input, .soul-set button { background: var(--paper); border-color: var(--line); }
.share-tabs button.on { background: var(--petal); border-color: #b49ac6; }
.acct-avatar { background: #b49ac6; color: #fffdfa; }
.acct-sheet .sheet-submit.logout { background: #f8ecec; color: #a45a5b; border-color: #e5c6c6; }
.soul-set input { color-scheme: light; }
.daily-tone .t-good { background: #e6efe7; color: #507258; }
.daily-tone .t-neutral { background: var(--petal); color: var(--gold-hi); }
.daily-tone .t-hard { background: #f8ecec; color: #a45a5b; }
.upg-moon::after { background: var(--paper); }
.cal-cell.got { background: var(--petal); }
.hall-mask, .pg-mask, .pg-slide { background: radial-gradient(100% 80% at 50% 20%, var(--pa-deep), transparent 70%), var(--abyss-0); }
.hall-hint { text-shadow: none; }
.pg-quote { color: var(--gold-hi); }
.zoom-mask { background: #faf7f2f0; }

/* 同一副牌、同一套洗切翻牌动画，换为淡紫牌背。 */
.flycard, .mini.filled .mc, #bigcard .face.back, .fan .fc,
.dflip .dface.back, .pcard .pc, .cut-half { background-image: url("back-lilac.svg"); }
.shuffle .sc { background: url("back-lilac.svg") center/cover; border-color: #b49ac6; box-shadow: 0 10px 26px #694f7c36; }
.shuffle .sc::after { color: transparent; text-shadow: none; }
.fan .fc { box-shadow: -4px 2px 12px #5d456b40; }
.fan .fc::after { color: #694f7b; text-shadow: 0 1px 4px #fff; }
.fan .fc.lift, .fan .fc:active { filter: brightness(1.06); box-shadow: 0 0 22px #ac8acb80, -4px 2px 12px #5d456b40; }
.cut-mask { background: radial-gradient(120% 80% at 50% 30%, #eee5f3f0, #faf7f2f7); }
.cut-half { border-color: #b49ac6; box-shadow: 2px 3px 0 #cdbed8, 4px 6px 0 #d6c9df, 6px 9px 0 #e2d8e8, 7px 11px 16px #60477338; }
.cut-glow { background: radial-gradient(circle, #b39ac766, transparent 65%); }
.dflip .dface, .pcard .pc, .cardthumb, .flycard { box-shadow: 0 10px 30px #694f7c35; }
.fanhint { bottom: calc(20vh + 195px); color: var(--gold-hi); font-size: 12px; letter-spacing: .12em; }
@media (min-width: 761px) {
  #viewRead { padding-inline: max(24px, calc((100vw - 720px) / 2)); }
  #viewChat #feed { padding-inline: max(24px, calc((100vw - 720px) / 2)); }
  .sheet-mask { align-items: center; }
  .sheet { border-bottom: 1px solid var(--line); border-radius: 22px; }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .home-shell { padding-inline: 36px; }
  .home-copy { padding-left: 0; }
  .home-header nav { gap: 16px; }
  .home-topic-list b { display: none; }
}
@media (max-width: 760px) {
  .home-shell { max-width: 560px; padding-inline: 24px; }
  .home-header { height: 83px; gap: 12px; }
  .home-wordmark { gap: 8px; }
  .home-moon { font-size: 32px; }
  #intro .cn { font-size: 18px; }
  .home-wordmark small { font-size: 6px; letter-spacing: .12em; }
  .home-header nav { gap: 12px; }
  .home-header button { font-size: 10px; }
  .home-header [data-home-daily] { display: none; }
  .home-hero { display: flex; flex-direction: column; gap: 0; padding: 35px 0 32px; min-height: 0; text-align: center; }
  .home-copy { display: contents; }
  .home-eyebrow { font-size: 7px; }
  .home-hero > .home-copy > .home-eyebrow, .home-status { order: 0; }
  .home-hero h1 { order: 1; font-size: clamp(32px, 10vw, 39px); line-height: 1.4; margin: 17px 0 14px; }
  .home-description { order: 2; font-size: 12px; line-height: 1.9; letter-spacing: .02em; }
  .home-art { order: 3; max-width: 340px; height: 265px; margin: 8px auto 0; }
  .home-art img { height: 248px; }
  .home-art figcaption { font-size: 6px; margin-top: 0; }
  .home-actions { order: 4; width: 100%; max-width: 330px; margin-top: 16px; }
  .home-actions p { font-size: 9px; margin-top: 12px; }
  #intro .home-signature { display: none; }
  .home-daily { padding: 20px 16px; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
  .home-daily img { width: 35px; height: 58px; }
  .home-daily strong { font-size: 16px; line-height: 1.6; }
  .home-daily small { font-size: 10px; margin-top: 7px; }
  .home-daily-action { margin: 0 0 0 51px; font-size: 11px; }
  .home-topics { margin-top: 43px; }
  .home-topics h2 { font-size: 22px; margin: 13px 0 20px; }
  .home-topic-list { display: block; }
  .home-topic-list button, .home-topic-list button + button { width: 100%; padding: 23px 0; border-left: 0; gap: 19px; align-items: center; }
  .home-topic-list button + button { border-top: 1px solid var(--line); }
  .home-topic-list small { font-size: 11px; margin-top: 7px; }
  .home-closing { font-size: 14px; padding: 43px 0 35px; }
  .home-footer { flex-direction: column; text-align: center; gap: 12px; font-size: 9px; }
  .fanhint { max-width: 92vw; text-align: center; white-space: normal; line-height: 1.8; }
  #rswitch { top: calc(56px + env(safe-area-inset-top)); }
  body.in-session #viewRead { padding-top: calc(104px + env(safe-area-inset-top)); }
  body.in-session #viewChat #feed { padding-top: calc(106px + env(safe-area-inset-top)); }
}
@media (prefers-reduced-motion: reduce) { .home-art img { animation: none; } }

/* 六位月下伙伴：同一张透明立绘用于角色卡、介绍和头像。 */
.home-companions { margin-top: 62px; }
.home-companions h2 { font: 400 26px/1.5 var(--serif); margin: 15px 0 10px; }
.companion-intro { color: var(--mist); font-size: 12px; line-height: 1.8; margin-bottom: 25px; }
.companion-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.companion-card { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 14px 10px 17px; color: var(--silver); background: var(--paper); border: 1px solid var(--line); border-radius: 20px; transition: transform .2s, box-shadow .2s; }
.companion-art { display: block; width: 100%; aspect-ratio: .9; border-radius: 14px; background: radial-gradient(ellipse, var(--companion-bg), transparent 72%); }
.companion-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.companion-card strong { margin-top: 12px; font: 20px var(--serif); }
.companion-form { font-size: 10px; color: var(--mist); margin-top: 8px; }
.companion-state { color: var(--gold); font-size: 10px; margin-top: 18px; }
.companion-card.selected { border-color: #a88db9; box-shadow: 0 0 0 2px #a88db91a; }
.companion-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px #76598214; }
.portrait-avatar { position: relative; display: inline-block; width: 36px; height: 36px; border-radius: 50%; flex: none; overflow: hidden; background: var(--avatar-bg, var(--petal)); }
.portrait-avatar img { position: absolute; width: 185%; height: 185%; max-width: none; left: -42.5%; top: -15%; object-fit: contain; }
.msg .av.character-av { background: none; box-shadow: none; }
.msg .av.character-av::after { display: none; }
.msg .av .portrait-avatar { width: 100%; height: 100%; }
.ik-pachip .portrait-avatar { width: 28px; height: 28px; }
.ik-parow { width: 100%; background: transparent; border: 0; text-align: left; font-family: var(--serif); }
.ik-parow .nm, .ik-parow .tg { display: block; }
.ik-portrait { width: 62px; height: 62px; border: 2px solid var(--paper); box-shadow: 0 5px 15px #76598214; }
.ik-guide-name { color: var(--pa-accent); font-size: 12px; letter-spacing: .12em; margin-bottom: 8px; }
.reading-persona { display: flex; gap: 9px; align-items: center; min-width: 0; }
.reading-persona .portrait-avatar { width: 30px; height: 30px; }
.reading-persona .rh { margin: 0; }
.pg-heading { position: absolute; top: calc(24px + env(safe-area-inset-top)); left: 28px; z-index: 3; font: 14px var(--serif); color: var(--gold-hi); }
.pg-heading span { display: block; font: 7px var(--sans); letter-spacing: .18em; margin-top: 6px; color: var(--mist); }
.pg-slide { justify-content: center; overflow-y: auto; padding-top: calc(76px + env(safe-area-inset-top)); background: radial-gradient(ellipse at 35% 40%, var(--pg-surface), transparent 70%), var(--abyss-0); }
.pg-art { flex: none; width: min(75vw, 330px); height: min(34dvh, 330px); margin-bottom: 22px; }
.pg-art img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; mask-image: none; -webkit-mask-image: none; }
.pg-art [hidden] { display: none !important; }
.pg-art .halo { width: 110%; opacity: .4; }
.pg-form { font: 11px var(--sans); letter-spacing: .1em; color: var(--mist); }
.pg-name { color: var(--silver); font-size: 34px; margin-top: 12px; }
.pg-name small { letter-spacing: .12em; }
.pg-quote { color: var(--gold-hi); }
.pg-go { letter-spacing: .1em; text-indent: 0; }
.pg-go.cur { border-color: var(--line); color: var(--gold-hi); }
.pg-dots { z-index: 3; pointer-events: auto; gap: 0; bottom: calc(12px + env(safe-area-inset-bottom)); }
.pg-dots button { width: 36px; height: 44px; display: grid; place-items: center; background: transparent; border: 0; padding: 0; cursor: pointer; }
.pg-dots button::after { content: ""; display: block; width: 6px; height: 6px; border-radius: 9px; background: #cdbed8; transition: width .2s; }
.pg-dots button.on::after { width: 18px; background: var(--gold); }
.pg-nav { position: absolute; z-index: 4; top: 48%; width: 44px; height: 44px; border-radius: 50%; background: #fffdf9c9; border: 1px solid var(--line); color: var(--gold-hi); font: 26px Georgia, serif; cursor: pointer; }
.pg-prev { left: 22px; }
.pg-next { right: 22px; }
.pg-nav:disabled { opacity: .25; cursor: default; }
@media (min-width: 900px) {
  .pg-slide { flex-direction: row; gap: 72px; padding-inline: 80px; }
  .pg-art { width: min(40vw, 440px); height: min(65dvh, 440px); margin-bottom: 0; }
  .pg-info { text-align: left; max-width: 360px; }
  .pg-name { font-size: 44px; }
  .pg-intro { margin-top: 26px; line-height: 2.1; }
  .pg-quote { margin-top: 24px; }
  .pg-go { margin-top: 30px; }
}
@media (max-width: 760px) {
  .home-companions { margin-top: 43px; }
  .home-companions h2 { font-size: 22px; }
  .companion-intro { font-size: 11px; margin-bottom: 20px; }
  .companion-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .companion-card { padding: 10px 6px 13px; border-radius: 15px; }
  .companion-card strong { font-size: 17px; margin-top: 9px; }
  .companion-form, .companion-state { font-size: 9px; }
  .companion-state { margin-top: 12px; }
  .pg-heading { left: 22px; }
  .pg-slide { justify-content: flex-start; padding-inline: 26px; padding-bottom: 90px; }
  .pg-nav { top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .pg-prev { left: max(12px, calc(50% - 156px)); }
  .pg-next { right: max(12px, calc(50% - 156px)); }
  .pg-dots { left: 52px; right: 52px; background: #faf7f2e6; border-radius: 22px; }
  .pg-info { max-width: 330px; }
  .pg-intro { font-size: 13px; margin-top: 14px; }
}
@media (prefers-reduced-motion: reduce) { .companion-card { transition: none; } .companion-card:hover { transform: none; } }
