/* ===== 全局变量（macOS Glassmorphism 风格） ===== */
:root {
  /* 背景层级 - 浅色通透 */
  --bg: #f2f2f7;
  --bg-sidebar: #f2f2f7;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-input: #e8e8ee;
  --bg-elevated: #ffffff;
  --bg-overlay: #000000;

  /* 边框 - 浅色半透明 */
  #ebebeb
  #f2f2f2
  #f7f7f7

  /* 文字层级 */
  --text: #1d1d1f;
  --text-secondary: #424245;
  --text-tertiary: #6e6e73;
  --text-muted: #aeaeb2;
  --text-on-accent: #1a1614;

  /* 品牌强调色 - 柠檬黄 */
  --primary: #eaa200;
  --primary-dark: #c98a00;
  --primary-light: #ffc23d;
  --primary-bg: #fcf4e0;
  --primary-bg-hover: #fbeccc;

  /* macOS 系统色 */
  --accent: #34c759;
  --danger: #ff3b30;
  --warning: #ff9500;
  --success: #34c759;
  --info: #5ac8fa;
  --purple: #af52de;
  --pink: #ff2d55;
  --yellow: #ffcc00;
  --indigo: #5856d6;

  /* 形状 - 大圆角（macOS 风格）*/
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  /* 阴影 - 浅色柔和 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px #e3e3e8;
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.10);

  /* 侧边栏 */
  --sidebar-width: 240px;
}

/* ===== 夜间模式变量 ===== */
.dark {
  --bg: #14141a;
  --bg-sidebar: #14141d;
  --bg-card: #22222b;
  --bg-card-hover: #2c2c34;
  --bg-input: #2e2e38;
  --bg-elevated: #2a2a36;
  --bg-overlay: #000000;

  #383840
  #2f2f38
  #2b2b33

  --text: #f5f5f7;
  --text-secondary: #aeaeb2;
  --text-tertiary: #6e6e73;
  --text-muted: #48484a;
  --text-on-accent: #1a1614;

  --primary: #ffc53d;
  --primary-dark: #f0b429;
  --primary-light: #ffd966;
  --primary-bg: #453c2b;
  --primary-bg-hover: #5b4c2d;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.20);
  --shadow: 0 4px 16px rgba(0,0,0,0.30);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.50);
}

/* ===== Reset ===== */
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ===== 布局 ===== */
.app { display: flex; min-height: 100vh; }

