/* 走进化学命理 · 品牌样式（ELEMENT-07）：深空背景、玻璃拟态、金属金点缀。叠加在 app.css 之后，旧页面通过变量自动换为深色。 */
:root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
  --space-0: #04060c; --space-1: #080d19; --space-2: #0f182b; --space-3: #16223a;
  --bg: var(--space-1); --surface: rgba(255,255,255,.045); --surface-2: rgba(255,255,255,.07);
  --ink: #ece7dc; --muted: #9aa3b5; --line: rgba(255,255,255,.09);
  --accent: #e3bd74; --accent-ink: #1a1408; --warn: #f0b45c; --danger: #ff8f84; --ok: #6fd3a0;
  --gold-1: #f6e2b3; --gold-2: #d9ae62; --gold-3: #a77c3c;
  --wood: #4fc28b; --fire: #ff7a45; --earth: #d9a85c; --metal: #e6e1d3; --water: #4aa3ff;
  --wood-bg: rgba(79,194,139,.12); --fire-bg: rgba(255,122,69,.12); --earth-bg: rgba(217,168,92,.12); --metal-bg: rgba(230,225,211,.10); --water-bg: rgba(74,163,255,.12);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --radius: 18px; --shadow: 0 10px 40px rgba(0,0,0,.35);
  --glass-blur: blur(16px) saturate(140%);
  color-scheme: dark;
}
body {
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(74,110,190,.20), transparent 60%),
    radial-gradient(900px 600px at -10% 20%, rgba(217,174,98,.10), transparent 60%),
    radial-gradient(800px 800px at 50% 120%, rgba(60,40,120,.22), transparent 60%),
    linear-gradient(180deg, var(--space-1), var(--space-0) 70%);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
}
body::before { /* 细密星点 */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .55;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff8, transparent), radial-gradient(1px 1px at 67% 32%, #fff6, transparent),
    radial-gradient(1.2px 1.2px at 82% 74%, #ffe9b8aa, transparent), radial-gradient(1px 1px at 31% 81%, #fff5, transparent),
    radial-gradient(1px 1px at 48% 52%, #fff4, transparent), radial-gradient(1.4px 1.4px at 91% 12%, #cfe3ff99, transparent),
    radial-gradient(1px 1px at 5% 63%, #fff5, transparent), radial-gradient(1px 1px at 58% 93%, #fff4, transparent);
  background-size: 640px 640px;
}
a { color: var(--gold-1); }
a:hover { color: #fff3d1; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .02em; }
.gold-text { background: linear-gradient(120deg, var(--gold-1), var(--gold-2) 45%, #fff2cf 60%, var(--gold-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* 顶栏 */
.topbar { background: rgba(6,10,20,.55); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(246,226,179,.35), 0 0 18px rgba(217,174,98,.35); }
.brand-title { font-family: var(--serif); font-size: 1.15rem; letter-spacing: .12em; }
.topbar nav a { color: var(--ink); opacity: .86; }
.topbar nav a:hover { opacity: 1; text-decoration: none; color: var(--gold-1); }
.topbar .credit-pill { border: 1px solid rgba(246,226,179,.35); border-radius: 999px; padding: 2px 10px; font-size: .85rem; color: var(--gold-1); }

/* 卡片与面板：玻璃拟态 */
.card, .panel, .glass {
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.card { padding: clamp(18px, 3vw, 32px); }
main { max-width: 1120px; margin: 0 auto; padding: clamp(16px, 3vw, 36px) clamp(16px, 4vw, 40px) 80px; }
main.wide { max-width: 1280px; }

/* 按钮 */
.btn { background: linear-gradient(135deg, var(--gold-1), var(--gold-2) 55%, var(--gold-3)); color: #1b1407; border: 0; border-radius: 999px; padding: .62em 1.4em; font-weight: 600; letter-spacing: .04em; box-shadow: 0 6px 22px rgba(217,174,98,.28), inset 0 1px 0 rgba(255,255,255,.45); cursor: pointer; display: inline-block; }
.btn:hover { filter: brightness(1.06); text-decoration: none; color: #1b1407; }
.btn.ghost { background: rgba(255,255,255,.05); color: var(--ink); border: 1px solid rgba(255,255,255,.18); box-shadow: none; }
.btn.ghost:hover { border-color: rgba(246,226,179,.5); color: var(--gold-1); }
.btn.small { padding: .38em 1em; font-size: .9rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input, select, textarea { background: rgba(0,0,0,.28); color: var(--ink); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(217,174,98,.18); }
.notice { background: rgba(74,163,255,.08); border: 1px solid rgba(74,163,255,.25); border-radius: 12px; }
.alert { background: rgba(255,143,132,.08); border: 1px solid rgba(255,143,132,.3); border-radius: 12px; color: #ffd2cc; }
.foot { border-top: 1px solid var(--line); color: var(--muted); background: rgba(4,6,12,.4); }

/* 欢迎动画 */
.welcome { position: fixed; inset: 0; z-index: 100; background: radial-gradient(circle at 50% 45%, #0d1527, #03050a 75%); display: grid; place-items: center; transition: opacity .9s ease; }
.welcome canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.welcome .skip { position: absolute; right: 20px; bottom: 20px; z-index: 2; }
.welcome .welcome-logo { position: absolute; z-index: 1; left: 50%; top: 50%; width: 62vmin; height: 62vmin; border-radius: 6%; opacity: 0; transition: opacity 1.2s ease, transform 1.4s ease; transform: translate(-50%, calc(-50% - 3vh)) scale(.97); box-shadow: 0 0 90px rgba(217,174,98,.28); }
.welcome.show-logo .welcome-logo { opacity: 1; transform: translate(-50%, calc(-50% - 3vh)) scale(1); }
.welcome.leaving { opacity: 0; pointer-events: none; }

/* 首页 */
.hero-v2 { position: relative; min-height: min(78vh, 720px); display: grid; align-items: center; padding: clamp(24px, 6vw, 80px) 0; overflow: hidden; }
.hero-v2 canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-v2 .hero-copy { position: relative; z-index: 1; max-width: 620px; }
.hero-v2 h1 { font-size: clamp(2.2rem, 6vw, 4rem); margin-bottom: .3em; }
.hero-v2 .lead { font-size: clamp(1.02rem, 2vw, 1.2rem); color: #d8d2c4; }
.hero-v2 .cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.4em; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 36px 0; }
.feature-grid .card h3 { margin-top: 0; }
.fine { font-size: .82rem; color: var(--muted); }

/* 生成等待场景 */
.genesis { position: relative; min-height: 70vh; border-radius: var(--radius); overflow: hidden; }
.genesis canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.genesis .genesis-ui { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; min-height: 70vh; padding: clamp(16px, 4vw, 36px); background: linear-gradient(180deg, transparent 50%, rgba(3,5,10,.75)); }
.genesis .stage-label { font-family: var(--serif); font-size: clamp(1.2rem, 3vw, 1.7rem); letter-spacing: .1em; }
.genesis .real-progress { list-style: none; padding: 0; margin: .6em 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .88rem; color: var(--muted); }
.genesis .real-progress li.done { color: var(--ok); }
.genesis .real-progress li.active { color: var(--gold-1); }

/* 结果页 */
.result-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 36px); align-items: center; }
.result-hero .structure-canvas { width: 100%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.04), transparent 70%); }
.result-hero .portrait { font-family: var(--serif); font-size: clamp(1.25rem, 2.6vw, 1.75rem); line-height: 1.6; }
.core-badge { display: inline-flex; align-items: baseline; gap: 10px; padding: 8px 16px; border-radius: 14px; border: 1px solid rgba(246,226,179,.35); background: rgba(217,174,98,.08); }
.core-badge .sym { font-family: Georgia, "Times New Roman", serif; font-size: 2.2rem; line-height: 1; }
.labels { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.label-chip { border-radius: 999px; padding: 6px 14px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); font-size: .92rem; }
.label-chip b { color: var(--gold-1); font-weight: 600; margin-right: 6px; }
.role-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.role-cell { border-radius: 16px; padding: 14px 12px; border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.04); text-align: center; position: relative; overflow: hidden; }
.role-cell::before { content: ""; position: absolute; inset: auto -30% -60% -30%; height: 90%; background: radial-gradient(circle, var(--c, #fff3), transparent 65%); opacity: .35; }
.role-cell .syms { font-family: Georgia, serif; font-size: 1.4rem; position: relative; }
.role-cell .role { display: inline-block; margin-top: 6px; font-size: .82rem; padding: 2px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); position: relative; }
.role-cell .role.r-亲和 { color: #9ff0c7; border-color: rgba(111,211,160,.5); }
.role-cell .role.r-催化 { color: #ffe1a3; border-color: rgba(246,226,179,.5); }
.role-cell .role.r-抑制, .role-cell .role.r-耗散, .role-cell .role.r-饱和 { color: #ffc0b8; border-color: rgba(255,143,132,.45); }
.role-cell .role.r-未判定 { color: var(--muted); }
.role-cell .share { position: relative; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 12px; }
.section-title h2 { margin: 0; }
.section-title .hint { color: var(--muted); font-size: .88rem; }
.theme-grid, .inter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.theme-card .dir { font-size: .82rem; padding: 2px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); }
.theme-card .dir.d-正面 { color: #9ff0c7; } .theme-card .dir.d-负面 { color: #ffc0b8; } .theme-card .dir.d-中性 { color: var(--muted); }
.timeline { position: relative; display: grid; gap: 12px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--gold-2), rgba(217,174,98,.1)); }
.win { position: relative; }
.win::before { content: ""; position: absolute; left: -20px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--space-2); border: 2px solid var(--gold-2); }
.win.k-顺势窗口::before { border-color: var(--ok); } .win.k-调整窗口::before { border-color: var(--danger); } .win.current::before { box-shadow: 0 0 0 4px rgba(217,174,98,.25); }
.win .years { font-family: Georgia, serif; font-size: 1.15rem; letter-spacing: .04em; }
.win .kind { font-size: .82rem; margin-left: 8px; color: var(--muted); }
.inter-card .term { font-family: var(--serif); font-size: 1.15rem; }
.inter-card .syms { font-family: Georgia, serif; color: var(--gold-1); }
.empty-note { color: var(--muted); border: 1px dashed rgba(255,255,255,.14); border-radius: 14px; padding: 14px 16px; }
.media-cta { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.disclaimer-box { font-size: .86rem; color: var(--muted); }

/* 客服挂件 */
.cs-fab { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 54px; height: 54px; border-radius: 50%; border: 1px solid rgba(246,226,179,.45); background: radial-gradient(circle at 35% 30%, #2a3656, #0d1424); color: var(--gold-1); font-size: .82rem; box-shadow: 0 8px 26px rgba(0,0,0,.45), 0 0 24px rgba(217,174,98,.2); cursor: pointer; }
.cs-panel { position: fixed; right: 18px; bottom: 84px; z-index: 50; width: min(340px, calc(100vw - 36px)); max-height: 70vh; overflow: auto; padding: 18px; }
.cs-panel h3 { margin: 0 0 8px; }
.cs-panel .qr { width: 160px; height: 160px; border-radius: 12px; background: #fff; display: block; margin: 10px 0; object-fit: contain; }
.cs-panel dl { margin: 8px 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.cs-panel dt { color: var(--muted); }
.cs-panel .topup { font-size: .86rem; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }

/* 媒体 */
.media-offer .price { font-size: 1.05rem; }
.media-offer .price b { color: var(--gold-1); font-size: 1.3rem; }
.media-figure { margin: 16px 0; }
.media-figure img, .media-figure video { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); background: #000; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
.media-tile { display: grid; gap: 6px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--ink); }
.media-tile img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }
.video-tile { display: grid; place-items: center; aspect-ratio: 16/9; border-radius: 10px; background: linear-gradient(135deg, #16223a, #070b14); color: var(--gold-1); }
.video-studio canvas { width: 100%; height: auto; aspect-ratio: 16/9; border-radius: 16px; background: #000; border: 1px solid var(--line); }
.progress-bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress-bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-3), var(--gold-1)); transition: width .3s; }

@media (max-width: 760px) {
  .result-hero { grid-template-columns: 1fr; }
  .result-hero .structure-canvas { max-width: 420px; margin: 0 auto; }
  .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-cta { grid-template-columns: 1fr; }
  .brand-title { font-size: 1rem; letter-spacing: .06em; }
  .topbar nav { gap: 10px; font-size: .92rem; }
}
@media (prefers-reduced-motion: reduce) {
  .welcome, .welcome .welcome-logo { transition: none; }
}

/* LYAI-FIX-01: the main site's official logo in the copy's header (a cream pill keeps its brown and orange legible on the dark bar) */
.home-brand { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: rgba(255, 249, 240, .94); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.home-brand img { display: block; height: 22px; width: auto; }
