/* ============================================================
   MZApp Design System — Unified Theme
   版本: v1.0  |  2026-04-05
   适用: mzapp.html / orders.html / data_analysis.html
   ============================================================

   使用方法：
   在每个页面 <head> 内添加：
   <link rel="stylesheet" href="/theme.css">

   然后将各页面原有 :root 变量替换为本文件中的统一 token，
   组件 class 按下方规范迁移。

   ============================================================ */


/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */

:root {

  /* ── 背景层级 ── */
  --bg-page:      #f5f5f4;   /* 页面底层 */
  --bg-surface:   #ffffff;   /* 卡片、面板 */
  --bg-surface-2: #fafaf9;   /* 斑马纹、表头 */
  --bg-surface-3: #f0efee;   /* 悬浮、选中 */

  /* ── 文字层级 ── */
  --text-primary:   #0c0c0b;
  --text-secondary: #57534e;
  --text-tertiary:  #a8a29e;
  --text-inverse:   #ffffff;

  /* ── 边框 ── */
  --border:          rgba(0, 0, 0, 0.07);
  --border-strong:   rgba(0, 0, 0, 0.12);
  --border-focus:    rgba(0, 102, 204, 0.45);

  /* ── 主色 (冷静蓝) ── */
  --accent:          #0066cc;
  --accent-hover:    #0052a3;
  --accent-active:   #004080;
  --accent-subtle:   #e8f0fb;
  --accent-muted:    rgba(0, 102, 204, 0.10);

  /* ── 功能色 ── */
  --success:         #16a34a;
  --success-subtle:  #f0fdf4;
  --warning:         #d97706;
  --warning-subtle:  #fffbeb;
  --danger:          #dc2626;
  --danger-subtle:   #fef2f2;
  --accent-blue:     #007aff;
  --accent-purple:   #8b5cf6;
  --cyan:            #06b6d4;
  --orange:          #f97316;
  --violet:          #8b5cf6;

  /* ── Area Colors ── */
  --area-1: #4ECDC4;
  --area-2: #45B7D1;
  --area-3: #96CEB4;
  --area-4: #85C1E9;
  --area-5: #FFEAA7;
  --area-6: #DDA0DD;
  --area-7: #98D8C8;
  --area-8: #F7DC6F;
  --area-9: #BB8FCE;

  /* ── Gray Scale ── */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* ── 圆角 ── */
  --radius-xs:   3px;
  --radius-sm:   5px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-pill: 100px;

  /* ── 阴影 ── */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);

  /* ── 间距 (4px grid) ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ── 字体 ── */
  --font-sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  /* ── 字号 (8级) ── */
  --text-xs:   11px;
  --text-sm:   12px;
  --text-base: 13px;
  --text-md:   14px;
  --text-lg:   16px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  32px;

  /* ── 行高 ── */
  --leading-tight:   1.3;
  --leading-normal:  1.5;
  --leading-relaxed: 1.7;

  /* ── 字重 ── */
  --weight-normal:   400;
  --weight-medium:   500;
  --weight-semibold: 600;

  /* ── 过渡 ── */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast:   120ms var(--ease);
  --transition-normal: 200ms var(--ease);
  --transition-slow:   300ms var(--ease);

  /* ── 容器宽度 ── */
  --container-sm: 720px;
  --container-md: 960px;
  --container-lg: 1280px;
  --container-xl: 1640px;

  /* ── Z-index ── */
  --z-base:    1;
  --z-sticky:  100;
  --z-overlay: 200;
  --z-tooltip: 300;
  --z-modal:   400;
}

/* 2. DARK MODE — 已禁用（2026-08-21 龙哥决策） */
  --warning:         #fbbf24;
  --warning-subtle:  rgba(251, 191, 36, 0.10);
  --danger:          #f87171;
  --danger-subtle:   rgba(248, 113, 113, 0.10);
  --accent-blue:     #4d9fff;
  --accent-purple:   #a78bfa;
  --cyan:            #22d3ee;
  --orange:          #fb923c;
  --violet:          #a78bfa;

  /* ── Area Colors (Dark) ── */
  --area-1: #6de0d6;
  --area-2: #5bc4de;
  --area-3: #a8d4bc;
  --area-4: #9bd0f0;
  --area-5: #f0ebb3;
  --area-6: #e5b9e5;
  --area-7: #a8e5d8;
  --area-8: #f5e58a;
  --area-9: #c9a8e0;

  /* ── Gray Scale (Dark) ── */
  --gray-50:  #18181b;
  --gray-100: #27272a;
  --gray-200: #3f3f46;
  --gray-300: #52525b;
  --gray-400: #71717a;
  --gray-500: #a1a1aa;
  --gray-600: #d4d4d8;
  --gray-700: #e4e4e7;
  --gray-800: #f4f4f5;
  --gray-900: #fafafa;
}



