:root {
  --night: #0b1526;
  --night-2: #111f35;
  --night-3: #1b2b45;
  --star: #d8b36a;
  --star-soft: #e7cf9b;
  --paper: #f7f3ec;
  --paper-2: #f0e9dd;
  --paper-3: #e7decd;
  --ink: #1f2421;
  --ink-2: #3c423d;
  --muted: #6f6e66;
  --line: #ddd5c7;
  --line-dark: rgba(216, 179, 106, 0.24);
  --pine: #35544b;
  --clay: #b4685a;
  --danger: #a34a3a;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --shadow: 0 1px 0 rgba(31, 36, 33, 0.04), 0 10px 34px rgba(31, 36, 33, 0.06);
  --shadow-soft: 0 1px 0 rgba(31, 36, 33, 0.04), 0 4px 16px rgba(31, 36, 33, 0.05);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --max: 1200px;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-width: 320px;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(216, 179, 106, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(53, 84, 75, 0.06), transparent 55%),
    var(--paper);
  color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.7;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.25; letter-spacing: 0.02em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--star); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--star-soft); color: var(--night); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 10px 16px; background: var(--ink); color: var(--paper); border-radius: var(--r-sm); transition: top .2s var(--ease); }
.skip-link:focus { top: 12px; }

.app { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: min(100% - 40px, var(--max)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 40; height: var(--header-h); background: rgba(247,243,236,.9); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.site-header--night { position: absolute; inset: 0 0 auto 0; background: transparent; border-bottom-color: var(--line-dark); backdrop-filter: none; }
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 20px; letter-spacing: .14em; }
.brand-seal { width: 30px; height: 30px; display: grid; place-items: center; background: var(--clay); color: #fff8ee; border-radius: 6px; font-size: 17px; line-height: 1; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.site-header--night .brand { color: var(--paper); }
.site-header--night .brand-seal { background: var(--star); color: var(--night); }
.nav { display: flex; align-items: center; gap: 26px; }
.nav-link { position: relative; padding: 6px 0; color: var(--muted); font-size: 14px; letter-spacing: .08em; }
.nav-link:hover, .nav-link.is-active { color: var(--ink); }
.nav-link.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--star); }
.site-header--night .nav-link { color: rgba(247,243,236,.66); }
.site-header--night .nav-link:hover, .site-header--night .nav-link.is-active { color: var(--paper); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.site-header--night .icon-btn { color: var(--paper); }
.site-header--night .icon-btn:hover { background: rgba(255,255,255,.08); }
.main { flex: 1; padding-bottom: 88px; }
.site-footer { border-top: 1px solid var(--line); padding: 34px 0 44px; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.footer-inner a:hover { color: var(--ink); }
.bottom-nav { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 999px; font-size: 14px; font-weight: 500; letter-spacing: .06em; transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #2c332e; }
.btn-star { background: var(--star); color: var(--night); }
.btn-star:hover { background: var(--star-soft); }
.btn-outline { border-color: var(--line); background: transparent; color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--muted); padding-inline: 12px; }
.btn-ghost:hover { color: var(--ink); background: var(--paper-2); }
.btn-night { border-color: var(--line-dark); color: var(--paper); background: rgba(255,255,255,.02); }
.btn-night:hover { border-color: var(--star); color: var(--star-soft); }
.btn-danger { color: var(--danger); border-color: rgba(163,74,58,.3); background: transparent; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn.is-family { color: var(--night); background: rgba(216, 179, 106, 0.28); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); transition: background .2s var(--ease), color .2s var(--ease); }
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn.is-active { color: var(--clay); }

.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; letter-spacing: .08em; background: transparent; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 13px; transition: all .2s var(--ease); }
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(240,233,221,.55); width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 9px 16px; border-radius: 999px; font-size: 13px; letter-spacing: .04em; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-soft); }

