:root {
  color-scheme: dark;
  --bg: #04060c;
  --ink: #f7f0df;
  --muted: #aeb5c5;
  --deep: rgba(4, 9, 18, 0.82);
  --panel: rgba(5, 12, 24, 0.74);
  --panel-strong: rgba(7, 14, 27, 0.92);
  --line: rgba(243, 194, 95, 0.26);
  --line-cool: rgba(117, 222, 255, 0.22);
  --gold: #f7c86d;
  --violet: #a56eff;
  --cyan: #6ff7ff;
  --pink: #f15cff;
  --good: #74ffd2;
  --shadow: 0 34px 110px rgba(0, 0, 0, 0.58);
  --radius: 8px;
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(2, 4, 10, 0.92), rgba(3, 8, 18, 0.42) 48%, rgba(2, 4, 10, 0.9)),
    linear-gradient(180deg, rgba(3, 5, 11, 0.16), rgba(3, 5, 11, 0.88)),
    url("./tech-yijing-bg.png") center top / cover fixed;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, transparent 0 49.8%, rgba(111, 247, 255, 0.13) 50%, transparent 50.2%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 96px);
  opacity: 0.46;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

#starCanvas,
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#starCanvas {
  z-index: 1;
  width: 100vw;
  height: 100vh;
  opacity: 0.66;
}

.scanlines {
  z-index: 2;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
  opacity: 0.24;
}

.tech-cursor {
  display: none;
}

.tech-cursor.is-visible {
  opacity: 1;
}

.cursor-ring,
.cursor-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.cursor-ring {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(247, 240, 223, 0.72);
  box-shadow: 0 0 16px rgba(247, 240, 223, 0.16), inset 0 0 12px rgba(255, 255, 255, 0.08);
}

.cursor-ring::before,
.cursor-ring::after {
  position: absolute;
  content: "";
  background: rgba(247, 240, 223, 0.68);
}

.cursor-ring::before {
  left: 50%;
  top: -7px;
  width: 1px;
  height: 44px;
  transform: translateX(-50%);
}

.cursor-ring::after {
  left: -7px;
  top: 50%;
  width: 44px;
  height: 1px;
  transform: translateY(-50%);
}

.cursor-dot {
  width: 5px;
  height: 5px;
  background: #f7f0df;
  box-shadow: 0 0 12px rgba(247, 240, 223, 0.72);
}

.cursor-ripple {
  display: none;
}

.cursor-ripple.is-strong {
  border-color: rgba(247, 240, 223, 0.58);
  animation-duration: 1100ms;
}

.topbar,
.app-shell,
.footnote {
  position: relative;
  z-index: 3;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: 20px 0 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(247, 200, 109, 0.42);
  border-radius: 50%;
  color: var(--gold);
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 1.3rem;
  background: rgba(4, 10, 18, 0.72);
  box-shadow: 0 0 26px rgba(247, 200, 109, 0.22), inset 0 0 18px rgba(111, 247, 255, 0.12);
}

.brand strong {
  display: block;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(111, 247, 255, 0.22);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(4, 10, 18, 0.68);
  text-decoration: none;
  backdrop-filter: blur(18px);
}

.lang-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 10, 18, 0.7);
  backdrop-filter: blur(18px);
}

.lang-btn {
  min-width: 54px;
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
}

.lang-btn.is-active {
  color: #060a10;
  background: linear-gradient(135deg, var(--gold), var(--violet), var(--cyan));
  box-shadow: 0 0 22px rgba(165, 110, 255, 0.25);
}

.app-shell {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(22px, 4vw, 58px) 0 28px;
}

.hero-panel {
  width: min(880px, 100%);
  margin-bottom: 24px;
}