/* ============================================================
   3. RESET
   ============================================================ */

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

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

body {
  font-family: 'DM Sans', 'PingFang SC', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-hover); }


/* ============================================================
   4. LAYOUT
   ============================================================ */

.mz-container {
  width: 100%;
  max-width: var(--container-lg);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.mz-container--xl { max-width: var(--container-xl); }
.mz-container--md { max-width: var(--container-md); }
.mz-container--sm { max-width: var(--container-sm); }


/* ============================================================
   5. HEADER — 三页面统一结构
   ============================================================ */

/*
   HTML 模板：
   <header class="mz-header">
     <div class="mz-header__left">
       <button class="mz-back-btn">← 返回</button>    ← 子页面用
       <span class="mz-header__title">明珠自习室</span>
       <nav class="mz-nav">
         <a href="/" class="mz-nav__link mz-nav__link--active">座位总览</a>
         <a href="/orders" class="mz-nav__link">今日订单</a>
         <a href="/analysis" class="mz-nav__link">数据分析</a>
       </nav>
     </div>
     <div class="mz-header__center">
       <!-- 统计数字等（可选）-->
     </div>
     <div class="mz-header__right">
       <span class="mz-header__meta">更新于 14:32</span>
       <button class="mz-btn mz-btn--secondary mz-btn--sm">刷新数据</button>
     </div>
   </header>
*/

.hd, .s-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  gap: 8px 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.hd-title, .s-header__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.hd-meta, .s-header__meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-right: 10px;
}

.s-header__stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 16px;
  background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(16,185,129,0.08) 100%);
  border-radius: 8px;
  border: 1px solid rgba(59,130,246,0.2);
  flex-basis: 100%;
  /* 2026-10-05 由 space-between 改为 flex-start：
     撑满整行时 space-between 会把标签推向左、数字推向右，
     窄屏下退化成 7 行标签-数字对角线。统一为左对齐紧贴。 */
  justify-content: flex-start;
  text-align: left;
  position: relative;
  margin: 0;
}
.s-stat-item { white-space: nowrap; }
.s-stat-value { 
  font-weight: 700; 
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-surface);
  margin-left: 4px;
}
.s-stat-item:nth-child(1) .s-stat-value { color: #10b981; }
.s-stat-item:nth-child(3) .s-stat-value { color: #3b82f6; }
.s-stat-item:nth-child(5) .s-stat-value { color: #8b5cf6; }
.s-stat-item:nth-child(7) .s-stat-value { color: #f59e0b; }
.s-stat-divider { color: var(--text-tertiary); font-weight: 300; }
.s-header__date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
}
.s-date-range {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 140px;
  text-align: center;
}
.btn-icon {
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.btn-icon:hover { background: var(--bg-elevated); color: var(--text-primary); }

.nav, .s-nav {
  display: flex;
  gap: 2px;
  margin-left: 16px;
}

/* 图标按钮（紧凑、节省空间） */
.nl--icon, .s-nav__item--icon {
  width: 34px;
  height: 34px;
  padding: 0;
  position: relative;
}
.nl--icon .material-icons, .s-nav__item--icon .material-icons {
  font-size: 20px;
  line-height: 1;
  pointer-events: none;
}
/* hover tooltip 文本 */
.nl--icon[data-tooltip]::after,
.s-nav__item--icon[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated, #1f2937);
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 100;
}
.nl--icon[data-tooltip]:hover::after,
.s-nav__item--icon[data-tooltip]:hover::after {
  opacity: 1;
}
.nl:hover, .s-nav__item:hover {
  background: var(--bg-surface-3);
  color: var(--text-primary);
}
.nl.act, .s-nav__item--active {
  color: var(--accent);
  background: var(--accent-subtle);
}

.sp, .s-nav__spacer {
  flex: 1;
}

/* 返回按钮（子页面） */
.mz-back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 28px;
  padding: 0 var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
  text-decoration: none;
}
.mz-back-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-3);
}

/* 导航链接（别名兼容） */
.nav, .s-nav, .mz-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 16px;
}

