: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); }
}
/* 🤝 E156（主公军令 2026-11-25）：幸福坐标卡嵌入块 —— /result 三场景报告底部 ＋ 财富报告页底部
   黑金同母版；预览缩略＋单一「保存 / 分享」主按钮（财富页）；主动权 100% 在付费用户本人。
   ✦ E158-刀三（主公军令 2026-11-26）：标题缩字 13px；/result 预览框正下方重复按钮退役 ⇒ 预览等比放大。
   🔴 泰语强制 anywhere + 1.55（容器自带 lang 属性 ⇒ 不依赖 html[lang] 接线）。 */
.ks-hcard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px 16px;
  border-radius: 18px;
  border: 1px solid rgba(212,175,55,.4);
  background: linear-gradient(160deg, rgba(212,175,55,.12) 0%, rgba(20,16,30,.55) 60%, rgba(13,13,26,.85) 100%);
  box-shadow: 0 0 26px rgba(212,175,55,.08) inset;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ks-hcard-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #F3E5AB;
  letter-spacing: .04em;
  text-align: center;
}
.ks-hcard-preview {
  align-self: center;
  /* ✦ E158-刀三：预览等比放大（E157 为 min(216px, 58vw)）；以坐标卡内容盒为上限 ⇒ 窄屏不挤占内边距、不贴边框 */
  width: min(300px, 100%);
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  border: 1px solid rgba(212,175,55,.55);
  box-shadow: 0 10px 30px rgba(0,0,0,.55), 0 0 24px rgba(212,175,55,.14);
  overflow: hidden;
  background: #05050A;
}
.ks-hcard-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ks-hcard-preview--pending { display: flex; align-items: center; justify-content: center; color: rgba(243,229,171,.6); font-size: 12px; }
.ks-hcard-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(212,175,55,.6);
  background: linear-gradient(135deg, #D4AF37 0%, #F0D060 50%, #D4AF37 100%);
  color: #0D0D1A;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .3px;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  cursor: pointer;
  transition: transform .25s ease, filter .25s ease;
}
.ks-hcard-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.ks-hcard-btn:disabled { opacity: .6; cursor: default; transform: none; }
.ks-hcard-err { margin: 0; color: #ffb4b4; font-size: 12px; text-align: center; line-height: 1.5; }
.ks-hcard-layer {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(5,5,10,.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
}
.ks-hcard-layer img { max-width: 100%; max-height: calc(100% - 48px); object-fit: contain; border-radius: 12px; }
.ks-hcard-layer-hint { color: rgba(243,229,171,.78); font-size: 12px; text-align: center; }
.ks-hcard[lang="th"], .ks-hcard[lang="th"] * { line-height: 1.55; overflow-wrap: anywhere; }
/* ═══════════════════════════════════════════════════════════════════════════
 * Celestial Obsidian Design Tokens —— 星际黑金奢华设计令牌（E83 军令铸造）
 * ═══════════════════════════════════════════════════════════════════════════
 * 母题（主公军令 2026-10-21）：为「姻缘模块全链路奢华重构」备好美学底座 ——
 *   彻底封杀 #ffffff 惨白背景、医院体检表式绿色进度条、灰底配浅灰的隐形字。
 *   本文件是全站深空黑金视觉的**唯一真源**（single source of truth）：
 *   后续任何页面重构一律引用本令牌，禁止散落硬编码色值。
 *
 * 铁律（由 skill:ui:aesthetic 探针 + audit-e83 闸门联合看守）：
 *   ① 大面积亮白背景（RGB 均值 >200）禁入 —— 全链路深空黑金一镜到底；
 *   ② 卡片一律流光毛玻璃：backdrop-filter blur(20px) + 钛金半透明微光描边；
 *   ③ 进度条/能量条一律星轨流光渐变（香槟金 #F5D08A × 星云玫瑰紫 #C084FC）；
 *   ④ 正文对比度 WCAG AA ≥4.5:1（大字号 ≥3:1）—— 隐形灰字当场翻红。
 * ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── ① 深空曜石底色（Deep-space Obsidian）──────────────────────────────
   *    深邃星空紫黑渐变；纯白 #fff 背景在本体系内为违禁品。
   *    与 .starfield-fallback 同族（紫黑星穹），供无视频背景的页面/弹层使用。 */
  --ks-bg-obsidian: radial-gradient(ellipse at 18% 0%, #17122E 0%, #0F0E26 46%, #0A0914 100%);
  --ks-bg-obsidian-solid: #0A0914;            /* 需要纯色兜底时（如 print / 阴影底） */
  --ks-bg-obsidian-raised: #131027;           /* 曜石抬升层（次级区块） */

  /* ── ② 流光毛玻璃卡片（Glassmorphism）─────────────────────────────────
   *    用法：.ks-glass-card 工具类，或拆引三变量自定义。 */
  --ks-card-glass: rgba(21, 18, 40, 0.55);    /* 玻璃体：曜石紫黑半透明 */
  --ks-card-glass-blur: blur(20px);
  --ks-card-glass-border: 1px solid rgba(245, 208, 138, 0.28);  /* 钛金微光描边 */
  --ks-card-glass-glow:
    0 8px 32px rgba(10, 9, 20, 0.45),
    inset 0 1px 0 rgba(245, 208, 138, 0.12); /* 外沉内升双光晕 */

  /* ── ③ 星轨能量渐变（Orbit Energy）────────────────────────────────────
   *    替换「医院体检表绿条」的唯一正身：香槟金 → 星云玫瑰紫双色引力发光。 */
  --ks-gold: #F5D08A;                          /* 流光香槟金 */
  --ks-nebula: #C084FC;                        /* 星云玫瑰紫 */
  --ks-progress-orbit: linear-gradient(90deg, #F5D08A 0%, #E9C7F2 52%, #C084FC 100%);
  --ks-progress-glow: 0 0 12px rgba(245, 208, 138, 0.55), 0 0 26px rgba(192, 132, 252, 0.35);
  --ks-progress-track: rgba(255, 255, 255, 0.07);  /* 轨道槽：仅此一处允许的白，alpha≤0.07 */

  /* ── ④ 三级高对比度排版（Luminance Tiering）────────────────────────────
   *    主/次/金句三级；全部在曜石底上过 WCAG AA（skill:ui:aesthetic 实测）。 */
  --ks-text-primary: #F5F2FA;                  /* 主文：星辉白（对曜石底 ≈15.9:1） */
  --ks-text-secondary: #C7C2D4;                /* 次文：月尘灰紫（对曜石底 ≈9.6:1） */
  --ks-text-gold: #F5D08A;                     /* 金句：流光香槟金（对曜石底 ≈11.4:1） */

  /* ── 动效曲线与时长（Motion）───────────────────────────────────────────
   *    丝绸折叠 / 塔罗翻转共用曲线，禁生硬 linear。 */
  --ks-ease-silk: cubic-bezier(0.22, 1, 0.36, 1);   /* 丝滑收放 */
  --ks-ease-orbit: cubic-bezier(0.65, 0, 0.35, 1);  /* 引力环绕（翻转/大位移） */
  --ks-dur-fast: 180ms;                        /* 微反馈 */
  --ks-dur-drawer: 420ms;                      /* 抽屉折叠 */
  --ks-dur-flip: 720ms;                        /* 塔罗 3D 翻转 */

  /* ── 星相图标（Esoteric Icons）─────────────────────────────────────────
   *    Lucide 线条图标统一发光滤镜，替代口语化 Emoji。 */
  --ks-icon-glow: drop-shadow(0 0 6px rgba(245, 208, 138, 0.45));
  --ks-icon-stroke: #F5D08A;
}

/* ═══ 工具类（重构军令的预制件；未挂任何现有 DOM，零回归风险）═══ */

/* 流光毛玻璃卡：全站卡片唯一正身 */
.ks-glass-card {
  background: var(--ks-card-glass);
  -webkit-backdrop-filter: var(--ks-card-glass-blur);
  backdrop-filter: var(--ks-card-glass-blur);
  border: var(--ks-card-glass-border);
  border-radius: 16px;
  box-shadow: var(--ks-card-glow);
}

/* 星轨流光进度条：替换一切绿色/纯色进度条 */
.ks-orbit-bar {
  background: var(--ks-progress-orbit);
  box-shadow: var(--ks-progress-glow);
  border-radius: 999px;
}

/* 丝滑折叠抽屉：grid-template-rows 0fr→1fr 过渡（禁 height:auto 动画——不可插值必卡顿） */
.ks-fold {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--ks-dur-drawer) var(--ks-ease-silk);
}
.ks-fold[data-open='true'] { grid-template-rows: 1fr; }
.ks-fold > .ks-fold-inner { overflow: hidden; min-height: 0; }

/* 3D 塔罗牌翻转：perspective 挂父、rotateY 挂卡、双面 backface 互斥 */
.ks-tarot-stage { perspective: 1200px; }
.ks-tarot-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform var(--ks-dur-flip) var(--ks-ease-orbit);
}
.ks-tarot-card[data-flipped='true'] { transform: rotateY(180deg); }
.ks-tarot-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.ks-tarot-face--back { transform: rotateY(180deg); }

/* 星相图标基类：线条 + 发光滤镜（Lucide / 自绘 SVG 通用） */
.ks-esoteric-icon {
  filter: var(--ks-icon-glow);
  color: var(--ks-icon-stroke);
}

/* ═══ E86（主公军令 2026-10-24）：统一黑金滚动条标准 ═══
 * 规格逐字复制「财富月报」金属框内的滚动槽：细长胶囊轨道（5px）、
 * 深黑半透滑轨、暗金→古铜金渐变滑块、悬停鎏金提亮。
 * 统领所有城市联想下拉浮层（姻缘/财富全模块），彻底剔除原生灰白粗滚动槽。 */
.celestial-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.45) rgba(15, 13, 25, 0.6);
}
.celestial-scrollbar::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.celestial-scrollbar::-webkit-scrollbar-track {
  background: rgba(15, 13, 25, 0.7);
  border-radius: 999px;
}
.celestial-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.6), rgba(180, 140, 30, 0.35));
  border-radius: 999px;
  border: 1px solid rgba(255, 215, 0, 0.15);
}
.celestial-scrollbar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.85), rgba(212, 175, 55, 0.6));
}
/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
/* 🎨 E83 画布底曜石化（celestial-tokens 落地第一枪）：原先 body transparent ⇒ 画布回落
   index.css :root --bg:#fff（Astro 模板遗留）——星空视频缺失/加载中时整页裸白（医院白）。
   曜石底令视频缺失优雅降级为深空底，任何页面永不闪白。 */
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols 2', 'Segoe UI', Roboto, sans-serif; background: var(--ks-bg-obsidian-solid, #0A0914); 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 ── */
/* 🔴 E71c 真页实测血训：本规则严禁添加任何非 visible 的纵向溢出值 —— 非 visible 纵向值
   会按 CSS 规范把横向轴强制计算成 auto，令 .page 成为双向裁切的滚动容器：E71 运势气泡
   加 44px 位移后宽于页盒，390 屏 Sophia 左缘被裁 18px、Milo 右缘被裁 11px，1440 桌面
   同样中招（A/B 对比实锤）。落地页滚动一直由 body 承担（实测 window.scrollY 生效、
   .page 无内部滚动条），该遗留值自 V200c 起从未真正生效 ⇒ 摘除即根治，闸门锁死禁回潮。 */
.input-page {
  padding-top: 56px; position: relative; z-index: 2; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  background: transparent;
}
/* Prevent iOS Safari zoom-on-input */
@media screen and (max-width: 500px) {
  .date-part { font-size: 16px !important; }
}

/* 🔴 E102-刀四-③（军令 2026-10-29）：390px 窄断点月/年报纵向堆叠——
   双列神谕卡 / 事实卡网格在 390px 以下强制单列，东南亚长词不挤压。 */
.ks-duo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ks-fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
@media screen and (max-width: 390px) {
  .ks-duo-grid, .ks-fact-grid { grid-template-columns: 1fr; }
}

