/* 阿里云官网 / 控制台风格 */
:root {
  --ali-orange: #ff6a00;
  --ali-orange-hover: #ff8533;
  --ali-orange-light: #fff7f0;
  --ali-blue: #0070cc;
  --ali-blue-hover: #005aa5;
  --ali-blue-light: #e8f4ff;
  --header-bg: #181818;
  --header-text: #ffffff;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e5e5e5;
  --sidebar-active-bg: #fff7f0;
  --sidebar-active-color: #ff6a00;
  --sidebar-text: #181818;
  --sidebar-sub-text: #737373;
  --header-height: 48px;
  --sidebar-width: 220px;
  --text-primary: #181818;
  --text-secondary: #737373;
  --text-muted: #999999;
  --border: #e5e5e5;
  --bg-page: #f7f9fa;
  --success: #00a700;
  --warning: #ff6a00;
  --danger: #e00000;
  --info: #0070cc;
  --card-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.stock-warning-row {
  background: #fff7e6;
}
.stock-warning-row:hover {
  background: #ffe7ba;
}
.stock-warning-text {
  color: var(--warning);
  font-weight: 600;
}
.stock-warning-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  vertical-align: middle;
  margin-right: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px; color: var(--text-primary); background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  word-break: normal;
  overflow-wrap: break-word;
}

/* SVG 图标 */
.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }
.menu-icon, .sub-icon {
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.menu-icon { width: 16px; height: 16px; opacity: .85; }

/* 登录 */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #181818 0%, #2a2a2a 50%, #181818 100%);
  position: relative;
}
.login-page::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--ali-orange), #ff8533);
}
.login-box {
  background: #fff; padding: 40px 36px; border-radius: 4px; width: 400px; max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.login-box .brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 6px; }
.login-box .brand-logo {
  width: 36px; height: 36px; background: var(--ali-orange); border-radius: 4px;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 18px;
}
.login-box h1 { font-size: 18px; text-align: center; color: var(--text-primary); font-weight: 600; }
.login-box .subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 28px; font-size: 13px; }

.force-pwd-overlay {
  display: none; position: fixed; inset: 0; z-index: 3000;
  background: linear-gradient(135deg, #001529 0%, #003a70 100%);
  align-items: center; justify-content: center;
}
.force-pwd-overlay.show { display: flex; }

/* 布局 */
.app-layout { display: none; min-height: 100vh; }
.app-layout.active { display: flex; flex-direction: column; }

.app-header {
  min-height: var(--header-height); height: var(--header-height);
  background: var(--header-bg);
  display: flex; align-items: center; padding: 0 20px; gap: 10px;
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  border-bottom: 2px solid var(--ali-orange);
  overflow: visible;
}
.app-header .logo {
  font-size: 15px; font-weight: 500; color: var(--header-text);
  display: flex; align-items: center; gap: 10px;
  min-width: 0; flex: 1 1 auto; overflow: hidden;
}
.app-header .logo-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-header .logo-mark {
  width: 28px; height: 28px; background: var(--ali-orange); border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.app-header .header-right {
  margin-left: auto; display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: rgba(255,255,255,.75);
  flex-shrink: 0; overflow: visible;
}
.app-header .header-user {
  white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}
.app-header .header-right .btn {
  color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.25); background: transparent;
  white-space: nowrap; flex-shrink: 0;
}
.app-header .header-right .btn:hover { border-color: var(--ali-orange); color: var(--ali-orange); }

/* 右上角门店选择器 */
.store-selector { position: relative; flex-shrink: 0; z-index: 210; }
.store-selector-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.2); border-radius: 2px;
  color: #fff; font-size: 13px; cursor: pointer; transition: all .15s;
  max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.store-selector-btn:hover { border-color: var(--ali-orange); background: rgba(255,106,0,.15); }