.nl, .s-nav__item, .nav__link, .mz-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--text-secondary);
  border-radius: 5px;
  transition: color 120ms ease, background 120ms ease;
  white-space: nowrap;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
}
.nl:hover, .s-nav__item:hover, .nav__link:hover, .mz-nav__link:hover {
  color: var(--text-primary);
  background: var(--bg-surface-3);
}
.nl.act, .s-nav__item--active, .nav__link--active, .mz-nav__link--active {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* ============================================================
   导航统一形态：图标 + 文字
   2026-10-05。四页（总览/订单/分析/用户）统一使用，
   取代此前"首页纯图标、其余三页纯文字"的不一致状态。
   ============================================================ */
.s-nav__item--labeled {
  gap: 5px;
  padding: 0 10px;
}
.s-nav__item--labeled .material-icons {
  font-size: 17px;
  line-height: 1;
  flex-shrink: 0;
  pointer-events: none;
  opacity: 0.7;
  transition: opacity 120ms ease;
}
.s-nav__item--labeled:hover .material-icons,
.s-nav__item--labeled.s-nav__item--active .material-icons {
  opacity: 1;
}
.s-nav__item--labeled .s-nav__label {
  font-size: 12px;
  line-height: 1;
}





/* ============================================================
   6. BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  font-family: 'DM Sans', 'PingFang SC', -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity .12s ease;
  background: transparent;
  color: inherit;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.bse {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.bse:hover {
  background: var(--bg-surface-3);
}

.bac {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}
.bac:hover {
  opacity: .88;
}

.bgh {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.bgh:hover {
  background: var(--bg-surface-3);
  color: var(--text-primary);
}

.bda {
  background: var(--danger-subtle);
  color: var(--danger);
}

.bsc {
  background: var(--success);
  color: var(--text-inverse);
  border-color: var(--success);
}
.bsc:hover {
  opacity: .88;
}

.bsm {
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 3px;
}

/* Container */
.container { max-width: 1640px; margin: 0 auto; padding: 0 16px; }

/* 小尺寸按钮 */
.bsm, .btn--sm, .mz-btn--sm {
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 3px;
}


/* ============================================================
   7. CARDS
   ============================================================ */

.mz-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.mz-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface-2);
}

.mz-card__title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.mz-card__subtitle {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.mz-card__body {
  padding: var(--space-5);
}

.mz-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--bg-surface-2);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}


/* ============================================================
   8. STAT CARDS
   ============================================================ */

/*
   HTML 模板：
   <div class="mz-stats-grid">
     <div class="mz-stat-card">
       <div class="mz-stat-card__label">今日上座率</div>
       <div class="mz-stat-card__value">76%</div>
       <div class="mz-stat-card__delta mz-stat-card__delta--up">+5% 较昨日</div>
     </div>
   </div>
*/

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

.mz-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
}

.mz-stat-card__label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-2);
}

.mz-stat-card__value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.mz-stat-card__delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}
.mz-stat-card__delta--up   { color: var(--success); }
.mz-stat-card__delta--down { color: var(--danger); }
.mz-stat-card__delta--flat { color: var(--text-tertiary); }


/* ============================================================
   9. BADGES / TAGS
   ============================================================ */

.mz-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-pill);
  line-height: 1;
  white-space: nowrap;
}

.mz-badge--default  { background: var(--bg-surface-3);  color: var(--text-secondary); }
.mz-badge--accent   { background: var(--accent-subtle);  color: var(--accent); }
.mz-badge--success  { background: var(--success-subtle); color: var(--success); }
.mz-badge--warning  { background: var(--warning-subtle); color: var(--warning); }
.mz-badge--danger   { background: var(--danger-subtle);  color: var(--danger); }

