:root {
  --bg: #050b12;
  --panel: rgba(8, 20, 31, .78);
  --panel2: rgba(11, 31, 45, .72);
  --line: rgba(159, 211, 222, .24);
  --line2: rgba(248, 218, 145, .34);
  --gold: #f2d58e;
  --gold2: #b79755;
  --cyan: #3fb6dc;
  --text: #f7ebc6;
  --muted: #91a9b5;
  --soft: #d5c28b;
  --green: #1fda88;
  --red: #e16d54;
  --font-display: "Palatino Linotype", Georgia, "Noto Serif SC", "Source Han Serif SC", "STZhongsong", "SimSun", serif;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease; }
button:active { transform: translateY(1px); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

.cosmos {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 72% 26%, rgba(24, 113, 155, .32), transparent 30%),
    radial-gradient(circle at 43% 53%, rgba(47, 150, 200, .18), transparent 28%),
    linear-gradient(110deg, #05080e, #07131c 44%, #02060b);
}

.cosmos::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 48%, rgba(116, 183, 211, .13) 49%, transparent 51%),
    linear-gradient(25deg, transparent 0 60%, rgba(116, 183, 211, .08) 61%, transparent 63%),
    radial-gradient(circle, rgba(255,255,255,.38) 0 1px, transparent 1px),
    radial-gradient(circle, rgba(255,255,255,.22) 0 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 58px 58px, 93px 93px;
  background-position: 0 0, 0 0, 0 0, 29px 41px;
  opacity: .5;
  animation: cosmosTwinkle 9s ease-in-out infinite alternate;
}

.cosmos::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 16% 84%, rgba(183, 151, 85, .10), transparent 34%),
    radial-gradient(ellipse at 50% 118%, rgba(28, 137, 190, .13), transparent 58%),
    radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(2, 5, 9, .5) 100%);
}

@keyframes cosmosTwinkle {
  from { opacity: .36; }
  to { opacity: .62; }
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  border-right: 1px solid var(--line);
  background: rgba(4, 11, 18, .82);
  backdrop-filter: blur(14px);
  padding: 20px 18px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  z-index: 4;
}

.brand {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 58px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line2);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 31px;
  box-shadow: inset 0 0 22px rgba(242, 213, 142, .13), 0 0 20px rgba(63, 182, 220, .12);
  animation: markGlow 5.5s ease-in-out infinite alternate;
}

@keyframes markGlow {
  from { box-shadow: inset 0 0 22px rgba(242, 213, 142, .13), 0 0 18px rgba(63, 182, 220, .10); }
  to { box-shadow: inset 0 0 26px rgba(242, 213, 142, .24), 0 0 32px rgba(63, 182, 220, .24); }
}

.brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 27px;
  letter-spacing: .02em;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(242, 213, 142, .22);
}

.brand span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 26px;
}

.nav button {
  position: relative;
  height: 46px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: rgba(247, 235, 198, .72);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  font-weight: 800;
  font-size: 16px;
  text-align: left;
}

.nav button:hover { transform: translateX(3px); }
.nav button:active { transform: translateX(3px) translateY(1px); }

.nav button.active::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--gold), rgba(242, 213, 142, .15));
  box-shadow: 0 0 10px rgba(242, 213, 142, .45);
}

.nav button span {
  width: 20px;
  text-align: center;
  color: rgba(247, 235, 198, .78);
}

.nav button.active,
.nav button:hover {
  border-color: var(--line2);
  background: linear-gradient(90deg, rgba(242, 213, 142, .20), rgba(63, 182, 220, .10));
  color: var(--text);
  box-shadow: inset 0 0 30px rgba(242, 213, 142, .09);
}

.rank-card {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(12, 31, 43, .88), rgba(6, 14, 23, .8));
  padding: 18px;
}

.crown {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line2);
  border-radius: 50%;
  color: var(--gold);
}

.rank-card h3 { margin: 14px 0 8px; color: var(--gold); font-family: var(--font-display); font-size: 22px; }
.rank-card p, .tiny-note { color: var(--muted); line-height: 1.6; font-size: 13px; }
.rank-card button {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line2);
  border-radius: 9px;
  background: rgba(242, 213, 142, .10);
  color: var(--text);
  margin-top: 14px;
  font-weight: 800;
}

.tiny-note {
  margin: 12px 4px 0;
}