.store-selector-btn .store-icon { opacity: .9; }
.store-icon-wrap { display: inline-flex; align-items: center; color: var(--ali-orange); }
.store-icon-wrap svg { width: 14px; height: 14px; }
.store-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 260px; background: #fff; border: 1px solid var(--border);
  border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.15); z-index: 220;
}
.store-dropdown-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text-primary);
}
.store-dropdown-footer .btn { width: 100%; }
.store-dropdown-header .link-btn {
  margin-left: auto; background: none; border: none; color: var(--ali-blue);
  font-size: 12px; cursor: pointer; padding: 2px 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.store-dropdown-header .link-btn + .link-btn { margin-left: 8px; }
.store-dropdown-list { max-height: 240px; overflow-y: auto; padding: 6px 0; }
.store-option {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; cursor: pointer; font-size: 13px; color: var(--text-primary);
}
.store-option:hover { background: #f7f9fa; }
.store-option input { accent-color: var(--ali-orange); width: 15px; height: 15px; }
.store-dropdown-footer { padding: 10px 14px; border-top: 1px solid var(--border); }
.app-header .menu-toggle {
  display: none; background: none; border: none; font-size: 20px; cursor: pointer;
  margin-right: 4px; color: #fff; padding: 4px; flex-shrink: 0;
}

.app-body { display: flex; margin-top: var(--header-height); min-height: calc(100vh - var(--header-height)); }

/* 侧栏 - 阿里云控制台浅色侧栏 */
.app-sidebar {
  width: var(--sidebar-width); background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  position: fixed; top: var(--header-height); left: 0; bottom: 0;
  overflow-y: auto; transition: transform .3s; z-index: 99;
}
.sidebar-menu { list-style: none; padding: 8px 0; }
.menu-item > a, .menu-item > .menu-label {
  display: flex; align-items: center; padding: 10px 16px;
  color: var(--sidebar-text); text-decoration: none; cursor: pointer;
  transition: all .15s; font-size: 13px; gap: 10px;
  border-left: 3px solid transparent;
}
.menu-item > a:hover, .menu-item > .menu-label:hover {
  background: #f7f9fa; color: var(--ali-orange);
}
.menu-item.active > a, .menu-item > .menu-label.active {
  color: var(--ali-orange); background: var(--sidebar-active-bg);
  border-left-color: var(--ali-orange); font-weight: 500;
}
.menu-item .arrow { margin-left: auto; font-size: 10px; color: var(--text-muted); transition: transform .2s; }
.menu-item.open .arrow { transform: rotate(90deg); }
.submenu { list-style: none; display: none; background: #fafafa; }
.menu-item.open .submenu { display: block; }
.submenu a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 28px; color: var(--sidebar-sub-text);
  text-decoration: none; font-size: 13px;
  border-left: 3px solid transparent;
}
.submenu a .submenu-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; flex-shrink: 0;
}
.submenu a .submenu-icon svg { display: block; }
.submenu a:hover { color: var(--ali-orange); background: #fff; }
.submenu a.active { color: var(--ali-orange); background: var(--sidebar-active-bg); border-left-color: var(--ali-orange); font-weight: 500; }
.submenu .sub-icon { width: 14px; height: 14px; opacity: .6; }

/* 内容区 */
.app-content { flex: 1; margin-left: var(--sidebar-width); padding: 20px 24px; min-width: 0; }
.page-header { margin-bottom: 20px; }
.page-header h2 { font-size: 20px; font-weight: 600; color: var(--text-primary); }
.page-header .breadcrumb { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.page-header .breadcrumb a { color: var(--ali-blue); text-decoration: none; }

/* 卡片 */
.card {
  background: #fff; border-radius: 4px; border: 1px solid var(--border);
  margin-bottom: 16px; box-shadow: var(--card-shadow);
}
.card-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: 4px;
  padding: 18px 20px; box-shadow: var(--card-shadow);
  border-top: 3px solid var(--ali-blue);
}
.stat-card.orange { border-top-color: var(--ali-orange); }
.stat-card .label { font-size: 13px; color: var(--text-secondary); }
.stat-card .value { font-size: 26px; font-weight: 600; color: var(--ali-blue); margin-top: 6px; }
.stat-card.orange .value { color: var(--ali-orange); }
.stat-card.green { border-top-color: #52c41a; }
.stat-card.green .value { color: #52c41a; }
.stat-change { font-size: 12px; margin-top: 4px; display: block; color: var(--text-secondary); }
.stat-change.up { color: #52c41a; }
.stat-change.down { color: #f5222d; }

/* 统计图表 */
.chart-bar-row {
  display: grid; grid-template-columns: minmax(80px, 120px) 1fr minmax(70px, 100px);
  gap: 8px; align-items: center; margin-bottom: 10px; font-size: 13px;
}
.chart-bar-track { height: 20px; background: #f0f2f5; border-radius: 2px; overflow: hidden; }
.chart-bar-fill {
  height: 100%; background: linear-gradient(90deg, #1890ff, #69c0ff);
  border-radius: 2px; min-width: 2px; transition: width .3s;
}
.chart-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.chart-bar-value { text-align: right; font-weight: 600; color: var(--text-primary); font-size: 12px; }
.line-chart-box {
  width: 100%;
  aspect-ratio: 2 / 1;
  min-height: 200px;
  max-height: 280px;
}
.line-chart {
  width: 100%;
  height: 100%;
  display: block;
}
.line-chart-grid {
  stroke: #f0f0f0; stroke-width: 1;
}
.line-chart-y-label, .line-chart-x-label {
  font-size: 11px; fill: var(--text-secondary);
}
.line-chart-path {
  stroke-linecap: round; stroke-linejoin: round;
}
.line-chart-dot {
  cursor: default;
}
.line-chart-dot:hover { r: 5; }
.line-chart-data-label {
  font-size: 10px; font-weight: 600;
  paint-order: stroke fill;
  stroke: #fff; stroke-width: 3px; stroke-linejoin: round;
}
.chart-trend-legend {
  display: flex; flex-wrap: wrap; gap: 12px 16px; font-size: 12px; color: var(--text-secondary); margin-bottom: 8px;
}
.chart-legend-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle;
}
.chart-legend-dot.recorded { background: #1890ff; }
.chart-legend-dot.stat { background: #ff6a00; }
.rev-diff-pos { color: #52c41a; font-weight: 600; }
.rev-diff-neg { color: #f5222d; font-weight: 600; }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 12px; border: 1px solid var(--border); border-radius: 4px;
  text-decoration: none; color: var(--text-primary); background: #fff;
  transition: all .2s; cursor: pointer;
}
.quick-item:hover { border-color: var(--ali-orange); color: var(--ali-orange); box-shadow: 0 2px 8px rgba(255,106,0,.12); }
.quick-item .quick-icon {
  width: 40px; height: 40px; border-radius: 8px; background: var(--ali-orange-light);
  display: flex; align-items: center; justify-content: center; color: var(--ali-orange);
}
.quick-item span { font-size: 13px; }

/* 巡检问题列表 */
.issue-list { display: flex; flex-direction: column; gap: 12px; }
.issue-item {
  display: flex; gap: 16px; padding: 16px; border: 1px solid var(--border);
  border-radius: 4px; background: #fff; transition: box-shadow .2s;
}
.issue-item:hover { box-shadow: var(--card-shadow); }
.issue-photo {
  width: 80px; height: 80px; border-radius: 4px; object-fit: cover;
  border: 1px solid var(--border); flex-shrink: 0; background: #f7f9fa;
}
.issue-photo-placeholder {
  width: 80px; height: 80px; border-radius: 4px; background: #f7f9fa;
  border: 1px dashed var(--border); display: flex; align-items: center;
  justify-content: center; color: var(--text-muted); flex-shrink: 0;
}
.issue-body { flex: 1; min-width: 0; }
.issue-title { font-weight: 500; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.issue-desc { color: var(--text-secondary); font-size: 13px; line-height: 1.6; margin-bottom: 8px; }
.issue-meta { font-size: 12px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 12px; }
.issue-meta span { display: flex; align-items: center; gap: 4px; }
.patrol-list .issue-photo { width: 100px; height: 100px; }
.patrol-list .issue-photo-placeholder { width: 100px; height: 100px; }
.patrol-card-actions { margin-top: 8px; display: flex; justify-content: flex-end; }

/* 筛选栏 */
.patrol-filters {
  padding: 16px; background: #fafafa; border: 1px solid var(--border);
  border-radius: 4px; margin-bottom: 16px;
}
.patrol-filters .form-group { margin-bottom: 0; }
.filter-actions { display: flex; gap: 8px; margin-top: 12px; }

.overview-summary {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.overview-stat {
  flex: 1; min-width: 140px; padding: 12px 16px;
  background: #f7f8fa; border: 1px solid var(--border); border-radius: 4px;
}
.overview-stat .label {
  display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px;
}
.overview-stat .value { font-size: 18px; font-weight: 600; color: var(--text); }
.overview-stat-action { cursor: pointer; transition: border-color .2s, background .2s; }
.overview-stat-action:hover { border-color: #fa8c16; }
.overview-stat-action.active { border-color: #fa8c16; background: #fff7e6; }
.btn-warning { background: #fa8c16; border-color: #fa8c16; color: #fff; }
.btn-warning:hover { background: #d46b08; border-color: #d46b08; color: #fff; }

.multi-select { position: relative; width: 100%; }
.multi-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 36px; padding: 6px 12px; text-align: left;
  background: #fff; cursor: pointer;
}
.multi-select-label {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; color: var(--text);
}
.multi-select-caret { color: #999; font-size: 12px; flex-shrink: 0; }
.multi-select-panel {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  z-index: 120; max-height: 260px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12); padding: 6px 0;
}
.multi-select.open .multi-select-panel { display: block; }
.multi-select-option {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: 13px; cursor: pointer; user-select: none;
}
.multi-select-option:hover { background: #f5f7fa; }
.multi-select-option input { margin: 0; }
.multi-select-all { font-weight: 600; }
.multi-select-divider { height: 1px; background: var(--border); margin: 4px 0; }

tr.overview-summary-row { background: #f0f7ff; }
tr.overview-summary-row td { border-top: 1px solid #d6e8ff; }

/* 菜品配方 */
.dish-ingredients { margin-top: 4px; }
.dish-ingredients-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.dish-ingredients-header label { margin: 0; font-size: 13px; color: var(--text-secondary); }
.dish-ing-table { table-layout: fixed; width: 100%; }
.dish-ing-table th, .dish-ing-table td { padding: 8px 10px; font-size: 13px; vertical-align: middle; }
.dish-ing-table .form-control { min-width: 0; }
.dish-ing-table col.col-ing-name { width: 40%; }
.dish-ing-table col.col-ing-unit { width: 10%; }
.dish-ing-table col.col-ing-portion { width: 20%; }
.dish-ing-table col.col-ing-loss { width: 11%; }
.dish-ing-table col.col-ing-action { width: 64px; }
.dish-ing-table .dish-ing-id { width: 100%; }
.dish-ing-table .dish-ing-unit { display: inline-block; color: var(--text-secondary); font-size: 13px; white-space: nowrap; }
.dish-ing-table .dish-ing-portion,
.dish-ing-table .dish-ing-loss { padding: 8px 4px; text-align: center; }
.modal-wide { width: 760px; max-width: 95vw; }

/* 出品录入导入 */
.entry-tabs {
  display: flex; gap: 8px; margin: 16px 0 12px;
}
.entry-tab {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 4px;
  background: #fff; color: var(--text-secondary); cursor: pointer; font-size: 14px;
}
.entry-tab:hover { border-color: #1890ff; color: #1890ff; }
.entry-tab.active {
  background: #e6f7ff; border-color: #1890ff; color: #1890ff; font-weight: 600;
}
.entry-panel.hidden { display: none; }

.prod-entry-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.prod-entry-actions .btn-with-icon { gap: 6px; }
.prod-entry-actions .btn-with-icon svg { flex-shrink: 0; }
.prod-import-hint { font-size: 12px; color: var(--text-muted); flex: 1; min-width: 220px; }
.prod-entry-actions .btn-primary { margin-left: auto; }
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}
.pagination-info { font-size: 13px; color: var(--text-secondary); }
.pagination .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-secondary); }
.form-control {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 2px;
  font-size: 14px; transition: border-color .2s; color: var(--text-primary);
}
.form-control:focus { outline: none; border-color: var(--ali-blue); box-shadow: 0 0 0 2px rgba(0,112,204,.15); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
select.form-control { appearance: auto; }

/* 拍照上传 */
.photo-upload { display: flex; flex-direction: column; gap: 10px; }
.photo-upload-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-preview {
  max-width: 200px; max-height: 150px; border-radius: 4px;
  border: 1px solid var(--border); object-fit: cover;
}
.photo-thumb { width: 48px; height: 48px; border-radius: 3px; object-fit: cover; border: 1px solid var(--border); cursor: pointer; }

/* 按钮 */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 6px 16px; min-height: 32px;
  border: 1px solid var(--border); border-radius: 2px; font-size: 14px;
  cursor: pointer; background: #fff; transition: all .15s; color: var(--text-primary);
  text-align: center; line-height: 1.4; white-space: nowrap;
  font-family: inherit;
}
button { font-family: inherit; }
.btn:hover { border-color: var(--ali-blue); color: var(--ali-blue); }
.btn-primary { background: var(--ali-orange); border-color: var(--ali-orange); color: #fff; }
.btn-primary:hover { background: var(--ali-orange-hover); border-color: var(--ali-orange-hover); color: #fff; }
.btn-outline { background: transparent; border-color: var(--ali-orange); color: var(--ali-orange); }
.btn-outline:hover { background: var(--ali-orange-light); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .9; color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 12px; min-height: 28px; }
.btn-block { width: 100%; }
.btn + .btn { margin-left: 8px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th, table td {
  word-break: keep-all;
  overflow-wrap: normal;
  vertical-align: middle;
}
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #fafafa; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
tr:hover td { background: #fafafa; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 2px; font-size: 12px; }
.tag-normal { background: var(--ali-blue-light); color: var(--ali-blue); }
.tag-serious { background: #fff7e6; color: var(--ali-orange); }
.tag-critical { background: #fff1f0; color: var(--danger); }
.tag-green { background: #f0fff0; color: var(--success); }

/* 弹窗 */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 4px; width: 560px; max-width: 92vw; max-height: 88vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 20px; }

/* 权限树 */
.perm-tree {
  max-height: 320px; overflow: auto; border: 1px solid var(--border);
  border-radius: 4px; padding: 10px; background: #fafafa;
}
.perm-tree-header {
  display: flex; gap: 12px; padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.perm-tree-header .link-btn {
  background: none; border: none; color: var(--ali-orange);
  cursor: pointer; font-size: 13px; padding: 0;
}
.perm-group { margin-bottom: 10px; }
.perm-group-title {
  font-size: 12px; font-weight: 600; color: var(--ali-orange);
  margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px dashed var(--border);
}
.perm-group-toggle {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.perm-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 3px 0; cursor: pointer;
}
.perm-item input { accent-color: var(--ali-orange); }

/* 账号门店多选 */
.store-picker {
  border: 1px solid var(--border); border-radius: 4px; background: #fafafa;
}
.store-picker-header {
  display: flex; gap: 12px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); background: #fff;
}
.store-picker-header .link-btn {
  background: none; border: none; color: var(--ali-blue);
  font-size: 12px; cursor: pointer; padding: 2px 6px;
  display: inline-flex; align-items: center; justify-content: center;
}
.store-picker-header .link-btn:hover { color: var(--ali-orange); }
.store-picker-list { max-height: 180px; overflow-y: auto; padding: 4px 0; }
.store-picker-list .store-option { padding: 6px 12px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); text-align: right; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); }

/* Toast */
.toast { position: fixed; top: 56px; right: 20px; padding: 12px 20px; border-radius: 4px; color: #fff; z-index: 9999; animation: slideIn .3s; font-size: 13px; max-width: 360px; box-shadow: 0 4px 12px rgba(0,0,0,.15); line-height: 1.5; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }
.toolbar .btn-with-icon { gap: 6px; }
.toolbar .btn-with-icon svg { flex-shrink: 0; width: 16px; height: 16px; }
.toolbar .spacer { flex: 1; }
.empty { text-align: center; padding: 40px; color: var(--text-secondary); }

.store-select-bar {
  display: none;
}

/* 响应式 */
@media (max-width: 1199px) {
  .app-sidebar { transform: translateX(-100%); box-shadow: 2px 0 8px rgba(0,0,0,.1); }
  .app-sidebar.open { transform: translateX(0); }
  .app-content { margin-left: 0; }
  .app-header .menu-toggle { display: block; }
  .app-header .logo-text { max-width: 180px; }
  .app-header .header-user { max-width: 120px; }
  .store-selector-btn { max-width: 160px; }
}
@media (max-width: 767px) {
  .app-header { padding: 0 10px; gap: 6px; }
  .app-header .logo-text { display: none; }
  .app-header .header-user { display: none; }
  .app-header .header-btn-pwd { display: none; }
  .app-header .header-right { gap: 6px; }
  .app-header .header-right .btn { padding: 4px 10px; font-size: 12px; }
  .store-selector-btn { max-width: 108px; padding: 4px 8px; font-size: 12px; }
  .app-content { padding: 12px; }
  .form-row { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .issue-item { flex-direction: column; }
  .issue-photo, .issue-photo-placeholder { width: 100%; height: 120px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header h2 { font-size: 18px; }
  .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .card-body { padding: 12px; }
  .pagination { flex-wrap: wrap; gap: 8px; }
  .pagination-info { width: 100%; text-align: center; font-size: 12px; }
  .drawer-info-grid { grid-template-columns: 1fr; }
  .overview-summary { flex-direction: column; }
  .overview-stat { min-width: 0; }
  .prod-entry-actions .btn-primary { margin-left: 0; }
  .prod-import-hint { min-width: 0; flex: 1 1 100%; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .modal { max-width: calc(100vw - 16px); }
  .toast { left: 12px; right: 12px; max-width: none; }
  .patrol-filters .form-group { width: 100%; }
  .chart-bar-row { grid-template-columns: minmax(60px, 80px) 1fr minmax(56px, 72px); font-size: 12px; }
}
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 98; }
.sidebar-overlay.show { display: block; }

/* 侧边抽屉 */
.drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 180; }
.drawer-overlay.show { display: block; }
.drawer-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 94vw);
  background: #fff; z-index: 181; transform: translateX(100%);
  transition: transform .28s ease; display: flex; flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,.12);
}
.drawer-panel.open { transform: translateX(0); }
.drawer-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.drawer-header h3 { font-size: 16px; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0; }
.drawer-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 20px; }
.drawer-info-item label { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 4px; }
.drawer-info-item span { font-size: 14px; color: var(--text); }
.drawer-section-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.drawer-table .table-wrap { margin: 0; }
.drawer-table table { font-size: 13px; }
.drawer-summary { display: flex; gap: 16px; padding: 12px 16px; background: var(--sidebar-active-bg); border-radius: 4px; margin-bottom: 16px; font-size: 13px; }
.drawer-summary strong { color: var(--ali-orange); }
.table-actions { white-space: nowrap; }
.table-actions .btn { margin-right: 4px; }
.table-actions .btn:last-child { margin-right: 0; }
.hidden { display: none !important; }

/* 图片预览弹窗 */
.img-preview-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.8);
  z-index: 250; align-items: center; justify-content: center; cursor: zoom-out;
}
.img-preview-overlay.show { display: flex; }
.img-preview-overlay img { max-width: 90vw; max-height: 90vh; border-radius: 4px; }
