:root {
  --ink: #04060d;
  --ink-2: #080d1b;
  --panel: rgba(8, 13, 27, 0.62);
  --panel-strong: rgba(7, 11, 24, 0.86);
  --line: rgba(140, 165, 210, 0.16);
  --line-bright: rgba(140, 190, 220, 0.32);
  --text: #e9eef8;
  --text-dim: #a3aecb;
  --text-faint: #6b7694;
  --gold: #e7c878;
  --gold-soft: rgba(231, 200, 120, 0.13);
  --cyan: #6cc4d4;
  --cyan-soft: rgba(108, 196, 212, 0.12);
  --violet: #a389e0;
  --violet-soft: rgba(163, 137, 224, 0.12);
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; }

#cosmos {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: transparent;
}

.galaxy-bg {
  position: fixed;
  inset: -8%;
  z-index: 0;
  background: url("assets/galaxy-bg.jpg") center / cover no-repeat;
  opacity: 0.92;
  transform-origin: 50% 50%;
  animation: galaxyTravel 46s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes galaxyTravel {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.18) translate3d(-2.4%, -1.8%, 0); }
}

.nebula {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(74px);
  opacity: 0.46;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: drift 38s ease-in-out infinite alternate;
}
.nebula-a { width: 52vw; height: 38vw; left: -10vw; top: 12vh; background: radial-gradient(circle, rgba(78, 54, 152, 0.5), transparent 68%); }
.nebula-b { width: 44vw; height: 34vw; right: -8vw; top: 40vh; background: radial-gradient(circle, rgba(24, 108, 138, 0.46), transparent 66%); animation-delay: -14s; }
.nebula-c { width: 36vw; height: 28vw; left: 32vw; bottom: -12vh; background: radial-gradient(circle, rgba(150, 96, 44, 0.28), transparent 66%); animation-delay: -24s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3vw, -2vh, 0) scale(1.14); }
}

.shell { position: relative; z-index: 1; min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(4, 7, 15, 0.86), rgba(4, 7, 15, 0.6));
  backdrop-filter: blur(14px);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 22px;
}