/* ===== 侧边栏（macOS 毛玻璃） ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid #e3e3e8;
  padding:0;
  position: fixed;
  top:0; left:0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.sidebar-brand {
  padding: 28px 20px 24px;
  border-bottom: 1px solid #e3e3e8;
  background: var(--bg-sidebar);
}
.sidebar-brand .logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 22px;
  height: 22px;
}
.sidebar-brand .logo .icon { font-size: 26px; }

/* 品牌 logo：可点击上传（仅管理员） */
.brand-logo {
  position: relative;
  cursor: default;
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s;
  /* 固定为与默认图标完全一致的尺寸（22svg + 4*2 padding = 30px） */
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* 默认状态：带黄底圆角方块 */
.brand-logo:not(.is-custom) {
  background: linear-gradient(135deg, #f5b301, #ffd34d);
  border-radius: 8px;
  padding: 4px;
}
.brand-logo:not(.is-custom) svg {
  width: 22px;
  height: 22px;
  display: block;
}
/* 自定义图片状态：透明背景，按图片原始比例缩放（contain） */
.brand-logo.is-custom img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}
.brand-logo.is-clickable {
  cursor: pointer;
}
.brand-logo.is-clickable:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(74, 124, 89, 0.35);
}
.brand-logo.is-uploading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #ffffff;
  border-radius: inherit;
  animation: brand-logo-pulse 1.1s ease-in-out infinite;
}
@keyframes brand-logo-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.7; }
}
.brand-logo .brand-logo-reset {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger, #ff3b30);
  color: #fff;
  border: none;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.brand-logo.has-custom:hover .brand-logo-reset {
  display: flex;
}
.sidebar-brand .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.sidebar-nav { flex:1; padding:16px 12px; overflow-y:auto; }
.nav-item {
  display:flex; align-items:center; gap:12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
  font-size: 14px;
  position: relative;
}
.nav-item:hover { background: #f5f5f5; color: var(--text); }
.nav-item.active {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
}
.nav-item .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-item .icon svg { display: block; }
.sidebar-brand .logo .icon svg { display: block; }

/* 导航分组（可折叠） */
.nav-group { margin-bottom: 4px; }
.nav-group-header { justify-content: flex-start; }
.nav-group-header .nav-arrow {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.2s;
}
.nav-group.collapsed .nav-arrow { transform: rotate(-90deg); }
.nav-group-items {
  overflow: hidden;
  max-height: 500px;
  transition: max-height 0.3s ease;
}
.nav-group.collapsed .nav-group-items { max-height: 0; }
.nav-item.nav-sub {
  padding-left: 40px;
  font-size: 13px;
  gap: 8px;
}
.nav-item.nav-sub .nav-dot {
  font-size: 10px;
  color: var(--text-muted);
  width: 8px;
}
/* 门店筹备 - 门店列表 */
.nav-store-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 24px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  margin-bottom: 2px;
}
.nav-store-item:hover { background: #f5f5f5; color: var(--text); }
.nav-store-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.nav-store-item .nav-store-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-store-item .nav-store-status {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.nav-store-status.preparing { background: #ffecce; color: var(--warning); }
.nav-store-status.completed { background: #d6f6de; color: var(--success); }
.nav-store-status.paused { background: #ffdad8; color: var(--danger); }
.nav-store-item.active .nav-store-status { background: #cccccc; color: inherit; }

/* 门店筹备状态徽章（页面内） */
.store-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.store-status-badge.preparing { background: #fff1da; color: var(--warning); }
.store-status-badge.completed { background: #e0f8e6; color: var(--success); }
.store-status-badge.paused { background: #ffe3e1; color: var(--danger); }

/* 门店详情页 */
.store-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.store-detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.store-detail-title h2 { margin: 0; font-size: 22px; }
.store-detail-actions { display: flex; gap: 8px; }
.store-delivery-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  font-size: 14px;
  color: var(--text-muted);
}
.store-delivery-date input[type="date"] {
  width: 150px;
  padding: 5px 10px;
  font-size: 14px;
}
.store-category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.store-category-tab {
  padding: 10px 18px;
  cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  font-weight: 500;
  transition: all 0.2s;
  font-size: 14px;
}
.store-category-tab:hover { color: var(--text); }
.store-category-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.store-category-panel { display: none; }
.store-category-panel.active { display: block; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.sidebar-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text);
  border-color: var(--border-light);
}

/* ===== 主题切换过渡 ===== */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== 主内容区 ===== */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 28px 32px;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-title { font-size: 22px; font-weight: 700; line-height: 1; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.page-subtitle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.drag-sort-hint {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}
.drag-sort-hint.disabled {
  background: #eeeeef;
  color: var(--text-muted);
}

/* ===== 卡片（macOS 毛玻璃） ===== */
.card {
  background: var(--bg-card);
  border: 1px solid #ffffff;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
  min-width: 0;
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 600; }

/* ===== 统计卡片（macOS 毛玻璃） ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid #ffffff;
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.stat-card .stat-icon svg {
  display: block;
  width: 26px;
  height: 26px;
}
.stat-card .stat-value { font-size: 28px; font-weight: 700; }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); }

/* ===== 按钮 ===== */
.btn {
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: #1a1614; font-weight: 600; box-shadow: 0 1px 3px rgba(234,162,0,0.30); }
.btn-primary:hover { background: var(--primary-dark); color: #1a1614; box-shadow: 0 2px 8px rgba(234,162,0,0.40); }
.btn-secondary { background: #f5f5f5; color: var(--text); border: 1px solid #ebebeb; }
.btn-secondary:hover { background: #ededed; }
.btn-info { background: #fcf4e0; color: var(--primary); border: 1px solid #f8e2af; }
.btn-info:hover { background: #fbeccc; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
tr:hover td { background: var(--bg-card-hover); }
.table-actions { display: flex; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }

/* ---- 物料供应商报价展开区域 ---- */
/* 毛玻璃蒙版：覆盖整个视口，其它区域变暗+模糊 */
.quote-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000000;
  z-index: 200;
  animation: quote-backdrop-in 0.25s ease;
}
@keyframes quote-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 展开时：让整个物料卡片用更高的 z-index 浮在蒙版上 */
.card.quote-active {
  position: relative;
  z-index: 201;
  background: #ffffff;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

/* 卡片内非聚焦行：模糊 + 变暗
   注意：tr 上 filter:blur 会让内部子表也一起模糊，
   所以改用"非聚焦行"为 .dimmed-row 类（按需加），不再用 :not 选择器 */
.card.quote-active #materials-table tbody tr.dimmed-row {
  filter: blur(8px) saturate(0.4) brightness(0.85);
  pointer-events: none;
  user-select: none;
  transition: filter 0.25s ease;
}
/* 聚焦行 + 展开行保持清晰 */
.card.quote-active #materials-table tbody tr.quote-focus-row,
.card.quote-active #materials-table tbody tr.material-quote-spacer {
  filter: none;
  position: relative;
  z-index: 1;
}
/* 聚焦行背景 */
.card.quote-active #materials-table tbody tr.quote-focus-row > td {
  background: #ffffff;
}

.material-quote-spacer { background: transparent !important; }
.material-quote-spacer:hover td { background: transparent !important; }
.material-quote-cell { padding: 0 !important; border-bottom: none; background: transparent; }
.material-quote-panel {
  background: #f5f7fb;
  border: none;
  border-radius: 0;
  margin: 0;
  padding: 16px 0;
  box-shadow: none;
}
.material-quote-panel .quote-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 24px 12px;
  border-bottom: 1px solid var(--border);
}
.material-quote-panel .quote-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.material-quote-panel .quote-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.quote-table-wrap { display: flex; flex-direction: column; }

/* 报价子表：与主表共用一套列结构（colgroup fr 比例完全一致），
   cell padding/border/vertical-align 严格继承主表 th/td，确保
   表头与数据行的文字 baseline 落在同一像素列上。 */
.quote-subtable {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  table-layout: fixed;
  margin: 0;
  border-spacing: 0;
}
.quote-subtable th,
.quote-subtable td {
  padding: 12px 16px;
  font-size: 13px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  box-sizing: border-box;
}
.quote-subtable th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  background: transparent;
  border-bottom: 1.5px solid var(--border);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.quote-subtable td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-subtable tr.selected-row td { background: #fdf8eb; }
.quote-subtable tr:hover td:not(:empty) { background: var(--bg-card-hover); }
.quote-subtable tr.selected-row:hover td { background: #fcf4e0; }
.quote-subtable .quote-empty { padding: 24px; text-align: center; color: var(--text-muted); }

.quote-cell-filler {
  background: transparent !important;
  border-bottom: none !important;
  padding: 0 !important;
}
.quote-grid {
  display: grid;
  align-items: stretch;
  gap: 0;
}
.quote-grid > div {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.quote-grid-header > div {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  background: transparent;
  border-bottom: 1.5px solid var(--border);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quote-grid-row:hover > div { background: var(--bg-card-hover); }
.quote-grid-row.selected-row > div { background: #fdf8eb; }
.quote-grid-row:last-child > div,
.quote-grid-form > div { border-bottom: none; }
.quote-supplier-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}
.quote-table th,
.quote-table td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.quote-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.quote-table tr:last-child td { border-bottom: none; }
.quote-table .selected-row td { background: #fdf8eb; }
/* 已采用 + 生产周期 两个 tag 统一高度：固定 height + line-height:1 + box-sizing */
.quote-selected-badge,
.lead-time-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  line-height: 1;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-sizing: border-box;
  flex-shrink: 0;
}
.quote-selected-badge {
  gap: 4px;
  background: #fbeed1;
  color: var(--primary);
}
.lead-time-tag {
  background: #fff1da;
  color: #d97706;
}
.quote-actions { display: flex; gap: 8px; flex-wrap: nowrap; width: 100%; }
.quote-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.quote-loading {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
@media (max-width: 768px) {
  .quote-table-wrap { overflow-x: auto; }
  .quote-grid { min-width: 720px; }
  .quote-form-action { flex-wrap: wrap; }
}

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.tag-tea { background: #fbeed1; color: var(--primary); }
.tag-composite { background: #f9e3b2; color: var(--primary); font-weight: 600; cursor: help; }
.tag-juice { background: #e0f8e6; color: var(--accent); }
.tag-dairy { background: #fff9da; color: var(--yellow); }
.tag-syrup { background: #ffe3e1; color: var(--danger); }
.tag-topping { background: #f5e6fd; color: var(--purple); }
.tag-other { background: #eeeeef; color: var(--text-tertiary); }
.tag-machine { background: #e8f8ff; color: var(--info); }
.tag-used { background: #e0f8e6; color: var(--success); cursor: help; }
.tag-used-clickable { cursor: pointer; }
.tag-used-clickable:hover { background: #cbf4d5; }
.tag-unused { background: #eeeeef; color: var(--text-tertiary); }

/* ===== 状态标签（极简风格） ===== */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0;
  border: 0;
  transition: opacity 0.15s;
}
.status-icon {
  display: none;
}
.status-active { background: #e7f8eb; color: #34c759; }
.status-pending { background: #fff2dd; color: #ff9f0a; }
.status-offline { background: #ffe7e6; color: #ff3b30; }

/* 可点击的状态标签 */
.status-tag.clickable {
  cursor: pointer;
  user-select: none;
}
#detail-status-tag {
  display: inline-flex;
  align-items: center;
  align-self: center;
}
.status-tag.clickable:hover { opacity: 0.78; }
.status-tag.clickable:active { opacity: 0.65; }

/* 状态切换下拉菜单 */
.status-menu {
  position: absolute;
  z-index: 50;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 100px;
  padding: 0;
}
.status-menu-item {
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-menu-item:hover { background: var(--bg-card-hover); }
.dark .status-menu { background: #2c2c38; }
.status-menu-item.current {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-bg);
}

/* ===== 表单（macOS 风格） ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  max-width: 100%;
  padding: 9px 14px;
  background: #ffffff;
  border: 1px solid #ebebeb;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}
/* 只读字段（复合物料的规格/换算/采购价等）：灰底弱化，提示不可编辑 */
.form-input[readonly] {
  background: var(--bg);
  color: var(--text-muted);
  cursor: not-allowed;
}
.form-textarea { resize: vertical; min-height: 60px; }
.form-input, .form-textarea {
  cursor: text;
}
/* 隐藏数字输入框的上下调节按钮，避免遮挡右对齐的文本光标 */
.form-input[type="number"]::-webkit-inner-spin-button,
.form-input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.form-input[type="number"] {
  -moz-appearance: textfield;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.form-checkbox input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  top:0; left:0; right:0; bottom:0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  background: #ffffff;
  border: 1px solid #ffffff;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}
.modal.large { max-width: 800px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--bg-card-hover); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--bg-card);
}

/* ===== 筛选栏 ===== */
.filter-bar {
  display: grid;
  grid-template-columns: 1fr 180px 180px auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filter-bar .search-bar { margin-bottom: 0; }
.filter-bar .filter-select {
  width: 100%;
  background: var(--bg-input) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23888' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 32px 8px 12px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.filter-bar .filter-select:focus { outline: none; border-color: var(--primary); }
.filter-bar-item { position: relative; }
.filter-bar-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}
.filter-bar-count {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 0 4px;
}

/* ===== 搜索框 ===== */
.search-bar {
  position: relative;
  margin-bottom: 16px;
}
.search-bar input {
  width: 100%;
  padding: 9px 14px 9px 40px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.search-bar input:focus { outline: none; border-color: var(--primary); }
.search-bar .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

/* ===== 配方编辑器 ===== */
.recipe-editor { margin-top: 16px; min-width: 0; }
.recipe-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 8px;
  flex-wrap: wrap;
}
.recipe-editor-title { font-size: 16px; font-weight: 600; }
.recipe-editor-actions { display: flex; gap: 8px; flex-shrink: 0; }
.recipe-item {
  display: grid;
  grid-template-columns: minmax(0,1fr) 100px 120px 90px 40px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.recipe-item .form-input, .recipe-item .form-select {
  padding: 7px 10px;
  font-size: 13px;
}
.recipe-material-cell {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.recipe-material-cell .form-select,
.recipe-material-cell .form-input {
  width: 100%;
  padding-right: 10px;
}
.recipe-material-input { display: none; }
.recipe-item[data-mode="new"] .recipe-material-select { display: none; }
.recipe-item[data-mode="new"] .recipe-material-input { display: block; }
.recipe-new-toggle {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--primary);
  cursor: pointer;
  font-size: 11px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  z-index: 1;
}
.recipe-new-toggle:hover { background: var(--primary); color: #1a1614; }
.recipe-item[data-mode="new"] .recipe-new-toggle {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}
.recipe-cost-display {
  padding: 7px 4px;
  text-align: right;
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.recipe-price-display {
  padding: 7px 4px;
  text-align: right;
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.recipe-amount-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.recipe-amount-cell .form-input {
  flex: 1;
  text-align: right;
}
.recipe-unit {
  color: var(--text-muted);
  font-size: 13px;
  user-select: none;
  white-space: nowrap;
}
.recipe-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 0;
  margin-top: 12px;
  border-top: 2px solid var(--border);
}
.recipe-total .label { font-size: 16px; font-weight: 600; }
.recipe-total .amount { font-size: 24px; font-weight: 700; color: var(--primary); }

/* 吸底保存栏：滚动时始终可见 */
.recipe-save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  margin-left: -20px;
  margin-right: -20px;
  margin-bottom: -20px;
  padding: 12px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 -4px 16px #e3e3e8;
  z-index: 20;
}
.recipe-save-bar-cost {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.recipe-save-bar-cost .label {
  font-size: 13px;
  color: var(--text-secondary);
}
.recipe-save-bar-cost .amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}
@media (max-width: 600px) {
  .recipe-save-bar-cost .amount { font-size: 17px; }
}

/* ===== 包装管理标签页 ===== */
.packaging-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.packaging-tab {
  padding: 10px 20px;
  cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  font-weight: 500;
  transition: all 0.2s;
}
.packaging-tab:hover { color: var(--text); }
.packaging-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== 杯子组合明细行 ===== */
.cup-item-row {
  display: grid;
  grid-template-columns: 1fr 120px 40px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

/* ===== 包装配置区 ===== */
.packaging-config {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-top: 16px;
}
.packaging-config-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}
.packaging-preview {
  text-align: right;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 12px;
}

/* ===== 饮品卡片 ===== */
.drinks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.drink-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  content-visibility: auto;
  contain-intrinsic-size: 0 380px;
  contain: layout paint;
  transform: translateZ(0);
}
.drink-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px) translateZ(0);
  box-shadow: 0 16px 32px rgba(0,0,0,0.35);
}
.drink-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-input);
  overflow: hidden;
  transform: translateZ(0);
}
.drink-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  display: block;
  transition: transform 0.4s ease;
}
.drink-card:hover .drink-photo { transform: scale(1.04); }
.drink-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--text-muted);
  cursor: pointer;
  background: linear-gradient(135deg, var(--bg-input), var(--bg-card));
}
.drink-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 5;
}
.action-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #aaaaaa;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}
.action-btn:hover {
  background: var(--primary);
  color: #1a1614;
  border-color: var(--primary);
  transform: scale(1.1);
}
.action-btn-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.action-btn.drag-handle {
  cursor: grab;
  font-size: 12px;
  letter-spacing: -1px;
  opacity: 1;
}
.action-btn.drag-handle:active { cursor: grabbing; }

/* ===== 饮品卡片拖拽排序 ===== */
.drink-card.draggable { cursor: grab; }
.drink-card.draggable:active { cursor: grabbing; }
.drink-card.dragging {
  opacity: 1;
  transform: scale(0.98) translateZ(0);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}
.drinks-grid.is-dragging .drink-card:not(.dragging) {
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.drink-card.drop-before,
.drink-card.drop-after {
  position: relative;
}
.drink-card.drop-before::before,
.drink-card.drop-after::after {
  content: "";
  position: absolute;
  background: var(--primary);
  border-radius: 2px;
  z-index: 10;
  pointer-events: none;
}
.drink-card.drop-before::before {
  top: -8px;
  left: 0;
  right: 0;
  height: 3px;
}
.drink-card.drop-after::after {
  bottom: -8px;
  left: 0;
  right: 0;
  height: 3px;
}
.drink-status-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  transition: opacity 0.15s;
}
.drink-card:hover .drink-status-badge { opacity: 0.85; }
.drink-card-body {
  padding: 20px;
  cursor: pointer;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.drink-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.drink-card .drink-name {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.2px;
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drink-variant-count { color: var(--text-muted); }
.drink-card .drink-category-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-bg);
  color: var(--primary);
  flex-shrink: 0;
}
.drink-card .drink-category-tag.no-category {
  background: #eeeeef;
  color: var(--text-muted);
  font-weight: 500;
}
.drink-card .drink-category-tag.editable {
  cursor: pointer;
  border: 1px dashed transparent;
  padding-right: 6px;
  transition: all 0.15s;
}
.drink-card .drink-category-tag.editable:hover {
  border-color: var(--primary);
  background: var(--primary-bg-hover);
}
.drink-card .drink-category-tag.editable .category-edit-icon {
  margin-left: 4px;
  opacity: 1;
  font-size: 11px;
}
.drink-card .category-inline-input {
  width: 130px;
  padding: 3px 10px;
  font-size: 12px;
  height: 26px;
  border-radius: 20px;
  flex-shrink: 0;
}
.drink-card .drink-cost {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.drink-card .drink-cost .cost-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.drink-card .drink-cost .cost-range {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}
.drink-card .drink-cost .drink-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--success, #34c759);
  padding-left: 8px;
  margin-left: 2px;
  border-left: 1px solid var(--border);
}
.drink-card .drink-cost .drink-price-unset {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
}
.drink-card .drink-cost .drink-variant-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
  flex-shrink: 0;
}
.drink-card .drink-cost-breakdown {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.drink-card .drink-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.drink-card .variant-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid #ffffff;
}
.drink-card .variant-chip .variant-chip-price {
  margin-left: 4px;
  color: var(--primary);
  font-weight: 600;
}
.drink-card .variant-chip.variant-more {
  background: transparent;
  border: 1px dashed var(--border-light);
  color: var(--text-muted);
}

/* ===== 饮品详情页照片 ===== */
.drink-detail-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  min-width: 0;
}
.drink-detail-photo-section {
  width: 280px;
  flex-shrink: 0;
}
.drink-detail-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.drink-detail-photo-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: var(--text-muted);
  background: var(--bg-input);
}
.drink-detail-photo-placeholder div { font-size: 14px; margin-top: 8px; }

/* ===== 饮品描述区域 ===== */
.drink-description-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 16px;
}
.drink-detail-photo-section > .drink-description-card {
  margin-top: 16px;
}
.drink-description-header {
  margin-bottom: 8px;
}
.drink-description-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.drink-description-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.drink-description-footer .btn,
#drink-description-editor-actions .btn {
  flex: 1;
  justify-content: center;
}
#drink-description-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.drink-description-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  margin: 0;
  word-break: break-all;
}
.drink-description-empty {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.drink-description-textarea {
  width: 100%;
  resize: vertical;
  min-height: 80px;
  font-size: 14px;
  line-height: 1.6;
  padding: 10px 12px;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state .title { font-size: 18px; margin-bottom: 8px; color: var(--text-secondary); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 300;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
}
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.info { background: var(--primary); color: #1a1614; }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ===== 成本条形图 ===== */
.cost-bar-chart { margin-top: 8px; }
.cost-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.cost-bar-row .bar-label { width: 120px; font-size: 13px; text-align: right; flex-shrink: 0; }
.cost-bar-row .bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.cost-bar-row .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-sm);
  transition: width 0.5s ease;
}
.cost-bar-row .bar-value {
  width: 70px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  flex-shrink: 0;
}

/* ===== 变体选择器（杯型/温度/甜度三组胶囊） ===== */
.variant-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 16px;
}
.selector-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.selector-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  width: 40px;
  flex-shrink: 0;
}
.selector-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.selector-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.selector-chip:hover:not(.disabled) {
  border-color: var(--primary);
  color: var(--text);
}
.selector-chip.active {
  background: var(--primary);
  color: #1a1614;
  border-color: var(--primary);
  font-weight: 600;
}
.selector-chip.disabled {
  opacity: 1;
  cursor: not-allowed;
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-light);
}
.variant-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
  margin-bottom: 16px;
}
.material-code {
  font-family: var(--font-mono, "SF Mono", Consolas, monospace);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.material-code-input {
  font-family: var(--font-mono, "SF Mono", Consolas, monospace);
  color: var(--text-muted);
  background: var(--bg-input);
}
.pkg-price-tag {
  flex-shrink: 0;
  min-width: 64px;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}
/* 门店筹备表格：去掉鼠标悬停行高亮 */
.prep-table tbody tr:hover td { background: transparent; }
.drink-variant-dims {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.variant-dim-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.variant-dim-label {
  flex-shrink: 0;
  color: var(--text-muted);
  width: 30px;
}
.variant-dim-values {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.variant-meta .meta-price { color: var(--success, #34c759); }
.variant-meta .meta-cost { color: var(--text-muted); }
.variant-meta .meta-sep { color: var(--text-muted); font-weight: 400; }
.recipe-editor-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}
.recipe-editor-meta .meta-price { color: var(--success, #34c759); }
.recipe-editor-meta .meta-cost { color: var(--text-muted); }
.recipe-editor-meta .meta-sep { color: var(--text-muted); font-weight: 400; }
.draft-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger, #ff3b30);
  margin-left: 6px;
  vertical-align: middle;
}

/* ===== 变体标签页（旧，已弃用但保留样式） ===== */
.variant-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.variant-tab {
  padding: 8px 12px 8px 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.variant-tab:hover { border-color: var(--border-light); color: var(--text); }
.variant-tab.active { background: var(--primary); color: #1a1614; border-color: var(--primary); font-weight: 600; }
.variant-tab .tab-label { white-space: nowrap; }
.variant-tab .tab-cost { font-weight: 700; white-space: nowrap; }
.variant-tab.has-draft { position: relative; }
.tab-draft-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger, #ff3b30);
  flex-shrink: 0;
}
.variant-tab.active .tab-draft-dot {
  background: #fff;
}
.tab-delete-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 0 2px 0;
  opacity: 1;
  transition: all 0.2s;
  margin-left: 2px;
}
.tab-delete-btn:hover {
  background: var(--danger);
  color: #fff;
  opacity: 1;
}
.variant-tab.active .tab-delete-btn:hover { background: #cccccc; color: #1a1614; }

/* ===== 手机端组件（默认隐藏） ===== */
.mobile-topbar { display: none; }
.sidebar-overlay { display: none; }

/* ===== 响应式：手机端 (<=768px) ===== */
@media (max-width: 768px) {

  /* ---- 全局 ---- */
  :root {
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --sidebar-width: 280px;
  }

  body {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
  }

  /* 禁用 hover 效果（触摸设备） */
  .stat-card:hover,
  .drink-card:hover,
  .btn:hover,
  .action-btn:hover,
  .nav-item:hover,
  .recycle-item:hover,
  .permission-item:hover,
  .sync-incomplete-chip:hover,
  .packaging-tab:hover,
  .variant-tab:hover {
    transform: none !important;
    box-shadow: var(--shadow-sm) !important;
  }
  .drink-card:hover .drink-photo { transform: none !important; }
  .drink-card:hover .drink-status-badge { opacity: 1 !important; }

  /* ---- 手机端顶部栏 ---- */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    padding: 0 env(safe-area-inset-right, 0) 0 env(safe-area-inset-left, 0);
    padding-top: env(safe-area-inset-top, 0);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    z-index: 150;
    flex-shrink: 0;
  }
  .mobile-topbar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-menu-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s;
    flex-shrink: 0;
  }
  .mobile-menu-btn:active { background: var(--bg-card-hover); }

  /* ---- 侧边栏抽屉 ---- */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
    width: var(--sidebar-width);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000000;
    z-index: 180;
    animation: overlayFadeIn 0.2s ease;
  }
  .sidebar-overlay.show { display: block; }
  @keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  /* 侧边栏导航项：最小 48px 触摸目标 */
  .nav-item {
    min-height: 48px;
    padding: 12px 16px !important;
    font-size: 15px;
  }
  .nav-item .icon { width: 28px; height: 28px; flex-shrink: 0; }
  .nav-item .icon svg { width: 18px; height: 18px; }
  .nav-item .icon[style*="padding"] { padding: 4px !important; }
  .nav-item.active {
    background: var(--primary-bg);
    border-left: 3px solid var(--primary);
  }
  .nav-sub { padding-left: 28px !important; }
  .nav-group-header { min-height: 48px; }
  .nav-store-item { min-height: 44px; padding: 10px 16px 10px 44px !important; font-size: 14px; }

  /* 侧边栏品牌区 */
  .sidebar-brand { padding: 20px 16px 16px; padding-top: calc(20px + env(safe-area-inset-top, 0)); }
  .sidebar-brand .logo { font-size: 20px; }
  .sidebar-footer { padding: 12px 14px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0)); }
  .user-bar { gap: 8px; padding: 10px; }
  .sidebar-footer-actions { gap: 6px; }
  .sidebar-footer-actions .btn-sm { min-height: 36px; padding: 7px 14px; }

  /* ---- 主内容区 ---- */
  .main {
    margin-left: 0;
    padding: calc(52px + env(safe-area-inset-top, 0) + 6px) 10px calc(env(safe-area-inset-bottom, 0) + 20px);
  }

  /* ---- 页面头部 ---- */
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }
  .page-header > div:first-child { flex: 1; min-width: 0; }
  .page-header > div:last-child {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
    width: 100%;
  }
  .page-header > div:last-child > * {
    flex: 1 1 auto;
    justify-content: center;
    white-space: nowrap;
  }
  .page-title { font-size: 17px; line-height: 1.2; }
  .page-subtitle { font-size: 11px; }
  .page-subtitle.page-subtitle-row { display: flex; }

  /* ---- 统计卡片 ---- */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }
  .stat-card {
    padding: 14px;
    gap: 10px;
    border-radius: var(--radius);
    flex-direction: row;
    align-items: center;
  }
  .stat-card .stat-icon {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  }
  .stat-card .stat-icon svg { width: 20px; height: 20px; }
  .stat-card .stat-value { font-size: 22px; line-height: 1.1; }
  .stat-card .stat-label { font-size: 11px; }

  /* ---- 卡片 ---- */
  .card {
    padding: 14px;
    margin-bottom: 12px;
    border-radius: var(--radius);
  }
  .card-header {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }
  .card-title { font-size: 15px; }

  /* ---- 按钮 ---- */
  .btn {
    padding: 10px 16px;
    font-size: 14px;
    min-height: 40px;
    border-radius: var(--radius-sm);
    -webkit-tap-highlight-color: transparent;
  }
  .btn-sm { padding: 8px 12px; font-size: 13px; min-height: 36px; }
  .btn:active { opacity: 0.7; transform: scale(0.97); }
  .btn-primary:active, .btn-danger:active { opacity: 0.85; }

  /* ---- 表单 ---- */
  .form-row, .form-row-3 { grid-template-columns: 1fr; gap: 12px; }
  .form-input, .form-select, .form-textarea {
    padding: 12px 14px;
    font-size: 16px; /* iOS 防缩放 */
    border-radius: var(--radius-sm);
  }
  .form-label { font-size: 13px; margin-bottom: 6px; }
  .form-group { margin-bottom: 14px; }

  /* ---- 筛选栏 ---- */
  .filter-bar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
    margin-bottom: 12px;
    border-radius: var(--radius);
  }
  .filter-bar .search-bar { grid-column: 1 / -1; }
  .filter-bar .form-select { font-size: 14px; padding: 10px 12px; }
  .filter-bar .filter-select { font-size: 13px; }

  /* ---- 搜索框 ---- */
  .search-bar input {
    padding: 12px 14px 12px 38px;
    font-size: 16px; /* iOS 防缩放 */
    border-radius: var(--radius-sm);
  }
  .search-icon { left: 12px; font-size: 15px; }

  /* ---- 表格 ---- */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: -4px;
    padding: 4px;
    border-radius: var(--radius-sm);
  }
  .table-wrap::after {
    content: "\2192 \6ed1\52a8\67e5\770b\66f4\591a";
    display: block;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    padding: 6px 0 2px;
    opacity: 1;
  }
  th { padding: 8px 10px; font-size: 11px; white-space: nowrap; }
  td { padding: 10px 10px; font-size: 13px; }
  .table-actions { gap: 6px; }
  .table-actions .btn-sm { min-height: 32px; padding: 6px 10px; font-size: 12px; }

  /* ---- 模态框（底部弹出） ---- */
  .modal-overlay { align-items: flex-end; }
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    animation: slideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }
  @keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .modal.large { max-width: 100%; }
  .modal::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    margin: 8px auto 0;
    opacity: 1;
  }
  .modal-header {
    padding: 12px 16px;
    padding-top: 4px;
    position: sticky;
    top: 0;
    background: var(--bg-elevated);
    z-index: 10;
    border-radius: 16px 16px 0 0;
  }
  .modal-title { font-size: 16px; }
  .modal-body { padding: 14px 16px; }
  .modal-footer {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
    position: sticky;
    bottom: 0;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
  }
  .modal-footer .btn { flex: 1; min-height: 44px; }
  .modal-close {
    width: 36px; height: 36px;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ---- 包装管理 ---- */
  .packaging-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 4px;
  }
  .packaging-tab {
    white-space: nowrap;
    padding: 10px 14px;
    font-size: 14px;
    min-height: 40px;
  }
  .packaging-tab:active { opacity: 0.7; }
  .cup-item-row {
    grid-template-columns: 1fr 90px 36px;
    gap: 6px;
  }
  .packaging-config { padding: 12px; }

  /* ---- 饮品卡片 ---- */
  .drinks-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .drink-card { border-radius: 12px; }
  .drink-card:active { transform: scale(0.98); }
  .drink-card-body { padding: 12px; }
  .drink-card .drink-name { font-size: 15px; line-height: 1.3; }
  .drink-card-header { flex-wrap: wrap; row-gap: 4px; }
  .drink-card-header .drink-name { flex-shrink: 1; }
  .drink-card .drink-cost { gap: 4px 8px; margin-bottom: 4px; flex-wrap: wrap; }
  .drink-card .drink-cost .cost-value { font-size: 20px; }
  .drink-card .drink-cost .cost-range { font-size: 12px; }
  .drink-card .drink-cost .drink-variant-count { font-size: 11px; margin-left: auto; }
  .drink-card .drink-cost .drink-price { border-left: none; padding-left: 0; }
  .drink-card .drink-cost-breakdown { font-size: 11px; gap: 4px; margin-bottom: 8px; }
  .drink-card .drink-variants { gap: 4px; }
  .drink-card .variant-chip { font-size: 10px; padding: 3px 6px; border-radius: 8px; }
  .drink-card-actions { top: 6px; right: 6px; gap: 4px; }
  .action-btn { width: 30px; height: 30px; font-size: 12px; }
  .action-btn:active { transform: scale(0.9); }
  .drink-status-badge { top: 6px; left: 6px; font-size: 10px; padding: 2px 8px; }

  /* ---- 饮品详情页 ---- */
  .drink-detail-layout { flex-direction: column; gap: 0; }
  .drink-detail-photo-section {
    width: 100%;
    align-self: stretch;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
  }
  .drink-detail-photo,
  .drink-detail-photo-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    flex-shrink: 0;
  }
  .drink-detail-photo-placeholder {
    font-size: 32px;
    border-width: 1px;
  }
  .drink-detail-photo-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
  }
  .drink-detail-photo-actions .btn {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 13px;
    justify-content: center;
    white-space: nowrap;
  }
  /* 选择器独立占满一行 */
  .drink-detail-photo-section #variant-selector-area {
    flex-basis: 100%;
    width: 100%;
  }
  .drink-detail-back { min-height: 40px; padding: 8px 14px; }

  /* ---- 变体标签页：手机端纵向排列 ---- */
  .variant-tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
  }
  .variant-tab {
    padding: 10px 12px;
    font-size: 14px;
    min-height: 40px;
    width: 100%;
    justify-content: space-between;
  }
  .variant-tab:active { opacity: 0.7; }
  .variant-tab .tab-cost { font-size: 13px; }
  .tab-delete-btn { width: 20px; height: 20px; font-size: 13px; }

  /* ---- 配方编辑器头部 ---- */
  .recipe-editor-header { margin-bottom: 8px; }
  .recipe-editor-title { font-size: 15px; }
  .recipe-editor-actions .btn-sm { font-size: 13px; padding: 6px 10px; min-height: 32px; }

  /* ---- 配方行：手机端用 flex wrap，物料占满整行，用量+删除挤在一行 ---- */
  .recipe-item {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    border: 1px solid var(--border);
    width: 100%;
  }
  /* 手机端隐藏 价格/成本 列 */
  .recipe-item .recipe-price-display,
  .recipe-item .recipe-cost-display { display: none; }
  /* 物料选择框：单独占满整行 */
  .recipe-item .recipe-material-cell {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }
  .recipe-item .recipe-material-cell .form-select,
  .recipe-item .recipe-material-cell .form-input {
    flex: 1;
    min-width: 0;
  }
  .recipe-item .recipe-material-cell .recipe-new-toggle {
    flex-shrink: 0;
  }
  /* 用量行：占剩余空间，跟删除按钮挤在第二行 */
  .recipe-item .recipe-amount-cell {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    min-width: 0;
  }
  /* 用量前缀标签 */
  .recipe-amount-cell::before {
    content: "\7528\91cf";
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .recipe-amount-cell .form-input {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    text-align: center;
    background: transparent;
    border: none;
    padding: 4px 0;
  }
  .recipe-amount-cell .form-input::placeholder {
    color: var(--text-muted);
    opacity: 1;
  }
  .recipe-amount-cell .form-input:focus {
    outline: none;
    box-shadow: none;
  }
  .recipe-amount-cell .recipe-unit {
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
  }
  /* 删除按钮：固定宽度，跟用量行挤在第二行 */
  .recipe-item > .btn-icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    font-size: 16px;
    align-self: stretch;
  }
  .recipe-item .form-input,
  .recipe-item .form-select {
    font-size: 14px;
    padding: 7px 10px;
  }
  .recipe-new-toggle { font-size: 11px; padding: 7px 8px; }

  /* ---- 成本显示 ---- */
  .recipe-total { padding: 8px 0 0; margin-top: 4px; }
  .recipe-total .label { font-size: 13px; }
  .recipe-total .amount { font-size: 18px; }
  .cost-split {
    flex-direction: row;
    gap: 10px !important;
    font-size: 11px !important;
  }

  /* ---- 吸底保存栏 ---- */
  .recipe-save-bar {
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0));
    margin-left: -10px;
    margin-right: -10px;
    bottom: 0;
  }
  .recipe-save-bar .btn { padding: 9px 20px; font-size: 14px; min-height: 38px; }
  .recipe-save-bar-cost .amount { font-size: 16px; }
  .recipe-save-bar-cost .label { font-size: 11px; }

  /* ---- 包装配置 ---- */
  .packaging-config { padding: 10px; }
  .packaging-config-title { font-size: 14px; margin-bottom: 6px; }
  .packaging-config .form-row {
    flex-direction: column;
    gap: 8px;
  }
  .packaging-config .form-row .form-group { width: 100%; }
  .packaging-config .form-select { font-size: 14px; padding: 8px 10px; }
  .packaging-config .form-label { font-size: 12px; margin-bottom: 4px; }
  .prep-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .prep-toolbar h2 { font-size: 18px; }
  .prep-stats { flex-wrap: wrap; gap: 8px; font-size: 12px; }
  .prep-modal-row { grid-template-columns: 1fr; }
  .prep-table { font-size: 12px; }
  .prep-table .col-name { min-width: 80px; }
  .prep-table th { padding: 6px 8px; }
  .prep-table td { padding: 8px; }

  /* ---- 回收站 ---- */
  .recycle-item {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-sm);
  }
  .recycle-item-photo { width: 44px; height: 44px; }
  .recycle-thumb { width: 44px; height: 44px; }
  .recycle-thumb-placeholder { width: 44px; height: 44px; font-size: 22px; }
  .recycle-item-name { font-size: 14px; }
  .recycle-item-actions { width: 100%; justify-content: flex-end; }
  .recycle-item-actions .btn-sm { min-height: 36px; }

  /* ---- 成本条形图 ---- */
  .cost-bar-row { gap: 8px; margin-bottom: 8px; }
  .cost-bar-row .bar-label { width: 70px; font-size: 12px; }
  .cost-bar-row .bar-track { height: 20px; }
  .cost-bar-row .bar-value { width: 52px; font-size: 12px; }

  /* ---- 权限网格 ---- */
  .permission-grid { grid-template-columns: 1fr; }
  .permission-item { min-height: 44px; padding: 10px 12px; }

  /* ---- Toast ---- */
  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0));
    text-align: center;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 14px;
  }

  /* ---- 登录页 ---- */
  .login-page {
    padding: 16px;
    padding-top: calc(env(safe-area-inset-top, 0) + 16px);
  }
  .login-card {
    padding: 32px 24px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0));
    border-radius: var(--radius-lg);
  }
  .login-brand .logo { font-size: 20px; }
  .login-brand .subtitle { font-size: 13px; }

  /* ---- 搜索框 ---- */
  .search-bar { margin-bottom: 10px; }

  /* ---- 拖拽排序提示 ---- */
  .drag-sort-hint { font-size: 10px; padding: 2px 6px; }

  /* ---- 同步提示条 ---- */
  .sync-banner { padding: 12px 14px; gap: 10px; margin-bottom: 12px; }
  .sync-banner-icon { font-size: 18px; }
  .sync-banner-title { font-size: 13px; }
  .sync-banner-desc { font-size: 12px; }
  .sync-banner-actions { gap: 6px; }
  .sync-banner-actions .btn { flex: 1; min-height: 38px; }

  /* ---- 空状态 ---- */
  .empty-state { padding: 40px 20px; }
  .empty-icon { font-size: 40px; }

  /* ---- 标签 ---- */
  .tag { font-size: 11px; padding: 2px 8px; }
}

