/* ================================
   基础变量与重置
================================ */
:root {
  --bg: #f4f6f9;
  --bg-soft: #fafbfc;
  --surface: #ffffff;
  --text: #1a1d26;
  --text-muted: #5c6370;
  --text-faint: #9ca3af;

  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-light: #dbeafe;

  --success: #059669;
  --success-bg: #ecfdf5;
  --success-soft: #d1fae5;

  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-soft: #fef3c7;

  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-soft: #fee2e2;

  --info: #0891b2;
  --info-bg: #ecfeff;

  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: var(--primary); text-decoration: none; }

/* 自定义滚动条 - 去掉Windows默认的上下箭头 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-button { display: none; }

* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }

/* ================================
   通用工具
================================ */
.hidden { display: none !important; }
.mono { font-family: 'SF Mono', Menlo, Consolas, monospace; }
.text-muted { color: var(--text-muted); }

/* ================================
   Toast 通知
================================ */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(-12px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  white-space: nowrap;
}

.toast-show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }

/* ================================
   通用表单元素
================================ */
.input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
  transition: all var(--transition);
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input::placeholder { color: var(--text-faint); }

.form { width: 100%; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group .required { color: var(--danger); }
.form-group .optional { color: var(--text-faint); font-weight: normal; font-size: 0.8rem; }

.field-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; min-height: 18px; }
.field-hint-ok { color: var(--success); }
.field-hint-err { color: var(--danger); }

/* ================================
   按钮
================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-secondary { background: var(--bg-soft); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #047857; }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-soft); }

.btn-block { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-icon {
  background: transparent;
  border: none;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition);
}
.btn-icon:hover { background: var(--bg-soft); }

/* 下拉菜单 */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.dropdown-toggle:hover { background: var(--bg-soft); }
.dropdown-toggle::after {
  content: '▼';
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: 2px;
}
.dropdown-menu {
  position: fixed;
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  display: none;
  overflow: hidden;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--bg-soft); }
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pagination-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.pagination-btns {
  display: flex;
  gap: 4px;
}

/* 批量操作 */
.batch-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}
.batch-info {
  font-size: 0.88rem;
  color: var(--primary);
  font-weight: 600;
}
.batch-info span {
  color: var(--text);
}
.batch-btns {
  display: flex;
  gap: 8px;
}

/* ================================
   卡片
================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}

.card-title-aux {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: auto;
}

/* ================================
   状态徽章 / 标签
================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--text-muted);
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge-info    { background: var(--primary-soft); color: var(--primary); }
.badge-muted   { background: #f1f5f9; color: var(--text-muted); }

/* ================================
   加载/空状态
================================ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 8px; opacity: 0.6; }
.empty-state-text { font-size: 0.9rem; }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

.spinner-ring {
  width: 40px;
  height: 40px;
  border: 3.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ================================
   核验页 - 移动端优先
================================ */
.verify-body {
  background: linear-gradient(180deg, #f8fafc 0%, #f4f6f9 100%);
  min-height: 100vh;
}

.verify-topbar {
  background: var(--surface);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

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

.verify-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.verify-brand-name { font-weight: 700; font-size: 0.95rem; }
.verify-brand-sub { font-size: 0.75rem; color: var(--text-muted); }

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* 加载页 */
.verify-loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

/* 错误页 */
.verify-error {
  text-align: center;
  padding: 60px 24px;
}
.error-icon { font-size: 64px; margin-bottom: 16px; }
.verify-error h2 { font-size: 1.4rem; color: var(--danger); margin-bottom: 8px; }
.verify-error p { color: var(--text-muted); margin-bottom: 24px; }

.error-tips {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
  max-width: 360px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}
.error-tips p { color: var(--text); font-weight: 600; margin-bottom: 8px; }
.error-tips ul { padding-left: 20px; color: var(--text-muted); }
.error-tips li { padding: 4px 0; font-size: 0.9rem; }

/* 顶部状态卡（核心信息，最醒目） */
.status-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border-top: 4px solid var(--primary);
}

.status-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.04) 0%, transparent 100%);
  pointer-events: none;
}

.status-pulse {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(5, 150, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

.status-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  color: white;
  margin: 0 auto 16px;
  background: var(--primary);
}

.status-card h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 6px; }
.status-card p { color: var(--text-muted); font-size: 0.92rem; }

.status-genuine { border-top-color: var(--success); }
.status-genuine .status-icon { background: var(--success); }
.status-genuine .status-pulse { background: var(--success); }