/* 数量徽章（标题右侧） */
.mz-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--bg-surface-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  line-height: 1;
}


/* ============================================================
   10. TABLE
   ============================================================ */

.mz-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mz-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.mz-table th {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.mz-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.mz-table tbody tr {
  transition: background var(--transition-fast);
}
.mz-table tbody tr:hover { background: var(--bg-surface-2); }

/* 数字列右对齐 */
.mz-table td.mz-table__num,
.mz-table th.mz-table__num { text-align: right; font-variant-numeric: tabular-nums; }


/* ============================================================
   11. FORM ELEMENTS
   ============================================================ */

.mz-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.mz-input,
.mz-select {
  display: block;
  width: 100%;
  height: 30px;
  padding: 0 var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  -webkit-appearance: none;
}

.mz-input:hover,
.mz-select:hover { border-color: var(--text-tertiary); }

.mz-input:focus,
.mz-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

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

.mz-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 筛选器行 */
.mz-filters {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.mz-filters .mz-form-group { flex: 1; min-width: 140px; }


/* ============================================================
   12. LOADING STATES
   ============================================================ */

/* 骨架屏 */
.mz-skeleton {
  background: var(--bg-surface-2);
  border-radius: var(--radius-xs);
  position: relative;
  overflow: hidden;
}

.mz-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%
  );
  animation: mz-shimmer 1.6s ease-in-out infinite;
}

@keyframes mz-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Spinner */
.mz-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: mz-spin 0.65s linear infinite;
}

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

/* 全屏加载遮罩 */
.mz-loading-mask {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
}


/* ============================================================
   13. GANTT / SEAT GRID (mzapp.html 专用)
   ============================================================ */

.mz-gantt-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.mz-gantt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface-2);
}

.mz-gantt-legend {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.mz-gantt-legend__item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.mz-gantt-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* 座位状态色 */
.mz-seat--occupied { background: var(--accent); }
.mz-seat--expiring { background: var(--warning); }
.mz-seat--free     { background: var(--bg-surface-3); border: 1px solid var(--border); }
.mz-seat--arrived  { background: var(--success); }


/* ============================================================
   14. CHART SECTION (通用)
   ============================================================ */

.mz-chart-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.mz-chart-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}


/* ============================================================
   15. TOOLTIP
   ============================================================ */

.mz-tooltip {
  position: fixed;
  z-index: var(--z-tooltip);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
  pointer-events: none;
  min-width: 160px;
  max-width: 240px;
}

.mz-tooltip__name {
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}

.mz-tooltip__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  padding: 2px 0;
}

.mz-tooltip__row strong {
  color: var(--text-primary);
  font-weight: var(--weight-medium);
}


/* ============================================================
   16. FOOTER
   ============================================================ */

.mz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.mz-footer__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}


/* ============================================================
   17. DIVIDER
   ============================================================ */

.mz-divider {
  height: 1px;
  background: var(--border);
  border: none;
  margin: 0;
}


/* ============================================================
   18. RESPONSIVE — 统一断点 768px
   ============================================================ */

@media (max-width: 768px) {
  .mz-container      { padding: 0 var(--space-4); }
  .mz-header         { padding: 0 var(--space-4); }
  .mz-header__center { display: none; }

  .mz-stats-grid     { grid-template-columns: repeat(2, 1fr); }
  .mz-filters        { flex-direction: column; }

  .mz-card__header   { padding: var(--space-3) var(--space-4); }
  .mz-card__body     { padding: var(--space-4); }

  .mz-footer { padding: var(--space-3) var(--space-4); flex-direction: column; align-items: flex-start; }
}


/* ============================================================
   19. UTILITY CLASSES
   ============================================================ */

/* 文字颜色 */
.mz-text-primary   { color: var(--text-primary) !important; }
.mz-text-secondary { color: var(--text-secondary) !important; }
.mz-text-tertiary  { color: var(--text-tertiary) !important; }
.mz-text-accent    { color: var(--accent) !important; }
.mz-text-success   { color: var(--success) !important; }
.mz-text-warning   { color: var(--warning) !important; }
.mz-text-danger    { color: var(--danger) !important; }

