/* ===== CSS Variables (Mobile Adaptation Phase 2) ===== */
/* 统一配色系统 - 使用工业风格的橙色作为主色 */
:root {
  /* Aliases to main palette for compatibility */
  --color-primary: var(--primary);  /* #E55A2A - 统一到橙色 */
  --color-secondary: var(--secondary);  /* #004E89 */
  --color-success: var(--success);  /* #10B981 */
  --color-danger: var(--danger);  /* #EF4444 */
  --color-warning: var(--warning);  /* #F59E0B */
  --color-background: var(--gray-50);  /* #F8FAFC */
  --color-surface: var(--white);  /* #FFFFFF */
  --color-text: var(--dark);  /* #0F1419 */
  --color-border: var(--gray-200);  /* #DEE2E6 */
  --radius-card: var(--radius-lg);  /* 0.75rem */
  --radius-btn: var(--radius-md);  /* 0.5rem */
  --shadow-card: var(--shadow-md);  /* 0 2px 8px rgba(0,0,0,0.08) */
}

/* BTMK-WebUI3 - Claude.ai Inspired Design System */
/* 参考: https://github.com/anthropics/claude-cookbooks/blob/main/coding/prompting_for_frontend_aesthetics.ipynb */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ===== Design Tokens ===== */
:root {
  /* Colors - Industrial palette */
  --primary: #E55A2A;
  --primary-dark: #CC4D1E;
  --primary-light: #FF7A4D;
  --secondary: #004E89;
  --secondary-dark: #003666;
  --accent: #F5C400;
  --accent-dark: #D4A900;

  --dark: #0F1419;
  --dark-soft: #1A1F26;
  --dark-muted: #242B33;

  --light: #F4F5F6;
  --light-warm: #ECEEF0;
  --white: #FFFFFF;

  --gray-50: #F8F9FA;
  --gray-100: #EBEDF0;
  --gray-200: #DEE2E6;
  --gray-300: #C4CACC;
  --gray-400: #8B9298;
  --gray-500: #5C6370;
  --gray-600: #3D4450;
  --gray-700: #2C3340;
  --gray-800: #1E2328;
  --gray-900: #12161A;

  /* Functional colors */
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --info: #3B82F6;
  --info-bg: rgba(59, 130, 246, 0.1);

  /* Typography */
  --font-display: 'Syne', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Type scale */
  --text-xs: 0.7rem;
  --text-sm: 0.8rem;
  --text-base: 0.9rem;
  --text-lg: 1rem;
  --text-xl: 1.1rem;
  --text-2xl: 1.3rem;
  --text-3xl: 1.6rem;
  --text-4xl: 2rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.375rem;
  --space-3: 0.5rem;
  --space-4: 0.75rem;
  --space-5: 1rem;
  --space-6: 1.25rem;
  --space-8: 1.5rem;
  --space-10: 1.75rem;
  --space-12: 2rem;
  --space-16: 2.5rem;
  --space-20: 3rem;
  --space-24: 3.5rem;

  /* Border radius - Harder edges for industrial feel */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;

  /* Shadows - Flatter and more subtle */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-primary: 0 4px 16px rgba(229, 90, 42, 0.25);
  --shadow-glow: 0 0 40px rgba(229, 90, 42, 0.15);

  /* Layout */
  --nav-height: 52px;
  --container-max: 1100px;
  --sidebar-width: 240px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: 'Inter', system-ui, sans-serif;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  color: var(--dark);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, var(--text-4xl)); }