.topbar {
  position: fixed;
  top: 0;
  left: 280px;
  right: 0;
  height: 74px;
  display: grid;
  grid-template-columns: minmax(360px, 560px) 1fr;
  align-items: center;
  gap: 18px;
  padding: 0 28px 0 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 9, 15, .65);
  backdrop-filter: blur(14px);
  z-index: 3;
}

.search {
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(4, 13, 22, .86);
  display: grid;
  grid-template-columns: 36px 1fr 45px;
  align-items: center;
  padding: 0 13px;
  color: var(--muted);
}

.search input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}

kbd {
  border: 1px solid rgba(255,255,255,.1);
  color: #8fa3ac;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.top-actions button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(8, 20, 31, .85);
  padding: 0 16px;
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.top-actions b { color: var(--gold); }
.user-pill span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line2);
  margin-right: 6px;
}

.content {
  margin-left: 280px;
  padding: 104px 34px 58px;
  min-height: 100vh;
}

.view { display: none; }
.view.active { display: block; animation: fadeIn .18s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(320px, .95fr) minmax(340px, 1.1fr) 340px;
  gap: 22px;
  min-height: 545px;
  border: 1px solid var(--line);
  background: linear-gradient(110deg, rgba(5, 13, 23, .94), rgba(8, 34, 53, .58));
  box-shadow: inset 0 0 100px rgba(28, 137, 190, .12);
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.hero-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 62% 50%, rgba(53, 175, 231, .22), transparent 28%);
  pointer-events: none;
}

.hero-copy, .disc-stage, .fortune-card { position: relative; z-index: 1; }
.path { color: var(--gold); }
h1, h2, h3, p { margin: 0; }
h1 {
  margin-top: 18px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(48px, 4.2vw, 66px);
  line-height: 1.14;
  letter-spacing: .01em;
  text-shadow: 0 0 22px rgba(242, 213, 142, .2);
  animation: heroGlow 6s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  from { text-shadow: 0 0 20px rgba(242, 213, 142, .14); }
  to { text-shadow: 0 0 34px rgba(242, 213, 142, .34), 0 0 60px rgba(63, 182, 220, .12); }
}

.hero-copy p {
  max-width: 560px;
  margin-top: 22px;
  color: #d1d7d3;
  line-height: 1.75;
  font-size: 17px;
}

.hero-copy p b { color: var(--gold); font-size: 22px; }
blockquote {
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 24px;
  margin: 22px 0 0;
  color: var(--text);
  line-height: 1.9;
  background: rgba(3, 12, 20, .54);
  font-size: 16px;
}
blockquote small { display: block; color: var(--soft); text-align: right; }

.hero-actions { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.form-actions, .result-actions { display: grid; gap: 12px; margin-top: 18px; }
.result-actions { grid-template-columns: 1fr 1fr; }
.result-actions .gold-btn { grid-column: 1 / -1; }
.form-actions .ghost-link, .result-actions .ghost-link { margin-top: 0; }
.workspace-link, .analysis-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(63, 182, 220, .28);
  border-left: 3px solid var(--cyan);
  border-radius: 10px;
  background: rgba(15, 48, 66, .24);
}
.workspace-link small { display: block; color: var(--muted); margin-bottom: 4px; }
.workspace-link b { color: var(--soft); }
.workspace-link p, .analysis-context { color: var(--muted); font-size: 13px; line-height: 1.55; }
.workspace-link p { margin-top: 4px; }
.workspace-link .ghost-link { width: auto; margin: 0; flex: 0 0 auto; }
.analysis-context { margin: 14px 0 0; }
.gold-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  border: 1px solid #f4dea1;
  border-radius: 11px;
  background: linear-gradient(180deg, #f7e2a6, #d8b464 62%, #c39f52);
  color: #1a1206;
  padding: 0 30px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .5px;
  box-shadow: 0 10px 26px rgba(200, 158, 70, .32), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.gold-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -140%;
  width: 55%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-18deg);
  transition: left .6s ease;
  pointer-events: none;
}
.gold-btn:hover::after { left: 150%; }
.gold-btn:hover {
  background: linear-gradient(180deg, #fbe9b6, #e2c072 62%, #cca858);
  box-shadow: 0 12px 32px rgba(216, 176, 88, .46), inset 0 1px 0 rgba(255, 255, 255, .55);
  transform: translateY(-1px);
}
.gold-btn.soft {
  background: rgba(242, 213, 142, .14);
  color: var(--gold);
  border-color: var(--line2);
  box-shadow: none;
}
.gold-btn.soft:hover {
  background: rgba(242, 213, 142, .24);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
}
.gold-btn.full { width: 100%; }
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  min-height: 44px;
  border: 1px solid var(--line2);
  border-radius: 22px;
  background: rgba(3, 12, 20, .55);
  padding: 0 22px;
  font-weight: 800;
  color: var(--gold);
}
.ghost-link:hover {
  background: rgba(242, 213, 142, .12);
  border-color: var(--gold);
}