.oracle-quote {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(2.35rem, 5.4vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: 0;
  color: var(--ink);
  text-wrap: balance;
  text-shadow: 0 0 34px rgba(0, 0, 0, 0.62), 0 0 42px rgba(247, 200, 109, 0.12);
}

.oracle-seal {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin: 14px 0 0;
  padding: 0 12px;
  border-left: 2px solid var(--gold);
  color: var(--gold);
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  background: linear-gradient(90deg, rgba(247, 200, 109, 0.11), transparent);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.hero-panel h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(2.2rem, 5.4vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-panel p:not(.eyebrow) {
  width: min(720px, 100%);
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.4vw, 1.13rem);
  line-height: 1.78;
}

.hero-panel .oracle-seal {
  width: auto;
  margin: 14px 0 0;
  color: var(--gold);
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  line-height: 1.2;
}

.hero-panel p[data-i18n="subhead"] {
  margin-top: 16px;
}

.step-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(3, 9, 18, 0.58);
  backdrop-filter: blur(16px);
}

.step-pill b {
  color: var(--gold);
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 0.82rem;
}

.step-pill em {
  overflow: hidden;
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.step-pill.is-active {
  border-color: rgba(111, 247, 255, 0.42);
  color: var(--ink);
  box-shadow: inset 0 0 22px rgba(111, 247, 255, 0.08);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 530px) minmax(0, 1fr);
  gap: clamp(18px, 2.2vw, 30px);
  align-items: start;
}

.oracle-form {
  display: grid;
  gap: 14px;
}

.form-section,
.ritual-stage,
.result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(8, 16, 32, 0.82), rgba(3, 8, 17, 0.74));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.form-section {
  display: grid;
  gap: 15px;
  padding: clamp(17px, 2vw, 24px);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.section-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(111, 247, 255, 0.28);
  border-radius: 50%;
  color: var(--cyan);
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 0.78rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.field,
.segmented {
  display: grid;
  gap: 8px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.date-triplet {
  display: grid;
  grid-template-columns: 1.15fr 0.92fr 0.92fr;
  gap: 8px;
}

.date-triplet input,
.date-triplet select {
  min-width: 0;
}

.field span,
.segmented legend {
  color: #dfe7ec;
  font-size: 0.84rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(111, 247, 255, 0.18);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(0, 5, 12, 0.68);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input,
select {
  padding: 0 12px;
}

textarea {
  min-height: 104px;
  padding: 12px;
  resize: vertical;
  line-height: 1.62;
}

select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%) right 17px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--gold) 50%, transparent 50%) right 11px center / 7px 7px no-repeat,
    rgba(0, 5, 12, 0.68);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(111, 247, 255, 0.72);
  background: rgba(0, 8, 18, 0.82);
  box-shadow: 0 0 0 3px rgba(111, 247, 255, 0.12);
}