/* ── 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 {
  /* 🎨 E83 WCAG AA 纠偏：#7c3aed 对曜石底 3.47:1 < 4.5（skill:ui:aesthetic 实测拦截）
     ⇒ 提亮至基类同款 #a855f7（4.86:1），辉光同步换色。 */
  color: #a855f7; text-shadow: 0 1px 16px rgba(168,85,247,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);
}
/* ✦ E84：白底青边幽灵按钮退役 → 黑金幽灵（透明底＋钛金描边＋金字） */
.btn-secondary {
  background: rgba(245, 208, 138, 0.06);
  color: var(--ks-text-gold, #F5D08A);
  border: 1.5px solid rgba(245, 208, 138, 0.45);
  margin-top: 20px;
  -webkit-backdrop-filter: var(--ks-card-glass-blur, blur(20px));
  backdrop-filter: var(--ks-card-glass-blur, blur(20px));
}
.btn-secondary:hover { background: rgba(245, 208, 138, 0.14); border-color: rgba(245, 208, 138, 0.7); }

/* ── 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 rgba(255,255,255,0.08); border-top-color: var(--ks-gold, #F5D08A); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin-top: 18px; color: var(--ks-text-secondary, #C7C2D4); font-size: 14px; }

/* ✦ E84：result 折叠开关（查看/收起完整分析）—— 曜石毛玻璃触发条＋金箭头 */
.ks-detail-toggle {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(245, 208, 138, 0.28);
  background: var(--ks-card-glass, rgba(21, 18, 40, 0.55));
  -webkit-backdrop-filter: var(--ks-card-glass-blur, blur(20px));
  backdrop-filter: var(--ks-card-glass-blur, blur(20px));
  box-shadow: var(--ks-card-glow);
  color: var(--ks-text-primary, #F5F2FA);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.ks-detail-toggle:hover { border-color: rgba(245, 208, 138, 0.55); }
.ks-detail-toggle .chevron { color: var(--ks-text-gold, #F5D08A); }
.ks-detail-toggle-label { text-align: left; }

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

/* Score Ring */
.score-ring { width: 130px; height: 130px; margin: 20px auto 8px; position: relative; }
.score-ring svg { width: 100%; height: 100%; }
/* ✦ E84：分数覆盖层（星辉白，color 驱动；对曜石底 ≈15.9:1 过 WCAG AA 大字 3:1） */
.score-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  color: var(--ks-text-primary, #F5F2FA);
  text-shadow: 0 2px 12px rgba(10, 9, 20, 0.6);
  pointer-events: none;
}

/* 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: var(--ks-text-primary, #F5F2FA); }
.engine-summary { font-size: 12px; color: var(--ks-text-secondary, #C7C2D4); line-height: 1.4; }
.engine-score { font-size: 20px; font-weight: 800; color: var(--ks-text-gold, #F5D08A); }

/* AI Insight */
/* ✦ E84：淡蓝紫浅底退役 → 曜石毛玻璃（.ai-insight-dark 变体并入同族） */
.ai-insight {
  background: var(--ks-card-glass, rgba(21, 18, 40, 0.55));
  -webkit-backdrop-filter: var(--ks-card-glass-blur, blur(20px));
  backdrop-filter: var(--ks-card-glass-blur, blur(20px));
  border: var(--ks-card-glass-border, 1px solid rgba(245, 208, 138, 0.28));
  box-shadow: var(--ks-card-glow);
  border-radius: 14px; padding: 18px; text-align: left; margin-bottom: 18px;
}
.ai-insight h3 { font-size: 14px; color: var(--ks-text-gold, #F5D08A); margin-bottom: 8px; }
.ai-insight p { font-size: 13px; color: var(--ks-text-secondary, #C7C2D4); 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: var(--ks-text-secondary, #C7C2D4); line-height: 1.75; text-align: left; margin: 0; padding: 0 0 8px 0; }
.insight-result p:first-child { color: var(--ks-text-primary, #F5F2FA); }
.insight-result p:last-child { padding-bottom: 0; }

/* ✦ E84：AI 洞察高定排版——金句铭牌（【】段）＋星芒高亮（✦ 段） */
.ks-insight-quote {
  padding: 10px 14px !important;
  background: rgba(245, 208, 138, 0.08) !important;
  border-left: 3px solid var(--ks-gold, #F5D08A) !important;
  border-radius: 0 10px 10px 0 !important;
  color: var(--ks-text-gold, #F5D08A) !important;
  font-weight: 600 !important;
  margin: 4px 0 10px !important;
}
.ks-insight-highlight { color: var(--ks-text-primary, #F5F2FA) !important; font-weight: 600 !important; }

/* ✦ E84：塔罗牌暗金铭牌框＋微光悬浮（牌面 emoji 为牌义符号保留，外壳黑金精修） */
.ks-tarot-frame {
  margin-top: 16px;
  padding: 18px 16px 14px;
  background: linear-gradient(165deg, rgba(245, 208, 138, 0.10) 0%, rgba(192, 132, 252, 0.07) 100%);
  border: 1px solid rgba(245, 208, 138, 0.4);
  border-radius: 14px;
  text-align: center;
  box-shadow:
    0 6px 24px rgba(10, 9, 20, 0.5),
    0 0 18px rgba(245, 208, 138, 0.12),
    inset 0 1px 0 rgba(245, 208, 138, 0.15);
  animation: ksTarotFloat 3.6s ease-in-out infinite;
}
@keyframes ksTarotFloat {
  0%, 100% { transform: translateY(0); box-shadow: 0 6px 24px rgba(10, 9, 20, 0.5), 0 0 14px rgba(245, 208, 138, 0.10), inset 0 1px 0 rgba(245, 208, 138, 0.15); }
  50% { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(10, 9, 20, 0.5), 0 0 24px rgba(245, 208, 138, 0.22), inset 0 1px 0 rgba(245, 208, 138, 0.2); }
}
.ks-tarot-glyph {
  font-size: 48px;
  line-height: 1.2;
  margin-bottom: 8px;
  transition: transform 0.6s var(--ks-ease-orbit, cubic-bezier(0.65, 0, 0.35, 1));
  filter: drop-shadow(0 0 10px rgba(245, 208, 138, 0.45));
}
.ks-tarot-name {
  font-weight: 700;
  color: var(--ks-text-gold, #F5D08A);
  font-size: 15px;
  letter-spacing: 0.04em;
}
.ks-tarot-orient { color: var(--ks-text-secondary, #C7C2D4); font-size: 12.5px; font-weight: 500; }
/* ✦ E87-①（主公军令 2026-10-25）：塔罗解读行——暗淡透明度退役，
   亮度与姻缘报告正文单源同令牌（--ks-text-secondary），正文同款 13px/1.75 行距。 */
/* 🔴 E88-③（主公军令 2026-10-26）：塔罗解读行亮度终极收口——弃次文令牌，
   强绑主文字亮度令牌（与一次性报告正文同源 ≈15.9:1），opacity 强制 1，
   任何上游/继承压暗（inline opacity / 祖先半透明）一律被 !important 压制。 */
.ks-tarot-line {
  margin: 12px 0 0;
  font-style: italic;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ks-text-primary, rgba(245, 245, 247, 0.95)) !important;
  opacity: 1 !important;
}

/* 🔴 E88-②（主公军令 2026-10-26）：姻缘报告「黑金长卷」三类——
   章节头金铭牌（年报五章/月报段落皆可命中）＋正文香槟白＋打字机光标。 */
/* 🔴 E90-③（主公军令 2026-10-25）：金属框全模块对齐——规格逐字移植财富报告封面卡
   （WealthReportPage：深空渐变底＋2px 钛金边＋内外金光＋顶部流光线），
   主公军令「姻缘月报/年报与财富月报/年报视觉一致」收官件。 */
.ks-report-scroll {
  position: relative;
  margin-top: 12px;
  padding: 20px;
  text-align: left;
  /* 🔴 E91-②（主公军令 2026-10-25）：底色对齐财富报告正文真源 SacredYearlyReportBox——
     曜黑纵向渐变（rgba(12,14,22)→rgba(6,7,12)），E90 误移植的封面卡蓝紫渐变
     （#1a1a2e→#16213e→#0f3460）退役（主公肉眼实锤两模块底色不一致）。 */
  background: linear-gradient(180deg, rgba(12, 14, 22, 0.98) 0%, rgba(6, 7, 12, 0.99) 100%);
  border: 2px solid rgba(212, 175, 55, 0.4);
  border-radius: 20px;
  /* 🔴 E91-②：光效逐字对齐 Sacred 真源（外黑幕＋内微金辉＋贴边金晕）。 */
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.85), inset 0 0 40px rgba(212, 175, 55, 0.015), 0 0 15px rgba(212, 175, 55, 0.1);
  overflow-y: auto;
  max-height: 60vh;
  overflow-wrap: anywhere;
  word-break: break-word;
  /* 🔴 E91-③：滑轨逐字对齐 Sacred .dark-scrollbar（哑光金 0.3 / 轨道 0.05）；
     E90 的 celestial-scrollbar 并挂与 0.45 亮金规格退役（主公实锤滑轨不一致）。 */
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.3) rgba(255, 255, 255, 0.05);
}
/* 🔴 E91-③：黑金滑轨（5px 胶囊 · 逐字克隆 Sacred .dark-scrollbar V257 封仓规格） */
.ks-report-scroll::-webkit-scrollbar { width: 5px; border-radius: 4px; }
.ks-report-scroll::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 4px; }
.ks-report-scroll::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.3); border-radius: 4px; }
.ks-report-scroll::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 55, 0.6); }
/* ✦ E96-①（主公军令 2026-10-26）：滑轨槽两端防溢出——.ks-report-scroll 自身既是金属框
   （border-radius: 20px）又是滚动容器，webKit 轨道默认 100% 顶格贯穿全高 ⇒ 直角轨道
   上下端头刺穿圆角边界（主公实锤：顶部与底部滑轨槽均超出金属框）。
   治法：轨道 margin 上下各内缩 20px（= 圆角半径，数学上轨道端点完全落在直边区内，
   军令 16px 方案在 5px 轨宽下右缘仍会擦弧 0.4px，故取 20px 整）；规格行追加于既有
   封仓行之后（层叠只补 margin，E90 断言锚定的原行零改动）。 */
.ks-report-scroll::-webkit-scrollbar-track { margin: 20px 0; }
/* 顶部鎏金流光线（对齐军令 .celestial-metallic-card::before 规格） */
.ks-report-scroll::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.8), transparent);
  pointer-events: none;
}
/* ✦ E95（主公军令 2026-10-26）：章节头金色左竖线退役——「第」字左侧 border-left 与
   padding-left 拔除（金属框已有顶部流光＋下方金色分隔底线，左竖线多余且易与「第」字粘连）；
   保留 border-bottom 分隔线。 */
.ks-report-chapter {
  margin: 14px 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ks-text-gold, #F5D08A);
  letter-spacing: 0.4px;
  border-left: none;
  /* 🔴 E102-刀四-①：泰语声调符/堆叠元音削顶防护（军令 line-height 1.55+ ＋ padding-top 4px） */
  padding-top: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}
.ks-report-para {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ks-text-primary, #F5F2FA);
  overflow-wrap: anywhere;
  word-break: break-word;
  /* 🔴 E102-刀四-①：泰语声调符/堆叠元音削顶防护（1.75 已达标，补 padding-top 4px 军令下限） */
  padding-top: 4px;
}
.ks-report-cursor {
  margin: 0;
  font-size: 13px;
  color: var(--ks-text-gold, #F5D08A);
  animation: ksReportCursorPulse 1.1s ease-in-out infinite;
}
@keyframes ksReportCursorPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* Aspects Tags */
/* ✦ E84：绿/黄浅底胶囊退役 → 金辉/星云紫胶囊（黑金系） */
.aspects { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.aspect-group { text-align: left; }
.aspect-group h4 { font-size: 13px; color: var(--ks-text-secondary, #C7C2D4); 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(245, 208, 138, 0.14); color: #F5D08A; border: 1px solid rgba(245, 208, 138, 0.35); }
.tag-warn { background: rgba(192, 132, 252, 0.16); color: #D8B4FE; border: 1px solid rgba(192, 132, 252, 0.35); }

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

/* ── Back Button ── */
.back-btn { background: none; border: none; cursor: pointer; color: var(--ks-text-gold, #F5D08A); 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: var(--ks-text-secondary, #C7C2D4); font-weight: 500; margin-bottom: 20px; letter-spacing: 0.5px; }

/* ── Four Dimensions ── */
/* ✦ E84（主公军令 2026-10-22）：医院白底体检卡退役 → 曜石毛玻璃星卡；
   廉价绿条退役 → 星轨流光能量条（令牌 --ks-progress-orbit）。 */
.dim-section {
  background: var(--ks-card-glass, rgba(21, 18, 40, 0.55));
  -webkit-backdrop-filter: var(--ks-card-glass-blur, blur(20px));
  backdrop-filter: var(--ks-card-glass-blur, blur(20px));
  border: var(--ks-card-glass-border, 1px solid rgba(245, 208, 138, 0.28));
  box-shadow: var(--ks-card-glow);
  border-radius: 14px; padding: 16px; margin-bottom: 16px;
}
.section-title { font-size: 13px; font-weight: 700; color: var(--ks-text-gold, #F5D08A); margin-bottom: 14px; text-align: left; letter-spacing: 0.05em; }
.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: var(--ks-text-primary, #F5F2FA); 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: var(--ks-progress-track, rgba(255,255,255,0.07)); border-radius: 3px; overflow: hidden; }
.dim-bar-fill { height: 100%; background: var(--ks-progress-orbit, linear-gradient(90deg, #F5D08A, #C084FC)); box-shadow: var(--ks-progress-glow); border-radius: 3px; transition: width 1s cubic-bezier(.4,0,.2,1); }
.dim-val { font-size: 13px; font-weight: 700; color: var(--ks-text-gold, #F5D08A); width: 26px; text-align: right; }

/* ── Engine Cards (interactive) ── */
/* ✦ E84：白底折叠卡退役 → 曜石毛玻璃；标题/分值左右两端对齐（禁电线杆居中），
   详情左对齐结构化排版（detail-heading 金标签／detail-line 次文）。 */
.engine-card {
  background: var(--ks-card-glass, rgba(21, 18, 40, 0.55));
  -webkit-backdrop-filter: var(--ks-card-glass-blur, blur(20px));
  backdrop-filter: var(--ks-card-glass-blur, blur(20px));
  border: var(--ks-card-glass-border, 1px solid rgba(245, 208, 138, 0.28));
  box-shadow: var(--ks-card-glow);
  border-radius: 14px; 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: rgba(245, 208, 138, 0.06); }
.engine-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.engine-icon { font-size: 20px; flex-shrink: 0; color: var(--ks-text-gold, #F5D08A); }
.engine-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.chevron { font-size: 20px; color: var(--ks-text-secondary, #C7C2D4); transition: transform 0.2s; display: inline-block; }
.chevron.open { transform: rotate(90deg); color: var(--ks-text-gold, #F5D08A); }
.engine-detail { padding: 0 16px 16px; border-top: 1px solid rgba(245, 208, 138, 0.12); animation: slideDown 0.2s ease; text-align: left; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.detail-heading { font-size: 12px; font-weight: 700; color: var(--ks-text-gold, #F5D08A); margin-top: 12px; margin-bottom: 4px; text-align: left; }
.detail-line { font-size: 12px; color: var(--ks-text-secondary, #C7C2D4); line-height: 1.65; margin-bottom: 2px; text-align: left; }

/* ── 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;
  overflow-wrap: anywhere; /* 🥂 E152-刀一：六语长文案受控换行（泰语防截断）——仅文本超宽时生效 */
}

.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 {
  /* 🥂 E153-刀二（军令 2026-11-24）：灵宠锚点容器改「干净标准纵列」——relative 真实占位，
     废除 E65 零高锚＋E152 全高 124px 让位（主公实拍病灶②真根：身体 sprite
     底部 33-36% 全透明死区——图盒底对齐≠视觉落座）。
     匿名访客 display:none 零占位（E52 72px 基线零扰动）。
     🎯 E153-P1 刀二（军令 2026-11-24 热补丁「落座贴沿」）：盒高 76px→72px＋
     margin-bottom 12px→0——旧形制的 12px 间距＋盒高富余 = 主公实拍「垂直悬空」
     病灶（实测缝隙 Milo 13.3px / Sophia 15.9px）。新盒高真值 = Sophia 裁切盒
     98×530/720 = 72.1px（取整 72）：Sophia 盒底 0.1px 恰好贴合按钮上边框；
     Milo 盒高 74.7px ⇒ 爪底轻压边框 2.7px（军令「轻贴」形态）。按钮
     padding-top 16px/14px（基线/PC 档）⇒ 灵宠底缘零侵入文字盒（p1 脚本硬断言）。 */
  position: relative;
  width: 100%;
  height: 72px;
  margin: 0;
  display: none;
  pointer-events: none;
  /* 🐾 E65g: z2 > 按钮 z1 —— 灵宠锚定层明确高于按钮（WebKit 实机物证修复） */
  z-index: 2;
}
body.ks-fam-ridden #ks-familiar-anchor { display: block; }
/* 🥂 E153-刀二（军令 2026-11-24）：灵宠骑乘间距条件档——锚点容器 in-flow
   真实占位（76px 宠位＋12px 落座间距）后，灵宠在场（body.ks-fam-ridden
   ——FamiliarHomeCard 挂载态条件类）⇒ wrap 顶距 18px（实测 subToFam 32px 入
   军令 28-34px 档）；匿名访客无灵宠 ⇒ E52 钦定 72px 基线零扰动。选择器
   specificity 压 1024 块 84px 覆写（双视口通吃）。 */
body.ks-fam-ridden .landing-start-wrap { margin-top: 18px; }
.ks-fam-breakout {
  position: absolute;
  bottom: -3px;           /* 🛬 E153-P4 刀二（军令 2026-11-24 终结军令「强制落地」）：根容器锚
                            按钮外层定位容器（.landing-start-wrap）的按钮上沿——in-flow 锚
                            #ks-familiar-anchor 底边恒＝按钮顶边，故 bottom:-3px ≡ 军令
                            「bottom:100%; margin-bottom:-3px」：实像素爪踩按钮上边框 3px
                            零缝隙（与宠高/朝向/视口/语种全解耦）。旧盒顶锚退役。 */
  pointer-events: none;  /* 🔒 物理穿透（军令铁律）：身体/爪子 100% 让路，按钮点击 100% 命中 */
  z-index: 6;
  isolation: isolate;    /* 🛡️ E153-P3（军令 2026-11-24 纠偏）：根容器独立层叠上下文——
                            尾 z1 / 本体 z2 / 眨眼 z3 显式分层在本仓内自闭，跨浏览器零歧义 */
  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 {
  /* 🧩 E82 体型语言不变式（主公亲令 2026-10-21「以 EN 为唯一真源锁死」）：
     旧 width:70% 绑定按钮宽坐标系，按钮宽随语言伸缩（六语真页实测 138.5~202.8px）
     ⇒ 灵宠渲染宽 98→143px 跳变。锁定 EN 基准 98px（138.5×70%），窄屏回 70% 适配；
     left 改 calc 保球心恒落键面 44%/56%（0.636/0.360 = E65d 资产球心占比真值）。 */
  /* 🎯 E153-P1 刀一（军令 2026-11-24 热补丁「严格居中」）：left 锦 44%→50%——
     旧 44%/56% 偏置是 E65d 参照稿时代故意非对称（球心落键面 44/56），主公
     实拍裁军令「水平偏左未沿中轴对齐」⇒ 视觉重心锚 50% 严格居中。补偿真值
     = PIL alpha 阈值 60 实测可见轮廓 x 中心：Milo cx=0.6368（画布 720×818，
     可见 x[199,717]）；乘法形制 min(98px,70%) 两分支数学精确（E82 窄屏适配
     契约不破）。 */
  left: calc(50% - 0.6368 * min(98px, 70%)); width: min(98px, 70%);
  /* 🥂 E153-刀二（军令 2026-11-24）：盒高裁至可见轮廓真值（PIL alpha 实测：
     Milo 可见底 0.6711H ⇒ 720×549 裁切比）——translateY 位移全退役（锚点
     容器 in-flow 落座）；breathe 层绝对化防内容撑高盒身（E152 血训：图盒底
     对齐≠视觉落座）。e152-verify 守卫退役，e153-verify 宠位区间断言守备。 */
  /* 🛬 E153-P4 刀一（军令 2026-11-24）：本体/眨眼图已物理裁除底部透明空气
     （720×818/817→720×550，阈 60 可见底）——图盒＝实像素盒，盒底即爪尖。 */
  aspect-ratio: 720 / 550;
}
.ks-fam-sophia {
  /* 🎯 E153-P1 刀一：56%→50% 严格居中（PIL cx=0.3597，画布 720×822，可见 x[2,515]） */
  left: calc(50% - 0.3597 * min(98px, 70%)); width: min(98px, 70%);
  /* 🥂 E153-刀二：同 Milo 裁切落座（Sophia 可见底 0.6436H ⇒ 720×530） */
  aspect-ratio: 720 / 530;
}
.ks-fam-breathe {
  /* 🥂 E153-刀二：绝对化＝内容不撑高 breakout 盒身（盒高唯一真源 aspect-ratio
     裁切比）；本层自身尺寸＝本体图自然高（宽 100%×高 auto），子层 % 坐标
     像素语义零漂移。 */
  position: absolute;
  top: 0;
  left: 0;
  /* 🛡️ E153-P3（军令 2026-11-24 纠偏·breathe 盒几何收敛）：盒宽高收敛到宠盒
     100%（本体图自然高 818 系底 33% 透明死区照旧溢出渲染，视觉零变化）——
     病根：breathe 盒原为 img 自然高 111px ⇒ 尾层旧 bottom 偏移锚落死区底
     沿＝爪线下 36px（P2 top 锚校准曾掩盖此层）。收敛后 bottom 锚＝盒底＝
     爪线/按钮顶，军令「尾底轻贴按钮上沿零悬空」语义成立。 */
  width: 100%;
  height: 100%;
  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;
  /* 🛡️ E153-P3（军令钦定）：本体层绝对压在尾层之上（z2>z1）——position:relative
     使 z-index 生效且零布局位移；尾巴任何像素严禁盖本体脸/紫晶爱心/爪子 */
  position: relative; z-index: 2; }
/* ── 🐾 E52 活体动效（主公亲令 2026-10-15）── */
/* 眨眼：闭眼帧叠加层常态隐藏，每 4.7s/5.3s 瞬目约 240ms（两宠错峰） */
.ks-fam-img-blink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  opacity: 0;
  z-index: 3;            /* 🛡️ E153-P3（军令钦定）：眨眼层最上 */
  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;
  z-index: 1;            /* 🛡️ E153-P3（军令钦定）：尾层绝对底层——严锁图层前后 */
}
.ks-fam-milo .ks-fam-tail {
  /* 🐈 E153-P3（军令 2026-11-24 纠偏「严锁比例/藏臀」）：P2 的 170% 巨尾＋
     侧向 top 锚＝「长猫头的毛毛虫」事故源，全数退役。死数字照抄军令：
     尾宽 108%（1.05W–1.15W 区间，W=本体 98px ⇒ 105.8px）；right:55% ⇒
     尾层右缘落盒 45%、尾根（origin 88%）落盒 32% 藏进 Milo 左下臀后
     （可见轮廓左缘 27.6% ⇒ 根际残片被球体遮蔽）；bottom:0（P4 落地）⇒ 尾底
     轻贴按钮上边框（视觉零悬空）；尾身顺按钮上沿向左平摊、尾尖上扬。 */
  right: 55%; bottom: 0; width: 108%;   /* 🛬 E153-P4 刀二：bottom:0 尾底与裁后爪线齐平（旧 2px 偏移退役） */
  transform-origin: 88% 85%;
  animation: ksFamTailLeisurely 4.8s ease-in-out infinite alternate;
}
.ks-fam-sophia .ks-fam-tail {
  /* 🐈 E153-P3：Sophia 镜像死数字照抄军令——尾宽 108%；left:55% ⇒ 尾根
     （origin 12%）落盒 68% 藏进 Sophia 右下臀后（可见轮廓右缘 71.5%）；
     bottom:0（P4 落地）轻贴按钮上沿；尾身顺按钮上沿向右平摊、尾尖上扬。 */
  left: 55%; bottom: 0; width: 108%;    /* 🛬 E153-P4 刀二：bottom:0 尾底与裁后爪线齐平（旧 2px 偏移退役） */
  transform-origin: 12% 85%;
  animation: ksFamTailLeisurelyMirror 4.8s 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 相位差与瞬目错峰。 */
/* 🐈 E153-P3（军令 2026-11-24 纠偏）：4.8s ease-in-out infinite alternate 节奏
   保留。P3 的 −3deg↔+4deg 双向摆与 translateY 双帧补偿，E153-P4 起按下文「平放↔尾梢
   上扬」单向摆全数退役（尾平躺按钮后下压半程会钻进键面）。 */
/* 🛬 E153-P4 刀二（军令 2026-11-24「还是悬空着」终结）：P3 的 translateY(-5px) 补偿全退役——
   P3 的等位移补偿把整条尾巴抬离按钮上沿 5px（尾图最底 7 行为 600~737px 宽的
   实像素平边 ⇒ 尾底悬空＝主公肉眼「悬空」真凶）。现尾层 bottom:0＝尾底与爪线
   齐平、平搭按钮上沿。摆向改「平放 ↔ 尾梢上扬」单向摆（P4 实像素验收修正）：
   尾既平躺按钮，下压摆（Milo −3deg / Sophia +4deg）会让尾梢钻进键面 2.9px，
   mobile 越南语双行长文（文字顶距按钮顶仅 4px）尾实像素压进文字 bbox——
   故退役下压半程，任意帧尾底不低于静止爪线。4.8s alternate 原样保留。 */
@keyframes ksFamTailLeisurely {        /* Milo：尾在左、根在右 ⇒ 正角＝尾梢上扬 */
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(4deg); }
}
@keyframes ksFamTailLeisurelyMirror {  /* Sophia：尾在右、根在左 ⇒ 负角＝尾梢上扬 */
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(-3deg); }
}
@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）命中区真值（脸部/蓝心宝石实测框） */
/* 🥂 E153-刀二：命中区 % 高度随裁切盒重标定（盒高 111.3→74.7 ⇒ ×1.4908；
   Sophia ×1.5538）——像素位零漂移（left/width 横向系零改动）。 */
.ks-fam-milo .ks-fam-zone-head { left: 45.6%; top: 0%; width: 45.3%; height: 44.9%; }
.ks-fam-milo .ks-fam-zone-gem  { left: 54.7%; top: 52.7%; width: 28.1%; height: 32.9%; }
.ks-fam-sophia .ks-fam-zone-head { left: 9.8%; top: 0%; width: 45.5%; height: 45.4%; }
.ks-fam-sophia .ks-fam-zone-gem  { left: 17.9%; top: 55.0%; width: 28.3%; height: 34.5%; }
/* 呼吸微光脉冲（点中头部/宝石时） */
.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 —— 垂直无解 ⇒ 移到灵宠**侧面**、与球体中上部同高；
   Milo（右侧宠区右缘 390 屏）⇒ left:100% 向右展开；Sophia ⇒ right:100% 向左展开。
   🧭 E153-刀三（主公军令 2026-11-24「全语种清剿」）：气泡防溢出死锁——
   ① 容器放宽：min-width:224px / max-width:min(312px,86vw) / padding:14px 16px / box-sizing:border-box
     （旧 150px 窄卡＝外语按钮破框溢出病灶）；
   ② 垂直口径像素守恒换算：旧 56%×111.3px(图盒) → 新 34.4%×74.7px(裁切盒)
     （E152 aspect-ratio 裁切盒后 56% 会抬太高；34.4% 保持原 62.3px 上移量零漂移）；
   ③ E82 动态解耦公式 0.56→0.344 同步（FamiliarHomeCard vRaise）。 */
.ks-fam-bubble {
  position: absolute;
  bottom: 34.4%;
  left: 100%;
  margin-left: 44px; /* 🧩 E71：右移 10mm（≈38px＋原 6px 间隙），让出中央标题右缘 */
  transform: none;
  width: max-content;
  min-width: 224px; /* 🧭 E153-刀三：轻奢卡下限（六语顶标＋节奏行优雅占位） */
  max-width: min(312px, 86vw); /* 🧭 E153-刀三：防溢出上限（泰/越长文安全折行） */
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px; /* 🧭 E153-刀三：军令钦定轻奢内距 */
  box-sizing: border-box; /* 🧭 E153-刀三：内距不撑破限宽 */
  background: rgba(24, 18, 38, 0.94);
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: ksFamBubbleIn 0.28s ease-out;
}
/* 🧩 E71 漫画尖角（Milo · 左下角朝左刺向 Milo 脑袋）：外层金边 + 内层底色双层三角，与框体融为一体 */
.ks-fam-bubble::after {
  content: '';
  position: absolute;
  right: 100%;
  bottom: -1px;
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-right: 15px solid rgba(212, 175, 55, 0.55);
}
.ks-fam-bubble::before {
  content: '';
  position: absolute;
  right: calc(100% + 2px);
  bottom: 0;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-right: 13px solid rgba(24, 18, 38, 0.94);
}
.ks-fam-sophia .ks-fam-bubble {
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-right: 44px; /* 🧩 E71：左移 10mm，让出「缘分天定」的「缘」字 */
  border-radius: 14px;
}
.ks-fam-sophia .ks-fam-bubble::after {
  right: auto;
  left: 100%;
  border-right: 0;
  border-left: 15px solid rgba(212, 175, 55, 0.55);
}
.ks-fam-sophia .ks-fam-bubble::before {
  right: auto;
  left: calc(100% + 2px);
  border-right: 0;
  border-left: 13px solid rgba(24, 18, 38, 0.94);
}
.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); }
}
/* ═══ 🤝 E160-刀五（主公军令 2026-11-29）：手机（≤768px）灵宠气泡居中于主标题正上方 ═══
   气泡脱离灵宠盒（左/底由 FamiliarHomeCard 量测主标题 rect 后内联定位，底距标题 14px）；
   此处只管：军令限宽、44px 外推归零、小三角居中朝下（Milo/Sophia 同形）、动画保 translateX、泰语折行。
   🔴 桌面（≥1024px）基础规则零触碰（E66/E81/E153 闸门锚定的字面分毫不动）。 */
@media (max-width: 768px) {
  .ks-fam-bubble, .ks-fam-sophia .ks-fam-bubble {
    width: min(340px, calc(100vw - 32px)); /* 🤝 E160-刀五：军令钦定限宽 */
    min-width: 0;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    text-align: center;
    overflow-wrap: break-word;
    animation-name: ksFamBubbleInE160;
  }
  /* 小三角居中朝下（外层金边 ::after ＋ 内层底色 ::before，双宠同形） */
  .ks-fam-bubble::after, .ks-fam-sophia .ks-fam-bubble::after {
    right: auto;
    left: 50%;
    bottom: -15px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-top: 15px solid rgba(212, 175, 55, 0.55);
    border-right: 11px solid transparent;
    border-bottom: 0;
    border-left: 11px solid transparent;
  }
  .ks-fam-bubble::before, .ks-fam-sophia .ks-fam-bubble::before {
    right: auto;
    left: 50%;
    bottom: -13px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-top: 13px solid rgba(24, 18, 38, 0.94);
    border-right: 9px solid transparent;
    border-bottom: 0;
    border-left: 9px solid transparent;
  }
  /* 🤝 E160-刀五：泰语全局折行铁律（六语零裁切） */
  html[lang="th"] :is(.ks-fam-bubble, .ks-fam-bubble-name, .ks-fam-bubble-line, .ks-fam-bubble-cta) { overflow-wrap: anywhere; line-height: 1.55; } /* :is() 形态：不抢 e153 基础规则首匹配锚 */
}
@keyframes ksFamBubbleInE160 {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 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: -4.5%; right: auto; left: 1%; color: #81D8D0; }

/* ── 🌟 E111-刀一（主公军令 2026-11-01）：待机活体微动效 ──
   JS 调度器（FamiliarHomeCard）首触发 15~20s（E112 军令）⇒ breakout 加
   .ks-fam-idle 2.4s 后自动摘除，之后每 25~30s 一次循环（E113 军令区间）。
   🏆 E112-刀一（主公军令 2026-11-01）：动效振幅大幅增强——主公实机验收
   实锤「深空星云背景下 3px 位移肉眼完全无法察觉」，军令钦定：
   Sophia 踩奶拱背位移 -3px→-7px＋skewY 双耳/肩背微动；
   Milo 尾巴欢快摆动 rotate ±15deg＋坏笑挑眉（blink 眯眼帧）＋
   嘴边 14px 晶蓝金边星芒气泡上浮 20px「啵」破裂成 4 颗金尘消散。
   🏆 E113-刀一（主公军令 2026-11-01）：全工况常驻循环＋振幅再强化——
   Sophia 拱背 -7px→-10px＋rotate 头颈仰角微抬＋skewY ±1.4deg 双耳微摇，
   宝石光晕 drop-shadow 16px/30px→20px/35px（踩奶与脉冲 0~2.4s 同步）；
   Milo 尾 22deg 弹性阻尼回弹＋新增 ksFamMiloSmirk 坏笑挑眉 breathe 层；
   星芒气泡斜上漂 25px 破裂（金尘破裂点随迁）。
   🔴 趴键几何铁律（E65g/E82）：.ks-fam-milo/.ks-fam-sophia 的 left/width/
   translateY 一概不动——动效全部叠加在子层，禁位移突变与卸载抖动。 */
.ks-fam-sophia.ks-fam-idle .ks-fam-breathe { animation: ksFamSophiaKnead 2.4s ease-in-out; }
@keyframes ksFamSophiaKnead {
  0%   { transform: scale(1) translateY(0) rotate(0deg) skewY(0deg); }
  38%  { transform: scale(0.96) translateY(-10px) rotate(1.4deg) skewY(-1.4deg); } /* 双爪踩奶压宝石＋背抬 10px（E113 军令真值）＋头颈仰角微抬 rotate＋双耳/肩背微摇 skewY（双耳在本体帧内不可独立变换，以整体微旋近似军令双耳 ±6deg 语义） */
  62%  { transform: scale(0.975) translateY(-7px) rotate(-0.8deg) skewY(0.9deg); }
  100% { transform: scale(1) translateY(0) rotate(0deg) skewY(0deg); }
}
/* 闭眼月牙（军令「双眼闭合呈月牙状」）：idle 中段常态显眨眼帧，头尾平滑淡入淡出 */
.ks-fam-sophia.ks-fam-idle .ks-fam-img-blink { animation: ksFamIdleBlink 2.4s ease-in-out; }
@keyframes ksFamIdleBlink {
  0%   { opacity: 0; }
  18%, 82% { opacity: 1; }
  100% { opacity: 0; }
}
/* 🏆 E112-刀一：Milo 坏笑挑眉神态——idle 中段眯眼帧（无独立表情资产层，
   眨眼帧眯眼＝坏笑挑眉的最近真值形态，禁过度工程化加表情层） */
.ks-fam-milo.ks-fam-idle .ks-fam-img-blink { animation: ksFamIdleBlink 2.4s ease-in-out; }
/* 🏆 E113-刀一（军令「必须注入」）：Milo 坏笑/自信挑眉微表情——breathe 层
   头颈微倾＋微抬＋微放大（嘴角/眼角上扬神态可见化，与眯眼帧、甩尾 2.4s 成套；
   仍是叠加层，零触碰趴键几何） */
.ks-fam-milo.ks-fam-idle .ks-fam-breathe { animation: ksFamMiloSmirk 2.4s ease-in-out; }
@keyframes ksFamMiloSmirk {
  0%, 100% { transform: none; }
  45%      { transform: translateY(-4px) rotate(-3.5deg) skewX(2deg) scale(1.03); }  /* 🏆 E114-刀三（军令「强化痞坏神态」）：头颈上扬 4px＋侧倾 3.5deg＋歪嘴梗 skewX（嘴角/眼角上挑坏笑的最近真值形态，与眯眼帧成套） */
  72%      { transform: translateY(-2px) rotate(-1.5deg) scale(1.01); }  /* 余韵收敛 */
}
/* 爱心宝石微光（E113-刀一翻倍强化）：多层高光渐变光晕（军令钦定真值
   drop-shadow 20px rgba(244,184,206,1) + 35px rgba(232,199,154,0.85)），
   踩奶顶点 40% 呈心跳般粉金能量脉冲（深空背景下肉眼可辨；
   0s~2.4s 与踩奶拱背完全同步——军令钦定时间轴） */
.ks-fam-gemglow {
  position: absolute;
  left: 17.9%; top: 55.0%; width: 28.3%; height: 34.5%; /* Sophia gem 命中区同框（E65 真值；🥂 E153-刀二 裁切盒重标定 ×1.5538） */
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 46%, rgba(244, 184, 206, 0.34) 0%, rgba(244, 184, 206, 0) 62%);
  animation: ksFamGemGlow 2.4s ease-in-out;
}
@keyframes ksFamGemGlow {
  0%   { box-shadow: 0 0 0 rgba(244, 184, 206, 0); filter: drop-shadow(0 0 0 rgba(244, 184, 206, 0)); transform: scale(0.96); }
  40%  {
    box-shadow: 0 0 22px rgba(244, 184, 206, 0.95), 0 0 46px rgba(244, 184, 206, 0.45);
    filter: drop-shadow(0 0 20px rgba(244, 184, 206, 1)) drop-shadow(0 0 35px rgba(232, 199, 154, 0.85));
    transform: scale(1.08);
  }
  70%  {
    box-shadow: 0 0 12px rgba(244, 184, 206, 0.55), 0 0 26px rgba(232, 199, 154, 0.35);
    filter: drop-shadow(0 0 10px rgba(244, 184, 206, 0.55));
    transform: scale(1.02);
  }
  100% { box-shadow: 0 0 0 rgba(244, 184, 206, 0); filter: drop-shadow(0 0 0 rgba(244, 184, 206, 0)); transform: scale(1); }
}
/* Milo 尾巴大弧度欢快甩动（E113 军令钦定 rotate 22deg＋弹性阻尼回弹） */
.ks-fam-milo.ks-fam-idle .ks-fam-tail { animation: ksFamMiloTailFlick 2.4s ease-in-out; }
@keyframes ksFamMiloTailFlick {
  0%, 100% { transform: rotate(0deg)    skewX(0deg)   translateY(0); }
  28%      { transform: rotate(7deg)    skewX(2deg)   translateY(-4px); }  /* 欢快甩尾（E113 弹性序列 E153-P2 换横尾后角度等比收敛 22→7deg：尾臂 37→158px 等位移换算） */
  48%      { transform: rotate(-3deg)   skewX(-1deg)  translateY(-2px); }  /* 弹性阻尼回弹 */
  66%      { transform: rotate(4deg)    skewX(1.5deg) translateY(-3px); }  /* 二次衰减摆动 */
  84%      { transform: rotate(-1.5deg) skewX(-0.7deg) translateY(-1px); }  /* 收敛回正 */
}
/* 🏆 E112-刀一（军令钦定）：Milo 星芒气泡——嘴边呼出晶蓝带金边小气泡
   ⇒斜上漂移⇒「啵」破裂⇒化作金色微尘粒子向星空四散消散（2.4s 全程）。
   🏆 E114-刀三（军令物理参数跃升）：直径 14→22px；沿 35° 倾角斜上漂 50px
   （dx 28 / dy -41）；末端 scale(1.25) 轻盈膨胀后爆裂成 5 颗金色星尘。 */
.ks-fam-pop {
  position: absolute;
  left: calc(68% - 11px); top: 3%; /* 嘴边/头顶右侧（zone-head 中心 68.35%，E65 真值；22px 气泡半径居中；🥂 E153-刀二 裁切盒重标定） */
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.ks-fam-pop-bub {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, rgba(190, 236, 255, 0.92) 0%, rgba(129, 216, 208, 0.55) 45%, rgba(129, 216, 208, 0.12) 78%);
  border: 1.5px solid rgba(240, 208, 96, 0.75);
  box-shadow: 0 0 10px rgba(129, 216, 208, 0.55), 0 0 18px rgba(240, 208, 96, 0.3);
  animation: ksFamPopBub 2.4s ease-out forwards;
}
@keyframes ksFamPopBub {
  0%   { opacity: 0; transform: translate(0, 3px) scale(0.3); }
  16%  { opacity: 1; transform: translate(4px, -8px) scale(1); }
  48%  { opacity: 1; transform: translate(14px, -24px) scale(1.08); }
  66%  { opacity: 1; transform: translate(22px, -33px) scale(1.18); }
  70%  { opacity: 1; transform: translate(26px, -38px) scale(1.25); } /* 🏆 E114-刀三：末端轻盈膨胀 scale(1.25)（军令真值） */
  74%  { opacity: 0; transform: translate(28px, -41px) scale(1.25); } /* 「啵」破裂——斜上漂 50px（35° 倾角：dx 28 / dy -41 军令真值） */
  100% { opacity: 0; transform: translate(28px, -41px) scale(1.25); }
}
.ks-fam-pop-dust {
  position: absolute;
  left: 50%;
  top: -41px; /* 破裂点（E114-刀三：气泡斜上漂 50px 后的真实破裂位置） */
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #FFE9A8 0%, #F0D060 70%);
  filter: drop-shadow(0 0 4px rgba(240, 208, 96, 0.9));
  opacity: 0;
  animation: ksFamPopDust 2.4s ease-out forwards;
}
/* 5 颗金尘各奔一方（1 颗略偏早、其余 ~74% 破裂点齐发，散向星空消散；
   E114-刀三：破裂点随气泡斜上漂移 +28px ⇒ --dx 整体随迁；第 5 颗入列） */
.ks-fam-pop-dust:nth-child(2) { animation-delay: 1.66s; --dx: 38px;  --dy: -16px; }
.ks-fam-pop-dust:nth-child(3) { animation-delay: 1.70s; --dx: 19px;  --dy: -20px; }
.ks-fam-pop-dust:nth-child(4) { animation-delay: 1.70s; --dx: 33px;  --dy: -12px; }
.ks-fam-pop-dust:nth-child(5) { animation-delay: 1.74s; --dx: 24px;  --dy: -18px; }
.ks-fam-pop-dust:nth-child(6) { animation-delay: 1.74s; --dx: 14px;  --dy: -10px; }
@keyframes ksFamPopDust {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.4); }
  12%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 6px)), var(--dy, -14px)) scale(0.75); }
}

/* ── 🏆 E114-刀二/刀五（主公军令 2026-11-01）：双耳独立摇摆＋宝石高光扩散＋SSE 吐字共鸣 ── */
/* Sophia 双耳层：本体同源帧 clip-path 复制叠加（静止时与本体逐像素重合不可见；
   摆动时绕耳基独立旋转——主公实机验收实锤「双耳没有摇动」根治。趴键几何
   铁律不破：层定位与本体帧同盒（inset:0），零 left/width/translateY 改动） */
.ks-fam-ears {
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  z-index: 3;            /* 🛡️ E153-P3：耳层与眨眼层同级（DOM 序在后）——压本体(z2)之上 */
  pointer-events: none;
  user-select: none;
  clip-path: inset(0% 40% 84% 6%);
  transform-origin: 33% 16%;
}
.ks-fam-sophia.ks-fam-idle .ks-fam-ears { animation: ksFamSophiaEars 2.4s ease-in-out; }
@keyframes ksFamSophiaEars {
  0%, 100% { transform: rotate(0deg) scaleY(1); }
  30%      { transform: rotate(8deg) scaleY(1.05); }  /* 军令钦定 rotate(±8deg) scaleY(1.05)——与拱背 38% 峰值节奏错落 */
  55%      { transform: rotate(-7deg) scaleY(1.03); }
  78%      { transform: rotate(4deg) scaleY(1.01); }
}
/* 宝石高光扩散脉冲层（军令钦定「高光扩散」语义）：径向渐变＋screen 混合，
   踩奶顶点扩散至 48px 半径——心跳般纯正能量脉冲（E113 仅 drop-shadow 加深
   被主公实机验收实锤「没有体现出来」，本层为独立光晕遮罩实体） */
.ks-fam-gempulse {
  position: absolute;
  left: calc(32.05% - 48px);  /* gem 命中区中心（17.9%+14.15%，E65 真值）——48px 半径层 */
  top: calc(72.25% - 48px);    /* gem 纵向中心（🥂 E153-刀二 裁切盒重标定：55.0%+17.25%） */
  width: 96px;
  height: 96px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 182, 193, 0.95) 0%, rgba(244, 184, 206, 0.7) 45%, rgba(244, 184, 206, 0) 75%);
  mix-blend-mode: screen;
  opacity: 0;
  animation: ksFamGemPulse 2.4s ease-in-out;
}
@keyframes ksFamGemPulse {
  0%   { opacity: 0; transform: scale(0.32); }
  38%  { opacity: 0.9; transform: scale(1); }  /* 踩奶顶点：48px 半径高光全幅扩散（与拱背同步） */
  70%  { opacity: 0.35; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(0.5); }
}
/* ── 🏆 E114-刀五：SSE 吐字共鸣姿态（.ks-fam-live——ChatSheet streaming 上行） ── */
/* Sophia「共鸣倾听」：双耳微幅前倾（1.6s 慢频） */
.ks-fam-sophia.ks-fam-live .ks-fam-ears { animation: ksFamEarLean 1.6s ease-in-out infinite; }
@keyframes ksFamEarLean {
  0%, 100% { transform: rotate(0deg) scaleY(1); }
  50%      { transform: rotate(5deg) scaleY(1.03); }  /* 双耳前倾（军令「微幅」） */
}
/* Sophia 宝石 4Hz 呼吸微光（0.25s 周期——与吐字频率共鸣的柔粉呼吸） */
.ks-fam-sophia.ks-fam-live .ks-fam-gemglow { animation: ksFamGemLiveGlow 0.25s ease-in-out infinite alternate; }
@keyframes ksFamGemLiveGlow {
  0%   { box-shadow: 0 0 6px rgba(244, 184, 206, 0.5); filter: drop-shadow(0 0 6px rgba(244, 184, 206, 0.5)); transform: scale(0.98); }
  100% { box-shadow: 0 0 18px rgba(244, 184, 206, 0.95), 0 0 30px rgba(232, 199, 154, 0.5); filter: drop-shadow(0 0 14px rgba(244, 184, 206, 0.9)); transform: scale(1.06); }
}
/* Sophia 尾梢规律轻打节拍（1.2s 拍点） */
.ks-fam-sophia.ks-fam-live .ks-fam-tail { animation: ksFamTailTap 1.2s ease-in-out infinite; }
@keyframes ksFamTailTap {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50%      { transform: rotate(3deg) translateY(-1.5px); }
}
/* Milo「欢快分享」：尾巴欢快摆（军令摆动周期 1.8s；E153-P2 横尾角度收敛
   ±13→±4deg：尾臂 158px×sin13°=35.6px 会穿按钮 padding 区，收敛后全帧
   |dy|≤11px 安全） */
.ks-fam-milo.ks-fam-live .ks-fam-tail { animation: ksFamMiloLiveTail 1.8s ease-in-out infinite; }
@keyframes ksFamMiloLiveTail {
  0%, 100% { transform: rotate(-4deg) skewX(-1.5deg) translateY(-2px); }
  50%      { transform: rotate(4deg)  skewX(1.5deg)  translateY(-4px); }
}
/* Milo 头顶 1~2 颗金色微缩星尘周期性上飘（错相位） */
.ks-fam-live-dust {
  position: absolute;
  left: 55%;
  top: -6%;  /* 🥂 E153-刀二：裁切盒重标定 */
  width: 30px;
  height: 34px;
  pointer-events: none;
}
.ks-fam-live-dust i {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #FFE9A8 0%, #F0D060 70%);
  filter: drop-shadow(0 0 4px rgba(240, 208, 96, 0.9));
  opacity: 0;
  animation: ksFamLiveDust 1.8s ease-out infinite;
}
.ks-fam-live-dust i:nth-child(1) { animation-delay: 0s;   --ldx: 6px; }
.ks-fam-live-dust i:nth-child(2) { animation-delay: 0.9s; --ldx: -5px; }
@keyframes ksFamLiveDust {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.5); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--ldx, 4px)), -30px) scale(0.8); }
}
/* 平滑回落（军令「吐字完成平滑退回待机」）：live class 摘除后耳/尾层回正
   过渡抚平（动画驱动期间 transition 不扰，仅收尾帧生效） */
.ks-fam-tail, .ks-fam-ears { transition: transform 0.45s ease; }

/* ── 💫 E111-刀三（主公军令 2026-11-01）：每日灵犀星打卡 ──
   每天首次点灵宠 ⇒「✦ 获得灵犀星 +1」飘字（宝石上方上飘消散 2.2s）＋
   累计存 localStorage.ks_starlight_count。
   🏆 E112-刀三（主公军令 2026-11-01）：灵宠身侧常显徽章物理拆除（贴在
   「开始测算」按钮下方破坏布局——主公实机验收实锤），迁移至对话舱 Header
   右侧（.ks-chat-star，见 chat 区）；点击飘字保留。 */
.ks-fam-starfloat {
  position: absolute;
  top: 27%;  /* 🥂 E153-刀二：裁切盒重标定（宝石上方旧像素位守恒） */
  left: 50%;
  transform: translateX(-50%);
  color: #FFE9A8;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-shadow: 0 0 10px rgba(240, 208, 96, 0.65);
  white-space: nowrap;
  pointer-events: none;
  animation: ksFamStarFloat 2.2s ease-out forwards;
}
@keyframes ksFamStarFloat {
  0%   { opacity: 0; transform: translateX(-50%) translateY(6px); }
  18%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-18px); }
}

@media (prefers-reduced-motion: reduce) {
  .ks-fam-breathe,
  .ks-fam-pulse .ks-fam-breathe,
  .ks-fam-idle .ks-fam-breathe,
  .ks-fam-idle .ks-fam-img-blink,
  .ks-fam-idle .ks-fam-tail { animation: none; }
  /* 🐾 E52/E54/E65d: 眨眼 / 慢旋尾 / 呼吸降级为静帧（🥂 E153-刀二：纵向落座
     改锚点容器 in-flow 占位——translateY 位移形态全退役，无降级位可守） */
  .ks-fam-img-blink { animation: none; opacity: 0; }
  .ks-fam-tail { animation: none; transform: none; }
  /* 🌟 E111/E112-刀一：待机光效层随降级静默不播（gemglow 无光晕 / 星芒气泡不升腾） */
  .ks-fam-gemglow, .ks-fam-pop { display: none; }
  /* 🏆 E114-刀二/刀五：耳层/脉冲层/吐字共鸣姿态随降级静默（gemglow live 4Hz
     已被上行 display:none 覆盖；耳层回正静帧） */
  .ks-fam-idle .ks-fam-ears,
  .ks-fam-live .ks-fam-ears,
  .ks-fam-live .ks-fam-tail { animation: none; }
  .ks-fam-gempulse, .ks-fam-live-dust { display: 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;
}

/* ✦ E84 黑曜浮雕化：深空曜石毛玻璃＋钛金描边＋双光晕（令牌真源 celestial-tokens.css） */
.mode-modal {
  background: var(--ks-card-glass, linear-gradient(168deg, rgba(26, 31, 75, 0.97) 0%, rgba(18, 22, 55, 0.99) 100%));
  backdrop-filter: var(--ks-card-glass-blur, blur(20px));
  -webkit-backdrop-filter: var(--ks-card-glass-blur, blur(20px));
  border: var(--ks-card-glass-border, 1px solid rgba(245, 208, 138, 0.28));
  box-shadow: var(--ks-card-glass-glow, 0 8px 32px rgba(10, 9, 20, 0.55));
  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 var(--ks-ease-silk, ease-out);
}

.mode-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ks-text-gold, #D4AF37);
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: 0.06em;
}

/* ✦ E84 曜石星卡按钮：悬浮微光流金边框＋点击引力缩放反馈 */
.mode-option {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(245, 208, 138, 0.18);
  border-radius: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  transition:
    border-color 0.3s var(--ks-ease-silk, ease),
    background 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.18s var(--ks-ease-silk, ease);
  text-align: left;
}

.mode-option:hover {
  background: rgba(192, 132, 252, 0.12);
  border-color: rgba(245, 208, 138, 0.55);
  box-shadow:
    0 0 18px rgba(245, 208, 138, 0.14),
    inset 0 0 12px rgba(192, 132, 252, 0.06);
  transform: translateY(-1px);
}

.mode-option:active {
  /* 引力缩放反馈：点击瞬间被「引力场」轻吸 */
  transform: scale(0.97);
}

/* ✦ E84：icon 位由 Emoji 换 SVG 矢量（EsotericIcons.tsx）——48px 固定宽守恒（E79 军令），
   星芒微光滤镜走令牌 --ks-icon-glow（skills/kindredsouls-celestial-ui 第四章规范） */
.mode-icon {
  font-size: 32px;
  line-height: 1;
  width: 48px;
  text-align: center;
}

.mode-icon .ks-esoteric-icon {
  filter: var(--ks-icon-glow, drop-shadow(0 0 6px rgba(245, 208, 138, 0.55)));
  transition: transform 0.3s var(--ks-ease-silk, ease);
}

.mode-option:hover .ks-esoteric-icon {
  transform: scale(1.08);
  filter: drop-shadow(0 0 9px rgba(245, 208, 138, 0.8));
}

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

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

/* 🌐 E79（主公军令 2026-10-20）: icon＋文字列排版——文字列吃掉剩余宽度并受控换行，
   fr/es/th/vi 长副标题绝不挤压左侧 48px 图标；标题保持单行优先 */
.mode-text {
  flex: 1;
  min-width: 0; /* flex 子项默认 min-width:auto 会拒绝收缩 ⇒ 必须归零才能触发换行 */
  display: block;
}

.mode-text .mode-label {
  white-space: nowrap; /* 主标题（Code/Clé/Código/รหัสลับ/Mật Mã）军令已控长度 ⇒ 单行优雅 */
  overflow: hidden;
  text-overflow: ellipsis; /* 兜底：极端窄屏标题截断省略号，绝不动图标 */
}

.mode-text .mode-desc {
  overflow-wrap: anywhere; /* 泰/越长副标题在词界缺失时也可断行 */
  word-break: normal;
}

/* ═══════════════════════════════════════════════════════════════════
 * ✦ E84（主公军令 2026-10-22）：双人输入页·双星分卡（Deep-space Star Cards）
 *    推翻 45-B5 六黑框堆叠：两张曜石星卡（你 / TA），必填生日置顶，
 *    选填时辰＋城市渐进式丝滑折叠（.ks-fold 令牌件）。
 * ═══════════════════════════════════════════════════════════════════ */

/* 曜石星卡本体：流光毛玻璃＋钛金描边（.ks-glass-card 令牌正身＋表单域扩展） */
.ks-starcard {
  background: var(--ks-card-glass);
  -webkit-backdrop-filter: var(--ks-card-glass-blur);
  backdrop-filter: var(--ks-card-glass-blur);
  border: var(--ks-card-glass-border);
  border-radius: 16px;
  box-shadow: var(--ks-card-glow);
  padding: 18px 16px 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 星卡头：SVG 图标＋标题（金）横排 */
.ks-starcard-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(245, 208, 138, 0.14);
}

.ks-starcard-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ks-text-gold, #F5D08A);
  letter-spacing: 0.04em;
}

.ks-starcard-head .ks-esoteric-icon {
  flex-shrink: 0;
}

/* 表单域标签：左对齐（E84 废除居中电线杆） */
.ks-starcard .date-label {
  text-align: left;
}

.ks-field-label {
  display: block;
  text-align: left;
  font-size: 12px;
  color: var(--ks-text-gold, #F5D08A);
  font-weight: 600;
  margin: 4px 0 5.6px;
}

/* 折叠触发条：微光金线＋＋/− 符号，悬浮流金 */
.ks-fold-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: rgba(245, 208, 138, 0.06);
  border: 1px dashed rgba(245, 208, 138, 0.35);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease;
  margin-top: 2px;
}

.ks-fold-trigger:hover {
  background: rgba(245, 208, 138, 0.12);
  border-color: rgba(245, 208, 138, 0.6);
}

.ks-fold-sign {
  font-size: 14px;
  font-weight: 700;
  color: var(--ks-text-gold, #F5D08A);
  line-height: 1;
  flex-shrink: 0;
}

.ks-fold-label {
  font-size: 11.5px;
  color: var(--ks-text-secondary, #C7C2D4);
  line-height: 1.45;
  text-align: left;
}

/* 折叠抽屉（令牌 .ks-fold grid-rows 0fr→1fr 丝滑）＋展开落定后放行下拉弹层：
   CitySearchInput 建议层为 absolute，须防 .ks-fold-inner overflow:hidden 裁切（E71 血训） */
.ks-fold[data-settled='true'] > .ks-fold-inner {
  overflow: visible;
}

.ks-fold-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
}

/* 金牌提示容器：星卡间距收口 */
.ks-dual-stack {
  margin-top: 4px;
}

@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 ── */
/* ⚖️ E127：独立路由页升 fixed 全屏覆盖（z-120）——与首页文档流互斥。
   旧病灶：position:relative 使条款纵向堆叠在首页 hero 下方，
   直访 /privacy-policy 首屏只见首页（「跳回首页」视觉假象）。
   ⚠️ E127 热修：.page 全局类 max-width:420px 会把 fixed inset-0 卡成
   420px 竖条（实弹 elementFromPoint 实锤右侧透出首页 VIDEO/hero）——
   须显式 max-width:none + width:100vw 覆盖。 */
.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: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  z-index: 120;
  overflow-y: auto;
  /* ⚖️ E128：滚动槽逐字对齐月报 .ks-report-scroll 黑金滑轨
     （E91-③ Sacred .dark-scrollbar 封仓规格——主公实锤条款页滑轨不一致）。 */
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.3) rgba(255, 255, 255, 0.05);
}
.policy-page::-webkit-scrollbar { width: 5px; border-radius: 4px; }
.policy-page::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 4px; }
.policy-page::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.3); border-radius: 4px; }
.policy-page::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 55, 0.6); }
.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;
}

/* ⚖️ E127-LEGAL-ROUTING-MODAL：表单原位法律条款弹窗（军令规格） */
.ks-legal-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 6, 10, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.ks-legal-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0D0D1A 0%, #080810 100%);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6), 0 0 24px rgba(212, 175, 55, 0.12);
  padding: 20px 18px 14px;
}
.ks-legal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: #D4AF37;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.ks-legal-title {
  font-size: 18px;
  font-weight: 800;
  color: #D4AF37;
  text-align: center;
  margin: 0 36px 2px 0;
  text-shadow: 0 2px 16px rgba(212, 175, 55, 0.4);
}
.ks-legal-date {
  font-size: 10px;
  color: rgba(139, 135, 120, 0.6);
  text-align: center;
  margin: 0 0 12px;
}
.ks-legal-scroll {
  overflow-y: auto;
  flex: 1;
  padding: 2px 4px 8px 2px;
  border-top: 1px solid rgba(212, 175, 55, 0.18);
  /* ⚖️ E128：滚动槽逐字对齐月报 .ks-report-scroll 黑金滑轨
     （E91-③ Sacred .dark-scrollbar 封仓规格——主公实锤弹窗滑轨不一致）。 */
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.3) rgba(255, 255, 255, 0.05);
}
/* ⚖️ E128：黑金滑轨（5px 胶囊 · 逐字克隆 .ks-report-scroll E91-③ 封仓规格） */
.ks-legal-scroll::-webkit-scrollbar { width: 5px; border-radius: 4px; }
.ks-legal-scroll::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 4px; }
.ks-legal-scroll::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.3); border-radius: 4px; }
.ks-legal-scroll::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 55, 0.6); }
.ks-legal-section {
  margin-bottom: 14px;
}
.ks-legal-h {
  font-size: 13px;
  font-weight: 700;
  color: #D4AF37;
  margin: 0 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}
