/* ============================================================================
   Aurora AI Studio — visual system
   设计语言：深色玻璃拟态 + 极光渐变网格 + 细描边发光。
   全部类名与 JS 渲染输出保持一致；AI 改配色时整站联动（消费 --accent 等变量）。
   ============================================================================ */

:root {
  /* Themeable by AI: the whole site reads --accent. */
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(124, 92, 255, 0.16);

  --bg: #07070b;
  --bg-2: #0b0b12;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.06);

  --text: #f5f5f7;
  --text-2: #a6a6b3;
  --text-3: #6b6b78;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-1: 0 18px 40px -22px rgba(0, 0, 0, 0.85);
  --shadow-2: 0 30px 70px -26px rgba(0, 0, 0, 0.9);
  --maxw: 1180px;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI',
    'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  background: var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* --- animated aurora backdrop --------------------------------------------- */
body::before {
  content: '';
  position: fixed;
  inset: -20% -20% -20% -20%;
  z-index: -1;
  background:
    radial-gradient(38vw 38vw at 12% 8%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(34vw 34vw at 88% 4%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(40vw 40vw at 70% 92%, rgba(236, 72, 153, 0.12), transparent 62%),
    radial-gradient(30vw 30vw at 22% 88%, rgba(99, 102, 241, 0.14), transparent 60%);
  filter: saturate(120%);
  animation: aurora 22s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(2%, -2%, 0) scale(1.06); }
  100% { transform: translate3d(-2%, 1%, 0) scale(1.03); }
}

/* faint grid texture for depth */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 80%);
  pointer-events: none;
}

::selection {
  background: var(--accent-soft);
}

/* Thin premium scrollbar */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.13);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
  background-clip: padding-box;
}

/* ============================== Primitives ================================ */
.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.glass-strong {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
}

.text-gradient {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.accent-ring {
  box-shadow: 0 0 0 1px var(--accent), 0 0 30px -6px var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 650;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.16s var(--ease), background 0.18s, border-color 0.18s,
    box-shadow 0.18s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--panel-strong);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #08080c;
  box-shadow: 0 10px 26px -12px var(--accent);
}
.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 14px 34px -12px var(--accent);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--panel);
}
.btn.sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 9px;
}

.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 650;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  transition: border-color 0.16s, color 0.16s, background 0.16s;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.shimmer {
  position: relative;
  overflow: hidden;
}
.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* ============================== Layout shell ============================= */
.app { min-height: 100%; }
.content {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px 24px 80px;
}

/* ============================== Top nav ================================== */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 30px -24px #000;
}
.topnav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 62px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand-mark {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.3rem;
}
.brand-name { font-size: 1.05rem; }
.brand-tag {
  font-size: 0.64rem;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}
.module-tabs {
  display: flex;
  gap: 4px;
  margin-left: 8px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.module-tabs::-webkit-scrollbar { display: none; }
.tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  padding: 8px 15px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s var(--ease);
}
.tab:hover {
  color: var(--text);
  background: var(--panel);
}
.tab.active {
  color: #08080c;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 22px -12px var(--accent);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text-2);
  white-space: nowrap;
}

/* ============================== Hero ===================================== */
.hero {
  position: relative;
  text-align: center;
  padding: 84px 12px 64px;
  animation: fade-up 0.6s ease both;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  font-weight: 700;
  color: var(--accent-2);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 7px 16px;
  border-radius: 99px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
}
.hero-h1 {
  font-size: clamp(2.3rem, 6vw, 4.1rem);
  line-height: 1.05;
  font-weight: 850;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  background: linear-gradient(120deg, #fff 20%, var(--accent-2) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(124, 92, 255, 0.18);
}
.hero-sub {
  max-width: 700px;
  margin: 0 auto 32px;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text-2);
}
.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================== Sections ================================= */
.section {
  margin: 60px 0;
  animation: fade-up 0.5s ease both;
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.section-title {
  position: relative;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  padding-left: 16px;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 1.1em;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.section-sub {
  color: var(--text-2);
  font-size: 0.95rem;
  margin: 0;
}
.section-tag { margin-left: auto; }
.section-text .text-body {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-2);
  max-width: 780px;
  white-space: pre-wrap;
  word-break: break-word;
}
.section-text .text-body p + p,
.section-text .text-body br + br { margin-top: 1.1em; }
.section-text.align-center .text-body { margin: 0 auto; text-align: center; }
.section-text.align-right .text-body { margin-left: auto; text-align: right; }

/* ---- Split (image + content two-column) ---- */
.split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 28px;
  align-items: stretch;
}
.split-media {
  border-radius: var(--radius-lg);
  min-height: 320px;
  background-size: cover !important;
  background-position: center !important;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.split-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 8px 4px;
}
.split-content .section-title { padding-left: 0; }
.split-content .section-title::before { display: none; }
.split-content .text-body { white-space: pre-wrap; max-width: 60ch; }
.split-right .split-media { order: 2; }
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .split-media { min-height: 220px; }
  .split-right .split-media { order: 0; }
}

