:root {
  --bg-0: #04060b;
  --bg-1: #080c14;
  --bg-2: #0e141f;
  --line: rgba(232, 195, 107, 0.18);
  --gold: #e8c36b;
  --gold-bright: #ffd77a;
  --cyan: #00f0ff;
  --text-1: #eaf2ff;
  --text-2: #8fa3bf;
  --text-3: #4e5c73;
  --danger: #ff6b81;
  --ok: #22e3a0;
  --warn: #ffc53d;
}

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

body {
  background: var(--bg-0);
  color: var(--text-1);
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(232, 195, 107, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 195, 107, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 0%, #000, transparent 75%);
  z-index: 0;
}

.hidden { display: none !important; }

/* ================= 登录 ================= */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 420px;
  padding: 40px 36px;
  background: rgba(14, 20, 31, 0.72);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(18px);
  box-shadow: 0 0 60px rgba(232, 195, 107, 0.12);
}

.login-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }

.logo-mark {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--gold-bright);
  border: 1px solid var(--gold);
  background: rgba(232, 195, 107, 0.1);
  box-shadow: 0 0 24px rgba(232, 195, 107, 0.3);
}

.logo-mark.small { width: 36px; height: 36px; font-size: 13px; border-radius: 8px; }

.login-brand h1 { font-size: 24px; letter-spacing: 2px; }

.login-brand h1 span { font-size: 12px; color: var(--gold); letter-spacing: 3px; margin-left: 8px; }

.login-brand p { font-size: 12px; color: var(--text-3); margin-top: 6px; letter-spacing: 1px; }

.field { margin-bottom: 18px; }

.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 8px; letter-spacing: 1px; }

.field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  font-size: 14px;
  outline: none;
}

.field input:focus { border-color: var(--gold); box-shadow: 0 0 16px rgba(232, 195, 107, 0.2); }

.btn-primary {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(100deg, #e8c36b, #ff9d3c);
  color: #1a1206;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 4px;
  cursor: pointer;
  margin-top: 8px;
}

.btn-primary:hover { filter: brightness(1.08); }

.tip { margin-top: 14px; font-size: 12px; color: var(--danger); min-height: 18px; }

.login-foot { margin-top: 18px; font-size: 11px; color: var(--text-3); line-height: 1.7; border-top: 1px dashed rgba(255, 255, 255, 0.08); padding-top: 14px; }

/* ================= 主框架 ================= */
.app-wrap { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: rgba(8, 12, 20, 0.9);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 20px 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }

.side-brand-txt strong { display: block; font-size: 16px; letter-spacing: 2px; }

.side-brand-txt small { font-size: 10px; color: var(--gold); letter-spacing: 2px; }

.nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav a {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}

.nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-1); }

.nav a.active {
  color: var(--gold-bright);
  background: rgba(232, 195, 107, 0.08);
  border-left-color: var(--gold);
}

.side-foot { padding: 16px 20px 0; border-top: 1px solid rgba(255, 255, 255, 0.06); font-size: 12px; color: var(--text-3); }

.btn-ghost {
  margin-top: 10px;
  width: 100%;
  height: 34px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
}

.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.main { flex: 1; min-width: 0; padding: 24px 28px 60px; }

.topbar { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }

.topbar h2 { font-size: 22px; letter-spacing: 1px; }

.topbar .sub { font-size: 12px; color: var(--text-3); margin-top: 6px; letter-spacing: 1px; }

.topbar-right { display: flex; gap: 10px; }

.pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--gold);
  border: 1px solid rgba(232, 195, 107, 0.3);
  background: rgba(232, 195, 107, 0.06);
}

.pill.ghost { color: var(--text-2); border-color: rgba(255, 255, 255, 0.1); background: transparent; }