.disc-stage { display: grid; place-items: center; }
.disc {
  width: min(430px, 32vw);
  aspect-ratio: 1;
  position: relative;
  border-radius: 50%;
  border: 1px solid rgba(242, 213, 142, .28);
  background:
    radial-gradient(circle, rgba(255,244,193,.16) 0 3%, transparent 4%),
    radial-gradient(circle at 34% 36%, rgba(243, 221, 154, .9) 0 10%, #050b12 10.5% 20%, transparent 21%),
    radial-gradient(circle, rgba(4, 16, 28, .1), rgba(53, 164, 220, .30) 62%, rgba(3, 8, 14, .85) 63%),
    conic-gradient(from 20deg, rgba(242,213,142,.26), rgba(63,182,220,.2), rgba(242,213,142,.22));
  box-shadow: 0 0 70px rgba(45, 156, 210, .40), inset 0 0 80px rgba(255,255,255,.08);
  animation: discBreath 8s ease-in-out infinite alternate;
}

@keyframes discBreath {
  from { box-shadow: 0 0 55px rgba(45, 156, 210, .30), inset 0 0 70px rgba(255,255,255,.06); }
  to { box-shadow: 0 0 96px rgba(45, 156, 210, .52), 0 0 40px rgba(242, 213, 142, .18), inset 0 0 90px rgba(255,255,255,.11); }
}

.disc::before, .disc::after {
  content: "";
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(242, 213, 142, .18);
  border-radius: 50%;
}
.disc::after { inset: 29%; border-color: rgba(95, 190, 226, .25); }
.taiji {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 110px;
  height: 110px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 25%, #050b12 0 12%, transparent 13%), linear-gradient(90deg, #f4dea1 50%, #050b12 50%);
  border: 1px solid var(--line2);
  animation: taijiSpin 26s linear infinite;
}

@keyframes taijiSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.taiji span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 75%, #f4dea1 0 12%, transparent 13%);
}
.gua {
  position: absolute;
  color: var(--gold);
  font-size: 32px;
  display: grid;
  justify-items: center;
  gap: 3px;
  text-shadow: 0 0 18px rgba(242,213,142,.34);
}
.gua::after {
  display: block;
  font-size: 38px;
  line-height: .7;
  opacity: .95;
}
.qian::after { content: "☰"; }
.dui::after { content: "☱"; }
.li::after { content: "☲"; }
.zhen::after { content: "☳"; }
.xun::after { content: "☴"; }
.kan::after { content: "☵"; }
.gen::after { content: "☶"; }
.kun::after { content: "☷"; }
.qian { top: 16%; left: 49%; }
.dui { top: 24%; right: 22%; }
.li { top: 48%; right: 14%; }
.zhen { bottom: 20%; right: 24%; }
.xun { bottom: 14%; left: 49%; }
.kan { bottom: 25%; left: 22%; }
.gen { top: 48%; left: 14%; }
.kun { top: 24%; left: 22%; }

.fortune-card, .glass-panel, .feature-row article, .thumbnail-row article {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: inset 0 0 28px rgba(63, 182, 220, .06), 0 18px 50px rgba(0,0,0,.18);
}
.feature-row article, .thumbnail-row article, .topic-card, .method-card {
  transition: transform .18s ease, border-color .18s ease, box-shadow .22s ease, background .22s ease;
}
.feature-row article:hover {
  transform: translateY(-4px);
  border-color: var(--line2);
  box-shadow: inset 0 0 30px rgba(242, 213, 142, .08), 0 22px 46px rgba(0,0,0,.32);
}
.feature-row article:hover span {
  border-color: var(--line2);
  box-shadow: 0 0 18px rgba(242, 213, 142, .28);
}
.topic-card:hover, .method-card:hover {
  transform: translateY(-3px);
  border-color: var(--line2);
  box-shadow: 0 14px 32px rgba(0,0,0,.28);
}
.fortune-card {
  align-self: center;
  border-radius: 13px;
  padding: 26px;
}
.card-head, .topic-head, .holder-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-head h3 { color: var(--text); font-family: var(--font-display); font-size: 24px; }
.card-head button, .topic-head button {
  border: 1px solid var(--line2);
  border-radius: 20px;
  background: rgba(242,213,142,.09);
  height: 36px;
  padding: 0 16px;
  color: var(--text);
}
.score-ring {
  width: 120px;
  height: 120px;
  margin: 26px auto 8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0 63%, rgba(255,255,255,.12) 63% 100%);
  box-shadow: 0 0 34px rgba(242, 213, 142, .16);
  position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: #08141f; }
