/* ============================================================
   AI Beam Teaching System — 深色科技风 UI
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-gradient: linear-gradient(135deg, #070b14 0%, #0d1424 50%, #091018 100%);
  --surface: rgba(15, 23, 42, 0.78);
  --surface-solid: #0f172a;
  --surface-2: rgba(30, 41, 59, 0.5);
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --line: rgba(51, 65, 85, 0.6);
  --line-solid: #334155;
  --blue: #06b6d4;
  --blue-2: #22d3ee;
  --blue-soft: rgba(6, 182, 212, 0.12);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.12);
  --gold: #f59e0b;
  --gold-soft: rgba(245, 158, 11, 0.12);
  --red: #f43f5e;
  --red-soft: rgba(244, 63, 94, 0.12);
  --accent-glow: 0 0 20px rgba(6, 182, 212, 0.12);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ---- 滚动条 ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.35);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.55);
}

/* ---- 表单基础 ---- */
button,
input,
select,
textarea {
  font: inherit;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  color: #fff;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 700;
  transition: all var(--transition);
  box-shadow: 0 2px 12px rgba(6, 182, 212, 0.25);
}

button:hover {
  background: linear-gradient(135deg, #0e7490, #0891b2);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 1px 6px rgba(6, 182, 212, 0.2);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.75);
  outline-offset: 2px;
}

button.secondary {
  background: rgba(51, 65, 85, 0.55);
  color: #cbd5e1;
  box-shadow: none;
  border: 1px solid rgba(71, 85, 105, 0.5);
}

button.secondary:hover {
  background: rgba(71, 85, 105, 0.6);
  color: #e2e8f0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--blue-2);
  text-decoration: underline;
}

/* ---- 顶部导航栏 ---- */
.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  color: #fff;
  padding: 8px 18px;
  font-weight: 800;
  transition: all var(--transition);
  box-shadow: 0 2px 12px rgba(6, 182, 212, 0.25);
}

.nav-button:hover {
  background: linear-gradient(135deg, #0e7490, #0891b2);
  text-decoration: none;
  box-shadow: 0 4px 24px rgba(6, 182, 212, 0.4);
  transform: translateY(-1px);
}

.secondary-link {
  background: rgba(51, 65, 85, 0.55);
  color: #cbd5e1;
  box-shadow: none;
  border: 1px solid rgba(71, 85, 105, 0.5);
}

.secondary-link:hover {
  background: rgba(71, 85, 105, 0.6);
  color: #e2e8f0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 112px;
  padding: 18px 28px;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
  background: linear-gradient(135deg, #e2e8f0, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-field {
  min-width: 150px;
}

.mobile-tabs {
  display: none;
}

/* ======== 总引导首页 ======== */
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.home-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(6, 182, 212, 0.07), transparent 28%),
    linear-gradient(225deg, rgba(16, 185, 129, 0.05), transparent 32%),
    var(--bg-gradient);
}

.boot-sequence {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 44%, rgba(6, 182, 212, 0.14), transparent 34%),
    linear-gradient(180deg, #030712 0%, #07111f 100%);
  animation: bootExit 3.2s ease forwards;
  pointer-events: none;
}

.boot-sequence::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.12) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0;
  animation: bootGrid 2.7s ease forwards;
}

.boot-panel {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  min-width: min(420px, calc(100vw - 36px));
  padding: 30px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.54);
  box-shadow: 0 0 70px rgba(6, 182, 212, 0.16), inset 0 0 34px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
  animation: bootPanel 2.5s ease forwards;
}

.boot-emblem {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 1px solid rgba(34, 211, 238, 0.36);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.28);
}

.boot-emblem svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: var(--blue-2);
  stroke-width: 1.8;
}

.boot-title {
  color: #e2e8f0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.boot-line {
  width: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.82);
}

.boot-line::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transform-origin: left;
  animation: bootLoad 2.15s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.boot-status {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  min-height: min(520px, 72vh);
  padding: 54px clamp(18px, 5vw, 72px) 34px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.12) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, #000, transparent 82%);
  pointer-events: none;
}

.home-hero-content,
.home-orbit {
  position: relative;
  z-index: 1;
}

.home-hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 920px;
}

.home-hero h1 {
  max-width: 860px;
  font-size: clamp(34px, 5.4vw, 68px);
  line-height: 1.05;
}

.home-lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: #b7c5d7;
  font-size: 18px;
  line-height: 1.75;
}

.button-icon {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-orbit {
  align-self: center;
  justify-self: center;
  position: relative;
  width: min(280px, 36vw);
  aspect-ratio: 1;
}

.orbit-ring,
.orbit-core {
  position: absolute;
  border-radius: 50%;
}

.orbit-ring {
  inset: 10%;
  border: 1px solid rgba(34, 211, 238, 0.22);
  box-shadow: inset 0 0 34px rgba(6, 182, 212, 0.08), 0 0 30px rgba(6, 182, 212, 0.08);
}

.orbit-ring-one {
  animation: orbSpin 18s linear infinite;
}

.orbit-ring-two {
  inset: 23%;
  border-style: dashed;
  border-color: rgba(16, 185, 129, 0.28);
  animation: orbSpinReverse 22s linear infinite;
}

.orbit-core {
  inset: 34%;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(34, 211, 238, 0.3);
  box-shadow: 0 0 40px rgba(6, 182, 212, 0.22), inset 0 0 24px rgba(255, 255, 255, 0.06);
}

.orbit-core svg {
  width: 42%;
  height: 42%;
  fill: none;
  stroke: var(--blue-2);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: orbitSvgPulse 3s ease-in-out infinite;
}

/* === 首页轨道球增强动效 === */

.home-orbit {
  animation: orbitFloat 4s ease-in-out infinite;
}

.home-orbit::before {
  content: "";
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.06), transparent 62%);
  animation: orbitGlowPulse 3.2s ease-in-out infinite;
  pointer-events: none;
}

.orbit-core {
  overflow: hidden;
}

.orbit-core::before {
  content: "";
  position: absolute;
  inset: -40%;
  border-radius: 50%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 38%,
    rgba(34, 211, 238, 0.12) 44%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(34, 211, 238, 0.12) 56%,
    transparent 62%,
    transparent 100%
  );
  animation: orbitCoreScan 3.8s ease-in-out infinite;
}

@keyframes orbitFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes orbitGlowPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes orbitCoreScan {
  0% { transform: translateY(-100%); }
  50% { transform: translateY(100%); }
  100% { transform: translateY(-100%); }
}

@keyframes orbitSvgPulse {
  0%, 100% { opacity: 0.7; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

.home-main {
  display: grid;
  gap: 18px;
  padding: 22px clamp(14px, 4vw, 42px) 42px;
}

.home-section {
  display: grid;
  gap: 16px;
}

.home-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.home-section h2,
.agent-entry h2 {
  margin: 0;
  color: #e2e8f0;
  font-size: 26px;
}

.home-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--blue-2);
  background: rgba(6, 182, 212, 0.08);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.module-card,
.agent-entry {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 18px;
  min-height: 260px;
  border: 1px solid rgba(51, 65, 85, 0.66);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.62));
  padding: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.module-card::before,
