/* ============ 平台信息管理 全局样式 ============ */
:root {
  --sidebar-w: 240px;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --primary: #2563eb;
  --bg: #f1f5f9;
}

body { background: var(--bg); font-size: 14px; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  display: flex; flex-direction: column;
  z-index: 1040;
}
.sidebar-static { position: static; width: 100%; height: 100%; }
.sidebar-brand {
  padding: 20px 22px; font-size: 16px; font-weight: 700;
  color: #fff; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand i { color: #60a5fa; font-size: 20px; }
.sidebar-menu { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 8px;
  color: var(--sidebar-text); text-decoration: none; font-weight: 500;
  transition: all .15s;
}
.menu-item i { font-size: 17px; width: 20px; text-align: center; }
.menu-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.menu-item.active { color: #fff; background: var(--primary); box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.sidebar-user { padding: 14px; border-top: 1px solid rgba(255,255,255,.06); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.user-name { color: #e2e8f0; font-weight: 600; font-size: 13px; }
.badge-admin { background: rgba(96,165,250,.2); color: #93c5fd; font-size: 10px; padding: 1px 6px; border-radius: 6px; margin-left: 6px; font-weight: 500; }
.btn-logout { background: none; border: none; color: #64748b; font-size: 12px; padding: 0; text-decoration: none; }
.btn-logout:hover { color: #f87171; }

.mobile-topbar {
  background: var(--sidebar-bg); color: #fff;
  padding: 10px 14px; display: flex; align-items: center; gap: 10px;
}
.sidebar-offcanvas { background: var(--sidebar-bg); width: var(--sidebar-w) !important; }

/* ---------- 主内容 ---------- */
.main { margin-left: var(--sidebar-w); padding: 24px 28px 48px; min-height: 100vh; }
@media (max-width: 991.98px) { .main { margin-left: 0; padding: 18px 14px 40px; } }

.flash-wrap { margin-bottom: 18px; }
.flash-wrap .alert { border-radius: 10px; }

.page-header h4 { font-weight: 700; }

/* ---------- 卡片 ---------- */
.card { border: none; border-radius: 12px; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.card-header { border-bottom: 1px solid #f1f5f9; border-radius: 12px 12px 0 0 !important; font-size: 14px; padding: 14px 18px; }

/* KPI */
.kpi-card { display: flex; align-items: center; gap: 14px; padding: 18px; }
.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  flex-shrink: 0;
}
.kpi-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.kpi-value.small-value { font-size: 15px; word-break: break-all; }
.kpi-label { color: #64748b; font-size: 12.5px; margin-top: 2px; }

/* ---------- 表格 ---------- */
.table thead th {
  background: #f8fafc; color: #64748b; font-size: 12.5px; font-weight: 600;
  border-bottom: 1px solid #e2e8f0; white-space: nowrap;
}
.table td { vertical-align: middle; }
.order-table td, .product-table td { white-space: nowrap; }

/* ---------- 登录页 ---------- */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(800px 400px at 20% 10%, rgba(37,99,235,.15), transparent),
    radial-gradient(700px 400px at 85% 85%, rgba(139,92,246,.12), transparent),
    #0f172a;
}
.login-wrap { width: 100%; max-width: 400px; padding: 0 16px; }
.login-card {
  background: #fff; border-radius: 16px; padding: 36px 34px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-logo {
  width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(37,99,235,.4);
}
.login-footer { text-align: center; color: #475569; font-size: 12px; margin-top: 20px; }

/* ---------- 标签页 ---------- */
.nav-tabs .nav-link { color: #475569; font-weight: 500; border: none; padding: 10px 18px; border-radius: 8px 8px 0 0; }
.nav-tabs .nav-link.active { color: var(--primary); border-bottom: 2px solid var(--primary); background: transparent; }
.tab-content { min-height: 300px; }

/* ---------- 弹窗 ---------- */
.modal-content { border: none; border-radius: 14px; }
.modal-header { border-bottom: 1px solid #f1f5f9; }

/* ---------- 产品曝光看板（dash- 前缀，避免与 bootstrap 冲突） ---------- */
.dash-hd {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 14px; padding: 26px 30px; color: #fff; margin-bottom: 22px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.dash-hd h1 { font-size: 26px; font-weight: 700; }
.dash-hd p { opacity: .85; margin-top: 6px; font-size: 14px; }
.dash-hd-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dash-sync-info { font-size: 12.5px; opacity: .9; text-align: right; }
.dash-sync-btn {
  background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.35);
  padding: 8px 18px; border-radius: 10px; font-size: 14px; cursor: pointer; font-weight: 600;
  transition: all .2s;
}
.dash-sync-btn:hover { background: rgba(255,255,255,.3); }

.dash-filter {
  background: #fff; border-radius: 14px; padding: 16px 22px; margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06); display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.dash-filter label { font-weight: 600; color: #555; font-size: 15px; }
.dash-filter input[type="date"] { padding: 7px 12px; border: 1.5px solid #ddd; border-radius: 10px; font-size: 14px; outline: none; transition: border-color .2s; }
.dash-filter input[type="date"]:focus { border-color: #667eea; }
.dash-filter button {
  background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none;
  padding: 8px 24px; border-radius: 10px; font-size: 14px; cursor: pointer; font-weight: 600; transition: opacity .2s;
}
.dash-filter button:hover { opacity: .9; }
.dash-date-labels { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-date-labels .dl {
  background: #eef0f5; border-radius: 14px; padding: 5px 14px; font-size: 13px;
  cursor: pointer; transition: all .2s; color: #555; user-select: none;
}
.dash-date-labels .dl:hover { background: #dde0ea; }
.dash-date-labels .dl.active { background: #667eea; color: #fff; }

.dash-sr { display: flex; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.dash-sc {
  background: #fff; border-radius: 12px; padding: 18px 22px; flex: 1; min-width: 140px;
  text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.dash-sc .v { font-size: 28px; font-weight: 700; }
.dash-sc .l { font-size: 14px; color: #888; margin-top: 5px; }

.dash-card {
  background: #fff; border-radius: 14px; padding: 22px 26px; margin-bottom: 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.dash-ch { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; gap: 10px; }
.dash-chl { display: flex; align-items: center; gap: 14px; }
.dash-rank {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 22px; background: #f5f5f5; flex-shrink: 0;
}
.dash-name { font-size: 19px; font-weight: 600; }
.dash-tags { display: flex; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.dash-tag { display: inline-block; background: #eef0f5; border-radius: 14px; padding: 3px 14px; font-size: 13px; }
.dash-tagp { display: inline-block; border-radius: 14px; padding: 3px 14px; font-size: 13px; color: #fff; }
.dash-chs { font-size: 15px; color: #555; white-space: nowrap; }
.dash-mr { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-mi { flex: 1; min-width: 100px; background: #f7f8fc; border-radius: 8px; padding: 12px 16px; text-align: center; }
.dash-mi .ml { font-size: 12px; color: #999; letter-spacing: .5px; }
.dash-mi .mv { font-size: 20px; font-weight: 700; color: #222; margin-top: 3px; }
.dash-mi .pd { font-size: 12px; color: #aaa; margin-top: 2px; }
.dash-cc { position: relative; height: 320px; }

/* ---------- SKU 多选筛选器 ---------- */
.sku-filter { position: relative; }
.sku-dropdown-btn {
  background: #fff; border: 1.5px solid #ddd; border-radius: 10px; padding: 7px 14px;
  font-size: 14px; cursor: pointer; transition: border-color .2s; color: #333;
}
.sku-dropdown-btn:hover { border-color: #667eea; }
.sku-dropdown-menu { width: 320px; max-width: 85vw; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.15); border: none; }
.sku-search-wrap { position: relative; padding: 10px 12px 6px; }
.sku-search-wrap i { position: absolute; left: 22px; top: 18px; color: #999; font-size: 13px; }
.sku-search-wrap input { padding-left: 30px; }
.sku-actions { border-bottom: 1px solid #f1f5f9; }
.sku-list { max-height: 300px; overflow-y: auto; padding: 4px 0; }
.sku-item { cursor: pointer; font-size: 13.5px; }
.sku-item:hover { background: #f8fafc; }
.sku-item-name { max-width: 170px; }
.sku-item-cat { font-size: 11px; font-weight: 400; }
.sku-only-btn {
  /* 彻底绕开 Bootstrap .btn —— 完全自控 */
  display: inline-block; vertical-align: middle;
  border: none !important; background: none !important; padding: 0 2px !important; margin: 0;
  color: #667eea !important; font-size: 11px !important; line-height: 1.5; font-family: inherit;
  cursor: pointer; text-align: center; text-decoration: none;
  border-radius: 0; outline: none;
  align-self: center; flex-shrink: 0; height: auto !important;
  transition: color .15s;
}
.sku-only-btn::-moz-focus-inner { border: 0; padding: 0; }
.sku-only-btn:hover { color: #4f6be0; text-decoration: underline; }
.sku-actions .btn-link { text-decoration: none; }
.sku-actions .btn-link:hover { text-decoration: none; background: transparent; color: #667eea; }
.sku-footer { border-top: 1px solid #f1f5f9; background: #fafbfc; border-radius: 0 0 12px 12px; }

/* ---------- 移动端（手机/窄窗口）进一步压缩 ---------- */
@media (max-width: 575.98px) {
  .sku-only-btn {
    font-size: 11px; padding: 0 1px;
  }
  .sku-item {
    padding-top: 2px !important; padding-bottom: 2px !important;
    font-size: 12.5px;
  }
  .sku-item-name { max-width: 130px; }
  .sku-dropdown-menu { width: 92vw; }
  .sku-list { max-height: 42vh; }
  .sku-dropdown-btn { padding: 6px 10px; font-size: 13px; }
  .sku-footer { font-size: 11px; padding: 6px 12px; }
}

/* ---------- 加载/空状态 ---------- */
.dash-loading { text-align: center; padding: 40px; color: #667eea; font-size: 15px; }
.dash-empty { text-align: center; padding: 60px 20px; color: #999; background: #fff; border-radius: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }

@media (max-width: 991.98px) {
  .dash-hd { padding: 20px; }
  .dash-card { padding: 16px 14px; }
  .dash-cc { height: 260px; }
  .dash-chs { white-space: normal; }
}

/* ---------- 全局：阻止移动浏览器自动放大小字号 ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* ---------- 分页 ---------- */
.pagination .page-link { color: var(--primary); border-color: #e2e8f0; }
.pagination .active .page-link { background: var(--primary); border-color: var(--primary); }

/* ---------- 其它 ---------- */
code { background: #f1f5f9; padding: 2px 6px; border-radius: 6px; font-size: 12px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.form-text { font-size: 12px; }