h2 { font-size: clamp(2rem, 4vw, var(--text-3xl)); }
h3 { font-size: clamp(1.5rem, 3vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
  color: var(--gray-500);
  max-width: 65ch;
}

strong {
  font-weight: 600;
  color: var(--gray-700);
}

code, pre {
  font-family: var(--font-mono);
}

code {
  background: var(--gray-100);
  padding: 0.15em 0.45em;
  border-radius: var(--radius-sm);
  font-size: 0.88em;
  color: var(--primary-dark);
}

/* ===== Navigation - Simplified Industrial ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(15, 20, 25, 0.92);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.navbar-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  letter-spacing: -0.01em;
}

.navbar-brand:hover {
  color: var(--white);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: var(--white);
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(229, 90, 42, 0.3);
}

/* ===== Main Content ===== */
.main-content {
  padding-top: calc(var(--nav-height) + var(--space-6));
  padding-bottom: var(--space-8);
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* ===== Page Header ===== */
.page-header {
  margin-bottom: var(--space-6);
  position: relative;
}

.page-title {
  font-size: clamp(1.75rem, 4vw, var(--text-4xl));
  font-weight: 800;
  margin-bottom: var(--space-2);
  background: linear-gradient(135deg, var(--dark) 0%, var(--gray-600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.15;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--gray-400);
  max-width: 560px;
  line-height: 1.5;
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 0, 0, 0.08);
}

.card-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--gray-50);
}

.card-header h3,
.card-header h4,
.card-header h5 {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 700;
}

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

.card-footer {
  padding: var(--space-3) var(--space-4);
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

/* Feature Card - Static top border */
.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
}

/* ===== Buttons ===== */
.btn {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  transition: all 0.2s ease;
  text-decoration: none;
  position: relative;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(229, 90, 42, 0.25);
  color: var(--white);
}

.btn-secondary {
  background: var(--dark);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--dark-soft);
  color: var(--white);
}

/* 状态徽章 */
.badge-draft {
  background: #FEF3C7;
  color: #B45309;
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
  background: #dc2626;
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--dark);
  border: 2px solid var(--gray-300);
}

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

.btn-ghost {
  background: transparent;
  color: var(--gray-500);
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--dark);
}

.btn-sm {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
}

.btn-lg {
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-1);
  letter-spacing: -0.01em;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--dark);
  transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--gray-400);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

/* ===== Badges ===== */
.badge {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.3em 0.7em;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  letter-spacing: 0.01em;
}

.badge-new {
  background: var(--primary);
  color: var(--white);
}

.badge-pending {
  background: var(--accent);
  color: var(--dark);
}

.badge-progress {
  background: var(--secondary);
  color: var(--white);
}

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

.badge-danger {
  background: var(--danger);
  color: var(--white);
}

.badge-info {
  background: var(--info);
  color: var(--white);
}

/* ===== Tables ===== */
.table-container {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background: var(--dark);
  color: var(--white);
}

.table th {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-2) var(--space-3);
  text-align: left;
}

.table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
  font-size: var(--text-sm);
}

.table tbody tr {
  transition: background 0.15s ease;
}

.table tbody tr:hover {
  background: rgba(229, 90, 42, 0.04);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ===== Tables Responsive (Phase 2) ===== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper table {
  min-width: 600px;
}

.table-wrapper th,
.table-wrapper td {
  white-space: nowrap;
}

/* Mobile optimization */
@media (max-width: 640px) {
  .table-wrapper {
    margin: 0 -16px;
    padding: 0 16px;
  }

  .table-wrapper table {
    font-size: 14px;
  }
}

/* ===== Alerts ===== */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  border-left: 3px solid;
}

.alert-icon {
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 700;
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
}

.alert-info {
  background: var(--info-bg);
  border-color: var(--info);
  color: #1d4ed8;
}

.alert-success {
  background: var(--success-bg);
  border-color: var(--success);
  color: #15803d;
}

.alert-warning {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: #a16207;
}

.alert-danger {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: #dc2626;
}

/* ===== Grid Layouts ===== */
.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1024px) {
  .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeIn 0.3s ease forwards;
}

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.3s; }

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  padding: var(--space-10) 0;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-soft) 100%);
  color: var(--white);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(255, 107, 53, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(255, 210, 63, 0.1) 0%, transparent 50%);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: var(--white);
  margin-bottom: var(--space-3);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.hero p {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--text-base);
  max-width: 560px;
  line-height: 1.6;
}

