:root {
  --text: #6b6375;
  --text-h: #08060d;
  --bg: #fff;
  --border: #e5e4e7;
  --code-bg: #f4f3ec;
  --accent: #aa3bff;
  --accent-bg: rgba(170, 59, 255, 0.1);
  --accent-border: rgba(170, 59, 255, 0.5);
  --social-bg: rgba(244, 243, 236, 0.5);
  --shadow:
    rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;

  --sans: system-ui, 'Segoe UI', Roboto, sans-serif;
  --heading: system-ui, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, Consolas, monospace;

  font: 18px/145% var(--sans);
  letter-spacing: 0.18px;
  color-scheme: light dark;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  @media (max-width: 1024px) {
    font-size: 16px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #9ca3af;
    --text-h: #f3f4f6;
    --bg: #16171d;
    --border: #2e303a;
    --code-bg: #1f2028;
    --accent: #c084fc;
    --accent-bg: rgba(192, 132, 252, 0.15);
    --accent-border: rgba(192, 132, 252, 0.5);
    --social-bg: rgba(47, 48, 58, 0.5);
    --shadow:
      rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
  }

  #social .button-icon {
    filter: invert(1) brightness(2);
  }
}

#root {
  width: 1126px;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  border-inline: 1px solid var(--border);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

body {
  margin: 0;
}

h1,
h2 {
  font-family: var(--heading);
  font-weight: 500;
  color: var(--text-h);
}

h1 {
  font-size: 56px;
  letter-spacing: -1.68px;
  margin: 32px 0;
  @media (max-width: 1024px) {
    font-size: 36px;
    margin: 20px 0;
  }
}
h2 {
  font-size: 24px;
  line-height: 118%;
  letter-spacing: -0.24px;
  margin: 0 0 8px;
  @media (max-width: 1024px) {
    font-size: 20px;
  }
}
p {
  margin: 0;
}

code,
.counter {
  font-family: var(--mono);
  display: inline-flex;
  border-radius: 4px;
  color: var(--text-h);
}

code {
  font-size: 15px;
  line-height: 135%;
  padding: 4px 8px;
  background: var(--code-bg);
}

/* 🛠️ V34 仪式感呼吸灯动画 */
@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.01); }
}