.agent-entry::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), transparent 34%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.module-card.is-live {
  border-color: rgba(6, 182, 212, 0.34);
}

.module-card.is-live:hover::before,
.agent-entry:hover::before {
  opacity: 1;
}

.module-card.is-disabled {
  opacity: 0.72;
}

.module-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.08);
  color: var(--blue-2);
}

.module-card.is-disabled .module-icon {
  color: #64748b;
  border-color: rgba(100, 116, 139, 0.34);
  background: rgba(51, 65, 85, 0.24);
}

.module-icon svg,
.module-status svg,
.module-action svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-copy {
  position: relative;
  display: grid;
  gap: 10px;
}

.module-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.module-status svg {
  width: 14px;
  height: 14px;
}

.module-status.live {
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.22);
  background: var(--green-soft);
}

.module-status.pending {
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.25);
  background: rgba(51, 65, 85, 0.24);
}

.module-card h3,
.agent-entry h2 {
  margin: 0;
}

.module-card h3 {
  color: #e2e8f0;
  font-size: 20px;
}

.module-card p,
.agent-entry p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.module-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid rgba(6, 182, 212, 0.28);
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.1);
  color: var(--blue-2);
  padding: 8px 12px;
  font-weight: 900;
  box-shadow: none;
}

.module-action:hover {
  text-decoration: none;
}

.module-action svg {
  width: 18px;
  height: 18px;
}

.module-action:disabled {
  cursor: not-allowed;
  color: #64748b;
  border-color: rgba(100, 116, 139, 0.22);
  background: rgba(51, 65, 85, 0.18);
  box-shadow: none;
  transform: none;
}

.agent-entry-section {
  margin-top: 4px;
}

.agent-entry {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: 172px;
}

.agent-entry-icon {
  width: 72px;
  height: 72px;
}

.agent-entry-icon svg {
  width: 34px;
  height: 34px;
}

.agent-entry-action {
  min-width: 150px;
}

.compact-field input,
.compact-field select {
  height: 38px;
}

/* ---- 主布局 ---- */
.app-shell {
  display: grid;
  grid-template-columns: 330px minmax(520px, 1fr) 380px;
  gap: 16px;
  padding: 16px;
}

.experiment-shell {
  grid-template-columns: 330px minmax(520px, 1fr);
}

/* ---- 面板 ---- */
.panel,
.visual-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.panel:hover,
.visual-panel:hover {
  border-color: rgba(6, 182, 212, 0.2);
  box-shadow: var(--shadow), var(--accent-glow);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
}

.panel section,
.visual-panel {
  padding: 14px;
}

.controls-panel,
.ai-panel {
  align-self: start;
  max-height: calc(100vh - 144px);
  overflow-y: auto;
  overflow-x: hidden;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

h2 {
  margin: 0 0 10px;
  color: #cbd5e1;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: 0;
}

.section-head h2 {
  margin-bottom: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid rgba(6, 182, 212, 0.2);
  transition: all var(--transition);
}

.status-pill.ok {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.25);
}

.status-pill.warn {
  background: var(--gold-soft);
  color: var(--gold);
  border-color: rgba(245, 158, 11, 0.25);
}

/* ---- 表单控件 ---- */
label {
  display: grid;
  gap: 6px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
  transition: all var(--transition);
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18), 0 0 16px rgba(6, 182, 212, 0.1);
}

/* ---- 滑块 ---- */
input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(51, 65, 85, 0.6);
  border-radius: 999px;
  outline: none;
  transition: background var(--transition);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  cursor: pointer;
  border: 2px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
  transition: all var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.5);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  cursor: pointer;
  border: 2px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.range-with-number {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
}

.unit-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
  transition: all var(--transition);
}

.unit-input input {
  height: 36px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 8px 6px 8px 9px;
}

.unit-input input:focus {
  box-shadow: none;
}

.unit-input:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18), 0 0 16px rgba(6, 182, 212, 0.1);
}

.unit-input span {
  padding-right: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.distance-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
  align-items: end;
}

.distance-field label {
  min-width: 0;
}

.support-position-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
  backdrop-filter: blur(8px);
}

.support-position-panel[hidden] {
  display: none;
}

#sectionHeightField[hidden],
#sectionThicknessField[hidden] {
  display: none;
}

/* ---- 截面预览 ---- */
.section-preview {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
  backdrop-filter: blur(8px);
}

.section-preview canvas {
  height: 170px;
  background: rgba(15, 23, 42, 0.5);
}

.section-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.disabled-field {
  opacity: 0.56;
}

.disabled-field input {
  cursor: not-allowed;
}

.control-grid,
.two-col {
  display: grid;
  gap: 12px;
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

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

.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 8px;
  background: var(--surface-2);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 8px;
  font-weight: 700;
  transition: all var(--transition);
}

.check-grid label:hover {
  border-color: rgba(6, 182, 212, 0.3);
}

/* ---- 载荷工具箱 ---- */
.load-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.load-tools button {
  min-width: 0;
  padding-inline: 10px;
}

.loads-list {
  display: grid;
  gap: 8px;
}

.load-item {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 9px;
  transition: all var(--transition);
}

.load-item:hover {
  border-color: rgba(6, 182, 212, 0.25);
}

.load-item.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15), 0 0 16px rgba(6, 182, 212, 0.08);
}

.load-select {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-height: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  box-shadow: none;
}

.load-select:hover {
  background: transparent;
  color: var(--blue);
  box-shadow: none;
  transform: none;
}

.load-select strong,
.load-select span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.load-select span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.load-row-actions {
  display: flex;
  gap: 8px;
}

.mini-button {
  min-height: 30px;
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  color: #94a3b8;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
  transition: all var(--transition);
}

.mini-button:hover {
  background: rgba(51, 65, 85, 0.55);
  transform: none;
  box-shadow: none;
}

.mini-button.danger {
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--red);
}

.mini-button.danger:hover {
  background: var(--red-soft);
  border-color: rgba(244, 63, 94, 0.4);
}

.load-editor {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.compact-head {
  margin-bottom: 0;
}

.compact-head h3 {
  margin: 0;
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.25;
}

.full-button {
  width: 100%;
}

/* ---- 指标卡片 ---- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  min-height: 82px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.66));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  transition: all var(--transition);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.metric:hover {
  border-color: rgba(6, 182, 212, 0.25);
  box-shadow: var(--shadow), var(--accent-glow);
  transform: translateY(-2px);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.metric:nth-child(2n) strong {
  color: var(--blue-2);
}

.metric:nth-child(3n) strong {
  color: var(--green);
}

/* ---- 可视化区域 ---- */
.visual-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.primary-visual {
  min-height: 372px;
}

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(51, 65, 85, 0.4);
  border-radius: 8px;
  touch-action: none;
  transition: border-color var(--transition);
}

