/* 第 0 屏 · 封面
   中心一颗星球，其余留白。白天 Neumorphism，夜晚 Liquid Glass。 */

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(18px, 2.6vw, 34px) clamp(20px, 4vw, 54px);
  pointer-events: none;
  isolation: isolate;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.topbar::before {
  content: "";
  position: absolute;
  inset: -24px -12px -10px;
  z-index: -1;
  background: linear-gradient(var(--bg) 62%, transparent);
  opacity: .96;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-btn {
  display: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  place-items: center;
  transition: color .3s var(--ease), transform 140ms var(--ease);
}
.back-btn .icon { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) {
  .back-btn:hover { color: var(--accent); }
}
.back-btn:active { transform: scale(.94); }
body[data-view="info"] .back-btn { display: grid; }

.brand {
  display: flex;
  align-items: baseline;
  gap: 11px;
}
.brand-cn {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: .12em;
}
.brand-en {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .24em;
  color: var(--text-3);
}

.topbar-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 白天：一颗凸起的圆钮 */
.theme-toggle {
  position: relative;
  overflow: hidden;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text-2);
  background: var(--bg);
  box-shadow:
    6px 6px 14px var(--shade),
    -6px -6px 14px var(--light);
  transition:
    color .18s var(--ease),
    background .25s var(--ease),
    box-shadow .3s var(--ease),
    transform 140ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover { color: var(--accent); }
}
.theme-toggle:active { transform: scale(.96); }

/* 夜晚：一块玻璃 */
:root[data-theme="dark"] .theme-toggle {
  color: var(--accent);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, .10) 0%,
    rgba(255, 255, 255, .03) 46%,
    rgba(255, 255, 255, .06) 100%
  );
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: var(--lg-filter, blur(22px) saturate(180%));
  backdrop-filter: var(--lg-filter, blur(22px) saturate(180%));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 -1px 0 rgba(0, 0, 0, .3),
    0 12px 30px rgba(0, 0, 0, .38),
    0 2px 8px rgba(0, 0, 0, .28);
}

.info-btn {
  width: 40px;
  height: 40px;
}
.info-btn .icon {
  width: 18px;
  height: 18px;
}

/* 说明面板：白天软面板，夜晚玻璃 */
.about {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  width: min(300px, calc(100vw - 44px));
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--bg);
  box-shadow:
    6px 6px 18px var(--shade),
    -6px -6px 18px var(--light);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text-2);
}
.about p { margin: 0 0 9px; }
.about p:last-child { margin-bottom: 0; }
.about-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  color: var(--text-3);
}
.settings-section + .settings-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.about .settings-label {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--text-3);
}
:root[data-theme="dark"] .about {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, .10) 0%,
    rgba(255, 255, 255, .035) 100%
  );
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    0 24px 54px rgba(0, 0, 0, .5);
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

/* 布局 */
/* 一屏封面：内容放得下就不出现滚动条；窗口很矮时仍可滚动，只是不显示滚动条 */
body.page-cover {
  overflow-y: auto;
  scrollbar-width: none;
}
body.page-cover::-webkit-scrollbar { display: none; }

.cover {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.4vh, 28px);
  padding: clamp(88px, 11vh, 120px) clamp(20px, 6vw, 80px) clamp(62px, 7vh, 88px);
}

/* 夜晚：按钮后方的一团暖光，让玻璃有东西可以折射 */
:root[data-theme="dark"] .cover::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 81%;
  width: min(760px, 88vw);
  height: 240px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(ellipse at 44% 50%, rgba(255, 210, 122, .08), transparent 62%),
    radial-gradient(ellipse at 68% 32%, rgba(170, 190, 220, .05), transparent 66%);
  filter: blur(48px);
  pointer-events: none;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.planet-wrap {
  --planet-size: clamp(180px, min(36vmin, 32vh), 380px);
  position: relative;
  width: var(--planet-size);
  height: var(--planet-size);
  display: grid;
  place-items: center;
}

.orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--planet-size) * 1.62);
  height: calc(var(--planet-size) * .46);
  border: 1px solid var(--line);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-13deg);
  pointer-events: none;
}
.orbit::after {
  content: "";
  position: absolute;
  right: -2.5px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 10px var(--accent-bright);
  transform: translateY(-50%);
}

/* 星球：白天是哑光球体，夜晚是暗面 + 金色边缘光 */
.planet {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  /* 触屏：竖向滑动交给页面滚动，横向滑动留给液态窗口 */
  touch-action: pan-y;
  appearance: none;
  background:
    radial-gradient(
      circle at 31% 26%,
      var(--planet-a) 0%,
      var(--planet-b) 30%,
      var(--planet-c) 63%,
      var(--planet-d) 100%
    );
  box-shadow:
    inset -26px -34px 70px rgba(38, 52, 72, .34),
    inset 20px 22px 60px rgba(255, 255, 255, .65),
    36px 44px 90px var(--shade),
    -26px -24px 70px var(--light);
  transition:
    transform .6s var(--ease),
    box-shadow .6s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .planet:hover { transform: scale(1.012); }
}
.planet:active { transform: scale(1.004); transition-duration: 140ms; }
.planet:focus-visible {
  outline-width: 1px;
  outline-offset: 7px;
}

/* 表面起伏，避免纯渐变的塑料感 */
.planet::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 42% 26% at 38% 45%, rgba(255, 255, 255, .32), transparent 72%),
    radial-gradient(ellipse 30% 20% at 63% 64%, rgba(80, 100, 130, .22), transparent 72%),
    radial-gradient(ellipse 18% 26% at 56% 30%, rgba(255, 255, 255, .16), transparent 72%);
  filter: blur(10px);
  mix-blend-mode: soft-light;
}

/* 右下的一圈金色边缘光 */
.planet::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 74% 72%,
    transparent 52%,
    rgba(255, 210, 122, .26) 70%,
    rgba(255, 210, 122, .05) 76%,
    transparent 80%
  );
  mix-blend-mode: screen;
  opacity: .8;
}

.planet-liquid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  pointer-events: none;
}

.planet-glow {
  position: absolute;
  left: 24%;
  top: 18%;
  width: 34%;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .7), transparent 70%);
  filter: blur(14px);
  opacity: .55;
  pointer-events: none;
}

:root[data-theme="dark"] .planet {
  box-shadow:
    inset -30px -36px 80px rgba(0, 0, 0, .86),
    inset 18px 20px 55px rgba(140, 170, 220, .1),
    0 0 90px rgba(255, 210, 122, .09),
    40px 50px 110px rgba(0, 0, 0, .6);
}
:root[data-theme="dark"] .planet::before {
  background:
    radial-gradient(ellipse 42% 26% at 38% 45%, rgba(190, 215, 255, .12), transparent 72%),
    radial-gradient(ellipse 30% 20% at 63% 64%, rgba(255, 210, 122, .1), transparent 72%),
    radial-gradient(ellipse 18% 26% at 56% 30%, rgba(190, 215, 255, .08), transparent 72%);
  mix-blend-mode: screen;
}
:root[data-theme="dark"] .planet-glow {
  opacity: .14;
  background: radial-gradient(circle, rgba(200, 220, 255, .65), transparent 70%);
}

.stage-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--text-3);
}
.stage-label .mono { color: var(--accent); }

/* 第 1 屏 · 信息页 */
.galaxy-label {
  display: none;
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .26em;
  color: var(--text-3);
}

.info {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
}
.info-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--text);
}
.info .meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  color: var(--text-3);
}
.info .hint {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-2);
}
.info .hint::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 10px var(--accent-bright);
  animation: hint-pulse 2.6s ease-in-out infinite;
}
@keyframes hint-pulse {
  0%, 100% { opacity: .35; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

body[data-view="info"] .intro { display: none; }
body[data-view="info"] .stage-label { display: none; }
body[data-view="info"] .galaxy-label { display: block; }
body[data-view="info"] .info { display: flex; }
body[data-view="info"] .planet-wrap {
  --planet-size: clamp(150px, min(28vmin, 25vh), 300px);
}
body[data-view="info"] .cover { gap: 24px; }
body[data-view="info"] .planet { cursor: pointer; }
body[data-view="info"] .planet-wrap::after {
  content: "";
  position: absolute;
  inset: -9%;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: planet-pulse 3.6s ease-out infinite;
}
@keyframes planet-pulse {
  0% { transform: scale(.92); opacity: .26; }
  62%, 100% { transform: scale(1.12); opacity: 0; }
}

/* 信息页底部的下滑提示 */
.scroll-cue {
  display: none;
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 3vh, 30px);
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-decoration: none;
  transition: opacity .5s var(--ease);
}
body[data-view="info"] .scroll-cue { display: flex; }
body.is-scrolled .scroll-cue { opacity: 0; pointer-events: none; }
.scroll-cue-label { white-space: nowrap; }
.scroll-cue-line {
  position: relative;
  width: 1px;
  height: 34px;
  overflow: hidden;
  background: linear-gradient(var(--accent), transparent);
}
.scroll-cue-line::after {
  content: "";
  position: absolute;
  left: 0;
  top: -8px;
  width: 1px;
  height: 8px;
  background: var(--accent-bright);
  animation: cue-drop 2.4s var(--ease) infinite;
}
@keyframes cue-drop {
  0% { transform: translateY(0); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateY(42px); opacity: 0; }
}

/* 视角切换：星球做共享元素，其余淡入淡出 */
html[data-vt="view"] .planet { view-transition-name: planet; }
html[data-vt="view"]::view-transition-old(root) {
  animation: vt-out .7s var(--ease) both;
}
html[data-vt="view"]::view-transition-new(root) {
  animation: vt-in .85s var(--ease) both;
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
::view-transition-group(planet),
::view-transition-old(planet),
::view-transition-new(planet) {
  animation-duration: 1.05s;
  animation-timing-function: var(--ease);
}

/* 文案 */
.intro {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  text-align: center;
}

.intro h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(28px, 3.8vw, 46px);
  line-height: 1.34;
  letter-spacing: .02em;
  color: var(--text);
}

.lede {
  margin: 0;
  max-width: 46ch;
  font-size: 14px;
  line-height: 1.95;
  color: var(--text-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 5px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 23px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13.5px;
  letter-spacing: .04em;
  cursor: pointer;
  transition:
    color .18s var(--ease),
    background .18s var(--ease),
    box-shadow .25s var(--ease),
    transform 140ms var(--ease);
}
.btn:active { transform: scale(.97); }

/* 白天：凸起的软按钮 */
.btn-primary {
  color: var(--accent);
  background: var(--bg);
  box-shadow:
    6px 6px 16px var(--shade),
    -6px -6px 16px var(--light);
}
.btn-primary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 8px var(--accent-bright);
}
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { color: var(--accent-bright); }
}
.btn-primary:active {
  box-shadow:
    inset 4px 4px 10px var(--shade),
    inset -4px -4px 10px var(--light);
}

.btn-ghost {
  color: var(--text-3);
  background: transparent;
  border: 1px solid var(--line);
  cursor: not-allowed;
}

/* 夜晚：整组按钮收进一块玻璃胶囊 */
:root[data-theme="dark"] .actions {
  position: relative;
  padding: 7px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, .09) 0%,
    rgba(255, 255, 255, .025) 52%,
    rgba(255, 255, 255, .06) 100%
  );
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: var(--lg-filter, blur(24px) saturate(180%));
  backdrop-filter: var(--lg-filter, blur(24px) saturate(180%));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    inset 0 -1px 0 rgba(0, 0, 0, .3),
    0 18px 46px rgba(0, 0, 0, .42),
    0 2px 10px rgba(0, 0, 0, .3);
}
:root[data-theme="dark"] .actions .btn {
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--text-2);
}
:root[data-theme="dark"] .actions .btn-primary { color: var(--accent); }
:root[data-theme="dark"] .actions .btn-ghost { color: var(--text-3); }

