/* AGI —— 界面样式
   原则：浅色不用白色渐变遮罩；任何内容都不产生横向滚动条 */

:root {
  --bg: #f2efe9;
  --surface: #fbfaf7;
  --surface-2: #f6f3ee;
  --surface-3: #eeebe4;
  --text: #1d1c1a;
  --text-soft: #4a463f;
  --muted: #78726a;
  --line: #e3ded4;
  --line-strong: #d3cdc1;
  --accent: #b45f3f;
  --accent-strong: #9a4c30;
  --accent-soft: rgba(180, 95, 63, 0.1);
  --accent-text: #fff8f4;
  --ok: #4f7d5a;
  --warn: #a8762c;
  --danger: #a9483d;
  --shadow: 0 1px 2px rgba(30, 26, 20, 0.05), 0 8px 24px rgba(30, 26, 20, 0.04);
  --shadow-lg: 0 20px 60px rgba(30, 26, 20, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #131312;
  --surface: #1b1a18;
  --surface-2: #21201d;
  --surface-3: #2a2825;
  --text: #ece7df;
  --text-soft: #c4beb4;
  --muted: #8d877d;
  --line: #2c2a26;
  --line-strong: #3a3732;
  --accent: #d97757;
  --accent-strong: #e89073;
  --accent-soft: rgba(217, 119, 87, 0.12);
  --accent-text: #1a1512;
  --ok: #7aa886;
  --warn: #d0a05a;
  --danger: #d07a6e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 全局防横向滚动 */
* { min-width: 0; }
p, pre, code, div, span, li { overflow-wrap: anywhere; word-break: break-word; }

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.orb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 1px var(--line), 0 2px 8px rgba(60, 30, 20, 0.12);
  animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.06); opacity: 1; }
}

.brand-text h1 {
  font-size: 15px;
  font-weight: 650;
  margin: 0;
  letter-spacing: 0.02em;
}

.brand-text p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
}

.top-status {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions { display: flex; gap: 8px; flex: none; }

#btn-view { display: none; }
.drawer-mask { display: none; }

/* ---------- 复盘横幅 ---------- */
.review-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 20px;
  font-size: 12.5px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-bottom: 1px solid var(--line);
  flex: none;
}

[data-theme="dark"] .review-banner { color: var(--accent); }

.hidden { display: none !important; }

/* ---------- 主布局 ---------- */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  min-height: 0;
}

.chat-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
}

/* ---------- 消息 ---------- */
.messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}

.msg { display: flex; gap: 10px; max-width: 760px; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.cont { margin-top: -10px; }
.msg.cont .avatar { visibility: hidden; }

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: none;
  margin-top: 2px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-soft);
  border: 1px solid var(--line);
}

.msg.user .avatar { background: var(--accent); color: var(--accent-text); border-color: transparent; }

.bubble {
  padding: 11px 15px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  white-space: pre-wrap;
  box-shadow: var(--shadow);
  font-size: 14.5px;
}

.msg.user .bubble {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}

.bubble .meta {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.85;
}

.msg.user .bubble .meta { color: var(--accent-text); opacity: 0.7; }

.speak-btn {
  background: none;
  border: none;
  padding: 0 0 0 6px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  color: inherit;
}

.speak-btn:hover { opacity: 1; }

.typing::after {
  content: "▍";
  animation: blink 1s steps(2) infinite;
  color: var(--accent);
}

@keyframes blink { 50% { opacity: 0; } }

.system-note {
  align-self: center;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-3);
  padding: 5px 12px;
  border-radius: 20px;
  max-width: 80%;
  text-align: center;
}

.empty-state {
  margin: auto;
  text-align: center;
  color: var(--muted);
  max-width: 420px;
}

.empty-state h2 { font-size: 17px; color: var(--text); font-weight: 600; margin: 0 0 6px; }
.empty-state p { margin: 4px 0; font-size: 13px; }

/* ---------- 输入区 ---------- */
.composer-wrap {
  flex: none;
  padding: 10px 24px 16px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.recall {
  font-size: 11.5px;
  color: var(--muted);
  min-height: 0;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recall b { color: var(--accent); font-weight: 600; }

.image-preview {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.image-preview .thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.image-preview .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.image-preview .thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.bubble .sticker {
  display: block;
  width: 112px;
  height: 112px;
  border-radius: 10px;
  margin: 6px 0 2px;
  object-fit: cover;
}

.msg-image {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 9px;
  margin-bottom: 8px;
}

.composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.composer textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  max-height: 160px;
  padding: 11px 14px;
  font: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.composer textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.composer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- 侧栏 ---------- */
.side-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface-2);
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--line);
  flex: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tabs button {
  border: none;
  background: none;
  padding: 8px 11px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s;
}

.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent-strong); border-bottom-color: var(--accent); font-weight: 600; }