.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { color: var(--gold); filter: drop-shadow(0 0 12px rgba(231, 200, 120, 0.35)); flex: none; }
.brand-text h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.1;
  white-space: nowrap;
}
.brand-text h1 span { font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--cyan); letter-spacing: 0.08em; }
.brand-text p {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 13, 27, 0.72);
  font-size: 12px;
  color: var(--text-dim);
}
.mode-badge.live { border-color: rgba(108, 196, 212, 0.4); color: var(--cyan); }
.mode-badge.web { border-color: rgba(231, 200, 120, 0.42); color: var(--gold); }
.mode-badge.demo { border-color: rgba(163, 137, 224, 0.4); color: var(--violet); }
.mode-badge.free { border-color: rgba(127, 224, 180, 0.42); color: #7fe0b4; }
.mode-badge.or { border-color: rgba(143, 193, 255, 0.42); color: #8fc1ff; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); animation: pulse 2s infinite; }
.live .pulse-dot { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.web .pulse-dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.free .pulse-dot { background: #7fe0b4; box-shadow: 0 0 8px #7fe0b4; }
.or .pulse-dot { background: #8fc1ff; box-shadow: 0 0 8px #8fc1ff; }
.demo .pulse-dot { background: var(--violet); box-shadow: 0 0 8px var(--violet); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.ghost-btn, .primary-btn {
  border: 1px solid var(--line);
  background: rgba(10, 15, 30, 0.72);
  border-radius: 8px;
  color: var(--text-dim);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.ghost-btn { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.ghost-btn:hover, .primary-btn:hover { color: var(--text); border-color: var(--line-bright); background: rgba(20, 28, 50, 0.86); }

.hero {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px 26px;
}
.hero-inner {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.thread {
  overflow-y: visible;
  scroll-behavior: smooth;
  text-align: center;
}

.welcome { animation: rise 0.8s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.welcome-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.32em;
  margin-bottom: 18px;
}
.welcome-kicker::before, .welcome-kicker::after {
  content: "";
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.welcome-kicker::after { transform: scaleX(-1); }

.welcome h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(32px, 5.2vw, 52px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
  color: #fff3dc;
  -webkit-text-stroke: 1px rgba(231, 200, 120, 0.55);
  text-shadow:
    0 0 2px rgba(231, 200, 120, 0.9),
    0 0 18px rgba(231, 200, 120, 0.42),
    0 2px 10px rgba(0, 0, 0, 0.82),
    0 0 42px rgba(0, 0, 0, 0.55);
}
.welcome h2 em {
  font-style: normal;
  color: #ffe9ad;
  -webkit-text-stroke: 1px rgba(255, 235, 170, 0.7);
  text-shadow: 0 0 30px rgba(231, 200, 120, 0.7), 0 0 3px rgba(255, 240, 190, 0.95), 0 2px 10px rgba(0, 0, 0, 0.8);
}
.welcome p.lead {
  max-width: 620px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-dim);
}

.prompt-carousel {
  max-width: 640px;
  min-height: 58px;
  margin: 24px auto 0;
  padding: 15px 20px;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(14, 21, 40, 0.72), rgba(9, 14, 28, 0.74));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  transition: border-color 0.25s, box-shadow 0.25s;
  position: relative;
}
.prompt-carousel:hover { border-color: rgba(108, 196, 212, 0.55); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.42), 0 0 0 3px rgba(108, 196, 212, 0.07); }
.prompt-carousel .pc-label {
  position: absolute;
  top: -9px;
  left: 16px;
  padding: 2px 9px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--gold);
  background: rgba(7, 11, 24, 0.94);
  border: 1px solid rgba(231, 200, 120, 0.28);
  border-radius: 999px;
}
.prompt-carousel .pc-text {
  font-size: 15px;
  line-height: 1.7;
  color: #dce5f4;
  min-height: 1.7em;
  white-space: pre-wrap;
}
.prompt-carousel .pc-cursor {
  display: inline-block;
  width: 1px;
  height: 1em;
  vertical-align: -0.12em;
  margin-left: 2px;
  background: var(--cyan);
  animation: blink 0.85s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.prompt-carousel.fading { opacity: 0; transform: translateY(4px); }
.prompt-carousel { transition: opacity 0.45s ease, transform 0.45s ease; }

.msg {
  display: grid;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: left;
  animation: rise 0.45s ease both;
}
.msg-user { justify-items: end; }
.msg-dao { justify-items: start; }

.bubble {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.9;
  word-break: break-word;
}
.msg-user .bubble {
  background: linear-gradient(180deg, rgba(24, 42, 66, 0.72), rgba(16, 28, 48, 0.74));
  color: #e7eefc;
  max-width: 78%;
}
.msg-dao .bubble {
  background: linear-gradient(180deg, rgba(13, 20, 38, 0.9), rgba(8, 13, 27, 0.92));
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.36);
  width: 100%;
  border-color: rgba(140, 190, 220, 0.2);
}
.msg-label {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.16em;
  padding: 0 4px;
}
.answer-text { white-space: pre-wrap; color: #d7dfee; }
.answer-text .cursor {
  display: inline-block;
  width: 1px;
  height: 1em;
  vertical-align: -0.12em;
  margin-left: 2px;
  background: var(--gold);
  animation: blink 0.85s steps(1) infinite;
}

.demo-note {
  margin-top: 16px;
  padding: 10px 13px;
  border: 1px dashed rgba(231, 200, 120, 0.35);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--gold);
  background: var(--gold-soft);
}

.loading-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 17px 20px;
  background: linear-gradient(180deg, rgba(13, 20, 38, 0.86), rgba(8, 13, 27, 0.88));
  width: 100%;
  text-align: left;
}
.loading-row { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-dim); }
.orbit {
  width: 22px; height: 22px;
  border: 2px solid rgba(108, 196, 212, 0.22);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-copy { margin-top: 9px; font-size: 12px; color: var(--text-faint); }

.composer-wrap { padding: 4px 0 0; }
.reset-row {
  max-width: 760px;
  margin: 0 auto 10px;
  display: flex;
  justify-content: flex-end;
}
.reset-row[hidden] { display: none; }
.reset-btn {
  height: 34px;
  padding: 0 15px;
  border: 1px solid rgba(231, 200, 120, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(40, 34, 20, 0.82), rgba(20, 17, 10, 0.86));
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.08em;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.reset-btn:hover {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(231, 200, 120, 0.3);
  transform: translateY(-1px);
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
  padding: 9px 9px 9px 16px;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: rgba(8, 13, 27, 0.82);
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.composer:focus-within { border-color: rgba(108, 196, 212, 0.6); box-shadow: 0 14px 46px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(108, 196, 212, 0.08); }
.composer textarea {
  flex: 1;
  min-height: 26px;
  max-height: 140px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  padding: 5px 0;
}
.composer textarea::placeholder { color: var(--text-faint); }
.composer button {
  flex: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #1c3b52, #12222f);
  color: var(--cyan);
  display: grid;
  place-items: center;
  transition: filter 0.2s, transform 0.2s;
}
.composer button:hover { filter: brightness(1.25); }
.composer button:active { transform: translateY(1px); }
.composer button:disabled { opacity: 0.45; cursor: default; filter: none; }
.composer-note {
  max-width: 760px;
  margin: 10px auto 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
}

.starmap-section {
  position: relative;
  border-top: 1px solid var(--line);
  padding: 70px 18px 90px;
  opacity: 0;
  transform: translateY(42px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.starmap-section.visible { opacity: 1; transform: none; }

/* ---- 银河裂隙：提问区 → 智慧星图的魔幻过渡 ---- */
.rift {
  position: relative;
  height: 90px;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(52% 120% at 50% 50%, rgba(108, 196, 212, 0.14), transparent 72%),
    linear-gradient(180deg, transparent, rgba(4, 7, 15, 0.5), transparent);
}
.rift::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56%;
  height: 1px;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent, rgba(231, 200, 120, 0.85), rgba(108, 196, 212, 0.7), transparent);
  box-shadow: 0 0 18px 2px rgba(231, 200, 120, 0.45), 0 0 46px 8px rgba(108, 196, 212, 0.28);
}
.rift span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #fdf3d0;
  box-shadow: 0 0 12px 2px rgba(255, 235, 170, 0.9);
  opacity: 0;
}
.rift span:nth-child(1) { animation: riftSpark 3.2s ease-out infinite; }
.rift span:nth-child(2) { animation: riftSpark 3.2s ease-out 1.6s infinite; }
@keyframes riftSpark {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  12% { opacity: 1; }
  45% { transform: translate(calc(-50% + 42vw), calc(-50% - 5vh)) scale(0.9); opacity: 0.85; }
  62% { transform: translate(calc(-50% - 38vw), calc(-50% + 6vh)) scale(0.6); opacity: 0.7; }
  80% { transform: translate(calc(-50% + 16vw), calc(-50% - 3vh)) scale(0.4); opacity: 0.35; }
  100% { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
}
.rift.in-view::before { animation: riftPulse 2.2s ease-in-out infinite; }
@keyframes riftPulse {
  0%, 100% { opacity: 0.75; filter: blur(0); }
  50% { opacity: 1; filter: blur(0.6px); }
}

/* ---- 星门旋涡入场（魔幻切换） ---- */
.starmap-section.visible .galaxy-wrap::before {
  content: "";
  position: absolute;
  inset: -18%;
  z-index: 0;
  background:
    radial-gradient(46% 46% at 50% 50%, rgba(108, 196, 212, 0.10), transparent 68%),
    repeating-conic-gradient(
      from 0deg,
      rgba(108, 196, 212, 0.10) 0deg 9deg,
      rgba(231, 200, 120, 0.06) 9deg 18deg
    );
  filter: blur(10px);
  pointer-events: none;
  animation: stargate 2.4s ease-out both;
  transform-origin: 50% 50%;
}
@keyframes stargate {
  0% {
    opacity: 0;
    transform: scale(0.35) rotate(0deg);
    filter: blur(22px) brightness(1.8);
  }
  38% { opacity: 1; }
  100% {
    opacity: 0.9;
    transform: scale(1.25) rotate(30deg);
    filter: blur(10px) brightness(1);
  }
}
/* 星光粒子自中心向四周飞散 */
.starmap-section.visible .galaxy-wrap::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  z-index: 0;
  border-radius: 50%;
  background: #fdf3d0;
  box-shadow:
    0 0 10px 2px rgba(255, 235, 170, 0.9),
    46px -28px 0 1px rgba(190, 225, 240, 0.75),
    -42px 30px 0 1px rgba(255, 235, 170, 0.7),
    30px 44px 0 2px rgba(190, 225, 240, 0.6),
    -30px -40px 0 1px rgba(255, 235, 170, 0.65),
    64px 12px 0 1px rgba(190, 225, 240, 0.55),
    -62px -8px 0 1px rgba(255, 235, 170, 0.55),
    8px 60px 0 1px rgba(190, 225, 240, 0.5),
    -8px -58px 0 1px rgba(255, 235, 170, 0.5);
  animation: stardust 1.6s cubic-bezier(0.16, 0.84, 0.3, 1) both;
  pointer-events: none;
}
@keyframes stardust {
  0% { opacity: 0; transform: scale(0.4); }
  30% { opacity: 1; }
  100% {
    opacity: 0;
    transform: scale(1.6) translate(0, 0);
  }
}
/* 星系节点由核心处依次放大浮现 */
.starmap-section.visible .galaxy-node {
  animation: nodeBloom 1.1s cubic-bezier(0.2, 0.9, 0.3, 1.2) backwards;
}
.starmap-section.visible .galaxy-node.core { animation-delay: 0.05s; }
.starmap-section.visible .galaxy-node:nth-child(2) { animation-delay: 0.28s; }
.starmap-section.visible .galaxy-node:nth-child(3) { animation-delay: 0.4s; }
.starmap-section.visible .galaxy-node:nth-child(4) { animation-delay: 0.52s; }
.starmap-section.visible .galaxy-node:nth-child(5) { animation-delay: 0.64s; }
.starmap-section.visible .galaxy-node:nth-child(6) { animation-delay: 0.76s; }
.starmap-section.visible .galaxy-node:nth-child(7) { animation-delay: 0.88s; }
.starmap-section.visible .galaxy-node:nth-child(8) { animation-delay: 1.0s; }
.starmap-section.visible .galaxy-node:nth-child(9) { animation-delay: 1.12s; }
@keyframes nodeBloom {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.12) rotate(-28deg);
    filter: brightness(2.4) blur(4px);
  }
  60% { opacity: 1; }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    filter: brightness(1) blur(0);
  }
}
.starmap-head { text-align: center; margin-bottom: 34px; }
.starmap-head h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 500;
  color: #f0e2bb;
  text-shadow: 0 0 24px rgba(231, 200, 120, 0.45);
  letter-spacing: 0.24em;
}
.starmap-head p { margin: 0; font-size: 14px; color: var(--text-dim); }
.starmap-section.visible .starmap-head h2 {
  animation: titleGlow 1.4s ease both;
}
@keyframes titleGlow {
  0% { opacity: 0; text-shadow: 0 0 0 rgba(231, 200, 120, 0); letter-spacing: 0.6em; }
  100% { opacity: 1; text-shadow: 0 0 24px rgba(231, 200, 120, 0.35); letter-spacing: 0; }
}

.galaxy-wrap {
  position: relative;
  width: min(1080px, 100%);
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 50% 50%, rgba(22, 16, 52, 0.6), transparent 72%),
    radial-gradient(40% 34% at 50% 50%, rgba(14, 52, 68, 0.32), transparent 70%),
    rgba(4, 7, 15, 0.72);
}
#galaxyCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.galaxy-nodes { position: absolute; inset: 0; }
.galaxy-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 104px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #dce6f5;
  font-size: 12px;
  text-align: center;
  transition: transform 0.25s, filter 0.25s;
  cursor: pointer;
}
.galaxy-node .gn-ball {
  display: block;
  width: 58px;
  height: 58px;
  margin: 0 auto 6px;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.12) 18%, transparent 34%),
    linear-gradient(150deg, rgba(120, 215, 230, 0.55), rgba(35, 80, 125, 0.75) 38%, rgba(18, 34, 70, 0.96) 74%),
    radial-gradient(circle at 68% 72%, rgba(163, 137, 224, 0.55), transparent 52%);
  box-shadow:
    inset -9px -12px 20px rgba(0, 0, 0, 0.62),
    inset 3px 4px 9px rgba(255, 255, 255, 0.16),
    0 0 20px rgba(108, 196, 212, 0.32);
}
.galaxy-node .gn-ball::after {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  width: 80px;
  height: 20px;
  border: 1px solid rgba(231, 200, 120, 0.55);
  border-radius: 50%;
  transform: translateY(-50%) rotate(-12deg);
  box-shadow: 0 0 10px rgba(231, 200, 120, 0.18);
}
.galaxy-node .gn-ball::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e6eef8, #8b96ae 72%);
  box-shadow: 0 0 8px rgba(210, 225, 245, 0.65);
  animation: moonOrbit 10s linear infinite;
}
@keyframes moonOrbit {
  from { transform: rotate(0deg) translateX(20px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(20px) rotate(-360deg); }
}
.galaxy-node .gn-ball .gn-ring {
  display: block;
  position: absolute;
  left: -16px;
  top: -14px;
  width: 90px;
  height: 34px;
  border: 1px solid rgba(140, 200, 220, 0.34);
  border-radius: 50%;
  transform: rotate(24deg);
  animation: ringSpin 26s linear infinite;
  pointer-events: none;
}
@keyframes ringSpin {
  to { transform: rotate(384deg); }
}
.galaxy-node:nth-child(odd) .gn-ball::after { border-color: rgba(108, 196, 212, 0.55); box-shadow: 0 0 10px rgba(108, 196, 212, 0.2); }
.galaxy-node:nth-child(3n) .gn-ball::after { border-color: rgba(163, 137, 224, 0.55); box-shadow: 0 0 10px rgba(163, 137, 224, 0.2); }
.galaxy-node:nth-child(3n) .gn-ball {
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.12) 18%, transparent 34%),
    linear-gradient(150deg, rgba(190, 150, 235, 0.55), rgba(90, 60, 160, 0.75) 38%, rgba(24, 20, 56, 0.96) 74%),
    radial-gradient(circle at 68% 72%, rgba(231, 200, 120, 0.45), transparent 52%);
  box-shadow:
    inset -9px -12px 20px rgba(0, 0, 0, 0.62),
    inset 3px 4px 9px rgba(255, 255, 255, 0.16),
    0 0 20px rgba(163, 137, 224, 0.32);
}
.galaxy-node:nth-child(3n+2) .gn-ball {
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.12) 18%, transparent 34%),
    linear-gradient(150deg, rgba(255, 205, 130, 0.5), rgba(170, 100, 50, 0.72) 38%, rgba(52, 28, 16, 0.94) 74%),
    radial-gradient(circle at 68% 72%, rgba(108, 196, 212, 0.4), transparent 52%);
  box-shadow:
    inset -9px -12px 20px rgba(0, 0, 0, 0.62),
    inset 3px 4px 9px rgba(255, 255, 255, 0.16),
    0 0 20px rgba(231, 200, 120, 0.3);
}
.galaxy-node .gn-label { display: block; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95); letter-spacing: 0.05em; }
.galaxy-node:hover, .galaxy-node.active {
  filter: brightness(1.25) drop-shadow(0 0 16px rgba(231, 200, 120, 0.45));
  transform: translate(-50%, -50%) scale(1.1);
}
.galaxy-node.core {
  width: 132px;
}
.galaxy-node.core .gn-ball {
  width: 86px;
  height: 86px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 252, 225, 0.98), rgba(255, 232, 160, 0.7) 24%, rgba(255, 190, 90, 0.34) 50%, transparent 74%),
    radial-gradient(circle at 62% 68%, rgba(255, 170, 90, 0.5), transparent 56%),
    radial-gradient(circle, rgba(255, 244, 200, 0.95), rgba(255, 205, 115, 0.55) 46%, rgba(255, 160, 70, 0.2) 64%, transparent 80%);
  box-shadow:
    0 0 24px rgba(255, 224, 150, 0.85),
    0 0 70px rgba(255, 205, 110, 0.42),
    0 0 140px rgba(255, 185, 95, 0.24),
    inset -8px -10px 24px rgba(180, 90, 20, 0.35);
  animation: starPulse 4.4s ease-in-out infinite;
}
.galaxy-node.core .gn-ball::after { display: none; }
.galaxy-node.core .gn-ball::before {
  content: "";
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 230, 160, 0.6);
  box-shadow: 0 0 20px rgba(255, 215, 130, 0.25);
  animation: coreSpin 24s linear infinite;
}
.galaxy-node.core .gn-ball .gn-ring {
  left: -34px;
  top: -32px;
  width: 154px;
  height: 52px;
  border-color: rgba(255, 225, 160, 0.32);
  box-shadow: 0 0 22px rgba(255, 215, 130, 0.2);
  animation: ringSpin 38s linear infinite reverse;
}
.galaxy-node.core .gn-ball .gn-ring { border-color: rgba(231, 200, 120, 0.85); }
@keyframes starPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.09); filter: brightness(1.3); }
}
@keyframes coreSpin {
  to { transform: rotate(360deg); }
}
.galaxy-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.14em;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
}