canvas:hover {
  border-color: rgba(6, 182, 212, 0.2);
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.wide-chart {
  grid-column: 1 / -1;
}

#liveHint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* ---- 反馈框 ---- */
.feedback-box {
  min-height: 170px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.5);
  padding: 12px;
  line-height: 1.55;
}

.feedback-box h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--blue);
}

.feedback-box ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.feedback-box li {
  margin: 6px 0;
}

.placeholder {
  color: var(--muted);
  margin: 0;
}

/* ---- 图片上传 ---- */
.image-upload-area {
  margin-top: 4px;
  margin-bottom: 2px;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px dashed rgba(100, 116, 139, 0.45);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--blue);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition);
  box-shadow: none;
}

.upload-btn:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
  transform: none;
}

.upload-btn svg {
  flex-shrink: 0;
}

.image-preview-card {
  margin-top: 6px;
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.5);
  overflow: hidden;
}

.preview-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(30, 41, 59, 0.6);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.preview-card-header svg {
  flex-shrink: 0;
  color: var(--blue);
}

.preview-card-label {
  flex: 1;
}

.remove-image-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px;
  border: 1px solid rgba(71, 85, 105, 0.5) !important;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5) !important;
  color: #94a3b8 !important;
  padding: 0 !important;
  cursor: pointer;
  font-size: 0;
  line-height: 0;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  box-shadow: none;
}

.remove-image-btn svg {
  color: inherit;
  width: 16px;
  height: 16px;
}

.remove-image-btn:hover {
  background: var(--red-soft) !important;
  border-color: rgba(244, 63, 94, 0.4) !important;
  color: var(--red) !important;
  box-shadow: none;
  transform: none;
}

.image-preview-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 35vh;
  object-fit: contain;
  background: rgba(15, 23, 42, 0.3);
}

.input-hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

/* ======== 智能体页面 ======== */
.agent-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 18% 12%, rgba(6, 182, 212, 0.08), transparent 40%),
    radial-gradient(ellipse at 86% 18%, rgba(16, 185, 129, 0.06), transparent 35%),
    radial-gradient(ellipse at 50% 80%, rgba(99, 102, 241, 0.05), transparent 50%),
    linear-gradient(180deg, #070b14 0%, #0d1424 100%);
}

.agent-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 112px;
  padding: 18px 24px;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.agent-shell {
  display: block;
  padding: 16px;
}

.agent-stage,
.agent-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}

.agent-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 1180px;
  min-height: calc(100vh - 144px);
  margin: 0 auto;
  overflow: hidden;
}

.agent-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: start;
  max-height: calc(100vh - 144px);
  overflow: auto;
  padding: 14px;
}

.agent-panel section {
  padding: 14px;
  border: 1px solid rgba(51, 65, 85, 0.4);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.45);
}

.agent-status-strip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.conversation-frame {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ---- Thinking 动画 ---- */
.thinking-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  min-height: 48px;
}

.thinking-text {
  color: var(--blue);
  font-weight: 700;
  font-size: 14px;
  animation: thinkTextPulse 2s ease-in-out infinite;
}

.thinking-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.thinking-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-2);
  opacity: 0.3;
  animation: thinkDot 1.2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.3);
}

.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinkDot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

@keyframes thinkTextPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ---- 对话 ---- */
.conversation-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 18px 18px 230px;
  background:
    linear-gradient(180deg, rgba(6, 182, 212, 0.035), transparent 32%),
    radial-gradient(ellipse at 50% 100%, rgba(16, 185, 129, 0.035), transparent 45%);
}

.message-row {
  display: flex;
  animation: msgFadeIn 0.35s ease-out;
}

@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.assistant {
  justify-content: flex-start;
}

.message-bubble {
  max-width: min(720px, 86%);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.55);
  padding: 12px 14px;
  line-height: 1.65;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  position: relative;
  overflow-wrap: anywhere;
}

.message-row.assistant .message-bubble {
  border-left: 3px solid var(--blue);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.06), rgba(15, 23, 42, 0.55));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(6, 182, 212, 0.05);
}

.message-row.user .message-bubble {
  border: 1px solid rgba(6, 182, 212, 0.2);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14), rgba(8, 145, 178, 0.08));
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.1), 0 4px 16px rgba(0, 0, 0, 0.2);
}

.message-bubble h3 {
  margin: 0 0 8px;
  color: var(--blue-2);
  font-size: 16px;
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.25);
}

.message-bubble ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.message-bubble p {
  color: #cbd5e1;
}

.message-bubble li {
  color: #cbd5e1;
}

.agent-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.agent-composer {
  position: sticky;
  bottom: 0;
  z-index: 8;
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: rgba(7, 11, 20, 0.9);
  padding: 12px;
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
}

.composer-head,
.composer-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.composer-head {
  justify-content: space-between;
}

.agent-composer textarea {
  min-height: 70px;
  max-height: 118px;
}

.composer-tools {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.compact-upload {
  min-height: 36px;
  padding: 7px 12px;
}

.compact-toggle {
  margin-top: 0;
  min-height: 36px;
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.5);
  padding: 7px 10px;
}

.compact-preview {
  max-width: 360px;
  justify-self: end;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.context-summary {
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.45);
  padding: 10px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.55;
}

/* ---- 全息语音球（6.0 高级美学版） ---- */
/* 配色理念：紫罗兰 × 靛蓝 × 柔金 — 冷静高级，科技感不减 */

.conversation-orb-dock {
  position: absolute;
  left: 50%;
  bottom: 62px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 210px;
  height: 200px;
  transform: translateX(-50%);
  pointer-events: none;
}

.voice-orb {
  --orb-accent: 94, 205, 215;
  --orb-accent-2: 125, 220, 190;
  --orb-warm: 246, 196, 112;
  position: relative;
  isolation: isolate;
  width: 160px;
  height: 160px;
  min-height: 160px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
  transform-style: preserve-3d;
  transition: filter 0.4s ease, transform 0.4s ease;
  animation: orbFloat 5s ease-in-out infinite;
}

.voice-orb:hover {
  background: transparent;
  box-shadow: none;
  filter: brightness(1.18) drop-shadow(0 0 36px rgba(94, 205, 215, 0.28));
  animation: orbFloatHover 3.5s ease-in-out infinite;
}

.voice-orb:active {
  filter: brightness(0.9);
}

/* === 地面投影 === */
.orb-shadow {
  position: absolute;
  bottom: -24px;
  left: 50%;
  width: 110px;
  height: 20px;
  margin-left: -55px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.35) 0%, transparent 70%);
  filter: blur(8px);
  animation: orbShadowFloat 5s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

.orb-scene-3d,
.orb-aura,
.orb-satellite-flow,
.orb-ring,
.orb-grid,
.orb-core,
.orb-depth,
.orb-shell,
.orb-caption,
.orb-particle-canvas {
  position: absolute;
  pointer-events: none;
}

/* === 场景容器（纯 2D 堆叠，无任何透视变形） === */
.orb-scene-3d {
  position: absolute;
  pointer-events: none;
  inset: 0;
  perspective: 520px;
  transform-style: preserve-3d;
}