/* ---- Quote / manifesto ---- */
.quote-block { text-align: center; max-width: 960px; margin-left: auto; margin-right: auto; }
.quote-block.align-left { text-align: left; margin-left: 0; }
.quote-block.align-right { text-align: right; margin-right: 0; }
.quote-text {
  font-size: clamp(1.6rem, 4.2vw, 3rem);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  background: linear-gradient(120deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.quote-cite {
  display: block;
  margin-top: 18px;
  color: var(--text-3);
  font-style: normal;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

/* ---- Bento grid ---- */
.layout-bento {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 180px;
}
.layout-bento > .card { grid-column: span 1; grid-row: span 1; }
.layout-bento > .span-2x1 { grid-column: span 2; }
.layout-bento > .span-1x2 { grid-row: span 2; }
.layout-bento > .span-2x2 { grid-column: span 2; grid-row: span 2; }
.layout-bento > .card .browser,
.layout-bento > .card .phone { min-height: 0; }
.layout-bento > .card .card-body { padding: 16px; }
@media (max-width: 760px) {
  .layout-bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
  .layout-bento > .span-2x2 { grid-column: span 2; }
}

/* ---- Logo wall ---- */
.logo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.logo-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 22px 14px;
  border-radius: var(--radius);
  text-align: center;
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.logo-cell:hover { transform: translateY(-3px); border-color: var(--accent); }
.logo-name { font-weight: 700; font-size: 1.02rem; letter-spacing: 0.01em; }
.logo-sub { font-size: 0.78rem; color: var(--text-3); }

/* ---- Free-form node tree（B 方案：AI 从零画的元素树）---- */
.nd { box-sizing: border-box; min-width: 0; }
.nd-text { margin: 0; }
.nd-img { display: block; max-width: 100%; }
img.nd-img { object-fit: cover; }
.nd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), filter 0.2s;
}
.nd-btn:hover { filter: brightness(1.08); }
.nd-badge { display: inline-block; }
.nd-divider { border: 0; height: 1px; margin: 0; background: currentColor; opacity: 0.14; }
.nd-grid { display: grid; min-width: 0; }
.nd-stack { display: flex; min-width: 0; }
@media (max-width: 760px) {
  .nd-grid { grid-template-columns: 1fr !important; }
}

/* ============================== Layouts ================================= */
.layout {
  display: grid;
  gap: 22px;
}
.layout-grid {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.layout-masonry {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 10px;
}
.layout-masonry > .card { grid-row-end: span 36; }
.layout-carousel {
  grid-auto-flow: column;
  grid-auto-columns: 330px;
  overflow-x: auto;
  padding-bottom: 14px;
  scroll-snap-type: x mandatory;
}
.layout-carousel > .card { scroll-snap-align: start; }
.layout-feature { grid-template-columns: 1fr; }
.layout-feature > .card {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* ============================== Card base =============================== */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.28s var(--ease), border-color 0.28s, box-shadow 0.28s;
  display: flex;
  flex-direction: column;
}
/* gradient border on hover */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-6px);
  border-color: transparent;
  box-shadow: var(--shadow-2), 0 0 0 1px var(--accent-soft);
}
.card:hover::after { opacity: 1; }

