:root {
  --bg-page: #f4f1ea;
  --bg-robot-pane: #0f1626;
  --bg-robot-card: #172136;
  --border-robot: rgba(255, 255, 255, 0.10);
  --text-light: #f1f5f9;
  --text-muted-light: #94a3b8;

  --bg-card: #ffffff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-soft: #e6e0d4;

  --accent-teal: #0d9488;
  --accent-amber: #f59e0b;
  --accent-rose: #e11d48;
  --accent-indigo: #4f46e5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg-page);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* Top Bar */
.topbar {
  background: #141c2f;
  color: var(--text-light);
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand .subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted-light);
}

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  transition: background 0.3s, box-shadow 0.3s;
}

.brand-dot.online {
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

.topbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pill-group {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.07);
  padding: 3px;
  border-radius: 999px;
  gap: 3px;
}

.ctrl-label {
  font-size: 12px;
  color: var(--text-muted-light);
  padding: 0 8px;
}

.age-btn {
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.age-btn.active {
  background: #38bdf8;
  color: #0f172a;
  font-weight: 600;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-demo-play {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #ffffff;
  border: none;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.btn-demo-play.playing {
  background: #e11d48;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35);
}

/* Split Stage */
.split-stage {
  flex: 1;
  display: grid;
  grid-template-columns: 44% 56%;
  min-height: calc(100vh - 60px);
}

@media (max-width: 860px) {
  .split-stage {
    grid-template-columns: 1fr;
  }
}

.pane {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.pane-robot {
  background: radial-gradient(circle at 50% 18%, #1e2943 0%, var(--bg-robot-pane) 70%);
  color: var(--text-light);
  border-right: 1px solid #0b101b;
}

.pane-parent {
  background: var(--bg-page);
}

.pane-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pane-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-dark {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-warm {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.trust-pill {
  margin-left: 6px;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

.model-chip {
  font-size: 11px;
  color: var(--text-muted-light);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 6px;
}

/* Robot Stage */
.robot-stage {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-robot);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.touch-sensor {
  position: relative;
  border: 1px dashed rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.08);
  color: #fde68a;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s, background 0.2s;
  user-select: none;
}

.touch-sensor:active,
.touch-sensor.pressing {
  transform: scale(0.97);
  background: rgba(251, 191, 36, 0.22);
}

.touch-ring {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(251, 191, 36, 0.35);
  transition: width 0.05s linear;
  pointer-events: none;
}

.touch-label {
  position: relative;
  z-index: 1;
}

.robot-body {
  position: relative;
  width: 268px;
  height: 268px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 抽象肢体意图动画 */
.robot-body.motion-lean_in {
  transform: scale(1.06) translateY(-4px);
}
.robot-body.motion-lean_in_slow {
  transform: scale(1.08) translateY(2px);
}
.robot-body.motion-nuzzle {
  animation: anim-nuzzle 1.2s ease-in-out;
}
.robot-body.motion-wiggle {
  animation: anim-wiggle 0.9s ease-in-out;
}
.robot-body.motion-cheer_bounce {
  animation: anim-bounce 1.0s ease-in-out;
}
.robot-body.motion-breath_calm {
  animation: anim-breath 4s ease-in-out infinite;
}

@keyframes anim-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-6deg) scale(1.02); }
  55% { transform: rotate(6deg) scale(1.03); }
  80% { transform: rotate(-3deg); }
}

@keyframes anim-nuzzle {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(4px) rotate(-4deg) scale(1.05); }
  75% { transform: translateY(2px) rotate(3deg) scale(1.05); }
}

@keyframes anim-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-14px) scale(1.06); }
  55% { transform: translateY(0) scale(0.98); }
  75% { transform: translateY(-7px) scale(1.03); }
}

@keyframes anim-breath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

.ws2812-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 41, 59, 0.9) 56%, rgba(15, 23, 42, 0.98) 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), inset 0 0 16px rgba(255, 255, 255, 0.06);
}

.led-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: background-color 0.25s, box-shadow 0.25s, opacity 0.25s;
}

.lcd-screen {
  position: relative;
  width: 198px;
  height: 198px;
  border-radius: 44px;
  background: #0b111e;
  border: 3px solid #243049;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.85);
}

#face-canvas {
  width: 194px;
  height: 194px;
}

.secret-badge {
  position: absolute;
  top: 10px;
  padding: 2px 9px;
  font-size: 11px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.22);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.speaking-wave {
  position: absolute;
  bottom: 12px;
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 14px;
}

.speaking-wave span {
  width: 3px;
  height: 6px;
  background: #38bdf8;
  border-radius: 3px;
  animation: wave 0.5s ease-in-out infinite alternate;
}
.speaking-wave span:nth-child(2) { animation-delay: 0.1s; }
.speaking-wave span:nth-child(3) { animation-delay: 0.2s; }
.speaking-wave span:nth-child(4) { animation-delay: 0.3s; }

