/* ================= 种草分发平台 · 深色主题（对齐交互原型） ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0e17;
  --bg2: #0f1421;
  --card: #141b2b;
  --card2: #1a2337;
  --card3: #202b42;

  --line: #263149;
  --line2: #32405f;

  --text: #e8edf7;
  --sub: #98a4bc;
  --mute: #6b7893;

  --primary: #6366f1;
  --primary2: #8b5cf6;
  --primary-d: #4f46e5;
  --primary-soft: rgba(99, 102, 241, .16);
  --cyan: #22d3ee;

  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .13);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, .13);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .13);
  --pink: #f472b6;

  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #22d3ee 100%);
  --side: #0d1220;

  --r: 12px;
  --r-lg: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; }
a { color: var(--cyan); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
input, textarea, select { outline: none; }
input::placeholder, textarea::placeholder { color: var(--mute); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

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

.side {
  width: 218px; flex: none; background: var(--side);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side .brand {
  padding: 20px 18px 18px; display: flex; align-items: center; gap: 11px;
  border-bottom: 1px solid var(--line);
}
.side .brand .logo {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: var(--grad); display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 5px 16px rgba(99, 102, 241, .4);
}
.side .brand b { color: #fff; font-size: 14.5px; font-weight: 600; display: block; line-height: 1.3; }
.side .brand small { font-size: 11px; color: var(--mute); }

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav .group {
  font-size: 11px; color: var(--mute); padding: 14px 11px 6px;
  letter-spacing: .5px; text-transform: uppercase;
}
.nav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 9px;
  color: var(--sub); font-size: 13.5px; margin-bottom: 2px; transition: .18s;
}
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.on {
  background: var(--primary-soft); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .35);
}
.nav a .ico { width: 16px; text-align: center; font-size: 13px; opacity: .95; }

.side .foot { padding: 14px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--mute); }

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

.top {
  height: 62px; background: rgba(10, 14, 23, .92); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 26px; gap: 14px;
  position: sticky; top: 0; z-index: 20;
}
.top h1 { font-size: 16px; font-weight: 600; letter-spacing: .2px; }
.top .sp { flex: 1; }
.top .who { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--sub); }
.top .avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft);
  color: var(--primary2); display: grid; place-items: center; font-weight: 600; font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .3);
}

.body { padding: 24px 26px 48px; flex: 1; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.card + .card { margin-top: 16px; }
.card-h { padding: 15px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card-h h2 { font-size: 14.5px; font-weight: 600; }
.card-h .sp { flex: 1; }
.card-b { padding: 18px 20px; }
.card-b.tight { padding: 0; }

/* ---------- 统计 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--grad); opacity: .8;
}
.stat small { font-size: 12px; color: var(--muted, var(--sub)); display: block; }
.stat b { font-size: 25px; font-weight: 700; letter-spacing: -.6px; display: block; margin-top: 3px; color: #fff; }
.stat .d { font-size: 11.5px; color: var(--success); margin-top: 2px; }
.stat .d.bad { color: var(--danger); }
.stat .d.warn { color: var(--warn); }

/* 趋势条 */
.trend { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding: 10px 4px 0; }
.trend .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend .bar i {
  display: block; width: 100%; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #6366f1, rgba(99, 102, 241, .25));
  min-height: 4px; transition: .3s;
}
.trend .bar span { font-size: 10.5px; color: var(--mute); white-space: nowrap; }
.trend .bar em { font-size: 11px; color: var(--sub); font-style: normal; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line2); background: var(--card2); color: var(--text);
  padding: 8px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: .18s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: #fff; background: var(--card3); }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 18px rgba(99, 102, 241, .32); }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.danger { color: var(--danger); border-color: rgba(248, 113, 113, .38); }
.btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--sub); }
.btn.ghost:hover { background: var(--card2); color: var(--text); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 7px; color: var(--text); }
.field .tip { font-size: 12px; color: var(--mute); margin-top: 6px; line-height: 1.65; }
.input, .field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line2); border-radius: 9px; padding: 9px 12px;
  font-size: 13.5px; background: var(--bg2); transition: .18s; color: var(--text);
}
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, .16);
}
.field textarea { resize: vertical; min-height: 84px; line-height: 1.7; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
select option { background: var(--card2); color: var(--text); }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 500; color: var(--sub); font-size: 12.5px;
  padding: 11px 16px; background: var(--bg2); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: .15s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .025); }
