:root {
  --ink: #f5f0e5;
  --muted: #aaa9a8;
  --deep: #090e18;
  --panel: #151b29;
  --panel-2: #20283a;
  --line: rgba(226, 213, 179, 0.16);
  --red: #a84f48;
  --red-soft: #d98570;
  --gold: #d8b874;
  --cream: #eee1c6;
  --moon: #dce4d6;
  --jade: #8da89b;
}

* { box-sizing: border-box; }
html { background: var(--deep); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 4%, rgba(216, 184, 116, 0.18), transparent 17rem),
    radial-gradient(circle at 8% 32%, rgba(98, 125, 139, 0.14), transparent 24rem),
    radial-gradient(circle at 55% 100%, rgba(168, 79, 72, 0.12), transparent 30rem),
    linear-gradient(150deg, #0b1220 0%, #090e18 54%, #17131a 100%);
  background-attachment: fixed;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .24;
  background-image:
    radial-gradient(circle, rgba(238, 225, 198, .8) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(216, 184, 116, .45) 0 1px, transparent 1.5px);
  background-size: 83px 97px, 137px 151px;
  background-position: 16px 20px, 48px 72px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 78%);
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}
body::after {
  content: "";
  position: fixed;
  width: min(42vw, 27rem);
  height: min(60vw, 38rem);
  right: -2rem;
  bottom: 1rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 620'%3E%3Cg fill='none' stroke='%23d8b874' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='310' cy='78' r='48' stroke-width='2' opacity='.46'/%3E%3Ccircle cx='310' cy='78' r='70' stroke-width='1' opacity='.22'/%3E%3Cpath d='M142 190h166M162 190v35m28-35v35m68-35v35m28-35v35M132 190l94-54 94 54M167 171l59-35 59 35M151 225h178' stroke-width='3' opacity='.5'/%3E%3Cpath d='M119 226c34-12 62-11 91 6 27-17 56-17 84 0 29-19 66-16 96 8' stroke-width='4' opacity='.42'/%3E%3Ccircle cx='244' cy='263' r='18' stroke-width='4' opacity='.72'/%3E%3Cpath d='M232 282c-14 33-13 66 4 97 14 27 20 55 15 84' stroke-width='5' opacity='.7'/%3E%3Cpath d='M227 300c-34-24-61-27-86-10 25 8 43 22 57 42M261 300c38-22 67-18 89 7-28 3-48 14-66 35' stroke-width='5' opacity='.68'/%3E%3Cpath d='M231 338c17 19 40 28 69 26 28-2 52-14 70-36M233 350c-29 21-51 46-65 77M289 352c34 12 62 32 82 60' stroke-width='5' opacity='.68'/%3E%3Cpath d='M249 462c-22 31-36 60-42 90M286 460c14 31 22 62 20 94' stroke-width='5' opacity='.64'/%3E%3Cpath d='M178 521c-25 18-30 42-12 58 16 15 39 7 45-11 7-19-8-35-20-43-12-8-13-21-1-35M191 491c5 13 16 18 25 11' stroke-width='4' opacity='.62'/%3E%3Cpath d='M24 512c49-37 92-34 128 2 31-50 90-49 122-8 38-46 101-35 126 10' stroke-width='5' opacity='.5'/%3E%3Cpath d='M52 564c60-25 117-23 171 4 63-29 122-29 181 1' stroke-width='3' opacity='.34'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0;
  filter: none;
  pointer-events: none;
}
/* 用户提供的月下宫殿图：作为祝眠界面的主背景 */
body::after {
  inset: 0;
  width: auto;
  height: auto;
  right: auto;
  bottom: auto;
  background: url("assets/watermarks/moon-palace-bg.jpg") center top / cover no-repeat;
  opacity: .62;
  mix-blend-mode: normal;
  filter: saturate(.68) brightness(.58) contrast(.92);
  z-index: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
.scene-art { position: fixed; right: -1rem; top: 4rem; width: min(58vw, 520px); height: auto; color: #d8b874; opacity: .58; pointer-events: none; z-index: 0; filter: drop-shadow(0 0 22px rgba(216,184,116,.2)); transform-box: fill-box; transform-origin: 78% 46%; animation: sceneFloat 15s ease-in-out infinite; }
.scene-art .moon-line { transform-box: fill-box; transform-origin: center; animation: moonGlow 7s ease-in-out infinite; }
.scene-art .cloud-line { transform-box: fill-box; transform-origin: center; animation: cloudDrift 11s ease-in-out infinite; }
@keyframes sceneFloat { 0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); } 50% { transform: translate3d(-9px, -8px, 0) rotate(-.6deg); } }
@keyframes moonGlow { 50% { opacity: 1; filter: drop-shadow(0 0 10px rgba(238,225,198,.8)); } }
@keyframes cloudDrift { 50% { transform: translateX(-14px); opacity: .92; } }
.app-shell { width: min(100%, 760px); margin: 0 auto; padding: 22px 18px 40px; position: relative; z-index: 1; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-mark { display: flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; }
.site-nav {
  display: flex; gap: 4px; align-items: center; margin-top: 14px; padding: 6px;
  overflow-x: auto; white-space: nowrap; scrollbar-width: thin;
  border: 1px solid rgba(216,184,116,.18); border-radius: 13px;
  background: rgba(10, 15, 24, .62); backdrop-filter: blur(12px);
}
.site-nav a {
  flex: 0 0 auto; color: #aaa9a8; text-decoration: none; border-radius: 9px;
  padding: 7px 9px; font-size: 11px; transition: .2s ease;
}
.site-nav a:hover, .site-nav a[aria-current="page"] {
  color: var(--ink); background: rgba(216,184,116,.14);
}
.site-nav a[aria-current="page"] { box-shadow: inset 0 0 0 1px rgba(216,184,116,.28); }
.brand-logo { width: 68px; height: 68px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 0 14px rgba(216,184,116,.18)); }
.brand-seal {
  display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(216,184,116,.72);
  border-radius: 50%; color: var(--moon); font-family: serif; font-size: 22px;
  background: radial-gradient(circle at 35% 30%, rgba(238,225,198,.22), transparent 48%), rgba(15,24,36,.62);
  box-shadow: 0 0 0 5px rgba(216,184,116,.045), 0 0 28px rgba(216,184,116,.2);
}
.brand-mark strong { display: block; font-family: serif; letter-spacing: .12em; font-size: 18px; }
.brand-mark small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .05em; margin-top: 2px; }
.ghost-button { color: var(--gold); border: 1px solid rgba(216,184,116,.44); background: rgba(216,184,116,.045); border-radius: 99px; padding: 7px 11px; font-size: 12px; }
.hero { padding: 54px 3px 34px; position: relative; }
.hero::after {
  content: "☽";
  position: absolute;
  right: 5%;
  top: 20px;
  color: rgba(238, 225, 198, .72);
  font-family: Georgia, serif;
  font-size: 72px;
  line-height: 1;
  transform: rotate(-18deg);
  text-shadow: 0 0 28px rgba(216, 184, 116, .28);
}
.eyebrow, .section-label { color: var(--gold); font-size: 11px; letter-spacing: .2em; }
.hero h1 { font-family: serif; font-weight: 400; font-size: clamp(38px, 9vw, 66px); line-height: 1.12; letter-spacing: .02em; margin: 14px 0 16px; }
.hero h1 em { color: var(--red-soft); font-style: normal; }
.hero p { margin: 0; color: #c1bcb3; line-height: 1.8; font-size: 15px; }
.player-card, .culture-card, .student-card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(24, 31, 47, .92), rgba(15, 20, 32, .9)); border-radius: 22px; box-shadow: 0 22px 70px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.035); backdrop-filter: blur(10px); }
.player-card { padding: 22px; }
.culture-card, .student-card { margin-top: 15px; padding: 20px; }
.card-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.card-heading.compact { align-items: center; }
h2 { margin: 8px 0 0; font-family: serif; font-size: 24px; font-weight: 400; letter-spacing: .03em; }
.orb { width: 50px; height: 50px; border-radius: 50%; padding: 8px; border: 1px solid rgba(216,184,116,.52); box-shadow: inset 0 0 20px rgba(216,184,116,.14), 0 0 22px rgba(216,184,116,.1); }
.orb span { display: block; width: 100%; height: 100%; border-radius: inherit; background: radial-gradient(circle at 34% 30%, #fff5d8 0 9%, #d8b874 27%, #8a6258 58%, #23354a 100%); opacity: .82; }
.orb.playing span { animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.72); opacity: .38; } }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 24px 0 16px; }
.mode { display: flex; gap: 9px; align-items: center; text-align: left; border: 1px solid rgba(226,213,179,.13); color: var(--ink); background: rgba(12,19,31,.62); border-radius: 14px; padding: 12px 10px; min-height: 66px; transition: .2s ease; }
.more-modes { margin: 8px 0 16px; border-top: 1px solid rgba(226,213,179,.12); border-bottom: 1px solid rgba(226,213,179,.12); }
.more-modes summary { display: flex; align-items: center; gap: 8px; padding: 13px 2px; color: var(--gold); cursor: pointer; list-style: none; font-size: 12px; }
.more-modes summary::-webkit-details-marker { display: none; }
.more-modes summary::before { content: "+"; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid rgba(216,184,116,.42); border-radius: 50%; font-size: 16px; line-height: 1; }
.more-modes[open] summary::before { content: "–"; }
.more-modes summary span { margin-left: auto; color: var(--muted); font-size: 11px; }
.extra-mode-grid { margin: 0 0 14px; }
.extra-mode-grid .mode { min-height: 58px; }
.mode:hover, .mode.active { border-color: var(--gold); background: linear-gradient(135deg, rgba(216,184,116,.16), rgba(168,79,72,.13)); box-shadow: inset 0 0 0 1px rgba(216,184,116,.08), 0 8px 22px rgba(0,0,0,.16); }
.mode-icon { color: var(--gold); font-size: 18px; min-width: 27px; text-align: center; text-shadow: 0 0 14px rgba(216,184,116,.24); }
.mode[data-mode="tone"] .mode-icon { font-size: 10px; letter-spacing: -.04em; }
.mode b, .mode small { display: block; }
.mode b { font-size: 14px; font-weight: 500; }
.mode small { font-size: 11px; color: var(--muted); margin-top: 4px; }
.music-note { margin: -5px 0 14px; color: #88847c; font-size: 11px; line-height: 1.5; }
.voice-strip { display: flex; gap: 12px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.voice-avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; background: var(--cream); color: #40241d; font-family: serif; font-size: 12px; }
.voice-copy { flex: 1; min-width: 0; }
.voice-copy b, .voice-copy span { display: block; }
.voice-copy b { font-size: 14px; }
.voice-copy span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.tiny-button, .secondary-button { border: 1px solid rgba(216,184,116,.5); background: rgba(216,184,116,.035); color: var(--gold); border-radius: 99px; padding: 8px 12px; font-size: 12px; white-space: nowrap; }
.voice-text { margin: 12px 0 2px; color: #c8c1b6; background: rgba(255,255,255,.035); padding: 11px 13px; border-radius: 10px; line-height: 1.65; font-size: 13px; }
.control-row { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.control-row select, .birth-row input { border: 1px solid var(--line); background: #11151b; color: var(--ink); border-radius: 9px; padding: 8px 10px; outline: none; }
.control-row select:focus, .birth-row input:focus { border-color: var(--red-soft); }
.volume-label { margin-left: auto; }
input[type="range"] { accent-color: var(--red-soft); width: 116px; }
.volume-note, .fine-print { color: #88847c; font-size: 11px; line-height: 1.6; }
.volume-note { margin: 9px 0 18px; }
.primary-button { display: flex; justify-content: center; align-items: center; gap: 10px; width: 100%; border: 1px solid rgba(238,225,198,.16); border-radius: 13px; padding: 15px; color: #fff5ea; background: linear-gradient(135deg, #b96553, #754049 58%, #3d4057); box-shadow: 0 12px 30px rgba(100,43,43,.3), inset 0 1px 0 rgba(255,255,255,.13); font-size: 15px; letter-spacing: .08em; }
.primary-button:hover { filter: brightness(1.08); }
.primary-button.playing { background: #3a2726; border: 1px solid rgba(223,118,100,.6); }
.timer-status { text-align: center; color: var(--muted); font-size: 12px; margin-top: 12px; min-height: 18px; }
.tag { color: var(--muted); border: 1px solid var(--line); padding: 5px 8px; border-radius: 99px; font-size: 11px; }
.birth-row { display: flex; align-items: center; gap: 9px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.birth-row input { width: 118px; }
.nayin-result { margin-top: 14px; padding: 15px; border-radius: 13px; background: linear-gradient(135deg, rgba(216,184,116,.16), rgba(141,168,155,.08) 52%, rgba(168,79,72,.12)); border: 1px solid rgba(216,184,116,.3); box-shadow: inset 0 0 28px rgba(216,184,116,.035); }
.nayin-result .result-title { color: var(--gold); font-size: 12px; }
.nayin-result strong { display: block; font-family: serif; font-size: 25px; font-weight: 400; margin: 6px 0; }
.nayin-result span { color: #b9b2a7; font-size: 12px; }
.culture-intro { margin: 14px 0 0; color: #b9b2a7; font-size: 13px; line-height: 1.7; }
.gender-inputs { display: flex; align-items: center; gap: 12px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.gender-inputs label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.gender-inputs input[type="radio"] { accent-color: var(--red-soft); }
.birth-inputs { display: grid; grid-template-columns: 1.35fr .8fr .8fr; gap: 9px; margin-top: 12px; }
.birth-field, .time-field { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.birth-field label, .time-field label { white-space: nowrap; }
.birth-field input, .time-field input { width: 100%; min-width: 0; border: 1px solid var(--line); background: #11151b; color: var(--ink); border-radius: 9px; padding: 9px 10px; outline: none; }
.birth-field input:focus, .time-field input:focus { border-color: var(--red-soft); }
.birth-field input::placeholder, .time-field input::placeholder { color: #68655f; }
.time-inputs { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.input-caption { margin-right: 2px; }
.time-field { width: 92px; }
.time-separator { color: var(--gold); font-size: 18px; }
.input-hint { margin-left: 4px; color: #77736c; font-size: 11px; }
.birth-grid { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 9px; align-items: center; margin-top: 18px; color: var(--muted); font-size: 13px; }
.birth-grid input { min-width: 0; border: 1px solid var(--line); background: #11151b; color: var(--ink); border-radius: 9px; padding: 8px 10px; outline: none; }
.birth-grid input:focus { border-color: var(--red-soft); }
.birth-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.text-button { border: 0; background: transparent; color: var(--muted); padding: 8px 4px; font-size: 12px; }
.result-reason, .result-note { color: #b9b2a7; font-size: 12px; line-height: 1.7; margin: 8px 0 0; }
.assessment-lines { display: grid; gap: 4px; margin-top: 10px; padding: 9px 10px; border-left: 2px solid var(--gold); background: rgba(255,255,255,.035); color: #d2c9bb; font-size: 12px; line-height: 1.6; }
.calculation-details { display: grid; gap: 5px; margin-top: 10px; color: #8f8a82; font-size: 11px; line-height: 1.6; }
.calculation-details summary { color: var(--gold); cursor: pointer; }
.recommend-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.recommend-mode { border: 1px solid rgba(223,118,100,.45); background: transparent; color: #f4d5c9; border-radius: 99px; padding: 7px 10px; font-size: 12px; }
.recommend-mode:hover { background: rgba(185,65,53,.16); }
.student-card { display: flex; gap: 20px; align-items: center; justify-content: space-between; background: linear-gradient(115deg, rgba(91,54,54,.62), rgba(24,38,48,.94)); }
.student-copy h2 { font-size: 21px; }
.student-copy p { color: #aaa29a; font-size: 12px; line-height: 1.6; margin: 8px 0 0; }
.secondary-button.dark { color: #f4d5c9; border-color: rgba(223,118,100,.5); }
footer { padding: 28px 4px 0; color: #77736c; font-size: 11px; line-height: 1.7; display: flex; justify-content: space-between; gap: 20px; }
footer p { margin: 0; }
.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(0,0,0,.72); z-index: 10; }
.modal { position: relative; max-width: 420px; width: 100%; padding: 28px 24px 24px; border: 1px solid var(--line); border-radius: 20px; background: #1a1d23; box-shadow: 0 20px 70px #000; }
.modal h2 { margin-bottom: 12px; }
.modal p { color: #c1bab0; line-height: 1.75; font-size: 14px; }
.modal-note { color: var(--gold) !important; font-size: 12px !important; }
.modal-close { position: absolute; right: 14px; top: 10px; border: 0; background: transparent; color: var(--muted); font-size: 25px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .scene-art, .scene-art * { animation: none !important; } }
@media (max-width: 520px) {
  .app-shell { padding-left: 14px; padding-right: 14px; }
  .brand-logo { width: 56px; height: 56px; }
  .brand-mark { gap: 6px; }
  .hero { padding-top: 45px; }
  .hero::after { right: 0; top: 8px; font-size: 52px; opacity: .58; }
  .scene-art { width: 92vw; right: -24vw; top: 6rem; opacity: .44; }
  .player-card, .culture-card, .student-card { border-radius: 18px; }
  .player-card { padding: 18px; }
  .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .mode { padding: 10px 7px; gap: 5px; }
  .mode-icon { min-width: 22px; }
  .mode b { font-size: 13px; }
  .mode small { font-size: 10px; }
  .birth-inputs { grid-template-columns: 1.25fr .85fr .85fr; gap: 6px; }
  .birth-field, .time-field { gap: 4px; font-size: 12px; }
  .birth-field input, .time-field input { padding: 9px 7px; }
  .time-inputs { flex-wrap: wrap; }
  .input-hint { width: 100%; margin-left: 0; }
  .control-row { flex-wrap: wrap; }
  .volume-label { margin-left: 0; }
  input[type="range"] { flex: 1; min-width: 100px; }
  footer { display: block; }
  footer p + p { margin-top: 4px; }
}

.seo-context { margin-top: 18px; padding: 18px 20px; border: 1px solid rgba(216,184,116,.18); border-radius: 16px; background: rgba(19,23,29,.72); }
.seo-context h2 { margin: 7px 0 9px; font-family: serif; font-size: 20px; font-weight: 400; color: #efe4d1; }
.seo-context p { margin: 7px 0; color: #aaa39a; font-size: 12px; line-height: 1.75; }
.seo-link { display: inline-block; margin-top: 5px; color: var(--gold); font-size: 12px; text-decoration: none; border-bottom: 1px solid rgba(216,184,116,.45); padding-bottom: 2px; }

.back-home { color: var(--gold); font-size: 12px; text-decoration: none; border-bottom: 1px solid rgba(216,184,116,.38); padding-bottom: 3px; margin-left: auto; margin-right: 14px; white-space: nowrap; }
.back-home:hover { color: #f1d49b; border-color: var(--gold); }
@media (max-width: 520px) { .back-home { font-size: 11px; margin-right: 8px; } }