/* 页脚 */
.foot {
  position: fixed;
  inset: auto 0 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 clamp(20px, 4vw, 54px) clamp(16px, 2.4vh, 26px);
  font-size: 10.5px;
  color: var(--text-3);
  pointer-events: none;
}

/* 提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  z-index: 70;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg);
  box-shadow:
    5px 5px 14px var(--shade),
    -5px -5px 14px var(--light);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition:
    opacity .3s var(--ease),
    transform .3s var(--ease);
}
.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
:root[data-theme="dark"] .toast {
  overflow: hidden;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, .09) 0%,
    rgba(255, 255, 255, .03) 100%
  );
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: var(--lg-filter, blur(22px) saturate(180%));
  backdrop-filter: var(--lg-filter, blur(22px) saturate(180%));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    inset 0 -1px 0 rgba(0, 0, 0, .3),
    0 18px 40px rgba(0, 0, 0, .42);
}

/* 夜间进入星图：星球坍缩成黑洞，周围内容螺旋吸入 */
.bh-veil {
  position: fixed;
  inset: 0;
  z-index: 41;
  pointer-events: none;
  opacity: 0;
  transition: opacity .9s var(--ease);
  background: radial-gradient(
    circle at var(--bhx, 50%) var(--bhy, 50%),
    transparent 0 54px,
    rgba(4, 5, 10, .5) 55%,
    rgba(4, 5, 10, .94) 100%
  );
}
body.bh-active { overflow: hidden; }
body.bh-active .bh-veil { opacity: 1; }

.black-hole {
  --bh-size: clamp(84px, 11vmin, 132px);
  position: fixed;
  left: var(--bhx, 50%);
  top: var(--bhy, 50%);
  width: var(--bh-size);
  height: var(--bh-size);
  margin: calc(var(--bh-size) / -2) 0 0 calc(var(--bh-size) / -2);
  border-radius: 50%;
  background: #000 url("./assets/black-hole.webp") center / 150% no-repeat;
  z-index: 55;
  opacity: 0;
  transform: scale(.1);
  pointer-events: none;
  box-shadow:
    0 0 0 1px rgba(255, 210, 122, .32),
    0 0 34px 8px rgba(255, 210, 122, .16),
    0 0 80px 30px rgba(255, 210, 122, .06);
}
.black-hole.on {
  animation: bh-appear .55s var(--ease) .45s both;
}
.black-hole.vanish {
  animation: bh-vanish .45s var(--ease) forwards;
}
@keyframes bh-appear {
  0% { opacity: 0; transform: scale(.1); }
  65% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes bh-vanish {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.7); }
}

/* Mind Galaxy：全屏三维星图 */
.galaxy {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: block;
  overflow: hidden;
  background: #07080f;
  color: #e8ecf4;
  clip-path: circle(0px at var(--gx, 50%) var(--gy, 50%));
  visibility: hidden;
  pointer-events: none;
  opacity: 1;
  transition: opacity .45s var(--ease);
}
.galaxy.on {
  visibility: visible;
  pointer-events: auto;
  animation: galaxy-open 1.35s var(--ease) forwards;
}
.galaxy.on.no-clip {
  clip-path: none;
  animation: none;
}
.galaxy.closing { opacity: 0; }
@keyframes galaxy-open {
  from { clip-path: circle(0px at var(--gx) var(--gy)); }
  to { clip-path: circle(var(--gr, 150vmax) at var(--gx) var(--gy)); }
}

.galaxy-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

.galaxy-hud {
  position: absolute;
  left: clamp(20px, 4vw, 54px);
  top: clamp(24px, 4vh, 42px);
  pointer-events: none;
}
.galaxy-eyebrow {
  margin: 0 0 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .28em;
  color: rgba(232, 236, 244, .5);
}
.galaxy-user {
  margin: 0;
  font-size: 12px;
  letter-spacing: .08em;
  color: rgba(232, 236, 244, .38);
}
.galaxy-reset {
  margin-top: 16px;
  padding: 7px 10px;
  border: 1px solid rgba(232, 236, 244, .2);
  border-radius: 999px;
  background: rgba(7, 8, 15, .42);
  color: rgba(232, 236, 244, .62);
  font: inherit;
  font-size: 11px;
  letter-spacing: .08em;
  cursor: pointer;
  pointer-events: auto;
  transition: color .2s var(--ease), border-color .2s var(--ease), transform 140ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .galaxy-reset:hover {
    color: #ffd27a;
    border-color: rgba(255, 210, 122, .7);
  }
}
.galaxy-reset:focus-visible {
  color: #ffd27a;
  border-color: rgba(255, 210, 122, .7);
}
.galaxy-reset:active { transform: scale(.96); }
.galaxy-reset:disabled {
  color: rgba(255, 210, 122, .7);
  border-color: rgba(255, 210, 122, .35);
  cursor: default;
}

.galaxy-hint {
  position: absolute;
  right: clamp(20px, 4vw, 54px);
  bottom: clamp(24px, 4vh, 36px);
  margin: 0;
  font-size: 11.5px;
  letter-spacing: .08em;
  color: rgba(232, 236, 244, .42);
  pointer-events: none;
  transition: opacity .6s var(--ease);
}
.galaxy-hint.dim { opacity: .2; }
.hint-mobile { display: none; }

.node-card {
  position: absolute;
  right: clamp(20px, 4vw, 54px);
  top: 50%;
  z-index: 2;
  width: min(330px, calc(100vw - 40px));
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, .10) 0%,
    rgba(255, 255, 255, .035) 100%
  );
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    0 24px 60px rgba(0, 0, 0, .5);
  transform: translateY(-50%);
  animation: node-card-in .24s var(--ease) both;
}
@keyframes node-card-in {
  from { opacity: 0; transform: translateY(calc(-50% + 8px)); }
  to { opacity: 1; transform: translateY(-50%); }
}
.node-card-close {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: rgba(232, 236, 244, .45);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color .2s var(--ease), transform 140ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .node-card-close:hover { color: #ffd27a; }
}
.node-card-close:active { transform: scale(.9); }
.node-card-cluster {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: rgba(255, 210, 122, .7);
}
.node-card-name {
  margin: 9px 0 10px;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: .04em;
  color: #ffd27a;
}
.node-card-text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.85;
  color: rgba(232, 236, 244, .82);
}
.node-card-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: rgba(232, 236, 244, .45);
}
.node-card-collapse {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 210, 122, .45);
  border-radius: 8px;
  background: rgba(255, 210, 122, .07);
  color: #ffd27a;
  font: inherit;
  font-size: 12px;
  letter-spacing: .12em;
  cursor: pointer;
  transition: background .25s var(--ease), border-color .25s var(--ease), transform 140ms var(--ease);
}
.node-card-collapse[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) {
  .node-card-collapse:hover {
    background: rgba(255, 210, 122, .17);
    border-color: #ffd27a;
  }
}
.node-card-collapse:focus-visible {
  background: rgba(255, 210, 122, .17);
  border-color: #ffd27a;
}
.node-card-collapse:active { transform: scale(.98); }
.node-card-rewind {
  border-color: rgba(232, 236, 244, .35);
  background: rgba(232, 236, 244, .06);
  color: #e8ecf4;
}

.galaxy.on .galaxy-hud {
  animation: galaxy-copy-in .8s .55s var(--ease) both;
}
.galaxy.on .galaxy-back {
  animation: galaxy-copy-in .8s .85s var(--ease) both;
}
@keyframes galaxy-copy-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.galaxy-back {
  position: absolute;
  left: clamp(20px, 4vw, 54px);
  bottom: clamp(20px, 4vh, 34px);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(16, 20, 30, .42);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  color: #e8ecf4;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), transform 140ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .galaxy-back:hover { color: #ffd27a; border-color: #ffd27a; }
}
.galaxy-back:active { transform: scale(.96); }
.galaxy-back:focus-visible {
  outline-width: 1px;
  outline-offset: 4px;
}

/* ---------- 承重分析：账单与改写 ---------- */
.analysis {
  display: none;
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 30px clamp(22px, 6vw, 80px) clamp(90px, 14vh, 150px);
  scroll-margin-top: 96px;
}
body[data-view="info"] .analysis { display: block; }
.analysis-block {
  margin-top: clamp(70px, 11vh, 130px);
  scroll-margin-top: 96px;
}
.analysis-block:first-child { margin-top: 0; }

.analysis-head { margin-bottom: clamp(24px, 4vw, 36px); }
.analysis-eyebrow {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  color: var(--text-3);
}
.analysis-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.35;
  letter-spacing: .02em;
  color: var(--text);
  text-wrap: balance;
}

.analysis-card {
  position: relative;
  border-radius: var(--radius-m);
  padding: clamp(22px, 3vw, 34px);
  background: var(--bg);
  box-shadow:
    8px 8px 22px var(--shade),
    -8px -8px 22px var(--light);
}
:root[data-theme="dark"] .analysis-card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, .075) 0%,
    rgba(255, 255, 255, .025) 100%
  );
  border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    0 24px 54px rgba(0, 0, 0, .4);
}
.card-label {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--text-3);
}

.cost-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(18px, 2.4vw, 28px);
}
.cost-rate {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: clamp(56px, 8vw, 88px);
  line-height: .95;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.cost-rate small { margin-left: 4px; font-size: .32em; opacity: .7; }
.cost-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cost-table td {
  padding: 11px 0;
  border-top: 1px solid var(--line);
  color: var(--text-2);
}
.cost-table td + td {
  text-align: right;
  color: var(--text);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.cost-note {
  margin: 16px 0 0;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--text-3);
}
.cost-quote {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
}
.cost-why {
  margin: 0 0 18px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--text-2);
}
.cost-verdict {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.7;
  color: var(--danger);
}

