/* ============ russia-b2b 管理后台样式 ============ */
:root {
  /* 品牌色取自平台 logo 的蓝 → 青渐变 */
  --brand: #1557e6;
  --brand-2: #2b8bff;
  --brand-cyan: #22d3ee;
  --grad: linear-gradient(135deg, #1557e6 0%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(21,87,230,.10), rgba(34,211,238,.10));
  --navy: #06203f;
  --navy-2: #0a2f5c;

  --primary: #1557e6;
  --primary-dark: #0f42b8;
  --bg: #f2f5fa;
  --panel: #ffffff;
  --text: #0f1b2d;
  --muted: #6b7a90;
  --border: #e6ebf3;
  --green: #14a05a;
  --red: #dc2626;
  --amber: #d97706;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 6px 18px rgba(15, 27, 45, .05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Inter", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
}
a { color: inherit; text-decoration: none; }

/* ---------- 布局 ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #101828; color: #cdd5e1; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { padding: 20px 18px; font-size: 17px; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar .logo small { display: block; font-size: 12px; font-weight: 400; color: #8a94a6; }
.nav { flex: 1; padding: 12px 8px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: #cdd5e1; font-size: 14px; margin-bottom: 2px; transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav .ico { width: 18px; text-align: center; }
.sidebar .foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 12px; color: #8a94a6; }
.sidebar .foot a { color: #cdd5e1; cursor: pointer; }
.sidebar .foot a:hover { color: #fff; }

.main { flex: 1; padding: 24px 28px; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 14px; flex-wrap: wrap;
}
.topbar h1 { font-size: 22px; font-weight: 700; }
.topbar .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- 面板/卡片 ---------- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; border-radius: 8px; padding: 8px 16px;
  transition: background 0.15s, opacity 0.15s; background: #eef1f5; color: var(--text);
}
.btn:hover { background: #e2e6ec; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: #fef2f2; color: var(--red); }
.btn-danger:hover { background: #fde4e4; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: #374151; }
.form-group input, .form-group select, .form-group textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 14px;
  outline: none; font-family: inherit; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,107,203,0.12); }
.form-group .hint { font-size: 12px; color: var(--muted); }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl th { background: #f8fafc; color: #475569; font-weight: 600; font-size: 13px; white-space: nowrap; }
table.tbl tr:hover td { background: #f8fafc; }
table.tbl .thumb { width: 46px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: #eef1f5; }

/* 徽标 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.gray { background: #eef1f5; color: #475569; }
.badge.blue { background: #e8f1fe; color: var(--primary); }
.badge.green { background: #e7f6ec; color: var(--green); }
.badge.amber { background: #fef3e2; color: var(--amber); }
.badge.red { background: #fdeaea; color: var(--red); }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0b2846, #0b6bcb); padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 36px; width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,0.25); }
.login-card h1 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 8px; }
.login-err { color: var(--red); font-size: 13px; margin-top: 12px; text-align: center; display: none; }

/* ---------- 富文本编辑器 ---------- */
.rte { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.rte-toolbar button {
  border: 1px solid transparent; background: transparent; border-radius: 6px; cursor: pointer;
  min-width: 30px; height: 30px; font-size: 13px; padding: 0 8px; color: #374151;
}
.rte-toolbar button:hover { background: #e8f1fe; color: var(--primary); }
.rte-toolbar .sep { width: 1px; background: var(--border); margin: 4px 2px; }
.rte-area { min-height: 160px; padding: 12px; outline: none; font-size: 14px; }
.rte-area:empty::before { content: attr(data-placeholder); color: #9aa3af; }

/* ---------- 图片上传 ---------- */
.img-upload { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.img-upload .preview { width: 110px; height: 82px; border: 1px dashed var(--border); border-radius: 8px; background: #f8fafc; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #9aa3af; font-size: 12px; }
.img-upload .preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 分类树 ---------- */
.cat-tree .main-cat { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; background: #fff; }
.cat-tree .main-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 600; }
.cat-tree .main-head .drag { cursor: grab; color: #9aa3af; }
.cat-tree .main-head .name { flex: 1; }
.cat-tree .sub-list { border-top: 1px solid var(--border); padding: 6px 10px; background: #fafbfc; }
.cat-tree .sub-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; }
.cat-tree .sub-item:hover { background: #f0f4fb; }
.cat-tree .sub-item .drag { cursor: grab; color: #c0c8d3; font-size: 12px; }
.cat-tree .sub-item .name { flex: 1; font-size: 13.5px; }
.cat-tree .empty-hint { color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }

.inline-input { border: 1px solid transparent; border-radius: 6px; padding: 4px 8px; font-size: 13.5px; font-family: inherit; background: transparent; width: 180px; }
.inline-input:hover, .inline-input:focus { border-color: var(--border); background: #fff; outline: none; }

/* 拖拽排序 */
.cat-tree .main-head, .cat-tree .sub-item { transition: box-shadow 0.15s, background 0.15s; }
.cat-tree .drag-over-top { box-shadow: 0 -2px 0 0 var(--primary); }
.cat-tree .drag-over-bottom { box-shadow: 0 2px 0 0 var(--primary); }
.cat-tree .dragging { opacity: 0.5; }
.cat-tree .main-head, .cat-tree .sub-item { cursor: default; }

/* ---------- 提示 ---------- */
.toast { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast .item { background: #111827; color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,0.2); animation: slidein 0.2s ease; }
.toast .item.ok { background: var(--green); }
.toast .item.err { background: var(--red); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.muted { color: var(--muted); }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.spinner { width: 30px; height: 30px; border: 3px solid #e2e8f0; border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 12px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 28px; font-weight: 800; }
.stat-card .label { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* 图表 */
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { width: 76px; font-size: 13px; color: #374151; text-align: right; flex-shrink: 0; }
.bar-track { flex: 1; height: 18px; background: #f1f4f8; border-radius: 9px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--primary), #3b8bff); transition: width 0.6s ease; }
.bar-fill.green { background: linear-gradient(90deg, #16a34a, #4ade80); }
.bar-fill.amber { background: linear-gradient(90deg, #d97706, #fbbf24); }
.bar-fill.red { background: linear-gradient(90deg, #dc2626, #f87171); }
.bar-fill.gray { background: linear-gradient(90deg, #64748b, #94a3b8); }
.bar-val { width: 40px; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.mini-table td { padding: 8px 6px; font-size: 13px; }

@media (max-width: 820px) {
  .dash-cols { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .admin-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .sidebar .logo { border-bottom: none; padding: 12px 16px; }
  .nav { display: flex; flex-wrap: wrap; padding: 8px; }
  .nav a { margin-bottom: 0; }
  .sidebar .foot { border-top: none; padding: 8px 16px; }
  .main { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- 合规拦截横幅 ---------- */
#compliance-banner {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 9999;
  width: min(680px, calc(100vw - 32px));
  background: #fff; border: 1px solid #f3b4b4; border-left: 5px solid #dc2626;
  border-radius: 10px; box-shadow: 0 12px 34px rgba(15, 23, 42, 0.18); overflow: hidden;
  animation: cbIn 0.22s ease-out;
}
@keyframes cbIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
#compliance-banner .cb-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fef2f2; color: #b91c1c; font-weight: 700; font-size: 14px; padding: 11px 14px;
}
#compliance-banner .cb-close {
  border: none; background: transparent; font-size: 20px; line-height: 1; color: #b91c1c;
  cursor: pointer; padding: 0 4px;
}
#compliance-banner .cb-body { padding: 12px 14px 14px; font-size: 13.5px; color: #334155; line-height: 1.7; }
#compliance-banner .cb-body ul { margin: 8px 0 6px; padding-left: 20px; }
#compliance-banner .cb-body li { margin: 3px 0; }
#compliance-banner .cb-body li b { color: #b91c1c; }
#compliance-banner .cb-tip { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e5e7eb; font-size: 12.5px; color: #6b7280; }
#compliance-banner .cb-tip a { color: var(--primary); }

/* ============================================================
   品牌升级（v1.3.0）· 后台高端化视觉
   ============================================================ */

body { -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }

/* ---------- 侧边栏：深海军蓝渐变 ---------- */
.sidebar {
  background: linear-gradient(180deg, #06203f 0%, #0a2f5c 62%, #07304f 100%);
  width: 232px; color: #c3d2e6;
  box-shadow: 1px 0 0 rgba(255, 255, 255, .05), 6px 0 24px rgba(6, 32, 63, .10);
}
.sidebar .logo {
  display: flex; align-items: center; gap: 12px; padding: 20px 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sidebar .logo-chip {
  width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto; display: block;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .32);
}
.sidebar .logo-text { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.3; letter-spacing: -.01em; }
.sidebar .logo-text small {
  display: block; font-size: 11.5px; font-weight: 500;
  color: #7f9cbf; margin-top: 2px; letter-spacing: .02em;
}

.nav { padding: 14px 10px; }
.nav a {
  padding: 11px 13px; border-radius: 11px; font-size: 14px; font-weight: 550;
  color: #b6c7dd; margin-bottom: 3px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; transform: translateX(2px); }
.nav a.active {
  background: var(--grad); color: #fff; font-weight: 700;
  box-shadow: 0 8px 20px rgba(21, 87, 230, .38);
}
.nav .ico { width: 20px; text-align: center; font-size: 15px; }
.sidebar .foot {
  padding: 15px 18px; border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 12px; color: #7f9cbf; line-height: 1.9;
}
.sidebar .foot a { color: #b6c7dd; }
.sidebar .foot a:hover { color: #fff; }

/* ---------- 主区 ---------- */
.main { padding: 26px 30px 40px; }
.topbar { margin-bottom: 24px; }
.topbar h1 { font-size: 23px; font-weight: 800; letter-spacing: -.022em; }

/* ---------- 面板 ---------- */
.panel {
  border-radius: 16px; border-color: rgba(15, 27, 45, .07);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-head {
  padding: 16px 20px; font-size: 15px; font-weight: 750; letter-spacing: -.008em;
  background: linear-gradient(180deg, #fff, #fbfdff);
}
.panel-body { padding: 20px; }

/* ---------- 按钮 ---------- */
.btn { border-radius: 10px; font-weight: 650; transition: all .18s ease; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 5px 15px rgba(21, 87, 230, .26); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 9px 22px rgba(21, 87, 230, .32); }
.btn:hover { background: #e7ecf4; }
.btn-danger { background: #fef2f2; color: var(--red); }
.btn-danger:hover { background: #fde4e4; }

/* ---------- 表单 ---------- */
.form-group input, .form-group select, .form-group textarea { border-radius: 10px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 4px rgba(21, 87, 230, .11);
}

/* ---------- 表格 ---------- */
table.tbl th {
  background: #f7f9fd; color: #5a6b83; font-weight: 700; font-size: 12.5px;
  letter-spacing: .02em; border-bottom: 1px solid var(--border);
}
table.tbl td { border-bottom: 1px solid #eef2f8; }
table.tbl tr:hover td { background: #f8fbff; }
table.tbl tr:last-child td { border-bottom: none; }

/* ---------- 统计卡：顶部渐变条 + 渐变数字 ---------- */
.stat-card {
  border-radius: 16px; border-color: rgba(15, 27, 45, .07); position: relative;
  overflow: hidden; box-shadow: var(--shadow); padding: 20px 22px;
}
.stat-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad);
}
.stat-card .num {
  font-size: 30px; font-weight: 800; letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.stat-card .label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 3px; }

/* ---------- 图表 ---------- */
.bar-track { background: #eef2f8; border-radius: 999px; }
.bar-fill { border-radius: 999px; }
.bar-fill { background: var(--grad); }

/* ---------- 徽标 ---------- */
.badge { border-radius: 999px; font-weight: 700; }

/* ---------- 登录页：品牌渐变 + logo ---------- */
.login-wrap {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(34, 211, 238, .28), transparent 60%),
    radial-gradient(900px 500px at 95% 110%, rgba(21, 87, 230, .32), transparent 60%),
    linear-gradient(135deg, #06203f, #0a2f5c);
}
.login-card {
  border-radius: 22px; padding: 38px 34px 34px;
  box-shadow: 0 30px 70px rgba(3, 15, 32, .45);
}
.login-card .brand-top {
  display: flex; align-items: center; gap: 13px; margin-bottom: 22px;
}
.login-card .brand-top img {
  width: 52px; height: 52px; border-radius: 14px; display: block;
  box-shadow: 0 10px 24px rgba(21, 87, 230, .28);
}
.login-card .brand-top .bt-text { font-size: 19px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.login-card .brand-top .bt-text small {
  display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px;
}
.login-card h1 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.login-card .btn { padding: 12px; border-radius: 11px; }

/* ---------- 内容审核页 ---------- */
.cb-head { border-radius: 0; }

@media (max-width: 820px) {
  .sidebar { background: linear-gradient(135deg, #06203f, #0a2f5c 70%, #07304f); }
  .nav a.active { box-shadow: none; }
}

/* ---------- 图表行对齐修正 ---------- */
.bar-row { align-items: center; gap: 12px; }
.bar-label {
  width: 124px; flex: 0 0 124px; font-size: 13px; color: #3d4d63; text-align: right;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550;
}
.bar-track { height: 20px; }
.bar-val { width: 54px; flex: 0 0 54px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 紧凑柱状图（近 14 天趋势） ---------- */
.col-chart { display: flex; align-items: flex-end; gap: 6px; height: 108px; padding: 6px 2px 0; }
.col-chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; min-width: 0; }
.col-chart .col .bar {
  width: 100%; max-width: 40px; border-radius: 6px 6px 3px 3px;
  background: var(--grad); min-height: 3px;
  transition: height .5s cubic-bezier(.2,.8,.2,1);
}
.col-chart .col.zero .bar { background: #e6ecf5; }
.col-chart .col .cap { font-size: 11px; color: var(--muted); white-space: nowrap; }
.col-chart .col .cnt { font-size: 11.5px; font-weight: 700; color: #3d4d63; font-variant-numeric: tabular-nums; }
