:root {
  --bg: #0b0d10;
  --panel: #14171c;
  --panel-2: #1a1e25;
  --line: #262c35;
  --line-soft: #1e232a;
  --text: #e8eaed;
  --muted: #8b929d;
  --dim: #5b626c;
  --gold: #e0b356;
  --gold-dim: #8a6d31;
  --danger: #d9534f;
  --ok: #46a97b;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

/* 作者样式里的 display 会盖掉浏览器默认的 [hidden]，必须显式兜住 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(900px 500px at 15% -10%, rgba(224, 179, 86, .07), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(80, 120, 200, .06), transparent 60%);
  background-attachment: fixed;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- shell ---------- */

#app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px; height: 58px;
  background: rgba(11, 13, 16, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; letter-spacing: .16em; font-size: 13px;
  white-space: nowrap;
}
.brand-mark { color: var(--gold); font-size: 16px; }

.tabs { display: flex; gap: 2px; margin-left: 6px; }
.tabs button {
  background: none; border: 0; padding: 8px 14px; border-radius: 7px;
  color: var(--muted); font-size: 13.5px; transition: color .15s, background .15s;
}
.tabs button:hover { color: var(--text); background: var(--panel-2); }
.tabs button.active { color: var(--bg); background: var(--gold); font-weight: 600; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { color: var(--muted); font-size: 13px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bell {
  position: relative; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--muted); border-radius: 8px; padding: 7px 12px; font-size: 13px;
}
.bell:hover { color: var(--text); border-color: var(--gold-dim); }
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; line-height: 17px; text-align: center; font-weight: 600;
}

main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 26px 24px 80px; }

.view { display: none; }
.view.active { display: block; }
.view.anim { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- primitives ---------- */

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px;
}

h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: .02em; }
h2 { font-size: 15px; margin: 0 0 14px; font-weight: 600; }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.spacer { flex: 1; }

label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
label.field > span { letter-spacing: .02em; }

/* 验证码：输入框和「获取验证码」并排，按钮不能被压扁 */
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row input { flex: 1 1 auto; }
.code-row .tiny { flex: 0 0 auto; white-space: nowrap; }

input[type=text], input[type=password], input[type=email], input[type=number], select, textarea {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px;
  padding: 8px 10px; outline: none; min-width: 0; transition: border-color .15s;
}

/* 数字输入框的上下箭头在窄槽位里很碍眼 */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input:focus, select:focus, textarea:focus { border-color: var(--gold-dim); }
input::placeholder { color: var(--dim); }

button.primary {
  background: var(--gold); color: #17130a; border: 0; border-radius: 8px;
  padding: 9px 18px; font-weight: 600; transition: filter .15s;
}
button.primary:hover { filter: brightness(1.08); }
button.primary:disabled { opacity: .45; cursor: not-allowed; }

button.ghost {
  background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 14px; color: var(--muted);
}
button.ghost:hover { color: var(--text); border-color: var(--gold-dim); }