/* === Canvas 粒子轨道层 === */
.orb-particle-canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 340px;
  height: 340px;
  transform: translate(-50%, -50%);
  border-radius: 0;
  z-index: 0;
  pointer-events: none;
  display: none;
  opacity: 1;
  filter: none;
  mask-image: radial-gradient(circle at 50% 50%, #000 0 58%, rgba(0, 0, 0, 0.72) 68%, transparent 84%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0 58%, rgba(0, 0, 0, 0.72) 68%, transparent 84%);
}

.orb-satellite-flow {
  left: 50%;
  top: 50%;
  z-index: 4;
  transform-style: preserve-3d;
  opacity: 0.88;
}

.orb-satellite-flow i {
  position: absolute;
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(var(--orb-accent-2), 0.9);
  box-shadow:
    0 0 8px rgba(var(--orb-accent-2), 0.65),
    0 0 18px rgba(var(--orb-accent), 0.28);
}

.orb-satellite-flow i::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 50%;
  width: 18px;
  height: 1px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(var(--orb-accent-2), 0.38));
}

.flow-a {
  width: 224px;
  height: 88px;
  margin: -44px 0 0 -112px;
  animation: satelliteFlowA 7.5s linear infinite;
}

.flow-b {
  width: 198px;
  height: 118px;
  margin: -59px 0 0 -99px;
  animation: satelliteFlowB 9.4s linear infinite;
  opacity: 0.74;
}

.flow-c {
  z-index: 8;
  width: 210px;
  height: 78px;
  margin: -39px 0 0 -105px;
  animation: satelliteFlowC 6.7s linear infinite;
  opacity: 0.86;
  mask-image: linear-gradient(180deg, transparent 0%, transparent 28%, #000 48%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, transparent 28%, #000 48%, #000 100%);
}

.flow-a i:nth-child(1) { left: 82%; top: 46%; width: 7px; height: 7px; background: rgba(246, 196, 112, 0.95); }
.flow-a i:nth-child(2) { left: 74%; top: 38%; width: 5px; height: 5px; opacity: 0.86; }
.flow-a i:nth-child(3) { left: 66%; top: 34%; opacity: 0.66; }
.flow-a i:nth-child(4) { left: 58%; top: 37%; width: 3px; height: 3px; opacity: 0.45; }
.flow-a i:nth-child(5) { left: 51%; top: 45%; width: 2px; height: 2px; opacity: 0.28; }
.flow-a i:nth-child(6) { left: 46%; top: 55%; width: 2px; height: 2px; opacity: 0.18; }
.flow-a i:nth-child(7) { left: 39%; top: 63%; width: 2px; height: 2px; opacity: 0.14; }
.flow-a i:nth-child(8) { left: 33%; top: 66%; width: 1px; height: 1px; opacity: 0.10; }

.flow-b i:nth-child(1) { left: 16%; top: 48%; width: 6px; height: 6px; }
.flow-b i:nth-child(2) { left: 24%; top: 39%; width: 4px; height: 4px; opacity: 0.78; }
.flow-b i:nth-child(3) { left: 32%; top: 35%; width: 3px; height: 3px; opacity: 0.55; }
.flow-b i:nth-child(4) { left: 41%; top: 39%; width: 2px; height: 2px; opacity: 0.34; }
.flow-b i:nth-child(5) { left: 48%; top: 48%; width: 2px; height: 2px; opacity: 0.20; }
.flow-b i:nth-child(6) { left: 55%; top: 58%; width: 2px; height: 2px; opacity: 0.14; }
.flow-b i:nth-child(7) { left: 61%; top: 64%; width: 1px; height: 1px; opacity: 0.10; }

.flow-c i:nth-child(1) { left: 78%; top: 54%; width: 6px; height: 6px; background: rgba(171, 154, 232, 0.92); }
.flow-c i:nth-child(2) { left: 70%; top: 60%; width: 4px; height: 4px; opacity: 0.78; }
.flow-c i:nth-child(3) { left: 62%; top: 61%; width: 3px; height: 3px; opacity: 0.56; }
.flow-c i:nth-child(4) { left: 55%; top: 57%; width: 2px; height: 2px; opacity: 0.34; }
.flow-c i:nth-child(5) { left: 49%; top: 49%; width: 2px; height: 2px; opacity: 0.22; }
.flow-c i:nth-child(6) { left: 43%; top: 41%; width: 2px; height: 2px; opacity: 0.15; }
.flow-c i:nth-child(7) { left: 38%; top: 35%; width: 1px; height: 1px; opacity: 0.10; }

/* === 外层光晕（紫罗兰色晕染） === */
.orb-aura {
  inset: -34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 30%, rgba(var(--orb-accent), 0.20), rgba(var(--orb-accent-2), 0.09) 30%, transparent 62%),
    radial-gradient(circle at 64% 72%, rgba(var(--orb-warm), 0.08), transparent 48%);
  filter: blur(30px) saturate(1.1);
  opacity: 0.62;
  animation: orbAuraPulse 4s ease-in-out infinite;
}

.orb-aura::after {
  content: "";
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  background:
    conic-gradient(from 120deg, transparent, rgba(var(--orb-accent-2), 0.12), transparent 34%, rgba(var(--orb-accent), 0.14), transparent 70%);
  filter: blur(14px);
  animation: orbAuraRotate 12s linear infinite;
  display: none;
}

.orb-ring {
  left: 50%;
  top: 50%;
  width: 176px;
  height: 74px;
  margin: -37px 0 0 -88px;
  border-radius: 50%;
  border: 1px solid rgba(var(--orb-accent-2), 0.30);
  box-shadow:
    0 0 18px rgba(var(--orb-accent), 0.18),
    inset 0 0 18px rgba(var(--orb-accent-2), 0.10);
  opacity: 0.62;
  transform-style: preserve-3d;
  display: none;
}

.orb-ring::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.42);
  border-right-color: rgba(var(--orb-accent-2), 0.16);
  opacity: 0.75;
}

.orb-ring-back {
  z-index: 1;
  transform: rotateX(67deg) rotateZ(-22deg) translateZ(-18px);
  opacity: 0.32;
  filter: blur(0.3px);
  animation: orbRingDriftBack 9s linear infinite;
}

.orb-ring-mid {
  z-index: 3;
  width: 160px;
  height: 92px;
  margin: -46px 0 0 -80px;
  transform: rotateX(74deg) rotateZ(18deg);
  opacity: 0.46;
  animation: orbRingDriftMid 11s linear infinite;
}

.orb-ring-front {
  z-index: 8;
  width: 184px;
  height: 78px;
  margin: -39px 0 0 -92px;
  border-bottom-color: rgba(255, 255, 255, 0.50);
  transform: rotateX(68deg) rotateZ(-17deg) translateZ(22px);
  animation: orbRingDriftFront 7s linear infinite;
  mask-image: linear-gradient(180deg, transparent 0%, transparent 38%, #000 52%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, transparent 38%, #000 52%, #000 100%);
}


/* === 内光晕装饰 === */
.voice-orb::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1px solid rgba(var(--orb-accent-2), 0.16);
  box-shadow:
    inset 0 0 30px rgba(var(--orb-accent), 0.10),
    0 0 30px rgba(var(--orb-accent), 0.12),
    0 0 68px rgba(var(--orb-accent-2), 0.08);
  pointer-events: none;
}

