/* ============================================================
   AI产业展销小订单平台 - 全局样式
   设计语言：白底为主 / 蓝色小面积点缀 / 简洁现代
   参考：影楼全掌控版风格（白底 + 蓝色仅用于按钮/标签/数字）
   ============================================================ */

/* ── Design Tokens ── */
:root {
  /* Primary - Blue（仅用于按钮、标签、数字、链接等小面积点缀） */
  --primary:        #3b82f6;
  --primary-dark:   #2563eb;
  --primary-light:  #60a5fa;
  --primary-bg:     #eff6ff;
  --primary-ghost:  rgba(59,130,246,.10);
  --primary-subtle: rgba(59,130,246,.06);

  /* Semantic Colors */
  --success:    #22c55e;
  --success-bg: rgba(34,197,94,.10);
  --danger:     #ef4444;
  --danger-bg:  rgba(239,68,68,.10);
  --warning:    #f59e0b;
  --warning-bg: rgba(245,158,11,.10);
  --info:       #06b6d4;
  --info-bg:    rgba(6,182,212,.10);

  /* Text */
  --text:            #1e293b;
  --text-secondary:  #64748b;
  --text-muted:      #94a3b8;
  --text-inverse:    #FFFFFF;

  /* Border & Background（白底体系） */
  --border:          #e2e8f0;
  --border-light:    #f1f5f9;
  --bg:              #f8fafc;
  --card:            #FFFFFF;

  /* Radius */
  --radius-xs:  6px;
  --radius-sm:  10px;
  --radius:     12px;
  --radius-lg:  16px;
  --radius-xl:  20px;

  /* Shadow（轻盈） */
  --shadow-sm:   0 1px 3px rgba(0,0,0,.04);
  --shadow:      0 2px 12px rgba(0,0,0,.04);
  --shadow-lg:   0 8px 28px rgba(0,0,0,.08);
  --shadow-blue: 0 4px 14px rgba(59,130,246,.18);

  /* Gradients（纯色或极浅渐变，不再有大面积蓝色渐变） */
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --gradient-hero:    #ffffff;
  --gradient-login:   #f8fafc;
  --gradient-header:  #ffffff;

  /* Transition & Safe Area */
  --transition: .25s ease;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* ── Status Bar Spacer ── */
.status-bar { height: env(safe-area-inset-top, 0px); background: #fff; border-bottom: 1px solid var(--border); }

/* ════════════════════════════════════
   Top Navigation Bar（白底 + 细边框）
   ════════════════════════════════════ */
.top-nav {
  background: #fff;
  color: var(--text);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-light);
}
.top-nav .nav-back {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 50%;
  color: var(--text-secondary);
}
.top-nav .nav-title { font-size: 17px; font-weight: 600; color: var(--text); }
.top-nav .nav-action { font-size: 14px; color: var(--primary); cursor: pointer; font-weight: 500; }

/* ════════════════════════════════════
   Bottom Tab Navigation
   ════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: #fff;
  border-top: 1px solid var(--border-light);
  display: flex;
  padding-bottom: var(--safe-bottom);
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,.03);
}
.tab-item, .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  transition: color var(--transition);
  text-decoration: none;
  position: relative;
}
.tab-item.active, .nav-item.active { color: var(--primary); }
.tab-icon, .nav-icon { font-size: 22px; margin-bottom: 2px; display: block; transition: transform var(--transition); }
.nav-icon img { width: 24px; height: 24px; object-fit: contain; display: block; }
.tab-item.active .tab-icon, .nav-item.active .nav-icon { transform: scale(1.08); }
.tab-label, .nav-label { font-size: 11px; display: block; }
.nav-badge {
  position: absolute;
  top: 4px; right: 50%; margin-right: -18px;
  background: var(--danger); color: #fff;
  font-size: 10px; min-width: 16px; height: 16px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
}

/* ── Page Content Area ── */
.page-content {
  padding: 16px 16px calc(70px + var(--safe-bottom));
  min-height: 100vh;
}
.page-content.no-nav { padding-bottom: 24px; }

/* ════════════════════════════════════
   Card System
   ════════════════════════════════════ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
}
.card-title {
  font-size: 15px; font-weight: 600;
  color: var(--text); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}

/* ════════════════════════════════════
   Button System（蓝色仅用于主按钮）
   ════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-block { display: flex; width: 100%; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-blue);
  letter-spacing: 0.5px;
}
.btn-primary:active { opacity: .88; transform: scale(.98); }

.btn-accent  { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }

.btn-outline {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:active { background: var(--bg); }
.btn-outline.primary-outline { border-color: var(--primary); color: var(--primary); }

.btn-sm  { font-size: 13px; padding: 8px 14px; border-radius: var(--radius-xs); }
.btn-lg  { font-size: 17px; padding: 15px 24px; border-radius: var(--radius); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ════════════════════════════════════
   Form System
   ════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
  font-weight: 500;
}
.form-control, .form-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: all var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
.form-control:focus, .form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ghost);
  background: #fff;
}
.form-control::placeholder, .form-input::placeholder { color: var(--text-muted); }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%2394a3b8' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ════════════════════════════════════
   Badge / Tag System（浅底+彩色字）
   ════════════════════════════════════ */
.badge-inline {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.badge-primary   { background: var(--primary-ghost);  color: var(--primary); }
.badge-success   { background: var(--success-bg);    color: var(--success); }
.badge-danger    { background: var(--danger-bg);     color: var(--danger); }
.badge-warning   { background: var(--warning-bg);    color: var(--warning); }
.badge-info      { background: var(--info-bg);       color: var(--info); }
.badge-muted     { background: var(--border-light);  color: var(--text-muted); }

/* ════════════════════════════════════
   List Item
   ════════════════════════════════════ */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition);
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--bg); }
.list-item-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--primary-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-size: 15px; font-weight: 600; color: var(--text); }
.list-item-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.list-item-right { font-size: 13px; color: var(--text-muted); text-align: right; flex-shrink: 0; }