.time-chip {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid rgba(247, 200, 109, 0.18);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(247, 200, 109, 0.06);
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.type-card {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 126px;
  padding: 15px;
  border: 1px solid rgba(111, 247, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(0, 6, 14, 0.58);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.type-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-card:has(input:checked) {
  border-color: rgba(247, 240, 223, 0.62);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04) 45%, rgba(0, 0, 0, 0.34)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 12px),
    rgba(2, 5, 10, 0.82);
  box-shadow: inset 0 0 28px rgba(247, 240, 223, 0.08), 0 0 22px rgba(247, 240, 223, 0.08);
}

.type-card:hover {
  transform: translateY(-1px);
}

.type-icon {
  font-size: 1.4rem;
}

.type-card strong {
  color: var(--ink);
  font-size: 1rem;
}

.type-card small {
  color: var(--muted);
  line-height: 1.45;
}

.branch-options {
  display: grid;
  gap: 12px;
}

.segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented legend {
  grid-column: 1 / -1;
}

.segmented label {
  position: relative;
  min-width: 0;
}

.segmented input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 8px 9px;
  border: 1px solid rgba(111, 247, 255, 0.16);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(0, 6, 14, 0.54);
  text-align: center;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.segmented input:checked + span {
  border-color: rgba(247, 240, 223, 0.7);
  color: #f7f0df;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(10, 12, 16, 0.78) 42%, rgba(255, 255, 255, 0.12)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 10px),
    rgba(3, 6, 12, 0.9);
  box-shadow: inset 0 0 18px rgba(247, 240, 223, 0.1), 0 0 14px rgba(247, 240, 223, 0.08);
  text-shadow: 0 0 10px rgba(247, 240, 223, 0.28);
}

.segmented label:hover span {
  transform: translateY(-1px);
}

.visual-options {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.branch-number {
  display: none;
}

.branch-number.is-visible {
  display: grid;
}

.upload-zone {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  align-items: center;
  min-height: 76px;
  padding: 15px;
  border: 1px dashed rgba(247, 200, 109, 0.34);
  border-radius: var(--radius);
  background: rgba(0, 6, 14, 0.54);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(111, 247, 255, 0.28);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 1.3rem;
  background: rgba(111, 247, 255, 0.08);
}

.upload-zone strong,
.upload-zone small {
  display: block;
}

.upload-zone small {
  margin-top: 3px;
  color: var(--muted);
}

.preview-wrap {
  position: relative;
  overflow: hidden;
  height: 166px;
  border: 1px solid rgba(111, 247, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.3);
}

.preview-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.icon-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.62);
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.primary-action,
.ghost-action,
.save-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  border-radius: var(--radius);
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.primary-action {
  border: 0;
  color: #f7f0df;
  font-weight: 780;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(7, 10, 16, 0.86) 48%, rgba(255, 255, 255, 0.16)),
    rgba(3, 6, 12, 0.92);
  box-shadow: inset 0 0 22px rgba(247, 240, 223, 0.12), 0 18px 44px rgba(0, 0, 0, 0.36);
  text-shadow: 0 0 12px rgba(247, 240, 223, 0.24);
}

.ghost-action,
.save-action {
  padding: 0 16px;
  border: 1px solid rgba(247, 200, 109, 0.28);
  color: var(--ink);
  background: rgba(0, 6, 14, 0.64);
}

.save-action {
  min-height: 40px;
  font-size: 0.9rem;
}

.primary-action:hover,
.ghost-action:hover,
.save-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgba(111, 247, 255, 0.12);
}

.oracle-console {
  display: grid;
  justify-items: center;
  gap: 14px;
  position: sticky;
  top: 18px;
}

.ritual-stage {
  position: relative;
  overflow: hidden;
  width: min(620px, 100%);
  min-height: 520px;
  padding: clamp(20px, 3vw, 34px);
  border-color: rgba(247, 240, 223, 0.14);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.ritual-stage.is-complete {
  background: transparent;
  border-color: rgba(247, 200, 109, 0.34);
  box-shadow: 0 34px 120px rgba(0, 0, 0, 0.38), inset 0 0 80px rgba(111, 247, 255, 0.04);
}

.ritual-stage.is-complete .astro-machine {
  opacity: 0.52;
  transform: scale(0.92);
  transition: opacity 420ms ease, transform 420ms ease;
}

.ritual-stage.is-complete .taiji-core,
.ritual-stage.is-complete .bagua-orbit {
  opacity: 0.22;
}

.ritual-stage.is-complete .machine-core span {
  color: rgba(247, 200, 109, 0.86);
}

.ritual-stage::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: none;
}

.ritual-effects {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.ritual-effect {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: effectFade 1.55s ease forwards;
}

.astro-machine {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: min(490px, 88vw);
  aspect-ratio: 1;
  margin: 0 auto 22px;
}

.astro-machine::before {
  position: absolute;
  inset: 8%;
  z-index: 0;
  border-radius: 50%;
  content: "";
  background:
    radial-gradient(circle, transparent 0 54%, rgba(3, 7, 14, 0.18) 70%, transparent 100%);
  box-shadow: inset 0 0 58px rgba(0, 0, 0, 0.18), 0 0 36px rgba(247, 240, 223, 0.08);
  opacity: 0.72;
}

.zodiac-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(247, 200, 109, 0.28);
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(247, 240, 223, 0.08) 0 1deg, transparent 1deg 15deg);
  box-shadow: inset 0 0 80px rgba(247, 240, 223, 0.035), 0 0 54px rgba(0, 0, 0, 0.2);
  animation: slowSpin 34s linear infinite;
}