.score-ring b, .score-ring span { position: relative; z-index: 1; }
.score-ring b { font-size: 42px; color: var(--gold); }
.score-ring span { align-self: end; margin-bottom: 27px; margin-left: -20px; color: var(--muted); }
.score-ring.huge { width: 180px; height: 180px; }
.score-ring.huge b { font-size: 64px; }
.fortune-card > p { text-align: center; color: var(--gold); margin-bottom: 20px; }
.bars { display: grid; gap: 14px; }
.bars label {
  display: grid;
  grid-template-columns: 48px 1fr 34px;
  gap: 12px;
  align-items: center;
  color: var(--soft);
}
.bars i { height: 7px; border-radius: 8px; background: linear-gradient(90deg, var(--gold) var(--v), rgba(255,255,255,.12) var(--v)); }

.feature-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.feature-row article {
  min-height: 124px;
  border-radius: 10px;
  padding: 18px;
}
.feature-row span, .method-card span, .topic-card span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
}
.feature-row h3 { margin: 12px 0 8px; color: var(--text); }
.feature-row p, .glass-panel p, .page-title p { color: var(--muted); line-height: 1.65; }
.thumbnail-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-top: 18px; }
.thumbnail-row article { height: 112px; border-radius: 10px; padding: 18px; background: linear-gradient(135deg, rgba(9,29,43,.84), rgba(6,14,22,.72)); display: grid; place-items: center; color: var(--gold); font-weight: 900; cursor: pointer; }
.thumbnail-row article:hover { border-color: var(--line2); background: linear-gradient(135deg, rgba(242,213,142,.13), rgba(9,29,43,.84)); }

.page-title {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.back-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(8,20,31,.75);
  font-size: 36px;
}
.page-title small { color: var(--soft); }
.page-title h2 { margin: 6px 0 8px; color: var(--gold); font-family: var(--font-display); font-size: 44px; letter-spacing: .01em; }

.ask-layout, .chart-layout {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 20px;
}
.glass-panel {
  border-radius: 13px;
  padding: 22px;
}
.ask-form h3 { color: var(--text); font-size: 22px; }
label {
  display: grid;
  gap: 9px;
  margin-top: 18px;
  color: var(--gold);
  font-weight: 800;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 10, 17, .72);
  outline: none;
  padding: 15px 18px;
  color: var(--text);
}
textarea { min-height: 118px; resize: vertical; line-height: 1.65; }
input:focus, textarea:focus, select:focus { border-color: var(--line2); box-shadow: 0 0 0 3px rgba(242,213,142,.08); }
select { min-height: 52px; color-scheme: dark; }
label em { justify-self: end; color: var(--muted); font-style: normal; font-size: 13px; margin-top: -34px; padding-right: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint-box, .privacy-box {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: rgba(3, 16, 26, .66);
}
.hint-box b { color: var(--gold); }
.topic-head { margin-top: 22px; }
.topic-grid, .method-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.topic-card, .method-card {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 21, 32, .76);
  padding: 16px;
  text-align: left;
}
.topic-card.active, .method-card.active { border-color: var(--line2); background: linear-gradient(135deg, rgba(242,213,142,.15), rgba(63,182,220,.10)); }
.topic-card h4, .method-card h4 { margin: 12px 0 6px; color: var(--gold); font-size: 18px; }
.topic-card p, .method-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.right-rail { display: grid; gap: 14px; align-content: start; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0; }
.chips span {
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 8px 12px;
  color: var(--soft);
  background: rgba(2,10,17,.55);
  font-size: 13px;
}
.rail-disc { display: grid; place-items: center; overflow: hidden; height: 250px; border: 1px solid var(--line); border-radius: 13px; background: rgba(5,15,24,.75); }
.disc.small { width: 230px; }
.disc.small .taiji { width: 62px; height: 62px; }
.disc.small .gua { font-size: 18px; }