/* === 网格层 === */
.orb-grid {
  inset: 18px;
  border-radius: 50%;
  z-index: 4;
  opacity: 0.08;
  display: none;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 57%, rgba(255, 255, 255, 0.20) 58%, transparent 60%),
    repeating-radial-gradient(ellipse at 50% 50%, transparent 0 12px, rgba(var(--orb-accent-2), 0.18) 13px, transparent 14px),
    linear-gradient(rgba(var(--orb-accent-2), 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--orb-accent), 0.12) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 13px 13px, 13px 13px;
  mask-image: radial-gradient(circle, #000 42%, transparent 68%);
  -webkit-mask-image: radial-gradient(circle, #000 42%, transparent 68%);
  transform: rotateX(64deg) rotateZ(-9deg);
  animation: orbGridShift 6.5s linear infinite;
}

/* === 核心（纯 2D 球面光照，无任何透视变形） === */
.orb-core {
  --hl-x: 30%;
  --hl-y: 18%;
  inset: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background:
    /* 主高光（动态位置，球面漫反射模拟） */
    radial-gradient(circle at var(--hl-x) var(--hl-y), rgba(255, 255, 255, 0.60), rgba(255, 255, 255, 0.10) 18%, transparent 38%),
    /* 次高光泛光 */
    radial-gradient(circle at var(--hl-x) var(--hl-y), rgba(196, 181, 253, 0.10), transparent 50%),
    /* 背面环境补光 */
    radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.12), transparent 35%),
    /* 底部阴影 */
    radial-gradient(circle at 50% 92%, rgba(0, 0, 0, 0.40), transparent 32%),
    /* 环境基底 */
    radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.08), transparent 55%),
    /* 球面底色 */
    radial-gradient(circle at 50% 25%, rgba(30, 27, 75, 0.95), rgba(15, 23, 42, 0.98) 50%, rgba(49, 46, 129, 0.90) 80%);
  border: 1px solid rgba(196, 181, 253, 0.08);
  box-shadow:
    inset 0 20px 44px rgba(255, 255, 255, 0.08),
    inset 0 -18px 40px rgba(139, 92, 246, 0.18),
    inset 4px 0 18px rgba(99, 102, 241, 0.10),
    inset -4px 0 18px rgba(196, 181, 253, 0.08),
    0 0 40px rgba(99, 102, 241, 0.12),
    0 8px 30px rgba(0, 0, 0, 0.25);
}

/* === 扫描线 === */
.orb-core::before {
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 40%,
    rgba(196, 181, 253, 0.12) 46%,
    rgba(255, 255, 255, 0.10) 50%,
    rgba(196, 181, 253, 0.12) 54%,
    transparent 60%,
    transparent 100%
  );
  animation: holoScan 4s ease-in-out infinite;
  pointer-events: none;
}

/* === 内层光晕环 === */
.orb-core::after {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.04);
  animation: orbCoreRingPulse 3s ease-in-out infinite;
  pointer-events: none;
}

/* === 中心光点（明亮聚焦） === */
.orb-core {
  inset: 20px;
  z-index: 5;
  background:
    radial-gradient(circle at var(--hl-x) var(--hl-y), rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.16) 14%, transparent 30%),
    radial-gradient(circle at calc(var(--hl-x) + 16%) calc(var(--hl-y) + 8%), rgba(var(--orb-accent-2), 0.28), transparent 32%),
    radial-gradient(circle at 72% 22%, rgba(255, 255, 255, 0.10), transparent 24%),
    radial-gradient(circle at 72% 78%, rgba(var(--orb-accent), 0.26), transparent 36%),
    radial-gradient(circle at 46% 96%, rgba(0, 0, 0, 0.56), transparent 34%),
    radial-gradient(circle at 24% 72%, rgba(var(--orb-accent-2), 0.13), transparent 34%),
    radial-gradient(circle at 48% 36%, rgba(21, 92, 104, 0.78), rgba(13, 28, 38, 0.96) 52%, rgba(27, 42, 65, 0.92) 84%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 18px 22px 36px rgba(255, 255, 255, 0.10),
    inset -22px -28px 44px rgba(0, 0, 0, 0.50),
    inset -8px 0 28px rgba(var(--orb-accent), 0.23),
    inset 8px 0 24px rgba(var(--orb-accent-2), 0.15),
    0 0 24px rgba(var(--orb-accent-2), 0.18),
    0 16px 38px rgba(0, 0, 0, 0.42);
}

.orb-depth {
  inset: 0;
  border-radius: 50%;
  z-index: 1;
  background:
    radial-gradient(circle at 28% 22%, transparent 0 20%, rgba(255, 255, 255, 0.10) 21%, transparent 34%),
    linear-gradient(138deg, transparent 0 48%, rgba(255, 255, 255, 0.08) 49%, transparent 59%),
    radial-gradient(circle at 50% 52%, transparent 45%, rgba(0, 0, 0, 0.42) 78%, rgba(0, 0, 0, 0.68) 100%);
  mix-blend-mode: screen;
  opacity: 0.62;
}

.orb-shell {
  inset: 14px;
  z-index: 7;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle at 27% 18%, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.12) 16%, transparent 32%),
    radial-gradient(circle at 68% 20%, rgba(255, 255, 255, 0.14), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.20), transparent 28%, transparent 62%, rgba(var(--orb-accent-2), 0.16)),
    radial-gradient(circle at 50% 50%, transparent 54%, rgba(255, 255, 255, 0.22) 70%, rgba(var(--orb-accent), 0.30) 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 0 20px rgba(255, 255, 255, 0.10),
    inset 0 -22px 34px rgba(0, 0, 0, 0.22),
    0 0 32px rgba(var(--orb-accent), 0.12);
}

.orb-shell::before,
.orb-shell::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.orb-shell::before {
  left: 18%;
  top: 10%;
  width: 42%;
  height: 18%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.70), rgba(255, 255, 255, 0.06));
  filter: blur(1px);
  transform: rotate(-20deg);
}

.orb-shell::after {
  right: 12%;
  bottom: 13%;
  width: 48%;
  height: 30%;
  border: 1px solid rgba(var(--orb-accent-2), 0.22);
  border-top-color: transparent;
  filter: blur(0.2px);
}

.orb-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 28%, #ffffff 0%, #dcfffb 30%, #8adfd0 55%, transparent 80%);
  box-shadow:
    0 0 20px rgba(255, 255, 255, 0.7),
    0 0 38px rgba(125, 220, 190, 0.36),
    0 0 62px rgba(94, 205, 215, 0.16);
  z-index: 2;
  transition: opacity 0.3s ease;
  animation: orbDotPulse 2.5s ease-in-out infinite;
}