.zodiac-ring::before,
.zodiac-ring::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.zodiac-ring::before {
  inset: 14%;
  border: 1px solid rgba(111, 247, 255, 0.22);
}

.zodiac-ring::after {
  inset: 29%;
  border: 1px solid rgba(247, 200, 109, 0.2);
  box-shadow: 0 0 26px rgba(247, 200, 109, 0.1);
}

.astro-machine.is-running .zodiac-ring {
  animation-duration: 7s;
}

.bagua-orbit {
  position: absolute;
  inset: 14%;
  z-index: 1;
  border: 1px solid rgba(247, 240, 223, 0.22);
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.1) 0 1deg, transparent 1deg 12deg),
    radial-gradient(circle, transparent 48%, rgba(255, 255, 255, 0.04) 49%, transparent 58%);
  box-shadow: inset 0 0 44px rgba(247, 240, 223, 0.06), 0 0 36px rgba(111, 247, 255, 0.08);
  animation: baguaRotate 28s linear infinite reverse;
}

.bagua-orbit span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(247, 240, 223, 0.26);
  border-radius: 50%;
  color: rgba(247, 240, 223, 0.9);
  background: rgba(4, 7, 12, 0.72);
  box-shadow: 0 0 18px rgba(247, 240, 223, 0.1);
  font-size: 1.35rem;
}

.bagua-orbit span:nth-child(1) { left: 50%; top: 3%; transform: translate(-50%, -50%); }
.bagua-orbit span:nth-child(2) { left: 84%; top: 16%; transform: translate(-50%, -50%); }
.bagua-orbit span:nth-child(3) { left: 97%; top: 50%; transform: translate(-50%, -50%); }
.bagua-orbit span:nth-child(4) { left: 84%; top: 84%; transform: translate(-50%, -50%); }
.bagua-orbit span:nth-child(5) { left: 50%; top: 97%; transform: translate(-50%, -50%); }
.bagua-orbit span:nth-child(6) { left: 16%; top: 84%; transform: translate(-50%, -50%); }
.bagua-orbit span:nth-child(7) { left: 3%; top: 50%; transform: translate(-50%, -50%); }
.bagua-orbit span:nth-child(8) { left: 16%; top: 16%; transform: translate(-50%, -50%); }