.impact-card { margin-top: clamp(18px, 2.4vw, 28px); }
.impact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.impact-list li {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-3);
}
.impact-list li.direct { border-left-color: var(--accent); }
.impact-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}
.impact-name {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--text);
}
.impact-list li.direct .impact-name { color: var(--accent); }
.impact-weight {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.impact-tag {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  color: var(--text-3);
}
.impact-list li.direct .impact-tag { color: var(--accent); }
.impact-list p { margin: 0; }

.analysis-pull {
  max-width: 22ch;
  margin: clamp(44px, 6vw, 72px) auto 0;
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.55;
  color: var(--text);
}

.rewrite-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 28px);
}
.rewrite-side { display: flex; flex-direction: column; }
.rewrite-rate {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(44px, 5.5vw, 64px);
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.rewrite-rate.danger { color: var(--danger); }
.rewrite-rate small { margin-left: 3px; font-size: .34em; opacity: .7; }
.rewrite-text {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.9;
  color: var(--text);
}
.rewrite-note {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-3);
}
.rewrite-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg);
  box-shadow:
    inset 3px 3px 7px var(--shade),
    inset -3px -3px 7px var(--light);
}
:root[data-theme="dark"] .rewrite-tabs {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: none;
}
.rewrite-tab {
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color .3s var(--ease), background .3s var(--ease);
}
.rewrite-tab.is-on { color: var(--bg); background: var(--text); }
:root[data-theme="dark"] .rewrite-tab.is-on {
  color: #14161d;
  background: var(--accent);
}
.rewrite-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: auto;
}
.analysis-btn {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition:
    color .18s var(--ease),
    border-color .18s var(--ease),
    background .18s var(--ease),
    transform 140ms var(--ease);
}
.rewrite-side > .analysis-btn {
  align-self: flex-start;
  margin-top: auto;
}
@media (hover: hover) and (pointer: fine) {
  .analysis-btn:hover { color: var(--accent); border-color: var(--accent); }
}
.analysis-btn:active:not(:disabled) { transform: scale(.97); }
.analysis-btn.primary {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg);
  box-shadow:
    4px 4px 12px var(--shade),
    -4px -4px 12px var(--light);
}
:root[data-theme="dark"] .analysis-btn.primary {
  background: rgba(255, 210, 122, .08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    0 10px 26px rgba(0, 0, 0, .35);
}
.copy-feedback { font-size: 11.5px; color: var(--text-3); }
.analysis-caption {
  margin: 22px 0 0;
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--text-3);
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 1s var(--ease),
    transform 1s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .cover {
    min-height: auto;
    padding: 96px 22px 84px;
    gap: 22px;
  }
  body[data-view="info"] .cover {
    min-height: 100svh;
    padding-top: 76px;
    padding-bottom: 56px;
  }
  .planet-wrap { --planet-size: clamp(190px, 56vmin, 290px); }
  .orbit {
    width: calc(var(--planet-size) * 1.34);
    height: calc(var(--planet-size) * .42);
  }
  .intro { max-width: 380px; }
  .intro h1 { font-size: clamp(27px, 8.4vw, 34px); }
  .lede { max-width: 34ch; font-size: 13.5px; }
  .actions {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }
  .actions .btn { width: 100%; }
  .foot { display: none; }
  .toast {
    bottom: 24px;
    width: calc(100% - 40px);
    text-align: center;
  }
  .hint-desktop { display: none; }
  .hint-mobile { display: inline; }
  .galaxy-hud { left: 20px; top: 20px; }
  .galaxy-hint { right: 20px; bottom: 30px; font-size: 11px; }
  .galaxy-back { left: 20px; bottom: 20px; }
  .node-card {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 78px;
    width: auto;
    transform: none;
    animation: node-card-mobile .55s var(--ease) both;
  }
  @keyframes node-card-mobile {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
  .analysis { padding: 24px 22px 96px; }
  .analysis-block { margin-top: 84px; }
  .cost-grid, .rewrite-grid { grid-template-columns: 1fr; }
  .impact-list { grid-template-columns: 1fr; }
  .analysis-head h2 { font-size: clamp(24px, 7.4vw, 32px); }
  .cost-rate { font-size: clamp(54px, 17vw, 76px); }
  .rewrite-rate { font-size: clamp(42px, 13vw, 56px); }
  .analysis-pull { max-width: 17ch; font-size: clamp(22px, 6.4vw, 30px); }
  .scroll-cue { bottom: 14px; }
}

/* ---------- 实时 `/v1` 合成演示工作台 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.workbench-block[hidden] { display: none; }

.workbench-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 18px;
}

.session-pill-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* 确保原生 hidden 属性不被组件 display 规则覆盖 */
[hidden] { display: none !important; }

.mode-badge,
.meta-pill,
.status-badge,
.stage-badge,
.adopted-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .04em;
  border: 1px solid var(--line);
  color: var(--text-2);
  background: transparent;
}
.adopted-pill[hidden],
.meta-pill[hidden],
.status-badge[hidden],
.stage-badge[hidden],
.mode-badge[hidden] {
  display: none;
}

.mode-badge {
  color: var(--accent);
  border-color: var(--accent);
}

.adopted-pill {
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 500;
}

.status-badge[data-status="running"] {
  color: var(--accent);
  border-color: var(--accent);
}
.status-badge[data-status="pending"] {
  color: var(--accent);
  border-color: var(--accent);
}
.status-badge[data-status="committed"] {
  color: #2f7d57;
  border-color: rgba(47, 125, 87, .45);
}
:root[data-theme="dark"] .status-badge[data-status="committed"] {
  color: #7ee0b0;
  border-color: rgba(126, 224, 176, .4);
}
.status-badge[data-status="cancelled"] {
  color: var(--text-3);
  border-color: var(--line);
}
.status-badge[data-status="failed"] {
  color: var(--danger);
  border-color: var(--danger);
}

.workbench-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.materials-hint {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
}

.workbench-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alert-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--bg);
}
.alert-banner[hidden] { display: none; }
.alert-warn { border-color: var(--accent); }
.alert-error { border-color: var(--danger); }
.alert-title {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}
.alert-error .alert-title { color: var(--danger); }
.alert-warn .alert-title { color: var(--accent); }
.alert-text {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
}
.alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(16px, 2.2vw, 24px);
}

.workbench-lower-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.2vw, 24px);
  margin-top: clamp(16px, 2.2vw, 24px);
}

.composer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.composer-top .card-label { margin-bottom: 0; }

.bound-focus-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  font-size: 11.5px;
  color: var(--accent);
}
.bound-focus-chip[hidden] { display: none; }

.chip-clear {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), transform 140ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .chip-clear:hover { color: var(--accent); border-color: var(--accent); }
}
.chip-clear:active { transform: scale(.94); }

.turn-input {
  width: 100%;
  min-height: 92px;
  padding: 13px 15px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  box-shadow:
    inset 3px 3px 8px var(--shade),
    inset -3px -3px 8px var(--light);
}
:root[data-theme="dark"] .turn-input {
  background: rgba(255, 255, 255, .04);
  box-shadow: none;
}

.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.analysis-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.danger-btn {
  color: var(--danger);
  border-color: rgba(180, 69, 47, .45);
}
@media (hover: hover) and (pointer: fine) {
  .danger-btn:hover:not(:disabled) {
    color: var(--danger);
    border-color: var(--danger);
  }
}

.focus-panel {
  padding: 12px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}
.focus-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
}
.focus-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.focus-span {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--accent);
}
.focus-kind {
  font-size: 10.5px;
  color: var(--text-3);
}
.focus-reason {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}

.sub-label {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--text-3);
}

.stream-explanation {
  min-height: 82px;
  max-height: 220px;
  overflow-y: auto;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  border: 1px dashed var(--line);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.stream-meta {
  margin: 10px 0 0;
  font-size: 10.5px;
  color: var(--text-3);
}

.empty-state {
  padding: 14px 16px;
  border-radius: var(--radius-s);
  border: 1px dashed var(--line);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.empty-state[hidden] { display: none; }
.bill-empty { margin-bottom: 18px; }
.empty-inline {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-3);
}

.node-index-list,
.facts-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}
.node-index-list[hidden] { display: none; }

.node-index-item {
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  overflow: hidden;
}
.node-index-item.is-bound,
.node-index-item.is-selected {
  border-color: var(--accent);
}
.node-index-btn {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.node-index-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.node-index-id { font-size: 11px; color: var(--accent); }
.node-index-load { font-size: 10.5px; color: var(--text-3); }
.node-index-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
}

.inline-node-card {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--accent);
}
.inline-node-card[hidden] { display: none; }
.inline-node-id { font-size: 11px; color: var(--accent); }
.inline-node-text {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}
.inline-node-meta,
.inline-node-evidence {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.6;
}

.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
}

.evidence-card {
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  padding: 10px 12px;
}
.evidence-card.is-pending { border-color: var(--accent); }
.evidence-card.is-denied { opacity: .68; }

.evidence-card-trigger {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.evidence-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}
.ev-tag,
.ev-attr {
  font-size: 10.5px;
  color: var(--text-3);
}
.ev-attr.is-self { color: var(--accent); }
.evidence-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
}
.evidence-snippet {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-2);
}
.evidence-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.evidence-detail-line {
  margin: 0 0 6px;
  font-size: 10.5px;
  color: var(--text-3);
  word-break: break-all;
}
.evidence-detail-excerpt {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
}
.evidence-link {
  display: inline-block;
  font-size: 10.5px;
  color: var(--accent);
  word-break: break-all;
}
.evidence-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.inline-mini-btn {
  margin-top: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), transform 140ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .inline-mini-btn:hover:not(:disabled) {
    color: var(--accent);
    border-color: var(--accent);
  }
}
.inline-mini-btn:active:not(:disabled) { transform: scale(.96); }
.inline-mini-btn.danger-outline {
  color: var(--danger);
  border-color: rgba(180, 69, 47, .45);
}
.inline-mini-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.fact-item {
  padding: 10px 12px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
}
.fact-item.is-retracted { opacity: .62; }
.fact-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.fact-id { font-size: 11px; color: var(--accent); }
.fact-status { font-size: 10.5px; color: var(--text-3); }
.fact-status.is-active { color: #2f7d57; }
:root[data-theme="dark"] .fact-status.is-active { color: #7ee0b0; }
.fact-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text);
}
.fact-nodes {
  margin: 5px 0 0;
  font-size: 10.5px;
  color: var(--text-3);
}

.cost-citation {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-3);
  word-break: break-word;
}
.impact-empty {
  grid-column: 1 / -1;
  border-left: 0 !important;
  padding-left: 0 !important;
  color: var(--text-3);
}

.adopted-banner {
  margin-bottom: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-s);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  line-height: 1.6;
}
.adopted-banner[hidden] { display: none; }

.rewrite-meta {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--text-3);
}

.rewrite-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rewrite-cards[hidden] { display: none; }

.rewrite-empty {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-3);
}

.rewrite-item {
  padding: 14px 16px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
}
.rewrite-item.is-adopted {
  border-color: var(--accent);
}
.rewrite-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.rewrite-item-head-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.rewrite-role-tag {
  font-size: 11.5px;
  color: var(--text-2);
}
.rewrite-ver-tag {
  font-size: 11px;
  color: var(--text-3);
}
.rewrite-item-rate {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1.1;
  color: var(--accent);
}
.rewrite-item-rate.danger { color: var(--danger); }
.rewrite-item-assess {
  display: block;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: var(--text-3);
}
.rewrite-item-text {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}
.rewrite-item-reason {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-2);
}
.rewrite-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 星图内空态与节点 ID / 绑定焦点按钮 */
.galaxy-empty-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: min(380px, calc(100vw - 44px));
  padding: 24px 26px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(12, 16, 26, .76);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  text-align: center;
}
.galaxy-empty-overlay[hidden] { display: none; }
.galaxy-empty-title {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 20px;
  color: #ffd27a;
}
.galaxy-empty-desc {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.75;
  color: rgba(232, 236, 244, .78);
}

.node-card-id {
  margin: 6px 0 0;
  font-size: 11px;
  color: rgba(232, 236, 244, .65);
}
.node-card-evidence {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: rgba(232, 236, 244, .72);
}

@media (max-width: 960px) {
  .workbench-grid,
  .workbench-lower-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .composer-actions .analysis-btn {
    flex: 1 1 auto;
    text-align: center;
  }
  .workbench-head-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .alert-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .alert-actions {
    width: 100%;
  }
  .alert-actions .analysis-btn {
    flex: 1 1 auto;
    min-height: 40px;
    text-align: center;
  }
}


/* ---------- 公开模式：温柔人性化首屏输入、对话流与双向依据星图 ---------- */