.thinker-panel {
  max-width: 1080px;
  margin: 26px auto 0;
  display: none;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.thinker-panel.open { display: grid; animation: rise 0.5s ease both; }
.thinker-panel.open .thinker-card {
  animation: cardFloat 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.15) backwards;
}
.thinker-panel.open .thinker-card:nth-child(2) { animation-delay: 0.06s; }
.thinker-panel.open .thinker-card:nth-child(3) { animation-delay: 0.12s; }
.thinker-panel.open .thinker-card:nth-child(4) { animation-delay: 0.18s; }
.thinker-panel.open .thinker-card:nth-child(5) { animation-delay: 0.24s; }
.thinker-panel.open .thinker-card:nth-child(6) { animation-delay: 0.3s; }
.thinker-panel.open .thinker-card:nth-child(7) { animation-delay: 0.36s; }
.thinker-panel.open .thinker-card:nth-child(8) { animation-delay: 0.42s; }
.thinker-panel.open .thinker-card:nth-child(9) { animation-delay: 0.48s; }
@keyframes cardFloat {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.86) rotateX(14deg);
    filter: brightness(1.7) blur(3px);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: brightness(1) blur(0);
  }
}
.thinker-panel .tp-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px 0;
}
.thinker-panel .tp-title { font-family: var(--serif); font-size: 20px; color: var(--gold); }
.tp-close { border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--text-dim); padding: 5px 10px; font-size: 12px; }
.tp-close:hover { color: var(--text); border-color: var(--line-bright); }
.thinker-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 15px;
  background: linear-gradient(180deg, rgba(13, 20, 38, 0.82), rgba(8, 13, 27, 0.86));
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.thinker-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(220px 90px at 50% 0%, rgba(231, 200, 120, 0.16), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.thinker-card:hover { border-color: rgba(231, 200, 120, 0.4); transform: translateY(-2px); }
.thinker-card:hover::before { opacity: 1; }
.thinker-card:active { transform: scale(0.985); }
.thinker-card.expanded {
  border-color: rgba(231, 200, 120, 0.55);
  box-shadow: 0 0 18px rgba(231, 200, 120, 0.12), 0 8px 30px rgba(0, 0, 0, 0.35);
}
.thinker-card.expanded::before { opacity: 1; }
.thinker-card .t-name { font-size: 15px; font-weight: 600; color: #e6edfa; }
.thinker-card .t-title { margin-top: 2px; font-size: 11px; color: var(--text-faint); }
.thinker-card .t-insight { margin-top: 8px; font-size: 12px; line-height: 1.7; color: var(--text-dim); }
.thinker-card .t-tags { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; }
.thinker-card .t-tags span { font-size: 10px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-faint); }
.thinker-card .t-hint {
  margin-top: 9px; font-size: 11px; letter-spacing: 0.08em;
  color: #cbb27a; opacity: 0.85;
  border: 1px dashed rgba(231, 200, 120, 0.35);
  border-radius: 5px; padding: 4px 8px; text-align: center;
  transition: opacity 0.3s, border-color 0.3s;
}
.thinker-card:hover .t-hint { opacity: 1; border-color: rgba(231, 200, 120, 0.65); }
.thinker-card.expanded .t-hint { opacity: 0.4; border-color: transparent; }
/* A: 星辉展开 —— 高度 0→auto 的顺滑动画 */
.thinker-card .t-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s cubic-bezier(0.25, 0.9, 0.3, 1);
}
.thinker-card.expanded .t-detail { grid-template-rows: 1fr; }
.thinker-card .t-detail > .t-inner { overflow: hidden; }
.thinker-card .t-perspective {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(231, 200, 120, 0.22);
  font-size: 12.5px;
  line-height: 1.85;
  color: #c9d4e8;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.45s 0.15s, transform 0.45s 0.15s;
}
.thinker-card.expanded .t-perspective { opacity: 1; transform: none; }
/* 中国古代思想家:文言名句 */
.thinker-card .t-quotes {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(231, 200, 120, 0.22);
  display: grid;
  gap: 7px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.45s 0.15s, transform 0.45s 0.15s;
}
.thinker-card.expanded .t-quotes { opacity: 1; transform: none; }
.thinker-card .t-quote { font-size: 13px; line-height: 1.8; color: #f0e2bb; }
.thinker-card .tq-text { font-family: var(--serif); letter-spacing: 0.04em; text-shadow: 0 0 12px rgba(231, 200, 120, 0.25); }
.thinker-card .tq-source { margin-left: 6px; font-size: 10.5px; color: var(--text-faint); }
.thinker-card .t-kws { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; opacity: 0; transition: opacity 0.45s 0.25s; }
.thinker-card.expanded .t-kws { opacity: 1; }
.thinker-card .t-kws span { font-size: 10px; padding: 2px 8px; border-radius: 4px; background: rgba(163, 137, 224, 0.1); border: 1px solid rgba(163, 137, 224, 0.28); color: #b9aede; }
/* C: 携其视角按钮 */
.thinker-card .t-ask {
  margin-top: 11px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(231, 200, 120, 0.35);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(231, 200, 120, 0.1), rgba(231, 200, 120, 0.04));
  color: var(--gold);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  font-family: var(--sans);
}
.thinker-card .t-ask:hover {
  background: linear-gradient(180deg, rgba(231, 200, 120, 0.22), rgba(231, 200, 120, 0.08));
  border-color: rgba(231, 200, 120, 0.7);
  box-shadow: 0 0 14px rgba(231, 200, 120, 0.18);
}
.thinker-card .t-ask:active { transform: scale(0.97); }
.thinker-empty { grid-column: 1 / -1; text-align: center; padding: 30px 10px; color: var(--text-faint); }

/* B: 星语飘出 */
.starword {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  max-width: min(340px, 78vw);
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(231, 200, 120, 0.55);
  background: linear-gradient(180deg, rgba(16, 24, 44, 0.95), rgba(8, 13, 27, 0.96));
  color: #f6e7b8;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  font-family: var(--serif);
  text-shadow: 0 0 10px rgba(231, 200, 120, 0.55);
  box-shadow: 0 0 24px rgba(231, 200, 120, 0.25), 0 10px 34px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%) scale(0.7);
  opacity: 0;
}
.starword.fly {
  animation: starwordFly 5.2s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes starwordFly {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6) rotate(-3deg); filter: blur(0); }
  10%  { opacity: 1; transform: translate(-50%, -72%) scale(1.06) rotate(1deg); filter: blur(0); }
  22%  { transform: translate(-50%, -92%) scale(1) rotate(0deg); filter: blur(0); }
  /* 中段长停留：从 22% 到 90% 保持清晰可见，让读者看完整句 */
  72%  { opacity: 1; transform: translate(-50%, -104%) scale(1) rotate(0deg); filter: blur(0); }
  90%  { opacity: 1; transform: translate(-50%, -112%) scale(1) rotate(0deg); filter: blur(0); }
  /* 最后 10% 才快速淡出 + 模糊 */
  100% { opacity: 0; transform: translate(-50%, -140%) scale(0.94) rotate(2deg); filter: blur(2px); }
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 18px 34px;
  text-align: center;
  background: rgba(4, 7, 15, 0.55);
}
.site-footer p { margin: 0; font-size: 13px; color: var(--text-dim); font-family: var(--serif); }
.site-footer .credit { margin-top: 8px; font-family: var(--sans); font-size: 12px; color: var(--gold); letter-spacing: 0.2em; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 4, 10, 0.7); backdrop-filter: blur(6px); }
.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(12, 18, 34, 0.96), rgba(6, 10, 22, 0.97));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: rise 0.35s ease both;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-family: var(--serif); font-size: 20px; font-weight: 500; color: #edf1fa; }
.modal-close { border: 0; background: transparent; color: var(--text-faint); font-size: 24px; line-height: 1; padding: 4px 8px; }
.modal-close:hover { color: var(--text); }
.mode-rows { display: grid; gap: 12px; margin-bottom: 16px; }
.mode-row { display: flex; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: rgba(8, 13, 27, 0.5); }
.mode-row strong { font-size: 14px; color: #dce5f4; }
.mode-row p { margin: 4px 0 0; font-size: 12px; line-height: 1.65; color: var(--text-faint); }
.mode-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.demo-dot { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.api-dot { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.free-dot { background: #7fe0b4; box-shadow: 0 0 8px #7fe0b4; }
.or-dot { background: #8fc1ff; box-shadow: 0 0 8px #8fc1ff; }
/* ---- 可选择的接入方式卡片 ---- */
.mode-choice {
  cursor: pointer;
  align-items: flex-start;
  transition: border-color 0.22s, background 0.22s, box-shadow 0.22s;
  position: relative;
}
.mode-choice:hover { border-color: var(--line-bright); background: rgba(14, 22, 42, 0.72); }
.mode-choice.selected {
  border-color: rgba(231, 200, 120, 0.6);
  background: linear-gradient(180deg, rgba(34, 30, 18, 0.62), rgba(14, 20, 36, 0.78));
  box-shadow: 0 0 0 1px rgba(231, 200, 120, 0.14), 0 0 22px rgba(231, 200, 120, 0.1);
}
.mode-radio {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(6, 10, 22, 0.9);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.mode-radio span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s, box-shadow 0.2s;
}
.mode-choice.selected .mode-radio {
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(231, 200, 120, 0.4);
}
.mode-choice.selected .mode-radio span {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(231, 200, 120, 0.8);
}
.field-group { margin-top: 2px; }
.field-group[hidden] { display: none; }
.field-label { display: block; margin: 4px 0 8px; font-size: 12px; color: var(--text-dim); }
.token-input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  background: rgba(6, 10, 22, 0.9);
  color: var(--text);
  outline: 0;
  font-size: 14px;
}
.token-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(231, 200, 120, 0.08); }
.token-help {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 27, 0.5);
}
.token-help p { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: #dce5f4; }
.token-help .token-tip {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.8;
  color: var(--text-dim);
  background: rgba(108, 196, 212, 0.06);
  border-left: 2px solid rgba(108, 196, 212, 0.4);
  padding: 8px 10px;
  border-radius: 0 6px 6px 0;
}
.token-help .ghost-btn { height: 30px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.primary-btn { height: 36px; padding: 0 18px; border-color: rgba(231, 200, 120, 0.42); color: var(--gold); background: var(--gold-soft); }
.primary-btn:hover { border-color: var(--gold); background: rgba(231, 200, 120, 0.2); }
.settings-message { margin: 12px 0 0; font-size: 12px; line-height: 1.7; color: var(--text-dim); min-height: 1.4em; }
.settings-message.ok { color: var(--cyan); }
.settings-message.err { color: var(--danger, #d98a8a); }

/* 捕捉星辉:与智慧星图同级的页面 section */
.draw-section { padding: 60px 20px 40px; display: flex; flex-direction: column; align-items: center; }
.draw-section .starmap-head { text-align: center; margin-bottom: 30px; }
.draw-section .starmap-head h2 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 500; color: #f0e2bb; letter-spacing: 0.24em; text-shadow: 0 0 24px rgba(231, 200, 120, 0.45); }
.draw-section .starmap-head p { margin: 10px 0 0; font-size: 13px; color: var(--text-dim); letter-spacing: 0.1em; }

.ds-stage {
  position: relative; z-index: 1;
  width: min(680px, 92vw); height: min(440px, 54vh);
  border-radius: 16px; overflow: hidden;
  background: #060a16;
  border: 1px solid rgba(231, 200, 120, 0.14);
  box-shadow: 0 0 60px rgba(20, 40, 90, 0.5), inset 0 0 120px rgba(0, 0, 0, 0.5);
}
#drawCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* 未开始捕捉时的提示 */
.draw-idle {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; letter-spacing: 0.12em; color: var(--text-dim);
  text-shadow: 0 0 16px rgba(231, 200, 120, 0.3);
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.4), transparent 100%),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,0.35), transparent 100%),
    radial-gradient(1.5px 1.5px at 85% 70%, rgba(231,200,120,0.4), transparent 100%),
    radial-gradient(1px 1px at 30% 80%, rgba(255,255,255,0.3), transparent 100%),
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.05), transparent 55%);
  animation: drawIdlePulse 3.2s ease-in-out infinite;
}
@keyframes drawIdlePulse { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
.draw-card-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px 44px; opacity: 0; transform: scale(0.88);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.15);
  overflow: hidden; box-sizing: border-box;
}
.draw-card-face .dc-inner {
  max-width: 100%; overflow-y: auto; padding: 2px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  -webkit-overflow-scrolling: touch;
}
.draw-card-face.show { opacity: 1; transform: scale(1); }
/* 退场:淡出 + 缩小,与新卡动画严格串行 */
.draw-card-face.leaving {
  opacity: 0 !important; transform: scale(0.9) translateY(8px) !important;
  transition: opacity 0.45s ease, transform 0.45s ease !important;
}
.dc-symbol { font-size: 34px; color: #e8c876; text-shadow: 0 0 20px rgba(231, 200, 120, 0.7); margin-bottom: 8px; }
.dc-name { font-family: var(--serif); font-size: 34px; font-weight: 500; color: #f5ead2; letter-spacing: 0.12em; }
.dc-title { margin-top: 6px; font-size: 13px; color: #9aa3b2; letter-spacing: 0.08em; }
.dc-insight { margin-top: 18px; font-size: 15px; line-height: 1.85; color: #dbe3f5; max-width: 480px; }
.dc-guide { margin-top: 16px; font-size: 14px; line-height: 1.85; color: #f0e2bb; max-width: 500px; border-top: 1px dashed rgba(231, 200, 120, 0.3); padding-top: 13px; }
.dc-quote { margin-top: 13px; font-size: 13px; color: #cbb27a; font-family: var(--serif); letter-spacing: 0.05em; }
.draw-actions { position: relative; z-index: 2; display: flex; gap: 12px; margin-top: 26px; }
.draw-actions .ghost-btn.disabled, .draw-actions .primary-btn.disabled { opacity: 0.45; pointer-events: none; }
.draw-actions .primary-btn { min-width: 150px; height: 40px; }
.draw-actions .ghost-btn { height: 40px; padding: 0 20px; }
/* 手机端:卡片文字缩小+内部滚动,杜绝长文溢出边框 */
@media (max-width: 720px) {
  .ds-stage { height: 62vh; }
  .draw-card-face { padding: 14px 12px; }
  .draw-card-face .dc-inner { overflow-y: auto; }
  .dc-symbol { font-size: 26px; margin-bottom: 4px; }
  .dc-insight { margin-top: 10px; font-size: 13px; line-height: 1.7; max-width: 100%; }
  .dc-guide { margin-top: 10px; font-size: 12px; line-height: 1.7; max-width: 100%; }
  .dc-quote { margin-top: 8px; font-size: 11.5px; }
  .dc-name { font-size: 21px; }
}

/* —— 星辉主题:不同类别思想家不同卡片气质 —— */
.draw-card-face {
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.06), transparent 55%),
              linear-gradient(160deg, var(--th-g0, #12243e), var(--th-g1, #080d1e));
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.4);
}
.draw-card-face::before {
  content: ""; position: absolute; inset: 12px; pointer-events: none;
  border: 1px solid var(--th-edge, rgba(231, 200, 120, 0.35));
  border-radius: 10px;
}
.draw-card-face .dc-symbol { color: var(--th-acc, #e8c876); text-shadow: 0 0 22px var(--th-glow, rgba(231, 200, 120, 0.8)); }
.draw-card-face .dc-guide { border-top-color: var(--th-edge, rgba(231, 200, 120, 0.3)); color: var(--th-txt, #f0e2bb); }
.draw-card-face .dc-quote { color: var(--th-acc, #cbb27a); }
.draw-card-face.th-relationships, .mini-card.th-relationships { --th-g0: #3f1f36; --th-g1: #191026; --th-acc: #f4a6c0; --th-glow: rgba(244, 166, 192, 0.75); --th-edge: rgba(244, 166, 192, 0.4); --th-txt: #fbe3ec; }
.draw-card-face.th-self, .mini-card.th-self { --th-g0: #12382c; --th-g1: #0c1c22; --th-acc: #7fe0b4; --th-glow: rgba(127, 224, 180, 0.7); --th-edge: rgba(127, 224, 180, 0.4); --th-txt: #d9f7ea; }
.draw-card-face.th-emotions, .mini-card.th-emotions { --th-g0: #2d1c40; --th-g1: #100c22; --th-acc: #c3a6f4; --th-glow: rgba(195, 166, 244, 0.75); --th-edge: rgba(195, 166, 244, 0.4); --th-txt: #e9dffb; }
.draw-card-face.th-decision, .mini-card.th-decision { --th-g0: #3d2c16; --th-g1: #1c1420; --th-acc: #f4c56a; --th-glow: rgba(244, 197, 106, 0.8); --th-edge: rgba(244, 197, 106, 0.42); --th-txt: #f9edcf; }
.draw-card-face.th-meaning, .mini-card.th-meaning { --th-g0: #122a4a; --th-g1: #081020; --th-acc: #8fc1ff; --th-glow: rgba(143, 193, 255, 0.75); --th-edge: rgba(143, 193, 255, 0.4); --th-txt: #dcebff; }
.draw-card-face.th-career, .mini-card.th-career { --th-g0: #16304a; --th-g1: #0a1320; --th-acc: #6fb7e8; --th-glow: rgba(111, 183, 232, 0.7); --th-edge: rgba(111, 183, 232, 0.4); --th-txt: #d5ebfa; }
.draw-card-face.th-conflict, .mini-card.th-conflict { --th-g0: #421f1c; --th-g1: #1e1016; --th-acc: #ff9a8a; --th-glow: rgba(255, 154, 138, 0.7); --th-edge: rgba(255, 154, 138, 0.4); --th-txt: #fde3de; }
.draw-card-face.th-health, .mini-card.th-health { --th-g0: #10302f; --th-g1: #0a1418; --th-acc: #6fd8d0; --th-glow: rgba(111, 216, 208, 0.7); --th-edge: rgba(111, 216, 208, 0.4); --th-txt: #d9f6f3; }

/* 分享 */
.share-card { width: min(460px, 100%); }
.share-preview { display: flex; justify-content: center; }
.mini-card {
  width: 320px; border: 1px solid var(--th-edge, rgba(231, 200, 120, 0.4)); border-radius: 12px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.06), transparent 55%),
              linear-gradient(160deg, var(--th-g0, #0d1424), var(--th-g1, #060a16));
  padding: 20px 22px; text-align: center; box-shadow: 0 0 30px var(--th-glow, rgba(231, 200, 120, 0.15));
}
.mini-card .mc-head { font-size: 13px; color: var(--th-acc, #e8c876); letter-spacing: 0.14em; }
.mini-card .mc-symbol { margin-top: 8px; font-size: 24px; color: var(--th-acc, #e8c876); text-shadow: 0 0 16px var(--th-glow, rgba(231, 200, 120, 0.7)); }
.mini-card .mc-name { margin-top: 4px; font-family: var(--serif); font-size: 26px; color: #f5ead2; }
.mini-card .mc-title { margin-top: 4px; font-size: 11px; color: #9aa3b2; }
.mini-card .mc-insight { margin-top: 14px; font-size: 12.5px; line-height: 1.8; color: #dbe3f5; }
.mini-card .mc-guide { margin-top: 12px; font-size: 12px; line-height: 1.8; color: var(--th-txt, #f0e2bb); border-top: 1px dashed var(--th-edge, rgba(231, 200, 120, 0.3)); padding-top: 10px; }
.mini-card .mc-quote { margin-top: 10px; font-size: 11.5px; color: var(--th-acc, #cbb27a); font-family: var(--serif); }
.mini-card .mc-quote span { color: #7d8698; font-family: sans-serif; font-size: 10px; }
.share-links { display: flex; gap: 8px; margin-top: 16px; justify-content: center; flex-wrap: wrap; }

.stream-model { font-size: 11px; color: var(--text-faint); font-weight: 400; }
.stream-caret {
  display: inline-block; width: 2px; height: 1em;
  background: var(--gold); vertical-align: -0.15em; margin-left: 2px;
  animation: caretBlink 0.9s steps(2, start) infinite;
}
@keyframes caretBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
/* 侧栏快速定位:右侧细窄竖条,半透明不挡内容 */
.side-nav {
  position: fixed; right: 10px; top: 50%; transform: translateY(-50%);
  z-index: 70; display: flex; flex-direction: column; gap: 6px;
}
.side-nav-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(231, 200, 120, 0.22);
  background: rgba(10, 14, 28, 0.55); backdrop-filter: blur(6px);
  color: var(--text-dim); font-size: 12px; letter-spacing: 0.06em;
  transition: all 0.25s ease; white-space: nowrap; opacity: 0.75;
}
.side-nav-btn .sn-icon { color: var(--gold); font-size: 11px; }
.side-nav-btn:hover { opacity: 1; color: #f0e2bb; border-color: rgba(231, 200, 120, 0.5); background: rgba(14, 20, 38, 0.8); transform: translateX(-3px); }
/* 手机上侧栏收起为纯图标,不遮挡内容 */
@media (max-width: 720px) {
  .side-nav { right: 6px; gap: 4px; }
  .side-nav-btn { padding: 6px 8px; }
  .side-nav-btn .sn-label { display: none; }
}
/* 背景音乐控件:右下角,星空风格,不喧宾夺主 */
.bgm-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 88; display: flex; align-items: center; gap: 8px; }
.bgm-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(231, 200, 120, 0.4);
  background: rgba(8, 13, 27, 0.72);
  color: #f0e2bb; cursor: pointer;
  display: grid; place-items: center;
  backdrop-filter: blur(6px);
  transition: box-shadow 0.3s, border-color 0.3s, transform 0.15s;
  font-size: 17px;
}
.bgm-btn:hover { border-color: rgba(231, 200, 120, 0.85); box-shadow: 0 0 16px rgba(231, 200, 120, 0.35); transform: scale(1.06); }
.bgm-btn.on { color: #1b2335; background: radial-gradient(circle at 35% 30%, #f8e7b0, #e0b96a); border-color: #e8c876; box-shadow: 0 0 18px rgba(231, 200, 120, 0.45); }
.bgm-btn .bgm-label { display: none; }
.bgm-vol { background: rgba(8, 13, 27, 0.82); border: 1px solid rgba(231, 200, 120, 0.3); border-radius: 20px; padding: 8px 10px; backdrop-filter: blur(6px); }
.bgm-vol input[type="range"] { width: 90px; accent-color: #e8c876; cursor: pointer; height: 4px; }

/* 首次引导 */
.onboard-card { width: min(620px, 100%); }
.onboard-head { text-align: center; margin-bottom: 12px; }
.onboard-head h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 22px; font-weight: 500; color: #edf1fa; }
.onboard-sub { margin: 0; font-size: 13px; color: var(--text-dim); font-family: var(--serif); letter-spacing: 0.06em; }
.onboard-intro { margin: 2px 0 12px; display: grid; gap: 8px; }
.onboard-intro p { margin: 0; font-size: 12.5px; line-height: 1.8; color: var(--text-dim); }
.onboard-intro b { color: #e6edfa; font-weight: 600; }
.onboard-modes { display: grid; gap: 12px; margin: 4px 0 14px; }
.onboard-mode { display: flex; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: rgba(8, 13, 27, 0.5); }
.onboard-mode strong { display: block; font-size: 13.5px; color: #e6edfa; }
.onboard-mode p { margin: 3px 0 0; font-size: 12px; line-height: 1.7; color: var(--text-dim); }
.om-dot { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; }
.om-dot.demo { background: var(--text-faint); box-shadow: 0 0 8px var(--text-faint); }
.om-dot.api { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.om-dot.web { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.om-dot.free { background: #7fe0b4; box-shadow: 0 0 8px #7fe0b4; }
.om-dot.or { background: #8fc1ff; box-shadow: 0 0 8px #8fc1ff; }
.onboard-note { margin: 0 0 4px; font-size: 11.5px; line-height: 1.7; color: var(--text-faint); text-align: center; }
.onboard-note b { color: var(--text-dim); font-weight: 600; }
.onboard-card .modal-actions { justify-content: center; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(90px);
  z-index: 60;
  padding: 11px 18px;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s, opacity 0.3s;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

@media (max-width: 720px) {
  .topbar-inner { height: 64px; padding: 0 12px; }
  .brand-text p { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; }
  .hero { min-height: calc(100vh - 64px); padding: 22px 12px 18px; }
  .welcome h2 { font-size: 30px; }
  .prompt-carousel { min-height: 70px; }
  .msg-user .bubble { max-width: 92%; }
  .galaxy-wrap { aspect-ratio: 4 / 5; }
  .galaxy-node { min-width: 82px; font-size: 12px; }
  .starmap-section { padding: 54px 12px 66px; }
}

@media (prefers-reduced-motion: reduce) {
  .nebula, #cosmos { animation: none; }
}