.taiji-core {
  position: absolute;
  z-index: 2;
  width: 35%;
  aspect-ratio: 1;
  border: 2px solid rgba(247, 240, 223, 0.92);
  border-radius: 50%;
  background: linear-gradient(90deg, #f5f1e6 0 50%, #040405 50% 100%);
  box-shadow:
    0 0 0 1px rgba(247, 200, 109, 0.18),
    0 0 42px rgba(247, 240, 223, 0.18),
    0 0 72px rgba(111, 247, 255, 0.1);
  overflow: hidden;
  animation: taijiSpin 18s linear infinite;
}

.taiji-core::before,
.taiji-core::after {
  position: absolute;
  left: 25%;
  width: 50%;
  height: 50%;
  border-radius: 50%;
  content: "";
}

.taiji-core::before {
  top: 0;
  background: #f5f1e6;
}

.taiji-core::after {
  bottom: 0;
  background: #040405;
}

.taiji-dot {
  position: absolute;
  left: 50%;
  z-index: 1;
  width: 13%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateX(-50%);
}

.taiji-dot-dark {
  top: 18.5%;
  background: #040405;
}

.taiji-dot-light {
  bottom: 18.5%;
  background: #f5f1e6;
}

.astro-machine.is-running .bagua-orbit {
  animation-duration: 6s;
  border-color: rgba(247, 240, 223, 0.34);
  box-shadow: inset 0 0 48px rgba(247, 240, 223, 0.05), 0 0 34px rgba(247, 240, 223, 0.08);
}

.astro-machine.is-running .taiji-core {
  animation-duration: 3.2s;
  box-shadow:
    0 0 0 1px rgba(247, 240, 223, 0.28),
    0 0 42px rgba(247, 240, 223, 0.18),
    0 0 70px rgba(0, 0, 0, 0.28);
}

.hex-stream {
  position: absolute;
  inset: 11% 0 auto;
  overflow: hidden;
  color: rgba(111, 247, 255, 0.46);
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: clamp(0.75rem, 1.4vw, 1rem);
  white-space: nowrap;
  transform: rotate(-5deg);
  animation: streamMove 20s linear infinite;
}

.ritual-effect.hex-rain .tech-glyph {
  position: absolute;
  left: var(--x);
  top: -12%;
  color: rgba(111, 247, 255, 0.72);
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: var(--size);
  text-shadow: 0 0 16px rgba(111, 247, 255, 0.5);
  animation: glyphFall var(--duration) linear var(--delay) forwards;
}

.ritual-effect.hex-rain .tech-glyph:nth-child(3n) {
  color: rgba(247, 200, 109, 0.7);
  text-shadow: 0 0 16px rgba(247, 200, 109, 0.44);
}

.ritual-effect.scan-ring::before,
.ritual-effect.scan-ring::after {
  position: absolute;
  inset: 12%;
  content: "";
  border-radius: 50%;
}

.ritual-effect.scan-ring::before {
  border: 1px solid rgba(111, 247, 255, 0.45);
  background:
    conic-gradient(from 0deg, transparent 0 18%, rgba(111, 247, 255, 0.32) 20% 23%, transparent 25% 58%, rgba(247, 200, 109, 0.3) 60% 63%, transparent 65%),
    radial-gradient(circle, transparent 45%, rgba(111, 247, 255, 0.1) 46%, transparent 62%);
  animation: scanRing 1.45s cubic-bezier(0.2, 0.7, 0.1, 1) forwards;
}

.ritual-effect.scan-ring::after {
  inset: 24%;
  border: 1px solid rgba(247, 200, 109, 0.34);
  box-shadow: 0 0 42px rgba(165, 110, 255, 0.18), inset 0 0 34px rgba(111, 247, 255, 0.08);
  animation: scanRing 1.15s ease 120ms forwards reverse;
}

.ritual-effect.particle-burst .spark {
  position: absolute;
  left: 50%;
  top: 44%;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(111, 247, 255, 0.86);
  box-shadow: 0 0 18px rgba(111, 247, 255, 0.64);
  animation: sparkGather 1.35s cubic-bezier(0.17, 0.67, 0.16, 1) var(--delay) forwards;
}

.ritual-effect.particle-burst .spark:nth-child(4n) {
  background: rgba(247, 200, 109, 0.9);
  box-shadow: 0 0 18px rgba(247, 200, 109, 0.64);
}

.ritual-effect.grid-pulse {
  background:
    linear-gradient(90deg, transparent, rgba(165, 110, 255, 0.24), transparent),
    repeating-linear-gradient(90deg, rgba(111, 247, 255, 0.13) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(0deg, rgba(247, 200, 109, 0.08) 0 1px, transparent 1px 34px);
  background-position: -80% 0, 0 0, 0 0;
  mix-blend-mode: screen;
  animation: gridSweep 1.4s ease forwards;
}

.ritual-effect.orbit-lock::before,
.ritual-effect.orbit-lock::after {
  position: absolute;
  left: 50%;
  top: 44%;
  content: "";
  width: min(420px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.35);
}

.ritual-effect.orbit-lock::before {
  border: 1px solid rgba(247, 200, 109, 0.45);
  box-shadow: inset 0 0 38px rgba(247, 200, 109, 0.08), 0 0 48px rgba(247, 200, 109, 0.1);
  animation: orbitLock 1.45s cubic-bezier(0.22, 0.78, 0.17, 1) forwards;
}

.ritual-effect.orbit-lock::after {
  width: min(300px, 54vw);
  border: 1px dashed rgba(111, 247, 255, 0.42);
  animation: orbitLock 1.1s cubic-bezier(0.22, 0.78, 0.17, 1) 120ms forwards;
}

.machine-core {
  position: relative;
  display: grid;
  place-items: center;
  z-index: 3;
  width: 48%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.machine-core span {
  display: none;
}

.machine-core small {
  color: var(--muted);
  font-family: "Consolas", "Cascadia Mono", monospace;
  text-shadow: 0 0 16px rgba(0, 0, 0, 0.88);
}

.coin-tray {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: -8px 0 22px;
}

.coin {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(247, 200, 109, 0.64);
  border-radius: 50%;
  color: #170f06;
  font-family: "STKaiti", "KaiTi", serif;
  font-weight: 700;
  background:
    radial-gradient(circle at 35% 28%, #fff2b9, #f7c86d 42%, #8c5a24 100%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34), 0 0 22px rgba(247, 200, 109, 0.18);
  transform-style: preserve-3d;
}

.coin.is-flipping {
  animation: coinFlip 700ms ease-in-out;
}

.coin[data-side="yin"] {
  filter: hue-rotate(24deg) saturate(0.86);
}

.coin[data-side="yang"] {
  filter: brightness(1.12) saturate(1.18);
}

.hex-builder {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  width: min(330px, 78vw);
  margin: 0 auto;
}

.hex-line {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  height: 10px;
  opacity: 0.32;
  transform: scaleX(0.7);
  transition: opacity 300ms ease, transform 300ms ease;
}

.hex-line i {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.hex-line.is-on {
  opacity: 1;
  transform: scaleX(1);
}

.hex-line.is-on i {
  background: linear-gradient(90deg, var(--gold), var(--violet), var(--cyan));
  box-shadow: 0 0 18px rgba(111, 247, 255, 0.36);
}

.hex-line.is-solid {
  grid-template-columns: 1fr;
}

.hex-line.is-solid i:last-child {
  display: none;
}

.loading-feed {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}

.loading-feed span {
  min-height: 40px;
  padding: 10px;
  border: 1px solid rgba(111, 247, 255, 0.14);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(0, 5, 12, 0.52);
  font-size: 0.82rem;
  text-align: center;
}

.ritual-stage.is-running .loading-feed span {
  color: var(--cyan);
  animation: feedPulse 900ms ease-in-out infinite alternate;
}

.result-card {
  width: 100%;
  padding: clamp(18px, 2.5vw, 30px);
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.result-content h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(1.9rem, 4vw, 3.8rem);
  line-height: 1.05;
}

.muted {
  color: var(--muted);
  line-height: 1.72;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(111, 247, 255, 0.18);
  border-radius: 999px;
  color: #e6fbff;
  background: rgba(0, 7, 16, 0.58);
  font-size: 0.86rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.reading-block {
  min-height: 168px;
  padding: 16px;
  border: 1px solid rgba(247, 200, 109, 0.16);
  border-radius: var(--radius);
  background: rgba(0, 6, 14, 0.48);
}

.reading-block.wide {
  grid-column: 1 / -1;
}

.reading-block h3 {
  margin: 0 0 9px;
  color: var(--gold);
  font-size: 1rem;
}

.reading-block p {
  margin: 0;
  color: #dce7ee;
  line-height: 1.7;
}

.reading-block p + p {
  margin-top: 9px;
}

.quote-line {
  color: var(--ink);
}

.score-row {
  display: grid;
  gap: 9px;
  margin: 18px 0;
}

.metric {
  display: grid;
  grid-template-columns: 82px 1fr 38px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-family: "Consolas", "Cascadia Mono", monospace;
  font-size: 0.84rem;
}

.bar {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--violet), var(--cyan));
}

.notice {
  margin: 18px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--cyan);
  color: var(--muted);
  line-height: 1.7;
}

.payment-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(247, 200, 109, 0.18);
  border-radius: var(--radius);
  background: rgba(0, 6, 14, 0.48);
}

.payment-box h3 {
  margin: 0 0 8px;
  color: var(--gold);
}

.payment-box p {
  margin: 0;
  color: #dce7ee;
  line-height: 1.65;
}

.payment-qrs {
  display: flex;
  gap: 12px;
}

.payment-qrs figure {
  display: grid;
  gap: 6px;
  margin: 0;
  width: 112px;
}

.payment-qrs img {
  width: 112px;
  aspect-ratio: 1;
  border: 1px solid rgba(111, 247, 255, 0.18);
  border-radius: var(--radius);
  object-fit: contain;
  background: #fff;
}

.payment-qrs figcaption {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.footnote {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 24px;
  color: rgba(220, 231, 238, 0.72);
  font-size: 0.78rem;
  line-height: 1.5;
}

@keyframes slowSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes cursorRipple {
  0% {
    opacity: 0.26;
    transform: translate(-50%, -50%) scale(0.25);
  }
  70% {
    opacity: 0.16;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(7.5);
  }
}

@keyframes baguaRotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes taijiSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes streamMove {
  to {
    transform: translateX(-50%) rotate(-5deg);
  }
}

@keyframes coinFlip {
  0% {
    transform: rotateY(0deg) translateY(0);
  }
  50% {
    transform: rotateY(720deg) translateY(-18px);
  }
  100% {
    transform: rotateY(1080deg) translateY(0);
  }
}

@keyframes effectFade {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  78% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
  }
}

@keyframes glyphFall {
  0% {
    opacity: 0;
    transform: translate3d(0, -30px, 0) scale(0.82);
  }
  12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), 118vh, 0) scale(1.18);
  }
}