.table .num { font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500;
  padding: 2px 9px; border-radius: 20px; background: var(--card3); color: var(--sub);
  white-space: nowrap; border: 1px solid var(--line2);
}
.badge.ok { background: var(--success-soft); color: var(--success); border-color: rgba(52, 211, 153, .3); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(251, 191, 36, .3); }
.badge.bad { background: var(--danger-soft); color: var(--danger); border-color: rgba(248, 113, 113, .3); }
.badge.info { background: var(--primary-soft); color: #a5b4fc; border-color: rgba(99, 102, 241, .35); }

/* ---------- 空态 ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--mute); }
.empty .ic { font-size: 34px; margin-bottom: 10px; opacity: .45; }
.empty p { font-size: 13.5px; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .sp { flex: 1; }
.toolbar .search { width: 230px; }
.toolbar select {
  border: 1px solid var(--line2); border-radius: 9px; padding: 8px 10px;
  background: var(--bg2); font-size: 13px; color: var(--text);
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(4, 7, 13, .72); display: grid; place-items: center;
  z-index: 100; padding: 20px; animation: fade .16s; backdrop-filter: blur(3px);
}
.modal {
  background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-lg);
  width: 100%; max-width: 500px; max-height: 90vh; overflow: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.modal.wide { max-width: 760px; }
.modal-h { padding: 18px 22px 14px; font-size: 15.5px; font-weight: 600; border-bottom: 1px solid var(--line); }
.modal-b { padding: 18px 22px 6px; }
.modal-f { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 16px);
  background: var(--card3); color: #fff; font-size: 13.5px; padding: 11px 20px;
  border-radius: 11px; border: 1px solid var(--line2);
  opacity: 0; pointer-events: none; transition: .22s; z-index: 200; max-width: 80vw;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: #3b1519; border-color: rgba(248, 113, 113, .5); color: #fca5a5; }
#toast.ok { background: #0f2a22; border-color: rgba(52, 211, 153, .5); color: #6ee7b7; }

/* ---------- 向导 ---------- */
.steps2 { display: flex; gap: 0; margin-bottom: 24px; }
.steps2 .s { flex: 1; display: flex; align-items: center; gap: 9px; position: relative; }
.steps2 .s:not(:last-child)::after { content: ""; flex: 1; height: 1px; background: var(--line2); margin: 0 12px; }
.steps2 .n {
  width: 26px; height: 26px; border-radius: 50%; background: var(--card3); color: var(--sub);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none;
  border: 1px solid var(--line2);
}
.steps2 .l { font-size: 13px; color: var(--sub); white-space: nowrap; }
.steps2 .s.on .n { background: var(--grad); color: #fff; border: 0; box-shadow: 0 4px 12px rgba(99, 102, 241, .4); }
.steps2 .s.on .l { color: var(--text); font-weight: 500; }
.steps2 .s.done .n { background: var(--success-soft); color: var(--success); border-color: rgba(52, 211, 153, .4); }

/* ---------- 上传 ---------- */
.drop {
  border: 2px dashed var(--line2); border-radius: var(--r-lg); padding: 40px 20px;
  text-align: center; cursor: pointer; transition: .2s; background: var(--bg2);
}
.drop:hover, .drop.over { border-color: var(--primary); background: rgba(99, 102, 241, .07); }
.drop .ic { font-size: 30px; margin-bottom: 8px; }
.drop b { font-size: 14px; display: block; }
.drop small { color: var(--mute); font-size: 12.5px; }

.filelist { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg2); }
.fitem { display: flex; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.fitem:last-child { border-bottom: 0; }
.fitem .no {
  width: 26px; height: 26px; border-radius: 7px; background: var(--card3); color: var(--sub);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none;
}
.fitem .info { flex: 1; min-width: 0; }
.fitem .info b { font-size: 13.5px; font-weight: 500; display: block; }
.fitem .info small { color: var(--mute); font-size: 12px; }
.fitem .st { font-size: 12px; color: var(--sub); white-space: nowrap; }

.progress { height: 6px; background: var(--card3); border-radius: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--grad); border-radius: 6px; transition: width .3s; width: 0; }

/* ---------- 通用 ---------- */
.muted { color: var(--sub); }
.tiny { font-size: 12px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.hint-box {
  background: rgba(99, 102, 241, .1); color: #b8c0ff;
  border: 1px solid rgba(99, 102, 241, .25);
  border-radius: 10px; padding: 11px 14px; font-size: 12.5px; line-height: 1.75;
}
.hint-box.warn { background: var(--warn-soft); color: #fcd34d; border-color: rgba(251, 191, 36, .3); }
.hint-box.danger { background: var(--danger-soft); color: #fca5a5; border-color: rgba(248, 113, 113, .3); }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.tag {
  display: inline-block; font-size: 12px; color: #a5b4fc; background: var(--primary-soft);
  padding: 2px 8px; border-radius: 6px; margin-right: 6px; border: 1px solid rgba(99, 102, 241, .25);
}

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 520px at 50% -12%, rgba(99, 102, 241, .22), transparent 62%), var(--bg);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--card);
  border-radius: 18px; padding: 34px 32px 30px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55); border: 1px solid var(--line2);
}
.login-card .logo {
  width: 46px; height: 46px; border-radius: 13px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-size: 21px; font-weight: 800;
  margin-bottom: 18px; box-shadow: 0 8px 22px rgba(99, 102, 241, .4);
}
.login-card h1 { font-size: 20px; font-weight: 600; letter-spacing: -.3px; }
.login-card .sub { color: var(--sub); font-size: 13px; margin-top: 5px; margin-bottom: 24px; }
.login-card .err { color: var(--danger); font-size: 12.5px; min-height: 18px; margin-bottom: 8px; }

/* ---------- 二维码 ---------- */
.qr-box { text-align: center; padding: 10px; }
.qr-box img, .qr-box canvas {
  width: 196px; height: 196px; border-radius: 10px; background: #fff; padding: 8px;
  border: 1px solid var(--line2);
}
.qr-box .link { font-size: 12px; color: var(--sub); word-break: break-all; margin-top: 10px; }

/* ---------- 筛选条 ---------- */
.filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 13px 16px; background: var(--bg2); border-bottom: 1px solid var(--line);
}
.filters select, .filters input {
  border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px;
  background: var(--card2); font-size: 12.5px; color: var(--text);
}
.filters .sp { flex: 1; }

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  .side { position: fixed; left: -220px; z-index: 60; transition: .22s; }
  .side.open { left: 0; }
  .body { padding: 16px; }
  .top { padding: 0 16px; }
  .table { font-size: 12.5px; }
  .table th, .table td { padding: 10px 12px; }
  .steps2 .l { display: none; }
}
