/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green: #0f6e56; --green-light: #e1f5ee; --green-dark: #085041;
  --blue: #185fa5; --blue-light: #e6f1fb;
  --amber: #854f0b; --amber-light: #faeeda;
  --red: #a32d2d; --red-light: #fcebeb;
  --text: #2c2c2a; --text-secondary: #5f5e5a; --text-muted: #888780;
  --bg: #f5f4f0; --white: #fff; --border: rgba(0,0,0,0.08);
  --radius: 12px; --radius-sm: 8px; --radius-xs: 6px;
}
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.6;
  min-height: 100vh;
}

/* ===== Layout ===== */
.app-container { max-width: 1600px; margin: 0 auto; padding: 24px; }

/* ===== Header ===== */
.app-header {
  background: var(--white); border-bottom: 0.5px solid var(--border);
  padding: 0 24px; height: 52px; display: flex; align-items: center; gap: 24px;
  position: sticky; top: 0; z-index: 100; backdrop-filter: blur(8px);
}
.app-header .logo { font-size: 16px; font-weight: 600; color: var(--green); white-space: nowrap; }
.app-header nav { display: flex; gap: 4px; flex: 1; }
.app-header nav a {
  padding: 6px 16px; border-radius: 6px; cursor: pointer; font-size: 13px;
  color: var(--text-secondary); text-decoration: none; transition: all 0.15s;
}
.app-header nav a:hover { background: var(--bg); }
.app-header nav a.active { background: var(--green-light); color: var(--green); font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: 12px; }

/* ===== Sections ===== */
.section { display: none; animation: fadeIn 0.3s ease; }
.section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.section-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.section-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; }

/* ===== Cards ===== */
.card { background: var(--white); border-radius: var(--radius); border: 0.5px solid var(--border); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: var(--text); }