/* 字号 */
.mz-text-xs   { font-size: var(--text-xs) !important; }
.mz-text-sm   { font-size: var(--text-sm) !important; }
.mz-text-base { font-size: var(--text-base) !important; }
.mz-text-md   { font-size: var(--text-md) !important; }
.mz-text-lg   { font-size: var(--text-lg) !important; }
.mz-text-xl   { font-size: var(--text-xl) !important; }

/* 字重 */
.mz-font-medium   { font-weight: var(--weight-medium) !important; }
.mz-font-semibold { font-weight: var(--weight-semibold) !important; }

/* 截断 */
.mz-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Flex 工具 */
.mz-flex         { display: flex; align-items: center; }
.mz-flex--gap-2  { gap: var(--space-2); }
.mz-flex--gap-3  { gap: var(--space-3); }
.mz-flex--gap-4  { gap: var(--space-4); }
.mz-flex--between { justify-content: space-between; }

/* 间距 */
.mz-mt-3 { margin-top: var(--space-3); }
.mz-mt-4 { margin-top: var(--space-4); }
.mz-mt-6 { margin-top: var(--space-6); }
.mz-mb-3 { margin-bottom: var(--space-3); }
.mz-mb-4 { margin-bottom: var(--space-4); }
.mz-mb-6 { margin-bottom: var(--space-6); }

/* 无障碍隐藏 */
.mz-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ============================================================
   HEADER 响应式（手机屏 ≤640px）— 2026-08-28 龙哥决策
   ============================================================ */
