/* ==========================================================
   电商价格监控中心 - 现代化 UI 样式库 (本地纯离线极速渲染)
   ========================================================== */

:root {
  --primary: #f97316;
  --primary-hover: #ea580c;
  --primary-light: #fff7ed;
  --primary-border: #ffedd5;
  --jd-red: #e11d48;
  --jd-light: #fff1f2;
  --jd-border: #ffe4e6;
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --bg-main: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 布局与容器 */
.app-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 顶部导航 */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.navbar-main {
  height: 64px;
}

.navbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-sub {
  height: 50px;
  background: rgba(248, 250, 252, 0.9);
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.navbar-sub-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f97316 0%, #e11d48 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* 状态药丸 */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--success-light);
  color: #047857;
  border: 1px solid var(--success-border);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* 按钮设计 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.28);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.35);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: #cbd5e1;
}

.btn-subtle {
  background: transparent;
  color: var(--text-muted);
}
.btn-subtle:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

/* 看板卡片 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-val {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 工具栏与筛选 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}

.tab-group {
  display: flex;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 12px;
}

.tab-btn {
  padding: 7px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn.active {
  background: white;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.search-box {
  position: relative;
  min-width: 260px;
}
.search-input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: all 0.18s;
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

/* 商品卡片网格 */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
  margin-top: 20px;
  margin-bottom: 40px;
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.product-card:hover {
  box-shadow: var(--shadow-xl);
  border-color: #cbd5e1;
  transform: translateY(-3px);
}

.product-head {
  padding: 22px 22px 16px;
}

.badge-platform {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.badge-taobao {
  background: var(--primary-light);
  color: #c2410c;
  border: 1px solid var(--primary-border);
}
.badge-jd {
  background: var(--jd-light);
  color: #be123c;
  border: 1px solid var(--jd-border);
}
.badge-xianyu {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-shop {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-sku {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
}
.product-title:hover {
  color: var(--primary);
}

/* 价格模块 */
.price-section {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 18px;
}

.price-current {
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: #e11d48;
}
.price-symbol {
  font-size: 14px;
  font-weight: 700;
}
.price-number {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

.price-original {
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: line-through;
  margin-left: 6px;
}

.lowest-tag {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
}
.lowest-val {
  font-size: 14px;
  font-weight: 700;
  color: #059669;
}

/* 目标价药丸 */
.target-box {
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #475569;
}
.target-reached {
  background: var(--success-light);
  border-color: var(--success-border);
  color: #065f46;
}

/* 调度指标条 */
.sched-info-strip {
  background: #f8fafc;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 12px 22px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sched-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
}
.sched-val {
  font-weight: 600;
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 卡片操作脚部 */
.product-footer {
  padding: 14px 22px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 弹窗与抽屉 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  background: white;
  border-radius: var(--radius-2xl);
  max-width: 540px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

/* 表单控件 */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}
.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: white;
  transition: all 0.15s;
}
.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

/* 拟态开关 Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: .24s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .24s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
input:checked + .slider {
  background-color: #10b981;
}
input:checked + .slider:before {
  transform: translateX(18px);
}

/* 消息 Toast */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: white;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.25s ease-out;
  pointer-events: auto;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

[v-cloak] { display: none !important; }

/* 现代无缝胶囊分段选择器 (Segmented Control) */
.nav-segmented-control {
  display: inline-flex;
  align-items: center;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 10px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.segmented-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: #64748b;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  line-height: 1.2;
}

.segmented-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.4);
}

.segmented-btn.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.segmented-icon {
  font-size: 14px;
}

.segmented-label {
  letter-spacing: -0.01em;
}

.segmented-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.25);
  color: #475569;
  transition: all 0.2s;
}

.segmented-btn.active .segmented-badge.items-badge {
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
}

.segmented-btn.active .segmented-badge.sellers-badge {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.btn-nav-cta {
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.25) !important;
}

.btn-seller-cta {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  border-color: #d97706 !important;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.28) !important;
}

/* 卖家卡片 */
.seller-card {
  background: white;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.2s;
}
.seller-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #fde68a;
}
.seller-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fef3c7;
  background: #fef9c3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.seller-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  max-height: 520px;
  overflow-y: auto;
  padding: 4px;
}
.seller-item-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  transition: all 0.2s;
}
.seller-item-card:hover {
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.12);
}
.seller-item-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #f8fafc;
}