.card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.card-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.card-title { font-size: 1.14rem; font-weight: 750; margin: 0; }
.card-desc {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-2);
  margin: 0;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.metrics { display: flex; gap: 16px; }
.metric { display: flex; flex-direction: column; }
.metric-v { font-weight: 800; font-size: 0.96rem; }
.metric-l { font-size: 0.68rem; color: var(--text-3); }
.card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #08080c;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 99px;
  z-index: 2;
}

/* website: browser mockup */
.browser { border-bottom: 1px solid var(--line); }
.browser-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.03);
}
.dots { display: flex; gap: 5px; }
.dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}
.dots i:first-child { background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.browser-url {
  flex: 1;
  font-size: 0.72rem;
  color: var(--text-3);
  background: rgba(0, 0, 0, 0.32);
  border-radius: 7px;
  padding: 4px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser-body { aspect-ratio: 16 / 9; background-size: cover !important; }

/* app: phone mockup */
.card-app { align-items: center; }
.phone {
  position: relative;
  width: 132px;
  height: 264px;
  margin: 20px auto 6px;
  border-radius: 28px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  background: #0a0a0c;
  overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
}
.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 16px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 0 0 12px 12px;
  z-index: 2;
}
.phone-screen { width: 100%; height: 100%; background-size: cover !important; }

/* game: 3D tilt */
.card-game .game-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background-size: cover !important;
  transition: transform 0.2s ease;
  display: flex;
  align-items: flex-end;
  padding: 12px;
}
.play-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #08080c;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  padding: 5px 12px;
  border-radius: 99px;
  box-shadow: 0 6px 18px -8px var(--accent);
}

/* image: gallery tile */
.card-image { cursor: pointer; }
.img-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background-size: cover !important;
}
.img-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s;
}
.card-image:hover .img-zoom { opacity: 1; }
.img-cap {
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--text-2);
}
.img-cap strong { color: var(--text); }

/* ============================== Stats / CTA / Widget ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.stat {
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 100% at 50% 0%, var(--accent-soft), transparent 70%);
  opacity: 0.7;
}
.stat-v {
  position: relative;
  font-size: 2.1rem;
  font-weight: 850;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-l { position: relative; font-size: 0.82rem; color: var(--text-2); margin-top: 4px; }

.cta-block {
  text-align: center;
  padding: 54px 24px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.cta-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 120% at 50% 0%, var(--accent-soft), transparent 70%);
}
.cta-title { position: relative; font-size: 1.85rem; font-weight: 850; margin: 0 0 10px; }
.cta-sub { position: relative; color: var(--text-2); margin: 0 0 24px; }

.widget-frame {
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 200px;
}
.sandbox-frame {
  width: 100%;
  min-height: 200px;
  border: 0;
  display: block;
  background: transparent;
}
.section-code .code-frame-wrap { width: 100%; }
.section-code .code-sandbox {
  width: 100%;
  border: 0;
  display: block;
  border-radius: var(--radius);
}
.nd-html {
  width: 100%;
  border: 0;
  display: block;
  border-radius: 12px;
}
.site-footer {
  text-align: center;
  color: var(--text-3);
  font-size: 0.82rem;
  padding: 44px 0 12px;
  border-top: 1px solid var(--line);
  margin-top: 44px;
}

/* ============================== Command palette ========================= */
.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 4, 8, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}
.cmd-box {
  width: min(700px, 92vw);
  border-radius: var(--radius-lg);
  padding: 18px;
  animation: scale-in 0.18s ease both;
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.85);
}
.cmd-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 6px 4px 14px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.cmd-input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cmd-prompt { color: var(--accent-2); font-weight: 800; font-size: 1.1rem; }
.cmd-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 1.05rem;
  padding: 10px 4px;
}
.cmd-input::placeholder { color: var(--text-3); }
.cmd-meta {
  display: flex;
  justify-content: space-between;
  margin: 14px 2px 10px;
  font-size: 0.74rem;
  color: var(--text-3);
}
.cmd-suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.cmd-ex { cursor: pointer; transition: all 0.16s; }
.cmd-ex:hover { border-color: var(--accent); color: var(--text); }