.chart-layout { grid-template-columns: 44% 1fr; }
.chart-preview { min-height: 640px; position: relative; overflow: hidden; display: grid; place-items: center; }
.chart-preview h3 { position: absolute; top: 35px; color: var(--gold); font-family: var(--font-display); font-size: 42px; }
.chart-disc { width: min(490px, 32vw); }
.chart-caption { position: absolute; left: 40px; right: 40px; bottom: 34px; border: 1px solid var(--line); border-radius: 12px; background: rgba(3,12,20,.66); padding: 18px; }
.chart-caption b { color: var(--gold); font-size: 22px; }
.chart-form { display: grid; gap: 15px; }
.form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.form-heading small, .section-heading small { color: var(--soft); }
.form-heading h3, .section-heading h3 { margin-top: 4px; color: var(--text); font-family: var(--font-display); font-size: 22px; }
.form-heading > span, .section-heading > span { color: var(--muted); font-size: 13px; }
.switch-line, .toggle-line {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 14px;
}
.switch-line > span, .toggle-line > span { color: var(--gold); font-weight: 900; }
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
}
.split button {
  height: 52px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}
.split button.active { color: var(--text); background: linear-gradient(180deg, rgba(242,213,142,.45), rgba(242,213,142,.10)); }
.toggle {
  width: 76px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: rgba(2,10,17,.8);
  position: relative;
}
.toggle::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  left: 7px;
  top: 6px;
  border-radius: 50%;
  background: #eadcb6;
}
.toggle.on::after { left: 38px; background: var(--green); }
.toggle[disabled] { cursor: not-allowed; opacity: .45; }
.toggle-line.compact { margin-top: 14px; }
.lunar-date-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 12px; }
.chart-two-col { align-items: end; }
.switch-field { display: grid; gap: 9px; margin-top: 18px; }
.switch-field > span { color: var(--gold); font-weight: 800; }
.toggle-text {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 10, 17, .72);
  padding: 0 16px;
  text-align: left;
}
.toggle-text i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(31, 218, 136, .35);
}
.toggle-text.on i { background: var(--gold); box-shadow: 0 0 12px rgba(242, 213, 142, .35); }
.correction-fields { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 16px; align-items: end; }
.field-status { align-self: end; min-height: 24px; color: var(--muted); font-size: 13px; }
.form-error {
  border-left: 3px solid var(--red);
  background: rgba(225, 109, 84, .10);
  padding: 12px 14px;
  color: #ffd9cf;
  line-height: 1.5;
}
.chart-form input:disabled { opacity: .5; cursor: not-allowed; }