/* === 语音音量条 === */
.orb-bars {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  z-index: 3;
  transition: opacity 0.3s ease;
}

.orb-bars i {
  display: block;
  width: 4px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #a78bfa);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4), 0 0 6px rgba(167, 139, 250, 0.3);
  animation: voiceBar 0.5s ease-in-out infinite;
}

.orb-bars i:nth-child(2) { animation-delay: 0.08s; }
.orb-bars i:nth-child(3) { animation-delay: 0.16s; }

/* === 标签 === */
.orb-caption {
  left: 50%;
  bottom: -34px;
  transform: translateX(-50%);
  color: rgba(148, 163, 184, 0.45);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3em;
  white-space: nowrap;
  transition: color 0.5s ease;
}

.voice-orb:hover .orb-caption {
  color: rgba(196, 181, 253, 0.75);
}

/* ===== 各状态样式 ===== */
/* 配色映射：idle=紫罗兰, listening=翡翠绿(清醒), thinking=琥珀金(专注), speaking=靛蓝(流动), error=玫瑰红 */

/* idle — 待机 */
body[data-agent-state="idle"] .orb-core {
  animation: orbBreathe 4s ease-in-out infinite;
}

body[data-agent-state="idle"] .voice-orb::before {
  animation: idlePulse 3.5s ease-out infinite;
}

body[data-agent-state="idle"] .orb-caption {
  color: rgba(148, 163, 184, 0.4);
}

body[data-agent-state="idle"] .orb-dot {
  animation: orbDotPulse 2.5s ease-in-out infinite;
}

/* listening — 聆听（翡翠绿） */
body[data-agent-state="listening"] .voice-orb {
  animation: orbFloat 0.6s ease-in-out infinite;
}

body[data-agent-state="listening"] .orb-aura {
  background:
    radial-gradient(circle at 35% 30%, rgba(52, 211, 153, 0.15), rgba(16, 185, 129, 0.06) 40%, transparent 55%);
  filter: blur(24px);
  animation: orbAuraPulse 0.8s ease-in-out infinite;
}

body[data-agent-state="listening"] .voice-orb::before {
  border-color: rgba(52, 211, 153, 0.20);
  animation: listenPulse 0.6s ease-out infinite;
}

body[data-agent-state="listening"] .orb-core {
  animation: orbBreathe 0.7s ease-in-out infinite;
  box-shadow:
    inset 0 0 32px rgba(255, 255, 255, 0.06),
    inset 0 0 24px rgba(52, 211, 153, 0.20),
    0 0 36px rgba(52, 211, 153, 0.18);
}

body[data-agent-state="listening"] .orb-caption {
  color: rgba(52, 211, 153, 0.70);
}

body[data-agent-state="listening"] .orb-core::before {
  animation-duration: 1.5s;
}

body[data-agent-state="listening"] .orb-dot {
  animation: orbDotPulse 0.5s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(52, 211, 153, 0.4);
}

body[data-agent-state="listening"] .voice-orb {
  filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.2));
}

/* thinking — 思考（琥珀金） */
body[data-agent-state="thinking"] .voice-orb {
  animation: orbFloat 0.5s ease-in-out infinite;
}

body[data-agent-state="thinking"] .orb-aura {
  background:
    radial-gradient(circle at 35% 30%, rgba(251, 191, 36, 0.10), rgba(99, 102, 241, 0.06) 35%, transparent 55%);
  filter: blur(24px);
  animation: orbAuraPulse 0.6s ease-in-out infinite;
}

body[data-agent-state="thinking"] .voice-orb::before {
  border-color: rgba(251, 191, 36, 0.20);
  animation: thinkPulse 0.8s ease-out infinite;
}

body[data-agent-state="thinking"] .orb-core {
  animation: orbBreathe 0.8s ease-in-out infinite;
  box-shadow:
    inset 0 0 32px rgba(255, 255, 255, 0.08),
    inset 0 0 24px rgba(251, 191, 36, 0.15),
    0 0 32px rgba(251, 191, 36, 0.10);
}

body[data-agent-state="thinking"] .orb-core::before {
  animation-duration: 1.2s;
}

body[data-agent-state="thinking"] .orb-caption {
  color: rgba(251, 191, 36, 0.70);
}

body[data-agent-state="thinking"] .orb-dot {
  animation: orbDotPulse 0.4s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(251, 191, 36, 0.4);
}

body[data-agent-state="thinking"] .voice-orb {
  filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.15));
}

body[data-agent-state="thinking"] .orb-grid {
  animation-duration: 2s;
  animation-direction: reverse;
}

/* speaking — 朗读（保持主色靛蓝，更流动） */
body[data-agent-state="speaking"] .orb-dot {
  opacity: 0;
}

body[data-agent-state="speaking"] .orb-bars {
  opacity: 1;
}

body[data-agent-state="speaking"] .voice-orb::before {
  animation: listenPulse 1s ease-out infinite;
}

body[data-agent-state="speaking"] .orb-caption {
  color: rgba(196, 181, 253, 0.70);
}

body[data-agent-state="speaking"] .orb-grid {
  animation-duration: 1.5s;
}

body[data-agent-state="speaking"] .voice-orb {
  filter: drop-shadow(0 0 25px rgba(99, 102, 241, 0.25));
}

/* error — 错误（玫瑰红） */
body[data-agent-state="error"] .orb-aura {
  background:
    radial-gradient(circle at 35% 30%, rgba(244, 63, 94, 0.12), rgba(251, 113, 133, 0.04) 40%, transparent 55%);
  filter: blur(24px);
  animation: orbAuraPulse 0.5s ease-in-out infinite;
}

body[data-agent-state="error"] .orb-core {
  background:
    radial-gradient(circle at 32% 20%, rgba(255, 255, 255, 0.15), transparent 30%),
    radial-gradient(circle at 50% 50%, rgba(244, 63, 94, 0.08), transparent 55%),
    radial-gradient(circle at 45% 28%, rgba(60, 15, 30, 0.95), rgba(15, 23, 42, 0.98) 50%, rgba(80, 20, 40, 0.90) 80%);
  animation: orbBreathe 0.4s ease-in-out infinite;
  box-shadow:
    inset 0 6px 28px rgba(255, 255, 255, 0.04),
    0 0 36px rgba(244, 63, 94, 0.20);
}

body[data-agent-state="error"] .orb-caption {
  color: rgba(244, 63, 94, 0.60);
}

body[data-agent-state="error"] .orb-dot {
  animation: none;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.5);
}

/* ========= 关键帧 ========= */

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

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

@keyframes orbAuraPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 0.9; transform: scale(1.06); }
}

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

@keyframes orbGridShift {
  to { background-position: 10px 10px, -10px 0; }
}

@keyframes orbBreathe {
  0%, 100% { transform: scale(0.96); }
  50% { transform: scale(1.05); }
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes orbFloatHover {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes orbShadowFloat {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.5; }
  50% { transform: translateX(-50%) scale(0.85); opacity: 0.25; }
}

@keyframes orbDotPulse {
  0%, 100% { opacity: 0.75; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1.15); }
}


