/* ============================================
   驼旅指挥中心 — 全局样式系统
   深色主题 · 金色品牌 · 响应式 · CSS变量
   ============================================ */

/* ---------- CSS 变量体系 ---------- */
:root {
  /* 品牌色 */
  --gold:            #f59e0b;
  --gold-hover:      #fbbf24;
  --gold-dim:        #b45309;

  /* 背景层级 */
  --bg-primary:      #0f172a;
  --bg-secondary:    #1a2332;
  --bg-card:         #1e293b;
  --bg-card-hover:   #273449;
  --bg-input:        #1a2332;

  /* 文字 */
  --text:            #e2e8f0;
  --text-muted:      #94a3b8;
  --text-dim:        #64748b;

  /* 边框 & 分割 */
  --border:          #334155;
  --border-light:    #475569;

  /* 语义色 */
  --success:         #10b981;
  --warning:         #f59e0b;
  --danger:          #ef4444;
  --info:            #3b82f6;

  /* 间距体系 (rem基准) */
  --space-xs:        0.25rem;
  --space-sm:        0.5rem;
  --space-md:        1rem;
  --space-lg:        1.5rem;
  --space-xl:        2rem;
  --space-2xl:       3rem;

  /* 圆角 */
  --radius-sm:       0.375rem;
  --radius-md:       0.75rem;
  --radius-lg:       1rem;
  --radius-xl:       1.5rem;

  /* 阴影 */
  --shadow-sm:       0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:       0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg:       0 10px 25px rgba(0,0,0,0.5);
  --shadow-gold:     0 0 20px rgba(245,158,11,0.15);

  /* 过渡 */
  --transition:      0.2s ease;

  /* 侧栏 */
  --sidebar-width:   16rem;
  --sidebar-collapsed: 3.5rem;
  --navbar-height:   3.5rem;

  /* 字体 */
  --font-sans:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono:       "SF Mono", "Cascadia Code", "Fira Code", monospace;
}

/* ---------- 全局 Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--gold);
  text-decoration: none;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ============================================
   登录页
   ============================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-md);
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0f1a2e 50%, #111d33 100%);
}

.login-page::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(245,158,11,0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(245,158,11,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 25rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.login-logo img,
.login-logo svg {
  width: 5rem;
  height: 5rem;
  margin-bottom: var(--space-md);
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.login-logo p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-group input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

.form-group input::placeholder {
  color: var(--text-dim);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
}

.btn-primary {
  width: 100%;
  background: var(--gold);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--gold-hover);
  box-shadow: 0 4px 12px rgba(245,158,11,0.3);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: var(--space-md);
  display: none;
}

.login-error.visible {
  display: block;
}

/* ============================================
   仪表盘布局
   ============================================ */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* ---------- 侧栏 ---------- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width var(--transition), min-width var(--transition);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-md);
  height: var(--navbar-height);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand img,
.sidebar-brand svg {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

.sidebar-brand span {
  font-weight: 700;
  color: var(--gold);
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}

.sidebar.collapsed .sidebar-brand span {
  opacity: 0;
  width: 0;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-sm) 0;
}

.nav-section {
  margin-bottom: var(--space-md);
}

.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: var(--space-sm) var(--space-md);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}

.sidebar.collapsed .nav-section-title {
  opacity: 0;
  height: 0;
  padding: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.65rem var(--space-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  font-size: 0.9rem;
  white-space: nowrap;
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text);
}

.nav-item.active {
  background: rgba(245,158,11,0.08);
  color: var(--gold);
  border-left-color: var(--gold);
}

.nav-item .nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.nav-item .nav-label {
  overflow: hidden;
  transition: opacity var(--transition);
}

.sidebar.collapsed .nav-item .nav-label {
  opacity: 0;
  width: 0;
}

/* 侧栏底部 */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-sm) 0;
  flex-shrink: 0;
}

/* ---------- 主内容区 ---------- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition);
  min-width: 0;
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed);
}

/* ---------- 顶部导航 ---------- */
.topbar {
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-xs);
  line-height: 1;
}

.topbar-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.user-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: box-shadow var(--transition);
}

.user-avatar:hover {
  box-shadow: 0 0 12px rgba(245,158,11,0.4);
}

/* ---------- 内容区 ---------- */
.content {
  padding: var(--space-lg);
}

.page-header {
  margin-bottom: var(--space-lg);
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: var(--space-xs);
}

/* ============================================
   指标卡片
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  box-shadow: var(--shadow-md), var(--shadow-gold);
  transform: translateY(-2px);
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-card-icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}

.stat-card-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.stat-card-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.stat-card-sub .trend-up { color: var(--success); }
.stat-card-sub .trend-down { color: var(--danger); }

/* ============================================
   第二行卡片 — 快捷入口
   ============================================ */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.quick-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.quick-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-card .qc-icon {
  font-size: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245,158,11,0.1);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.quick-card .qc-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.quick-card .qc-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   表格区域占位
   ============================================ */
.section-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.section-card-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.section-card-body {
  padding: var(--space-lg);
}

.table-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--text-dim);
  font-size: 0.9rem;
  flex-direction: column;
  gap: var(--space-sm);
}