@keyframes wave {
  from { height: 4px; }
  to { height: 14px; }
}

.hw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.hw-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 10px;
  cursor: pointer;
}

.hw-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.hw-btn.active {
  background: rgba(245, 158, 11, 0.24);
  border-color: #f59e0b;
  color: #fde68a;
}

.hw-btn.recording {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
  color: #fecaca;
}

/* Child Simulation Zone */
.child-sim-box {
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.child-sim-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.child-sim-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #93c5fd;
}

.child-sim-tip {
  font-size: 11px;
  color: var(--text-muted-light);
}

.chat-input-row input.flash-filled {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.28);
}

/* Quick Scenarios & Chat Feed */
.quick-scenarios {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.quick-label {
  font-size: 11px;
  color: var(--text-muted-light);
}

.chip-btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.pane-parent .chip-btn {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.chip-btn:hover {
  filter: brightness(1.08);
  border-color: #38bdf8;
}

.chat-feed {
  background: rgba(10, 15, 27, 0.65);
  border: 1px solid var(--border-robot);
  border-radius: 14px;
  padding: 10px 12px;
  height: 155px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble-row {
  display: flex;
  flex-direction: column;
  max-width: 88%;
}

.bubble-row.child {
  align-self: flex-end;
  align-items: flex-end;
}

.bubble-row.robot {
  align-self: flex-start;
  align-items: flex-start;
}

.bubble-meta {
  font-size: 10px;
  color: var(--text-muted-light);
  margin-bottom: 2px;
}

.bubble {
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.bubble-row.child .bubble {
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 3px;
}

.bubble-row.robot .bubble {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 3px;
}

.bubble.secret {
  border-color: rgba(245, 158, 11, 0.55) !important;
  background: rgba(120, 53, 15, 0.45) !important;
}

.chat-input-row {
  display: flex;
  gap: 8px;
}

.chat-input-row input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.chat-input-row input::placeholder {
  color: #94a3b8;
}

/* EmoScript Drawer */
.emoscript-drawer {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border-robot);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12px;
}

.emoscript-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  color: #cbd5e1;
}

.affect-pill {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.emo-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.emo-metrics > div {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.emo-metrics small {
  font-size: 10px;
  color: var(--text-muted-light);
}

.emo-metrics strong {
  font-size: 11px;
  color: #f8fafc;
  word-break: break-all;
}

.emo-json {
  margin: 8px 0 0;
  max-height: 110px;
  overflow: auto;
  background: #090d16;
  color: #93c5fd;
  padding: 8px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.35;
}

/* Right Pane: Parent Console */
.age-summary {
  margin-left: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.tab-bar {
  display: flex;
  gap: 6px;
}

.tab-btn {
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--text-dark);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--accent-teal);
  border-color: var(--accent-teal);
  color: #ffffff;
}

.count-badge {
  display: inline-block;
  margin-left: 4px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
}

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

.tab-panel.active {
  display: flex;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(30, 41, 59, 0.04);
}

.card h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.hint-tag {
  font-size: 11px;
  color: var(--accent-teal);
  background: #ccfbf1;
  padding: 3px 8px;
  border-radius: 999px;
}

.card-desc {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.parent-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.parent-input-row textarea {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

.btn-primary {
  background: var(--accent-teal);
  color: #ffffff;
  border: none;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-accent {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-accent:hover {
  background: #fde68a;
}

/* W1 Review Box */
.review-box {
  margin-top: 12px;
  border-radius: 12px;
  padding: 13px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.review-box.level-green { border-color: #86efac; background: #f0fdf4; }
.review-box.level-yellow { border-color: #fde047; background: #fefce8; }
.review-box.level-orange { border-color: #fdba74; background: #fff7ed; }
.review-box.level-red { border-color: #fca5a5; background: #fef2f2; }

.review-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.psych-badge {
  font-size: 11px;
  font-weight: 600;
  background: #e0e7ff;
  color: #3730a3;
  padding: 3px 9px;
  border-radius: 999px;
}

.review-preview {
  margin: 8px 0;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.85);
  border-left: 3px solid var(--accent-teal);
  border-radius: 6px;
  font-size: 12.5px;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.course-fold {
  margin-top: 8px;
  font-size: 11.5px;
  color: #64748b;
}

/* Pending Intent List */
.intent-list, .alert-list, .topic-cards, .memory-list, .jev-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intent-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fafafa;
}

.intent-item.status-frozen_by_emotion {
  border-color: #fdba74;
  background: #fff7ed;
}

.intent-item.status-woven_into_chat {
  border-color: #93c5fd;
  background: #eff6ff;
}

.intent-item.status-completed {
  border-color: #86efac;
  background: #f0fdf4;
}

.intent-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.intent-status-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #e2e8f0;
}

.intent-item.status-frozen_by_emotion .intent-status-pill {
  background: #ffedd5;
  color: #c2410c;
}
.intent-item.status-woven_into_chat .intent-status-pill {
  background: #dbeafe;
  color: #1d4ed8;
}
.intent-item.status-completed .intent-status-pill {
  background: #dcfce7;
  color: #15803d;
}

/* Alerts */
.alert-item {
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
}

.alert-item.level-L2 {
  border-color: #fed7aa;
  background: #fff7ed;
}

.alert-item.level-L1 {
  border-color: #fde68a;
  background: #fefce8;
}

.guide-box {
  margin-top: 8px;
  background: #ffffff;
  border-left: 3px solid #e11d48;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: pre-line;
  line-height: 1.5;
}

/* Report Grid */
.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.duration-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}

.bar-row {
  display: grid;
  grid-template-columns: 78px 1fr 48px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.bar-track {
  height: 8px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
}

.subhead {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.mood-svg {
  width: 100%;
  height: 120px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.topic-card {
  border: 1px solid #e2e8f0;
  background: #fdfbf7;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12.5px;
}

.memory-item, .jev-item {
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.memory-item.secret {
  background: #fffbeb;
  border-color: #fde68a;
}

.empty-tip {
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 0;
  text-align: center;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #f8fafc;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 999;
}

/* Modal & Artwork Pad */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-card {
  background: #ffffff;
  color: var(--text-dark);
  border-radius: 18px;
  width: 100%;
  max-width: 440px;
  padding: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-head h3 {
  margin: 0;
  font-size: 15px;
}

.btn-ghost-dark {
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
}

.modal-tip {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.art-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.color-dot.active {
  border-color: #0f172a;
  transform: scale(1.15);
}

.art-canvas {
  width: 100%;
  height: 220px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
}

.art-footer {
  display: flex;
  gap: 8px;
}

.art-footer input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12.5px;
}

.artwork-gallery {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.artwork-item {
  display: flex;
  gap: 10px;
  background: #fdfbf7;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  align-items: center;
}

.artwork-item img {
  width: 72px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
}


/* ---------- v3.2 声纹认主、4层VAD防打断与家庭成员记忆库样式 ---------- */
.owner-pill {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}

.hw-btn-highlight {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.35), rgba(37, 99, 235, 0.35)) !important;
  border-color: rgba(56, 189, 248, 0.55) !important;
  color: #e0f2fe !important;
  font-weight: 700;
}

.voice-guard-box {
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 14px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.voice-guard-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.vg-label {
  font-size: 11px;
  font-weight: 700;
  color: #6ee7b7;
  min-width: 110px;
}

.voice-guard-status {
  font-size: 11.5px;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.14);
  border-left: 3px solid #10b981;
  color: #d1fae5;
  line-height: 1.35;
}

.voice-guard-status.blocked {
  background: rgba(244, 63, 94, 0.16);
  border-left-color: #f43f5e;
  color: #ffe4e6;
}

.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 10px;
}

.person-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.person-card.active-owner {
  background: #ecfdf5;
  border-color: #0d9488;
}

.person-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.person-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.person-role-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
}

.person-role-tag.parent {
  background: #ffedd5;
  color: #c2410c;
}

.person-meta-line {
  font-size: 11.5px;
  color: #334155;
  line-height: 1.4;
}

.person-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.layer-pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.layer-step {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.layer-step-core {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.layer-arrow {
  color: #94a3b8;
  font-weight: 700;
  font-size: 12px;
}

.voice-gate-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 270px;
  overflow-y: auto;
}

.vg-log-item {
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 12px;
}

.vg-log-item.allowed {
  border-left: 4px solid #10b981;
  background: #f0fdf4;
}

.vg-log-item.blocked {
  border-left: 4px solid #ef4444;
  background: #fef2f2;
}

.enroll-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.enroll-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.enroll-form-grid input,
.enroll-form-grid select,
.enroll-full-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12.5px;
}

.enroll-face-box {
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  padding: 9px 11px;
}


/* ---------- v3.3 纯语音无输入框交互区 & 连续对话状态条 ---------- */
.live-voice-panel {
  background: rgba(10, 15, 27, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.live-voice-panel.listening {
  border-color: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.22);
}

.live-voice-panel.speaking-user {
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.32);
}

.live-voice-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mic-wave-bars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
}

.mic-wave-bars span {
  display: block;
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: #64748b;
  transition: height 0.08s ease, background-color 0.15s ease;
}

.live-voice-panel.listening .mic-wave-bars span {
  background: #10b981;
}

.live-voice-panel.speaking-user .mic-wave-bars span {
  background: #38bdf8;
}

.live-voice-state {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.live-asr-preview {
  font-size: 13px;
  color: #fde047;
  background: rgba(250, 204, 21, 0.1);
  border-left: 3px solid #facc15;
  padding: 5px 9px;
  border-radius: 6px;
  line-height: 1.4;
}

.vad-wait-track {
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.vad-wait-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #10b981);
  transition: width 0.08s linear;
}

.voice-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.voice-action-art {
  padding: 10px 16px !important;
  font-size: 13px !important;
  border-radius: 12px !important;
}

.btn-continuous-mic {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-continuous-mic:hover {
  filter: brightness(1.08);
}

.btn-continuous-mic.active {
  background: linear-gradient(135deg, #059669, #0d9488);
  border-color: #34d399;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.48);
}

.mic-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e0f2fe;
}

.btn-continuous-mic.active .mic-dot {
  background: #fef08a;
  box-shadow: 0 0 8px #fde047;
  animation: micPulse 1.1s infinite ease-in-out;
}

@keyframes micPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.45); opacity: 0.55; }
}


/* ---------- v4.0 三库隔离、家长概括脱敏视图、独立高危预警原话快照与个人专属记忆检索样式 ---------- */
.btn-new-session {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: rgba(52, 211, 153, 0.55) !important;
  color: #a7f3d0 !important;
  font-weight: 700 !important;
}

.mem-rag-drawer {
  background: rgba(12, 22, 40, 0.82);
  border: 1px solid rgba(34, 211, 238, 0.34);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mem-rag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rag-ms-pill {
  background: rgba(34, 211, 238, 0.16);
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}

.mem-l1-bar {
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid #22d3ee;
  padding: 5px 8px;
  border-radius: 6px;
  line-height: 1.4;
}

.mem-hit-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mem-hit-item {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 11.5px;
  color: #e2e8f0;
  line-height: 1.38;
}

.mem-hit-item.guardrail {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fef3c7;
}

.mem-src-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  margin-right: 5px;
  background: rgba(56, 189, 248, 0.22);
  color: #bae6fd;
}

.mem-inspector-pool {
  margin-top: 6px;
  max-height: 155px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pool-fact-row {
  background: #090e1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  color: #cbd5e1;
}

.pool-fact-row.superseded {
  opacity: 0.58;
  text-decoration: line-through;
  border-style: dashed;
}

.pool-fact-row.archived {
  opacity: 0.45;
  text-decoration: line-through;
}

/* 右屏：库 ① 陪伴概括总结卡片 */
.digest-hero-card {
  border-color: #99f6e4;
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
}

.privacy-shield-pill {
  font-size: 11px;
  font-weight: 700;
  color: #0f766e;
  background: #ccfbf1;
  border: 1px solid #5eead4;
  padding: 3px 9px;
  border-radius: 999px;
}

.digest-vault-banner {
  background: #0f172a;
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.digest-summary-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.digest-mood-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.digest-mood-badge {
  font-size: 12.5px;
  font-weight: 700;
  color: #0d9488;
  background: #ecfdf5;
  padding: 3px 10px;
  border-radius: 999px;
}

.digest-updated {
  font-size: 11px;
  color: #64748b;
}

.digest-overall-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: #1e293b;
  font-weight: 500;
}

.digest-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.digest-sub-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.digest-domain-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.domain-pill {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.digest-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
  font-size: 12px;
  color: #334155;
}

/* 右屏：库 ② 高风险预警完整上下文对话快照框 */
.alert-context-box {
  margin-top: 8px;
  background: #fff1f2;
  border: 1px solid #fda4af;
  border-radius: 8px;
  padding: 9px 11px;
}

.alert-context-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #9f1239;
  margin-bottom: 6px;
}

.alert-turn-line {
  font-size: 12px;
  line-height: 1.48;
  padding: 3px 0;
  color: #1e293b;
  border-bottom: 1px dashed rgba(244, 63, 94, 0.16);
}

.alert-turn-line:last-child {
  border-bottom: none;
}

.alert-turn-line.trigger-turn {
  background: #ffe4e6;
  padding: 4px 6px;
  border-radius: 5px;
  font-weight: 600;
  color: #881337;
}

.alert-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.alert-item.status-false_alarm {
  opacity: 0.68;
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* 右屏：库 ③ 个人专属历史记忆资料与四源统计 */
.mem-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.mem-stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mem-stat-card small {
  font-size: 11px;
  color: #64748b;
}

.mem-stat-card strong {
  font-size: 14px;
  color: #0f172a;
}

.profile-edit-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.profile-edit-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.preset-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #64748b;
}

.profile-register-line {
  font-size: 12px;
  color: #0f766e;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 6px 10px;
  border-radius: 8px;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.profile-form-grid input,
.profile-extra-row input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12.5px;
  background: #ffffff;
}

.profile-extra-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