@keyframes orbCoreRingPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.75; }
}

/* 卫星 C 反缩放版脉冲（保留 scaleY(1.54)） */
@keyframes orbSatPulseC {
  0%, 100% { opacity: 0.6; transform: scaleY(1.54) scale(0.85); }
  50% { opacity: 1; transform: scaleY(1.54) scale(1.3); }
}

@keyframes orbFastOrbit {
  0%, 100% { transform: translate(-50%, -3px); }
  50% { transform: translate(-50%, 3px); }
}

@keyframes idlePulse {
  0% { transform: scale(0.9); opacity: 0.4; }
  100% { transform: scale(1.25); opacity: 0; }
}

@keyframes listenPulse {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.35); opacity: 0; }
}

@keyframes thinkPulse {
  0% { transform: scale(0.88); opacity: 0.5; border-color: rgba(251, 191, 36, 0.30); }
  50% { border-color: rgba(139, 92, 246, 0.20); }
  100% { transform: scale(1.35); opacity: 0; border-color: rgba(251, 191, 36, 0); }
}

@keyframes holoScan {
  0% { transform: translateY(-100%); }
  50% { transform: translateY(100%); }
  100% { transform: translateY(-100%); }
}

@keyframes voiceBar {
  0%, 100% { height: 12px; }
  50% { height: 28px; }
}

@keyframes bootExit {
  0%, 78% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}

@keyframes bootGrid {
  0% { opacity: 0; transform: scale(1.04); }
  25%, 78% { opacity: 0.28; }
  100% { opacity: 0; transform: scale(1); }
}

@keyframes bootPanel {
  0% { opacity: 0; transform: translateY(12px) scale(0.96); filter: blur(6px); }
  18%, 76% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translateY(-8px) scale(0.98); filter: blur(2px); }
}