.ks-legal-p {
  font-size: 12px;
  color: rgba(232, 228, 217, 0.78);
  line-height: 1.7;
  margin: 0;
}
.ks-legal-ack {
  margin-top: 12px;
  width: 100%;
  padding: 10px 0;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.55);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22) 0%, rgba(212, 175, 55, 0.10) 100%);
  color: #F0D060;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.ks-legal-ack:active {
  transform: translateY(1px);
}

/* 🛡️ 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;
  /* 🧭 E153-刀三（主公军令 2026-11-24）：卡片内按钮防溢出死锁——块级全宽＋
     受控换行，杜绝任何非中文语种按钮撑破卡片右边框（旧「flex-start 自对齐
     ＋ nowrap」＝en「Celestial Aura Today」破框溢出病灶）。 */
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  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;
  line-height: 1.35; /* 🧭 E153-刀三：军令钦定行高 */
  white-space: normal; /* 退役 nowrap：长语种按钮优雅折行 */
  overflow-wrap: anywhere; /* 泰/越长词安全断词 */
}
.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 军令①：渲染隔离，输入态变化不再外溢 */
}
/* 🆕 E144-刀二（军令 2026-11-18）：昼夜星轨色温呼吸——暖金 06:00–17:59 /
   星夜紫 18:00–05:59（CSS 变量单源；组件开舱锚相位驱动 class 切换）。
   ::after 柔光层 z-index:-1：舱体 transform 已建层叠上下文 ⇒ 光晕沉底
   不遮字不截交互；6s 呼吸关键帧纯 CSS 零算力。 */