/* ── Price ── */
.price { color: var(--danger); font-weight: 700; }
.price-lg { font-size: 24px; }
.price sup { font-size: 14px; vertical-align: top; margin-top: 4px; }

/* ════════════════════════════════════
   Empty State
   ════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 56px; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: 15px; }

/* ════════════════════════════════════
   Toast Notification
   ════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 9999;
  width: calc(100% - 32px); max-width: 450px;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 12px;
  animation: toast-in .3s ease;
  pointer-events: all;
}
.toast.success { background: var(--success); }
.toast.warning { background: var(--warning); color: #fff; }
.toast.error   { background: var(--danger); }
.toast-icon    { font-size: 20px; flex-shrink: 0; }
.toast-body    { flex: 1; }
.toast-title   { font-weight: 600; font-size: 14px; }
.toast-text    { font-size: 13px; opacity: .9; margin-top: 2px; }
.toast-close   { cursor: pointer; opacity: .7; font-size: 18px; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════
   Modal Overlay
   ════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: flex-end;
  animation: fade-in .2s ease;
}
.modal-overlay.center { align-items: center; padding: 24px; }
.modal-sheet {
  background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  animation: slide-up .3s ease;
}
.modal-overlay.center .modal-sheet {
  border-radius: var(--radius-lg);
  animation: scale-in .25s ease;
}
.modal-card {
  background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 480px;   /* 限制桌面端最大宽度，居中显示 */
  margin: 0 auto;
  animation: slide-up .3s ease;
}
@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes scale-in { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); } }
.modal-handle {
  width: 36px; height: 4px; background: var(--border);
  border-radius: 2px; margin: 0 auto 16px;
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; text-align: center; color: var(--text); }

/* ════════════════════════════════════
   Loading Spinner
   ════════════════════════════════════ */
.loading-spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider & Section Title ── */
.divider { height: 1px; background: var(--border-light); margin: 12px 0; }
.section-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 12px; }

/* ════════════════════════════════════
   Step Indicator
   ════════════════════════════════════ */