@keyframes bootLoad {
  0% { transform: scaleX(0); }
  55% { transform: scaleX(0.72); }
  100% { transform: scaleX(1); }
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 12px 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  font-weight: 700;
  border: 1px solid rgba(6, 182, 212, 0.2);
  backdrop-filter: blur(16px);
  animation: toastIn 0.35s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ======== 响应式 ======== */
@media (max-width: 1280px) {
  .module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-shell {
    grid-template-columns: 300px minmax(440px, 1fr);
  }

  .ai-panel {
    grid-column: 1 / -1;
    max-height: none;
  }

  .controls-panel {
    max-height: none;
  }
}

@media (max-width: 900px) {
  body {
    font-size: 14px;
  }

  .topbar {
    position: relative;
    top: auto;
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 12px;
  }

  h1 {
    font-size: 24px;
  }

  .subtitle {
    font-size: 13px;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .home-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 34px 16px 22px;
  }

  .home-hero h1 {
    font-size: 34px;
  }

  .home-lead {
    font-size: 15px;
  }

  .home-orbit {
    width: min(180px, 60vw);
    min-height: 180px;
    align-self: center;
  }

  .home-section-head,
  .agent-entry {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .home-section-head {
    flex-direction: column;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .module-card {
    min-height: 220px;
  }

  .agent-entry {
    min-height: 0;
  }

  .agent-entry-action {
    width: 100%;
  }

  .mobile-tabs {
    position: sticky;
    top: 0;
    z-index: 15;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px 12px;
    background: rgba(7, 11, 20, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .mobile-tabs button {
    min-height: 36px;
    border: 1px solid rgba(71, 85, 105, 0.5);
    background: rgba(15, 23, 42, 0.65);
    color: #94a3b8;
    padding: 7px 10px;
    box-shadow: none;
  }

  .mobile-tabs button.active {
    border-color: var(--blue);
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: #fff;
    box-shadow: 0 2px 12px rgba(6, 182, 212, 0.25);
  }

  .app-shell {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  html[data-mobile-section="params"] [data-mobile-section="visual"],
  html[data-mobile-section="visual"] [data-mobile-section="params"] {
    display: none;
  }

  .agent-topbar {
    position: relative;
    top: auto;
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    padding: 12px;
  }

  .agent-shell {
    padding: 10px;
  }

  .agent-stage,
  .agent-panel {
    max-height: none;
    min-height: 0;
  }

  .agent-stage {
    min-height: calc(100vh - 116px);
    border-radius: 10px;
  }

  .agent-stage .conversation-frame {
    min-height: 0;
  }

  .agent-stage .agent-status-strip {
    padding: 8px 12px;
    font-size: 12px;
  }

  .agent-stage .agent-composer {
    padding: 8px 10px;
  }

  .agent-stage .agent-composer textarea {
    min-height: 52px;
    max-height: 90px;
    font-size: 14px;
  }

  .agent-panel {
    padding: 10px;
  }

  .agent-panel section {
    padding: 10px;
  }

  .agent-status-strip,
  .agent-action-row {
    grid-template-columns: 1fr;
  }

  .agent-status-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .message-bubble {
    max-width: 94%;
    padding: 10px 12px;
    font-size: 14px;
  }

  .conversation-list {
    padding: 12px 10px 195px;
  }

  .conversation-orb-dock {
    bottom: 40px;
    width: 160px;
    height: 155px;
  }

  .voice-orb {
    width: 120px;
    height: 120px;
    min-height: 120px;
  }

  .voice-orb:hover,
  .voice-orb:active {
    transform: none;
  }

  .orb-shadow {
    width: 90px;
    height: 18px;
    margin-left: -45px;
    bottom: -22px;
  }

  .orb-particle-canvas {
    width: 260px !important;
    height: 260px !important;
  }

  .orb-dot {
    width: 16px;
    height: 16px;
  }

  .orb-aura {
    inset: -36px;
  }

  .orb-grid {
    inset: 14px;
    background-size: 8px 8px;
  }

  .agent-composer {
    padding: 8px 10px 10px;
  }

  .agent-composer textarea {
    min-height: 56px;
    max-height: 100px;
    padding: 8px 10px;
    font-size: 15px;
  }

  .composer-head {
    margin-bottom: 2px;
  }

  .composer-head .input-hint {
    font-size: 12px;
  }

  .composer-tools {
    justify-content: stretch;
    gap: 6px;
  }

  .composer-tools button,
  .composer-tools .upload-btn,
  .composer-tools .compact-toggle {
    flex: 1 1 80px;
    min-height: 38px;
  }

  .composer-tools .compact-toggle {
    padding: 6px 8px;
    font-size: 13px;
    gap: 5px;
  }

  .compact-upload {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .conversation-frame {
    min-height: 0;
  }

  .panel {
    gap: 10px;
    padding: 10px;
  }

  .panel section,
  .visual-panel {
    padding: 10px;
  }

  .agent-page .agent-panel {
    margin-bottom: 0;
  }

  .controls-panel,
  .ai-panel {
    max-height: none;
  }

  /* Agent page stage full height on mobile */
  .agent-stage {
    min-height: calc(100vh - 110px);
    border-radius: 10px;
  }

  /* Improve spacing for experiment panels */
  .controls-panel > section {
    padding: 10px;
  }

  .control-grid {
    gap: 10px;
  }

  .control-grid label {
    font-size: 12px;
    gap: 4px;
  }

  .load-tools button {
    font-size: 13px;
    padding: 6px 8px;
    min-height: 34px;
  }

  .load-item {
    padding: 7px;
    font-size: 13px;
  }

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

  .metric {
    min-height: 64px;
    padding: 8px 10px;
  }

  .metric span {
    font-size: 11px;
  }

  .metric strong {
    font-size: 14px;
    margin-top: 4px;
  }

  .chart-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .visual-panel {
    padding: 8px;
  }

  .visual-panel h2 {
    font-size: 14px;
    margin-bottom: 6px;
  }

  #beamCanvas {
    aspect-ratio: 2.2 / 1;
  }

  #shearCanvas,
  #momentCanvas,
  #deflectionCanvas {
    aspect-ratio: 1.7 / 1;
  }

  .range-with-number,
  .distance-field {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .load-tools,
  .two-col {
    grid-template-columns: 1fr;
  }

  .primary-visual {
    min-height: 0;
  }

  #liveHint {
    font-size: 12px;
  }

  .section-preview canvas {
    height: auto;
    aspect-ratio: 30 / 17;
  }

  .feedback-box {
    max-height: none;
  }
}

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

  .boot-sequence {
    display: none;
  }
}

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

  .metric {
    min-height: 54px;
    padding: 8px;
  }

  .metric strong {
    font-size: 13px;
  }

  button,
  input,
  select,
  textarea {
    font-size: 14px;
  }

  .topbar,
  .agent-topbar {
    padding: 8px 10px;
  }

  .topbar h1,
  .agent-topbar h1 {
    font-size: 20px;
  }

  .conversation-list {
    padding: 10px 8px 175px;
  }

  .message-bubble {
    max-width: 97%;
    padding: 8px 10px;
    font-size: 13px;
  }

  .conversation-orb-dock {
    bottom: 34px;
    width: 140px;
    height: 135px;
  }

  .voice-orb {
    width: 100px;
    height: 100px;
    min-height: 100px;
  }

  .orb-shadow {
    width: 70px;
    height: 14px;
    margin-left: -35px;
    bottom: -18px;
  }

  .orb-particle-canvas {
    width: 220px !important;
    height: 220px !important;
  }

  .orb-core {
    inset: 18px;
  }

  .orb-dot {
    width: 14px;
    height: 14px;
  }

  .orb-caption {
    bottom: -26px;
    font-size: 10px;
  }

  .orb-grid {
    inset: 12px;
    background-size: 7px 7px;
  }

  .agent-composer textarea {
    min-height: 46px;
  }

  .composer-tools button,
  .composer-tools .upload-btn,
  .composer-tools .compact-toggle {
    flex: 1 1 60px;
    min-height: 34px;
    font-size: 12px;
  }

  .home-orbit {
    width: min(150px, 52vw);
    min-height: 150px;
  }

  .home-hero h1 {
    font-size: 28px;
  }

  .module-card {
    min-height: 180px;
    padding: 14px;
  }

  .section-preview canvas {
    height: auto;
    aspect-ratio: 30 / 17;
  }

  #beamCanvas {
    aspect-ratio: 1.8 / 1;
  }

  #shearCanvas,
  #momentCanvas,
  #deflectionCanvas {
    aspect-ratio: 1.5 / 1;
  }
}

body[data-agent-state="idle"] .voice-orb {
  --orb-accent: 94, 205, 215;
  --orb-accent-2: 125, 220, 190;
  --orb-warm: 246, 196, 112;
}

body[data-agent-state="listening"] .voice-orb {
  --orb-accent: 72, 196, 147;
  --orb-accent-2: 120, 222, 190;
  --orb-warm: 104, 205, 218;
}

body[data-agent-state="thinking"] .voice-orb {
  --orb-accent: 234, 177, 89;
  --orb-accent-2: 110, 201, 214;
  --orb-warm: 246, 196, 112;
}

body[data-agent-state="speaking"] .voice-orb {
  --orb-accent: 104, 184, 225;
  --orb-accent-2: 94, 205, 215;
  --orb-warm: 154, 170, 226;
}

body[data-agent-state="error"] .voice-orb {
  --orb-accent: 244, 63, 94;
  --orb-accent-2: 251, 113, 133;
  --orb-warm: 251, 191, 36;
}

.orb-ring {
  width: 110%;
  height: 46%;
  margin: -23% 0 0 -55%;
}

.orb-ring-mid {
  width: 100%;
  height: 58%;
  margin: -29% 0 0 -50%;
}

.orb-ring-front {
  width: 115%;
  height: 49%;
  margin: -24.5% 0 0 -57.5%;
}

@keyframes orbRingDriftBack {
  to { transform: rotateX(67deg) rotateZ(338deg) translateZ(-18px); }
}

@keyframes orbRingDriftMid {
  to { transform: rotateX(74deg) rotateZ(-342deg); }
}

@keyframes orbRingDriftFront {
  to { transform: rotateX(68deg) rotateZ(343deg) translateZ(22px); }
}

@keyframes satelliteFlowA {
  from { transform: rotateX(68deg) rotateZ(-24deg) translateZ(-8px); }
  to { transform: rotateX(68deg) rotateZ(336deg) translateZ(-8px); }
}

@keyframes satelliteFlowB {
  from { transform: rotateX(58deg) rotateY(18deg) rotateZ(132deg) translateZ(-16px); }
  to { transform: rotateX(58deg) rotateY(18deg) rotateZ(-228deg) translateZ(-16px); }
}

@keyframes satelliteFlowC {
  from { transform: rotateX(72deg) rotateZ(18deg) translateZ(18px); }
  to { transform: rotateX(72deg) rotateZ(378deg) translateZ(18px); }
}

.voice-orb .orb-ring {
  display: none !important;
  opacity: 0 !important;
}

@media (max-width: 760px) {
  .flow-a {
    width: 176px;
    height: 70px;
    margin: -35px 0 0 -88px;
  }

  .flow-b {
    width: 156px;
    height: 94px;
    margin: -47px 0 0 -78px;
  }

  .flow-c {
    width: 166px;
    height: 62px;
    margin: -31px 0 0 -83px;
  }

  .orb-satellite-flow i::after {
    width: 14px;
  }
}

@media (max-width: 420px) {
  .flow-a {
    width: 148px;
    height: 58px;
    margin: -29px 0 0 -74px;
  }

  .flow-b {
    width: 130px;
    height: 78px;
    margin: -39px 0 0 -65px;
  }

  .flow-c {
    width: 140px;
    height: 52px;
    margin: -26px 0 0 -70px;
  }

  .orb-satellite-flow i {
    transform: scale(0.82);
  }

  .orb-satellite-flow i::after {
    width: 11px;
  }
}
