@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

:root {
  --p: #3d8bff;
  --p-2: #2b74f0;
  --p-dim: #e8f2ff;
  --s: #ff7a1a;
  --s-dim: #fff1e6;
  --t: #ff5a9a;
  --t-dim: #ffe8f2;
  --ok: #07c160;
  --ok-2: #06ad56;
  --ok-dim: #e8f8ef;
  --danger: #ff4d4f;
  --danger-dim: #ffecec;
  --bg: #ffffff;
  --bg-2: #f5f6f8;
  --elev: #ffffff;
  --elev-2: #f7f8fa;
  --line: #eef0f4;
  --line-2: #e4e7ed;
  --text: #1a1a1a;
  --text-2: #8a8f99;
  --text-3: #b4b8c0;
  --white: #ffffff;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 8px 28px rgba(45, 90, 160, 0.10);
  --card-shadow: 0 6px 18px rgba(30, 40, 80, 0.06);
  --grad-sky: linear-gradient(180deg, #132c9c 0%, #1d3db0 10%, #2a55c8 22%, #3d78e6 38%, #6ea4f4 54%, #b7d2fb 72%, #e4eefc 88%, #eef3fb 100%);
  --grad-chat: linear-gradient(90deg, #4c9dff 0%, #7b78ff 52%, #c56bff 100%);
  --grad-hot: linear-gradient(90deg, #ff7aa8, #ff5a8a);
  --font-head: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --tab-h: 58px;
  --safe: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: #dce8f6;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; }

.ico {
  width: 1em;
  height: 1em;
  display: inline-block;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  vertical-align: -0.15em;
}
svg.ico { overflow: visible; }

.is-hidden { display: none !important; }

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  object-fit: cover;
  background: linear-gradient(145deg, #8ec2ff, #3d8bff);
}
.avatar.a1 { background: linear-gradient(145deg, #ffb3d0, #ff5a9a); }
.avatar.a2 { background: linear-gradient(145deg, #8ec2ff, #3d8bff); }
.avatar.a3 { background: linear-gradient(145deg, #ffd0a8, #ff7a1a); color: #fff; }
.avatar.u1 { background: linear-gradient(145deg, #c9d3e0, #8a8f99); }
.avatar.me { background: linear-gradient(145deg, #b8e4c8, #07c160); }

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.head { font-family: var(--font-head); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  transition: 0.18s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--p); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: var(--ok-2); }
.btn-chat { background: var(--grad-chat); color: #fff; }
.btn-secondary { background: var(--elev-2); color: var(--text); border: 1px solid var(--line); }
.btn-inverted { background: var(--white); color: var(--text); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--line-2); }
.btn-ghost { background: transparent; color: var(--p); }
.btn-danger { background: var(--danger-dim); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 999px; }
.btn-lg { height: 48px; font-size: 16px; border-radius: 999px; font-weight: 700; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.pill-p { background: var(--p-dim); color: var(--p); }
.pill-s { background: var(--s-dim); color: var(--s); }
.pill-t { background: var(--t-dim); color: var(--t); }
.pill-d { background: var(--danger-dim); color: var(--danger); }
.pill-muted { background: rgba(255,255,255,0.06); color: var(--text-2); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(26, 26, 26, 0.88);
  color: #fff;
  border: 0;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  z-index: 80;
  transition: 0.2s ease;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.search {
  height: 40px;
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--text-2);
}
.search input {
  flex: 1;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  min-width: 0;
}
.search input::placeholder { color: var(--text-3); }
.chip {
  height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--elev); border: 1px solid var(--line);
  color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chip.on { background: var(--p-dim); color: var(--p); border-color: transparent; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; outline: none;
}
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