@keyframes scanRing {
  0% {
    opacity: 0;
    transform: scale(0.28) rotate(0deg);
  }
  38% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.28) rotate(170deg);
  }
}

@keyframes sparkGather {
  0% {
    opacity: 0;
    transform: translate(var(--sx), var(--sy)) scale(0.25);
  }
  20% {
    opacity: 1;
  }
  72% {
    opacity: 1;
    transform: translate(calc(var(--sx) * 0.12), calc(var(--sy) * 0.12)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(0, 0) scale(0.2);
  }
}

@keyframes gridSweep {
  0% {
    opacity: 0;
    background-position: -80% 0, 0 0, 0 0;
    transform: skewY(-2deg) scale(1.05);
  }
  18% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
    background-position: 180% 0, 30px 0, 0 30px;
    transform: skewY(2deg) scale(1);
  }
}

@keyframes orbitLock {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35) rotate(0deg);
  }
  45% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.2) rotate(220deg);
  }
}

@keyframes feedPulse {
  to {
    border-color: rgba(247, 200, 109, 0.34);
    box-shadow: inset 0 0 22px rgba(111, 247, 255, 0.06);
  }
}

@media (max-width: 1160px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .oracle-console {
    position: static;
  }
}

@media (pointer: coarse) {
  body,
  button,
  a,
  label,
  input,
  select,
  textarea {
    cursor: auto;
  }

  .tech-cursor,
  .cursor-ripple {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar,
  .app-shell,
  .footnote {
    width: min(100% - 28px, 1500px);
  }

  .topbar {
    padding-top: 14px;
  }

  .brand small {
    display: none;
  }

  .hero-panel h1 {
    font-size: clamp(2rem, 11vw, 3.1rem);
  }

  .step-rail,
  .type-grid,
  .field-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .segmented,
  .visual-options,
  .loading-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions,
  .result-head {
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
  }

  .result-head {
    display: grid;
    align-items: stretch;
  }

  .payment-box {
    grid-template-columns: 1fr;
  }

  .payment-qrs {
    flex-wrap: wrap;
  }

  .bagua-orbit span {
    width: 34px;
    height: 34px;
    font-size: 1.08rem;
  }

  .taiji-core {
    width: 42%;
  }

  .coin {
    width: 56px;
    height: 56px;
  }

  .metric {
    grid-template-columns: 72px 1fr 34px;
  }
}

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

  #starCanvas {
    display: none;
  }
}