button.tiny {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; color: var(--muted);
}
button.tiny:hover { color: var(--text); border-color: var(--gold-dim); }
button.tiny.ok { color: var(--ok); border-color: rgba(70,169,123,.45); }
button.tiny.ok:hover { background: rgba(70,169,123,.12); }
button.tiny.no:hover { color: var(--danger); border-color: rgba(217,83,79,.5); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); line-height: 1.6;
}
.pill.gold { color: var(--gold); border-color: var(--gold-dim); }
.pill.ok { color: var(--ok); border-color: rgba(70,169,123,.4); }
.pill.warn { color: #d9a13f; border-color: rgba(217,161,63,.4); }
.pill.bad { color: var(--danger); border-color: rgba(217,83,79,.4); }

.mono { font-family: var(--mono); }
.empty { color: var(--dim); font-size: 13px; padding: 26px 0; text-align: center; }

/* ---------- auth ---------- */

.auth-wrap { display: grid; place-items: center; min-height: 62vh; }
.auth-card { width: 380px; }
.auth-card h1 { margin-bottom: 2px; }
.auth-switch { color: var(--muted); font-size: 12.5px; margin-top: 14px; }
.auth-switch a { color: var(--gold); cursor: pointer; text-decoration: none; }
.demo-line { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.demo-line p { margin: 0 0 9px; font-size: 12px; color: var(--dim); }
.demo-line .row { gap: 8px; }

/* ---------- support ---------- */

.slot {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  gap: 8px; padding: 12px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line-soft);
}
.slot + .slot { margin-top: 8px; }
.slot .idx { font-family: var(--mono); color: var(--dim); font-size: 12px; padding-bottom: 9px; }
.slot label.field { min-width: 62px; }
.slot .op-field { flex: 1 1 150px; }
.slot .skill-levels { display: flex; gap: 4px; }
.slot .skill-levels select { min-width: 54px; }
.slot select, .slot input { padding: 6px 8px; font-size: 13px; }

/* ---------- operator picker ---------- */

.picker { position: relative; }
.picker input { width: 100%; }
.picker-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 260px; overflow: auto;
  background: #1c2129; border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 18px 40px rgba(0,0,0,.55); padding: 4px;
}
.picker-list[hidden] { display: none; }
.picker-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px;
  border-radius: 6px; cursor: pointer; font-size: 13px;
}
.picker-item:hover, .picker-item.hl { background: rgba(224,179,86,.13); }
.picker-item .r { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.picker-empty { padding: 10px; color: var(--dim); font-size: 12.5px; }

/* ---------- results ---------- */

.result {
  display: grid; grid-template-columns: 1fr auto; gap: 14px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); margin-bottom: 10px;
}
.result:hover { border-color: #333b47; }
.result-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.result-actions { display: flex; flex-direction: column; gap: 6px; align-self: center; min-width: 92px; }
.result-name { font-weight: 600; font-size: 14.5px; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: 7px; padding: 5px 9px; font-size: 12px;
}
.chip .op { font-weight: 600; }
.chip .lv { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.chip .hit { color: var(--gold); }
.face {
  position: relative; overflow: hidden;
  width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #0b0d10; flex: none;
}
.face-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- requests ---------- */

.req {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--line-soft);
}
.req:last-child { border-bottom: 0; }
.req-main { min-width: 0; }
.req-title { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.req-msg { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.uid-box {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono);
  background: rgba(224,179,86,.08); border: 1px dashed var(--gold-dim);
  border-radius: 6px; padding: 2px 8px; color: var(--gold); font-size: 12.5px;
}

/* ---------- drawer ---------- */

.drawer {
  position: fixed; top: 58px; right: 0; bottom: 0; width: 380px; max-width: 92vw;
  background: #101318; border-left: 1px solid var(--line); z-index: 30;
  transform: translateX(100%); transition: transform .22s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.drawer-body { overflow: auto; flex: 1; }
.noti { padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
.noti.unread { background: rgba(224,179,86,.045); }
.noti-title { display: flex; align-items: center; gap: 7px; font-size: 13.5px; margin-bottom: 2px; }
.noti-body { color: var(--muted); font-size: 12.5px; }
.noti-time { color: var(--dim); font-size: 11.5px; font-family: var(--mono); margin-top: 4px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; }

/* ---------- toasts ---------- */

.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 9px; z-index: 60; }
.toast {
  background: #1c2129; border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 8px; padding: 11px 15px; min-width: 250px; max-width: 380px;
  box-shadow: 0 14px 34px rgba(0,0,0,.5); animation: slide .22s ease;
}
.toast.err { border-left-color: var(--danger); }
.toast .t { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.toast .b { color: var(--muted); font-size: 12.5px; }
@keyframes slide { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
  .slot { align-items: stretch; }
  .tabs button { padding: 8px 10px; }
  .who { display: none; }
}