.steps { display: flex; align-items: center; margin-bottom: 20px; }
.step { flex: 1; text-align: center; font-size: 12px; color: var(--text-muted); }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--border-light); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; margin: 0 auto 4px;
  transition: all var(--transition);
}
.step.active .step-dot { background: var(--primary); color: #fff; box-shadow: var(--shadow-blue); }
.step.done .step-dot   { background: var(--success); color: #fff; }
.step-line { flex: 1; height: 2px; background: var(--border-light); margin-top: -20px; }
.step-line.done { background: var(--success); }

/* ════════════════════════════════════
   Rating Stars
   ════════════════════════════════════ */
.rating-row {
  display: flex; gap: 8px;
  justify-content: center; margin: 16px 0;
}
.rating-btn {
  width: 40px; height: 40px;
  border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}
.rating-btn.selected { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ════════════════════════════════════
   Hero Banner (Home Page) —— 白底风格
   蓝色仅用于数字和tag
   ════════════════════════════════════ */
.home-banner {
  background: #fff;
  border-radius: 0;
  padding: 24px 20px 20px;
  color: var(--text);
  margin-bottom: 0;
  position: relative;
  border-bottom: 1px solid var(--border-light);
}
.home-banner h2 { font-size: 20px; font-weight: 700; letter-spacing: .3px; color: var(--text); }
.home-banner p  { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.points-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--primary-bg);
  border: 1px solid transparent;
  color: var(--primary);
  font-size: 13px; font-weight: 600;
  padding: 4px 12px; border-radius: 16px;
  margin-top: 10px;
}

/* Hero 内的统计卡片（白色卡片+蓝色数字） */
.hero-stats {
  display: flex; gap: 10px; margin-top: 16px;
}
.hero-stat-card {
  flex: 1;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 13px 10px;
  text-align: center;
  border: 1px solid var(--border-light);
}
.hero-stat-card .stat-val {
  font-size: 23px; font-weight: 800; color: var(--primary);
}
.hero-stat-card .stat-lbl {
  font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ════════════════════════════════════
   Feature Grid (Icon Grid)
   ════════════════════════════════════ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 16px;
}
.feature-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  border: 1px solid var(--border-light);
}
.feature-item:active { transform: scale(.96); }
.feature-item .fi-icon { font-size: 26px; margin-bottom: 6px; }
.feature-item .fi-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

/* ════════════════════════════════════
   Ranking List
   ════════════════════════════════════ */
.rank-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
}
.rank-item:last-child { border-bottom: none; }
.rank-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--border-light); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.rank-num.gold   { background: #FEF3C7; color: #D97706; }
.rank-num.silver { background: #F1F5F9; color: #64748B; }
.rank-num.bronze { background: #FFEDD5; color: #C2410C; }

/* ════════════════════════════════════
   Page Header (Sub Pages) —— 白底风格
   ════════════════════════════════════ */
.page-header {
  background: #fff;
  padding: 20px 16px 24px;
  color: var(--text);
  position: relative;
  border-bottom: 1px solid var(--border-light);
}
.page-header h2 { font-size: 19px; font-weight: 700; color: var(--text); }
.page-header p  { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ════════════════════════════════════
   Data Table (Admin)
   ════════════════════════════════════ */
.data-table {
  width:100%; background:#fff; border-radius:var(--radius);
  overflow:hidden; box-shadow:var(--shadow-sm); margin-bottom:16px;
  border:1px solid var(--border-light);
}
.data-table-head {
  display:flex; background:var(--bg); padding:10px 14px;
  font-size:12px; color:var(--text-muted); font-weight:600;
}
.data-table-row {
  display:flex; padding:12px 14px;
  border-bottom:1px solid var(--border-light); align-items:center; font-size:13px;
}
.data-table-row:last-child{ border:none; }
.col-name{flex:2;color:var(--text);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.col-status{flex:1;text-align:center;}
.col-val{flex:1;text-align:right;color:var(--text-secondary);}
.col-action{width:90px;text-align:right;}

/* ════════════════════════════════════
   KPI Card Grid（白底卡片+左侧蓝色细线）
   ════════════════════════════════════ */
.kpi-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-bottom:16px;}
.kpi-card{
  background:#fff;border-radius:var(--radius);padding:16px;
  box-shadow:var(--shadow-sm);border:1px solid var(--border-light);
  position:relative;overflow:hidden;
}
.kpi-card::before{
  content:'';position:absolute;top:0;left:0;width:4px;height:100%;
  background:var(--primary);border-radius:0 2px 2px 0;
}
.kpi-val{font-size:26px;font-weight:800;color:var(--primary);}
.kpi-lbl{font-size:12px;color:var(--text-muted);margin-top:4px;font-weight:500;}
.kpi-trend{font-size:11px;margin-top:6px;font-weight:600;}
.kpi-trend.up{color:var(--success);}
.kpi-trend.down{color:var(--danger);}

/* ════════════════════════════════════
   Filter Bar
   ════════════════════════════════════ */
.filter-row{display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap;}
.filter-select{
  padding:8px 14px;border-radius:var(--radius-sm);
  border:1.5px solid var(--border);background:#fff;
  font-size:13px;color:var(--text-secondary);outline:none;cursor:pointer;
  transition:border-color var(--transition);
}
.filter-select:focus{border-color:var(--primary);}
.filter-input{
  padding:8px 14px;border-radius:var(--radius-sm);
  border:1.5px solid var(--border);background:#fff;
  font-size:13px;flex:1;outline:none;transition:border-color var(--transition);
}
.filter-input:focus{border-color:var(--primary);}

/* ════════════════════════════════════
   Category Tabs (Chip Style)
   active态用蓝色填充，非active用白底灰边
   ════════════════════════════════════ */
.cat-tabs{display:flex;gap:8px;padding:12px 16px 8px;overflow-x:auto;-webkit-overflow-scrolling:touch;}
.cat-tabs::-webkit-scrollbar{display:none;}
.cat-tab{
  white-space:nowrap;padding:8px 16px;border-radius:20px;
  border:1.5px solid var(--border);background:#fff;
  font-size:13px;font-weight:500;color:var(--text-secondary);
  cursor:pointer;transition:all var(--transition);flex-shrink:0;
}
.cat-tab.active{
  background:var(--primary);border-color:var(--primary);color:#fff;
  box-shadow:var(--shadow-blue);
}

/* ════════════════════════════════════
   Order Card
   ════════════════════════════════════ */
.order-card{
  background:#fff;border-radius:var(--radius);padding:16px;margin-bottom:10px;
  box-shadow:var(--shadow-sm);border:1px solid var(--border-light);
  transition:box-shadow var(--transition),transform var(--transition);
}
.order-card:active{ box-shadow:var(--shadow); }
.pkg-card{
  min-width:180px;background:#fff;border-radius:var(--radius);padding:16px;
  box-shadow:var(--shadow-sm);cursor:pointer;border:1.5px solid transparent;
  transition:all var(--transition);flex-shrink:0;
}
.pkg-card:hover{border-color:var(--primary);}
.package-scroll{display:flex;gap:12px;overflow-x:auto;padding-bottom:4px;-webkit-overflow-scrolling:touch;}
.package-scroll::-webkit-scrollbar{display:none;}

/* ════════════════════════════════════
   Login Specific Styles（白底登录页）
   ════════════════════════════════════ */
.login-wrap {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 20px;
  position: relative;
}

/* ════════════════════════════════════
   Status Badge（订单状态等）
   ════════════════════════════════════ */
.status-badge {
  padding: 3px 11px; border-radius: 20px;
  font-size: 12px; font-weight: 500; display: inline-block;
}
.status-paid        { background: var(--primary-bg);  color: var(--primary); }
.status-dispatched   { background: var(--info-bg);       color: var(--info); }
.status-accepted     { background: var(--warning-bg);    color: var(--warning); }
.status-completed    { background: var(--success-bg);    color: var(--success); }
.status-pending      { background: var(--border-light);  color: var(--text-muted); }
.status-in_progress  { background: var(--danger-bg);     color: var(--danger); }
.status-cancelled    { background: var(--border-light);  color: var(--text-muted); }
