:root {
  --bg-washi: #FFFCF6;
  --oatmeal: #F7F1E5;
  --linen: #EAE0D5;
  --rose: #D8A7B1;
  --sage: #C7D3C0;
  --glacier: #D4E4ED;
  --taro: #DFD3E8;
  --butter: #FAF0CA;
  --seasalt: #ECEFF1;
  --peach: #F8D8C8;
  --mint: #D1EDE8;

  --ink-main: #3A3632;
  --ink-muted: #7C756D;
  --border-soft: rgba(58, 54, 50, 0.12);
  --panel-bg: rgba(255, 252, 246, 0.88);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-washi);
  color: var(--ink-main);
  font-family: 'Noto Serif SC', 'Noto Sans TC', sans-serif;
  -webkit-font-smoothing: antialiased;
}

#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  cursor: grab;
}
#canvas-container:active {
  cursor: grabbing;
}

/* 顶部栏 */
.top-bar {
  position: fixed;
  top: 16px;
  left: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.brand-cluster, .status-cluster {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 8px 16px;
}

.brand-signature {
  font-family: 'Bonheur Royale', cursive;
  font-size: 30px;
  line-height: 1;
  color: var(--ink-main);
}

.brand-sub {
  font-family: 'Playfair Display', serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  transition: all 0.35s ease;
}

.pill.mode-life {
  background: var(--sage);
  color: #2E3A2B;
}

.pill.mode-focus {
  background: var(--glacier);
  color: #223542;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.weather-group {
  display: flex;
  gap: 4px;
  background: var(--oatmeal);
  padding: 3px;
  border-radius: 999px;
}

.city-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-family: inherit;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.25s ease;
}

.city-btn.active {
  background: var(--bg-washi);
  color: var(--ink-main);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.weather-badge {
  font-size: 12px;
  color: var(--ink-muted);
}

/* 左侧分身名片坞 */
.agents-dock {
  position: fixed;
  left: 20px;
  top: 84px;
  z-index: 10;
  width: 158px;
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 12px;
}

.dock-title {
  font-family: 'Playfair Display', serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.agent-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agent-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(247, 241, 229, 0.55);
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 12px;
}

.agent-chip:hover {
  background: var(--oatmeal);
  border-color: var(--border-soft);
  transform: translateX(2px);
}

.agent-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(58, 54, 50, 0.2);
  flex-shrink: 0;
}

/* 右侧互动抽屉 */
.side-drawer {
  position: fixed;
  right: 20px;
  top: 84px;
  bottom: 88px;
  width: 310px;
  z-index: 10;
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border-soft);
  background: var(--oatmeal);
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 10px 4px;
  font-size: 11.5px;
  font-family: inherit;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--bg-washi);
  color: var(--ink-main);
  font-weight: 500;
}

.tab-pane {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

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

.pane-hint {
  font-size: 11px;
  color: var(--ink-muted);
  padding: 8px 14px;
  background: rgba(234, 224, 213, 0.35);
  border-bottom: 1px solid var(--border-soft);
}

.scroll-feed {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-card {
  background: #FFFFFF;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.55;
  animation: fadeSlide 0.3s ease;
}

.log-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.dm-card {
  background: rgba(248, 216, 200, 0.22);
  border: 1px solid rgba(216, 167, 177, 0.35);
}

.rel-card {
  background: var(--oatmeal);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
}

.rel-bar-bg {
  height: 5px;
  background: rgba(58, 54, 50, 0.1);
  border-radius: 999px;
  margin-top: 6px;
  overflow: hidden;
}

.rel-bar-fill {
  height: 100%;
  background: var(--rose);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* 设置面板 */
.settings-box {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  font-size: 12px;
  color: var(--ink-muted);
}

.input-clean {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: #FFFFFF;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink-main);
}

.api-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hidden {
  display: none !important;
}

/* 底部输入台 */
.command-dock {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  width: min(640px, calc(100% - 40px));
}

.command-inner {
  display: flex;
  gap: 10px;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(58, 54, 50, 0.06);
}

.command-inner input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink-main);
  padding: 6px 8px;
  outline: none;
}

.btn-primary {
  border: none;
  background: var(--ink-main);
  color: var(--bg-washi);
  padding: 9px 18px;
  border-radius: 11px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-outline {
  border: 1px solid var(--border-soft);
  background: var(--bg-washi);
  color: var(--ink-main);
  padding: 7px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.btn-ghost {
  border: 1px dashed var(--border-soft);
  background: transparent;
  color: var(--ink-muted);
  padding: 8px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
}

.full-width {
  width: 100%;
}

/* 会议室弹窗 */
.war-room-modal {
  position: fixed;
  inset: 76px 350px 88px 196px;
  z-index: 15;
  background: rgba(255, 252, 246, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(58, 54, 50, 0.09);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--glacier);
  border-bottom: 1px solid var(--border-soft);
}

.modal-tag {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #2B4252;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 500;
  margin-top: 2px;
}

.war-room-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
  padding: 16px 20px;
  overflow-y: auto;
}

.debate-column, .plans-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-card {
  background: #FFFFFF;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px;
}

.plan-card.recommended {
  border-color: #7E9A76;
  background: rgba(199, 211, 192, 0.16);
}

.vote-map {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-soft);
}

.vote-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
}

/* 详情气泡 */
.inspector-toast {
  position: fixed;
  left: 196px;
  bottom: 88px;
  z-index: 14;
  width: 280px;
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.5;
}

.toast-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.toast-head button {
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink-muted);
}

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

@media (max-width: 960px) {
  .agents-dock { display: none; }
  .side-drawer { width: 260px; }
  .war-room-modal { inset: 72px 16px 84px 16px; }
  .war-room-body { grid-template-columns: 1fr; }
}