/* ===== VOLT 经销系统 · 大厂风格 UI ===== */
:root {
  --primary: #ff8fb8;            /* 黑粉主色 */
  --primary-dark: #ff6ba3;
  --primary-light: #fff0f6;
  --navy: #0d0e14;               /* 极黑 */
  --navy-2: #181a22;
  --bg: #f3f6fa;
  --card: #ffffff;
  --text: #1a2333;
  --muted: #8590a6;
  --border: #e8edf4;
  --danger: #f5483b;
  --warning: #faad14;
  --info: #1677ff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,30,54,.04), 0 4px 16px rgba(16,30,54,.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }

/* ===== 登录页 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: stretch; }
.login-hero { flex: 1.2; background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255,143,184,.32), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(122,95,255,.28), transparent 55%),
    linear-gradient(160deg, #0d0e14 0%, #1c1a26 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 60px 8vw; }
.login-hero .logo-mark { width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, #ff8fb8, #ffc2d9); display: flex; align-items: center;
  justify-content: center; font-size: 26px; margin-bottom: 28px; box-shadow: 0 8px 24px rgba(255,143,184,.45); }
.login-hero h1 { font-size: 34px; font-weight: 700; letter-spacing: 1px; margin-bottom: 14px; }
.login-hero .hero-sub { color: rgba(255,255,255,.65); font-size: 15px; line-height: 2; max-width: 420px; }
.login-hero .hero-badges { margin-top: 36px; display: flex; gap: 10px; flex-wrap: wrap; }
.login-hero .hero-badges span { border: 1px solid rgba(255,255,255,.25); color: rgba(255,255,255,.8);
  padding: 5px 14px; border-radius: 999px; font-size: 12px; }
.login-panel { flex: 1; display: flex; align-items: center; justify-content: center; background: #fff; }
.login-card { width: 360px; padding: 20px; }
.login-card h2 { font-size: 24px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 28px; font-size: 13px; }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 14px; font-size: 14px; transition: border-color .2s, box-shadow .2s; }
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,143,184,.12); }
.login-card button { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none;
  border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all .2s; }
.login-card button:hover { background: var(--primary-dark); box-shadow: 0 6px 16px rgba(255,143,184,.35); }
.login-err { color: var(--danger); font-size: 13px; margin-bottom: 10px; min-height: 18px; }
@media (max-width: 800px) { .login-hero { display: none; } }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 216px; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #aeb9cc; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 22px 20px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar .brand .mark { width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, #ff8fb8, #ffc2d9); display: flex; align-items: center;
  justify-content: center; font-size: 17px; box-shadow: 0 3px 10px rgba(255,143,184,.4); }
.sidebar .brand .name { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .5px; }
.sidebar .brand .name small { display: block; color: rgba(255,255,255,.45); font-size: 10px; font-weight: 400; letter-spacing: 2px; }
.sidebar nav { flex: 1; padding: 14px 10px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 9px;
  color: #aeb9cc; text-decoration: none; margin-bottom: 4px; font-size: 14px; transition: all .18s; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(255,143,184,.95), rgba(255,143,184,.78));
  color: #fff; box-shadow: 0 4px 14px rgba(255,143,184,.4); }
.nav-ico { width: 23px; height: 23px; border-radius: 7px; display: inline-flex; align-items: center;
  justify-content: center; flex: none;
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.3), 0 1px 3px rgba(0,0,0,.35); }
.sidebar .user-box { padding: 16px 18px; border-top: 1px solid rgba(255,255,255,.07); font-size: 13px;
  display: flex; align-items: center; gap: 10px; }
.sidebar .user-box .avatar { width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #7a5fff, #ff8fb8); color: #fff; display: flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.sidebar .user-box a { color: #ff9ec7; cursor: pointer; text-decoration: none; font-size: 12px; }
.main { flex: 1; padding: 26px 30px; min-width: 0; max-width: 1500px; }
.page-title { font-size: 21px; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center;
  gap: 12px; flex-wrap: wrap; letter-spacing: .3px; }
.page-title .sub { font-size: 13px; color: var(--muted); font-weight: 400; }
.page-title .spacer { flex: 1; }

/* ===== 通用组件 ===== */
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  margin-bottom: 18px; border: 1px solid rgba(232,237,244,.7); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 9px;
  border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 13px; color: var(--text);
  text-decoration: none; transition: all .18s; font-weight: 500; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(255,143,184,.3); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { color: var(--danger); border-color: #ffd4d0; }
.btn.danger:hover { background: #fff2f0; }
.btn.sm { padding: 4px 12px; font-size: 12px; border-radius: 7px; }
input, select, textarea { padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 13px; font-family: inherit; background: #fff; transition: border-color .18s, box-shadow .18s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,143,184,.1); }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; padding: 11px 12px; color: var(--muted); font-weight: 600;
  font-size: 11px; letter-spacing: .8px; text-transform: uppercase; border-bottom: 1px solid var(--border);
  white-space: nowrap; background: #fafcfe; }
table.grid th:first-child { border-radius: 8px 0 0 0; }
table.grid th:last-child { border-radius: 0 8px 0 0; }
table.grid td { padding: 12px; border-bottom: 1px solid #f2f5f9; vertical-align: middle; }
table.grid tr:hover td { background: #fff7fb; }
table.grid tr:last-child td { border-bottom: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag.direct { background: #fff7e6; color: #d48806; }
.tag.self { background: #e6f4ff; color: #1677ff; }
.tag.risk { background: #fff1f0; color: var(--danger); }
.tag.ok { background: var(--primary-light); color: var(--primary-dark); }
.tag.grey { background: #f0f2f7; color: var(--muted); }
.muted { color: var(--muted); font-size: 12px; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }

/* ===== 弹窗 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(10,26,48,.5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 16px; width: 740px; max-width: 94vw; max-height: 90vh;
  overflow: auto; padding: 26px; box-shadow: 0 24px 80px rgba(10,26,48,.25); }
.modal h3 { margin-bottom: 18px; font-size: 17px; letter-spacing: .3px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px;
  padding-top: 16px; border-top: 1px solid var(--border); }

/* ===== 看板 ===== */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  border: 1px solid rgba(232,237,244,.7); display: flex; gap: 14px; align-items: center;
  transition: transform .2s, box-shadow .2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,30,54,.1); }
.stat-card .icon { width: 44px; height: 44px; border-radius: 12px; flex: none; display: flex;
  align-items: center; justify-content: center; font-size: 20px; }
.stat-card .label { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.stat-card .value { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.stat-card .value.green { color: var(--primary-dark); }
.stat-card .value.red { color: var(--danger); }
.chart-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 18px; }
.chart-box { height: 300px; }
@media (max-width: 1000px) { .chart-row { grid-template-columns: 1fr; } }

/* ===== 风险面板 ===== */
.risk-panel { border: 1px solid #ffd4d0; background: linear-gradient(180deg, #fffafa, #fff5f4);
  border-radius: 12px; padding: 16px 18px; margin-top: 14px; }
.risk-panel h4 { color: var(--danger); margin-bottom: 12px; font-size: 14px; display: flex;
  align-items: center; gap: 6px; }
.risk-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0;
  border-bottom: 1px dashed #ffe0dc; }
.risk-item:last-child { border-bottom: none; }
.risk-item input { margin-top: 3px; accent-color: var(--primary); width: 15px; height: 15px; }
.risk-item .who { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }

.attach-list { margin-top: 8px; }
.attach-list a { color: var(--info); text-decoration: none; font-size: 13px; }
.attach-list .row { display: flex; align-items: center; gap: 8px; padding: 7px 0;
  border-bottom: 1px dashed var(--border); }
.attach-list .row .del { color: var(--danger); cursor: pointer; font-size: 12px; }

.toast { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); background: var(--navy);
  color: #fff; padding: 11px 24px; border-radius: 10px; z-index: 999; font-size: 13px;
  box-shadow: 0 8px 28px rgba(10,26,48,.35); }
.toast.err { background: var(--danger); }

.detail-kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; margin-bottom: 10px; }
.detail-kv .k { font-size: 12px; color: var(--muted); font-weight: 500; }
.detail-kv .v { font-size: 14px; margin-top: 3px; word-break: break-all; font-weight: 500; }
.section-h { font-weight: 700; margin: 18px 0 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.section-h::before { content: ''; width: 4px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, #ff8fb8, #ffc2d9); }

/* 登录失败弹窗（淡入淡出） */
.login-mask { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center;
  justify-content: center; background: rgba(13, 14, 20, .45); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .28s ease; }
.login-mask.show { opacity: 1; }
.login-dialog { background: #fff; border-radius: 18px; padding: 30px 34px 26px; width: 320px;
  text-align: center; box-shadow: 0 24px 70px rgba(10, 12, 30, .35);
  transform: translateY(14px) scale(.95); transition: transform .28s cubic-bezier(.2, .9, .3, 1.2); }
.login-mask.show .login-dialog { transform: none; }
.login-dialog h3 { font-size: 16px; color: var(--navy); }