.hero .btn-primary {
  margin-top: var(--space-4);
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

/* Responsive: 1 col on mobile, 2 cols on tablet, 4 cols on desktop */
@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
  border: 1px solid var(--gray-200);
  transition: box-shadow 0.2s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: var(--space-1);
  line-height: 1;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ===== Dashboard Card ===== */
.dashboard-card .card-inner {
  transition: box-shadow 0.2s ease;
}

.dashboard-card:hover .card-inner {
  box-shadow: var(--shadow-lg);
}

/* ===== Switch ===== */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--dark-muted);
  transition: 0.3s;
  border-radius: 22px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch input:checked + .switch-slider {
  background-color: var(--primary);
}

.switch input:checked + .switch-slider:before {
  transform: translateX(18px);
}

/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-6);
}

/* 移动端全屏模态框 */
@media (max-width: 640px) {
  .modal.active {
    align-items: flex-start;
  }

  .modal-content {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    margin: 0;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

.modal-close {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: white;
}

/* ===== Tabs ===== */
.tabs {
  margin-top: var(--space-6);
}

.tab-buttons {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: var(--space-6);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--gray-400);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  font-size: var(--text-base);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--dark);
}

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

.tab-content {
  display: none;
}

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

/* ===== Upload ===== */
.upload-item {
  text-align: center;
}

.upload-item .form-label {
  display: block;
  margin-bottom: var(--space-2);
}

.upload-filename {
  display: block;
  font-size: var(--text-sm);
  color: var(--gray-400);
  margin-top: var(--space-2);
  word-break: break-all;
}

/* ===== Status Steps ===== */
.status-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  background: var(--gray-100);
}

.status-step.running {
  background: var(--info-bg);
}

.status-step.success {
  background: var(--success-bg);
}

.status-step.error {
  background: var(--danger-bg);
}

.step-icon {
  font-size: 1.2rem;
}

.step-name {
  font-weight: 600;
  min-width: 150px;
}

.step-msg {
  color: var(--gray-400);
  font-size: var(--text-sm);
}

/* ===== Markdown ===== */
.markdown-details {
  margin-top: var(--space-4);
}

.markdown-summary {
  cursor: pointer;
  padding: var(--space-3);
  background: var(--gray-100);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-weight: 500;
  color: var(--dark);
}

.markdown-body {
  background: white;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  color: var(--dark);
  margin: var(--space-4) 0 var(--space-2);
}

/* ===== Button Variants ===== */
.btn-accent {
  background: var(--accent);
  color: var(--dark);
  box-shadow: var(--shadow-sm);
}

.btn-accent:hover {
  background: var(--accent-dark);
  color: var(--dark);
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-warning:hover {
  background: #d97706;
  color: var(--white);
}

/* ===== Order Detail ===== */
.order-detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.order-reason {
  color: var(--gray-300);
  font-size: var(--text-sm);
}

/* ===== Delivery Stats ===== */
.delivery-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--gray-100);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}

.stat-item {
  text-align: center;
}

.stat-item .stat-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-bottom: var(--space-1);
}

.stat-item .stat-value {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--primary);
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: var(--space-6);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-5);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-6) + 4px);
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.timeline-time {
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-bottom: var(--space-1);
}