.ks-chat-sheet { --ks-circadian: 232, 190, 90; }
.ks-chat-sheet.ks-circadian-night { --ks-circadian: 158, 126, 255; }
.ks-chat-sheet::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(130% 55% at 50% 0%, rgba(var(--ks-circadian), 0.20), transparent 70%);
  animation: ksCircadianBreath 6s ease-in-out infinite;
}
@keyframes ksCircadianBreath { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* 🖥 E68 军令②：桌面端废除 100% 大通栏 ⇒ 右下角精致悬浮陪伴舱 */
@media (min-width: 768px) {
  .ks-chat-layer { justify-content: flex-end; padding: 0 24px 20px 0; }
  /* 🐾 E77（主公亲令 2026-10-20）: 视觉动线按**角色朝向**分流 ——
     Milo 身子朝左、脸朝右 ⇒ 保持右下角，视线上抬即落对话框（原样不动）；
     Sophia 身子朝右、脸朝左 ⇒ 镜像到左下角，否则「背对聊天窗说话」。
     治法＝在 flex 层换边（justify-content + 左右内边距对调），**不是**给 sheet 加
     left/right 绝对定位：舱体在流内才能与右侧 Milo 窗严格 100% 镜像对称
     （同宽 420、同高 600、同底距 20px、同侧边距 24px），且不引入脱离文档流的叠层风险。
     入场动画 ksChatPop 是纯纵向（translateY + scale），换边不会出现横向闪现残影。 */
  .ks-chat-layer[data-familiar="sophia"] { justify-content: flex-start; padding: 0 0 20px 24px; }
  .ks-chat-mask {
    background: rgba(6, 5, 14, 0.18); /* 桌面端只轻微压暗，视频/星空完整透出 */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .ks-chat-sheet {
    /* 🏆 E135-刀一（主公军令 2026-11-11）：桌面悬浮舱扩容 —— 宽 420→477px（+15mm≈57px）、
       高 600→638px（+10mm≈38px；96 DPI 换算 1mm≈3.78px）。仅 768px 断点生效；
       移动端底部抽屉（100% × 55vh）零改动；Sophia/Milo 共用本块单源常量（E77 镜像铁律）。 */
    width: 477px;
    max-width: 90vw;
    height: 638px;
    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);
  }
}

/* ═══ 🖥 E151-刀一（军令 2026-11-24）：PC 端（≥1024px）国际轻奢精修 ═══
   基线：暗夜黑金轻奢（香槟金 #D4AF37 族＋象牙白 #F6F0E4）。移动端（<1024px）零扰动；
   E77 朝向镜像（Milo 右锚/Sophia 左锚）与 E65 趴键几何钦定红线零触碰——仅尺寸/材质/间距。 */
@media (min-width: 1024px) {
  /* ⓪ Hero 托底：极柔和暗色径向渐变（星云亮区可读性——E152-刀二） */
  .landing-container {
    background: radial-gradient(ellipse at center, rgba(12, 8, 24, 0.56) 0%, rgba(12, 8, 24, 0) 72%);
  }
  /* 🥂 E153-刀一（军令 2026-11-24）：Hero 文本区桌面放宽——解除 420px 窄列束缚
     （主公实拍病灶①：zh 孤字「故」折行重叠＋en/fr 三行挤脸，真根＝E152 字号放大
     未配套放宽容器）。六语排版分流：zh clamp(30px,2.5vw,38px)/1.32 单行；拉丁泰越
     clamp(26px,2.2vw,34px)/1.28＋text-wrap:balance 优雅 1-2 行（泰 anywhere 防截断）。
     语种落 DOM＝documentElement.lang（App.tsx languageChanged 同步）。
     ⚠️ 血训（E152 实测）：选择器须 `.input-page .title`（0-2-0）——单类 `.title`
     被 line 88 老款青辉光 specificity 压死（E151 ① 死代码血训）。 */
  .page.input-page { max-width: min(740px, 84vw); }
  .input-page .title {
    font-family: 'Noto Serif SC', 'Songti SC', Georgia, serif;
    font-size: clamp(26px, 2.2vw, 34px);
    line-height: 1.28;
    letter-spacing: 0.1em;
    color: #FAF4E8;
    text-shadow: 0 2px 16px rgba(10, 6, 22, 0.85);
    text-wrap: balance;
  }
  html[lang="zh"] .input-page .title {
    font-size: clamp(30px, 2.5vw, 38px);
    line-height: 1.32;
  }
  html[lang="th"] .input-page .title { overflow-wrap: anywhere; }
  .input-page .subtitle {
    color: rgba(246, 240, 228, 0.86);
    font-weight: 500;
    font-size: 15px;
    margin-top: 12px;
    line-height: 1.5;
    max-width: min(620px, 88vw);
    letter-spacing: 0.04em;
    text-shadow: 0 2px 16px rgba(10, 6, 22, 0.85);
  }
  /* ② 主 CTA：丝缎香槟金轻奢胶囊（E152-刀一 军令换血——旧暗浊褐半透明曜石底被
     主公线上实拍否决「颜色没有之前的协调」；缎面三段金渐变＋深曜石黑字＋顶缘
     微高光＋暖金外辉光＋hover 柔和增亮浮起） */
  .landing-start-btn {
    min-width: 248px;
    padding: 14px 40px;
    color: #181324;
    font-weight: 600;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, #F0D99C 0%, #D9B45B 52%, #C59B3E 100%);
    border: none;
    box-shadow: 0 8px 28px rgba(217, 180, 91, 0.34), inset 0 1px 0 rgba(255, 251, 235, 0.65);
    text-shadow: none;
  }
  .landing-start-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #F6E4AD 0%, #E2C268 52%, #CBA64C 100%);
    box-shadow: 0 10px 32px rgba(217, 180, 91, 0.46), inset 0 1px 0 rgba(255, 251, 235, 0.78);
  }
  /* ③ 灵宠×按钮呼吸感：🥂 E153-刀二 纵列落座——锚点容器 in-flow 真实占位
     （76px 宠位＋12px 落座间距）后，本 84px 仅匿名访客（无灵宠）基线；
     灵宠在场走 body.ks-fam-ridden 32px 档（specificity 压本行）。 */
  .landing-start-wrap { margin-top: 84px; }
  /* ④ 语言切换器：右上角安全区归位（fixed 锚定视口 top 24 / right 28）＋暗夜磨砂玻璃融入星云 */
  .lang-switch {
    position: fixed;
    top: 24px;
    right: 28px;
    background: rgba(15, 12, 24, 0.58) !important;
    border: 1px solid rgba(212, 175, 55, 0.28) !important;
    color: #F5EFE6;
    font-weight: 600;
    border-radius: 999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.38);
  }
  .lang-switch:hover {
    background: rgba(26, 21, 40, 0.74) !important;
    border-color: rgba(212, 175, 55, 0.5) !important;
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.28);
  }
  /* ⑤ 对话舱：深邃毛玻璃＋宽屏比例舒展（仅尺寸/材质；E77 流内镜像定位零触碰） */
  .ks-chat-sheet {
    width: clamp(400px, 30vw, 460px);
    height: min(680px, 76vh);
    max-height: 76vh;
    background:
      radial-gradient(120% 60% at 50% 0%, rgba(120, 90, 200, 0.20), transparent 70%),
      linear-gradient(180deg, rgba(16, 13, 26, 0.80) 0%, rgba(11, 8, 18, 0.92) 100%);
    backdrop-filter: blur(22px) saturate(1.4);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    border: 1px solid rgba(212, 175, 55, 0.24);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.66), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  /* ⑥ 快捷胶囊：受控换行＋泰语/长词防截断防撑爆（emoji 图标位天然锁定） */
  .ks-chat-pill {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
  }
}
@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;
  flex-direction: column;
  gap: 3px;
  padding: 4px 2px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex: 0 0 auto;
}
/* 🆕 E144.1-刀一（补刀军令 2026-11-18）：头部双行彻底分层——第一行
   头像＋灵宠名称（左）与 ✦灵犀星胶囊＋✕（右）严格水平对齐（军令钦定
   flex/align-items:center/justify-content:space-between 字面）；
   Sophia/Milo 共用同一结构零分叉。 */
