/* ==========================================================================
   名将食品 · 设计Token与三模态核心色板 (tokens.css)
   遵循: Rule LV (Daylight/Midnight/Eyecare) / Rule XXXV (≤ 300 行)
   ========================================================================== */

:root, [data-theme="daylight"] {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-accent: #ecfdf5;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #d1fae5;
  --accent: #0284c7;
  --accent-light: #e0f2fe;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --phone-bg: #0f172a;
}

[data-theme="midnight"] {
  --bg-primary: #090d16;
  --bg-surface: #111827;
  --bg-subtle: #1f2937;
  --bg-accent: #064e3b;
  --text-primary: #f9fafb;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-light: #064e3b;
  --accent: #38bdf8;
  --accent-light: #0c4a6e;
  --warning: #f59e0b;
  --warning-light: #78350f;
  --danger: #ef4444;
  --border: #334155;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.7);
  --phone-bg: #020617;
}

[data-theme="eyecare"] {
  --bg-primary: #f6f1e8;
  --bg-surface: #fdfbf7;
  --bg-subtle: #ebe3d5;
  --bg-accent: #e5ede4;
  --text-primary: #2d261e;
  --text-secondary: #5c5245;
  --text-muted: #786c5e;
  --primary: #2e7d32;
  --primary-hover: #1b5e20;
  --primary-light: #c8e6c9;
  --accent: #00796b;
  --accent-light: #b2dfdb;
  --warning: #b78103;
  --warning-light: #ffecb3;
  --danger: #c62828;
  --border: #dfd5c5;
  --shadow-sm: 0 1px 2px rgba(45, 38, 30, 0.05);
  --shadow-md: 0 4px 6px rgba(45, 38, 30, 0.08);
  --shadow-lg: 0 10px 15px rgba(45, 38, 30, 0.1);
  --phone-bg: #2d261e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

.global-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 24px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.brand-badge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  min-width: 0;
}

.dot-live {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  display: inline-block;
  flex-shrink: 0;
}

.benchmark-tag {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary);
  white-space: nowrap;
}

.view-switchers {
  display: flex;
  flex-wrap: wrap;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.switch-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.switch-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.theme-controller {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.theme-controller select {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

.main-viewport-container {
  min-height: calc(100vh - 56px);
}

.view-section { display: none; }
.view-section.active { display: block; }
.full-width { width: 100%; }

@media (max-width: 768px) {
  .global-control-bar {
    position: static;
    padding: 8px 12px;
    gap: 8px;
  }
  .brand-badge {
    width: 100%;
    font-size: 13px;
    justify-content: space-between;
    gap: 6px;
  }
  .benchmark-tag {
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }
  .view-switchers {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: space-between;
  }
  .switch-btn {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    font-size: 12px;
    text-align: center;
  }
  .theme-controller {
    flex-shrink: 0;
  }
  .theme-controller label {
    display: none;
  }
}