/* 公开模式封面：保留星球气质，让自由输入与起手示例在首屏从容落位 */
body[data-host-mode="public"][data-view="cover"] .cover {
  gap: clamp(14px, 2vh, 22px);
  padding: clamp(82px, 9vh, 108px) clamp(20px, 5vw, 64px) clamp(44px, 6vh, 72px);
}
body[data-host-mode="public"][data-view="cover"] .planet-wrap {
  --planet-size: clamp(124px, min(22vmin, 20vh), 210px);
}
body[data-host-mode="public"][data-view="cover"] .stage-label {
  display: none;
}

/* 公开模式对话态：顶部紧凑留白，直接聚焦对话、出处、改写与星图 */
body[data-host-mode="public"][data-view="info"] .cover {
  min-height: auto;
  padding: clamp(86px, 10vh, 108px) clamp(20px, 5vw, 64px) 18px;
  gap: 14px;
}
body[data-host-mode="public"][data-view="info"] .planet-wrap {
  --planet-size: clamp(82px, 11vmin, 118px);
}
body[data-host-mode="public"][data-view="info"] .galaxy-label {
  margin-bottom: 10px;
}
body[data-host-mode="public"][data-view="info"] .scroll-cue {
  display: none;
}
body[data-host-mode="public"][data-view="info"] .analysis {
  padding-top: 12px;
}

.public-intro {
  max-width: 680px;
}

.public-home-composer {
  width: 100%;
  margin-top: 8px;
  padding: clamp(16px, 2.4vw, 22px);
  border-radius: var(--radius-m);
  background: var(--bg);
  box-shadow:
    8px 8px 22px var(--shade),
    -8px -8px 22px var(--light);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
:root[data-theme="dark"] .public-home-composer {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, .085) 0%,
    rgba(255, 255, 255, .028) 100%
  );
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(22px) saturate(175%);
  backdrop-filter: blur(22px) saturate(175%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    0 24px 56px rgba(0, 0, 0, .44);
}

.public-home-input,
.public-rewrite-editor,
.public-followup-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  resize: vertical;
  box-shadow:
    inset 3px 3px 8px var(--shade),
    inset -3px -3px 8px var(--light);
  transition: border-color .25s var(--ease);
}
.public-home-input:focus,
.public-rewrite-editor:focus,
.public-followup-input:focus {
  outline: none;
  border-color: var(--accent);
}
:root[data-theme="dark"] .public-home-input,
:root[data-theme="dark"] .public-rewrite-editor,
:root[data-theme="dark"] .public-followup-input {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(255, 255, 255, .14);
  box-shadow: none;
}

.public-home-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.starter-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 320px;
}

.starter-chip,
.quick-ask-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease), transform 140ms var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .starter-chip:hover,
  .quick-ask-chip:hover {
    color: var(--accent);
    border-color: var(--accent);
  }
  :root[data-theme="dark"] .starter-chip:hover,
  :root[data-theme="dark"] .quick-ask-chip:hover {
    background: rgba(255, 210, 122, .08);
  }
}
.starter-chip:active,
.quick-ask-chip:active { transform: scale(.97); }

.public-submit-btn {
  flex-shrink: 0;
  padding: 12px 26px;
}

/* 公开模式温和降级条 */
.public-degrade-dock {
  width: min(1120px, 100%);
  margin: 0 auto 14px;
  padding: 0 clamp(22px, 6vw, 80px);
}
body[data-view="cover"] .public-degrade-dock {
  width: min(720px, 100%);
  margin-top: -28px;
  margin-bottom: 36px;
}
.public-degrade-saved {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text);
  opacity: .85;
}
.public-switch-demo-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.65;
}

/* 共用顶部状态条：demo 模式突出清晰，public 模式沉静收起在底部 */
.shared-banners {
  margin-bottom: 14px;
}
.shared-status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0 22px;
}
body[data-host-mode="public"] .shared-status-strip {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
  opacity: .72;
}
body[data-host-mode="public"] .shared-status-strip .meta-pill {
  font-size: 10.5px;
  padding: 3px 9px;
  border-color: transparent;
  color: var(--text-3);
}

/* 公开对话双栏布局 */
.public-workspace-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 20px;
  margin-bottom: 22px;
}
.public-workspace-title-group h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.35;
  color: var(--text);
}
.public-workspace-sub {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-3);
}
.public-workspace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.public-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr);
  gap: clamp(18px, 2.5vw, 28px);
  align-items: start;
}

.public-dialogue-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.public-dialogue-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.public-empty-feed {
  padding: 20px 22px;
  border-radius: var(--radius-m);
  border: 1px dashed var(--line);
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-3);
}

.public-turn-card {
  position: relative;
  border-radius: var(--radius-m);
  padding: clamp(18px, 2.6vw, 26px);
  background: var(--bg);
  box-shadow:
    8px 8px 22px var(--shade),
    -8px -8px 22px var(--light);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
:root[data-theme="dark"] .public-turn-card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, .075) 0%,
    rgba(255, 255, 255, .024) 100%
  );
  border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 20px 48px rgba(0, 0, 0, .38);
}

.public-user-quote {
  margin: 0;
  padding: 10px 14px;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  background: rgba(180, 140, 72, .06);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}
:root[data-theme="dark"] .public-user-quote {
  background: rgba(255, 210, 122, .07);
}

.public-focus-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.public-focus-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  line-height: 1.4;
}

.public-stage-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.public-stage-hint::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
  animation: hint-pulse 1.8s ease-in-out infinite;
}

.public-reply-text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 核验出处：默认紧凑收起，点击「看看出处」展开 */
.public-citations-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.public-citations-label {
  margin: 0 0 2px;
  font-size: 11.5px;
  color: var(--text-3);
}

.public-citation-item {
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  padding: 10px 13px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.public-citation-item[data-highlighted="true"],
.public-citation-item.is-highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(210, 165, 86, .22);
}

.public-citation-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.public-citation-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 220px;
}
.public-citation-author {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}
.public-citation-short-title {
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 32ch;
}
.public-citation-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.public-rel-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.4;
  border: 1px solid var(--line);
  color: var(--text-2);
}
.public-rel-badge.is-supports {
  color: #2c7a57;
  border-color: rgba(44, 122, 87, .42);
  background: rgba(44, 122, 87, .07);
}
.public-rel-badge.is-refutes {
  color: #b4452f;
  border-color: rgba(180, 69, 47, .45);
  background: rgba(180, 69, 47, .07);
}
.public-rel-badge.is-qualifies {
  color: #35679b;
  border-color: rgba(53, 103, 155, .42);
  background: rgba(53, 103, 155, .07);
}
.public-rel-badge.is-unknown {
  color: var(--text-3);
  border-color: var(--line);
}
:root[data-theme="dark"] .public-rel-badge.is-supports {
  color: #82e0b4;
  border-color: rgba(130, 224, 180, .38);
  background: rgba(130, 224, 180, .09);
}
:root[data-theme="dark"] .public-rel-badge.is-refutes {
  color: #ff9c8a;
  border-color: rgba(255, 156, 138, .42);
  background: rgba(255, 156, 138, .09);
}
:root[data-theme="dark"] .public-rel-badge.is-qualifies {
  color: #96c4ff;
  border-color: rgba(150, 196, 255, .4);
  background: rgba(150, 196, 255, .09);
}

.citation-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.citation-detail-title {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.55;
}
.citation-detail-author {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-3);
}
.citation-detail-quote {
  margin: 2px 0;
  padding: 8px 12px;
  border-left: 2px solid var(--line);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-2);
}
.citation-detail-reason {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-3);
}

/* 关系变化 & 材料边界 */
.public-section-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--accent);
}
.public-change-summary {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--text);
}
.public-relation-changes {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.public-change-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 9px 12px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  font-size: 12.5px;
}
.public-change-row.is-changed {
  border-color: var(--accent);
}
.public-change-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-2);
}

.public-unknown-box {
  padding: 16px 18px;
  border-radius: var(--radius-s);
  border: 1px dashed var(--line);
  background: transparent;
}
.public-unknown-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.public-unknown-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-3);
}
.public-unknown-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}

/* 可编辑改写卡片 */
.public-rewrite-hint {
  font-size: 11.5px;
  color: var(--text-3);
}
.public-rewrite-explain {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-2);
}
.public-rewrite-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.public-rewrite-note-pill {
  padding: 5px 11px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}
.public-rewrite-actions,
.public-followup-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.public-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

/* 右侧互动依据星图面板 */
.public-graph-panel {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.public-graph-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3);
}