.field { display: grid; gap: 7px; }
.field > label, .label { font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.input, .select, .textarea { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(255,255,255,.5); color: var(--ink); font-size: 15px; transition: border-color .2s var(--ease), background .2s var(--ease); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--star); background: #fffdf8; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
.input::placeholder, .textarea::placeholder { color: #a19d92; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.error-text { color: var(--danger); font-size: 13px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 42px; height: 24px; border-radius: 999px; background: var(--paper-3); border: 1px solid var(--line); position: relative; transition: background .2s var(--ease); }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch input:checked + .switch-track { background: var(--pine); border-color: var(--pine); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }

.card { background: rgba(255,253,248,.72); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-soft); }
.panel { background: rgba(255,253,248,.62); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; }
.section { padding: 72px 0; }
.section--tight { padding: 44px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.section-title { font-size: clamp(26px, 3vw, 36px); letter-spacing: .06em; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--clay); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 10px; }
.eyebrow::before { content: ""; width: 20px; height: 1px; background: var(--clay); }
.lede { color: var(--muted); font-size: 15px; line-height: 1.9; max-width: 62ch; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.grow { flex: 1; }
.divider { height: 1px; background: var(--line); border: 0; margin: 22px 0; }

.name-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px; background: rgba(255,253,248,.72); border: 1px solid var(--line); border-radius: var(--r-md); transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease); min-height: 100%; }
.name-card:hover { transform: translateY(-3px); border-color: #cfc4b1; box-shadow: var(--shadow); }
.name-card { scroll-margin-top: calc(var(--header-h) + 12px); }
.name-card.is-target { border-color: var(--star); box-shadow: 0 0 0 3px rgba(216,179,106,.18), var(--shadow); }
.name-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.name-card__name { font-family: var(--serif); font-size: 40px; line-height: 1.15; letter-spacing: .14em; }
.name-card__pinyin { color: var(--muted); font-size: 12px; letter-spacing: .16em; margin-top: 4px; }
.name-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.name-card__story { color: var(--ink-2); font-size: 13px; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.name-card__source { border-top: 1px solid var(--line); padding-top: 11px; color: var(--muted); font-family: var(--serif); font-size: 12px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.name-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.name-card__actions { display: flex; gap: 2px; }
.score { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 48px; }
.score__num { font-family: var(--serif); font-size: 22px; line-height: 1; color: var(--pine); }
.score__label { font-size: 10px; color: var(--muted); letter-spacing: .12em; }
.sister-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: rgba(216,179,106,.14); color: #7d6432; font-size: 10px; letter-spacing: .08em; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 74px 1fr 38px; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
.bar-track { height: 5px; background: var(--paper-3); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--pine), #5f7d70); border-radius: 999px; }
.bar-fill--gold { background: linear-gradient(90deg, var(--star), var(--star-soft)); }

.modal { border: 0; padding: 0; background: transparent; max-width: min(720px, calc(100vw - 28px)); width: 100%; color: var(--ink); }
.modal::backdrop { background: rgba(11,21,38,.55); backdrop-filter: blur(4px); }
.modal-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 30px 80px rgba(11,21,38,.35); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-title { font-family: var(--serif); font-size: 20px; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }
.sheet { margin: auto 0 0; max-width: none; width: 100%; }
.sheet .modal-card { border-radius: 22px 22px 0 0; max-height: 86vh; overflow: auto; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 14px; padding: 11px 18px; background: var(--ink); color: var(--paper); border-radius: 999px; font-size: 13px; box-shadow: 0 18px 40px rgba(11,21,38,.25); animation: toast-in .25s var(--ease); }
.toast button { border: 0; background: transparent; color: var(--star); font-size: 13px; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.skeleton { background: linear-gradient(90deg, rgba(231,222,205,.55) 25%, rgba(240,233,221,.9) 37%, rgba(231,222,205,.55) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.empty { text-align: center; padding: 64px 20px; border: 1px dashed var(--line); border-radius: var(--r-md); color: var(--muted); }
.empty h3 { font-size: 22px; color: var(--ink); margin-bottom: 8px; }
.notice { display: flex; gap: 10px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(240,233,221,.5); color: var(--muted); font-size: 13px; line-height: 1.7; }
.notice--warn { border-color: rgba(180,104,90,.35); background: rgba(180,104,90,.06); color: #7d4a41; }
.notice--good { border-color: rgba(53,84,75,.3); background: rgba(53,84,75,.06); color: var(--pine); }

/* home */
.hero { position: relative; overflow: hidden; background: radial-gradient(900px 520px at 78% 16%, rgba(216,179,106,.16), transparent 60%), radial-gradient(700px 480px at 10% 100%, rgba(53,84,75,.32), transparent 62%), linear-gradient(180deg, #08111f 0%, var(--night) 42%, #0e1a2c 100%); color: var(--paper); min-height: min(78vh, 940px); display: flex; flex-direction: column; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(180deg, transparent, rgba(247,243,236,.98)); pointer-events: none; }
.hero-stars { position: absolute; inset: 0; pointer-events: none; }
.hero-stars .star { position: absolute; border-radius: 50%; background: var(--star-soft); opacity: .6; animation: twinkle 5s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: .25; } 50% { opacity: .95; } }
.hero-constellation { position: absolute; right: 4vw; top: 18vh; width: min(46vw, 620px); opacity: .9; pointer-events: none; }
.hero-inner { position: relative; z-index: 2; padding: 132px 0 92px; display: flex; flex-direction: column; gap: 26px; max-width: 760px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--star-soft); font-size: 11px; letter-spacing: .24em; }
.hero-kicker::before { content: ""; width: 28px; height: 1px; background: var(--star); }
.hero-title { font-size: clamp(38px, 6.4vw, 76px); line-height: 1.18; letter-spacing: .08em; font-weight: 600; text-wrap: balance; }
.hero-title em { font-style: normal; color: var(--star-soft); }
.hero-sub { color: rgba(247,243,236,.7); font-size: 15px; line-height: 1.9; max-width: 640px; }
.family-bar { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 14px; border: 1px solid var(--line-dark); border-radius: 999px; width: fit-content; max-width: 100%; color: rgba(247,243,236,.72); font-size: 12px; letter-spacing: .06em; }
.family-bar strong { color: var(--paper); font-weight: 500; }
.family-bar .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--star); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.hero-note { color: rgba(247,243,236,.45); font-size: 11px; letter-spacing: .08em; }
.hero-scroll { position: absolute; left: 50%; bottom: 22px; z-index: 3; transform: translateX(-50%); color: rgba(247,243,236,.5); font-size: 10px; letter-spacing: .22em; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hero-scroll span { width: 1px; height: 30px; background: linear-gradient(180deg, var(--star), transparent); }
.family-grid, .route-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.route-card { padding: 26px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255,253,248,.55); display: flex; flex-direction: column; gap: 12px; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.route-card:hover { border-color: #cfc4b1; transform: translateY(-2px); }
.route-card__num { font-family: var(--serif); font-size: 12px; color: var(--star); letter-spacing: .2em; }
.route-card h3 { font-size: 24px; }
.route-card p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.route-examples { color: var(--ink-2); font-family: var(--serif); font-size: 15px; letter-spacing: .08em; }
.quote-band { border-block: 1px solid var(--line); background: rgba(240,233,221,.42); padding: 52px 0; }
.quote-band blockquote { margin: 0; text-align: center; font-family: var(--serif); font-size: clamp(20px,2.6vw,30px); line-height: 1.8; letter-spacing: .06em; }
.quote-band footer { margin-top: 12px; text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .16em; }
.stat-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.stat { padding: 18px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat__num { font-family: var(--serif); font-size: 28px; }
.stat__label { color: var(--muted); font-size: 11px; letter-spacing: .12em; }

/* workshop */
.workshop { padding: 36px 0 48px; }
.workshop-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.workshop-title { font-size: clamp(28px,4vw,44px); }
.workshop-sub { color: var(--muted); font-size: 13px; max-width: 60ch; }
.strategy-tabs { margin: 8px 0 20px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 0; border-block: 1px solid var(--line); }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.result-count { color: var(--muted); font-size: 12px; letter-spacing: .06em; }
.quick-picks { margin: 2px 0 0; padding: 14px 16px 15px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255,253,248,.55); scroll-margin-top: calc(var(--header-h) + 10px); }
.quick-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.quick-title { font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: .04em; }
.quick-hint { margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.quick-grid { display: grid; grid-template-columns: repeat(8, minmax(0,1fr)); gap: 6px; }
.quick-tile { display: flex; min-width: 0; min-height: 54px; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px 3px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,253,248,.6); color: var(--ink); transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease); }
.quick-tile:hover, .quick-tile:focus-visible { border-color: var(--star); background: #fffdf8; transform: translateY(-1px); }
.quick-tile__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-size: 17px; line-height: 1.25; letter-spacing: .03em; }
.quick-tile__py { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; line-height: 1.2; letter-spacing: .01em; }
.quick-picks--loading { pointer-events: none; }
.quick-picks--loading .quick-grid .skeleton { display: block; }
.section-split { display: flex; align-items: center; gap: 12px; margin: 24px 0 4px; color: var(--muted); font-size: 10px; letter-spacing: .18em; }
.section-split::before, .section-split::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.result-count strong { color: var(--ink); font-family: var(--serif); font-size: 15px; }
.results-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-top: 20px; }
.load-more { display: flex; justify-content: center; padding: 34px 0 10px; }
.filter-sheet { display: grid; gap: 22px; }
.filter-group { display: grid; gap: 10px; }
.filter-group__title { display: flex; align-items: center; justify-content: space-between; font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.filter-actions { display: flex; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.lookup { margin-top: 22px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255,253,248,.5); display: grid; gap: 12px; }
.lookup-row { display: flex; gap: 10px; }
.lookup-row .input { flex: 1; }
.lookup-result { display: grid; gap: 10px; padding-top: 6px; border-top: 1px dashed var(--line); }
.ai-panel { border: 1px solid rgba(216,179,106,.35); background: radial-gradient(500px 200px at 100% 0%, rgba(216,179,106,.16), transparent 70%), var(--night); color: var(--paper); border-radius: var(--r-md); padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 22px; }
.ai-panel h3 { font-size: 22px; color: var(--paper); }
.ai-panel p { color: rgba(247,243,236,.6); font-size: 12px; max-width: 60ch; }
.ai-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .1em; color: var(--star-soft); }
.ai-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--star); }
.ai-results { margin-top: 18px; display: grid; gap: 14px; }
.ai-result { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255,253,248,.72); display: grid; gap: 8px; }
.ai-result__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ai-result__name { font-family: var(--serif); font-size: 30px; letter-spacing: .1em; }
.ai-badge { font-size: 10px; letter-spacing: .1em; color: var(--clay); border: 1px solid rgba(180,104,90,.35); border-radius: 999px; padding: 2px 8px; }
.ai-badge--ok { color: var(--pine); border-color: rgba(53,84,75,.35); }

/* detail */
.detail-hero { background: radial-gradient(700px 320px at 80% 0%, rgba(216,179,106,.14), transparent 70%), var(--night); color: var(--paper); padding: 48px 0 52px; }
.detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.detail-name { font-size: clamp(52px,8vw,92px); letter-spacing: .18em; line-height: 1.1; }
.detail-pinyin { color: var(--star-soft); font-size: 13px; letter-spacing: .24em; margin-top: 8px; }
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.detail-tags .tag { border-color: var(--line-dark); color: rgba(247,243,236,.68); }
.detail-score { text-align: right; }
.detail-score__num { font-family: var(--serif); font-size: 54px; line-height: 1; color: var(--star-soft); }
.detail-score__label { color: rgba(247,243,236,.5); font-size: 10px; letter-spacing: .2em; }
.sister-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; margin-top: 28px; padding: 18px 20px; border: 1px solid var(--line-dark); border-radius: var(--r-md); }
.sister-node { display: grid; gap: 3px; }
.sister-node__role { color: rgba(247,243,236,.45); font-size: 10px; letter-spacing: .18em; }
.sister-node__name { font-family: var(--serif); font-size: 26px; letter-spacing: .12em; }
.sister-node__pinyin { color: rgba(247,243,236,.55); font-size: 11px; letter-spacing: .16em; }
.sister-link { color: var(--star); font-family: var(--serif); font-size: 12px; letter-spacing: .1em; text-align: center; }
.detail-body { padding: 44px 0 72px; }
.detail-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,1fr); gap: 22px; align-items: start; }
.detail-main, .detail-side { display: grid; gap: 18px; }
.detail-section { display: grid; gap: 14px; }
.detail-section h2 { font-size: 24px; }
.detail-section h3 { font-size: 17px; }
.why-list { display: grid; gap: 10px; }
.why-list li { display: flex; gap: 10px; color: var(--ink-2); font-size: 14px; line-height: 1.8; }
.why-list li::before { content: "·"; color: var(--star); font-size: 22px; line-height: 1.2; }
.char-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.char-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(255,253,248,.5); }
.char-card__char { font-family: var(--serif); font-size: 42px; line-height: 1; }
.char-card__pinyin { color: var(--muted); font-size: 11px; letter-spacing: .16em; margin-top: 4px; }
.char-card p { color: var(--ink-2); font-size: 12px; line-height: 1.8; margin-top: 10px; }
.source-block { padding: 20px; border-left: 2px solid var(--star); background: rgba(240,233,221,.45); }
.source-line { font-family: var(--serif); font-size: 19px; line-height: 1.9; letter-spacing: .04em; }
.source-meta { color: var(--muted); font-size: 12px; margin-top: 8px; letter-spacing: .06em; }
.source-note { color: var(--ink-2); font-size: 12px; margin-top: 10px; line-height: 1.8; }
.story-box { font-family: var(--serif); font-size: 17px; line-height: 2; letter-spacing: .03em; }
.warning-list { display: grid; gap: 6px; color: #7d4a41; font-size: 12px; line-height: 1.7; }
.warning-list li::before { content: "— "; color: var(--clay); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-sticky { position: sticky; top: calc(var(--header-h) + 16px); }

/* favorites / compare / book */
.page-head { padding: 40px 0 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.page-title { font-size: clamp(28px,4vw,44px); }
.fav-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.compare-bar { position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; background: var(--ink); color: var(--paper); border-radius: 999px; box-shadow: 0 18px 44px rgba(11,21,38,.25); margin-top: 22px; }
.compare-bar strong { color: var(--star-soft); }
.archive-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255,253,248,.6); }
.compare-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.compare-table th, .compare-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
.compare-table th { font-family: var(--serif); font-size: 16px; font-weight: 500; }
.compare-table tr:last-child td { border-bottom: 0; }
.compare-table .row-label { color: var(--muted); font-size: 11px; letter-spacing: .08em; white-space: nowrap; }
.compare-name { font-family: var(--serif); font-size: 24px; letter-spacing: .1em; }
.compare-sister { color: var(--muted); }

.book-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; padding-top: 36px; }
.book-pages { display: grid; gap: 24px; max-width: 860px; margin: 0 auto; }
.book-page { position: relative; aspect-ratio: 210 / 297; background: #fffdf8; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 9% 10%; display: flex; flex-direction: column; overflow: hidden; }
.book-page--cover { background: var(--night); color: var(--paper); border-color: var(--night-3); }
.book-page--cover .book-eyebrow { color: var(--star); }
.book-eyebrow { font-size: 10px; letter-spacing: .26em; color: #8f4e44; }
.book-title { font-family: var(--serif); font-size: clamp(30px,5vw,54px); letter-spacing: .1em; line-height: 1.3; margin-top: 16px; }
.book-sub { color: var(--muted); font-size: 13px; line-height: 1.9; margin-top: 10px; }
.book-page--cover .book-sub { color: rgba(247,243,236,.62); }
.book-sisters { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.book-sister { display: grid; gap: 4px; }
.book-sister span { font-size: 10px; letter-spacing: .2em; color: rgba(247,243,236,.72); }
.book-sister strong { font-family: var(--serif); font-size: 30px; letter-spacing: .12em; color: var(--star-soft); }
.book-seal { width: 46px; height: 46px; display: grid; place-items: center; background: var(--clay); color: #fff8ee; border-radius: 8px; font-family: var(--serif); font-size: 24px; }
.book-h2 { font-size: 28px; margin: 12px 0 16px; }
.book-text { font-size: 14px; line-height: 2; color: var(--ink-2); }
.book-quote { font-family: var(--serif); font-size: 18px; line-height: 2; border-left: 2px solid var(--star); padding-left: 16px; margin: 18px 0; }
.book-sign { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); font-size: 11px; line-height: 2; }
.book-letter { font-family: var(--serif); font-size: 16px; line-height: 2.2; white-space: pre-wrap; }

/* settings / about */
.settings-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(280px,1fr); gap: 22px; align-items: start; }
.settings-section { display: grid; gap: 14px; }
.settings-section h2 { font-size: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-grid .field--full { grid-column: 1 / -1; }
.bazi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.bazi-pillar { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); text-align: center; }
.bazi-pillar span { display: block; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.bazi-pillar strong { display: block; font-family: var(--serif); font-size: 24px; margin-top: 4px; }
.wuxing-bars { display: grid; gap: 8px; }
.wuxing-row { display: grid; grid-template-columns: 28px 1fr 34px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.wuxing-track { height: 6px; background: var(--paper-3); border-radius: 999px; overflow: hidden; }
.wuxing-fill { height: 100%; background: var(--star); border-radius: 999px; }
.favorable-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.prose { max-width: 74ch; display: grid; gap: 18px; }
.prose h2 { font-size: 24px; margin-top: 18px; }
.prose p, .prose li { color: var(--ink-2); font-size: 14px; line-height: 1.95; }
.prose ul { display: grid; gap: 8px; }
.prose li::before { content: "· "; color: var(--star); }
.prose a { border-bottom: 1px solid var(--line); }
.prose a:hover { border-color: var(--ink); }
.share-wrap { padding: 44px 0 80px; }
.share-intro { text-align: center; margin-bottom: 28px; }
.share-card { max-width: 620px; margin: 0 auto; padding: 30px; }
.share-name { font-family: var(--serif); font-size: 46px; letter-spacing: .14em; text-align: center; }
.share-pinyin { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: .2em; margin-top: 4px; }
.share-story { font-family: var(--serif); font-size: 16px; line-height: 2; text-align: center; margin-top: 18px; color: var(--ink-2); }

@media (max-width: 1024px) {
  .family-grid, .route-grid, .results-grid, .fav-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-grid, .settings-grid { grid-template-columns: 1fr; }
  .hero-constellation { opacity: .55; width: 58vw; }
}
@media (max-width: 760px) {
  :root { --header-h: 58px; }
  .container { width: min(100% - 28px, var(--max)); }
  .nav { display: none; }
  .main { padding-bottom: 104px; }
  .bottom-nav { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 50; display: grid; grid-template-columns: repeat(5,1fr); gap: 2px; padding: 6px; background: rgba(247,243,236,.94); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 34px rgba(31,36,33,.14); backdrop-filter: blur(16px); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; border-radius: 12px; color: var(--muted); font-size: 10px; letter-spacing: 0; }
  .bottom-nav a span { white-space: nowrap; }
  .bottom-nav a.is-active { color: var(--ink); background: var(--paper-2); }
  .hero { min-height: 680px; }
  .hero-inner { padding: 96px 0 56px; gap: 20px; }
  .hero-scroll { display: none; }
  .family-bar { font-size: 11px; padding: 9px 12px; }
  .family-bar .family-note { display: none; }
  .hero-sub { overflow-wrap: anywhere; }
  .hero-constellation { top: 8vh; right: -12vw; width: 86vw; opacity: .4; }
  .family-grid, .route-grid, .results-grid, .fav-grid, .form-grid, .char-cards { grid-template-columns: 1fr; }
  .workshop { padding: 18px 0 40px; }
  .workshop-head { align-items: center; margin-bottom: 10px; gap: 10px; }
  .workshop-head .eyebrow, .workshop-sub { display: none; }
  .workshop-title { font-size: 28px; }
  .workshop-head .row { gap: 6px; }
  .toolbar { display: none; }
  .strategy-tabs { margin: 2px 0 8px; }
  .quick-picks { padding: 10px 11px 11px; margin: 0; }
  .quick-head { margin-bottom: 8px; }
  .quick-title { font-size: 16px; }
  .quick-hint { display: none; }
  .quick-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; }
  .quick-tile { min-height: 46px; padding: 3px 2px; }
  .quick-tile__name { font-size: 18px; }
  .quick-tile__py { font-size: 8.5px; }
  .section-split { margin: 16px 0 2px; }
  .workshop .results-grid { margin-top: 12px; }
  .stat-row { grid-template-columns: repeat(2,1fr); }
  .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: 0; }
  .sister-pair { grid-template-columns: 1fr 1fr; grid-template-areas: "sis mm" "link link"; gap: 8px 12px; }
  .sister-pair .sister-node:first-child { grid-area: sis; }
  .sister-pair .sister-link { grid-area: link; text-align: left; }
  .sister-pair .sister-node:last-child { grid-area: mm; text-align: right; }
  .sister-node__name { font-size: 22px; }
  .sister-link { font-size: 11px; }
  .detail-top { gap: 14px; }
  .detail-score { text-align: left; }
  .bazi-grid { grid-template-columns: repeat(2,1fr); }
  .lookup-row { flex-direction: column; }
  .ai-panel { align-items: flex-start; }
  .book-page { aspect-ratio: auto; min-height: 560px; padding: 34px 26px; }
  .book-title { font-size: 34px; }
  .compare-bar { border-radius: 18px; }
  .section { padding: 52px 0; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .name-card { padding: 18px; }
  .name-card__name { font-size: 34px; }
  .panel { padding: 18px; }
  .toast { bottom: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* The AI page explicitly opts into its galaxy animation; everything else stays calm. */
  html:not(.allow-ai-motion) *,
  html:not(.allow-ai-motion) *::before,
  html:not(.allow-ai-motion) *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .site-header, .bottom-nav, .site-footer, .book-toolbar, .no-print, .toast, .detail-actions, .compare-bar { display: none !important; }
  .main { padding: 0; }
  .container { width: 100%; max-width: none; }
  .book-pages { max-width: none; gap: 0; }
  .book-page { width: 210mm; height: 297mm; aspect-ratio: auto; border: 0; box-shadow: none; page-break-after: always; break-after: page; padding: 22mm 20mm; }
  .book-page:last-child { page-break-after: auto; break-after: auto; }
  .book-page--cover { background: #0b1526 !important; color: #f7f3ec !important; }
  .book-title { font-size: 42pt; }
  .book-h2 { font-size: 18pt; }
  .book-text, .book-letter { font-size: 11pt; line-height: 1.9; }
  .book-quote { font-size: 13pt; }
}

.ai-page { padding-bottom: 28px; }
.ai-head { padding: 28px 0 8px; }
.ai-launch { margin-top: 18px; display: grid; gap: 14px; max-width: 62ch; }
.ai-brief { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(255, 253, 248, .55); }
.ai-brief label { font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.ai-brief label .small { margin-left: 6px; color: var(--muted); font-weight: 400; }
.ai-brief__text { min-height: 64px; resize: vertical; line-height: 1.6; }
.ai-brief__meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.ai-brief__meta span:last-child { flex: none; font-variant-numeric: tabular-nums; }
.ai-brief__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-brief__chips .chip { min-height: 30px; padding: 0 10px; font-size: 11px; }
.ai-history { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--ink); }
.ai-again { display: grid; gap: 14px; max-width: 62ch; margin: 8px auto 28px; }
.ai-again .btn { justify-self: center; }
.galaxy { position: relative; margin-top: 18px; border-radius: 28px; overflow: hidden; background:
  radial-gradient(520px 280px at 50% 42%, rgba(48, 78, 140, .45), transparent 70%),
  radial-gradient(900px 420px at 50% 0%, #1b3158, transparent 70%),
  linear-gradient(180deg, #050b16 0%, #0b1526 58%, #101828 100%);
  color: var(--paper); }
.galaxy-sky { position: relative; height: 640px; overflow: hidden; }
.galaxy-stars { position: absolute; inset: 0; }
.galaxy-star { position: absolute; border-radius: 50%; background: #f7f3ec; box-shadow: 0 0 6px rgba(231, 207, 155, .8); animation: galaxy-twinkle ease-in-out infinite; }
.milky { position: absolute; left: -18%; right: -18%; top: 34%; height: 168px; transform: rotate(-14deg); overflow: hidden; z-index: 1; mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.milky-band { position: absolute; left: 0; right: 0; top: 28%; height: 44%; background: linear-gradient(90deg, transparent, rgba(150, 176, 230, .22), rgba(243, 226, 176, .42), rgba(150, 176, 230, .2), transparent); filter: blur(16px); animation: milky-pulse 3.6s ease-in-out infinite; }
.milky-stars { display: flex; align-items: center; gap: 22px; width: max-content; height: 100%; animation: milky-run 16s linear infinite; }
.milky-dot { flex: none; border-radius: 50%; background: #f7f3ec; box-shadow: 0 0 6px rgba(231, 207, 155, .7); }
.milky-dot.is-bright { background: #fff; box-shadow: 0 0 10px 2px rgba(243, 226, 176, .95); }
.shoot { position: absolute; width: 110px; height: 2px; background: linear-gradient(90deg, transparent, #fff 45%, #f3e2b0); opacity: 0; z-index: 1; animation: shoot 3.2s ease-in infinite; animation-delay: var(--d); }
.orrery { position: absolute; left: 50%; top: 43%; width: 460px; height: 460px; transform: translate(-50%, -50%); z-index: 2; transition: opacity .35s var(--ease); }
.dial, .season-ring, .pole-ring, .pole-star, .dipper-rotor { position: absolute; inset: 0; }
.dial i { position: absolute; left: 50%; top: 50%; width: 1px; height: 8px; margin-left: -0.5px; background: rgba(231, 207, 155, .5); transform: rotate(var(--a)) translateY(-214px); }
.season-ring span { position: absolute; left: 50%; top: 50%; width: 1.6em; margin: -0.7em 0 0 -0.8em; text-align: center; font-family: var(--serif); font-size: 16px; letter-spacing: .18em; color: var(--star-soft); text-shadow: 0 0 12px rgba(216, 179, 106, .8); transform: rotate(var(--a)) translateY(-196px) rotate(calc(var(--a) * -1)); }
.pole-ring { inset: auto; left: 50%; top: 50%; width: 132px; height: 132px; margin: -66px 0 0 -66px; border: 1px solid rgba(231, 207, 155, .38); border-radius: 50%; box-shadow: 0 0 22px rgba(216, 179, 106, .2); }
.pole-ring--outer { width: 430px; height: 430px; margin: -215px 0 0 -215px; border-style: dashed; border-color: rgba(231, 207, 155, .22); animation: galaxy-turn 48s linear infinite reverse; }
.pole-star { inset: auto; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px 4px #fff, 0 0 32px 10px rgba(170, 200, 255, .85); z-index: 3; }
.pole-star::after { content: "北极"; position: absolute; left: 18px; top: -2px; font-family: var(--serif); font-size: 12px; letter-spacing: .24em; color: rgba(231, 207, 155, .9); white-space: nowrap; }
.dipper-rotor { animation: galaxy-turn 8.8s linear infinite; }
.dipper-sweep { position: absolute; inset: 10px; border-radius: 50%; background: conic-gradient(from 312deg, transparent 0deg, rgba(243, 226, 176, .05) 28deg, rgba(243, 226, 176, .72) 70deg, transparent 92deg, transparent 360deg); mask: radial-gradient(circle, transparent 48%, #000 64%, #000 76%, transparent 84%); }
.dipper-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dipper-lines polyline { fill: none; stroke: rgba(243, 226, 176, .82); stroke-width: .7; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 2px rgba(216, 179, 106, .9)); }
.dipper-star { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #fffaf0; box-shadow: 0 0 8px 2px rgba(243, 226, 176, .95), 0 0 18px rgba(216, 179, 106, .75); }
.dipper-star--tail { width: 11px; height: 11px; margin: -5px 0 0 -5px; box-shadow: 0 0 12px 4px rgba(255, 244, 214, 1), 0 0 28px rgba(216, 179, 106, .9); }
.dipper-star--tail::after { content: ""; position: absolute; right: 10px; top: 4px; width: 42px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(243, 226, 176, .95)); transform: rotate(32deg); }
.born-stage { position: absolute; left: 50%; top: 43%; z-index: 5; width: min(640px, 92%); transform: translate(-50%, -58%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.born-burst { position: absolute; left: 50%; top: 42%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid rgba(255, 244, 214, .9); opacity: 0; }
.born-burst.is-flash { animation: born-ring .9s ease-out; }
.born-name { font-family: var(--serif); font-size: 92px; letter-spacing: .22em; line-height: 1; color: #fffaf0; text-indent: .22em; text-shadow: 0 0 16px rgba(255, 255, 255, .95), 0 0 42px rgba(216, 179, 106, 1), 0 0 90px rgba(120, 160, 255, .55); opacity: 0; }
.born-name.is-in { animation: name-emerge .72s cubic-bezier(.16, .84, .32, 1) both; }
.born-py.is-in { animation: py-emerge .72s cubic-bezier(.16, .84, .32, 1) both; }
.born-name.is-out, .born-py.is-out { animation: name-fly .46s ease-in forwards; }
.born-py { min-height: 1.2em; margin-top: 12px; letter-spacing: .46em; text-indent: .46em; font-size: 14px; color: var(--star-soft); opacity: 0; }
.born-dock { position: absolute; left: 18px; right: 18px; bottom: 48px; z-index: 4; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 28px; }
.born-chip { font-family: var(--serif); letter-spacing: .16em; font-size: 15px; color: var(--paper); border: 1px solid rgba(216, 179, 106, .5); border-radius: 999px; padding: 3px 12px 3px 14px; background: rgba(5, 12, 24, .55); }
.born-chip.is-in { animation: chip-pop .4s var(--ease) both; }
.galaxy-caption { position: absolute; left: 0; right: 0; bottom: 16px; z-index: 4; margin: 0; text-align: center; letter-spacing: .28em; font-size: 13px; color: var(--star-soft); }
.galaxy-names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 8px 18px 22px; }
.galaxy-names:empty { display: none; }
.star-born { position: relative; padding: 18px 18px 14px; border: 1px solid rgba(216, 179, 106, .28); border-radius: 18px; background: rgba(247, 243, 236, .06); display: grid; gap: 6px; }
.star-born.is-emerging { animation: star-pop .7s var(--ease) both; }
.star-born__glow { position: absolute; left: 28px; top: 0; width: 90px; height: 2px; background: linear-gradient(90deg, transparent, var(--star), transparent); opacity: .8; }
.star-born__name { font-family: var(--serif); font-size: 36px; letter-spacing: .18em; line-height: 1.2; }
.star-born__py { color: rgba(231, 207, 155, .8); letter-spacing: .16em; font-size: 12px; }
.star-born__reason { margin: 4px 0 0; color: rgba(247, 243, 236, .82); font-size: 14px; line-height: 1.7; }
.star-born .hint, .star-born .source-meta { color: rgba(247, 243, 236, .62); }
.star-born__actions { justify-content: flex-end; }
.star-born .btn, .star-born .icon-btn { color: var(--star-soft); }
.star-born .btn:hover, .star-born .icon-btn:hover { color: var(--paper); background: rgba(247,243,236,.08); }
.star-born .ai-badge { color: var(--star-soft); border-color: rgba(216,179,106,.45); }
.star-born .ai-badge--ok { color: #d5ecdf; border-color: rgba(213,236,223,.4); }
.galaxy--birthing .orrery { opacity: .22; }
.galaxy--birthing .milky { opacity: .4; }
.galaxy--settled .dipper-rotor { animation-duration: 36s; }
.galaxy--settled .milky-stars { animation-duration: 28s; }
.galaxy--settled .shoot { animation: none; opacity: 0; }
@keyframes galaxy-twinkle {
  0%, 100% { opacity: .25; }
  50% { opacity: 1; }
}
@keyframes galaxy-turn { to { transform: rotate(360deg); } }
@keyframes milky-run { to { transform: translateX(-50%); } }
@keyframes milky-pulse {
  0%, 100% { opacity: .65; }
  50% { opacity: 1; }
}
@keyframes shoot {
  0% { opacity: 0; transform: rotate(22deg) translateX(0); }
  10% { opacity: 1; }
  32% { opacity: 0; transform: rotate(22deg) translateX(220px); }
  100% { opacity: 0; }
}
@keyframes born-ring {
  0% { opacity: 1; transform: scale(.2); box-shadow: 0 0 0 0 rgba(243, 226, 176, .7); }
  100% { opacity: 0; transform: scale(14); box-shadow: 0 0 0 18px rgba(243, 226, 176, 0); }
}
@keyframes name-emerge {
  0% { opacity: 0; transform: scale(.08); filter: blur(16px); letter-spacing: 1.1em; }
  55% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: scale(1); letter-spacing: .22em; }
}
@keyframes py-emerge {
  0% { opacity: 0; transform: scale(.2); filter: blur(8px); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes name-fly {
  from { opacity: 1; transform: none; filter: none; }
  to { opacity: 0; transform: translateY(150px) scale(.22); filter: blur(8px); }
}
@keyframes chip-pop {
  from { opacity: 0; transform: translateY(-28px) scale(.5); }
}
@keyframes star-pop {
  0% { opacity: 0; transform: translateY(-64px) scale(.55); filter: blur(8px); }
  100% { opacity: 1; transform: none; filter: none; }
}
@media (max-width: 760px) {
  .galaxy-sky { height: 540px; }
  .orrery { width: 320px; height: 320px; }
  .dial i { transform: rotate(var(--a)) translateY(-148px); }
  .season-ring span { font-size: 14px; transform: rotate(var(--a)) translateY(-136px) rotate(calc(var(--a) * -1)); }
  .pole-ring--outer { width: 300px; height: 300px; margin: -150px 0 0 -150px; }
  .born-name { font-size: 64px; }
  .galaxy-names { grid-template-columns: 1fr; padding: 4px 12px 16px; }
  .galaxy-caption { letter-spacing: .12em; font-size: 12px; }
  .star-born__name { font-size: 32px; }
}