.ks-chat-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.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); } }
/* 🆕 E144.1-刀一：名称行弹性截断（row1 左侧——长名/窄屏零挤压灵犀星）。 */
.ks-chat-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  color: #F0D060;
  letter-spacing: 0.02em;
}
/* 🆕 E144.1-刀一：状态栏独立第二行占满整行宽度（width:100% 军令钦定）——
   彻底消除与 ✦灵犀星胶囊的水平挤压（「晨曦星轨」零截断零遮挡）。
   🧭 E153-刀三（主公军令 2026-11-24）：外语长状态优雅折行——退役强制三截断
   （nowrap/overflow:hidden/text-overflow:ellipsis），改 flex-wrap:wrap＋row-gap:4px
   （fr「Harmonie de l'Après-mi」被硬截半个词的病灶根治；es/th/vi 长状态同理）。 */
.ks-chat-status {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap; /* 🧭 E153-刀三：长状态折行不截断 */
  row-gap: 4px; /* 🧭 E153-刀三：军令钦定行距 */
  width: 100%;
  font-size: 11px;
  color: rgba(237, 232, 220, 0.6);
}
.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;
}
/* 🆕 E143-刀三（军令 2026-11-17）：灵犀共生默契状态栏前缀——六语自容
   （零 i18n 键扰动）；金调前缀恒完整显示。
   🆕 E145-刀一（军令 2026-11-19）：.ks-chat-status-text 弹性截断槽整体
   退役（chatStatus 尾缀删除——昼夜词条恒完整零截断）。
   🧭 E153-刀三（军令 2026-11-24）：bond 与状态栏同折行——退役 nowrap/ellipsis
   三截断（vi「Tâm Linh Tương Thông…」实测溢出 14px 病灶；军令钦定优雅折行）。 */