/* ================= 通用组件 ================= */
.card {
  background: rgba(14, 20, 31, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 20px;
}

.grid { display: grid; gap: 16px; }

.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.stat-card { position: relative; overflow: hidden; }

.stat-card .k { font-size: 12px; color: var(--text-3); letter-spacing: 1px; }

.stat-card .v { font-size: 30px; font-weight: 800; margin-top: 10px; font-family: 'DIN Alternate', 'SF Mono', monospace; color: var(--gold-bright); }

.stat-card .u { font-size: 12px; color: var(--text-3); margin-left: 4px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; }

.section-title h3 { font-size: 15px; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }

.section-title h3::before { content: ''; width: 3px; height: 14px; background: var(--gold); box-shadow: 0 0 10px var(--gold); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }

.table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 500;
  color: var(--text-3);
  font-size: 12px;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.table td { padding: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); color: var(--text-2); }

.table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.table .strong { color: var(--text-1); font-weight: 600; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  border: 1px solid currentColor;
}

.tag.gold { color: var(--gold); }
.tag.ok { color: var(--ok); }
.tag.warn { color: var(--warn); }
.tag.danger { color: var(--danger); }
.tag.muted { color: var(--text-3); }

.btn {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid rgba(232, 195, 107, 0.35);
  background: rgba(232, 195, 107, 0.08);
  color: var(--gold);
}

.btn:hover { background: rgba(232, 195, 107, 0.16); }

.btn.danger { border-color: rgba(255, 107, 129, 0.4); background: rgba(255, 107, 129, 0.08); color: var(--danger); }

.btn.muted { border-color: rgba(255, 255, 255, 0.12); background: transparent; color: var(--text-2); }

.btn + .btn { margin-left: 6px; }

input.inline, select.inline {
  height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  font-size: 13px;
  outline: none;
}

textarea.inline {
  width: 100%;
  min-height: 90px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  font-size: 12px;
  font-family: 'SF Mono', monospace;
  outline: none;
}

.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }

.empty { text-align: center; padding: 60px 0; color: var(--text-3); font-size: 13px; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 12px 20px;
  border-radius: 10px;
  background: rgba(14, 20, 31, 0.96);
  border: 1px solid var(--line);
  color: var(--text-1);
  font-size: 13px;
  z-index: 999;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.toast.err { border-color: rgba(255, 107, 129, 0.5); color: #ffb3bf; }

.brand-foot { margin-top: 40px; text-align: center; font-size: 11px; color: var(--text-3); letter-spacing: 2px; }

/* 客户分层 */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(232, 195, 107, 0.08);
  border: 1px solid rgba(232, 195, 107, 0.35);
  color: var(--gold, #E8C36B); font-size: 13px;
}
.chip-item em { font-style: normal; opacity: 0.7; font-size: 12px; }
.chip-item a { color: var(--danger, #ff6b6b); cursor: pointer; font-size: 12px; }

/* 分层选择弹层 */
.hy-modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 99; display: flex; align-items: center; justify-content: center; }
.hy-modal-card { width: 420px; max-height: 70vh; overflow: auto; background: #0d1119; border: 1px solid rgba(232,195,107,.25); border-radius: 14px; padding: 20px; }
.hy-modal-card h3 { margin: 0 0 14px; font-size: 16px; color: #EAF2FF; }
.hy-modal-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.hy-modal-list label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #C8D6E8; }
.hy-modal-list em { font-style: normal; color: #6B7B94; font-size: 12px; }
.hy-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
/* 内容管理表单 */
.hy-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.hy-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-3, #6B7B94); }
.hy-form input, .hy-form select, .hy-form textarea {
  background: #0a0f18; border: 1px solid rgba(255,255,255,.12); border-radius: 8px;
  padding: 9px 12px; color: #EAF2FF; font-size: 13px; outline: none;
}
.hy-row { display: flex; gap: 12px; }
.hy-row label { flex: 1; }
/* 品牌 Logo 图片 */
.logo-mark-img { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; box-shadow: 0 0 18px rgba(0, 240, 255, .25); }.logo-mark-img.small { width: 34px; height: 34px; border-radius: 9px; }