/* ============================================================
   棒苹果 · 管理端样式（与用户端同一视觉体系）
   ============================================================ */
:root {
  --nav-bg: rgba(51, 51, 51, 0.9);
  --gold: #d7bf91;
  --gold-bright: #d9b33a;
  --gold-light: #dcc69c;
  --gold-grad: linear-gradient(180deg, #ebd298 0%, #dcc69c 100%);
  --gold-grad-hover: linear-gradient(180deg, #fbecc9 0%, #f1e1b9 100%);
  --beige: #ebe6dd;
  --beige-border: #dfd0b1;
  --tan: #b8a688;
  --text-1: #333333;
  --text-2: #474747;
  --text-3: #666666;
  --text-4: #999999;
  --line-1: #e8e8e8;
  --line-2: #eaeaea;
  --line-3: #d6d6d6;
  --red: #d9363e;
  --red-light: #ff4d4f;
  --green: #389e0d;
  --blue: #096dd9;
  --orange: #d46b08;
  --radius: 4px;
  --shadow: 0 1px 6px 2px rgba(0, 0, 0, 0.05);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text-1);
  background: #f5f5f5;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select {
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--line-3);
  border-radius: 4px;
  padding: 7px 10px;
  outline: none;
  background: #fff;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, #3a3a3a 0%, #4a4438 60%, #6b5d40 100%);
}
.login-card {
  width: 380px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  padding: 36px 34px 30px;
  text-align: center;
}
.login-card .login-logo {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  background: #fff;
}
.login-card h2 { font-size: 19px; margin-bottom: 4px; }
.login-card p.sub { font-size: 12px; color: var(--text-4); margin-bottom: 22px; }
.login-card .field { text-align: left; margin-bottom: 14px; }
.login-card label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; }
.login-card input { width: 100%; padding: 10px 12px; }
.login-card .err { color: var(--red); font-size: 12px; margin-top: 8px; min-height: 18px; }
.gold-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--gold-grad);
  color: #424242 !important;
  font-size: 14px;
  font-weight: bold;
  border: none;
  border-radius: 2px;
  padding: 9px 24px;
  transition: background 0.3s;
}
.gold-btn:hover { background: var(--gold-grad-hover); }
.gold-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.gold-btn.small { padding: 5px 12px; font-size: 13px; }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px;
  color: var(--text-3);
  border: 1px solid var(--line-3);
  border-radius: 2px;
  background: #fff;
  padding: 5px 12px;
  transition: all 0.3s;
}
.ghost-btn:hover { color: var(--gold); border-color: var(--gold); }
.danger-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px;
  color: var(--red);
  border: 1px solid #f0c4c4;
  border-radius: 2px;
  background: #fff;
  padding: 5px 12px;
  transition: all 0.3s;
}
.danger-btn:hover { background: #fff1f0; border-color: var(--red-light); }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; flex: none;
  background: #2e2e2e;
  color: #b5b5b5;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 1px;
  border-bottom: 1px solid #444;
}
.sidebar .brand .mark-img {
  width: 32px; height: 32px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  background: #fff;
  flex: none;
}
.sidebar .brand small { display: block; font-size: 11px; color: var(--gold-light); font-weight: normal; letter-spacing: 1px; }
.sidebar nav { flex: 1; padding: 12px 0; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 22px;
  font-size: 14px;
  color: #b5b5b5;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover { color: var(--gold); background: #3a3a3a; }
.sidebar nav a.active {
  color: var(--gold);
  font-weight: bold;
  background: #3a3a3a;
  border-left-color: var(--gold);
}
.sidebar .side-foot { padding: 14px 18px; border-top: 1px solid #444; font-size: 12px; color: #777; }
.sidebar .side-foot a { color: #999; }
.sidebar .side-foot a:hover { color: var(--gold); }

.main {
  flex: 1;
  margin-left: 210px;
  padding: 24px 28px 40px;
}
.main-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.main-head h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.main-head .today { font-size: 13px; color: var(--text-4); }

/* ---------- 卡片 / 表格 ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line-1);
  border-radius: 6px;
  padding: 20px 22px;
  margin-bottom: 18px;
}
.card h3 {
  font-size: 15px;
  color: var(--text-2);
  border-bottom: 2px solid var(--text-2);
  padding-bottom: 10px;
  margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.card h3 small { font-size: 12px; color: var(--text-4); font-weight: normal; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--line-1);
  border-radius: 6px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gold-grad); }
.stat-card .num { font-size: 30px; font-weight: bold; color: var(--text-1); line-height: 1.2; }
.stat-card .label { font-size: 13px; color: var(--text-4); }
.stat-card.accent .num { color: var(--red); }
.stat-card.blue .num { color: var(--blue); }
.stat-card.green .num { color: var(--green); }
.stat-card.orange .num { color: var(--orange); }

.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar input[type="date"] { width: 150px; }
.filter-bar select { min-width: 120px; }
.filter-bar .spacer { flex: 1; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left;
  padding: 10px 12px;
  background: #fafafa;
  color: var(--text-3);
  font-weight: bold;
  border-bottom: 1px solid var(--line-1);
  white-space: nowrap;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:hover td { background: #fcfaf5; }
.tbl .code { font-weight: bold; color: var(--gold-bright); letter-spacing: 1px; }
.tbl .price-edit { width: 70px; text-align: right; }
.tbl .ops { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-tip { text-align: center; color: var(--text-4); padding: 30px 0; font-size: 13px; }

.status-pill {
  display: inline-block;
  font-size: 12px;
  border-radius: 10px;
  padding: 2px 10px;
  font-weight: bold;
  white-space: nowrap;
}
.status-pill.pending { background: #fff7e6; color: var(--orange); border: 1px solid #ffd591; }
.status-pill.confirmed { background: #e6f7ff; color: var(--blue); border: 1px solid #91d5ff; }
.status-pill.done { background: #f6ffed; color: var(--green); border: 1px solid #b7eb8f; }
.status-pill.cancelled { background: #fff1f0; color: var(--red); border: 1px solid #ffa39e; }

/* ---------- 日历管理 ---------- */
.cal-layout { display: flex; gap: 18px; align-items: flex-start; }
.cal-main { flex: 1; }
.cal-head { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 12px; }
.cal-head b { font-size: 16px; min-width: 110px; text-align: center; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; margin-bottom: 6px; }
.cal-week span { font-size: 13px; color: var(--text-4); padding: 5px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.adm-cell {
  min-height: 58px;
  border-radius: 4px;
  border: 1px solid var(--line-1);
  background: #fff;
  padding: 4px 6px;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.adm-cell:hover { border-color: var(--gold); }
.adm-cell.open { background: var(--beige); border-color: var(--beige-border); font-weight: bold; }
.adm-cell.today { border-color: var(--red-light); border-style: dashed; }
.adm-cell .d { display: flex; justify-content: space-between; align-items: center; }
.adm-cell .ev { font-size: 11px; color: var(--gold-bright); background: #fdfaf3; border-radius: 2px; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-cell .note { font-size: 10px; color: var(--text-4); }
.cal-side { width: 300px; flex: none; }
.cal-side .event-item {
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 13px;
  display: flex; justify-content: space-between; gap: 8px; align-items: flex-start;
}
.cal-side .event-item .del { color: var(--red-light); cursor: pointer; background: none; border: none; font-size: 14px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; }
.form-row input, .form-row textarea { width: 100%; }
.form-row textarea { resize: vertical; min-height: 90px; }
.form-row .hint { font-size: 12px; color: var(--text-4); margin-top: 3px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* 项目编辑 · 券种行 */
.ticket-row { display: grid; grid-template-columns: 1fr 90px 1fr; gap: 8px; margin-bottom: 8px; }

/* 往期活动 · 图片上传网格 */
.up-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.up-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line-1);
  background: #fafafa;
}
.up-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-item .up-del {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  line-height: 22px;
  text-align: center;
}
.up-item .up-del:hover { background: var(--red-light); }
.up-add {
  aspect-ratio: 4 / 3;
  border: 1.5px dashed var(--line-3);
  border-radius: 6px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-4);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}
.up-add:hover { border-color: var(--gold); color: var(--gold); }

/* 顶部横幅 · 列表预览缩略图 */
.bn-thumb {
  width: 100px; height: 50px;
  border-radius: 4px;
  display: flex; align-items: center;
  padding: 0 8px;
  color: #fff;
  font-size: 10px;
  overflow: hidden;
  white-space: nowrap;
}
.bn-thumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-thumb.slide-1 { background: linear-gradient(120deg, #3a3a3a 0%, #55524a 60%, #8a7a55 100%); }
.bn-thumb.slide-2 { background: linear-gradient(120deg, #4a2f3a 0%, #6d3a4a 55%, #b08a4f 100%); }
.bn-thumb.slide-3 { background: linear-gradient(120deg, #3c3f2f 0%, #5c5a37 60%, #a8945a 100%); }
.banner-img-box img { width: 100%; max-height: 160px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line-1); display: block; margin-bottom: 8px; }

/* 刻蚀章 · 列表预览缩略图（棋盘格底显示透明） */
.seal-thumb {
  width: 48px; height: 48px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line-1);
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.seal-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* 海报 · 列表预览缩略图 */
.poster-thumb {
  width: 72px; height: 96px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line-1);
  background: var(--beige);
  flex: none;
}
.poster-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 横幅取景框：拖动图片确定展示区域 */
.bn-crop-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1160 / 230;
  border-radius: 8px;
  overflow: hidden;
  background: #333;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.bn-crop-frame:active { cursor: grabbing; }
.bn-crop-frame img {
  position: absolute;
  top: 0; left: 0;
  width: 150%;
  height: auto;
  max-width: none;
  pointer-events: none;
  display: block;
}
.bn-crop-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.bn-crop-controls input[type="range"] { flex: 1; min-width: 100px; padding: 0; }

/* 手机端底部标签栏可横向滚动（项目多时） */
.mobile-tabs { overflow-x: auto; }
.mobile-tabs a { flex: 1 0 52px; min-width: 52px; }

@media screen and (max-width: 640px) {
  .ticket-row { grid-template-columns: 1fr 76px; }
  .ticket-row .tr-note { grid-column: 1 / -1; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- 提示 ---------- */
.toast-wrap {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: rgba(51, 51, 51, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 9px 20px;
  border-radius: 4px;
  animation: tIn 0.25s ease;
}
.toast.error { background: rgba(180, 50, 50, 0.95); }
.toast.ok { background: rgba(46, 125, 50, 0.95); }
@keyframes tIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px;
  overflow-y: auto;
}
.modal-mask.show { display: flex; }
.modal {
  width: 420px; max-width: 100%;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.modal-head h4 { font-size: 15px; }
.modal-head .close { margin-left: auto; border: none; background: none; font-size: 16px; color: var(--text-4); }
.modal-body { padding: 16px 18px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 扫码核销 ---------- */
.scanner-wrap { display: flex; gap: 18px; }
.scanner-video-wrap {
  flex: 1;
  position: relative;
  min-height: 300px;
  border-radius: 6px;
  overflow: hidden;
  background: #222;
  display: flex; align-items: center; justify-content: center;
}
.scanner-video-wrap video { width: 100%; height: 100%; min-height: 300px; object-fit: cover; display: block; }
/* HTTP 环境内嵌的 HTTPS 安全扫码窗 */
.scan-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; background: #222; }
.scan-cover {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: #888; font-size: 13px; text-align: center; line-height: 1.8;
  background: rgba(34, 34, 34, 0.85);
}
.scan-cover b { font-size: 44px; display: block; }
.scan-frame {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.scan-frame span {
  width: 62%; height: 52%;
  border: 2px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  animation: scanPulse 1.6s ease-in-out infinite;
}
@keyframes scanPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.scanner-side {
  width: 260px; flex: none;
  display: flex; flex-direction: column; gap: 10px;
}
.scanner-side input { width: 100%; padding: 10px 12px; font-size: 14px; }
.scan-divider { display: flex; align-items: center; gap: 10px; color: #999; font-size: 12px; }
.scan-divider::before, .scan-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.scan-tip { font-size: 12px; color: var(--text-4); line-height: 1.8; }

.scan-result {
  margin-top: 16px;
  border: 1px solid var(--beige-border);
  background: #fdfaf3;
  border-radius: 6px;
  padding: 16px 18px;
}
.scan-result.err { background: #fff1f0; border-color: #ffa39e; display: flex; gap: 12px; align-items: center; }
.scan-error-banner {
  background: #fff1f0;
  border: 1px solid #ffa39e;
  color: #cf1322;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 10px;
}
.scan-result.done { background: #f6ffed; border-color: #b7eb8f; }
.scan-result.cancelled { background: #fff1f0; border-color: #ffa39e; }
.scan-result .r-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.scan-result .r-ico { font-size: 34px; }
.scan-result .r-title { display: flex; flex-direction: column; gap: 4px; }
.scan-result .r-code { font-size: 20px; font-weight: bold; letter-spacing: 2px; color: var(--gold-bright); }
.scan-actions { display: flex; gap: 10px; margin-top: 14px; }

.pay-row { margin-top: 12px; }
.pay-btns { display: flex; gap: 10px; margin-top: 8px; }
.pay-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  transition: transform 0.2s, filter 0.2s;
}
.pay-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.pay-btn small { font-size: 11px; font-weight: normal; opacity: 0.85; }
.pay-btn .pay-logo {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: bold;
}
.pay-btn.alipay { background: #1677ff; }
.pay-btn.alipay .pay-logo { color: #1677ff; }
.pay-btn.wechat { background: #07c160; }
.pay-btn.wechat .pay-logo { color: #07c160; }

/* ---------- 活动停用态 / 设备 ---------- */
.event-item.off { opacity: 0.62; background: #fafafa; }
.event-item .ev-ops { display: flex; gap: 6px; align-items: center; flex: none; }
.event-item .ev-ops .ghost-btn { padding: 3px 9px; font-size: 12px; }
.device-item .ops { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 手机端：底部标签栏 ---------- */
.mobile-tabs {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 58px;
  background: #2e2e2e;
  z-index: 500;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.25);
}
.mobile-tabs a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #b5b5b5;
  font-size: 10px;
  border-top: 2px solid transparent;
  -webkit-tap-highlight-color: transparent;
}
.mobile-tabs a .ti { font-size: 20px; line-height: 1.2; }
.mobile-tabs a .tt { white-space: nowrap; }
.mobile-tabs a.active { color: var(--gold); border-top-color: var(--gold); font-weight: bold; }

/* ---------- 手机端：订单 / 设备卡片 ---------- */
.bk-card, .dev-card {
  background: #fff;
  border: 1px solid var(--line-1);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}
.bk-card .bk-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 8px;
}
.bk-card .bk-head .code { font-size: 16px; font-weight: bold; color: var(--gold-bright); letter-spacing: 1px; }
.bk-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; }
.bk-row span { color: var(--text-4); flex: none; }
.bk-row b { text-align: right; font-weight: normal; color: var(--text-1); word-break: break-all; }
.bk-row b.red { color: var(--red); font-weight: bold; }
.bk-ops { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.bk-ops button { flex: 1; min-width: 84px; justify-content: center; padding: 9px 6px; font-size: 13px; }
.dev-card.off { opacity: 0.62; }
.dev-card .d-head { display: flex; align-items: center; gap: 10px; }
.dev-card .d-ico { font-size: 26px; }
.dev-card .d-head b { flex: 1; font-size: 15px; }
.dev-card .d-from { font-size: 12px; color: var(--text-4); margin: 8px 0 2px; }
.dev-card .d-ops { display: flex; gap: 8px; margin-top: 10px; }
.dev-card .d-ops button { flex: 1; justify-content: center; padding: 9px 6px; font-size: 13px; }

/* ---------- 手机端适配 ---------- */
@media screen and (max-width: 900px) {
  .sidebar { width: 64px; }
  .sidebar .brand span.txt, .sidebar nav a span.txt, .sidebar .side-foot { display: none; }
  .sidebar nav a { justify-content: center; padding: 13px 0; }
  .main { margin-left: 64px; padding: 16px 12px 60px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cal-layout { flex-direction: column; }
  .cal-side { width: 100%; }
  .scanner-wrap { flex-direction: column; }
  .scanner-side { width: 100%; }
  .scanner-video-wrap { min-height: 240px; }
  .scanner-video-wrap video { min-height: 240px; }
  .main-head h2 { font-size: 17px; }
  .main-head .today { display: none; }
  .tbl { font-size: 12px; }
  .tbl th, .tbl td { padding: 8px 6px; }
  .login-wrap { padding: 16px; }
}

@media screen and (max-width: 640px) {
  /* 侧栏隐藏，改用底部标签栏 */
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 0 0 76px; }
  .mobile-tabs { display: flex; }
  .main-head {
    position: sticky; top: 0; z-index: 50;
    background: #f5f5f5;
    margin: 0 0 10px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  }
  .main-head h2 { font-size: 16px; }
  .card { padding: 14px; margin: 0 10px 12px; border-radius: 8px; }
  .stats-grid { margin: 0 10px 12px; }
  .stat-card { padding: 14px; }
  .stat-card .num { font-size: 24px; }

  .filter-bar > * { flex: 1 1 42%; min-width: 0; }
  .filter-bar input[type="date"], .filter-bar select { width: 100%; }
  .filter-bar .spacer { display: none; }

  .cal-head b { font-size: 14px; }
  .adm-cell { min-height: 46px; padding: 3px 4px; font-size: 12px; }
  .adm-cell .note { display: none; }

  .scanner-video-wrap { min-height: 210px; }
  .scanner-video-wrap video { min-height: 210px; }
  .scan-frame span { width: 70%; height: 55%; }
  .scan-actions { flex-direction: column; }
  .scan-actions button { width: 100%; justify-content: center; padding: 12px 0; font-size: 15px; }
  .pay-btns { flex-direction: row; }
  .login-card { width: 100%; padding: 28px 22px 24px; }
}