.ks-chat-bond {
  flex: 0 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere; /* 泰文无空格长词安全断词 */
  color: #D4AF37;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.92;
}
/* 🆕 E143-刀三：星光呼吸微共鸣——默契跃升/极值情绪唤名/微标点亮时头像外圈
   1.5s 金色星光呼吸光晕（纯 CSS 关键帧零算力；组件态驱动 class 切换）。 */
.ks-chat-avatar-breathe { animation: ksAstralBreathe 1.5s ease-in-out 1 !important; }
@keyframes ksAstralBreathe {
  0%, 100% { filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5)); transform: scale(1); }
  50% {
    filter: drop-shadow(0 0 14px rgba(240, 208, 96, 0.95)) drop-shadow(0 0 26px rgba(212, 175, 55, 0.55));
    transform: scale(1.08);
  }
}
/* 🆕 E143-刀三：显式记忆星光微标——assistant 气泡顶部 11px 毛玻璃星光胶囊
   （军令钦定 11px；六语自容词条；单会话同类型恰 1 次）。 */
.ks-chat-badge {
  display: inline-block;
  align-self: flex-start;
  margin: 0 0 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #F0E6C8;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.ks-chat-bubble { display: flex; flex-direction: column; }
/* 🆕 E144-刀五（军令 2026-11-18）：嘴替三档行级轻点复制——hover 微亮金沿、
   ✓ 已复制 11px 金字内联闪现 1.5s（零新增卡片——交互长在既有气泡行内）。 */
.ks-chat-proxy-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  border-radius: 8px;
  margin: 1px -4px 0;
  padding: 1px 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ks-chat-proxy-line:hover { background: rgba(212, 175, 55, 0.10); }
.ks-chat-proxy-line:active { background: rgba(212, 175, 55, 0.18); }
.ks-chat-proxy-text { flex: 1 1 auto; min-width: 0; }
.ks-chat-copy-done {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: #D4AF37;
  letter-spacing: 0.02em;
}
/* 🆕 E144-刀四（军令 2026-11-18）：日历锁内联微胶囊——复用 .ks-chat-badge
   11px 毛玻璃形制（button 形态归零：字体继承＋手型＋金沿 hover 提亮）。 */
.ks-chat-cal-pill {
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ks-chat-cal-pill:hover { background: rgba(212, 175, 55, 0.22); border-color: rgba(212, 175, 55, 0.55); }
.ks-chat-cal-pill:active { background: rgba(212, 175, 55, 0.32); }
@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); }
/* 🏆 E112-刀三（主公军令 2026-11-01）：灵犀星徽章归位对话舱 Header——
   与标题行平行靠右（✕ 左侧）深空黑金轻奢胶囊 [ ✦ 灵犀星: N ] */