@media (max-width: 640px) {
  /* header 容器紧凑 */
  .hd, .s-header {
    padding: 8px 10px;
    gap: 6px 0;
  }

  /* 导航：5 项「图标 + 文字」横排，窄屏收紧并允许横向滚动
     2026-10-05 由纯图标横排改为图标+文字 */
  .nav, .s-nav {
    flex-direction: row;
    align-items: center;
    width: 100%;
    margin-left: 0;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar,
  .s-nav::-webkit-scrollbar { display: none; }
  .s-nav__item--labeled {
    gap: 4px;
    padding: 0 7px;
  }
  .s-nav__item--labeled .material-icons {
    font-size: 16px;
  }
  .s-nav__item--labeled .s-nav__label {
    font-size: 11px;
  }

  /* spacer 隐藏（窄屏不需要右推） */
  .sp, .s-nav__spacer {
    display: none;
  }

  /* date-nav 居中占满 */
  .s-header__date-nav {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  /* 更新时间居中 */
  .hd-meta, .s-header__meta {
    margin-right: 0;
    text-align: center;
    width: 100%;
  }

  /* 刷新按钮占满 */
  #btnRefresh {
    width: 100%;
  }

  /* 7 个关键数据：竖向依次排列 */
  .s-header__stats {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 10px;
  }
  .s-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
  }
  .s-stat-item:last-child {
    border-bottom: none;
  }

  /* 分隔符 “|” 竖向时不需要 */
  .s-stat-divider {
    display: none;
  }

  /* ============================================================
     GANTT 区域响应式 — 2026-08-28 龙哥决策
     ============================================================ */
  /* gantt header 行允许换行（标题+标签 | 图例+按钮） */
  .gantt-header-row {
    flex-wrap: wrap;
    gap: 6px;
  }
  /* 标题与标签堆叠（标签独占一行以便横排）
     2026-10-05 提高选择器权重：mzapp.html:142 的内联 .gantt-subs{align-items:center}
     在 head 之后加载、同权重下会赢，导致盒子不撑满而居中。加父级限定后
     移动端盒子与页头 .s-header__stats 一样通栏。 */
  .gantt-header-row .gantt-subs {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .gantt-title {
    margin-bottom: 2px;
  }
  /* 6 个数据标签：每个独占一行（避免 wrap 造成的漂移）
     2026-10-05 提高选择器权重：本块要覆盖 mzapp.html:146 内联的
     .gantt-subt{align-items:center}。移动端是 flex-direction:column，
     此时 align-items 控制的是水平方向，center 会让每行内容居中，
     必须显式压成 stretch 才能与页头 .s-header__stats 的左对齐一致。 */
  .gantt-header-row .gantt-subt {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 10px;
    margin-left: 0;
    justify-content: flex-start;
    text-align: left;
  }
  .gantt-subt > span:not(.divider-s):not(.divider-m) {
    padding: 5px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 11px;
  }
  .gantt-subt > span:not(.divider-s):not(.divider-m):last-of-type {
    border-bottom: none;
  }
  /* 竖向排列时分隔符不需要 */
  .gantt-subt .divider-s,
  .gantt-subt .divider-m {
    display: none;
  }
  /* 图例 + 门禁刷新按钮也横排一行 */
  .legend-gap {
    width: 100%;
    justify-content: space-between;
  }
  .legend {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ============================================================
   手动云备份弹窗（2026-09-01 新增）
   ============================================================ */
.bk-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-base, system-ui, -apple-system, sans-serif);
}
.bk-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
.bk-modal__card {
  position: relative;
  background: var(--bg-card, #fff);
  color: var(--text-primary, #222);
  border-radius: 10px;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.bk-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light, #e5e7eb);
}
.bk-modal__header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.bk-modal__close {
  background: none;
  border: 0;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary, #888);
  padding: 0 4px;
}
.bk-modal__close:hover { color: var(--text-primary, #222); }
.bk-modal__body {
  padding: 20px;
  overflow-y: auto;
}
.bk-modal__confirm p { margin: 0 0 12px; }
.bk-modal__list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.bk-modal__list li {
  padding: 8px 12px;
  background: var(--bg-subtle, #f4f5f7);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 14px;
}
.bk-modal__hint {
  font-size: 12px;
  color: var(--text-secondary, #888);
  margin: 12px 0 0;
}
.bk-modal__progress { padding: 0; }
.bk-progress-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 12px;
  font-weight: 500;
}
.bk-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-light, #e5e7eb);
  border-top-color: var(--accent, #3b82f6);
  border-radius: 50%;
  animation: bk-spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes bk-spin { to { transform: rotate(360deg); } }
.bk-log {
  margin: 0;
  padding: 12px;
  background: #1a1d23;
  color: #e1e4e8;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
  line-height: 1.5;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.bk-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-light, #e5e7eb);
}

/* ============================================================
   BOOKING WINDOW（预约时段）— 全站统一
   ============================================================
   2026-10-06：预约时段原先各处各自渲染、整块居中，多行长短不一时参差不齐。
   现统一为「日期橙红 / 时间蓝 / 五列网格对齐」，orders.html 三张表、
   mzapp.html 座位悬浮提示、users.html 消费与订单记录共用同一份实现，
   渲染函数见 shared-utils.js 的 mzUtils.renderBookTime。

   网格列宽用 ch 锁定，配合等宽字体，保证任意字号下
   所有行的日期列与时间列各自竖直对齐。 */
.bt {
  display: inline-grid;
  grid-template-columns: 5.4ch 5.4ch 1.1em 5.4ch 5.4ch;
  align-items: baseline;
  column-gap: 2px;
  font-family: var(--font-mono);
  font-size: 1em;
  line-height: 1.5;
  white-space: nowrap;
}
.bt-d { color: var(--orange); font-weight: var(--weight-medium); }
.bt-t { color: var(--accent-blue); font-weight: var(--weight-semibold); }
.bt-x { color: var(--text-tertiary); text-align: center; }
/* 当日单段没有结束日期，留空占位以保持四列对齐 */
.bt-none, .bt-raw { color: var(--text-tertiary); }

/* 日期/时段拆成独立两列的表格（users.html 订单记录）用这两个单色类 */
.bt-date { color: var(--orange); font-family: var(--font-mono); font-weight: var(--weight-medium); }
.bt-time { color: var(--accent-blue); font-family: var(--font-mono); font-weight: var(--weight-semibold); }

/* 承载 .bt 的单元格：左对齐 + 不换行 */
.bt-cell { text-align: left; white-space: nowrap; }

/* 纯时段（无日期，如 "08:00 → 22:00"）：横向排列 + 首尾对齐 */
.bt-inline {
  display: inline-grid;
  grid-template-columns: 5.4ch 1.1em 5.4ch;
  align-items: baseline;
  column-gap: 2px;
  font-family: var(--font-mono);
  font-size: 1em;
  white-space: nowrap;
}

/* ============================================================
   END OF DESIGN SYSTEM
   ============================================================ */