.public-graph-stage {
  position: relative;
  border-radius: var(--radius-s);
  background: radial-gradient(circle at 50% 45%, #121728 0%, #090b14 70%, #06070d 100%);
  border: 1px solid rgba(255, 255, 255, .1);
  min-height: 230px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.public-graph-svg {
  width: 100%;
  height: 250px;
  display: block;
}
.public-graph-empty {
  position: absolute;
  margin: 0;
  padding: 0 22px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.75;
  color: rgba(232, 236, 244, .58);
}

.public-graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 11px;
  color: var(--text-3);
}
.legend-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.legend-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.legend-dot.is-claim::before { background: #ffd27a; }
.legend-dot.is-supports::before { background: #74d9a8; }
.legend-dot.is-refutes::before { background: #ff8e7a; }
.legend-dot.is-qualifies::before { background: #8bbcff; }
.legend-dot.is-unknown::before { background: #aeb8cc; }

.public-graph-nodes {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}
.public-graph-node-item {
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.public-graph-node-item[data-highlighted="true"] {
  border-color: var(--accent);
  background: rgba(210, 165, 86, .08);
}
.public-graph-node-btn {
  width: 100%;
  padding: 9px 11px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.public-graph-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.public-graph-node-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}
.public-graph-node-snippet {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-3);
}

.public-graph-detail {
  padding: 12px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--accent);
}
.public-graph-detail-author {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--text-2);
}
.public-graph-detail-text {
  margin: 0 0 8px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
}

/* 等待与流式输出的动态星轨呼吸态与打字光标 */
.public-live-orbit {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 12px;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: linear-gradient(90deg, transparent, rgba(255, 210, 122, 0.08), transparent);
  background-size: 220% 100%;
  animation: publicOrbitShimmer 2.8s ease-in-out infinite;
}
.public-live-orb {
  position: relative;
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
/* 扩散的光环用 transform/opacity 做，避免每帧重绘 box-shadow */
.public-live-orb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(212, 160, 72, .55);
  opacity: .75;
  transform: scale(1);
  animation: publicOrbPulse 1.8s ease-out infinite;
}
.public-live-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}
.public-live-step {
  font-size: 12px;
  color: var(--text-3);
  transition: color .25s ease, opacity .25s ease;
}
.public-live-step.is-done {
  color: var(--text-2);
  opacity: .75;
}
.public-live-step.is-active {
  color: var(--accent);
  font-weight: 500;
}
.public-reply-text.is-waiting {
  color: var(--text-2);
}
.public-reply-text.is-streaming::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.15em;
  background: var(--accent);
  border-radius: 2px;
  animation: publicCaretBlink 0.9s steps(2, start) infinite;
}
@keyframes publicOrbPulse {
  0% { transform: scale(1); opacity: .7; }
  70% { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}
@keyframes publicOrbitShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@keyframes publicCaretBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .public-live-orbit,
  .public-live-orb::after,
  .public-reply-text.is-streaming::after,
  .info .hint::before,
  .public-stage-hint::before,
  body[data-view="info"] .planet-wrap::after,
  .scroll-cue-line::after,
  .galaxy.on .galaxy-hud,
  .galaxy.on .galaxy-back {
    animation: none;
  }
  .node-card {
    animation-duration: .01ms;
  }
  .planet,
  .btn,
  .analysis-btn {
    transition-duration: .01ms;
  }
}

@media (max-width: 960px) {
  .public-workspace-grid {
    grid-template-columns: 1fr;
  }
  .public-graph-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  body[data-host-mode="public"][data-view="cover"] .cover {
    padding: 84px 18px 44px;
  }
  body[data-host-mode="public"][data-view="cover"] .planet-wrap {
    --planet-size: clamp(104px, 30vmin, 148px);
  }
  .public-home-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .public-submit-btn {
    width: 100%;
  }
  .public-degrade-dock {
    padding: 0 18px;
  }
  .public-citation-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .public-citation-summary {
    flex: 0 1 auto;
    width: 100%;
  }
  .public-citation-short-title {
    max-width: 100%;
    white-space: normal;
  }
  .public-followup-actions .analysis-btn,
  .public-rewrite-actions .analysis-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* P1：移动端最小可点尺寸 */
@media (max-width: 760px) {
  .analysis-btn,
  .inline-mini-btn,
  .starter-chip,
  .quick-ask-chip,
  .node-card-collapse,
  .galaxy-back,
  .back-btn {
    min-height: 44px;
  }
  .chip-clear,
  .node-card-close {
    min-width: 40px;
    min-height: 40px;
  }
}

/* ---------- 星史：星图下方的科幻叙事 ---------- */
.galaxy-hud { z-index: 6; }
.galaxy-back { z-index: 6; }
.story-catcher {
  position: absolute; inset: 0; z-index: 3; cursor: pointer;
}
.story-catcher[hidden] { display: none; }
.story-fx {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 4;
}
.story-dock {
  position: absolute; left: 50%; bottom: clamp(88px, 12vh, 122px);
  transform: translateX(-50%); width: min(780px, 84vw); z-index: 5;
  padding: 18px 24px 14px; border: 1px solid #ffd27a2e;
  background: linear-gradient(180deg, #07080ff4, #07080fe8);
  backdrop-filter: blur(10px); box-shadow: 0 24px 70px #000a;
  color: #ffe6b8; font-family: var(--font-sans);
}
.story-dock[hidden] { display: none; }
.story-meta {
  display: flex; align-items: center; justify-content: space-between;
  font: 10px/1 "IBM Plex Mono", Consolas, monospace; letter-spacing: .18em; color: #8e8a82;
}
.story-close {
  border: 0; background: transparent; color: #8e8a82; font-size: 18px;
  line-height: 1; cursor: pointer; padding: 0 4px;
}
.story-close:hover { color: #ffd27a; }
.story-text {
  margin: 12px 0 10px; min-height: 68px;
  font-size: 17px; line-height: 1.95; letter-spacing: .02em;
  text-shadow: 0 0 24px #ffd27a12;
}
.story-text .ghost { color: #ffd27a66; }
.story-foot {
  display: flex; align-items: center; justify-content: space-between;
  color: #6d6a63; font-size: 11.5px;
}
.story-mark { color: #ffd27a; animation: story-mark 2.4s ease-in-out infinite; }
@keyframes story-mark {
  0%, 100% { opacity: .3; }
  50% { opacity: 1; }
}
body.story-on .galaxy-hint { opacity: 0; }

/* 星史：电影字幕式呈现（覆盖基础样式） */
.story-bar {
  position: absolute; left: 0; right: 0; height: 0; z-index: 5;
  background: #000; pointer-events: none;
  transition: height .85s cubic-bezier(.22, 1, .36, 1);
}
.story-bar.top { top: 0; }
.story-bar.bottom { bottom: 0; }
body.story-on .story-bar { height: clamp(46px, 8vh, 86px); }
body.story-on .galaxy-hud,
body.story-on .galaxy-back,
body.story-on .galaxy-hint {
  animation: none !important;
  opacity: 0 !important; pointer-events: none; transition: opacity .5s ease;
}
body.story-on .node-card {
  z-index: 7;
}
.story-dock {
  width: min(840px, 88vw);
  z-index: 6;
  cursor: pointer;
  bottom: calc(clamp(46px, 8vh, 86px) + 38px);
  padding: 0; border: 0; background: none; box-shadow: none;
  backdrop-filter: none; text-align: center;
}
.story-meta { color: #7d776d; }
.story-progress { height: 1px; margin: 10px 0 18px; background: #ffffff14; overflow: hidden; }
.story-progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #ffd27a, #d64a32);
  transition: width .7s cubic-bezier(.22, 1, .36, 1);
}
.story-text {
  min-height: 122px; margin: 0;
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 2.05; letter-spacing: .04em;
  text-shadow: 0 2px 30px #000c, 0 0 26px #ffd27a10;
}
.story-line { display: block; animation: story-rise .95s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes story-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.story-foot { justify-content: center; gap: 18px; }
.story-fx .story-beacon {
  pointer-events: all;
  cursor: pointer;
}
.story-fx .story-beacon-core {
  transition: stroke-width .16s ease, opacity .16s ease;
}
.story-fx .story-beacon:hover .story-beacon-core {
  stroke-width: 1.8;
  opacity: 1;
}
.story-fx .story-ring {
  transform-box: fill-box; transform-origin: center;
  animation: story-ring 2.6s ease-in-out infinite;
}
@keyframes story-ring {
  0%, 100% { opacity: .85; transform: scale(1); }
  50% { opacity: .3; transform: scale(1.3); }
}
.story-fx .story-burst {
  pointer-events: none;
}
.story-fx .story-burst-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: story-burst-expand .38s cubic-bezier(.16, 1, .3, 1) forwards;
}
.story-fx .story-burst-echo {
  transform-box: fill-box;
  transform-origin: center;
  animation: story-burst-echo .32s cubic-bezier(.16, 1, .3, 1) forwards;
}
.story-fx .story-burst-core {
  transform-box: fill-box;
  transform-origin: center;
  animation: story-burst-core .26s ease-out forwards;
}
@keyframes story-burst-expand {
  0%   { opacity: .95; transform: scale(1); stroke-width: 1.8; }
  65%  { opacity: .45; transform: scale(2.25); stroke-width: 1.1; }
  100% { opacity: 0;   transform: scale(2.75); stroke-width: .4; }
}
@keyframes story-burst-echo {
  0%   { opacity: .62; transform: scale(1); }
  100% { opacity: 0;   transform: scale(2.15); }
}
@keyframes story-burst-core {
  0%   { opacity: .55; transform: scale(.75); }
  100% { opacity: 0;   transform: scale(1.75); }
}
.story-fx .story-trail {
  stroke-dasharray: 5 9;
  animation: story-trail 1.2s linear infinite;
}
@keyframes story-trail { to { stroke-dashoffset: -28; } }
.story-tools { display: inline-flex; gap: 6px; align-items: center; }
.story-pause {
  border: 0; background: transparent; color: #8e8a82; font-size: 14px;
  line-height: 1; cursor: pointer; padding: 0 4px;
}
.story-pause:hover { color: #ffd27a; }
.story-catcher { cursor: pointer; }
/* 星图整体压暗，减轻恒星眩光 */
#galaxyCanvas { filter: none; }
#deepSky { filter: none; }
/* 星史：角色与幕名 */
.story-stage { display: flex; align-items: baseline; justify-content: center; gap: 16px; min-height: 26px; margin: 2px 0 8px; }
.story-act { font: 16px/1.3 var(--font-sans); letter-spacing: .16em; color: #d8cbb2; }
.story-speaker { font-size: 17px; letter-spacing: .12em; color: #ffd27a; }
.story-act:empty, .story-speaker:empty { display: none; }
/* 全局恒星压暗 */
#galaxyCanvas { filter: none; }
#deepSky { filter: none; }
/* 星史：播放前情境卡 */
.story-prelude {
  position: absolute; inset: 0; z-index: 8;
  display: grid; align-content: center; justify-items: center; gap: 10px;
  text-align: center; pointer-events: auto; cursor: pointer;
  background: radial-gradient(62% 62% at 50% 50%, #07080fcc, #07080ff2 78%);
  opacity: 0; transition: opacity .9s ease;
}
.story-prelude.on { opacity: 1; }
.story-prelude[hidden] { display: none; }
.story-prelude-kicker {
  font: 11px/1 "IBM Plex Mono", Consolas, monospace;
  letter-spacing: .38em; color: #8e8a82; text-transform: uppercase;
}
.story-prelude h2 {
  margin: 4px 0 2px; font-family: var(--font-sans);
  font-size: clamp(30px, 3.8vw, 48px); font-weight: 400;
  letter-spacing: .16em; color: #ffe6b8;
  text-shadow: 0 0 40px #ffd27a22;
}
.story-prelude p {
  margin: 0; font-size: 13px; letter-spacing: .18em; color: #9a9388;
}
.story-prelude-lines {
  max-width: min(720px, 78vw); margin: 18px auto 0;
  color: #a9a090; font-size: 14px; line-height: 2.05; letter-spacing: .04em;
}
.story-prelude-lines p { margin: 0 0 8px; }
.story-prelude-lines .name { color: #ffd27a; margin-right: 8px; }

/* 登录门 */
.auth-gate {
  position: fixed; inset: 0; z-index: 220; display: grid; place-items: center;
  padding: 24px; overflow: auto; background: #05060b;
  color: #e8ecf4;
}
.auth-gate[hidden] { display: none; }
.auth-panel {
  width: min(440px, 92vw); padding: 30px 30px 24px;
  border: 1px solid #ffffff1a; background: #090b12;
  box-shadow: 0 30px 90px #000c;
}
.auth-kicker { margin: 0 0 10px; font: 10px/1 "IBM Plex Mono", monospace; letter-spacing: .28em; color: #8e8a82; }
.auth-title { margin: 0 0 8px; font-family: var(--font-sans); font-size: 26px; font-weight: 400; letter-spacing: .06em; color: #ffe6b8; }
.auth-sub { margin: 0 0 20px; font-size: 12.5px; line-height: 1.8; color: #8e8a82; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tab {
  flex: 1; padding: 9px 10px; border: 1px solid #ffffff1f; background: transparent;
  color: #a9a090; font: inherit; font-size: 13px; cursor: pointer;
}
.auth-tab.on { border-color: #ffd27a66; background: #ffd27a14; color: #ffd27a; }
.auth-pane { display: grid; gap: 10px; }
.auth-pane[hidden] { display: none; }
.auth-qr-box {
  min-height: 220px; display: grid; place-items: center; padding: 12px;
  border: 1px dashed #ffffff1f; color: #7d776d; font-size: 12px; text-align: center;
}
.auth-qr-box img { width: 200px; height: 200px; object-fit: contain; display: block; }
.auth-primary {
  width: 100%; padding: 11px 14px; border: 1px solid #ffd27a55;
  background: #ffd27a12; color: #ffd27a; font: inherit; font-size: 13px;
  letter-spacing: .08em; cursor: pointer;
}
.auth-primary:disabled { opacity: .45; cursor: wait; }
.auth-pane label { display: grid; gap: 6px; font-size: 12px; color: #8e8a82; }
.auth-pane input {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid #ffffff1f; background: #06070c; color: #e8ecf4;
  font: inherit; font-size: 14px; outline: none;
}
.auth-pane input:focus { border-color: #ffd27a66; }
.auth-status { min-height: 20px; margin: 16px 0 0; font-size: 12px; line-height: 1.7; color: #9a9388; }
.auth-status.error { color: #ff8f8f; }
.auth-status.ok { color: #8ee9c4; }
body.auth-locked { overflow: hidden; }

.auth-temp {
  width: 100%; margin: 0 0 14px; padding: 9px 12px;
  border: 1px dashed #ffffff2a; background: transparent;
  color: #b9b0a0; font: inherit; font-size: 12px; letter-spacing: .06em;
  cursor: pointer;
}
.auth-temp:hover { border-color: #ffd27a55; color: #ffd27a; }
.auth-temp:disabled { opacity: .45; cursor: wait; }

/* 登录门：液态玻璃 */
.auth-gate {
  background:
    radial-gradient(70% 70% at 20% 10%, #16233a 0%, transparent 60%),
    radial-gradient(60% 60% at 85% 90%, #2a1a18 0%, transparent 62%),
    #03040a;
  isolation: isolate;
}
.auth-gate::before,
.auth-gate::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  width: 68vmax; height: 68vmax; border-radius: 50%;
  filter: blur(90px); opacity: .42;
  animation: auth-drift 22s ease-in-out infinite alternate;
}
.auth-gate::before {
  top: -32%; left: -24%;
  background: radial-gradient(circle, #3f6fa8 0%, #1c2f4a 38%, transparent 68%);
}
.auth-gate::after {
  right: -26%; bottom: -34%;
  background: radial-gradient(circle, #8a5a3a 0%, #3a211b 40%, transparent 68%);
  animation-delay: -9s;
  opacity: .32;
}
@keyframes auth-drift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); }
  50% { transform: translate3d(3%, 2%, 0) scale(1.08); }
  100% { transform: translate3d(-1%, 3%, 0) scale(.96); }
}
.auth-panel {
  position: relative; width: min(460px, 92vw); padding: 34px 32px 26px;
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.16), rgba(8,10,18,.66) 42%, rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.22);
  box-shadow:
    0 44px 130px rgba(0,0,0,.72),
    inset 0 1px 0 rgba(255,255,255,.42),
    inset 0 -1px 0 rgba(255,255,255,.06),
    0 0 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(28px) saturate(165%);
  -webkit-backdrop-filter: blur(28px) saturate(165%);
  overflow: hidden;
}
.auth-panel::before { display: none; }
.auth-panel::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 60px rgba(255,255,255,.05);
}
.auth-panel > * { position: relative; z-index: 1; }
@keyframes auth-sheen {
  to { transform: rotate(360deg); }
}
.auth-title {
  font-size: 30px; letter-spacing: .08em;
  text-shadow: 0 0 40px rgba(255,210,122,.18);
}
.auth-sub { color: #a9a49a; }
.auth-tabs {
  padding: 4px; gap: 4px; margin-bottom: 16px;
  border-radius: 999px; background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
}
.auth-tab {
  border: 0; border-radius: 999px; background: transparent;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.auth-tab.on {
  border: 0; color: #ffe6b8;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,210,122,.14));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 10px rgba(0,0,0,.22);
}
.auth-pane input {
  border-radius: 14px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 -6px 16px rgba(0,0,0,.18);
  backdrop-filter: blur(8px);
  transition: border-color .2s ease, background .2s ease;
}
.auth-pane input:focus {
  border-color: rgba(255,210,122,.55);
  background: rgba(255,255,255,.09);
}
.auth-qr-box {
  border-radius: 20px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.045);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
}
.auth-primary {
  border-radius: 16px; border: 1px solid rgba(255,210,122,.34);
  background: linear-gradient(180deg, rgba(255,227,170,.22), rgba(255,180,90,.1));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.36), 0 10px 30px rgba(0,0,0,.28);
  transition: transform .16s ease, background .2s ease, border-color .2s ease;
}
.auth-primary:hover {
  background: linear-gradient(180deg, rgba(255,227,170,.3), rgba(255,180,90,.16));
  border-color: rgba(255,210,122,.6);
}
.auth-primary:active { transform: scale(.985); }

.auth-brand {
  margin: 0 0 2px; font-family: var(--font-sans);
  font-size: clamp(38px, 5vw, 48px); font-weight: 400;
  letter-spacing: .16em; color: #ffe6b8;
  text-shadow: 0 0 44px rgba(255,210,122,.28);
}
.auth-brand-en {
  margin: 0 0 18px; font: 10px/1.6 "IBM Plex Mono", monospace;
  letter-spacing: .34em; color: #8e8a82;
}
.auth-kicker { display: none; }

/* 首屏介绍动画 */
.intro-film {
  position: fixed; inset: 0; z-index: 240; display: grid; place-items: center;
  overflow: hidden; background:
    radial-gradient(60% 60% at 50% 42%, #122036 0%, #05070d 62%, #020308 100%);
  color: #e8ecf4; opacity: 0; transition: opacity .7s ease;
}
.intro-film.on { opacity: 1; }
.intro-film[hidden] { display: none; }
.intro-film::before {
  content: ""; position: absolute; inset: -20%;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 72%, #fff6 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 74% 26%, #ffe6b8aa 50%, transparent 51%),
    radial-gradient(1px 1px at 84% 68%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 12%, #fff5 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 42% 84%, #fff7 50%, transparent 51%);
  animation: intro-drift 26s linear infinite alternate;
  opacity: .8;
}
@keyframes intro-drift { to { transform: translate3d(-2%, 1.5%, 0) scale(1.04); } }
.intro-stage { position: relative; z-index: 1; width: min(1080px, 88vw); text-align: center; }
.intro-kicker {
  margin: 0 0 18px; font: 12px/1 "IBM Plex Mono", monospace;
  letter-spacing: .42em; color: #8e8a82; opacity: 0;
  animation: intro-up .8s .2s ease both;
}
.intro-title {
  margin: 0 0 34px; font-family: var(--font-sans);
  font-size: clamp(44px, 6.2vw, 86px); line-height: 1.3; font-weight: 400;
  letter-spacing: .06em; color: #ffe6b8;
  text-shadow: 0 0 70px rgba(255,210,122,.22);
  opacity: 0; animation: intro-up 1s .5s cubic-bezier(.22,1,.36,1) both;
}
.intro-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin: 0 auto 34px; max-width: 900px;
}
.intro-step {
  padding: 18px 16px; border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px; background: rgba(255,255,255,.045);
  backdrop-filter: blur(14px); opacity: 0;
  animation: intro-up .9s ease both;
}
.intro-step:nth-child(1) { animation-delay: 4.0s; }
.intro-step:nth-child(2) { animation-delay: 4.4s; }
.intro-step:nth-child(3) { animation-delay: 4.8s; }
.intro-step b { display: block; margin-bottom: 8px; font: 11px/1 "IBM Plex Mono", monospace; letter-spacing: .3em; color: #8e8a82; }
.intro-step span { display: block; font-size: 26px; letter-spacing: .06em; color: #ffe6b8; }
.intro-step em { display: block; margin-top: 6px; font-style: normal; font-size: 14px; color: #a9a090; }
.intro-foot {
  margin: 0; font-size: 18px; letter-spacing: .16em; color: #ffd27a;
  opacity: 0; animation: intro-up .9s 8.4s ease both;
}
@keyframes intro-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.intro-skip {
  position: absolute; right: clamp(18px, 4vw, 42px); bottom: clamp(18px, 4vh, 34px);
  padding: 10px 18px; border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px; background: rgba(7,8,15,.5); color: #b9b0a0;
  font: inherit; font-size: 13px; cursor: pointer;
}
.intro-skip:hover { border-color: rgba(255,210,122,.5); color: #ffd27a; }
@media (max-width: 720px) {
  .intro-steps { grid-template-columns: 1fr; gap: 10px; }
  .intro-step { padding: 12px 14px; }
  .intro-step span { font-size: 20px; }
  .intro-title { font-size: clamp(34px, 9vw, 52px); }
}

/* 星史·幕转场模板 */
.story-prelude.act {
  background:
    radial-gradient(50% 50% at 50% 50%, #17233a 0%, #05070d 66%, #020308 100%);
}
.story-prelude.act::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: min(72vmin, 760px); height: min(72vmin, 760px);
  margin: calc(min(72vmin, 760px) / -2); border-radius: 50%;
  border: 1px solid rgba(255,210,122,.24);
  box-shadow: 0 0 80px rgba(255,210,122,.08), inset 0 0 80px rgba(255,210,122,.05);
  animation: act-ring 18s linear infinite;
}
.story-prelude.act::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: min(52vmin, 560px); height: min(52vmin, 560px);
  margin: calc(min(52vmin, 560px) / -2); border-radius: 50%;
  border: 1px dashed rgba(142,233,196,.2);
  animation: act-ring 26s linear infinite reverse;
}
@keyframes act-ring { to { transform: rotate(360deg); } }
.story-prelude.act h2 {
  font-size: clamp(52px, 8vw, 104px); letter-spacing: .16em;
  text-shadow: 0 0 60px rgba(255,210,122,.28);
}
.story-prelude.act .story-prelude-kicker {
  font-size: 14px; letter-spacing: .42em; color: #ffd27a;
}
.story-prelude.act p { font-size: 16px; color: #b9b0a0; }

/* 开屏 v2：星图运镜 + 超大品牌字 */
.intro-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0;
  pointer-events: none;
}
.intro-stage { width: min(1220px, 92vw); }
.intro-brand {
  margin: 0 0 18px; font-family: var(--font-sans);
  font-size: clamp(76px, 12vw, 160px); line-height: 1.02; font-weight: 400;
  letter-spacing: .14em; color: #ffe6b8;
  background: linear-gradient(105deg, #b98b4a 0%, #fff3d2 28%, #ffd27a 48%, #fff6df 68%, #b98b4a 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 46px rgba(255,210,122,.22));
  animation: intro-brand-in 2.2s .75s cubic-bezier(.22,1,.36,1) both,
             intro-shimmer 7s 2.6s linear infinite;
}
@keyframes intro-brand-in {
  from { opacity: 0; transform: scale(1.16) translateY(16px); letter-spacing: .34em; }
  to { opacity: 1; transform: none; letter-spacing: .14em; }
}
@keyframes intro-shimmer { to { background-position: -220% 0; } }
.intro-tagline {
  margin: 0 auto 36px; font-size: clamp(22px, 2.4vw, 34px);
  letter-spacing: .12em; color: #cbbd9f;
  opacity: 0; animation: intro-up 1s 2.8s ease both;
}
.intro-kicker { font-size: 11px; letter-spacing: .5em; }
.intro-step { padding: 22px 18px; }
.intro-step b { font-size: 12px; letter-spacing: .34em; }
.intro-step span { font-size: 30px; }
.intro-step em { font-size: 15px; }
.intro-foot { font-size: 20px; letter-spacing: .2em; }
@media (max-width: 720px) {
  .intro-brand { font-size: clamp(52px, 15vw, 86px); letter-spacing: .08em; }
  .intro-tagline { font-size: 17px; margin-bottom: 22px; }
  .intro-step span { font-size: 21px; }
  .intro-step em { font-size: 13px; }
  .intro-foot { font-size: 15px; }
}

/* 登录 v2：左品牌 + 右玻璃面板 */
.auth-gate {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
  align-items: center; gap: clamp(32px, 6vw, 90px);
  padding: clamp(24px, 5vw, 72px);
  background:
    linear-gradient(100deg, rgba(3,4,10,.94) 0%, rgba(3,4,10,.62) 48%, rgba(3,4,10,.88) 100%),
    radial-gradient(70% 60% at 18% 20%, rgba(44,72,110,.35), transparent 62%);
  backdrop-filter: blur(4px);
}
.auth-hero { max-width: 720px; align-self: center; }
.auth-hero-kicker {
  margin: 0 0 12px; font: 11px/1 "IBM Plex Mono", monospace;
  letter-spacing: .42em; color: #8e8a82;
}
.auth-hero-brand {
  margin: 0 0 16px; font-family: var(--font-sans);
  font-size: clamp(62px, 8.4vw, 116px); line-height: 1.02; font-weight: 400;
  letter-spacing: .12em; color: #ffe6b8;
  background: linear-gradient(105deg, #b98b4a, #fff3d2 35%, #ffd27a 58%, #b98b4a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 44px rgba(255,210,122,.18));
}
.auth-hero-tagline {
  margin: 0 0 26px; font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.55; letter-spacing: .06em; color: #cbbd9f;
}
.auth-hero-points { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; color: #9a9388; font-size: 14px; }
.auth-hero-points li::before { content: "✦"; margin-right: 10px; color: #ffd27a; }
.auth-panel-kicker {
  margin: 0 0 8px; font: 10px/1 "IBM Plex Mono", monospace;
  letter-spacing: .3em; color: #8e8a82;
}
.auth-panel { width: 100%; max-width: 440px; justify-self: end; }
.auth-title { font-size: 23px; }
@media (max-width: 900px) {
  .auth-gate { grid-template-columns: 1fr; padding: 20px; gap: 22px; align-content: center; }
  .auth-hero { text-align: center; }
  .auth-hero-brand { font-size: clamp(48px, 14vw, 76px); }
  .auth-hero-tagline { font-size: 17px; margin-bottom: 10px; }
  .auth-hero-points { display: none; }
  .auth-panel { justify-self: center; }
}

/* 开屏 v3：命中帧 + 5.6s 节奏 */
.intro-film::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: #fff; opacity: 0;
  animation: intro-impact .3s 1.0s ease-out both;
}
@keyframes intro-impact {
  0% { opacity: 0; }
  14% { opacity: .2; }
  100% { opacity: 0; }
}
.intro-brand {
  font-size: clamp(96px, 12.6vw, 168px);
  font-weight: 600; letter-spacing: .1em;
  animation: intro-brand-in 1.35s .18s cubic-bezier(.16,1,.3,1) both,
             intro-shimmer 1.1s 1.25s linear 1;
}
@keyframes intro-brand-in {
  from { opacity: 0; transform: scale(1.1) translateY(12px); letter-spacing: .32em; filter: blur(8px); }
  to { opacity: 1; transform: none; letter-spacing: .1em; filter: none; }
}
.intro-tagline {
  font-size: clamp(24px, 2.6vw, 38px);
  animation: intro-up .7s 1.55s ease both;
  margin-bottom: 26px;
}
.intro-step {
  opacity: 0; animation: intro-up .6s ease both;
}
.intro-step:nth-child(1) { animation-delay: 2.2s; }
.intro-step:nth-child(2) { animation-delay: 2.38s; }
.intro-step:nth-child(3) { animation-delay: 2.56s; }
.intro-step span { font-size: 28px; font-weight: 500; }
.intro-step em { font-size: 14px; }
.intro-foot { animation: intro-up .6s 3.5s ease both; font-size: 18px; }
.intro-skip { opacity: .75; font-size: 12px; }

/* 登录 v3：更大品牌 + 单层玻璃 + 32 圆角 */
.auth-hero-brand { font-size: clamp(72px, 8.8vw, 122px); font-weight: 600; letter-spacing: .1em; }
.auth-hero-tagline { font-size: clamp(22px, 2.4vw, 34px); }
.auth-panel {
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,.045) 46%, rgba(255,255,255,.07) 100%);
  border: 1px solid rgba(255,255,255,.2);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.4),
    inset 0 -1px 0 rgba(0,0,0,.34),
    0 44px 130px -22px rgba(0,0,0,.78),
    0 12px 32px rgba(0,0,0,.4);
  backdrop-filter: blur(24px) saturate(165%);
  -webkit-backdrop-filter: blur(24px) saturate(165%);
}
.auth-pane input, .auth-qr-box { backdrop-filter: none; -webkit-backdrop-filter: none; }
.auth-pane input { border-radius: 14px; }
.auth-title { font-size: 24px; }
@media (max-width: 720px) {
  .intro-brand { font-size: clamp(58px, 16vw, 96px); font-weight: 600; letter-spacing: .06em; }
  .intro-tagline { font-size: 18px; }
  .intro-step span { font-size: 20px; }
  .auth-hero-brand { font-size: clamp(54px, 15vw, 86px); }
}

/* 开屏：实拍星景 + 运镜，不再纯黑点阵 */
.intro-film {
  background: #020308;
}
.intro-bg {
  position: absolute; inset: -8%; z-index: 0;
  background: url("./assets/milky-way.webp") center 42% / cover no-repeat;
  filter: brightness(.5) saturate(.92) contrast(1.05);
  animation: intro-kenburns 12s cubic-bezier(.16,1,.3,1) both;
}
@keyframes intro-kenburns {
  from { transform: scale(1.14) translate3d(-1.2%, 1.4%, 0); }
  to { transform: scale(1.0) translate3d(0, 0, 0); }
}
.intro-planet {
  position: absolute; z-index: 0; right: -6%; bottom: -18%;
  width: min(64vw, 880px); aspect-ratio: 1;
  background: url("./assets/black-hole.webp") center / contain no-repeat;
  opacity: .5; filter: brightness(.75) saturate(.9); mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 74%);
  mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 74%);
  animation: intro-planet-drift 16s ease-in-out infinite alternate;
}
@keyframes intro-planet-drift {
  from { transform: translate3d(0, 0, 0) scale(1.0); }
  to { transform: translate3d(-1.4%, -1.2%, 0) scale(1.04); }
}
.intro-film::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(70% 80% at 50% 42%, rgba(2,3,8,.08) 0%, rgba(2,3,8,.52) 62%, rgba(2,3,8,.92) 100%),
    linear-gradient(180deg, rgba(2,3,8,.78), transparent 30%, rgba(2,3,8,.55) 78%, rgba(2,3,8,.95));
  animation: none;
}
.intro-canvas { z-index: 1; }
.intro-stage { z-index: 2; }
.intro-film::after { z-index: 3; }
.intro-skip { z-index: 4; }

/* 登录：隐藏封面主体，保留顶栏、登录层与 API 配置弹窗 */
body.auth-locked > main,
body.auth-locked > section:not(#authGate):not(#introFilm):not(#apiGateModal) {
  visibility: hidden !important;
}
.auth-gate {
  background:
    linear-gradient(100deg, rgba(2,3,8,.92) 0%, rgba(2,3,8,.55) 46%, rgba(2,3,8,.86) 100%),
    radial-gradient(60% 70% at 25% 45%, rgba(40,72,112,.32), transparent 62%),
    url("./assets/milky-way.webp") center 46% / cover no-repeat #020308;
  backdrop-filter: none;
}
.auth-gate::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  right: -8%; top: 50%; bottom: auto; width: min(56vw, 760px); height: auto; aspect-ratio: 1;
  transform: translateY(-50%);
  background: url("./assets/black-hole.webp") center / contain no-repeat;
  opacity: .45; filter: brightness(.7) saturate(.9); mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 74%);
  mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 74%);
  animation: auth-planet 18s ease-in-out infinite alternate;
}
@keyframes auth-planet {
  from { transform: translateY(-50%) translate3d(0, 0, 0) scale(1); }
  to { transform: translateY(-50%) translate3d(-1%, 1%, 0) scale(1.03); }
}
.auth-gate::before {
  content: ""; position: fixed; z-index: -2; pointer-events: none;
  inset: 0; border-radius: 0; width: auto; height: auto;
  background: radial-gradient(60% 80% at 25% 45%, rgba(255,210,122,.05), transparent 65%);
  filter: none; opacity: 1; animation: none;
}

/* 开屏 v4：电影画幅 + 三层次 + 底部功能条 */
.intro-bars { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.intro-bars::before, .intro-bars::after {
  content: ""; position: absolute; left: 0; right: 0; height: 7.5vh; background: #010207;
}
.intro-bars::before { top: 0; }
.intro-bars::after { bottom: 0; }
.intro-stage {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; width: min(1180px, 90vw); padding: 12vh 0 9vh;
}
.intro-kicker { margin-bottom: 14px; }
.intro-brand {
  font-size: clamp(100px, 13.2vw, 176px);
  letter-spacing: .07em; line-height: .96;
  -webkit-text-stroke: .8px rgba(255,235,190,.2);
  text-shadow: 0 0 90px rgba(255,190,100,.16);
  animation: intro-brand-in 1.45s .12s cubic-bezier(.16,1,.3,1) both;
}
@keyframes intro-brand-in {
  0% { opacity: 0; transform: scale(1.14); letter-spacing: .26em; filter: blur(10px); }
  62% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: scale(1); letter-spacing: .07em; filter: none; }
}
.intro-tagline {
  margin: 22px 0 0; font-size: clamp(24px, 2.6vw, 36px);
  color: #d8cbb2; letter-spacing: .14em;
  animation: intro-up .8s 1.55s ease both;
}
.intro-stage::before {
  content: ""; width: min(720px, 72vw); height: 1px; margin-top: 30px;
  background: linear-gradient(90deg, transparent, rgba(255,210,122,.55), transparent);
  opacity: 0; animation: intro-line 1s 1.35s ease both;
}
@keyframes intro-line { from { opacity: 0; transform: scaleX(.3); } to { opacity: 1; transform: scaleX(1); } }
.intro-steps {
  display: flex; width: min(980px, 88vw); margin: auto 0 0; gap: 0;
  border-top: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 -1px 0 rgba(255,210,122,.08);
}
.intro-step {
  position: relative; flex: 1; padding: 20px 22px 0;
  border: 0; border-left: 1px solid rgba(255,255,255,.12);
  border-radius: 0; background: none; backdrop-filter: none;
  text-align: left; opacity: 0;
  animation: intro-up .7s ease both;
}
.intro-step:first-child { border-left: 0; padding-left: 0; }
.intro-step:nth-child(1) { animation-delay: 2.25s; }
.intro-step:nth-child(2) { animation-delay: 2.34s; }
.intro-step:nth-child(3) { animation-delay: 2.43s; }
.intro-step b { display: block; margin: 0 0 8px; font: 11px/1 "IBM Plex Mono", monospace; letter-spacing: .3em; color: #9a8a68; }
.intro-step span { display: block; font-size: clamp(22px, 2.2vw, 30px); font-weight: 500; color: #ffe6b8; letter-spacing: .04em; }
.intro-step em { display: block; margin-top: 7px; font-style: normal; font-size: 14px; color: #9a9388; }
.intro-foot {
  margin: 26px 0 0; font-size: 15px; color: #9a9388; letter-spacing: .18em;
  animation: intro-up .6s 3.35s ease both;
}
.intro-planet {
  width: min(58vw, 820px); right: -8%; bottom: -16%;
  opacity: .55; filter: brightness(.72) saturate(.86);
  animation: intro-planet-drift 9s cubic-bezier(.16,1,.3,1) both;
}
@keyframes intro-planet-drift {
  from { transform: translate3d(4%, 4%, 0) scale(1.08); opacity: .35; }
  to { transform: translate3d(0, 0, 0) scale(1); opacity: .55; }
}
.intro-bg { animation: intro-kenburns 6.2s cubic-bezier(.16,1,.3,1) both; }
@keyframes intro-kenburns {
  from { transform: scale(1.17) translate3d(-1.5%, 1.6%, 0); filter: brightness(.38) saturate(.85) contrast(1.06); }
  to { transform: scale(1.0) translate3d(0, 0, 0); filter: brightness(.52) saturate(.92) contrast(1.04); }
}
.intro-film::after { animation: intro-impact .34s 1.0s ease-out both; }
@keyframes intro-impact { 0% { opacity: 0; } 12% { opacity: .16; } 100% { opacity: 0; } }

/* 登录：让黑洞真正出现在玻璃后面 */
.auth-gate { position: relative; }
.auth-gate::after { z-index: 0; opacity: .42; }
.auth-hero, .auth-panel { position: relative; z-index: 2; }
.auth-hero-brand { -webkit-text-stroke: .6px rgba(255,235,190,.16); }

/* 登录时保留顶栏（品牌与日夜切换），隐藏封面主体，保持与首页一致的纯净观感 */
body.auth-locked > *:not(.topbar):not(#authGate):not(#introFilm):not(#apiGateBackdrop):not(#apiGateModal):not(#toast) {
  display: none !important;
}

/* ============ 登录页 · 首页同款简约液态玻璃设计（同步支持日间/夜间主题） ============ */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: clamp(78px, 10vh, 112px) 20px 36px;
  overflow: auto;
  background: radial-gradient(120% 90% at 50% 16%, var(--bg-deep), var(--bg) 54%, var(--bg) 100%);
  color: var(--text);
  backdrop-filter: none;
}
.auth-gate::before,
.auth-gate::after {
  content: none !important;
  display: none !important;
}
.auth-ambient-orbit {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(560px, 84vw);
  height: min(560px, 84vw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid var(--line);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  box-shadow: inset 0 0 80px rgba(255, 255, 255, 0.16);
}
:root[data-theme="dark"] .auth-ambient-orbit {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 90px rgba(255, 210, 122, 0.04),
    0 0 120px rgba(120, 170, 255, 0.05);
}

.auth-panel {
  position: relative;
  z-index: 2;
  width: min(392px, 92vw);
  padding: 26px 26px 22px;
  border-radius: 26px;
  /* 白天：通透瓷白液态玻璃 */
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.72) 0%,
    rgba(255, 255, 255, 0.44) 48%,
    rgba(255, 255, 255, 0.58) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.84);
  -webkit-backdrop-filter: blur(24px) saturate(165%);
  backdrop-filter: blur(24px) saturate(165%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(120, 138, 162, 0.14),
    0 24px 56px rgba(90, 108, 132, 0.16),
    0 4px 14px rgba(90, 108, 132, 0.08);
}
:root[data-theme="dark"] .auth-panel {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.09) 0%,
    rgba(255, 255, 255, 0.025) 45%,
    rgba(255, 255, 255, 0.045) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 28px 64px rgba(0, 0, 0, 0.54);
}
.auth-panel:active { transform: none !important; }

.auth-head {
  text-align: center;
  margin-bottom: 18px;
}
.auth-panel-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--text-3);
}
.auth-title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text);
}
.auth-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-2);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: rgba(56, 70, 90, 0.06);
  border: 1px solid rgba(56, 70, 90, 0.08);
}
:root[data-theme="dark"] .auth-tabs {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.09);
}
.auth-tab {
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: 500 12.5px/1 var(--font-sans);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.auth-tab.on {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(80, 96, 120, 0.12);
}
:root[data-theme="dark"] .auth-tab.on {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.auth-pane {
  display: grid;
  gap: 12px;
}
.auth-pane[hidden] { display: none !important; }

.auth-qr-box {
  min-height: 204px;
  padding: 16px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(56, 70, 90, 0.09);
}
:root[data-theme="dark"] .auth-qr-box {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.10);
}
.auth-qr-box img {
  width: 172px;
  height: 172px;
  border-radius: 12px;
  background: #ffffff;
  padding: 6px;
  object-fit: contain;
  display: block;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.auth-cred-fields,
.auth-verify-box {
  display: grid;
  gap: 11px;
}
.auth-cred-fields[hidden],
.auth-verify-box[hidden] { display: none !important; }

.auth-field {
  display: grid;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-2);
}
.auth-field input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(56, 70, 90, 0.14);
  background: rgba(255, 255, 255, 0.66);
  color: var(--text);
  font: 400 13px/1 var(--font-sans);
  outline: none;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.auth-field input::placeholder { color: var(--text-3); }
.auth-field input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 3px rgba(169, 119, 34, 0.12);
}
:root[data-theme="dark"] .auth-field input {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(5, 8, 16, 0.56);
  color: var(--text);
}
:root[data-theme="dark"] .auth-field input:focus {
  border-color: rgba(255, 210, 122, 0.58);
  background: rgba(8, 12, 24, 0.84);
  box-shadow: 0 0 0 3px rgba(255, 210, 122, 0.12);
}

.auth-verify-hint {
  margin: 0;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-2);
  background: rgba(169, 119, 34, 0.08);
  border: 1px solid rgba(169, 119, 34, 0.22);
}
:root[data-theme="dark"] .auth-verify-hint {
  color: #f6ddb0;
  background: rgba(255, 210, 122, 0.08);
  border-color: rgba(255, 210, 122, 0.24);
}
.auth-verify-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.auth-verify-row input {
  font-family: var(--font-mono);
  letter-spacing: 0.18em;
}
.auth-resend-btn {
  height: 38px;
  padding: 0 13px;
  border-radius: 12px;
  border: 1px solid rgba(56, 70, 90, 0.16);
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  font: 500 12px/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), opacity 0.15s var(--ease);
}
.auth-resend-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--accent);
}
.auth-resend-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
:root[data-theme="dark"] .auth-resend-btn {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
:root[data-theme="dark"] .auth-resend-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 210, 122, 0.45);
}

.auth-back-link {
  justify-self: start;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font: 400 11.5px/1.4 var(--font-sans);
  cursor: pointer;
  transition: color 0.15s var(--ease);
}
.auth-back-link:hover { color: var(--accent); }

.auth-primary {
  width: 100%;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(169, 119, 34, 0.36);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(235, 224, 202, 0.52) 100%);
  color: var(--accent);
  font: 500 13px/1 var(--font-sans);
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 20px rgba(90, 108, 132, 0.12);
  transition: transform 0.14s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.auth-primary:hover:not(:disabled) {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(242, 226, 194, 0.72) 100%);
}
.auth-primary:disabled { opacity: 0.48; cursor: wait; }
:root[data-theme="dark"] .auth-primary {
  border-color: rgba(255, 210, 122, 0.46);
  background: linear-gradient(180deg, rgba(255, 210, 122, 0.22) 0%, rgba(255, 190, 90, 0.10) 100%);
  color: #ffe5ad;
}
:root[data-theme="dark"] .auth-primary:hover:not(:disabled) {
  border-color: rgba(255, 224, 158, 0.68);
  background: linear-gradient(180deg, rgba(255, 210, 122, 0.30) 0%, rgba(255, 190, 90, 0.16) 100%);
}

.auth-status {
  min-height: 18px;
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-2);
}
.auth-status.error { color: var(--danger); }
:root[data-theme="dark"] .auth-status.error { color: #ff9c8e; }
.auth-status.ok { color: #268963; }
:root[data-theme="dark"] .auth-status.ok { color: #84e6bd; }

.auth-foot {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.auth-temp {
  width: auto;
  margin: 0;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-3);
  font: 400 12px/1.4 var(--font-sans);
  cursor: pointer;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}
.auth-temp:hover {
  color: var(--text);
  background: rgba(56, 70, 90, 0.06);
}
:root[data-theme="dark"] .auth-temp:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* ============ 登录后原页 API 配置液态玻璃弹窗（与首页/登录页同源日夜材质） ============ */
.api-gate-backdrop {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(220, 228, 238, 0.54);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
:root[data-theme="dark"] .api-gate-backdrop {
  background: rgba(3, 5, 11, 0.72);
}
.api-gate-backdrop[hidden],
.api-gate-modal[hidden] {
  display: none !important;
}
.api-gate-modal {
  position: fixed !important;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 265;
  width: min(420px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 24px 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.84) 0%,
    rgba(244, 247, 252, 0.74) 100%
  );
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 24px 64px rgba(74, 90, 114, 0.22);
  color: var(--text);
}
:root[data-theme="dark"] .api-gate-modal {
  position: fixed !important;
  border-color: rgba(255, 224, 166, 0.22);
  background: linear-gradient(180deg, rgba(16, 21, 36, 0.92) 0%, rgba(8, 11, 20, 0.96) 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 206, 0.18),
    0 28px 80px rgba(0, 0, 0, 0.74);
  color: #eef2fa;
}
.api-gate-modal:active { transform: translate(-50%, -50%) !important; }
.api-gate-kicker {
  margin: 0 0 6px;
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.24em;
  color: var(--text-3);
}
.api-gate-title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text);
}
.api-gate-sub {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-2);
}
.api-gate-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.api-gate-field {
  display: grid;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-2);
}
.api-gate-field input {
  width: 100%;
  box-sizing: border-box;
  height: 36px;
  padding: 0 11px;
  border-radius: 11px;
  border: 1px solid rgba(56, 70, 90, 0.15);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font: 400 12.5px/1 var(--font-mono);
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.api-gate-field input::placeholder {
  color: var(--text-3);
  font-family: var(--font-sans);
}
.api-gate-field input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.96);
}
:root[data-theme="dark"] .api-gate-field input {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(5, 7, 14, 0.76);
  color: #f3f6fc;
}
:root[data-theme="dark"] .api-gate-field input:focus {
  border-color: rgba(255, 210, 122, 0.58);
  background: rgba(8, 12, 24, 0.94);
}
.api-gate-more {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-3);
}
.api-gate-more summary {
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}
.api-gate-more[open] .api-gate-field {
  margin-top: 8px;
}
.api-gate-status {
  margin: 2px 0 0;
  min-height: 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-2);
}
.api-gate-status.ok { color: #268963; }
:root[data-theme="dark"] .api-gate-status.ok { color: #84e6bd; }
.api-gate-status.error { color: var(--danger); }
:root[data-theme="dark"] .api-gate-status.error { color: #ff9c8e; }
.api-gate-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.api-gate-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(56, 70, 90, 0.16);
  background: rgba(255, 255, 255, 0.62);
  color: var(--text-2);
  font: 500 12.5px/1 var(--font-sans);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.api-gate-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}
.api-gate-btn.primary {
  border-color: rgba(169, 119, 34, 0.42);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(235, 224, 202, 0.56) 100%);
  color: var(--accent);
}
:root[data-theme="dark"] .api-gate-btn {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(235, 240, 250, 0.86);
}
:root[data-theme="dark"] .api-gate-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
:root[data-theme="dark"] .api-gate-btn.primary {
  border-color: rgba(255, 210, 122, 0.52);
  background: linear-gradient(180deg, rgba(255, 210, 122, 0.24) 0%, rgba(255, 190, 88, 0.14) 100%);
  color: #ffe5ad;
}
.api-gate-btn:disabled {
  opacity: 0.48;
  cursor: wait;
}