.ks-chat-star {
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(212, 175, 55, 0.1);
  color: #D4AF37;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
  cursor: default; /* 🏆 E113-刀五（军令钦定）：2.0 兑换未就绪 ⇒ 拔手型指针静默化 */
}

.ks-chat-flow {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* 🏆 E135-刀二（主公军令 2026-11-11）：左缘垂线对齐 —— padding-x 2px→0，
     对话流内框（路书卡/文本气泡）左沿与下方提示条胶囊左沿
     getBoundingClientRect().left 恒等（Δ=0px；sheet padding 14px 单源）。 */
  padding: 12px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overscroll-behavior: contain;
  /* 🔴 E108-刀四（主公军令 2026-11-01）：对话窗滚动槽对齐月报黑金细轨——
     主公实锤：对话窗右侧为原生灰白粗滚动槽，与深空黑金舱体不融。
     规格逐字克隆月报 .ks-report-scroll（E91-③ Sacred .dark-scrollbar 封仓源）：
     5px 胶囊轨、近透明轨道、哑光暗金 0.3 滑块、hover 鎏金提亮。 */
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.3) rgba(255, 255, 255, 0.05);
}
/* 🔴 E108-刀四：黑金滑轨（5px 胶囊 · 逐字克隆 .ks-report-scroll 规格） */
.ks-chat-flow::-webkit-scrollbar { width: 5px; border-radius: 4px; }
.ks-chat-flow::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 4px; }
.ks-chat-flow::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.3); border-radius: 4px; }
.ks-chat-flow::-webkit-scrollbar-thumb:hover { background: rgba(212, 175, 55, 0.6); }
.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;
  flex-wrap: wrap; /* 🧩 E70：三颗药丸必须完整可见，禁横向滚动裁切（真机上横滚条无任何提示 ⇒ 第三条被挡住） */
  gap: 6px 7px;
  padding: 2px 0 8px;
  flex: 0 0 auto;
}
.ks-chat-pill {
  flex: 0 1 auto;
  max-width: 100%;
  font-size: 11.5px;
  line-height: 1.3;
  text-align: left;
  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;
  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); }
}

