/* base.css: tokens + primitives shared by every page (also used by the login page, which is served without a session) */
:root {
  --bg: #edf0f3;
  --paper: #ffffff;
  --ink: #1d2733;
  --muted: #66727f;
  --line: #d5dbe2;
  --theirs: #f3f5f7;
  --mine: #d9e6f5;
  --accent: #2c5c8c;
  --accent-ink: #ffffff;
  --warn-bg: #fbf0d9;
  --warn-line: #e3c384;
  --warn-ink: #6f4708;
  --danger: #a3352b;
  --danger-bg: #f9e4e1;
  --focus: #2c5c8c;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181d;
    --paper: #1c2229;
    --ink: #e3e8ee;
    --muted: #8d98a5;
    --line: #2f3843;
    --theirs: #252c35;
    --mine: #22374f;
    --accent: #8fb5df;
    --accent-ink: #11171e;
    --warn-bg: #3a2e14;
    --warn-line: #7a6026;
    --warn-ink: #f0cf8a;
    --danger: #ee8a7f;
    --danger-bg: #3d2320;
    --focus: #8fb5df;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
h1.title {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", serif;
  font-weight: 600; font-size: 30px; letter-spacing: .02em; line-height: 1.25; margin: 0 0 6px;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.btn {
  border: 1px solid var(--line); background: var(--paper); border-radius: 8px;
  padding: 7px 14px; line-height: 1.4;
}
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn.danger { color: var(--danger); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn.quiet:hover:not(:disabled) { color: var(--ink); }

.field {
  width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: 8px;
  padding: 8px 10px; color: var(--ink);
}
textarea.field { resize: vertical; line-height: 1.55; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.muted { color: var(--muted); }

.banner {
  border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn-ink);
  border-radius: 8px; padding: 8px 12px; font-size: 14px;
}
.banner.err { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: var(--bg); border-radius: 10px; padding: 9px 16px;
  display: flex; gap: 14px; align-items: center; font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.18);
  max-width: calc(100vw - 32px);
}
.toast button { border: 0; background: none; color: inherit; font-weight: 600; text-decoration: underline; padding: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 560px) { h1.title { font-size: 25px; } }