.table-placeholder .ph-icon {
  font-size: 2rem;
  opacity: 0.5;
}

/* ============================================
   Toast 通知
   ============================================ */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  max-width: 24rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 1000;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
  color: #fff;
}

.toast.visible {
  transform: translateX(0);
}

.toast-info    { background: var(--info); }
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-warning { background: var(--warning); color: var(--bg-primary); }

/* ============================================
   Tab 导航栏
   ============================================ */
.tab-bar {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
}

.tab-btn {
  padding: 0.6rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text);
  background: rgba(245,158,11,0.05);
}

.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ============================================
   Tab 面板
   ============================================ */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ============================================
   数据表格
   ============================================ */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table thead th {
  text-align: left;
  padding: 0.75rem 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.data-table code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: rgba(245,158,11,0.1);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--gold);
}

.table-loading,
.table-empty,
.table-error {
  text-align: center !important;
  padding: 2rem !important;
  color: var(--text-dim);
}

.table-error {
  color: var(--danger);
}

/* ============================================
   状态徽章
   ============================================ */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-active    { background: rgba(16,185,129,0.15); color: var(--success); }
.status-inactive  { background: rgba(148,163,184,0.15); color: var(--text-muted); }
.status-draft     { background: rgba(100,116,139,0.15); color: var(--text-dim); }
.status-pending   { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-paid      { background: rgba(59,130,246,0.15); color: var(--info); }
.status-shipped   { background: rgba(139,92,246,0.15); color: #a78bfa; }
.status-completed { background: rgba(16,185,129,0.15); color: var(--success); }
.status-cancelled { background: rgba(239,68,68,0.15); color: var(--danger); }
.status-refunded  { background: rgba(148,163,184,0.15); color: var(--text-muted); }
.status-processing{ background: rgba(59,130,246,0.15); color: var(--info); }
.status-failed    { background: rgba(239,68,68,0.15); color: var(--danger); }

/* ============================================
   操作按钮
   ============================================ */
.action-cell {
  display: flex;
  gap: var(--space-xs);
  white-space: nowrap;
}

.btn-sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  background: var(--bg-input);
  color: var(--text-muted);
}

.btn-sm:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

.btn-sm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-edit:hover { color: var(--info); }
.btn-delete:hover { color: var(--danger); }

.btn-gold {
  background: var(--gold);
  color: var(--bg-primary);
  font-weight: 600;
}

.btn-gold:hover {
  background: var(--gold-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

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

/* ============================================
   订单筛选按钮
   ============================================ */
.order-filters {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.order-filter-btn {
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.order-filter-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.order-filter-btn.active {
  background: rgba(245,158,11,0.15);
  border-color: var(--gold);
  color: var(--gold);
}

/* ============================================
   商品缩略图
   ============================================ */
.product-thumb {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  object-fit: cover;
  vertical-align: middle;
  margin-right: var(--space-sm);
}

/* ============================================
   分页
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================
   弹窗 (Modal)
   ============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  width: 100%;
  max-width: 34rem;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

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

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

.modal-card form {
  padding: var(--space-xl);
}

.modal-card .form-group {
  margin-bottom: var(--space-md);
}

.modal-card .form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-card .form-group input,
.modal-card .form-group select,
.modal-card .form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.modal-card .form-group input:focus,
.modal-card .form-group select:focus,
.modal-card .form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

.modal-card .form-group textarea {
  resize: vertical;
  min-height: 4rem;
}

/* select 专用样式 */
.modal-card .form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.modal-footer .btn {
  min-width: 6rem;
}

.modal-footer .btn-primary {
  width: auto;
}

/* ============================================
   系统状态
   ============================================ */
.system-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.sys-status-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
}

.sys-status-item .sys-status-val {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.sys-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sys-dot.success { background: var(--success); }
.sys-dot.warning { background: var(--warning); }
.sys-dot.danger  { background: var(--danger); }
.sys-dot.info    { background: var(--info); }

/* ============================================
   日志操作标签
   ============================================ */
.log-action {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: rgba(245,158,11,0.1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--gold);
}

/* ============================================
   手机遮罩（侧栏展开时）
   ============================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ============================================
   响应式布局
   ============================================ */

/* 平板 */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 手机 */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 16rem;
    --sidebar-collapsed: 0;
  }

  /* 侧栏默认隐藏 */
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0 !important;
  }

  .hamburger {
    display: block;
  }

  .sidebar-overlay.visible {
    display: block;
  }

  /* 卡片列 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: var(--space-md);
  }

  /* 弹窗适配 */
  .modal-card {
    max-width: 100%;
    max-height: 85vh;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* 订单筛选换行 */
  .order-filters {
    margin-top: var(--space-sm);
  }

  /* 系统状态单列 */
  .system-status-grid {
    grid-template-columns: 1fr;
  }
}

/* 窄屏手机 */
@media (max-width: 420px) {
  html { font-size: 14px; }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .stat-card {
    padding: var(--space-md);
  }

  .stat-card-value {
    font-size: 1.5rem;
  }

  .login-card {
    padding: var(--space-xl) var(--space-lg);
  }

  .content {
    padding: var(--space-sm);
  }
}