/* ===== 超小屏 (<=380px) ===== */
@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr; gap: 8px; }
  .drinks-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header > div:last-child { width: 100%; }
  .page-header > div:last-child > * { flex: 1; }
  .modal-footer { flex-direction: column; gap: 8px; }
  .modal-footer .btn { width: 100%; }
  .mobile-topbar-title { font-size: 14px; }
}

/* ===== 物料同步检测提示 ===== */
.sync-banner {
  background: linear-gradient(135deg, #fff3e2, #fff9f0);
  border: 1px solid #ffd89c;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.sync-banner.sync-ok {
  background: linear-gradient(135deg, #eafaee, #f7fdf8);
  border-color: #b4eec2;
}
.sync-banner-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}
.sync-banner-body { flex: 1; min-width: 0; }
.sync-banner-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.sync-banner-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.sync-banner-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.sync-incomplete-list {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sync-incomplete-chip {
  background: #fff1da;
  border: 1px solid #ffdca6;
  color: var(--warning);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.sync-incomplete-chip:hover {
  background: #ffe2b6;
}
.nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--warning);
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-weight: 700;
}

/* ===== 登录页面（macOS 玻璃） ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fdf6df 0%, #fefaf0 40%, #fdf2d0 100%);
  padding: 24px;
  transition: background 0.3s ease;
}
.login-card {
  background: #ffffff;
  border: 1px solid #ffffff;
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 40px #ebebeb;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.dark .login-page {
  background: linear-gradient(135deg, #14141a 0%, #1c1c24 40%, #14141a 100%);
}
.dark .login-card {
  background: #22222b;
  border-color: #383840;
  box-shadow: 0 12px 40px rgba(0,0,0,0.40);
}
.login-brand {
  text-align: center;
  margin-bottom: 28px;
}
.login-brand .logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-brand .subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}
.login-error {
  color: var(--danger);
  font-size: 13px;
  margin: 8px 0;
  min-height: 20px;
}
.login-error:empty { margin: 0; min-height: 0; }
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}
.password-field .form-input {
  width: 100%;
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}
.password-toggle:hover { color: var(--primary); }
.login-tip {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
  line-height: 1.6;
}

/* ===== 侧边栏用户栏 ===== */
.user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #ebebf0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.user-info {
  flex: 1;
  min-width: 0;
}
.user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 权限控制辅助类 ===== */
.hide-no-perm {
  display: none !important;
}
.disabled-no-perm {
  opacity: 1;
  pointer-events: none;
  cursor: not-allowed;
}