.result-title { margin-bottom: 12px; }
.result-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px 72px;
}
.result-toolbar .gold-btn, .result-toolbar .ghost-link { width: auto; min-height: 44px; margin: 0; padding: 0 18px; font-size: 14px; }
.result-toolbar > span { color: var(--muted); font-size: 13px; }
.plain-language-section {
  padding: 28px 0;
  border-top: 1px solid var(--line2);
  border-bottom: 1px solid var(--line2);
  background: linear-gradient(90deg, rgba(242, 213, 142, .06), rgba(63, 182, 220, .05), transparent);
}
.interpretation-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-left: 3px solid var(--green);
  padding: 4px 10px;
  color: var(--soft) !important;
  background: rgba(31, 218, 136, .06);
}
.interpretation-status.is-partial { border-left-color: var(--gold); background: rgba(242, 213, 142, .06); }
.interpretation-status.is-uncertain { border-left-color: var(--red); background: rgba(225, 109, 84, .07); }
.plain-summary {
  max-width: 980px;
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 20px;
}
.plain-summary p { color: var(--text); font-size: 18px; line-height: 1.85; }
.plain-summary p + p { margin-top: 8px; }
.plain-insight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.plain-insight {
  min-height: 188px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 16, 25, .72);
  padding: 18px;
}
.plain-insight small { color: var(--soft); }
.plain-insight h4 { margin: 6px 0 10px; color: var(--gold); font-size: 19px; }
.plain-insight > p { color: #d6dfdf; line-height: 1.72; }
.plain-insight details { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.plain-insight summary { min-height: 32px; color: var(--soft); cursor: pointer; font-weight: 800; }
.evidence-list { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; color: var(--muted); font-size: 13px; line-height: 1.55; list-style: none; }
.evidence-list li { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid rgba(159, 211, 222, .14); border-radius: 7px; background: rgba(4, 16, 25, .38); }
.evidence-list li > div { display: flex; flex-wrap: wrap; gap: 5px; align-items: baseline; }
.evidence-list b { color: var(--soft); }
.evidence-list b::after { content: '：'; }
.evidence-list span { color: #d6dfdf; overflow-wrap: anywhere; }
.evidence-meta { display: block; color: var(--muted); font-size: 11px; }
.plain-luck-band {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(260px, 1fr) minmax(260px, 1fr);
  margin-top: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.plain-luck-band article { min-width: 0; padding: 16px 18px; border-right: 1px solid var(--line); }
.plain-luck-band .is-unavailable { grid-column: 1 / -1; }
.plain-luck-band article:last-child { border-right: 0; }
.plain-luck-band small { display: block; color: var(--muted); margin-bottom: 7px; }
.plain-luck-band b { color: var(--text); line-height: 1.5; }
.plain-luck-band p { margin-top: 6px; color: var(--muted); line-height: 1.55; font-size: 13px; }
.chart-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 14, 22, .5);
}
.chart-facts article { min-width: 0; padding: 18px; border-right: 1px solid var(--line); }
.chart-facts article:last-child { border-right: 0; }
.chart-facts small { display: block; color: var(--muted); margin-bottom: 7px; }
.chart-facts b { color: var(--text); line-height: 1.45; overflow-wrap: anywhere; }
.chart-result-section { padding: 26px 0; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 18px; }
.pillar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pillar-card {
  min-height: 224px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 16, 25, .74);
  overflow: hidden;
}
.pillar-card.is-day { border-color: var(--line2); background: rgba(37, 32, 19, .42); }
.pillar-card > header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 0; }
.pillar-card > header b { color: var(--gold); }
.pillar-card > header span { color: var(--muted); font-size: 12px; }
.pillar-ganzhi { padding: 12px 16px; color: var(--text); font-family: var(--font-display); font-size: 40px; line-height: 1.1; font-weight: 900; }
.pillar-card dl { display: grid; grid-template-columns: auto 1fr; align-content: end; gap: 7px 12px; margin: 0; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.pillar-card dt { color: var(--muted); }
.pillar-card dd { margin: 0; color: var(--soft); text-align: right; overflow-wrap: anywhere; }
.bazi-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.bazi-table { width: 100%; min-width: 720px; border-collapse: collapse; table-layout: fixed; }
.bazi-table th, .bazi-table td { padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.55; }
.bazi-table th { color: var(--gold); background: rgba(242, 213, 142, .07); }
.bazi-table th:first-child, .bazi-table td:first-child { width: 130px; color: var(--muted); }
.bazi-table th:last-child, .bazi-table td:last-child { border-right: 0; }
.bazi-table tbody tr:last-child td { border-bottom: 0; }
.chart-insight-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 30px; border-bottom: 1px solid var(--line); }
.chart-insight-grid .chart-result-section { border-bottom: 0; }
.element-bars { display: grid; gap: 12px; }
.element-row { display: grid; grid-template-columns: 56px 1fr 32px; gap: 12px; align-items: center; }
.element-row b { color: var(--element-color); }
.element-track { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.element-track i { display: block; width: var(--element-width); height: 100%; border-radius: inherit; background: var(--element-color); }
.element-wood { --element-color: #5fcf8f; }
.element-fire { --element-color: #ef7d68; }
.element-earth { --element-color: #d9b45f; }
.element-metal { --element-color: #d9e5e8; }
.element-water { --element-color: #50aee5; }
.result-note, .chart-disclaimer { color: var(--muted); font-size: 13px; line-height: 1.65; }
.result-note { margin-top: 14px; }
.chart-disclaimer { padding: 18px 0 4px; }
.reference-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.reference-list article { min-height: 78px; padding: 14px; background: #07131c; }
.reference-list small { display: block; color: var(--muted); margin-bottom: 6px; }
.reference-list b { color: var(--soft); }
.luck-timeline { display: grid; grid-template-columns: repeat(8, minmax(132px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.luck-item { min-height: 98px; border-left: 3px solid var(--line2); background: rgba(4, 16, 25, .65); padding: 13px; }
.luck-item.current { border-left-color: var(--green); background: rgba(31, 218, 136, .09); box-shadow: inset 0 0 0 1px rgba(31, 218, 136, .18); }
.luck-item b { display: block; color: var(--gold); font-size: 20px; }
.luck-item span, .luck-item small { display: block; color: var(--muted); margin-top: 6px; line-height: 1.45; overflow-wrap: anywhere; }
.professional-disclosure { border-bottom: 1px solid var(--line); }
.professional-disclosure > summary {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  list-style: none;
  color: var(--gold);
  font-size: 19px;
  font-weight: 900;
}
.professional-disclosure > summary::-webkit-details-marker { display: none; }
.professional-disclosure > summary::after { content: "+"; color: var(--soft); font-size: 25px; font-weight: 400; }
.professional-disclosure[open] > summary::after { content: "−"; }
.professional-disclosure > summary small { grid-column: 1; color: var(--muted); font-size: 13px; font-weight: 400; }

.ai-grid, .fortune-layout {
  display: grid;
  grid-template-columns: 360px 1fr 1fr;
  gap: 18px;
}
.ai-hero { min-height: 360px; }
.hex-line-list { display: grid; gap: 10px; margin-top: 14px; }
.hex-line, .result-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: rgba(2,10,17,.5);
}
.hex-line {
  display: grid;
  grid-template-columns: 34px 1fr 80px;
  align-items: center;
  gap: 12px;
}
.hex-line b, .result-item b { color: var(--gold); }
.hex-line em, .result-item p { color: var(--muted); font-size: 12px; font-style: normal; margin-top: 4px; }
.hex-line span {
  height: 10px;
  border-radius: 10px;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(242,213,142,.2);
}
.hex-line span.yin {
  background: linear-gradient(90deg, var(--gold) 0 42%, transparent 42% 58%, var(--gold) 58% 100%);
}
.hex-line.moving { border-color: var(--line2); background: rgba(242,213,142,.08); }
.judge-cards, .fortune-cards { display: grid; gap: 12px; margin-top: 14px; }
.judge-cards article, .fortune-cards article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
  background: rgba(2,10,17,.54);
}
.text-action {
  min-height: 34px;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-weight: 800;
  cursor: pointer;
}
.text-action:hover { color: var(--text); }
.fortune-layout { grid-template-columns: 360px 1fr; }
.big-fortune p { margin-top: 20px; }
.history-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.history-actions .gold-btn, .history-actions .ghost-link { min-height: 44px; margin: 0; padding: 0 18px; font-size: 14px; }
.history-page { display: grid; gap: 28px; }
.history-group { border-top: 1px solid var(--line); padding-top: 20px; }
.history-group .holder-head h3 { color: var(--text); }
.history-group .holder-head span { color: var(--muted); }
.history-list { display: grid; gap: 1px; margin-top: 14px; border: 1px solid var(--line); background: var(--line); }
.history-record, .history-empty { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 92px; padding: 16px 18px; background: #07131c; }
.history-record b, .history-empty b { color: var(--gold); }
.history-record p, .history-empty p { margin-top: 6px; color: var(--muted); line-height: 1.55; }
.record-actions { display: flex; gap: 8px; flex-shrink: 0; }
.record-actions button { min-height: 38px; border: 1px solid var(--line); border-radius: 7px; background: rgba(242, 213, 142, .07); color: var(--soft); padding: 0 12px; }
.record-actions [data-delete-profile] { color: #f1a390; }

.site-footer {
  margin-left: 280px;
  padding: 20px 34px;
  color: var(--muted);
  display: flex;
  gap: 18px;
  justify-content: center;
  font-size: 13px;
}
.site-footer a { color: var(--gold); text-decoration: none; }
.mobile-nav { display: none; }

@media (max-width: 1180px) {
  .sidebar { transform: translateX(-100%); }
  .topbar, .content, .site-footer { margin-left: 0; left: 0; }
  .topbar { grid-template-columns: 1fr; height: auto; padding: 12px; position: sticky; }
  .top-actions { justify-content: flex-start; overflow-x: auto; }
  .content { padding: 18px 16px 104px; }
  .hero-grid, .ask-layout, .chart-layout, .ai-grid, .fortune-layout { grid-template-columns: 1fr; }
  .hero-grid { padding: 28px; }
  .disc { width: min(420px, 80vw); }
  .feature-row, .thumbnail-row { grid-template-columns: repeat(2, 1fr); }
  .fortune-card { align-self: stretch; }
  .chart-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chart-facts article { border-bottom: 1px solid var(--line); }
  .plain-insight-grid { grid-template-columns: 1fr; }
  .plain-luck-band { grid-template-columns: 1fr 1fr; }
  .plain-luck-band article:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .pillar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer { padding-bottom: 104px; }

  .mobile-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line2);
    border-radius: 18px;
    background: rgba(3, 9, 15, .94);
    backdrop-filter: blur(14px);
    box-shadow: 0 16px 44px rgba(0, 0, 0, .5);
  }
  .mobile-nav button {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-height: 50px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }
  .mobile-nav button span { font-size: 18px; line-height: 1; }
  .mobile-nav button.active {
    border-color: var(--line2);
    color: var(--gold);
    background: rgba(242, 213, 142, .14);
  }
}

@media (max-width: 640px) {
  .search { grid-template-columns: 28px 1fr; }
  .search kbd { display: none; }
  .content { padding: 16px 12px 104px; }

  /* Mobile first screen: lead with heading + primary actions, keep decor secondary */
  .hero-grid {
    display: flex;
    flex-direction: column;
    padding: 22px 20px;
    min-height: auto;
    gap: 18px;
  }
  .hero-copy { display: flex; flex-direction: column; }
  h1 { font-size: clamp(38px, 11vw, 50px); margin-top: 12px; }
  .hero-copy p { font-size: 15px; margin-top: 16px; }
  .hero-copy blockquote { order: 6; margin-top: 4px; font-size: 14px; padding: 14px 18px; }
  .hero-actions { order: 3; display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 18px; }
  .hero-copy .ghost-link { order: 4; }
  .disc-stage { order: 5; margin: 4px auto; }
  .disc { width: min(300px, 72vw); }

  .form-actions, .result-actions, .two-col, .topic-grid, .method-grid, .hex-line-list, .feature-row, .thumbnail-row, .lunar-date-grid, .correction-fields, .chart-insight-grid { grid-template-columns: 1fr; display: grid; }
  .workspace-link { align-items: flex-start; flex-direction: column; }
  .workspace-link .ghost-link { width: 100%; }
  .gold-btn { width: 100%; }
  .switch-line, .toggle-line { grid-template-columns: 1fr; gap: 8px; }
  .page-title { grid-template-columns: 44px 1fr; gap: 14px; margin-bottom: 18px; }
  .page-title h2 { font-size: 30px; }
  .page-title p { font-size: 13px; }
  .score-ring.huge { width: 150px; height: 150px; }
  .score-ring.huge b { font-size: 52px; }
  .chart-preview { display: none; }
  .chart-form { padding: 18px 16px; }
  .form-heading { align-items: flex-start; }
  .form-heading > span { max-width: 130px; text-align: right; }
  .chart-two-col { display: grid; }
  .result-toolbar { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 16px; }
  .result-toolbar .gold-btn, .result-toolbar .ghost-link { width: 100%; }
  .result-toolbar #saveChart, .result-toolbar > span { grid-column: 1 / -1; }
  .plain-language-section { padding: 22px 0; }
  .plain-language-section .section-heading { gap: 10px; }
  .plain-summary { padding-left: 14px; }
  .plain-summary p { font-size: 16px; line-height: 1.75; }
  .plain-insight { min-height: 0; padding: 16px; }
  .plain-luck-band { grid-template-columns: 1fr; }
  .plain-luck-band article, .plain-luck-band article:first-child { grid-column: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .plain-luck-band article:last-child { border-bottom: 0; }
  .chart-facts { grid-template-columns: 1fr 1fr; }
  .chart-facts article { padding: 14px; border-bottom: 1px solid var(--line); }
  .pillar-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .pillar-card { min-height: 112px; display: block; }
  .pillar-card.is-uncertain { grid-column: span 2; }
  .pillar-card > header { padding: 10px 8px 0; }
  .pillar-card > header span { display: none; }
  .pillar-ganzhi { padding: 12px 8px; font-size: 26px; text-align: center; }
  .pillar-card dl { display: none; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .professional-disclosure > summary { grid-template-columns: 1fr 28px; }
  .reference-list { grid-template-columns: 1fr; }
  .luck-timeline { grid-template-columns: repeat(8, 132px); }
  .history-record, .history-empty { align-items: flex-start; flex-direction: column; }
  .record-actions { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .record-actions button { padding: 0 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
