:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --text: #22211f;
  --muted: #77736b;
  --border: #e3e0d8;
  --accent: #2f7d6d;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ed;
  --user-bubble: #2f7d6d;
  --user-ink: #ffffff;
  --human-bubble: #fff4dc;
  --human-border: #f0d59a;
  --danger: #c0392b;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161716;
    --surface: #1f2120;
    --surface-2: #2a2c2b;
    --text: #ecebe7;
    --muted: #9a978f;
    --border: #333634;
    --accent: #5bb5a0;
    --accent-ink: #0d1f1b;
    --accent-soft: #1f3530;
    --user-bubble: #3d8f7d;
    --user-ink: #ffffff;
    --human-bubble: #3a321f;
    --human-border: #6b5a2c;
    --danger: #e57366;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: 10px; font-size: 15px; transition: opacity .15s, background .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent); opacity: .9; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.input, textarea.input, select.input {
  width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 10px;
  padding: 10px 12px; outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--accent); }
.muted { color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(30,30,30,.9); color: #fff; padding: 10px 18px; border-radius: 20px;
  font-size: 14px; z-index: 1000; max-width: 86vw; text-align: center; pointer-events: none;
}
