/* OK-Music 界面：深色 + 毛玻璃（glassmorphism）。
   自己写而不是引 UI 库的原因：无构建步骤、无第三方 JS、可控到每个像素。
   结构顺序：变量 → 基础 → 背景光斑 → 顶栏 → 卡片/表格 → 徽章 → 表单 → 登录页 → 响应式 */

:root {
  --bg: #070b16;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.085);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #e7ecf6;
  --muted: #94a3bd;
  --faint: #6b7a96;
  --accent: #7c9cff;
  --accent-2: #b07cff;
  --success: #3ddc97;
  --warn: #ffc861;
  --danger: #ff7b8a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(3, 6, 15, 0.55);
  --blur: blur(18px) saturate(150%);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}

body::before {
  width: 46rem; height: 46rem;
  top: -18rem; left: -12rem;
  background: radial-gradient(circle at 30% 30%, #2b4bff 0%, rgba(43, 75, 255, 0) 65%);
}

body::after {
  width: 40rem; height: 40rem;
  bottom: -16rem; right: -10rem;
  background: radial-gradient(circle at 60% 40%, #a855f7 0%, rgba(168, 85, 247, 0) 65%);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #a9beff; }

code {
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12.5px;
  color: #d7e0f5;
}

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  background: rgba(10, 14, 26, 0.62);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 12px 22px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}

.brand { display: flex; align-items: baseline; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: 0.2px; }
.brand a { color: var(--text); }
.brand .sub { color: var(--faint); font-weight: 500; font-size: 12.5px; }
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(124, 156, 255, 0.8);
  display: inline-block; margin-right: 2px;
}

.topbar .spacer { flex: 1 1 auto; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted); font-size: 12.5px; white-space: nowrap;
}
.pill.ok { color: #b8f5d8; border-color: rgba(61, 220, 151, 0.35); }
.pill.warn { color: #ffe0a8; border-color: rgba(255, 200, 97, 0.38); }

/* ---------- 布局 ---------- */

.wrap { max-width: 1400px; margin: 0 auto; padding: 24px 22px 64px; }
.row { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; }
.card-head .spacer { flex: 1 1 auto; }
.card-body { padding: 16px 18px; }

.kpi { padding: 16px 18px; position: relative; transition: transform 160ms ease, border-color 160ms ease; }
.kpi:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.kpi::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
}
.kpi .label { color: var(--muted); font-size: 12.5px; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .note { color: var(--faint); font-size: 12px; }
.kpi .value.accent { background: linear-gradient(120deg, #cfe0ff, #e6d4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- 表格 ---------- */

.table-wrap { overflow-x: auto; }
table.okm { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.okm th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-weight: 600; font-size: 12px; color: var(--muted);
  padding: 11px 14px; white-space: nowrap;
  background: rgba(12, 17, 32, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
table.okm td { padding: 11px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.055); vertical-align: middle; }
table.okm tbody tr { transition: background 140ms ease; }
table.okm tbody tr:hover { background: rgba(124, 156, 255, 0.075); }
table.okm tbody tr:last-child td { border-bottom: none; }
table.okm .rank { color: var(--faint); font-variant-numeric: tabular-nums; width: 44px; }
table.okm .title { max-width: 330px; }
table.okm .title a { color: var(--text); font-weight: 600; }
table.okm .title a:hover { color: var(--accent); }
table.okm .who { max-width: 210px; }
table.okm .who .handle { color: var(--faint); font-size: 12px; }
table.okm .note-cell { max-width: 200px; }

/* ---------- 徽章 / 标签 ---------- */

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.35;
  border: 1px solid transparent; font-variant-numeric: tabular-nums;
}
.badge.up { background: rgba(61, 220, 151, 0.14); border-color: rgba(61, 220, 151, 0.34); color: #8ff0c4; }
.badge.down { background: rgba(255, 123, 138, 0.14); border-color: rgba(255, 123, 138, 0.34); color: #ffb0b9; }
.badge.flat { background: rgba(255, 255, 255, 0.07); border-color: var(--border); color: var(--muted); }
.badge.warn { background: rgba(255, 200, 97, 0.13); border-color: rgba(255, 200, 97, 0.34); color: #ffdda2; }
.badge.info { background: rgba(124, 156, 255, 0.14); border-color: rgba(124, 156, 255, 0.36); color: #bdd0ff; }
.badge.err { background: rgba(255, 123, 138, 0.16); border-color: rgba(255, 123, 138, 0.4); color: #ffc2c9; }
.badge.role { background: rgba(176, 124, 255, 0.14); border-color: rgba(176, 124, 255, 0.36); color: #dfc6ff; }
.badge.multi { white-space: normal; text-align: left; }

/* ---------- 表单 / 按钮 ---------- */

input[type="text"], input[type="search"], input[type="email"], input[type="password"], select {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(8, 12, 22, 0.55);
  color: var(--text);
  font-size: 14px; font-family: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
input::placeholder { color: var(--faint); }

textarea {
  width: 100%; padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(8, 12, 22, 0.55);
  color: var(--text); font: inherit; font-size: 13.5px;
  resize: vertical; min-height: 58px;
}
textarea::placeholder { color: var(--faint); }
textarea:focus { outline: none; border-color: rgba(124, 156, 255, 0.65); box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.18); }

input:focus, select:focus {
  outline: none; border-color: rgba(124, 156, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.18);
}
label { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text); font-size: 13.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}
.btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.btn.primary {
  border: none; color: #0b1020;
  background: linear-gradient(120deg, #a8c0ff, #d4b6ff);
  box-shadow: 0 10px 26px rgba(124, 156, 255, 0.28);
}
.btn.primary:hover { box-shadow: 0 14px 30px rgba(124, 156, 255, 0.36); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn.danger { color: #ffc9cf; border-color: rgba(255, 123, 138, 0.4); }
.btn.ok { color: #a9f0cc; border-color: rgba(61, 220, 151, 0.4); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 标注：筛选胶囊 + 行内快捷按钮 ---------- */

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 12.5px; transition: all 140ms ease;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: rgba(124, 156, 255, 0.16); border-color: rgba(124, 156, 255, 0.45); color: #cdd9ff; }

.quick { display: flex; gap: 4px; }
.quick button {
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}
.quick button:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.quick button.active {
  background: rgba(124, 156, 255, 0.2); border-color: rgba(124, 156, 255, 0.5);
  color: #d6e0ff; font-weight: 600;
}

.history { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; }
.history li { margin-bottom: 2px; }

.search-form { display: flex; gap: 8px; align-items: center; }
.search-form input { min-width: 230px; }

/* ---------- 提示条 ---------- */

.alert {
  border-radius: var(--radius-sm);
  padding: 11px 15px; margin-bottom: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted); font-size: 13px;
}
.alert.info { border-color: rgba(124, 156, 255, 0.32); background: rgba(124, 156, 255, 0.10); color: #cbd8ff; }
.alert.ok { border-color: rgba(61, 220, 151, 0.32); background: rgba(61, 220, 151, 0.10); color: #b6f0d4; }
.alert.warn { border-color: rgba(255, 200, 97, 0.34); background: rgba(255, 200, 97, 0.10); color: #ffe3b3; }
.alert.err { border-color: rgba(255, 123, 138, 0.36); background: rgba(255, 123, 138, 0.10); color: #ffc6cc; }

/* ---------- 分页 ---------- */

.pager { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); }
.pager .spacer { flex: 1 1 auto; }
.pager a, .pager span.disabled {
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); font-size: 12.5px;
}
.pager span.disabled { color: var(--faint); opacity: 0.6; }

/* ---------- 曲线 ---------- */

.spark { width: 116px; height: 28px; display: block; }
.chart { width: 100%; height: 240px; display: block; }
.chart-grid { stroke: rgba(255, 255, 255, 0.07); stroke-width: 1; }

/* ---------- 空状态 ---------- */

.empty { padding: 56px 24px; text-align: center; }
.empty h3 { margin: 0 0 6px; font-size: 16px; }
.empty p { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------- 登录 / 注册 ---------- */

.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 0.85fr; }

.auth-art { position: relative; overflow: hidden; border-right: 1px solid var(--border); }
.auth-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#art-debug {
  position: absolute; z-index: 3; left: 16px; right: 16px; top: 16px; margin: 0;
  padding: 10px 12px; border-radius: 10px; font-size: 12px; line-height: 1.55;
  background: rgba(6, 9, 20, 0.86); border: 1px solid var(--border);
  color: #b9c6e0; white-space: pre-wrap;
}
.auth-art .art-copy { 
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 56px 52px 64px;
  background: linear-gradient(180deg, rgba(6, 9, 20, 0.15) 0%, rgba(6, 9, 20, 0.72) 78%);
}
.auth-art .art-brand { display: flex; align-items: baseline; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: auto; }
.auth-art .art-brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(124, 156, 255, 0.9);
}
.auth-art h2 { margin: 0 0 10px; font-size: 32px; line-height: 1.25; letter-spacing: -0.6px;
  background: linear-gradient(120deg, #eaf1ff 10%, #c7b6ff 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-art p { margin: 0; color: #a9b6cf; font-size: 14px; max-width: 30rem; }
.auth-art .art-hint { margin-top: 14px; color: #6b7a96; font-size: 12px; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 32px; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 18px; }
.auth-card {
  width: 100%; max-width: 420px;
  background: rgba(13, 18, 33, 0.62);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  box-shadow: 0 30px 80px rgba(2, 4, 12, 0.7);
  padding: 34px 32px 28px;
}
.auth-card .brand { justify-content: center; margin-bottom: 6px; font-size: 18px; }
.auth-card .tagline { text-align: center; color: var(--faint); font-size: 12.5px; margin-bottom: 24px; }
.auth-card h1 { font-size: 19px; margin: 0 0 4px; text-align: center; font-weight: 650; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.auth-card .btn.primary { width: 100%; padding: 12px; margin-top: 4px; }
.auth-foot { margin-top: 18px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---------- 页脚 ---------- */

.foot { max-width: 1400px; margin: 0 auto; padding: 0 22px 40px; color: var(--faint); font-size: 12px; }

/* ---------- 响应式 ---------- */

@media (max-width: 1024px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-art { min-height: 260px; border-right: none; border-bottom: 1px solid var(--border); }
  .auth-art .art-copy { padding: 28px 24px; }
  .auth-art h2 { font-size: 22px; }
  .auth-art p { display: none; }
  .auth-art .art-hint { display: none; }
}
@media (max-width: 720px) {
  .wrap { padding: 18px 14px 48px; }
  .topbar-inner { padding: 10px 14px; gap: 10px; }
  .search-form input { min-width: 0; width: 100%; }
  .search-form { width: 100%; }
  .kpi .value { font-size: 22px; }
  table.okm .title { max-width: 200px; }
  table.okm .who { max-width: 140px; }
}