/* ===== Grid ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }

/* ===== Metric Cards ===== */
.metric {
  background: var(--white); border-radius: var(--radius); border: 0.5px solid var(--border);
  padding: 16px 18px; transition: transform 0.15s, box-shadow 0.15s; cursor: pointer;
}
.metric:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.metric .label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.metric .value { font-size: 24px; font-weight: 600; color: var(--text); }
.metric .change { font-size: 12px; margin-top: 4px; }
.up { color: #e24b4a; }
.down { color: #1d9e75; }

/* ===== Badge ===== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-gray { background: var(--bg); color: var(--text-secondary); }
.badge-disabled { background: #e8e7e2; color: #9a9890; }

/* ===== Type Checkbox ===== */
.type-checkbox {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border: 1px solid #d4d3cd; border-radius: 6px;
  cursor: pointer; font-size: 13px; user-select: none;
  background: #fff; transition: all 0.15s;
}
.type-checkbox:hover { border-color: #0f6e56; background: #e1f5ee; }
.type-checkbox.checked { border-color: #0f6e56; background: #e1f5ee; color: #0f6e56; font-weight: 600; }
.type-checkbox input[type="checkbox"] { accent-color: #0f6e56; }

/* ===== Cabinet Create Page ===== */
.cc-breadcrumb {
  padding: 4px 0;
}
.cc-breadcrumb a {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 0; transition: opacity 0.15s;
}
.cc-breadcrumb a:hover { opacity: 0.7; }

/* Type selection cards */
.cc-type-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.cc-type-card {
  padding: 16px 12px; border: 1.5px solid #d4d3cd; border-radius: 10px;
  cursor: pointer; text-align: center; transition: all 0.2s;
  background: #fff; user-select: none;
}
.cc-type-card:hover { border-color: #0f6e56; background: #f0faf6; }
.cc-type-card.selected {
  border-color: #0f6e56; background: #e1f5ee;
  box-shadow: 0 0 0 1px #0f6e56;
}
.cc-type-icon { font-size: 28px; margin-bottom: 6px; }
.cc-type-name { font-size: 14px; font-weight: 600; color: #2c2c2a; }
.cc-type-card.selected .cc-type-name { color: #0f6e56; }
.cc-type-desc { font-size: 11px; color: #888780; margin-top: 2px; }

/* Cabinet configuration table */
.cc-cabinet-table { width: 100%; border-collapse: collapse; }
.cc-cabinet-table th {
  font-size: 12px; color: #5f5e5a; font-weight: 600;
  padding: 8px 6px; border-bottom: 1.5px solid #d4d3cd;
  background: #f7f9f8; text-align: center;
}
.cc-cabinet-table td {
  padding: 6px; border-bottom: 0.5px solid rgba(0,0,0,0.06);
  text-align: center; font-size: 13px;
}
.cc-cabinet-table td input[type="number"] {
  width: 70px; padding: 6px 8px; border: 1px solid #d4d3cd;
  border-radius: 6px; text-align: center; font-size: 13px;
  transition: border-color 0.15s;
}
.cc-cabinet-table td input[type="number"]:focus {
  border-color: #0f6e56; outline: none; box-shadow: 0 0 0 2px rgba(15,110,86,0.1);
}
.cc-cabinet-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 500;
}
.cc-cabinet-badge.main { background: #e1f5ee; color: #0f6e56; }
.cc-cabinet-badge.sub { background: #e6f1fb; color: #185fa5; }
.cc-delete-row {
  background: none; border: none; color: #a32d2d; cursor: pointer;
  font-size: 16px; padding: 2px 6px; border-radius: 4px; transition: all 0.15s;
}
.cc-delete-row:hover { background: #fcebeb; }
.cc-delete-row:disabled { color: #ccc; cursor: not-allowed; }
.cc-slot-total {
  font-weight: 700; font-size: 14px; color: #0f6e56;
}

/* Cabinet grid summary */
.cc-grid-summary {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 12px; background: #f7f9f8; border-radius: 8px;
  font-size: 12px; color: #444441;
}
.cc-grid-summary b { color: #0f6e56; }
.cc-grid-summary.over-limit {
  background: #fcebeb;
}
.cc-grid-summary.over-limit b { color: #a32d2d; }

/* Responsive for cabinet create */
@media (max-width: 640px) {
  .cc-type-cards { grid-template-columns: repeat(2, 1fr); }
  .cc-cabinet-table th, .cc-cabinet-table td { font-size: 10px; padding: 4px; }
  .cc-cabinet-table td input[type="number"] { width: 50px; padding: 4px; font-size: 12px; }
  .cc-grid-summary { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ===== Role Tags ===== */
.role-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.role-user { background: var(--blue-light); color: var(--blue); }
.role-admin { background: var(--green-light); color: var(--green); }
.role-ops { background: var(--amber-light); color: var(--amber); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px; border-radius: 7px; font-size: 13px; cursor: pointer;
  border: 0.5px solid; font-weight: 500; transition: all 0.15s; text-decoration: none;
}
.btn-primary { background: var(--green); color: var(--white); border-color: var(--green); }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { background: var(--white); color: var(--text); border-color: rgba(0,0,0,0.2); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: var(--red-light); color: var(--red); border-color: #f7c1c1; }
.btn-danger:hover { background: #f7c1c1; }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-lg { padding: 10px 24px; font-size: 14px; }

/* ===== Table ===== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* 右侧淡出提示 */
  background: linear-gradient(to right, var(--white) 30%, rgba(255,255,255,0)),
              linear-gradient(to right, rgba(255,255,255,0), var(--white) 70%) 100% 0;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%;
  background-attachment: local, scroll;
}
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; padding: 10px 14px; color: var(--text-muted); font-weight: 500; border-bottom: 0.5px solid var(--border); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 0.5px solid rgba(0,0,0,0.05); color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ===== Form ===== */
input, select, textarea {
  border: 0.5px solid rgba(0,0,0,0.2); border-radius: var(--radius-xs); padding: 8px 12px;
  font-size: 12px; color: var(--text); background: var(--white); outline: none; width: 100%;
  font-family: inherit; transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: #1d9e75; box-shadow: 0 0 0 3px rgba(29,158,117,0.1); }
label { font-size: 12px; color: var(--text-secondary); display: block; margin-bottom: 4px; font-weight: 500; }
.form-group { margin-bottom: 14px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }

/* ===== Sidebar Layout ===== */
.sidebar-layout { display: grid; grid-template-columns: 148px 1fr; gap: 12px; min-width: 0; }
.sidebar-layout > div:last-child { min-width: 0; overflow: visible; }

.sidebar-menu {
  background: var(--white); border-radius: var(--radius); border: 0.5px solid var(--border);
  padding: 3px; position: sticky; top: 68px;
  max-height: calc(100vh - 84px); overflow-y: auto;
}
.sidebar-item { padding: 5px 6px; border-radius: 5px; font-size: 12px; cursor: pointer; color: var(--text-secondary); margin-bottom: 1px; transition: all 0.15s; }
.sidebar-item:hover { background: var(--bg); }
.sidebar-item.active { background: var(--green-light); color: var(--green); font-weight: 500; }
.sidebar-group { font-size: 10px; color: #b4b2a9; padding: 6px 6px 2px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== Top Tabs (二级菜单 - 页面顶端按钮) ===== */
.admin-top-tabs {
  display: flex; gap: 6px; padding: 8px 0 14px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.admin-top-tabs .tab-btn {
  padding: 6px 16px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--white); color: var(--text-secondary); font-size: 12px;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.admin-top-tabs .tab-btn:hover { background: var(--bg); }
.admin-top-tabs .tab-btn.active {
  background: var(--green); color: #fff; border-color: var(--green);
}

/* ===== 菜单管理三级图例 ===== */
.menu-level-legend {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-secondary); background: var(--bg);
  padding: 5px 12px; border-radius: 4px;
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-dot.l1 { background: var(--green); }
.legend-dot.l2 { background: var(--blue); }
.legend-dot.l3 { background: var(--amber); }

/* ===== 三列表单 ===== */
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 600px) { .form-row-3 { grid-template-columns: 1fr; } }

/* ===== Phone Mockup ===== */
.phone-wrap { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; }
.phone {
  width: 240px; background: var(--white); border-radius: 32px;
  border: 2px solid var(--text); overflow: hidden;
  box-shadow: 0 0 0 6px var(--bg), 0 8px 24px rgba(0,0,0,0.12);
  transition: transform 0.2s;
}
.phone:hover { transform: translateY(-4px); }
.phone-notch { background: var(--text); height: 22px; border-radius: 0 0 12px 12px; width: 80px; margin: 0 auto; }
.phone-screen { padding: 12px; min-height: 400px; }
.phone-label { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ===== Screen UI ===== */
.s-header {
  background: var(--green); color: var(--white); padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 500;
}
.s-tab-bar { display: flex; border-bottom: 0.5px solid var(--border); margin-bottom: 10px; }
.s-tab { flex: 1; text-align: center; padding: 7px 0; font-size: 11px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; }
.s-tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 500; }
.s-product { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 0.5px solid rgba(0,0,0,0.05); }
.s-product:last-child { border-bottom: none; }
.s-product .thumb { width: 36px; height: 36px; background: var(--green-light); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.s-product .pname { font-size: 11px; font-weight: 500; color: var(--text); }
.s-product .pprice { font-size: 10px; color: var(--text-muted); }
.s-product .paction { margin-left: auto; font-size: 10px; background: var(--green); color: var(--white); padding: 3px 8px; border-radius: 4px; white-space: nowrap; cursor: pointer; }
.s-device { background: var(--bg); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.s-device .dname { font-size: 11px; font-weight: 500; }
.s-device .dprice { font-size: 10px; color: var(--text-muted); }
.s-device .dstatus { font-size: 10px; color: #1d9e75; margin-top: 2px; }
.s-btn { width: 100%; padding: 9px; background: var(--green); color: var(--white); border-radius: 8px; text-align: center; font-size: 12px; font-weight: 500; margin-top: 10px; cursor: pointer; border: none; transition: background 0.15s; }
.s-btn:hover { background: var(--green-dark); }
.s-btn-outline { background: var(--white); color: var(--green); border: 0.5px solid var(--green); }
.s-btn-outline:hover { background: var(--green-light); }
.s-chip { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 10px; margin-right: 4px; }

/* ===== Flow ===== */
.flow { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin: 16px 0; }
.flow-step { display: flex; align-items: center; gap: 6px; }
.flow-step .dot {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 600;
  background: var(--green-light); color: var(--green); flex-shrink: 0;
}
.flow-step .name { font-size: 12px; color: #444441; white-space: nowrap; }
.flow-arrow { color: #b4b2a9; margin: 0 8px; font-size: 14px; font-weight: 600; }

/* ===== Feature List ===== */
.feat-list { list-style: none; }
.feat-list li { padding: 6px 0; border-bottom: 0.5px solid rgba(0,0,0,0.05); font-size: 12px; display: flex; gap: 8px; }
.feat-list li:last-child { border-bottom: none; }
.feat-list li::before { content: ""; display: block; width: 6px; height: 6px; border-radius: 50%; background: #1d9e75; margin-top: 5px; flex-shrink: 0; }

/* ===== Device Card ===== */
.device-card {
  border: 0.5px solid var(--border); border-radius: 10px; padding: 14px;
  background: var(--white); transition: all 0.15s;
}
.device-card:hover { border-color: var(--green); }
.device-card .device-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.device-card .device-loc { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.device-progress { height: 4px; background: var(--bg); border-radius: 2px; margin: 6px 0 8px; }
.device-progress-fill { height: 4px; background: #1d9e75; border-radius: 2px; transition: width 0.6s ease; }

/* ===== 格口可视化网格（方块网格布局） ===== */
.slot-legend { display:inline-block;width:12px;height:12px;border-radius:3px;vertical-align:-2px;margin-right:3px; }
.locker-device-bar {
  display:flex; align-items:center; justify-content:space-between;
  background:linear-gradient(135deg,#f7f9f8,#eff5f1); border-radius:var(--radius);
  padding:14px 18px; margin-bottom:16px; border:1px solid var(--border);
}
.locker-dev-info { display:flex;align-items:center;gap:10px;font-size:13px; }
.locker-dev-info span:last-of-type { font-size:11px;color:#888780; }
.locker-stats { display:flex;align-items:center;gap:16px; }
.stat-item { text-align:right; }
.stat-label { font-size:11px;color:#888780;display:block;margin-bottom:2px; }
.stat-val { font-size:15px; }
.stat-sub { font-size:10px;color:#aaa;margin-left:6px; }
.stat-divider { width:1px;height:36px;background:var(--border); }
.locker-section { margin-bottom:20px; }
.locker-section-header {
  display:flex;align-items:center;gap:8px;padding:10px 0;border-bottom:1px solid var(--border);
  margin-bottom:12px;flex-wrap:wrap;
}
.section-icon { font-size:16px; }
.section-title { font-weight:600;font-size:14px; }
.section-legend { margin-left:auto;display:flex;gap:10px;font-size:11px;color:#888780;flex-wrap:wrap; }
.section-count { font-size:12px;font-weight:600;color:#888780;background:var(--bg);padding:2px 10px;border-radius:10px; }
.locker-grid-wrap {
  display:grid; gap:6px;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
}
@media (min-width:700px) { .locker-grid-wrap { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); } }

/* 格口柜模式: 每个格口带动作按钮, 容器需更宽以容纳 */
.comp-cabinet-card .locker-grid-wrap {
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 7px;
  overflow: visible;
}
@media (min-width:1100px) {
  .comp-cabinet-card .locker-grid-wrap { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}
/* 手机/平板: 减小格口大小但仍保持按钮可见 */
@media (max-width:500px) {
  .comp-cabinet-card .locker-grid-wrap { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 5px; }
}
.slot-cell {
  position:relative; aspect-ratio:1; border-radius:7px; cursor:pointer;
  display:flex;align-items:center;justify-content:center;transition:all 0.15s ease;
  border:2px solid transparent; user-select:none; overflow:hidden;
}
.slot-cell:hover { transform:scale(1.08); z-index:2; box-shadow:0 3px 12px rgba(0,0,0,0.15); }
.slot-cell.slot-selected { border-color:#2563eb; transform:scale(1.08); box-shadow:0 0 0 2px rgba(37,99,235,0.25); z-index:2; }
/* 租赁-空闲 */
.slot-idle { background:#e1f5ee; border-color:#9fe1cb; color:#0f6e56; }
/* 租赁-占用 */
.slot-occupied { background:#0f6e56; color:#fff; }
/* 售卖-空柜 */
.slot-empty { background:#faeeda; border-color:#eddcb7; color:#ba7517; }
/* 售卖-有货 */
.slot-stocked { background:#ba7517; color:#fff; }
.slot-num { font-size:10px;font-weight:700;z-index:1;pointer-events:none;letter-spacing:0.5px; }
.slot-dot {
  position:absolute;top:3px;right:3px;width:5px;height:5px;
  border-radius:50%;background:#4ade80;box-shadow:0 0 4px rgba(74,222,128,0.6);
}
.slot-dot.dot-yellow { background:#fbbf24; box-shadow:0 0 4px rgba(251,191,36,0.6); }
.slot-dot.dot-unlock { background:transparent; box-shadow:none; width:auto; height:auto; top:50%; left:50%; transform:translate(-50%,-50%); font-size:13px; }

/* ===== 格口柜-已开锁状态 ===== */
.slot-unlocked {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
  color: #92400e;
  box-shadow: 0 0 0 2px rgba(245,158,11,0.25);
  animation: slot-pulse 1.4s ease-in-out infinite;
}
/* 售卖-空柜（用于 sale_empty 状态） */
.slot-sale-empty { background:#faf5eb; border-color:#eddcb7; color:#9a7b3a; }
/* 混合（租赁+售卖） */
.slot-mixed {
  background: linear-gradient(135deg, #0f6e56 0%, #ba7517 100%);
  color: #fff;
  border-color: #8b5e14;
  box-shadow: 0 0 0 2px rgba(186,117,23,0.3);
}
/* ★ 员工投递占用（紫色 — 区别于租赁绿/售卖棕） */
.slot-delivery-occupied {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  border-color: #7c3aed;
  color: #5b21b6;
  box-shadow: 0 0 0 2px rgba(124,58,237,0.2);
  font-weight: 600;
}
.slot-delivery-occupied .slot-num { color:#5b21b6; }
.slot-dot.dot-delivery { background:transparent; box-shadow:none; width:auto; height:auto; top:50%; left:50%; transform:translate(-50%,-50%); font-size:12px; }
/* ★ 管理员手动置故障（红色） */
.slot-fault {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
  box-shadow: 0 0 0 2px rgba(239,68,68,0.15);
}
.slot-fault .slot-num { color:#991b1b; }
/* ★ 归还充电占用（已归还的租赁设备正在格口充电 — 深绿） */
.slot-return-occupied {
  background: #15803d;
  border-color: #166534;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(21,128,61,0.35);
  font-weight: 600;
}
.slot-return-occupied .slot-num { color:#fff; }
/* ★ 充电格口标记（虚线边框 + 闪电角标 — 只能投放/归还租赁设备） */
.slot-cell.slot-charge {
  border-style: dashed;
  border-width: 2px;
  border-color: #65a30d;
}
.slot-cell.slot-charge.slot-empty,
.slot-cell.slot-charge.slot-idle {
  background: #f7fee7;
  border-style: dashed;
  border-color: #a3e635;
}
.slot-act-btn.slot-act-charge:hover { background: #ecfccb; border-color: #65a30d; }
@keyframes slot-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(245,158,11,0.25); }
  50%      { box-shadow: 0 0 0 4px rgba(245,158,11,0.4); }
}

/* ===== 格口 + 动作按钮 组合容器 ===== */
.comp-slot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}
.comp-slot-wrap .slot-cell {
  width: 100%;
}
.comp-slot-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  justify-items: stretch;
  min-height: 44px;
  width: 100%;
}
.slot-act-btn {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 4px;
  padding: 1px 2px;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.slot-act-btn:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.slot-act-btn.slot-act-open:hover  { background: #d1fae5; border-color: #10b981; }
.slot-act-btn.slot-act-status:hover{ background: #dbeafe; border-color: #3b82f6; }
.slot-act-btn.slot-act-idle:hover  { background: #d1fae5; border-color: #10b981; }
.slot-act-btn.slot-act-fault:hover { background: #fee2e2; border-color: #ef4444; }
.slot-act-btn:disabled {
  cursor: wait;
  opacity: 0.5;
}
@media (max-width:500px) {
  .locker-grid-wrap { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap:4px; }
  .locker-device-bar { flex-direction:column;gap:10px; text-align:center; }
  .locker-stats { justify-content:center; }
  .section-legend { display:none; }
  .track-card { min-width:100%; }
  .track-actions { flex-wrap:wrap; }
}

/* ===== 轨道柜可视化 ===== */
.track-grid-wrap {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width:600px) {
  .track-grid-wrap { grid-template-columns: repeat(2, 1fr); }
}
.track-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  transition: all 0.2s ease;
  cursor: default;
}
.track-card:hover {
  border-color: #0891b2;
  box-shadow: 0 4px 16px rgba(8,145,178,0.12);
  transform: translateY(-1px);
}
.track-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.track-num {
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
}
.track-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.track-status-unknown {
  background: #f1f5f9;
  color: #64748b;
}
.track-status-open {
  background: #ecfdf5;
  color: #0891b2;
}
.track-status-closed {
  background: #e0f2fe;
  color: #0c4a6e;
}
.track-status-loading {
  background: #fefce8;
  color: #ca8a04;
  animation: pulse 0.6s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.track-actions {
  display: flex;
  gap: 6px;
}
.track-btn {
  flex: 1;
  padding: 6px 4px;
  border: 1.5px solid;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fff;
  text-align: center;
}
.track-btn:hover {
  transform: scale(1.04);
}
.track-btn-open {
  color: #0891b2;
  border-color: #67e8f9;
}
.track-btn-open:hover {
  background: #0891b2;
  color: #fff;
  border-color: #0891b2;
}
.track-btn-close {
  color: #6b7280;
  border-color: #d1d5db;
}
.track-btn-close:hover {
  background: #4b5563;
  color: #fff;
  border-color: #4b5563;
}
.track-btn-status {
  flex: 0 0 36px;
  color: #7c3aed;
  border-color: #c4b5fd;
  font-size: 14px;
}
.track-btn-status:hover {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
}
.badge-info {
  background: #e0f2fe;
  color: #0891b2;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}

/* ===== 格口柜可视化（按柜体分组） ===== */
.comp-cabinet-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.comp-cabinet-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  overflow: visible;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.comp-cabinet-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.comp-cabinet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 8px;
}
.comp-cabinet-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.comp-cabinet-icon {
  font-size: 18px;
}
.comp-cabinet-name {
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
}
.comp-cabinet-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #64748b;
}
.comp-stat b {
  color: #0f172a;
}
.comp-cabinet-body {
  padding: 12px 16px 16px;
  overflow: visible;
}
.comp-section {
  margin-bottom: 16px;
}
.comp-section:last-child {
  margin-bottom: 0;
}
.comp-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  margin-bottom: 8px;
  border-bottom: 1px dashed #e2e8f0;
  flex-wrap: wrap;
}
.comp-section-icon {
  font-size: 14px;
}
.comp-section-title {
  font-weight: 600;
  font-size: 13px;
  color: #334155;
}
.comp-section-legend {
  margin-left: auto;
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: #888780;
  flex-wrap: wrap;
}
.comp-section-count {
  font-size: 11px;
  font-weight: 600;
  color: #888780;
  background: #f1f5f9;
  padding: 2px 10px;
  border-radius: 10px;
}
.comp-empty-msg {
  text-align: center;
  padding: 20px;
  color: #aaa;
  font-size: 12px;
}
.cab-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}
.cab-badge-main {
  background: #e1f5ee;
  color: #0f6e56;
}
.cab-badge-sub {
  background: #e0f2fe;
  color: #0891b2;
}

/* 响应式：窄屏时柜体卡片统计换行 */
@media (max-width:600px) {
  .comp-cabinet-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .comp-cabinet-stats {
    width: 100%;
    justify-content: flex-start;
  }
  .comp-section-header {
    flex-wrap: wrap;
    gap: 4px;
  }
  .comp-section-legend {
    margin-left: 0;
  }
}

/* 设备表格：保证窄屏可水平滚动 */
#device-table { min-width: 900px; }
#device-table th, #device-table td { padding: 6px 10px; }

/* ===== Timeline ===== */
.timeline { padding-left: 16px; border-left: 1.5px solid var(--green-light); }
.tl-item { position: relative; padding-bottom: 16px; padding-left: 14px; }
.tl-item::before { content: ""; position: absolute; left: -6px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: #1d9e75; border: 2px solid var(--white); }
.tl-item .tl-title { font-size: 12px; font-weight: 500; color: var(--text); }
.tl-item .tl-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ===== Info Row ===== */
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 0.5px solid rgba(0,0,0,0.05); font-size: 12px; }
.info-row:last-child { border-bottom: none; }
.info-row .lk { color: var(--text-muted); }
.info-row .lv { color: var(--text); font-weight: 500; }

/* ===== Modal ===== */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); z-index: 200; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-overlay.active {
  display: flex !important;
  z-index: 99999 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  align-items: center !important;
  justify-content: center !important;
}
.modal {
  background: var(--white); border-radius: var(--radius); padding: 24px;
  max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2); animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ===== Charts ===== */
.chart-area { width: 100%; }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin: 8px 0; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; border-radius: 3px 3px 0 0; transition: height 0.4s ease; }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 300;
  padding: 12px 20px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--white); transform: translateX(120%); transition: transform 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.toast.show { transform: translateX(0); }
.toast-success { background: #1d9e75; }
.toast-error { background: #e24b4a; }
.toast-info { background: #185fa5; }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ===== Product Filter Bar ===== */
.product-filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  padding: 12px 16px; background: var(--bg); border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.filter-item { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.filter-item label { font-size: 10px; color: var(--text-muted); margin-bottom: 0; font-weight: 400; }
.filter-item input, .filter-item select { font-size: 12px; padding: 6px 10px; height: 32px; }
.filter-date { min-width: 220px; }
.filter-actions { flex-direction: row; align-items: flex-end; gap: 6px; min-width: auto; }
.filter-actions .btn { height: 32px; white-space: nowrap; }

/* ===== Upload Area ===== */
.upload-area {
  border: 1.5px dashed rgba(0,0,0,0.15); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; cursor: pointer; transition: all 0.15s;
  position: relative; background: #fafaf9;
}
.upload-area:hover { border-color: var(--green); background: var(--green-light); }
.upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.upload-preview { position: relative; display: inline-block; }
.upload-preview img { max-width: 100%; max-height: 160px; border-radius: 6px; object-fit: cover; }
.upload-remove {
  position: absolute; top: -8px; right: -8px; width: 22px; height: 22px;
  background: var(--red); color: #fff; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 12px; cursor: pointer;
  line-height: 1;
}

/* ===== Form Section Title ===== */
.form-section-title {
  font-size: 12px; font-weight: 600; color: var(--text); margin: 16px 0 10px;
  padding-bottom: 6px; border-bottom: 0.5px solid var(--border);
}
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }

/* ===== Edit Dialog Layout ===== */
.edit-section {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e8e4da;
}
.edit-section:last-of-type { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.edit-section-title {
  font-size: 13px; font-weight: 600; color: #2c2c2a;
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.edit-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.edit-field { display: flex; flex-direction: column; gap: 4px; }
.edit-label {
  font-size: 12px; color: #6b6860; font-weight: 500;
}
.edit-input {
  width: 100%; padding: 7px 10px; border: 1px solid #d4d3cd; border-radius: 6px;
  font-size: 13px; color: #2c2c2a; background: #fff; transition: border-color 0.2s;
  box-sizing: border-box;
}
.edit-input:focus { outline: none; border-color: #0f6e56; box-shadow: 0 0 0 2px rgba(15,110,86,0.08); }
.edit-input-readonly {
  background: #f8f7f4; color: #888780; cursor: not-allowed; border-color: #e8e4da;
}
.edit-select {
  width: 100%; padding: 7px 10px; border: 1px solid #d4d3cd; border-radius: 6px;
  font-size: 13px; color: #2c2c2a; background: #fff; transition: border-color 0.2s;
  box-sizing: border-box; appearance: auto;
}
.edit-select:focus { outline: none; border-color: #0f6e56; box-shadow: 0 0 0 2px rgba(15,110,86,0.08); }

/* Edit type card */
.edit-type-card {
  padding: 12px 16px; border: 1.5px solid #d4d3cd; border-radius: 8px;
  cursor: pointer; text-align: center; transition: all 0.2s;
  background: #fff; user-select: none; min-width: 90px;
}
.edit-type-card:hover { border-color: #0f6e56; background: #f0faf6; }
.edit-type-card.selected {
  border-color: #0f6e56; background: #e1f5ee;
  box-shadow: 0 0 0 1px #0f6e56;
}

@media (max-width: 640px) {
  .edit-grid-2 { grid-template-columns: 1fr; }
  .edit-type-card { min-width: 70px; padding: 10px 12px; }
}

/* ===== Required Mark ===== */
.required-mark { color: #e24b4a; font-weight: 500; }

/* ===== Product Table Image ===== */
.product-thumb {
  width: 42px; height: 42px; border-radius: 6px; object-fit: cover;
  border: 0.5px solid var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #b4b2a9;
}

/* ===== Loading ===== */
.loading { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--green-light); border-top-color: var(--green); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Skeleton Screen ===== */
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skel-row td { padding: 6px 12px !important; }
.skel-block {
  height: 16px; border-radius: 3px;
  background: linear-gradient(90deg, #e8e6de 25%, #dcd9ce 37%, #e8e6de 63%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}
/* 分页切换时的平滑过渡 */
#product-table-body { transition: opacity 0.12s ease; }
.skel-loading-overlay {
  text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 13px;
}
.skel-loading-overlay .loading { margin: 0 auto 12px; display: block; width: 32px; height: 32px; border-width: 3px; }

/* ===== Marketing Center ===== */
.marketing-tabs {
  display: flex; gap: 0; margin-bottom: 14px;
  border-bottom: 2px solid var(--border);
}
.marketing-tab {
  padding: 8px 18px; font-size: 12px; cursor: pointer; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.15s; white-space: nowrap;
}
.marketing-tab:hover { color: var(--text); }
.marketing-tab.active {
  color: var(--green); border-bottom-color: var(--green); font-weight: 500;
}

/* 活动类型选择卡片 */
.mk-type-selector {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.mk-type-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s; text-align: center; background: var(--white);
}
.mk-type-card:hover { border-color: var(--green); background: var(--green-light); }
.mk-type-card.selected {
  border-color: var(--green); background: var(--green-light);
  box-shadow: 0 0 0 3px rgba(15,110,86,0.1);
}
.mk-type-icon { font-size: 28px; }
.mk-type-name { font-size: 13px; font-weight: 600; color: var(--text); }
.mk-type-desc { font-size: 10px; color: var(--text-muted); }

/* 关联商品多选列表 */
.mk-product-list {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px;
  border: 0.5px solid rgba(0,0,0,0.15); border-radius: var(--radius-xs);
  min-height: 44px; align-items: center; background: #fafaf9;
}
.mk-product-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px; font-size: 11px;
  cursor: pointer; transition: all 0.15s;
  border: 0.5px solid var(--border); background: var(--white);
  user-select: none;
}
.mk-product-chip:hover { border-color: var(--green); }
.mk-product-chip.selected {
  background: var(--green-light); color: var(--green);
  border-color: var(--green); font-weight: 500;
}
.mk-product-chip .chip-check {
  display: none; font-size: 10px;
}
.mk-product-chip.selected .chip-check { display: inline; }

/* 营销活动表格操作按钮 */
#marketing-table .btn-sm { font-size: 10px; padding: 3px 8px; }

/* 响应式：类型选择卡片 */
@media (max-width: 768px) {
  .mk-type-selector { grid-template-columns: 1fr; }
  .marketing-tabs { overflow-x: auto; white-space: nowrap; }
  .marketing-tab { font-size: 11px; padding: 6px 12px; }
}

/* ===== Responsive ===== */

/* ≥1200px: 大屏优化 */
@media (min-width: 1200px) {
  .app-container { max-width: 1600px; }
}

/* ≤1200px: 中等屏幕 */
@media (max-width: 1200px) {
  .app-container { max-width: 100%; padding: 20px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .phone-wrap { gap: 24px; }
}

/* ≤1024px: 小平板 */
@media (max-width: 1024px) {
  .app-container { padding: 16px; }
  
  /* sidebar 自适应 */
  .sidebar-layout { grid-template-columns: 1fr; }
  .sidebar-menu {
    position: static; display: flex; flex-wrap: wrap; gap: 2px;
    padding: 6px; border-radius: var(--radius);
    overflow-x: auto; white-space: nowrap;
  }
  .sidebar-group { display: none; }
  .sidebar-item {
    margin-bottom: 0; white-space: nowrap; flex-shrink: 0;
    padding: 5px 8px; font-size: 12px; border-radius: 6px;
  }
  
  /* 表单两列/三列变一列 */
  .form-row-2 { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  
  /* 筛选栏 */
  .product-filter-bar { flex-direction: column; }
  .filter-item { width: 100%; }
  .filter-date { min-width: auto; }
  
  /* 流程步骤 */
  .flow { flex-wrap: wrap; justify-content: center; gap: 4px; }
  .flow-arrow { margin: 0 4px; }
  
  /* 设备表格：水平滚动提示 */
  #device-table { min-width: 800px; }
}

/* ≤768px: 手机横屏/小平板 */
@media (max-width: 768px) {
  /* Header */
  .app-header { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 6px; }
  .app-header .logo { font-size: 14px; }
  .app-header nav { order: 3; width: 100%; overflow-x: auto; display: flex; flex-wrap: nowrap; }
  .app-header nav a { font-size: 11px; padding: 5px 10px; white-space: nowrap; }
  .header-actions { margin-left: auto; }
  
  /* Grids */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  
  /* 统计卡片缩小 */
  .metric { padding: 12px 14px; }
  .metric .value { font-size: 20px; }
  
  /* 卡片 */
  .card { padding: 14px; }
  
  /* 手机模型 */
  .phone-wrap { gap: 12px; }
  .phone { width: 160px; border-radius: 24px; }
  .phone-screen { min-height: 320px; padding: 8px; }
  .phone-label { font-size: 11px; margin-top: 10px; }
  
  /* 流程 */
  .flow { flex-direction: column; align-items: flex-start; }
  .flow-arrow { transform: rotate(90deg); margin: 2px 12px; }
  
  /* 时间线 */
  .grid-3 { gap: 12px; }
  
  /* 弹窗 */
  .modal { padding: 16px; max-width: 95vw; max-height: 85vh; }
  .modal-footer { flex-wrap: wrap; }
  
  /* 按钮 */
  .btn { padding: 6px 14px; font-size: 12px; }
  
  /* 表格操作按钮 */
  td .btn-sm { padding: 3px 7px; font-size: 10px; }
  
  /* 管理后台搜索区 */
  #admin-devices .card > div:first-child { flex-direction: column; align-items: flex-start !important; }
  #admin-devices .card > div:first-child > div:last-child { width: 100%; }
  #admin-search-device { width: 100% !important; }
  #admin-filter-status, #admin-filter-type { width: 48% !important; }
}

/* ===== 系统权限 ===== */

/* 菜单树 */
.menu-tree { padding: 4px 0; }
.menu-tree-node { margin-bottom: 2px; }
.menu-tree-header {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: var(--radius-xs); cursor: pointer; transition: all 0.15s;
  border: 0.5px solid transparent;
}
.menu-tree-header:hover { background: var(--bg); }
.menu-tree-header.level-1 { background: var(--green-light); border-color: #9fe1cb; margin-bottom: 4px; }
.menu-tree-header.level-2 { background: var(--blue-light); border-color: #85b7eb; }
.menu-tree-header.level-3 { background: #fafaf9; border-color: var(--border); }
.menu-tree-expand {
  width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--text-muted); transition: transform 0.2s;
  flex-shrink: 0;
}
.menu-tree-expand.expanded { transform: rotate(90deg); }
.menu-tree-icon { font-size: 14px; flex-shrink: 0; }
.menu-tree-name { font-size: 12px; font-weight: 500; flex: 1; }
.menu-tree-tag {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  font-size: 9px; font-weight: 500; white-space: nowrap;
}
.menu-tree-tag.l1 { background: var(--green-light); color: var(--green); }
.menu-tree-tag.l2 { background: var(--blue-light); color: var(--blue); }
.menu-tree-tag.l3 { background: var(--amber-light); color: var(--amber); }
.menu-tree-minlevel {
  display: inline-block; padding: 1px 5px; border-radius: 3px;
  font-size: 9px; background: var(--red-light); color: var(--red);
}
.menu-tree-actions { display: flex; gap: 4px; flex-shrink: 0; }
.menu-tree-children { padding-left: 24px; }

/* 菜单勾选列表 */
.menu-check-list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 240px; overflow-y: auto; padding: 8px;
  border: 0.5px solid rgba(0,0,0,0.15); border-radius: var(--radius-xs);
  background: #fafaf9;
}
.menu-check-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px;
  border-radius: 4px; cursor: pointer; font-size: 11px; transition: background 0.15s;
  user-select: none;
}
.menu-check-item:hover { background: var(--bg); }
.menu-check-item input[type="checkbox"] { width: auto; accent-color: var(--green); }
.menu-check-item.child { padding-left: 32px; font-size: 10px; color: var(--text-secondary); }

/* 岗位等级标签 */
.level-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500;
}
.level-l1 { background: var(--red-light); color: var(--red); }
.level-l2 { background: var(--amber-light); color: var(--amber); }
.level-l3 { background: var(--blue-light); color: var(--blue); }
.level-l4 { background: var(--green-light); color: var(--green); }
.level-l5 { background: var(--bg); color: var(--text-muted); }

/* 员工卡片内联 */
.emp-position-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 500;
}

/* 响应式：菜单树 */
@media (max-width: 768px) {
  .menu-tree-children { padding-left: 12px; }
  .menu-tree-header { padding: 6px 8px; gap: 4px; }
  .menu-tree-name { font-size: 11px; }
  .menu-check-list { max-height: 180px; }
}

/* ===== Refund ===== */
.refund-amount-input {
  position: relative; display: flex; align-items: center;
}
.refund-currency {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; font-weight: 600; color: var(--text); z-index: 1;
  pointer-events: none;
}
.refund-hint {
  font-size: 10px; color: var(--text-muted); margin-top: 4px;
}
.refund-summary {
  background: var(--amber-light); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-top: 10px;
}
.refund-badge {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 500;
  background: #fcebeb; color: #a32d2d;
}

/* ≤480px: 小屏手机 */
@media (max-width: 480px) {
  .app-container { padding: 10px; }
  .section-title { font-size: 15px; }
  .section-sub { font-size: 11px; margin-bottom: 16px; }
  
  /* Header 紧凑 */
  .app-header { padding: 8px 10px; }
  .app-header nav a { font-size: 10px; padding: 4px 8px; }
  .header-actions .badge { font-size: 10px !important; padding: 2px 8px !important; }
  
  /* 统计卡片更紧凑 */
  .metric { padding: 10px 12px; border-radius: var(--radius-sm); }
  .metric .label { font-size: 10px; }
  .metric .value { font-size: 18px; }
  .metric .change { font-size: 10px; }
  
  /* 卡片 */
  .card { padding: 12px; border-radius: var(--radius-sm); }
  .card-title { font-size: 13px; margin-bottom: 10px; }
  
  /* 表格 */
  th, td { padding: 6px 8px; font-size: 10px; }
  
  /* 弹窗 */
  .modal { padding: 12px; border-radius: var(--radius-sm); }
  .modal-title { font-size: 14px; margin-bottom: 12px; }
  
  /* 手机模型更小 */
  .phone { width: 140px; border-radius: 20px; }
  .phone-screen { min-height: 260px; padding: 6px; }
  .s-header { padding: 6px 8px; font-size: 10px; }
  .s-tab { font-size: 9px; padding: 5px 0; }
  .s-device { padding: 6px; }
  .s-btn { padding: 6px; font-size: 10px; }
  
  /* 流程 */
  .flow-step .dot { width: 22px; height: 22px; font-size: 10px; }
  .flow-step .name { font-size: 10px; }
  
  /* 特征列表 */
  .feat-list li { font-size: 10px; padding: 4px 0; }
  
  /* 图表 */
  .bar-chart { height: 80px; gap: 4px; }
  
  /* 设备统计卡片在480以下仍保持两列 */
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  
  /* 收入/订单统计两列 */
  #admin-orders .grid-2,
  #admin-finance .grid-2 { gap: 8px; }
}

/* ===== 日期输入框点击区域扩大 ===== */
input[type="date"] {
  cursor: pointer;
  position: relative;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: transparent;
  background: transparent;
  cursor: pointer;
}

/* ===== 商品图片 hover 放大 ===== */
.product-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-radius 0.2s ease;
  cursor: pointer;
}
.product-thumb:hover {
  transform: scale(8);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  border-radius: 4px;
  position: relative;
  z-index: 999;
}

/* ===== 商品详情页 ===== */
.product-detail-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
}

.product-detail-gallery {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
}

.product-detail-main-img {
  width: 100%;
  height: 360px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg);
  margin-bottom: 12px;
}

.product-detail-info {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border);
}

.product-detail-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.product-detail-name {
  font-size: 22px;
  font-weight: 700;
  color: #2c2c2a;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.product-detail-subtitle {
  font-size: 13px;
  color: #fe7b2e;
  margin: 4px 0 0 0;
}

.product-detail-price-section {
  background: linear-gradient(135deg, #fff7f0, #fff3e8);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.product-detail-price-label {
  font-size: 13px;
  color: #b4b2a9;
  margin-bottom: 4px;
}

.product-detail-current-price {
  font-size: 32px;
  font-weight: 700;
  color: #fe7b2e;
  margin: 0;
}

.product-detail-current-price .unit {
  font-size: 16px;
  font-weight: 500;
}

.product-detail-current-price .period {
  font-size: 13px;
  font-weight: 400;
  color: #888780;
}

.product-detail-origin-price {
  font-size: 14px;
  color: #b4b2a9;
  text-decoration: line-through;
  margin-left: 12px;
}

.product-detail-rental-detail {
  margin-top: 8px;
  font-size: 12px;
  color: #888780;
  line-height: 1.8;
}

.product-detail-rental-detail span {
  color: #5b5a55;
  font-weight: 500;
}

.product-detail-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.product-detail-spec-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #5b5a55;
}

.product-detail-spec-item .spec-label {
  color: #b4b2a9;
  min-width: 56px;
}

.product-detail-spec-item .spec-value {
  color: #2c2c2a;
  font-weight: 500;
}

.product-detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.product-detail-btn-primary {
  flex: 1;
  padding: 14px 24px;
  background: linear-gradient(135deg, #fe7b2e, #e8691a);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.product-detail-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.product-detail-btn-secondary {
  padding: 14px 28px;
  background: #fff;
  color: #fe7b2e;
  border: 1.5px solid #fe7b2e;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.product-detail-btn-secondary:hover {
  background: #fff7f0;
}

/* 商品描述 */
.product-detail-desc-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border);
  margin-top: 16px;
}

.product-detail-desc-title {
  font-size: 16px;
  font-weight: 600;
  color: #2c2c2a;
  margin: 0 0 12px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.product-detail-desc-content {
  font-size: 14px;
  color: #5b5a55;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 商品详情 - 新布局 */
.product-detail-layout-new {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.product-detail-gallery-new {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.product-detail-body {
  display: flex;
  flex-direction: column;
}

/* 轮播图 */
.product-carousel {
  width: 100%;
}
.product-carousel-main {
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f4f0;
}
.product-carousel-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-carousel-thumbs {
  display: flex;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
}
.product-carousel-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s;
}
.product-carousel-thumb.active {
  border-color: #1d9e75;
}
.product-carousel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 商品详情区块（底部） */
.product-detail-section {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  border: 1px solid var(--border);
  margin-top: 0;
}
.product-detail-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #2c2c2a;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}
.product-detail-section-icon {
  font-size: 20px;
}
.product-detail-rich-content {
  font-size: 14px;
  color: #3c3c3a;
  line-height: 1.9;
  word-break: break-word;
}
.product-detail-rich-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
}
.product-detail-rich-content p {
  margin: 8px 0;
}

/* 多图上传区域 */
.product-images-upload {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.product-images-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.product-image-thumb-card {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: #f5f4f0;
}
.product-image-thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-image-thumb-badge {
  position: absolute;
  top: -1px;
  left: -1px;
  background: #1d9e75;
  color: #fff;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 0 0 6px 0;
  font-weight: 600;
}
.product-image-thumb-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  opacity: 0;
  transition: opacity 0.15s;
  font-size: 12px;
  color: #fff;
}
.product-image-thumb-card:hover .product-image-thumb-overlay {
  opacity: 1;
}
.product-image-thumb-move-left,
.product-image-thumb-move-right,
.product-image-thumb-remove {
  cursor: pointer;
  padding: 0 3px;
  user-select: none;
}
.product-image-thumb-remove {
  color: #ff9c9c;
  font-weight: 700;
  font-size: 14px;
}
.product-images-add {
  width: 90px;
  height: 90px;
  border: 2px dashed #d7d5cc;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: #b4b2a9;
  flex-shrink: 0;
}
.product-images-add:hover {
  border-color: #1d9e75;
  background: #f0faf6;
}
.product-image-thumb-err {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e24b4a;
  font-size: 20px;
}

/* ===== 下单弹窗 ===== */
.order-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  width: 480px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}

.order-modal h3 {
  font-size: 18px;
  font-weight: 600;
  color: #2c2c2a;
  margin: 0 0 20px 0;
  text-align: center;
}

.order-modal-product {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 16px;
}

.order-modal-product img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
}

.order-modal-product-info {
  flex: 1;
}

.order-modal-product-name {
  font-size: 14px;
  font-weight: 600;
  color: #2c2c2a;
}

.order-modal-product-price {
  font-size: 13px;
  color: #fe7b2e;
  font-weight: 500;
  margin-top: 4px;
}

.order-modal .form-group {
  margin-bottom: 14px;
}

.order-modal .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #5b5a55;
  margin-bottom: 6px;
}

.order-modal .form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg);
  transition: border-color 0.2s;
}

.order-modal .form-input:focus {
  border-color: #fe7b2e;
  outline: none;
  background: #fff;
}

.order-modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.order-modal-footer button {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}

.order-modal-footer .btn-cancel {
  background: var(--bg);
  color: #5b5a55;
  border: 1px solid var(--border);
}

.order-modal-footer .btn-confirm {
  background: linear-gradient(135deg, #fe7b2e, #e8691a);
  color: #fff;
}

.order-modal-footer button:hover {
  opacity: 0.85;
}

/* 响应式 */
@media (max-width: 768px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
  }
  .product-detail-layout-new {
    grid-template-columns: 1fr;
  }
  .product-carousel-main {
    height: 280px;
  }
  .product-detail-gallery {
    max-width: 100%;
  }
  .product-detail-specs {
    grid-template-columns: 1fr;
  }
  .product-detail-actions {
    flex-direction: column;
  }
}

/* ===== 商品详情左右分栏（编辑器 + 预览） ===== */
.product-desc-split {
  display: flex;
  gap: 12px;
  align-items: stretch;
  min-height: 480px;
}
.product-desc-left {
  flex: 1 1 60%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  position: relative;
}
.product-desc-left #product-desc-toolbar-wrap {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #faf9f5;
  border-bottom: 1px solid var(--border);
  min-height: 40px;
  flex-shrink: 0;
}
.product-desc-left #product-desc-editor {
  flex: 1 1 auto;
  min-height: 420px;
  height: 420px;
  overflow-y: auto;
  padding: 8px 12px;
  background: #fff;
}
.product-desc-left .w-e-toolbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 5;
  background: #faf9f5 !important;
  border-bottom: 1px solid var(--border) !important;
  margin: 0 !important;
}
.product-desc-left .w-e-text-container {
  height: calc(100% - 0px) !important;
  min-height: 380px !important;
  overflow-y: auto !important;
}
.product-desc-right {
  flex: 1 1 40%;
  display: flex;
  flex-direction: column;
  border: 1px dashed #b4b2a9;
  border-radius: 8px;
  background: #faf9f5;
  padding: 10px;
  min-width: 0;
}
.product-desc-preview-title {
  text-align: center;
  font-size: 12px;
  color: #888780;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.product-desc-preview-phone {
  flex: 1 1 auto;
  background: #fff;
  border-radius: 12px;
  padding: 14px 12px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
  color: #2a2926;
  word-break: break-word;
  box-shadow: inset 0 0 0 1px #ece9df;
  min-height: 420px;
  max-height: 420px;
}
.product-desc-preview-phone img,
.product-desc-preview-phone video {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  margin: 8px auto;
}
.product-desc-preview-phone p { margin: 6px 0; }
.product-desc-preview-phone h1,
.product-desc-preview-phone h2,
.product-desc-preview-phone h3 { margin: 10px 0 6px; }
.product-desc-preview-empty {
  text-align: center;
  color: #b4b2a9;
  font-size: 12px;
  padding: 60px 10px;
}
/* 小屏：左右分栏自动堆叠 */
@media (max-width: 900px) {
  .product-desc-split { flex-direction: column; }
  .product-desc-right { min-height: 260px; }
}