/* 眉颜运营后台 · 暗金主题（与 05 文档设计令牌一致） */
:root {
  --bg: #0d0c0a;
  --panel: #161208;
  --panel-2: #1d1911;
  --gold: #c9a96a;
  --gold-light: #f4e6c6;
  --gold-dark: #8a6e42;
  --text: #f2ecdd;
  --muted: #9a917d;
  --ok: #8cb98a;
  --warn: #d8b46a;
  --danger: #d0796b;
  --border: rgba(138, 110, 66, 0.32);
  --gradient: linear-gradient(135deg, #f4e6c6 0%, #c9a96a 48%, #8a6e42 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }

/* ---------- 登录 ---------- */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 78% 18%, rgba(201, 169, 106, 0.12), transparent 42%),
    radial-gradient(circle at 12% 82%, rgba(201, 169, 106, 0.07), transparent 40%),
    var(--bg);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 34px 34px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 230, 198, 0.55), transparent);
}
.login-card .brand { font-size: 26px; letter-spacing: 6px; color: var(--gold-light); }
.login-card .brand span { font-size: 11px; letter-spacing: 3px; color: var(--gold-dark); margin-left: 8px; }
.login-card .sub { color: var(--muted); font-size: 12px; letter-spacing: 2px; margin: 6px 0 28px; }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.login-card input {
  display: block;
  width: 100%;
  margin-top: 8px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(13, 12, 10, 0.6);
  color: var(--text);
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.login-card input:focus { border-color: var(--gold); }
.login-card button {
  width: 100%;
  height: 46px;
  margin-top: 10px;
  border: none;
  border-radius: 999px;
  background: var(--gradient);
  color: #14120e;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 4px;
  cursor: pointer;
}
.login-card button:disabled { opacity: .6; cursor: default; }
.err { color: var(--danger); font-size: 12px; margin-top: 12px; min-height: 18px; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex: 0 0 220px;
  background: #0f0e0b;
  border-right: 1px solid rgba(138, 110, 66, 0.18);
  display: flex;
  flex-direction: column;
  padding: 26px 0 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  padding: 0 24px 26px;
  font-size: 20px;
  letter-spacing: 5px;
  color: var(--gold-light);
}
.sidebar .brand span { display: block; font-size: 10px; letter-spacing: 3px; color: var(--gold-dark); margin-top: 4px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  padding: 11px 24px;
  color: var(--muted);
  font-size: 13px;
  border-left: 2px solid transparent;
  transition: all .18s;
}
.sidebar nav a:hover { color: var(--text); background: rgba(201, 169, 106, 0.05); }
.sidebar nav a.active {
  color: var(--gold-light);
  border-left-color: var(--gold);
  background: rgba(201, 169, 106, 0.08);
}
.sidebar-foot {
  margin-top: auto;
  padding: 18px 24px 0;
  border-top: 1px solid rgba(138, 110, 66, 0.16);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.sidebar-foot a { color: var(--gold-dark); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid rgba(138, 110, 66, 0.16);
  background: rgba(13, 12, 10, 0.72);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar h1 { font-size: 17px; font-weight: 600; letter-spacing: 2px; color: var(--gold-light); }
.page-actions { display: flex; gap: 10px; align-items: center; }

.content { padding: 26px 30px 48px; }

/* ---------- 卡片 ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 230, 198, 0.28), transparent);
}
.card-label { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.card-value { font-size: 30px; font-weight: 600; color: var(--gold-light); margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.card-sub { font-size: 11px; color: var(--gold-dark); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(138, 110, 66, 0.14);
}
.panel-head h3 { font-size: 14px; font-weight: 600; color: var(--gold-light); letter-spacing: 1px; }
.link { font-size: 12px; color: var(--gold-dark); }
.link:hover { color: var(--gold); }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(138, 110, 66, 0.16);
  white-space: nowrap;
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(138, 110, 66, 0.08);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(201, 169, 106, 0.03); }
.table strong { color: var(--text); font-weight: 500; }
.num { font-variant-numeric: tabular-nums; }
.code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; color: var(--gold); }
.ops { white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 26px 0; font-size: 13px; }
.loading { color: var(--muted); padding: 40px; text-align: center; font-size: 13px; }
.pager { padding: 14px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid rgba(138, 110, 66, 0.1); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--border);
  color: var(--muted);
  line-height: 1.7;
}
.badge.ok { color: var(--ok); border-color: rgba(140, 185, 138, 0.45); background: rgba(140, 185, 138, 0.08); }
.badge.warn { color: var(--warn); border-color: rgba(216, 180, 106, 0.45); background: rgba(216, 180, 106, 0.08); }
.badge.danger { color: var(--danger); border-color: rgba(208, 121, 107, 0.45); background: rgba(208, 121, 107, 0.08); }
.badge.hot { color: #e8b0a2; border-color: rgba(224, 145, 120, 0.5); background: rgba(224, 145, 120, 0.12); }
.badge.paid { color: #14120e; background: var(--gradient); border-color: transparent; font-weight: 600; }

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
  border: 1px solid rgba(244, 230, 198, 0.3);
}

/* ---------- 控件 ---------- */
.input, .select {
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(13, 12, 10, 0.7);
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
  outline: none;
}
.input { width: 210px; }
.input:focus, .select:focus { border-color: var(--gold); }

.btn {
  height: 34px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--gold-dark);
  background: transparent;
  color: var(--gold-light);
  font-size: 13px;
  cursor: pointer;
}
.btn:hover { background: rgba(201, 169, 106, 0.08); }

.mini {
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  margin-right: 6px;
}
.mini.ok { color: var(--ok); border-color: rgba(140, 185, 138, 0.45); }
.mini.ok:hover { background: rgba(140, 185, 138, 0.1); }
.mini.danger { color: var(--danger); border-color: rgba(208, 121, 107, 0.45); }
.mini.danger:hover { background: rgba(208, 121, 107, 0.1); }

/* ---------- 弹层 ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.modal-card h3 { font-size: 15px; color: var(--gold-light); margin-bottom: 8px; letter-spacing: 1px; }
.modal-card textarea {
  width: 100%;
  min-height: 84px;
  margin: 16px 0 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(13, 12, 10, 0.7);
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  resize: vertical;
  outline: none;
}
.modal-card textarea:focus { border-color: var(--gold); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions button {
  height: 34px;
  padding: 0 18px;
  border-radius: 8px;
  border: none;
  background: var(--gradient);
  color: #14120e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.modal-actions button.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(22, 18, 8, 0.96);
  border: 1px solid var(--border);
  color: var(--gold-light);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all .24s;
  z-index: 80;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(208, 121, 107, 0.5); color: var(--danger); }

@media (max-width: 900px) {
  .sidebar { width: 64px; flex-basis: 64px; }
  .sidebar .brand { font-size: 0; padding: 0 0 20px; text-align: center; }
  .sidebar .brand::first-letter { font-size: 18px; }
  .sidebar nav a { padding: 12px 0; text-align: center; font-size: 11px; }
  .sidebar-foot { justify-content: center; }
  .sidebar-foot span { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 40px; }
  .input { width: 140px; }
}

/* ---------- 系统设置 ---------- */
.alert {
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: 10px;
  background: rgba(216, 180, 106, 0.08);
  color: var(--warn);
  font-size: 13px;
}
.setting-panel { margin-bottom: 16px; }
.setting-list { display: flex; flex-direction: column; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  transition: background .18s;
}
.setting-row:first-child { border-top: none; }
.setting-row:hover { background: rgba(201, 169, 106, 0.04); }
.setting-row.dirty { background: rgba(201, 169, 106, 0.09); box-shadow: inset 3px 0 0 var(--gold); }
.setting-label { min-width: 0; }
.setting-name { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); }
.setting-name .badge { font-size: 10px; padding: 1px 6px; }
.setting-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--gold-dark); margin-top: 2px; }
.setting-remark { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.setting-control { flex: 0 0 auto; display: flex; align-items: center; }
.setting-input {
  width: 240px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
textarea.setting-input { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.setting-input:focus { border-color: var(--gold); outline: none; }
.setting-input:disabled { opacity: .45; cursor: not-allowed; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  position: relative;
  width: 42px; height: 23px;
  border-radius: 999px;
  background: rgba(138, 110, 66, 0.4);
  border: 1px solid var(--border);
  transition: all .22s;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--muted);
  transition: all .22s;
}
.switch input:checked + .switch-track { background: rgba(201, 169, 106, 0.35); border-color: var(--gold); }
.switch input:checked + .switch-track::after { left: 21px; background: var(--gold-light); }
.switch input:disabled + .switch-track { opacity: .45; cursor: not-allowed; }
.switch-text { font-size: 12px; color: var(--muted); min-width: 28px; }
.switch input:checked ~ .switch-text { color: var(--gold); }

/* 公告弹窗字段 */
.modal-card .field { display: block; margin-bottom: 12px; font-size: 12.5px; color: var(--muted); }
.modal-card .field input,
.modal-card .field textarea,
.modal-card .field select {
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font: 13px/1.5 inherit;
}
.modal-card .field input:focus,
.modal-card .field textarea:focus,
.modal-card .field select:focus { border-color: var(--gold); outline: none; }
.field-row { display: flex; gap: 20px; margin-bottom: 12px; }
.modal-card .check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.modal-card .check input { width: auto; margin: 0; accent-color: var(--gold); }

.audit-diff { font-size: 11px; max-width: 320px; word-break: break-all; }

.btn.primary { box-shadow: 0 0 0 1px var(--gold); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

@media (max-width: 900px) {
  .setting-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .setting-input { width: 100%; }
}