@keyframes skeleton-wave {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* 🛠️ V117: 城市 HUD 渐现动画（坐标/时区专业背书） */
@keyframes hudFadeIn {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}
/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols 2', 'Segoe UI', Roboto, sans-serif; background: transparent; min-height: 100vh; color: #222; }

/* ── Layout ── */
.app { display: flex; justify-content: center; padding: 24px 16px 60px; min-height: 100vh; }
.page { width: 100%; max-width: 420px; position: relative; }

/* ── Language Switcher ── */
.lang-switch { position: absolute; top: 8px; right: 0; background: #fff !important; border: 2px solid #a855f7 !important; border-radius: 20px; padding: 5px 14px; font-size: 12px; cursor: pointer; color: #81D8D0; font-weight: 700; z-index: 9999; }
.lang-switch:hover { background: #ede9fe; border-color: #c084fc !important; box-shadow: 0 0 12px rgba(168,85,247,0.4); }

/* ── Typography ── */
.title { font-size: 26px; font-weight: 800; color: #fff; margin-bottom: 2px; letter-spacing: -0.5px; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.subtitle { font-size: 14px; color: #a855f7; font-weight: 600; margin-bottom: 14px; }
.desc { font-size: 13px; color: #a855f7; line-height: 1.6; margin-bottom: 18px; }

/* ── Input Page ── */
.input-page {
  padding-top: 56px; position: relative; z-index: 2; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  background: transparent; overflow-y: auto;
}
/* Prevent iOS Safari zoom-on-input */
@media screen and (max-width: 500px) {
  .date-part { font-size: 16px !important; }
}

/* ── Background Video ── */
.bg-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

/* Aurora gradient fallback (shown when video fails to load) */
.starfield-fallback {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 20% 50%, #0F0E26 0%, #0A0914 50%, #0A0914 100%);
  background-size: 200% 200%;
}

/* Aurora purple particle glow */
.starfield-fallback::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 30% 40%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(129, 216, 208, 0.02) 0%, transparent 50%);
  animation: aurora-drift 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes aurora-drift {
  0% { transform: translateX(-5%) translateY(-3%); }
  100% { transform: translateX(5%) translateY(3%); }
}


/* Dark overlay for text readability */
.video-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: transparent;
}
/* Cinematic typography over video */
.input-page .title {
  color: #81D8D0; text-shadow: 0 2px 20px rgba(129,216,208,0.4), 0 0 40px rgba(129,216,208,0.15);
  position: relative; z-index: 5; letter-spacing: -0.8px;
}
.input-page .subtitle {
  color: #7c3aed; text-shadow: 0 1px 16px rgba(124,58,237,0.35);
  position: relative; z-index: 5;
}
.input-page .desc {
  color: #FFFFFF; position: relative; z-index: 5;
  font-weight: 500;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
.input-page .date-label { color: #FFFFFF; font-size: 12px; margin-bottom: 2px; font-weight: 700; }
/* ── Form Card — compact & bright glass ── */
.form {
  display: flex; flex-direction: column; gap: 12px;
  width: 100%;
  /* 🛠️ 45-B9：顶部留白对齐框内行距（原 14px ⇒ 与 App.tsx 的 gap 5.6px 一致） */
  padding: 5.6px 14px 12px;
  background: transparent;
  border: 2px solid #0891b2;
  border-radius: 16px;
  box-shadow:
    0 4px 24px rgba(8,145,178,0.15),
    inset 0 1px 0 rgba(255,255,255,0.4);
}
.input { width: 100%; height: 50px; border: 1.5px solid #e0e0e0; border-radius: 12px; padding: 0 16px; font-size: 15px; color: #222; background: #fff; outline: none; transition: border-color 0.2s; }
.input:focus { border-color: #81D8D0; box-shadow: 0 0 0 3px rgba(129,216,208,0.15); }
.input::placeholder { color: #bbb; }

/* ── Manual Date Input — 对齐财富模块：单框内嵌三段透明输入（YYYY / MM / DD） ── */
.date-manual {
  display: flex; align-items: center; gap: 3px;
  width: 100%; padding: 11px 14px; box-sizing: border-box;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(212,175,55,0.3);
  border-radius: 10px;
}
.date-part {
  flex: 1; border: none; background: transparent;
  padding: 0; font-size: 14px; font-weight: 600;
  color: #D4AF37 !important;
  outline: none; text-align: center;
  transition: none;
  -webkit-appearance: none; appearance: none;
  font-family: inherit;
  min-width: 0;
}
.date-part:focus { box-shadow: none; }
.date-part::placeholder { color: #8B8778; }
.date-slash {
  color: #8B8778; font-size: 14px; font-weight: 400;
  user-select: none; flex-shrink: 0;
}

.btn { width: 100%; height: 46px; border: none; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s; letter-spacing: 0.3px; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(0.98); }
/* Brand Blue — no glow, pure & flat */
.btn-primary {
  background: #2ECBF7;
  color: #fff;
  border: none;
  border-radius: 14px;
  margin-top: 24px;
  margin-bottom: 40px;
  position: relative;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.btn-primary:hover, .btn-primary:active {
  background: #4AD8FF;
  box-shadow: 0 3px 12px rgba(0,0,0,0.3);
}
.btn-secondary { background: #fff; color: #81D8D0; border: 2px solid #81D8D0; margin-top: 20px; }
.btn-secondary:hover { background: rgba(129,216,208,0.06); }

/* ── Loading ── */
.loading-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; }
.spinner { width: 44px; height: 44px; border: 3px solid #eee; border-top-color: #81D8D0; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin-top: 18px; color: #999; font-size: 14px; }

/* ── Result Page ── */
.result-page { padding-top: 20px; }

/* Score Ring */
.score-ring { width: 130px; height: 130px; margin: 20px auto 8px; }
.score-ring svg { width: 100%; height: 100%; }

/* Engine Cards */
.engine-cards { display: flex; flex-direction: column; gap: 0; margin: 24px 0; }
.engine-info { display: flex; flex-direction: column; gap: 3px; text-align: left; flex: 1; }
.engine-name { font-size: 13px; font-weight: 600; color: #1A1F4B; }
.engine-summary { font-size: 12px; color: #888; line-height: 1.4; }
.engine-score { font-size: 20px; font-weight: 800; color: #1A1F4B; }

/* AI Insight */
.ai-insight { background: linear-gradient(135deg, #f0f7ff, #faf5ff); border-radius: 14px; padding: 18px; text-align: left; margin-bottom: 18px; border: 1px solid rgba(129,216,208,0.2); }
.ai-insight h3 { font-size: 14px; color: #1A1F4B; margin-bottom: 8px; }
.ai-insight p { font-size: 13px; color: #555; line-height: 1.65; }
/* Dark variant for paywall sections — matches deep space aesthetic */
.ai-insight-dark { background: linear-gradient(170deg, #0e1028 0%, #0a0c1e 40%, #0D0D1A 100%) !important; border: 1px solid rgba(129,216,208,0.12) !important; }
.ai-insight-dark h3 { color: #81D8D0 !important; text-shadow: 0 2px 20px rgba(129,216,208,0.3); }
@keyframes paywallOrbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* AI Insight result — tight paragraph spacing */
.insight-result { text-align: left; }
.insight-result p { font-size: 13px; color: #444; line-height: 1.65; text-align: left; margin: 0; padding: 0 0 6px 0; }
.insight-result p:last-child { padding-bottom: 0; }

/* Aspects Tags */
.aspects { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.aspect-group { text-align: left; }
.aspect-group h4 { font-size: 13px; color: #555; margin-bottom: 8px; }
.tag { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; margin: 0 6px 6px 0; }
.tag-good { background: rgba(129,216,208,0.15); color: #2a8a7a; }
.tag-warn { background: rgba(212,175,55,0.15); color: #b8860b; }

/* Error */
.error-msg { color: #e74c3c; font-size: 13px; marginTop: 12px; }

/* ── Back Button ── */
.back-btn { background: none; border: none; cursor: pointer; color: #81D8D0; font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 16px; }
.back-btn:hover { opacity: 0.7; }

/* ── Score Label ── */
.score-label { text-align: center; font-size: 13px; color: #888; font-weight: 500; margin-bottom: 20px; letter-spacing: 0.5px; }

/* ── Four Dimensions ── */
.dim-section { background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 16px; border: 1px solid #eee; }
.section-title { font-size: 13px; font-weight: 700; color: #1A1F4B; margin-bottom: 14px; }
.dim-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dim-row:last-child { margin-bottom: 0; }
.dim-label { font-size: 12px; color: #1a1a1a; width: 110px; flex-shrink: 0; text-align: left; font-family: 'SimHei', 'Heiti SC', sans-serif; font-weight: 900; }
.dim-bar-bg { flex: 1; height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.dim-bar-fill { height: 100%; background: linear-gradient(90deg, #81D8D0, #5cc5bb); border-radius: 3px; transition: width 1s cubic-bezier(.4,0,.2,1); }
.dim-val { font-size: 13px; font-weight: 700; color: #1A1F4B; width: 26px; text-align: right; }

/* ── Engine Cards (interactive) ── */
.engine-card { background: #fff; border-radius: 14px; border: 1px solid #eee; margin-bottom: 10px; overflow: hidden; }
.engine-card-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; cursor: pointer; user-select: none; }
.engine-card-header:active { background: #fafafa; }
.engine-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.engine-icon { font-size: 20px; flex-shrink: 0; }
.engine-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.chevron { font-size: 20px; color: #ccc; transition: transform 0.2s; display: inline-block; }
.chevron.open { transform: rotate(90deg); color: #81D8D0; }
.engine-detail { padding: 0 16px 16px; border-top: 1px solid #f0f0f0; animation: slideDown 0.2s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.detail-heading { font-size: 12px; font-weight: 700; color: #1A1F4B; margin-top: 12px; margin-bottom: 4px; }
.detail-line { font-size: 12px; color: #555; line-height: 1.65; margin-bottom: 2px; }

/* ── Date Field ── */
.date-field { position: relative; }
.date-label { display: block; font-size: 12px; color: #888; font-weight: 500; margin-bottom: 6px; margin-left: 4px; }

/* ── Date inputs (year/month/day text fields) ── */
.date-selects {
  display: flex; align-items: center; gap: 6px;
}
.date-sep {
  color: rgba(46,203,247,0.5); font-size: 18px; font-weight: 300;
  user-select: none; flex-shrink: 0;
}
.date-sel {
  flex: 1; height: 52px; border: 2px solid #0891b2; border-radius: 12px;
  padding: 0 14px; font-size: 16px; color: #a855f7 !important; background: #fff;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none; appearance: none;
  font-family: inherit; text-align: center; font-weight: 600;
}
.date-sel:focus { border-color: #81D8D0; box-shadow: 0 0 0 3px rgba(129,216,208,0.2); }
.date-sel::placeholder { color: #c4b5fd; }
.date-sel-year { flex: 1.4; min-width: 0; }
.date-sel-month { flex: 0.9; min-width: 0; }
.date-sel-day { flex: 0.9; min-width: 0; }

/* Keep original date-input for any fallback usage */


/* Hide native date picker "Today" / "Clear" buttons (WebKit shadow-DOM hack) */
.date-input::-webkit-datetime-edit-seconds-field,
.date-input::-webkit-datetime-edit-millisecond-field,
.date-input::-webkit-datetime-edit-meridiem-field { display: none; }

/* ── Custom Date Picker (minimalist) ── */
.date-picker-wrapper { position: relative; width: 100%; }
.date-display {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; height: 52px; border: 1.5px solid rgba(255,255,255,0.25); border-radius: 12px;
  padding: 0 16px; background: rgba(255,255,255,0.12); backdrop-filter: blur(10px);
  cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
}
.date-display:hover { border-color: rgba(255,255,255,0.4); }
.date-value { font-size: 15px; color: #fff; letter-spacing: 0.5px; }
.date-placeholder { font-size: 15px; color: rgba(255,255,255,0.45); }
.date-icon { font-size: 18px; opacity: 0.7; }
.date-panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 100;
  background: rgba(13,13,26,0.95); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 16px; padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.date-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.date-title { font-size: 15px; font-weight: 600; color: #fff; }
.date-nav {
  width: 32px; height: 32px; border: none; border-radius: 8px; background: rgba(255,255,255,0.1);
  color: #fff; font-size: 18px; cursor: pointer; transition: background 0.2s;
}
.date-nav:hover { background: rgba(129,216,208,0.3); }
.date-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 8px; }
.date-wd { text-align: center; font-size: 11px; color: rgba(255,255,255,0.5); padding: 4px 0; }
.date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.date-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: rgba(255,255,255,0.8); border-radius: 8px; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.date-cell:hover:not(.empty) { background: rgba(129,216,208,0.25); color: #fff; }
.date-cell.empty { cursor: default; }
.date-cell.selected { background: #81D8D0; color: #1A1F4B; font-weight: 600; }

/* ── AI Insight Loading Skeleton ── */
.insight-skeleton { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.skeleton-line {
  height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.w60 { width: 60%; }
.w80 { width: 80%; }
.w90 { width: 90%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.insight-error { font-size: 12px; color: #aaa; font-style: italic; }
/* 命运之震颤：300ms 高频微调（iOS 密码错误同款） */
@keyframes celestialShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.date-manual.shake {
  animation: celestialShake 0.3s ease-in-out;
}

.date-manual.date-error-border {
  border-color: #E05C5C !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}


@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Language Modal (glassmorphism) ── */
.lang-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 0.2s ease-out;
  align-items: flex-start;
  padding-top: 38px;
}

.lang-modal {
  position: relative;
  width: 280px;
  padding: 28px 0 16px;
  border-radius: 18px;
  background: rgba(26, 31, 75, 0.72);
  border: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55), 0 0 60px rgba(80, 60, 180, 0.18);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  animation: modalSlideUp 0.25s ease-out;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lang-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.lang-modal-close:hover { color: #fff; }

.lang-modal-title {
  text-align: center;
  font-size: 13px;
  color: rgba(212, 175, 55, 0.7);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
  font-family: 'Helvetica Neue', sans-serif;
}

.lang-modal-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
  width: 100%;
}
.lang-modal-option:hover {
  background: rgba(212, 175, 55, 0.1);
  color: #fff;
}

.lang-modal-option-active {
  color: #D4AF37;
  background: rgba(212, 175, 55, 0.08);
}
.lang-modal-option-active:hover {
  background: rgba(212, 175, 55, 0.14);
}

.lang-modal-flag {
  font-size: 22px;
  line-height: 1;
  width: 30px;
  text-align: center;
}

.lang-modal-label {
  flex: 1;
  font-family: 'Helvetica Neue', sans-serif;
  letter-spacing: 0.3px;
}

.lang-modal-check {
  color: #D4AF37;
  font-size: 15px;
  font-weight: 700;
}

/* ── Golden Insight Transition ── */
.golden-transition {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 32px 20px;
  background: linear-gradient(168deg, rgba(26,31,75,0.97) 0%, rgba(18,22,55,0.99) 100%);
  border-radius: 20px;
  border: 1px solid rgba(212,175,55,0.35);
  text-align: center;
  animation: goldenFadeIn 0.6s ease-out;
}
.golden-orb {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, #F0D060 0%, #D4AF37 40%, rgba(212,175,55,0.2) 70%, transparent 100%);
  animation: goldenPulse 1.8s ease-in-out infinite;
  margin-bottom: 20px;
  box-shadow: 0 0 40px rgba(212,175,55,0.4), 0 0 80px rgba(212,175,55,0.15);
}
.golden-title {
  font-size: 17px;
  font-weight: 800;
  color: #D4AF37;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.golden-subtitle {
  font-size: 13px;
  color: #a0a0c0;
  line-height: 1.6;
  max-width: 280px;
}
.golden-dots span {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #D4AF37;
  margin: 0 4px;
  animation: goldenDot 1.4s ease-in-out infinite;
}
.golden-dots span:nth-child(2) { animation-delay: 0.2s; }
.golden-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes goldenFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes goldenPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(212,175,55,0.4), 0 0 80px rgba(212,175,55,0.15); }
  50% { transform: scale(1.12); box-shadow: 0 0 60px rgba(212,175,55,0.6), 0 0 120px rgba(212,175,55,0.25); }
}
@keyframes goldenDot {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* ── Landing Page (minimalist mode) ── */
.landing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 0 20px;
  text-align: center;
}

.landing-start-btn {
  margin-top: 0; /* 🐾 E52: 上间距整体上移至 .landing-start-wrap（锚点线 = 按钮顶，几何可算） */
  /* 🐾 E65g: 显式图层序（主公实机截图 0ee1ac52 物证：灵宠与按钮重叠的身体被按钮吞掉
     —— WebKit/微信 WebView 对「无显式 z-index 的兄弟 + filter 合成层」排序与 Chrome
     不一致）。wrap 内 isolation 锁死比较域：按钮 z1 < anchor z2，灵宠稳在按钮之上。 */
  position: relative;
  z-index: 1;
  padding: 16px 48px;
  font-size: 18px;
  font-weight: 700;
  color: #0A0914;
  background: linear-gradient(135deg, #D4AF37 0%, #F0D060 100%);
  border: none;
  border-radius: 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.landing-start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 30px rgba(212, 175, 55, 0.6);
}

/* ── 🐾 E51 破框骑键（灵宠骑「开始测算」按钮上沿 · 主公钦定原画 2026-10-14）── */
.landing-start-wrap {
  position: relative;
  display: inline-block;
  /* 🐾 E65g: 显式 z2 —— 线上真页实测定版：视频(fixed z0) < wrap(z2)，灵宠压视频与按钮之上；
     内部按钮 z1 < anchor z2。⚠️ z1 实测仍被视频盖（Chrome 复现），z2 起显形——以实测定版。
     ⚠️ 勿用 isolation:isolate（会把灵宠锁进 wrap 层域反被 z0 视频盖住——E65g 线上实测翻车）。 */
  z-index: 2;
  /* 🐾 E52: 40+32=72px 总空隙整体上移到此（按钮自身 margin-top 已归零）⇒ 锚点 top:0 即按钮顶，
     灵宠「体底压键沿」可纯数学定位（体底比例实测：Milo 0.780 / Sophia 0.775） */
  margin-top: 72px;
}
#ks-familiar-anchor {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  pointer-events: none;
  /* 🐾 E65g: z2 > 按钮 z1 —— 灵宠锚定层明确高于按钮（WebKit 实机物证修复） */
  z-index: 2;
}
.ks-fam-breakout {
  position: absolute;
  bottom: 100%;          /* 灵宠底边先对齐按钮顶沿，再按自身高百分比下垂复现「搭键爪垫」 */
  pointer-events: none;  /* 🔒 物理穿透（军令铁律）：身体/爪子 100% 让路，按钮点击 100% 命中 */
  z-index: 6;
  filter: drop-shadow(0 10px 24px rgba(20, 10, 40, 0.45));
}
/* 几何真值（源图实测，单位=按钮宽）：Milo 居左 -14.77% 宽 71.46%；Sophia 居右 58.45% 宽 69.93%
   🐾 E52（主公亲令 2026-10-15）：① 整体缩至约 67%（宽度 71.46%→48% / 69.93%→46.9%），高度完全
   容纳于「缘分天定」与按钮之间；② 巡视通道：±14% 自体宽缓移（translateX 与趴键 translateY
   同帧合成，禁 margin 重排）。
   🐾 E54-1（主公亲令 2026-10-15 · 真机截屏抓形「Sophia 悬挂半空」）：垂直锚点**重标定** ——
   病根＝E52 的「体底 0.780/0.775」实测的是**爪尖/尾梢**（alpha 最下极值），而灵宠本体是
   圆球坐姿：身体球底（行宽 ≥ 峰值 20% 的实心轮廓底）才是视觉"坐上去"的接触点。
   逐行 alpha 实测真值：Milo 球底 0.7806（图 793px）/ Sophia 球底 0.7485（图 831px）
   ⇒ 球底距图底 0.2194h / 0.2515h；目标＝球底压在按钮顶沿**下方约 3.5%h（≈3px）**，
   故 translateY = 0.2194+0.035 ⇒ **25.4%** / 0.2515+0.035 ⇒ **28.6%**。
   残余的图底透明区下垂（爪垫 0.95 / 尾梢 0.99）自然搭在金色键面上 —— 真正的"扒在键沿"。 */
/* 几何真值（🛡️ E65 终版原画重制 2026-10-18 主公补料 image_46/47）：
   新原画 = Gemini 终版（玄武岩暗 Milo × 灰白壳粉耳 Sophia），macOS Vision 主体提取 →
   按钮黄键剔除 → 尾身分离（尾根结合部斜线）→ Milo 水平镜像（军令「面朝右·尾在左」）
   → 按旧球宽 686/695px 定标 → 排上 945×1073 / 962×1099 画布。
   🐾 E65b（主公亲令 2026-10-18「手脚要放在按键上」）: 趴键锚点由球底改**爪脚坐底线**
   （行宽≥20% 峰值底缘：Milo 0.6438 / Sophia 0.6423）。
   🐾 E65c（主公亲令 2026-10-18「不用移动·固定此位·后脚要能看到」）：
   ①撤水平巡逻（translateX ±7%），灵宠**定住**不漂移，尾巴摇摆/眨眼/呼吸保留；
   🐾 E65d（主公亲令 2026-10-18「后脚位置没有体现出来，要和参照稿手脚呈现一样」）：
   **横向重锚** —— 病根＝Milo left:-27.2% 时大半个身子悬在按键左侧外，后脚恰落
   按键左圆角盲区/键外（参照稿实测：球心≈键宽 50%、球宽≈键宽 52%、球底贴键沿、
   四爪垂搭在金面）。按参照稿重算：
   ①球宽 63%→**70%** 键宽（球宽/键宽 ≈ 51.8% 对齐参照稿）；
   ②球心落位：Milo **44%** / Sophia **56%**（左右镜像偏置，都落在键面平金区）
     ⇒ 资产球心占比 Milo 0.636 / Sophia 0.360（擦尾后偏侧）⇒
     left = 球心目标 − 球心占比×宽 ⇒ Milo **-0.5%** / Sophia **30.8%**；
   ③ty = (1−球底0.6114/0.6078)+微压 ⇒ **40.2% / 40.4%**（球底压键沿下 ~2px，
     爪脚主体垂搭在金面上，与参照稿同款「趴键垂爪」形态）。
   ⚠️ 尾层资产已裁剪至 bbox（尾盒 358×575 / 400×687），CSS left/top/width 即 bbox 百分比。
   ⚠️ 旧 E51/E52/E54/E65b/E65c 几何（-27.2%/56.01%、63%、38.9%~43.2%）全数退役。
   🐾 E65e（主公亲令 2026-10-18「你自己比对灵宠的手脚和尾巴状态」）—— 断爪移植 + 尾层降层 + 球底贴沿：
   ①**断爪真因**＝E65 黄键剔除把原画中压在金键上的爪身误吞（资产爪垂搭仅 3.4%H，参照稿 ≈6%H）；
     治法＝以绿眼距定标（S=2.0119/1.9001）+ 蓝图翻转对齐，从原画源图把键沿以下的爪身
     **画布中心逆向采样**移植回资产（⚠️ 1源像素→1画布像素会因 2× 缩放欠采样成点阵；
     爪根色调按暗爪均值/方差仿射匹配；逐列桥接过渡；密度<0.55 的影瓣点阵剔除）。
     新爪底：Milo 0.6711H（原 0.6463）/ Sophia 0.6433H（原 0.6433，资产本就完好免移植）。
   ②**尾层降层**：DOM 尾层移到身体之前（下层）—— 参照稿尾根藏球后，分离切口与根际残片被球遮蔽。
   ③**球底贴沿**：ty 改 (1−球底) 精确贴沿 ⇒ **38.9% / 39.2%**，爪全量垂搭金面（Milo 12px/Sophia 7px）。
   🐾 E65f（主公实机终裁 2026-10-18「还是老样子」· 线上真页取证）：**历轮全在「贴沿」级（0~2px），
   参照稿是「坐键」级** —— 逐像素量参照稿：球宽/键宽 51%（现渲染 52% ✓ 尺寸无误），但球底
   **深入按钮内部约 65% 按钮高**（灵宠整个人「坐」在按键上）。治法＝贴沿公式保留（% 锚球底）
   ＋ **30px 坐键深压**（按钮高 46px 的 65%，参照稿同款）：translateY(calc(38.9% + 30px))。
   agent-browser 线上真页双视口实测：桌面 1280 与手机 390 同为键高 46px，压入比例一致，
   「开始测算」文字完整可见，尾巴垂键左下与参照稿同款。⚠️ 核验铁律：**几何验收必须在
   线上真页 getBoundingClientRect＋截图比对参照稿**，自建仿真页与 grep 自写数值皆为假绿。
   ⚠️ E65f 的 30px 深压被主公实机否决（0ee1ac52）——且暴露 stacking 真雷：与按钮重叠的
   身体在主公 WebKit/微信 WebView 里被按钮吞掉（Chrome 里灵宠在上故桌面验证假绿）。
   🐾 E65g（主公实机终裁 2026-10-18「你自己看现在搞成什么样子啦」）：
   ①**图层序显式化**：wrap `isolation:isolate` + 按钮 z1 + anchor z2 —— 灵宠跨浏览器稳压按钮之上（真凶修复）；
   ②**压深回调 30px→6px**：参照稿本意是「球底微压＋爪垂搭金面」，30px 是把参照稿「爪压区」
     误读成「球身坐键区」⇒ 整个身子没进按钮。ty = calc(38.9% + 6px)：球底压 6px、
     爪底（球底下 6%H≈12px）垂搭金面 12~18px 清晰可见，形态即参照稿。 */
.ks-fam-milo {
  left: -0.5%; width: 70%;
  transform: translateY(calc(38.9% + 6px));
}
.ks-fam-sophia {
  left: 30.8%; width: 70%;
  transform: translateY(calc(39.2% + 6px));
}
.ks-fam-breathe {
  animation: ksFamBreatheMilo 4.6s ease-in-out infinite;
  transform-origin: 50% 88%;
}
.ks-fam-sophia .ks-fam-breathe { animation-name: ksFamBreatheSophia; animation-duration: 5.4s; }
.ks-fam-img { display: block; width: 100%; height: auto; user-select: none; }
/* ── 🐾 E52 活体动效（主公亲令 2026-10-15）── */
/* 眨眼：闭眼帧叠加层常态隐藏，每 4.7s/5.3s 瞬目约 240ms（两宠错峰） */
.ks-fam-img-blink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}
.ks-fam-milo .ks-fam-img-blink { animation: ksFamBlinkMilo 4.7s linear infinite; }
.ks-fam-sophia .ks-fam-img-blink { animation: ksFamBlinkSophia 5.3s linear infinite; animation-delay: 1.9s; }
@keyframes ksFamBlinkMilo {
  0%, 94% { opacity: 0; }
  94.8%, 97.2% { opacity: 1; }
  98%, 100% { opacity: 0; }
}
@keyframes ksFamBlinkSophia {
  0%, 94% { opacity: 0; }
  94.8%, 97.2% { opacity: 1; }
  98%, 100% { opacity: 0; }
}
/* 尾巴动效：独立尾层（本体已擦尾），transform-origin 钉在尾根（geometry.json E52 真值）；
   🐾 E55-2（主公亲令 2026-10-16）: 弃左右正弦摆动（真机僵硬），改**尾梢慢速画圆**
   （Tail Circling）—— rotate 基线叠加椭圆 translate 轨迹 + skew 微扭，
   自闭环 infinite（不用 alternate，轨迹首尾相接成小圈），像猫咪惬意趴着时
   尾尖在键侧慢悠悠转小圈的慵懒活体感。
   🐾 E56-2（主公亲令 2026-10-16 · 真机复测「尾巴没有转到」）: 真机尾层仅 ~90px 宽，
   E55 幅度（rotate ±3°/translate 6%）尾梢行程仅 ~10px，手机上肉眼难辨 ⇒ 幅度翻倍：
   rotate ±7°/translate 12%/skew 9°，尾梢行程 ~22px；7s→6s。reduced-motion 降级保持。
   🐾 E57-2（主公亲令 2026-10-16 · 真机复测「幅度还是太小，还可以翻倍」）: 再翻倍——
   rotate ±14°/translate 24%/skew ±18°，尾梢行程 ~45px，慵懒大圈一望即知。
   🐾 E63（主公钦定终版 2026-10-17）: 回归「尾梢自然转小圈」终版节奏 —— 见下方
   ksFamTailLeisurely（4.5s alternate，rotate ±1.8°/skew ±1°/translateY ±0.5px）。
   🐾 E63-1（主公亲令「Milo 面朝右、尾在左、与 Sophia 相对」核验结论）: **现渲染即军令形态**——
   Milo 尾层布局盒 left:0%（尾在左）、本体面朝右前，与 Sophia（尾 left:55.14% 在右）天然镜像相对；
   主公所附终版原画截图（image_47）为「尾在右」形态，按军令末句调整到左边后 ＝ 现渲染形态，
   故**不做 scaleX(-1) 翻转**（PIL 双形态合成实测：翻转后尾翻到右、面翻向左，双违军令）。 */
.ks-fam-tail {
  position: absolute;
  pointer-events: none;
  user-select: none;
  height: auto;
}
.ks-fam-milo .ks-fam-tail {
  left: 0%; top: 46.41%; width: 37.88%;
  transform-origin: 86.2% 26.4%;
  animation: ksFamTailLeisurely 4.5s ease-in-out infinite alternate;
}
.ks-fam-sophia .ks-fam-tail {
  left: 58.42%; top: 37.49%; width: 41.58%;
  transform-origin: 20.8% 38.6%;
  animation: ksFamTailLeisurely 4.5s ease-in-out infinite alternate;
  animation-delay: 0.9s; /* E63: 与 4.7s/5.3s 瞬目错峰的相位差 */
}
/* 🐾 E63（主公钦定终版 keyframes 2026-10-17 · 「慢速悠闲轻旋/画圆微动」总令）:
   弃大幅画圈，改**尾梢自然转小圈**——rotate ±1.8°/skew ±1°/translateY ±0.5px，
   4.5s ease-in-out infinite alternate（0%≡100%，alternate 正反往复＝连续小圈）。
   军令即单组 keyframes 双宠共用（.ks-tail-sophia/.ks-tail-milo ⇒ 本仓类名
   .ks-fam-milo/.ks-fam-tail 与 .ks-fam-sophia/.ks-fam-tail）；Sophia +0.9s 相位差与瞬目错峰。 */
@keyframes ksFamTailLeisurely {
  0%   { transform: rotate(0deg)    skewX(0deg)  translateY(0); }
  33%  { transform: rotate(1.8deg)  skewX(1deg)  translateY(0.5px); }
  66%  { transform: rotate(-1.5deg) skewX(-1deg) translateY(-0.5px); }
  100% { transform: rotate(0deg)    skewX(0deg)  translateY(0); }
}
@keyframes ksFamBreatheMilo {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.035) rotate(0.5deg); }
  78% { transform: scale(1.012) rotate(-0.35deg); } /* Milo 耳朵微动 */
}
@keyframes ksFamBreatheSophia {
  0%, 100% { transform: scale(1) rotate(0deg); }
  45% { transform: scale(1.03) rotate(-0.8deg); }
  70% { transform: scale(1.015) rotate(0.6deg); }  /* Sophia 尾巴微摆 */
}
/* 点击命中区：仅头部 / 爱心宝石（透明圆区，其余全部穿透） */
.ks-fam-zone {
  position: absolute;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ks-fam-zone-head { left: 24%; top: 1%; width: 46%; height: 34%; border-radius: 46% 54% 50% 50%; }
.ks-fam-zone-gem  { left: 30%; top: 38%; width: 42%; height: 32%; border-radius: 50%; }
/* 🛡️ E65：新画布（945×1073 / 962×1099）命中区真值（脸部/蓝心宝石实测框） */
.ks-fam-milo .ks-fam-zone-head { left: 45.6%; top: 0%; width: 45.3%; height: 30.1%; }
.ks-fam-milo .ks-fam-zone-gem  { left: 54.7%; top: 35.4%; width: 28.1%; height: 22.1%; }
.ks-fam-sophia .ks-fam-zone-head { left: 9.8%; top: 0%; width: 45.5%; height: 29.2%; }
.ks-fam-sophia .ks-fam-zone-gem  { left: 17.9%; top: 35.4%; width: 28.3%; height: 22.2%; }
/* 呼吸微光脉冲（点中头部/宝石时） */
.ks-fam-pulse .ks-fam-breathe { animation: ksFamPulse 0.75s ease-in-out 2; }
@keyframes ksFamPulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(167, 139, 250, 0)); }
  50% { filter: drop-shadow(0 0 16px rgba(190, 160, 255, 0.95)) drop-shadow(0 0 42px rgba(140, 110, 250, 0.5)); }
}
/* 命理气泡轻语（纯展示，pointer-events:none 绝不挡操作）
   🐾 E65h（主公亲令 2026-10-18「气泡调整到 Sophia 左侧空间/Milo 右侧空间」）：
   旧位 bottom:106% 正上方在 390 视口实测压住「缘分天定」标题（气泡 y399~453 vs 标题 y402~450），
   且标题群底(450)到球顶(460)仅 10px —— 垂直无解 ⇒ 移到灵宠**侧面**、与球体中上部同高：
   bottom:56%（气泡 y≈447~519，副标题下/按钮上，球顶侧旁）；Milo（右侧宠区右缘 390 屏）
   ⇒ left:100% 向右展开；Sophia ⇒ right:100% 向左展开（左侧空间 155px）。
   max-width 收至 min(150px,40vw) 保两侧不溢出屏。真页实测：不遮标题/脸/按钮 ✓。 */
.ks-fam-bubble {
  position: absolute;
  bottom: 56%;
  left: 100%;
  margin-left: 6px;
  transform: none;
  width: max-content;
  max-width: min(150px, 40vw);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  background: rgba(24, 18, 38, 0.94);
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 14px 14px 14px 3px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: ksFamBubbleIn 0.28s ease-out;
}
.ks-fam-sophia .ks-fam-bubble { left: auto; right: 100%; margin-left: 0; margin-right: 6px; border-radius: 14px 14px 3px 14px; }
.ks-fam-bubble-name { color: #F0D060; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; line-height: 1.4; }
.ks-fam-bubble-line { color: rgba(240, 230, 200, 0.92); font-size: 12px; line-height: 1.5; }
@keyframes ksFamBubbleIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
/* 管理小圆钮（↺ 重置领养 / 🧪 沙箱清档） */
.ks-fam-chip {
  position: absolute;
  top: -3%;
  right: 1%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(20, 16, 34, 0.72);
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  line-height: 1;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.ks-fam-chip:hover { opacity: 1; }
.ks-fam-chip-test { top: auto; bottom: -3%; right: auto; left: 1%; color: #81D8D0; }
@media (prefers-reduced-motion: reduce) {
  .ks-fam-breathe,
  .ks-fam-pulse .ks-fam-breathe { animation: none; }
  /* 🐾 E52/E54/E65d: 眨眼 / 慢旋尾 / 呼吸降级为静帧（趴键位保持 —— E65d 参照稿同款真值） */
  .ks-fam-milo { transform: translateY(calc(38.9% + 6px)); }
  .ks-fam-sophia { transform: translateY(calc(39.2% + 6px)); }
  .ks-fam-img-blink { animation: none; opacity: 0; }
  .ks-fam-tail { animation: none; transform: none; }
}

/* ── Mode Selection Modal ── */
.mode-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 20, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease-out;
}

.mode-modal {
  background: linear-gradient(168deg, rgba(26, 31, 75, 0.97) 0%, rgba(18, 22, 55, 0.99) 100%);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 20px;
  padding: 32px 24px;
  max-width: 340px;
  width: 100%;
  /* 主公令 45-B11：弹窗整体下移 1cm —— flex 居中下 margin-top 取 2cm（对称抵消一半）即净下移 1cm ≈ 37.8px */
  margin-top: 2cm;
  animation: slideUp 0.4s ease-out;
}

.mode-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #D4AF37;
  text-align: center;
  margin-bottom: 24px;
}

.mode-option {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.mode-option:hover {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.5);
  transform: translateX(4px);
}

.mode-icon {
  font-size: 32px;
  line-height: 1;
  width: 48px;
  text-align: center;
}

.mode-label {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  display: block;
}

.mode-desc {
  font-size: 12px;
  color: #a0a0c0;
  margin-top: 4px;
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Legal Footer Disclaimer ── */
.legal-footer {
  font-size: 9px;
  color: rgba(200, 195, 170, 0.9);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}
.legal-footer a {
  color: rgba(200, 195, 170, 0.9);
  text-decoration: underline;
}

/* ── Policy Pages ── */
.policy-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #080810 0%, #0D0D1A 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 16px 60px;
  position: relative;
}
.policy-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
}
.policy-back-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 6px 12px;
  color: #8B8778;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 16px;
}
.policy-title {
  font-size: 24px;
  font-weight: 800;
  color: #D4AF37;
  text-align: center;
  margin-bottom: 4px;
  text-shadow: 0 2px 20px rgba(212,175,55,0.4);
}
.policy-date {
  font-size: 11px;
  color: rgba(139,135,120,0.6);
  text-align: center;
  margin-bottom: 24px;
}
.policy-content {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 24px 20px;
  color: rgba(232,228,217,0.85);
}
.policy-content h2 {
  font-size: 14px;
  font-weight: 700;
  color: #D4AF37;
  margin: 0 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(212,175,55,0.2);
}
.policy-content p {
  font-size: 12px;
  color: rgba(232,228,217,0.75);
  line-height: 1.7;
  margin: 0 0 16px 0;
}

/* 🛡️ Gate 43：合盘推演进度卡脉冲（仪式感 · 纯装饰，缺帧不渲染） */
@keyframes ksPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.85); }
  50%      { opacity: 1;    transform: scale(1.15); }
}

/* 🛡️ Gate 44：画布视觉二期（宫位交互网格 + 卡面质感；纯装饰，缺真值不渲染） */
@keyframes ksShimmer {
  0%   { background-position: 180% 0; }
  100% { background-position: -180% 0; }
}
@keyframes ksResGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(212, 175, 55, 0); }
  50%      { box-shadow: 0 0 12px rgba(212, 175, 55, 0.38); }
}

/* 流光扫过（羁绊签名卡 / 命运契约卡 / 宫位网格卡） */
.ks-card-shimmer,
.ks-house-card { position: relative; overflow: hidden; }
.ks-card-shimmer::after,
.ks-house-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.07) 50%, transparent 58%);
  background-size: 260% 100%;
  animation: ksShimmer 7s linear infinite;
  pointer-events: none;
}

/* 命运契约卡：古老羊皮纸质感（径向微光叠加） */
.ks-card-parchment {
  background-image:
    radial-gradient(circle at 18% 22%, rgba(212, 175, 55, 0.07), transparent 58%),
    radial-gradient(circle at 82% 78%, rgba(212, 175, 55, 0.055), transparent 55%);
}

/* 宫位格：共鸣宫高亮脉冲；平时平滑过渡 */
.ks-house-cell { transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease; }
.ks-house-cell--res { animation: ksResGlow 3.4s ease-in-out infinite; }
.ks-house-cell:hover { transform: translateY(-1px); }

/* 实时状态绿点（鉴权 / 投递路径 —— 真实真值，复用 ksPulse） */
.ks-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4CAF50;
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.7);
  animation: ksPulse 2.4s ease-in-out infinite;
  flex: 0 0 auto;
}

/* ══════════════════════════════════════════════════════════════════════
   🐾 灵宠首页宿主壳（E46 建 → E53 净化 · 主公亲令 2026-10-15）
   E53-1 首页净化白名单：星空背景＋缘分天定＋骑键灵宠＋极简切换语言 ⇒
   E46 时代的折叠条/认领表单/座位卡全部拔除（约 310 行死样式一并清场），
   仅保留 .ks-pet-card 宿主壳（承载 testid + 权益判定）；灵宠本尊经
   portal 骑「开始测算」按钮上沿（样式在 .ks-fam-* E51/E52 区）。
   ══════════════════════════════════════════════════════════════════════ */
.ks-pet-card {
  width: 100%;
  max-width: 400px;
  margin: 18px auto 0;
  padding: 0 20px;
  box-sizing: border-box;
  /* 🔴 视频背景（fixed inset:0 z-index:0 pointerEvents:auto）会吞静态内容点击 ——
     仓内惯例（.btn-primary / .input-page）：定位提升浮到视频上层，否则整卡可看不可点。 */
  position: relative;
  z-index: 2;
}

/* 无障碍：尊重系统「减弱动态」偏好 */
@media (prefers-reduced-motion: reduce) {
  .ks-card-shimmer::after,
  .ks-house-card::after,
  .ks-house-cell--res,
  .ks-dot { animation: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   🐾 E66 · 灵魂兽半屏毛玻璃抽屉舱（主公军令 2026-10-18）
   - 深空毛玻璃：backdrop-filter blur + 双层渐变，透出首页星河而不抢戏；
   - 68vh 占屏（军令 65%~70%），圆角 22px，顶部金线一道作「舱门」；
   - 遮罩点击 / 下滑手势收起（手势位移由组件内联 transform 驱动，本文件只给过渡）；
   - 层级 900：高于首页全部内容（视频 z0 / wrap z2 / 气泡 z6），低于全局 Toast 弹层。
   ══════════════════════════════════════════════════════════════════════════ */
.ks-fam-bubble-cta {
  pointer-events: auto;
  align-self: flex-start;
  margin-top: 3px;
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.55);
  color: #F0D060;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}
.ks-fam-bubble-cta:hover { background: rgba(212, 175, 55, 0.3); transform: translateY(-1px); }

.ks-chat-layer {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: flex-end;
}
.ks-chat-mask {
  position: absolute;
  inset: 0;
  background: rgba(6, 5, 14, 0.58);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: ksChatFade 0.24s ease-out;
}
.ks-chat-sheet {
  position: relative;
  width: 100%;
  height: 55vh; /* E68 军令②：移动端 68→55vh，留出上半屏让背景视频透出 */
  max-height: 55vh;
  display: flex;
  flex-direction: column;
  padding: 0 14px calc(10px + env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(120, 90, 200, 0.22), transparent 70%),
    linear-gradient(180deg, rgba(26, 20, 44, 0.88) 0%, rgba(12, 9, 24, 0.95) 100%);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.62);
  animation: ksChatUp 0.32s cubic-bezier(0.22, 0.9, 0.24, 1);
  transition: transform 0.22s ease;
  will-change: transform;
  transform: translateZ(0); /* E68 军令①：图层提升，隔离合成避免打字全屏 Reflow */
  contain: content;         /* E68 军令①：渲染隔离，输入态变化不再外溢 */
}

/* 🖥 E68 军令②：桌面端废除 100% 大通栏 ⇒ 右下角精致悬浮陪伴舱 */
@media (min-width: 768px) {
  .ks-chat-layer { justify-content: flex-end; padding: 0 24px 20px 0; }
  .ks-chat-mask {
    background: rgba(6, 5, 14, 0.18); /* 桌面端只轻微压暗，视频/星空完整透出 */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .ks-chat-sheet {
    width: 420px;
    max-width: 90vw;
    height: 600px;
    max-height: 75vh;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.66);
    animation: ksChatPop 0.28s cubic-bezier(0.22, 0.9, 0.24, 1);
  }
}
@keyframes ksChatPop { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: translateZ(0) scale(1); } }
@keyframes ksChatUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes ksChatFade { from { opacity: 0; } to { opacity: 1; } }

.ks-chat-grab {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  margin: 8px auto 4px;
  flex: 0 0 auto;
}
.ks-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex: 0 0 auto;
}
.ks-chat-avatar {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
  animation: ksChatBreathe 4.6s ease-in-out infinite;
  flex: 0 0 auto;
}
.ks-chat-sophia .ks-chat-avatar { animation-duration: 5.4s; }
@keyframes ksChatBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.ks-chat-who { flex: 1 1 auto; min-width: 0; }
.ks-chat-name { font-size: 15px; font-weight: 700; color: #F0D060; letter-spacing: 0.02em; }
.ks-chat-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(237, 232, 220, 0.6);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ks-chat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #81D8D0;
  box-shadow: 0 0 8px rgba(129, 216, 208, 0.9);
  animation: ksChatPulse 1.8s ease-in-out infinite;
  flex: 0 0 auto;
}
@keyframes ksChatPulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.ks-chat-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.ks-chat-close:active { background: rgba(255, 255, 255, 0.14); }

.ks-chat-flow {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 2px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overscroll-behavior: contain;
}
.ks-chat-bubble {
  max-width: 82%;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.65;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: ksChatBubbleIn 0.2s ease-out;
}
@keyframes ksChatBubbleIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.ks-chat-assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #EDE8DC;
  border-bottom-left-radius: 4px;
}
.ks-chat-user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.92), rgba(240, 208, 96, 0.82));
  color: #17122A;
  font-weight: 600;
  border-bottom-right-radius: 4px;
}
.ks-chat-typing { display: inline-flex; gap: 3px; vertical-align: middle; }
.ks-chat-typing i {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(237, 232, 220, 0.55);
  animation: ksChatTyping 1.1s ease-in-out infinite;
}
.ks-chat-typing i:nth-child(2) { animation-delay: 0.15s; }
.ks-chat-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ksChatTyping { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
.ks-chat-notice {
  align-self: center;
  font-size: 11.5px;
  color: #FFB4A2;
  background: rgba(255, 107, 122, 0.12);
  border: 1px solid rgba(255, 107, 122, 0.28);
  padding: 6px 12px;
  border-radius: 999px;
  text-align: center;
}

.ks-chat-pills {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0 8px;
  flex: 0 0 auto;
  scrollbar-width: none;
}
.ks-chat-pills::-webkit-scrollbar { display: none; }
.ks-chat-pill {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: rgba(240, 208, 96, 0.92);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.34);
  border-radius: 999px;
  padding: 6px 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease;
}
.ks-chat-pill:hover:not(:disabled) { background: rgba(212, 175, 55, 0.2); }
.ks-chat-pill:disabled { opacity: 0.45; cursor: default; }

.ks-chat-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.ks-chat-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #EDE8DC;
  font-size: 13px;
  padding: 0 14px;
  outline: none;
}
.ks-chat-input::placeholder { color: rgba(237, 232, 220, 0.38); }
.ks-chat-input:focus { border-color: rgba(212, 175, 55, 0.5); background: rgba(255, 255, 255, 0.09); }
.ks-chat-mic,
.ks-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(237, 232, 220, 0.7);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.ks-chat-mic:disabled { opacity: 0.38; cursor: not-allowed; }
.ks-chat-send {
  background: linear-gradient(135deg, #D4AF37, #F0D060);
  border-color: transparent;
  color: #17122A;
  font-weight: 800;
  font-size: 16px;
}
.ks-chat-send:disabled { opacity: 0.4; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .ks-chat-sheet, .ks-chat-mask, .ks-chat-bubble { animation: none; }
  .ks-chat-avatar, .ks-chat-dot, .ks-chat-typing i { animation: none; }
  .ks-chat-sheet { transform: translateZ(0); }
}