[data-theme="dark"] .tabs button.active { color: var(--accent); }

.tab-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px; }

.panel { display: none; }
.panel.active { display: block; }

.section-title {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 10px;
}

.section-title:first-child { margin-top: 0; }
.section-title.tight { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 12px; }

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

.badge {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
  white-space: nowrap;
}

[data-theme="dark"] .badge { color: var(--accent); }

/* ---------- 按钮与输入 ---------- */
.btn {
  font: inherit;
  font-size: 13px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
  font-weight: 600;
}

.btn.primary:hover { background: var(--accent-strong); }

.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }

.btn.small { font-size: 12px; padding: 5px 10px; }
.btn.icon { padding: 6px 9px; font-size: 15px; line-height: 1; }
.btn.danger { color: var(--danger); border-color: var(--line-strong); }

.input {
  font: inherit;
  font-size: 13px;
  width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

select.input { cursor: pointer; }

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-soft);
  cursor: pointer;
  margin-bottom: 6px;
}

.check-row input { margin-top: 3px; accent-color: var(--accent); }

.field { display: block; margin-bottom: 10px; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

.linkish {
  border: none;
  background: none;
  font: inherit;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.linkish:hover { color: var(--accent); text-decoration: underline; }

/* ---------- 情绪 ---------- */
.emotion-grid { display: grid; gap: 13px; }

.emotion-item { display: grid; gap: 5px; }

.emotion-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
}

.emotion-head .val { color: var(--muted); font-variant-numeric: tabular-nums; }

.meter {
  height: 6px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}

.meter > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.profile-list { display: grid; gap: 7px; }

.profile-item {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  display: grid;
  gap: 2px;
}

.profile-item b { font-weight: 600; color: var(--accent-strong); font-size: 11.5px; }
[data-theme="dark"] .profile-item b { color: var(--accent); }
.profile-item span { color: var(--text-soft); }

.task-card {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  font-size: 13px;
  display: grid;
  gap: 4px;
}

.milestone-list { display: grid; gap: 6px; margin-top: 8px; }

.milestone {
  font-size: 12px;
  color: var(--text-soft);
  padding: 7px 10px;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ---------- 生活：日记 / 待办 / 情绪来源 ---------- */
.diary-list, .todo-list, .emotion-log { display: grid; gap: 9px; }

.diary-card {
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  gap: 7px;
}

.diary-card .head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.diary-card .mood { color: var(--accent-strong); }
[data-theme="dark"] .diary-card .mood { color: var(--accent); }

.diary-card .body {
  font-size: 13.5px;
  line-height: 1.8;
  white-space: pre-wrap;
}

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

.plan-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.plan-item.done { opacity: 0.72; }
.plan-item .plan-result { flex-basis: 100%; font-size: 12px; color: var(--muted); margin-top: 2px; }

.interest-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.interest-tags .tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid transparent;
}

[data-theme="dark"] .interest-tags .tag { color: var(--accent); }

.insight-list { display: grid; gap: 9px; }

.insight-card {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  gap: 6px;
}

.insight-card .head { font-size: 11.5px; color: var(--accent-strong); letter-spacing: 0.02em; }
[data-theme="dark"] .insight-card .head { color: var(--accent); }
.insight-card .body { font-size: 13px; line-height: 1.75; white-space: pre-wrap; }

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
}

.todo-item input { margin-top: 4px; accent-color: var(--accent); flex: none; }
.todo-item.done { opacity: 0.55; text-decoration: line-through; }
.todo-item .src { font-size: 11px; color: var(--muted); margin-left: auto; white-space: nowrap; }

.emo-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
}

