/* ====================================================
   全局样式：商务浅色后台风格
   ==================================================== */

:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-light: #eff6ff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --line: #e2e8f0;
  --bg: #f5f7fa;
  --card: #ffffff;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

#app { height: 100%; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
}

.login-hero {
  flex: 1;
  padding: 64px 56px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-hero h1 {
  font-size: 38px;
  line-height: 1.25;
  margin: 0 0 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.login-hero .sub {
  font-size: 16px;
  opacity: 0.88;
  line-height: 1.8;
  margin-bottom: 40px;
  max-width: 520px;
}

.plan-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  backdrop-filter: blur(6px);
  max-width: 520px;
}

.plan-card .pname { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.plan-card .pdesc { font-size: 13px; opacity: 0.85; line-height: 1.7; }

.login-panel {
  width: 460px;
  background: #fff;
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-panel h2 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
}

.login-panel .tip {
  color: var(--ink-3);
  font-size: 13px;
  margin-bottom: 28px;
}

.login-foot {
  margin-top: 20px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

.login-foot a { color: var(--brand); text-decoration: none; cursor: pointer; }
.login-foot a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .login-hero { display: none; }
  .login-panel { width: 100%; }
}

/* ---------- 主框架 ---------- */
.layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 220px;
  background: #0f172a;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar .logo {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: 0.5px;
}

.sidebar .logo .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #38bdf8; margin-right: 10px; flex-shrink: 0;
}

.menu { padding: 12px 0; flex: 1; overflow-y: auto; }

.menu-item {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all .16s;
  border-left: 3px solid transparent;
}

.menu-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.menu-item.active {
  background: rgba(37, 99, 235, 0.22);
  color: #fff;
  border-left-color: #3b82f6;
  font-weight: 500;
}

.menu-item .ico { margin-right: 10px; font-size: 15px; width: 18px; text-align: center; }

.sidebar-foot {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #64748b;
}

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.topbar .page-title { font-size: 17px; font-weight: 600; }
.topbar .right { display: flex; align-items: center; gap: 14px; }

.content { flex: 1; overflow-y: auto; padding: 20px 24px 40px; }

/* ---------- 卡片 / 统计 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.stat-card .label { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-card .unit { font-size: 13px; color: var(--ink-3); margin-left: 4px; font-weight: 400; }
.stat-card.accent { border-left: 3px solid var(--brand); }
.stat-card.ok .value { color: var(--ok); }
.stat-card.warn .value { color: var(--warn); }
.stat-card.danger .value { color: var(--danger); }

/* ---------- 信息行 ---------- */
.info-row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-row .k { width: 140px; color: var(--ink-3); flex-shrink: 0; }
.info-row .v { flex: 1; color: var(--ink); word-break: break-all; }

/* ---------- 工具条 ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.toolbar .spacer { flex: 1; }

/* ---------- 其它 ---------- */
.text-mute { color: var(--ink-3); }
.text-sm { font-size: 12px; }
.mb-0 { margin-bottom: 0; }
.mt-8 { margin-top: 8px; }
.nowrap { white-space: nowrap; }

.link-url {
  color: var(--brand);
  text-decoration: none;
  word-break: break-all;
}
.link-url:hover { text-decoration: underline; }

.expire-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ok-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.info-banner {
  background: var(--brand-light);
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.quota-bar {
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 8px;
}
.quota-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 4px;
  transition: width .3s;
}

.el-table .cell { word-break: break-word; }

.selector-tip {
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.8;
  margin-bottom: 12px;
}

/* ====================================================
   商品比价模块
   ==================================================== */

/* ---------- 商品卡片网格 ---------- */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 14px;
}

.prod-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .18s, transform .18s, border-color .18s;
  cursor: pointer;
  position: relative;
}

.prod-card:hover {
  box-shadow: 0 6px 20px rgba(15, 23, 42, .1);
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.prod-thumb {
  height: 168px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.prod-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.prod-thumb .noimg {
  color: #cbd5e1;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.prod-thumb .noimg span { font-size: 30px; }

.prod-body { padding: 12px 13px 13px; flex: 1; display: flex; flex-direction: column; }

.prod-brand {
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prod-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 37px;
}

.prod-name-cn {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prod-price {
  margin-top: 9px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.prod-price .p {
  font-size: 18px;
  font-weight: 700;
  color: var(--danger);
  line-height: 1;
}

.prod-price .n { font-size: 11px; color: var(--ink-3); }

.prod-meta {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.prod-seller {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 关注星标 ---------- */
.fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  z-index: 2;
  transition: all .16s;
  color: #cbd5e1;
}
.fav-btn:hover { transform: scale(1.12); border-color: #fbbf24; color: #f59e0b; }
.fav-btn.on { color: #f59e0b; border-color: #fcd34d; background: #fffbeb; }

/* ---------- 库存角标 ---------- */
.stock-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  z-index: 2;
  font-weight: 500;
}
.stock-badge.in { background: #dcfce7; color: #166534; }
.stock-badge.out { background: #f1f5f9; color: #64748b; }

/* ---------- 分类快捷条 ---------- */
.cat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.cat-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all .16s;
  color: var(--ink-2);
  user-select: none;
}
.cat-chip:hover { border-color: var(--brand); color: var(--brand); }
.cat-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 500;
}
.cat-chip .c { opacity: .7; font-size: 11px; margin-left: 4px; }

/* ---------- 详情抽屉 ---------- */
.detail-hero { display: flex; gap: 18px; margin-bottom: 18px; }

.detail-img {
  width: 190px;
  height: 190px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.detail-img img { max-width: 100%; max-height: 100%; object-fit: contain; }

.detail-info { flex: 1; min-width: 0; }
.detail-info h3 { margin: 0 0 6px; font-size: 18px; line-height: 1.4; }
.detail-info .cn { color: var(--ink-2); font-size: 14px; margin-bottom: 12px; }

.variant-list { display: flex; flex-direction: column; gap: 8px; }

.variant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 13px;
}
.variant-row .size { color: var(--ink-2); }
.variant-row .price { font-weight: 700; color: var(--danger); font-size: 15px; }

/* ---------- 提醒抽屉 ---------- */
.event-item {
  display: flex;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.event-item:hover { background: #f8fafc; }
.event-item.unread { background: #f0f7ff; }

.event-thumb {
  width: 52px; height: 52px; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: 6px;
  background: #f8fafc; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.event-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }

.event-main { flex: 1; min-width: 0; }
.event-main .t {
  font-size: 13px; font-weight: 600; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.event-main .d { font-size: 12px; color: var(--ink-2); }
.event-main .time { font-size: 11px; color: var(--ink-3); margin-top: 4px; }

.price-old { text-decoration: line-through; color: var(--ink-3); }
.price-new { color: var(--danger); font-weight: 700; }

.bell-wrap { position: relative; cursor: pointer; font-size: 19px; line-height: 1; }
.bell-dot {
  position: absolute; top: -5px; right: -8px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--danger); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; font-weight: 600;
}

.empty-box { padding: 60px 0; text-align: center; color: var(--ink-3); }
.empty-box .ico { font-size: 42px; display: block; margin-bottom: 10px; opacity: .5; }