/* ============================== Settings ================================ */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(4, 4, 8, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.settings-box {
  width: min(620px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: 24px;
  animation: scale-in 0.18s ease both;
}
.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.settings-head h2 { margin: 0; font-size: 1.3rem; }
.settings-note {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.65;
  margin: 6px 0 16px;
}
.prov-list { display: flex; flex-direction: column; gap: 10px; }
.prov-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.prov-row.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.prov-info { flex: 1; min-width: 0; }
.prov-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.prov-badge {
  font-size: 0.66rem;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #08080c;
  padding: 1px 8px;
  border-radius: 99px;
  font-weight: 800;
}
.prov-sub {
  font-size: 0.76rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prov-actions { display: flex; gap: 6px; }
.prov-form { display: flex; flex-direction: column; gap: 10px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.settings-divider {
  margin: 18px 0 12px;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.settings-foot { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ============================== Toast =================================== */
#toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 14px;
  font-size: 0.86rem;
  animation: fade-up 0.25s ease both;
  box-shadow: var(--shadow-1);
}
.toast.out {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.28s ease;
}
.toast.err { border-color: #ff5f57; }
.toast-msg { flex: 1; }
.toast-undo {
  background: var(--accent);
  color: #08080c;
  border: 0;
  border-radius: 8px;
  padding: 5px 12px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.8rem;
}
.toast-x {
  background: transparent;
  border: 0;
  color: var(--text-3);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

/* ---- AI 设计师实时输出面板（显示模型原话）---- */
.ai-view {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 210;
  width: min(640px, calc(100vw - 36px));
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 16px;
  animation: fade-up 0.3s ease both;
}
.ai-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8rem;
  color: var(--text-2);
}
.ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: ai-pulse 1.1s ease-in-out infinite;
}
.ai-title { font-weight: 600; color: var(--text); }
.ai-badge {
  margin-left: auto;
  font-size: 0.68rem;
  padding: 2px 9px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--text-3);
}
.ai-say {
  font-size: 0.93rem;
  line-height: 1.68;
  color: var(--text);
  white-space: pre-wrap;
  max-height: 32vh;
  overflow-y: auto;
  min-height: 1.7em;
}
.ai-say::after {
  content: '▌';
  color: var(--accent);
  margin-left: 1px;
  animation: ai-blink 1s steps(1) infinite;
}
.ai-view.done .ai-say::after { content: ''; }
.ai-view.done .ai-dot { background: #22c55e; animation: none; }
.ai-stat {
  font-size: 0.76rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
@keyframes ai-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.78); }
}
@keyframes ai-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-dot, .ai-say::after { animation: none; }
}

/* 进度型 toast：主文案 + 实时详情 + 底部进度条 */
.toast-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.toast-msg { flex: 0 0 auto; }
.toast-detail {
  font-size: 0.78rem;
  color: var(--text-2);
  white-space: pre-line;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.toast.has-bar {
  position: relative;
  overflow: hidden;
  padding-bottom: 17px;
  min-width: 300px;
}
.toast-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.09);
}
.toast-bar i {
  display: block;
  height: 100%;
  width: 35%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}
.toast-bar i.indeterminate {
  width: 32%;
  transition: none;
  animation: toast-slide 1.25s ease-in-out infinite;
}
@keyframes toast-slide {
  0% { transform: translateX(-105%); }
  100% { transform: translateX(320%); }
}
@media (prefers-reduced-motion: reduce) {
  .toast-bar i.indeterminate { animation: none; width: 60%; }
}

/* ============================== Lightbox ================================ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(4, 4, 8, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-up 0.2s ease both;
}
.lightbox { width: min(720px, 94vw); border-radius: var(--radius-lg); overflow: hidden; }
.lightbox-cover { height: 320px; background-size: cover !important; }
.lightbox-meta { padding: 20px 22px 24px; }
.lightbox-meta h3 { margin: 0 0 6px; font-size: 1.4rem; }
.lightbox-meta p { color: var(--text-2); margin: 4px 0; }
.lightbox-desc { line-height: 1.75; }

/* ============================== Reveal anim ============================= */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s ease, transform 0.55s var(--ease);
  transition-delay: var(--d, 0ms);
}