.emo-row .t { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.emo-row .d { font-variant-numeric: tabular-nums; }
.emo-row .up { color: var(--ok); }
.emo-row .down { color: var(--danger); }

/* ---------- 内心活动 ---------- */
.thought-list { display: grid; gap: 7px; }

.thought-item {
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  display: grid;
  gap: 4px;
}

.thought-item .time {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.thought-item .said { color: var(--accent); font-size: 11px; }
.thought-item .chain { font-size: 11.5px; color: var(--muted); }

/* ---------- 统计 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stat {
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.stat .num { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .lab { font-size: 11.5px; color: var(--muted); }

/* ---------- 大脑 ---------- */
.brain-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }

.canvas-wrap {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid #1d242a;
  background: radial-gradient(circle at 50% 45%, #0f1418 0%, #05070a 75%);
  overflow: hidden;
  height: 380px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
}

.brain-stats {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.brain-stats b {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#brain-canvas { width: 100%; height: 100%; display: block; cursor: grab; }
#brain-canvas:active { cursor: grabbing; }

.canvas-tip {
  position: absolute;
  pointer-events: none;
  padding: 6px 9px;
  font-size: 11.5px;
  max-width: 240px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.12s;
  overflow-wrap: anywhere;
}

.canvas-tip.show { opacity: 1; }

/* ---------- 记忆列表 ---------- */
.memory-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.memory-card {
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  gap: 6px;
}

.memory-card .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.memory-card .summary { font-size: 13px; }
.memory-card .sub { font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.memory-card .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.memory-card.archived { opacity: 0.62; }

.pill {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--surface-3);
  color: var(--muted);
  white-space: nowrap;
}

.pill.hot { background: var(--accent-soft); color: var(--accent-strong); }
[data-theme="dark"] .pill.hot { color: var(--accent); }

/* ---------- 人格 ---------- */
.persona-list { display: grid; gap: 9px; }

.persona-card {
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  gap: 5px;
}

.persona-card .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.persona-card .name { font-weight: 600; font-size: 13px; }
.persona-card .value { font-size: 13px; color: var(--text-soft); white-space: pre-wrap; }
.persona-card .foot { display: flex; justify-content: flex-end; }

.log-list, .audit-list { display: grid; gap: 8px; }

.log-item, .audit-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  display: grid;
  gap: 4px;
}

.log-item .time, .audit-item .time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.audit-item .action { font-weight: 600; }
.audit-item .diff { font-size: 11.5px; color: var(--muted); }
.audit-item .acts { display: flex; gap: 6px; justify-content: flex-end; }

code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--surface-3);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- 弹窗 ---------- */
dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg);
}

dialog::backdrop { background: rgba(20, 18, 16, 0.42); }

.dialog-form { padding: 20px; display: grid; gap: 10px; }
.dialog-form h2 { margin: 0; font-size: 16px; }
.dialog-form textarea, .dialog-form input {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  resize: vertical;
  outline: none;
}

.dialog-form textarea:focus, .dialog-form input:focus { border-color: var(--accent); }

.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.error { color: var(--danger); font-size: 12.5px; min-height: 16px; margin: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  padding: 9px 16px;
  border-radius: 20px;
  background: var(--text);
  color: var(--bg);
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100vw - 40px);
  text-align: center;
  z-index: 50;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 登录 ---------- */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.login-card {
  width: min(340px, calc(100vw - 40px));
  padding: 28px 24px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.login-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
}

.login-card h2 { margin: 4px 0 0; font-size: 18px; font-weight: 650; }
.login-card p { margin: 0; }
.login-card .input { text-align: center; margin-top: 4px; }
.login-card .btn { width: 100%; justify-content: center; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  /* 手机：聊天占满，面板收进右侧抽屉 */
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .chat-pane { border-right: none; }

  .side-pane {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(92vw, 420px);
    transform: translateX(102%);
    transition: transform 0.22s ease;
    z-index: 60;
    box-shadow: -14px 0 44px rgba(0, 0, 0, 0.18);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .side-pane.open { transform: none; }

  #btn-view { display: inline-flex; }

  .drawer-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 18, 16, 0.36);
    z-index: 55;
  }

  .drawer-mask.show { display: block; }

  .messages { padding: 16px 14px 8px; }
  .composer-wrap { padding: 8px 14px calc(10px + env(safe-area-inset-bottom)); }
  .topbar { padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
  .top-status { display: none; }
  .brand-text p { display: none; }
  #btn-review { font-size: 12px; padding: 5px 9px; }
}

@media (max-width: 520px) {
  .brand-text p { display: none; }
  .btn { font-size: 12px; }
  .canvas-wrap { height: 240px; }
}

/* 文字里的 emoji，统一成图 */
.emoji {
  width: 1.35em;
  height: 1.35em;
  vertical-align: -0.28em;
  display: inline-block;
  margin: 0 1px;
}

/* 技能 */
.skill-list { display: grid; gap: 9px; }

.skill-item {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  display: grid;
  gap: 5px;
}

.skill-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.skill-head b { font-size: 13.5px; }
.skill-body { font-size: 12.5px; color: var(--text-soft); line-height: 1.65; white-space: pre-wrap; }
.skill-next { font-size: 11.5px; color: var(--muted); }