.status-caution { border-top-color: var(--warning); }
.status-caution .status-icon { background: var(--warning); }
.status-caution .status-pulse { background: var(--warning); animation-name: pulse-warning; }
.status-caution h1 { color: var(--warning); }
@keyframes pulse-warning {
  0% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(217, 119, 6, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
}

.status-suspicious,
.status-unknown { border-top-color: var(--danger); }
.status-suspicious .status-icon,
.status-unknown .status-icon { background: var(--danger); }
.status-suspicious .status-pulse,
.status-unknown .status-pulse { background: var(--danger); animation-name: pulse-danger; }
.status-suspicious h1,
.status-unknown h1 { color: var(--danger); }
@keyframes pulse-danger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(220, 38, 38, 0); }
}

.status-deactivated { border-top-color: var(--text-faint); }
.status-deactivated .status-icon { background: var(--text-faint); }
.status-deactivated h1 { color: var(--text-muted); }

/* 风险告警条幅 */
.alert-banner {
  background: var(--danger-bg);
  border: 1.5px solid var(--danger-soft);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.alert-banner-title {
  font-weight: 700;
  color: var(--danger);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.alert-item {
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.88rem;
  border-left: 3px solid var(--warning);
}

.alert-item:last-child { margin-bottom: 0; }
.alert-item-title { font-weight: 600; color: var(--warning); margin-bottom: 4px; }
.alert-item-msg { color: var(--text); }
.alert-critical { border-left-color: var(--danger); }
.alert-critical .alert-item-title { color: var(--danger); }

/* 信息卡 */
.info-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.info-card-accent {
  background: linear-gradient(135deg, var(--primary-soft) 0%, #f0f9ff 100%);
  border: 1.5px solid var(--primary-light);
}

.info-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.info-card-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-card-badge {
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.owner-badge { background: var(--success-bg); color: var(--success); }

/* 商品块 */
.product-block { }
.product-image-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-image-wrap img { width: 100%; height: 100%; object-fit: cover; }

.product-name { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }

.product-meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.meta-chip {
  background: var(--bg-soft);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.meta-chip em { font-style: normal; font-weight: 600; color: var(--text); margin-left: 4px; }

.product-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 12px; line-height: 1.6; }

.specs-grid { border-top: 1px solid var(--border); padding-top: 8px; }
.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.88rem;
  gap: 12px;
}
.spec-row:last-child { border-bottom: none; }
.spec-label { color: var(--text-muted); flex-shrink: 0; }
.spec-value { color: var(--text); font-weight: 500; text-align: right; }
.specs-empty { color: var(--text-faint); font-size: 0.85rem; padding: 8px 0; text-align: center; }

/* Meta list */
.meta-list { list-style: none; }
.meta-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.meta-list li:last-child { border-bottom: none; }
.meta-label { color: var(--text-muted); flex-shrink: 0; }
.meta-value { color: var(--text); font-weight: 500; text-align: right; word-break: break-all; }
.meta-location {
  margin-top: 8px;
  padding-top: 12px !important;
  border-top: 1px dashed var(--border);
  border-bottom: none !important;
}

/* 注册卡 */
.register-intro {
  background: white;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.6;
}

.register-agreement {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-top: 12px;
  line-height: 1.5;
}

.verify-footer {
  text-align: center;
  padding: 24px 16px 32px;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.verify-footer .footer-muted { color: var(--text-faint); font-size: 0.75rem; margin-top: 4px; }

/* ================================
   登录页
================================ */
.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #4f46e5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container { width: 100%; max-width: 400px; }

.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.3);
}

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 auto 12px;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}
.login-logo h1 { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.login-logo p { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 12px;
  border: 1px solid var(--danger-soft);
}

.login-tips {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}
.login-tips p { margin: 4px 0; }
.login-tips code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', monospace;
  font-size: 0.78rem;
  color: var(--text);
}

/* ================================
   管理后台
================================ */
.admin-body { background: var(--bg); min-height: 100vh; }

.admin-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.admin-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-logo { display: flex; align-items: center; gap: 12px; }
.admin-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.admin-logo-text { font-size: 0.95rem; font-weight: 700; }
.admin-logo-sub { font-size: 0.72rem; color: var(--text-muted); }
.admin-nav-right { display: flex; align-items: center; gap: 12px; }
.admin-user { font-size: 0.85rem; color: var(--text-muted); }

.admin-main { padding: 24px; max-width: 1200px; margin: 0 auto; }

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition);
  border-left: 4px solid var(--primary);
  cursor: pointer;
  user-select: none;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card:active { transform: translateY(-1px); }

.stat-icon { font-size: 28px; flex-shrink: 0; }
.stat-content { flex: 1; min-width: 0; }
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.stat-products { border-left-color: var(--primary); }
.stat-labels { border-left-color: var(--info); }
.stat-registered { border-left-color: var(--success); }
.stat-scans { border-left-color: #8b5cf6; }
.stat-alerts { border-left-color: var(--danger); }
.stat-alerts .stat-value { color: var(--danger); }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  padding: 10px 18px;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-icon { font-size: 1rem; }

.tab-badge {
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

.tab-panel { animation: fadeIn 0.25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 600px; }
.data-table th, .data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--bg-soft);
}
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--bg-soft); }
.table-empty { text-align: center; color: var(--text-muted); padding: 32px 12px; }