/* ═══ 🤝 E160-刀六（主公军令 2026-11-29）：手机（≤768px）灵宠对话框升全屏 ═══
   旧形制：底部 55vh 半屏抽屉（留上半屏透视频）。新形制逐字落实军令：position:fixed; inset:0;
   width:100%; height/max-height 100dvh（回退 100vh）；border-radius:0；拖拽灰条取消；
   顶栏 padding-top max(12px, env(safe-area-inset-top))；对话流 flex:1 纵向滚动；
   底部 padding-bottom max(12px, env(safe-area-inset-bottom))（由舱体 padding 单点承载，不与输入条叠加）。
   🔴 基座 55vh（E66/E135 闸门锚定）与桌面悬浮舱（≥768px 块，E135/E151 锚定）零触碰；
   本块置于对话舱全部基础规则之后（同特异度靠源序覆盖；恰 768px 两块皆命中 ⇒ 军令「≤768」以本块为准）。 */
@media (max-width: 768px) {
  .ks-chat-layer { padding: 0; justify-content: center; } /* 全屏态 sheet 已 fixed inset:0 ⇒ layer 仅归零内边距；不碰 sophia 镜像选择器（e66 守卫） */
  .ks-chat-sheet {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100vh;      /* 回退：不支持 dvh 的旧内核 */
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    padding: 0 14px max(12px, env(safe-area-inset-bottom));
    box-shadow: none;
  }
  .ks-chat-grab { display: none; }
  .ks-chat-head { padding-top: max(12px, env(safe-area-inset-top)); }
  .ks-chat-flow { flex: 1 1 0%; overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* ═══════════════════════════════════════════════════════════════════
   🐾🏆💠 E105（主公军令 2026-10-30）：伴读共鸣／命盘金卡／骨架承接样式
   ═══════════════════════════════════════════════════════════════════ */

/* ── 刀一 · 灵宠伴读（微光呼吸态＋共鸣气泡浮现）── */
@keyframes ks-companion-breathe {
  0%, 100% { box-shadow: 0 6px 22px rgba(0,0,0,0.5), 0 0 0 rgba(212,175,55,0); }
  50% { box-shadow: 0 6px 22px rgba(0,0,0,0.5), 0 0 14px rgba(212,175,55,0.35); }
}
.ks-companion-milo, .ks-companion-sophia, .ks-companion-badge {
  transition: transform 180ms ease, filter 180ms ease;
}
.ks-companion-milo:hover, .ks-companion-sophia:hover, .ks-companion-badge:hover {
  transform: translateY(-3px);
  border-color: rgba(212,175,55,0.8);
}
.ks-companion-toast {
  animation: ks-companion-slidein 260ms ease-out;
}
@keyframes ks-companion-slidein {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.ks-companion-drawer {
  animation: ks-companion-drawer-up 280ms ease-out;
}
@keyframes ks-companion-drawer-up {
  from { transform: translateY(60%); }
  to { transform: translateY(0); }
}

/* ── 刀二 · 金卡导出（CTA 微光＋移动端全屏弹层）── */
.ks-goldcard-export button {
  transition: box-shadow 200ms ease, transform 180ms ease;
}
.ks-goldcard-export button:not(:disabled):hover {
  box-shadow: 0 6px 24px rgba(212,175,55,0.28);
  transform: translateY(-1px);
}
.ks-goldcard-modal {
  animation: ks-goldcard-fadein 220ms ease-out;
}
@keyframes ks-goldcard-fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── 刀三 · 深空黑金 Shimmer 骨架屏（付讫→Hydrate 承接，CLS=0）── */
.ks-skeleton-guard {
  border-radius: 14px;
  border: 1px solid rgba(212,175,55,0.18);
  background: rgba(14, 15, 20, 0.4);
  padding: 22px 18px;
}
.ks-shimmer-line {
  position: relative;
  height: 16px;
  border-radius: 6px;
  margin-bottom: 14px;
  overflow: hidden;
  background: linear-gradient(100deg, rgba(212,175,55,0.06) 0%, rgba(212,175,55,0.14) 40%, rgba(212,175,55,0.06) 80%);
}
.ks-shimmer-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(243,229,171,0.10) 50%, transparent 80%);
  animation: ks-shimmer-sweep 1.6s ease-in-out infinite;
}
@keyframes ks-shimmer-sweep {
  0% { transform: translateX(-70%); }
  100% { transform: translateX(70%); }
}
.ks-shimmer-w80 { width: 80%; }
.ks-shimmer-w90 { width: 90%; }
.ks-shimmer-w75 { width: 75%; }
.ks-shimmer-w60 { width: 60%; }
.ks-shimmer-w50 { width: 50%; }

/* ── 双端视口分流（桌面双宠对角 / 移动单宠徽章——组件内 matchMedia 驱动，此处为降级兜底）── */
@media (max-width: 768px) {
  .ks-companion-milo, .ks-companion-sophia { display: none; }
  .ks-skeleton-guard { padding: 16px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .ks-companion-milo, .ks-companion-sophia, .ks-companion-badge,
  .ks-companion-toast, .ks-companion-drawer, .ks-goldcard-modal,
  .ks-shimmer-line::after { animation: none; }
}

/* ═══ 🆕 E145-刀四（军令 2026-11-19）：灵魂成长年鉴卡（报告页/姻缘结果区）═══
   黑金玻璃卡轻量形态：标题行（✦ 灵魂成长年鉴＋已解锁/待解锁状态胶囊）＋
   提示行＋导出按钮（已解锁态）；零价格字眼（对话舱红线安全）。 */
.ks-chronicle-card {
  margin: 18px auto 0;
  max-width: 560px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(18, 24, 38, 0.72);
  border: 1px solid rgba(212, 175, 55, 0.28);
}
.ks-chronicle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ks-chronicle-title {
  font-size: 14px;
  font-weight: 800;
  color: #D4AF37;
  letter-spacing: 0.04em;
}
.ks-chronicle-state {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  color: #8A93A6;
  background: rgba(138, 147, 166, 0.12);
}
.ks-chronicle-state.is-unlocked {
  color: #81D8D0;
  background: rgba(129, 216, 208, 0.12);
}
.ks-chronicle-hint {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: #CFE0E8;
}
.ks-chronicle-cta {
  margin-top: 10px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.1);
  color: #D4AF37;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
/* 🆕 E147-刀四（军令 2026-11-19）：蓄能态置灰——双门槛（≥30 天＋轨迹≥5）
   未齐过前导出按钮禁用（防空壳导出）。 */
.ks-chronicle-cta.is-charging {
  border-color: rgba(138, 147, 166, 0.3);
  background: rgba(138, 147, 166, 0.08);
  color: #8A93A6;
  cursor: not-allowed;
}
.ks-chronicle-charging {
  margin: 8px 0 0;
  font-size: 10.5px;
  line-height: 1.6;
  color: #C9B27C;
  letter-spacing: 0.02em;
}
.ks-chronicle-locked {
  margin: 8px 0 0;
  font-size: 10.5px;
  color: #8A93A6;
}

/* ⚖️ E157（主公军令 2026-11-26）：合规定位声明——输入页主按钮下 / 三场景报告尾 / 财富报告尾 三处常驻。
   12px 浅香槟灰高可读；行高宽松；绝不隐藏（零 opacity / display / visibility 花招）；
   多语防溢出：fr/es/th/vi 受控多行（anywhere 断词，不撑破容器）；泰语强制 1.55。 */
.ks-compliance-note,
.ks-compliance-note.ks-compliance-note {
  margin: 10px 0 0;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  color: #D9CFB8;
  font-style: normal;
  text-align: center;
  opacity: 1;
  visibility: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.ks-compliance-note:lang(th),
.ks-compliance-note.ks-compliance-note:lang(th) {
  line-height: 1.55;
}

/* ✦ E158-刀一（主公军令 2026-11-26）：双人坐标输入页主按钮——亮青 #2ECBF7 退役，换站点高定
   丝缎香槟金渐变＋深黑高对比字（与 /result 金主按钮同一视觉语系；E152 PC 首屏 CTA 同源色）。
   选择器叠 data-testid ⇒ specificity 压过 .btn-primary / :hover，不动被闸门钉死的 className 字面。 */
.btn-primary[data-testid="e156-cta"] {
  background: linear-gradient(135deg, #F0D99C 0%, #D9B45B 52%, #C59B3E 100%);
  color: #0D0D1A;
  text-shadow: none;
  box-shadow: 0 6px 22px rgba(217, 180, 91, 0.28);
}
.btn-primary[data-testid="e156-cta"]:hover,
.btn-primary[data-testid="e156-cta"]:active {
  background: linear-gradient(135deg, #F6E3AE 0%, #E3BF69 52%, #CFA64A 100%);
  color: #0D0D1A;
  box-shadow: 0 8px 26px rgba(217, 180, 91, 0.4);
}

/* ✦ E158-刀七：单活手风琴折叠条（黑金；✦ 标题 · 已 unlocked ｜ 右侧香槟金「展开重温 ▼」胶囊） */
.ks-e158-bar {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
  padding: 10px 10px 10px 14px;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.14) 0%, rgba(13, 13, 26, 0.85) 60%);
  color: #F3E5AB;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ks-e158-bar-title { min-width: 0; line-height: 1.5; overflow-wrap: anywhere; }
.ks-e158-bar-unlocked { color: rgba(243, 229, 171, 0.72); font-weight: 600; }
.ks-e158-bar-reopen {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #F0D99C 0%, #D9B45B 60%, #C59B3E 100%);
  color: #0D0D1A;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.ks-e158-bar[lang="th"], .ks-e158-bar[lang="th"] * { line-height: 1.55; overflow-wrap: anywhere; }
.ks-e158-fold { min-width: 0; }

/* ✦ E159-刀五（主公军令 2026-11-27）：昵称输入框 placeholder 零裁切——
   en/es/vi 精简措辞＋字号 12px（移动端 11.5px），259px 内宽六语 100% 完整展示。 */
.ks-e159-nickname-input::placeholder { font-size: 12px; letter-spacing: 0; }
@media (max-width: 480px) {
  .ks-e159-nickname-input::placeholder { font-size: 11.5px; }
}