/* ============================== Keyframes =============================== */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ============================== Light theme ============================= */
body[data-theme='light'] {
  --bg: #eef0f6;
  --text: #16161a;
  --text-2: #4a4a55;
  --text-3: #8a8a96;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.86);
  --line: rgba(0, 0, 0, 0.1);
  --line-soft: rgba(0, 0, 0, 0.06);
}
body[data-theme='light'] .hero-h1 {
  background: linear-gradient(120deg, #0a0a0c 20%, #3b2fd4 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
body[data-theme='light'] .card,
body[data-theme='light'] .stat,
body[data-theme='light'] .prov-row,
body[data-theme='light'] .topnav {
  background: rgba(255, 255, 255, 0.78);
}
body[data-theme='light'] .tab.active { color: #fff; }
body[data-theme='light'] body::before { opacity: 0.7; }

/* ============================== Responsive ============================== */
@media (max-width: 720px) {
  .ai-status,
  .brand-tag {
    display: none;
  }
  .content { padding: 80px 14px 60px; }
  .hero { padding: 56px 10px 44px; }
  .section { margin: 44px 0; }
}

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

/* ============================== Chat dialog ============================== */
.chat-box {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 372px;
  max-width: calc(100vw - 28px);
  height: 544px;
  max-height: calc(100vh - 44px);
  border-radius: 16px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 61;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--text-3, rgba(255, 255, 255, 0.1));
}
.chat-title { font-weight: 600; color: var(--text); }
.chat-model {
  font-size: 0.7rem;
  color: var(--text-2);
  background: rgba(124, 92, 255, 0.16);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: auto;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-close {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}
.chat-close:hover { color: var(--text); }

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg { display: flex; }
.chat-msg.me { justify-content: flex-end; }
.chat-msg.ai { justify-content: flex-start; }
.chat-bubble {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg.me .chat-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.ai .chat-bubble {
  background: rgba(127, 127, 127, 0.16);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-inputbar {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--text-3, rgba(255, 255, 255, 0.1));
}
.chat-input {
  flex: 1;
  resize: none;
  max-height: 120px;
  border-radius: 10px;
  border: 1px solid var(--text-3, rgba(255, 255, 255, 0.12));
  background: rgba(127, 127, 127, 0.08);
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  outline: none;
}
.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-3); }
.chat-send {
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.chat-send:disabled { opacity: 0.5; cursor: default; }

.chat-mode {
  border: 1px solid var(--text-3, rgba(255, 255, 255, 0.18));
  background: transparent;
  color: var(--text-2);
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 3px 9px;
  cursor: pointer;
  white-space: nowrap;
}
.chat-mode.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chat-apply {
  display: inline-block;
  margin-top: 8px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 7px 14px;
  cursor: pointer;
}
.chat-apply:disabled { opacity: 0.6; cursor: default; }
.chat-apply.chat-preview {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  margin-right: 8px;
}
.chat-mem {
  border: 1px solid var(--accent-soft, rgba(255, 255, 255, 0.18));
  background: transparent;
  color: var(--accent, #c9a96e);
  border-radius: 9px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 9px;
  cursor: pointer;
}
.chat-mem:hover { background: var(--accent-soft, rgba(255, 255, 255, 0.1)); }

/* 改前预览横幅：覆盖在内容区顶部，明确"这是预览、未保存" */
.preview-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: linear-gradient(90deg, #1a1206, #2a1d0a);
  border-bottom: 1px solid var(--accent, #c9a96e);
  box-shadow: 0 8px 30px -10px rgba(0, 0, 0, 0.6);
  font-size: 0.85rem;
}
.preview-banner .pv-label { color: #f5e8cf; font-weight: 600; flex: 1; }
.pv-btn {
  border: none;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 6px 14px;
  cursor: pointer;
}
.pv-keep { background: var(--accent, #c9a96e); color: #fff; }
.pv-exit { background: rgba(255, 255, 255, 0.12); color: #fff; }

@media (max-width: 720px) {
  .chat-box { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  .preview-banner { flex-wrap: wrap; gap: 8px; }
}

/* ===== AI 接管整站：导航按钮 + 悬浮入口 + 控制台 + 站点级横幅 ===== */
.btn-takeover {
  background: linear-gradient(135deg, #7c5cff, #22d3ee);
  color: #fff;
  border: none;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0 12px;
}
.btn-takeover:hover { filter: brightness(1.08); }

.ctl-fab {
  position: fixed;
  right: 16px;
  bottom: 92px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #7c5cff, #22d3ee);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 12px 30px -8px rgba(124, 92, 255, 0.6);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ctl-fab:hover { transform: scale(1.06); }

.ctl-panel {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: 380px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: rgba(18, 20, 28, 0.96);
  border: 1px solid rgba(124, 92, 255, 0.4);
  border-radius: 18px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  z-index: 60;
}
.ctl-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ctl-title { font-weight: 700; font-size: 0.95rem; margin-right: auto; }
.ctl-model { font-size: 0.7rem; color: #9aa3b2; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl-takeback {
  border: none;
  border-radius: 8px;
  background: rgba(255, 90, 90, 0.18);
  color: #ff9b9b;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 9px;
  cursor: pointer;
}
.ctl-close {
  border: none;
  background: transparent;
  color: #9aa3b2;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
}
.ctl-ctx {
  padding: 10px 14px;
  font-size: 0.74rem;
  color: #9aa3b2;
  background: rgba(124, 92, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ctl-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; }
.ctl-chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: transparent;
  color: #cdd3df;
  font-size: 0.72rem;
  padding: 4px 10px;
  cursor: pointer;
}
.ctl-chip:hover { border-color: var(--accent, #c9a96e); color: #fff; }
.ctl-log {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
}
.ctl-empty { color: #6b7280; font-size: 0.78rem; line-height: 1.6; }
.ctl-log-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 10px 12px;
}
.ctl-log-say { font-size: 0.82rem; color: #e7eaf0; line-height: 1.5; }
.ctl-log-meta { font-size: 0.68rem; color: #7b8494; margin-top: 6px; }
.ctl-undo {
  margin-top: 8px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #cfd5e1;
  font-size: 0.72rem;
  padding: 4px 10px;
  cursor: pointer;
}
.ctl-undo:hover { background: rgba(255, 255, 255, 0.16); }
.ctl-running { font-size: 0.8rem; color: #a9b0c0; padding: 2px 0; }
.ctl-inputbar { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.ctl-input {
  flex: 1;
  resize: none;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #e7eaf0;
  font: inherit;
  font-size: 0.82rem;
  padding: 9px 11px;
}
.ctl-input:focus { outline: none; border-color: var(--accent, #c9a96e); }
.ctl-send {
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c5cff, #22d3ee);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0 14px;
  cursor: pointer;
}
.ctl-send:disabled { opacity: 0.6; cursor: default; }

/* 站点级"接管中"横幅：接管模式下常驻页面顶部 */
.takeover-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.95), rgba(34, 211, 238, 0.95));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 70;
  box-shadow: 0 4px 18px -6px rgba(124, 92, 255, 0.6);
}
.takeover-banner > span { margin-right: auto; }
.takeover-exit {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
}
.takeover-exit:hover { background: rgba(255, 255, 255, 0.24); }

@media (max-width: 720px) {
  .ctl-panel { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .ctl-fab { right: 14px; bottom: 150px; }
}

/* ===== 模块目标选择器（接管 / 命令台 / 聊天共用） ===== */
.ctl-modrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ctl-modlabel { font-size: 0.72rem; color: #9aa3b2; }
.ctl-modsel,
.cmd-modsel,
.chat-modsel {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.3);
  color: #e7eaf0;
  font: inherit;
  font-size: 0.74rem;
  padding: 4px 8px;
  cursor: pointer;
}
.ctl-modsel { flex: 1; }
.cmd-modsel { font-size: 0.72rem; padding: 3px 7px; }
.chat-modsel { font-size: 0.7rem; padding: 3px 6px; }