.token-link {
  color: var(--primary);
  text-decoration: none;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 500;
}
.token-link:hover { text-decoration: underline; }

/* 两列布局 */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* 搜索框 */
.search-box { width: 220px; max-width: 100%; }
.search-box .input { padding: 6px 12px; font-size: 0.85rem; }

/* 过滤器 */
.filter-tabs { display: flex; gap: 4px; }
.filter-tab {
  padding: 5px 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-tab:hover { background: var(--bg-soft); }
.filter-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 生成结果区 */
.gen-result-empty { color: var(--text-muted); }
.gen-summary {
  display: flex;
  gap: 24px;
  padding: 12px 16px;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.gen-summary-item { flex: 1; }
.gen-summary-label { font-size: 0.78rem; color: var(--text-muted); }
.gen-summary-value { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-top: 2px; }

.gen-label-list { max-height: 300px; overflow-y: auto; }
.gen-label-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 0.82rem;
  background: var(--bg-soft);
}
.gen-label-item:hover { background: var(--border); }
.gen-label-index {
  background: var(--primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.gen-label-content { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.gen-label-url {
  flex: 1;
  font-family: 'SF Mono', monospace;
  font-size: 0.78rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gen-label-actions { display: flex; gap: 2px; }
.gen-label-more {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 8px;
}
.gen-actions { margin-top: 12px; text-align: center; }

/* 商品列表 */
.product-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  background: var(--bg-soft);
  transition: background var(--transition);
}
.product-item:hover { background: var(--border); }
.product-item-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}
.product-item-img img { width: 100%; height: 100%; object-fit: cover; }
.product-item-img-fallback { font-size: 24px; }
.product-item-info { flex: 1; min-width: 0; }
.product-item-name { font-weight: 600; font-size: 0.92rem; }
.product-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  flex-wrap: wrap;
}
.product-item-desc {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* 告警卡片 */
.alert-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  margin-bottom: 8px;
  border-left: 4px solid var(--warning);
  transition: all var(--transition);
}
.alert-card:hover { background: var(--border); }

.alert-sev-info { border-left-color: var(--info); }
.alert-sev-warning { border-left-color: var(--warning); }
.alert-sev-critical { border-left-color: var(--danger); background: var(--danger-bg); }
.alert-sev-critical:hover { background: var(--danger-soft); }

.alert-card-left { flex-shrink: 0; }
.alert-card-icon { font-size: 24px; }
.alert-card-body { flex: 1; min-width: 0; }
.alert-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 8px;
  flex-wrap: wrap;
}
.alert-card-type { font-weight: 700; font-size: 0.88rem; color: var(--text); }
.alert-card-time { font-size: 0.75rem; color: var(--text-muted); }
.alert-card-msg { font-size: 0.88rem; color: var(--text); line-height: 1.5; margin-bottom: 4px; }
.alert-card-meta { font-size: 0.78rem; color: var(--text-muted); }
.alert-card-right { flex-shrink: 0; }

/* ================================
   弹窗
================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  width: 100%;
  transform: translateY(-20px);
  transition: transform 0.25s ease;
}

.modal-show .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--transition);
}

.modal-close:hover { color: var(--danger); }

.modal-body { padding: 20px; }

/* 用户信息 */
.owner-info-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.owner-info-item:last-child { border-bottom: none; }

.owner-info-label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.owner-info-value {
  color: var(--text);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

/* 用户链接 */
.owner-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.owner-link:hover { text-decoration: underline; }

/* 操作按钮组 */
.action-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* ================================
   响应式 - 移动端
================================ */
@media (max-width: 768px) {
  .container-wide { padding: 16px; }
  .admin-main { padding: 16px; }
  .admin-nav-inner { padding: 12px 16px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px; gap: 10px; }
  .stat-icon { font-size: 22px; }
  .stat-value { font-size: 1.4rem; }
  .stat-label { font-size: 0.75rem; }

  .two-col { grid-template-columns: 1fr; }

  .card { padding: 16px; }
  .card-title { font-size: 0.9rem; }

  .tabs { gap: 2px; }
  .tab { padding: 8px 12px; font-size: 0.85rem; }

  .status-card { padding: 24px 20px; }
  .status-icon { width: 56px; height: 56px; font-size: 30px; }
  .status-card h1 { font-size: 1.3rem; }

  .search-box { width: 100%; }

  .admin-user { display: none; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 1.2rem; }
  .gen-summary { flex-direction: column; gap: 8px; }
}

/* 桌面端优化 */
@media (min-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(5, 1fr); }
}