.timeline-location {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.timeline-desc {
  font-size: var(--text-base);
  color: var(--dark);
  margin-top: var(--space-1);
}

/* ===== Toast ===== */
.toast {
  background: var(--dark-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  min-width: 250px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border-left: 4px solid var(--gray-500);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-error { border-left-color: var(--danger); }
.toast-title { font-weight: 600; margin-bottom: var(--space-1); color: var(--light-warm); }
.toast-message { font-size: var(--text-sm); color: var(--gray-400); }

/* ===== Config Badge ===== */
.config-badge {
  margin-left: auto;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
}

/* ===== Footer ===== */
.footer {
  padding: var(--space-12) 0;
  text-align: center;
  color: var(--gray-400);
  font-size: var(--text-sm);
  border-top: 1px solid var(--gray-100);
  margin-top: var(--space-20);
  margin-left: var(--sidebar-width);
}

.sidebar-collapsed .footer {
  margin-left: var(--sidebar-collapsed-width);
}

.footer p {
  text-align: center;
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ===== Sidebar Layout ===== */
:root {
  /* 侧边栏 */
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;
  --sidebar-bg: #0F1419;
  --sidebar-text: rgba(255, 255, 255, 0.65);
  --sidebar-text-hover: rgba(255, 255, 255, 0.9);
  --sidebar-text-active: #FFFFFF;
  --sidebar-item-hover: rgba(255, 255, 255, 0.06);
  --sidebar-item-active: rgba(229, 90, 42, 0.3);
  --sidebar-border: rgba(255, 255, 255, 0.04);
  --sidebar-footer-bg: rgba(0, 0, 0, 0.2);
}

/* 侧边栏基础样式 */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease, transform 0.3s ease;
  z-index: 1000;
  overflow: hidden;
}

/* 折叠状态 - 侧边栏宽度 */
.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

/* 侧边栏头部 */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--sidebar-border);
  min-height: 64px;
}

.sidebar-logo {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-collapsed .sidebar-logo {
  opacity: 0;
  width: 0;
}

/* 折叠按钮 */
.sidebar-toggle {
  background: var(--sidebar-item-hover);
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
}

.sidebar-toggle:hover {
  background: var(--sidebar-item-active);
  color: var(--sidebar-text-hover);
  border-color: var(--primary);
}

.sidebar-collapsed .sidebar-toggle {
  margin-left: auto;
}

.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: var(--space-4) var(--space-2);
}

/* 导航菜单 */
.sidebar-nav {
  flex: 1;
  padding: var(--space-3) 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* 导航项 */
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  white-space: nowrap;
}

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

.nav-item.active {
  background: var(--sidebar-item-active);
  color: var(--sidebar-text-active);
  border-left-color: var(--primary);
}

.nav-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.nav-text {
  font-size: var(--text-sm);
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.sidebar-collapsed .nav-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: var(--space-3) var(--space-2);
}

/* 侧边栏底部 */
.sidebar-footer {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--sidebar-border);
  background: var(--sidebar-footer-bg);
}

.sidebar-user {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
}

.user-name {
  font-size: var(--text-xs);
  color: var(--gray-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.sidebar-collapsed .user-name {
  display: none;
}

/* 移动端遮罩层 */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.visible {
  opacity: 1;
}

/* 移动端汉堡按钮 */
.mobile-menu-btn {
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 998;
  background: var(--dark);
  border: none;
  color: var(--white);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn:hover {
  background: var(--dark-soft);
}

/* 主内容区 - 侧边栏布局 */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--space-6);
  padding-bottom: var(--space-8);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

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

/* 仪表盘样式 */
.dashboard-welcome {
  margin-bottom: var(--space-8);
}

.dashboard-welcome h1 {
  font-size: clamp(1.75rem, 4vw, var(--text-3xl));
  margin-bottom: var(--space-2);
}

.dashboard-welcome p {
  color: var(--gray-500);
  font-size: var(--text-base);
}

/* 仪表盘统计卡片 */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.dashboard-stats .stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  border: 1px solid var(--gray-200);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.dashboard-stats .stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.dashboard-stats .stat-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.dashboard-stats .stat-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.dashboard-stats .stat-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--dark);
  line-height: 1;
}

.dashboard-stats .stat-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* 快捷操作 */
.dashboard-quick-actions {
  margin-bottom: var(--space-8);
}

.dashboard-quick-actions h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
  color: var(--dark);
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.quick-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  color: var(--dark);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
  transition: all 0.2s ease;
}

.quick-action-btn:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

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

  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }

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

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

  .sidebar-collapsed .sidebar-logo {
    opacity: 1;
    width: auto;
  }

  .sidebar-collapsed .nav-text {
    opacity: 1;
    width: auto;
  }

  .sidebar-collapsed .nav-item {
    justify-content: flex-start;
    padding: var(--space-3) var(--space-4);
  }

  .sidebar-collapsed .sidebar-header {
    justify-content: space-between;
    padding: var(--space-4);
  }

  .main-content {
    margin-left: 0;
    padding-top: calc(var(--space-6) + 56px);
  }

  .sidebar-collapsed .main-content {
    margin-left: 0;
  }

  .footer {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .quick-actions-grid {
    grid-template-columns: 1fr;
  }
}