/* ===== 用户管理页面 ===== */
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.permission-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
}
.permission-item input {
  cursor: pointer;
}
.permission-item:hover {
  border-color: var(--primary);
}
.permission-group-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 14px;
}
.user-status-active { color: var(--success); font-weight: 600; }
.user-status-inactive { color: var(--danger); font-weight: 600; }

/* ===== 回收站 ===== */
.recycle-bin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.recycle-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s;
}
.recycle-item:hover {
  border-color: var(--primary);
}
.recycle-item-photo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.recycle-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}
.recycle-thumb-placeholder {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 8px;
  font-size: 28px;
  color: var(--text-muted);
}
.recycle-item-info {
  flex: 1;
  min-width: 0;
}
.recycle-item-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.recycle-item-meta {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.recycle-item-meta .tag {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.recycle-item-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.recycle-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.btn-success {
  background: var(--success);
  color: #fff;
  border: 1px solid var(--success);
}
.btn-success:hover {
  opacity: 1;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 1;
}
.empty-hint {
  font-size: 13px;
  margin-top: 8px;
  opacity: 1;
}

/* ===== 门店筹备 ===== */
.prep-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.prep-toolbar h2 { margin: 0; font-size: 20px; }
.prep-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
.prep-stats span strong { color: var(--primary); }
.prep-table th { font-size: 12px; white-space: nowrap; }
.prep-table td { font-size: 13px; vertical-align: middle; }
.prep-table .col-name { min-width: 120px; font-weight: 600; }
.prep-table .col-actions { white-space: nowrap; text-align: right; }
.prep-table .col-actions button { margin-left: 4px; }
.prep-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
}
.prep-img-wrap {
  position: relative;
  display: inline-block;
}
.prep-img-preview {
  position: fixed;
  z-index: 1000;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  pointer-events: none;
  max-width: min(320px, calc(100vw - 16px));
}
.prep-img-preview img {
  max-width: 320px;
  max-height: 320px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}
.prep-no-img {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 11px;
}
.prep-image-upload {
  display: flex;
  align-items: center;
  gap: 12px;
}
.prep-image-preview {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  overflow: hidden;
  background: var(--bg-input);
}
.prep-image-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}
.prep-no-preview {
  color: var(--text-muted);
  font-size: 12px;
}
.prep-image-field {
  flex: 1;
  min-width: 0;
}
.prep-image-field .form-input {
  padding: 4px 0;
  border: none;
  background: transparent;
  font-size: 13px;
}
.prep-image-tip {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.prep-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.prep-badge-paid { background: var(--success); color: #fff; }
.prep-badge-unpaid { background: var(--bg-input); color: var(--text-secondary); }
.prep-badge-partial { background: var(--warning); color: #fff; }
.prep-badge-alert {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  background: #ffe9e7;
  color: var(--danger);
  border: 1px solid #ffb5b0;
  font-size: 11px;
  font-weight: 700;
  animation: prep-alert-pulse 2s ease-in-out infinite;
}
.prep-badge-alert::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  flex-shrink: 0;
}
@keyframes prep-alert-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.3); }
  50% { box-shadow: 0 0 0 4px rgba(255, 69, 58, 0); }
}
.prep-source-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--primary);
  color: #1a1614;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
}
.prep-modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.prep-modal-row .form-group { margin-bottom: 0; }
.prep-modal-full { grid-column: 1 / -1; }
.prep-input-with-unit {
  display: flex;
  align-items: center;
  gap: 6px;
}
.prep-input-with-unit input[type="number"] {
  flex: 1;
  -moz-appearance: textfield;
}
.prep-input-with-unit input[type="number"]::-webkit-outer-spin-button,
.prep-input-with-unit input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.prep-input-unit {
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
}
/* ===== 不透明化改造：暗色主题等效色（原来半透明叠色转实体色，保持夜间模式观感）===== */
.dark .sidebar-brand { background: linear-gradient(180deg, #211d1b, #14141d); }
.dark .nav-item:hover, .dark .nav-store-item:hover { background: #13131c; }
.dark .user-bar { background: #13131c; }
.dark .btn-secondary { background: #212126; }
.dark .btn-secondary:hover { background: #202025; }
.dark .btn-info { background: #3a3123; }
.dark .btn-info:hover { background: #4a3c20; }
.dark .action-btn { background: #202025; }
.dark .form-input, .dark .form-select, .dark .form-textarea { background: #a7a7a9; }
.dark .modal { background: #d5d5d6; }
.dark .nav-store-status.preparing { background: #4e3b22; }
.dark .nav-store-status.completed { background: #254532; }
.dark .nav-store-status.paused { background: #4e292c; }
.dark .nav-store-item.active .nav-store-status { background: #1b1b20; }
.dark .store-status-badge.preparing { background: #433524; }
.dark .store-status-badge.completed { background: #243c2f; }
.dark .store-status-badge.paused { background: #43272b; }
.dark .status-active { background: #24362e; }
.dark .status-pending { background: #413424; }
.dark .status-offline { background: #3d2529; }
.dark .tag-tea { background: #463921; }
.dark .tag-composite { background: #5e481c; }
.dark .tag-juice, .dark .tag-used { background: #243c2f; }
.dark .tag-used-clickable:hover { background: #264e34; }
.dark .tag-dairy { background: #433d24; }
.dark .tag-syrup { background: #43272b; }
.dark .tag-topping { background: #3a2a46; }
.dark .tag-other, .dark .tag-unused, .dark .drag-sort-hint.disabled, .dark .drink-card .drink-category-tag.no-category { background: #323238; }
.dark .tag-machine { background: #2c3c48; }
.dark .lead-time-tag, .dark .sync-incomplete-chip { background: #433524; }
.dark .sync-incomplete-chip:hover { background: #64481f; }
.dark .prep-badge-alert { background: #3d262a; }
.dark .quote-subtable tr.selected-row td, .dark .quote-grid-row.selected-row > div, .dark .quote-table .selected-row td { background: #322c25; }
.dark .quote-subtable tr.selected-row:hover td { background: #3a3123; }
.dark .quote-selected-badge { background: #463921; }
.dark .drink-card .variant-chip { background: #2f2f35; }
.dark .variant-tab.active .tab-delete-btn:hover { background: #1b1b20; }
.dark .sync-banner { background: linear-gradient(135deg, #30251b, #221c1c); }
.dark .sync-banner.sync-ok { background: linear-gradient(135deg, #172723, #151c1f); }
/* ===== 不透明化：暗色主题边框等效色 ===== */
.dark .card, .dark .stat-card { border-color: #dededf; }
.dark .btn-secondary { border-color: #1f1f28; }
.dark .btn-info { border-color: #614a1e; }
.dark .modal { border-color: #fbfbfb; }
.dark .drink-card .variant-chip { border-color: #2f2f38; }

/* ===== 输入框可视性：填充底色 + 清晰边框（不透明）===== */
.search-bar input,
.filter-bar .filter-select,
.form-input, .form-select, .form-textarea {
  border-color: #d8d8de;
}
.dark .search-bar input,
.dark .filter-bar .filter-select,
.dark .form-input, .dark .form-select, .dark .form-textarea {
  border-color: #45454f;
}
