/* ============ 18 楼共享层预定系统 · 浅色版 ============ */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --panel: #ffffff;
  --ink: #16233a;
  --ink-2: #3d4d63;
  --muted: #7a8aa0;
  --line: #e6ebf2;
  --line-strong: #d5dde8;
  --accent: #2f6fed;
  --accent-dark: #1d58cf;
  --accent-soft: #eef4ff;
  --green: #0e9f6e;
  --green-soft: #e9f8f1;
  --amber: #b26a00;
  --amber-soft: #fdf4e5;
  --blue: #1a63c9;
  --blue-soft: #eaf1fe;
  --slate: #5f6f86;
  --slate-soft: #eff2f7;
  --red: #d64550;
  --red-soft: #fdeff0;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 10px 24px rgba(20, 40, 80, 0.08);
  --shadow-lift: 0 2px 4px rgba(16, 24, 40, 0.06), 0 18px 36px rgba(20, 40, 80, 0.13);

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;

  --gutter: 28px;
  --page-max: 1360px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--s5);
  height: var(--topbar-h);
  padding: 0 max(var(--gutter), calc((100vw - var(--page-max)) / 2 + var(--gutter)));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  flex: none;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 200px;
  height: auto;
}

.brand-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--ink-2);
  line-height: 1.2;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: var(--s1);
  padding: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  flex: none;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13.5px;
  padding: 7px 16px;
  border-radius: 7px;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); background: rgba(47, 111, 237, 0.06); }
.tab.active {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(29, 88, 207, 0.24);
}

.statusbar { margin-left: auto; display: flex; align-items: center; gap: var(--s4); flex: none; }

.conn { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.conn i { width: 7px; height: 7px; border-radius: 50%; background: #b6c0cd; }
.conn.ok i { background: var(--green); }
.conn.bad i { background: var(--red); }
.conn b { font-weight: 600; }

.server-clock {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

--mono-placeholder { }
main { position: relative; max-width: var(--page-max); margin: 0 auto; padding: var(--s6) var(--gutter) var(--s8); }

.view { display: none; }
.view.active { display: block; }

/* ---------- 通用组件 ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 0.2px; color: var(--ink); }
.panel-head p { margin: var(--s1) 0 0; font-size: 12.5px; line-height: 1.6; }

.muted { color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.btn:hover {
  color: var(--ink);
  border-color: #b9c8dc;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid rgba(47, 111, 237, 0.35); outline-offset: 1px; }
.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.danger { border-color: #e6b4b8; background: #fff; color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.danger-ghost { border-color: #edd3d6; background: #fff; color: #b4535c; }
.btn.danger-ghost:hover { background: var(--red-soft); border-color: #e6b4b8; }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 6px; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1;
  transition: all 0.16s ease;
}
.icon-btn:hover { color: var(--ink); border-color: #b9c8dc; background: var(--bg-soft); }

.control {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink);
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  color-scheme: light;
}
.control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12); }
.control::placeholder { color: #9aa8ba; }

/* ---------- 房态看板 ---------- */

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.state-filters { display: flex; gap: var(--s2); flex-wrap: wrap; }

.fchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 0 13px;
  height: 34px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.16s ease;
}
.fchip em {
  font-style: normal;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 1px 7px;
}
.fchip:hover { border-color: #c3d2e4; color: var(--ink); }
.fchip.active {
  background: var(--accent-soft);
  border-color: #bfd4fb;
  color: var(--accent-dark);
}
.fchip.active em { color: var(--accent-dark); background: #dde9ff; }

.board-tools { display: flex; gap: var(--s2); }
.board-tools .control { width: 205px; }

.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: var(--s4);
}

/* 状态色板：空闲=中性灰白 / 已预定=琥珀 / 使用中=青绿 / 即将结束=橙 / 超时=红 / 已结束=灰 */
.room-card {
  --state-color: #98a4b5;
  --state-tint: #f2f4f8;
  --state-ink: #5f6f86;
  --state-line: #dde3ec;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #ffffff;
  border: 1px solid var(--state-line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 #ffffff, var(--shadow);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  will-change: transform;
  animation: fadeUp 0.32s ease both;
}
.state-free {
  --state-color: #a9b5c5;
  --state-tint: #f7f8fa;
  --state-ink: #475467;
  --state-line: #e1e6ee;
}
.state-booked {
  --state-color: #d59b2a;
  --state-tint: #fdf4e5;
  --state-ink: #8a5300;
  --state-line: #f0dcb6;
}
.state-using {
  --state-color: #0f9f8f;
  --state-tint: #e7f7f4;
  --state-ink: #04756a;
  --state-line: #b9e3dc;
}
.state-ending {
  --state-color: #e07a1f;
  --state-tint: #fff1e4;
  --state-ink: #9a4d00;
  --state-line: #f3cdaa;
}
.state-overtime {
  --state-color: #d64550;
  --state-tint: #fdeff0;
  --state-ink: #b02a35;
  --state-line: #efbcc1;
}
.state-ended {
  --state-color: #98a4b5;
  --state-tint: #f2f4f8;
  --state-ink: #5f6f86;
  --state-line: #dde3ec;
}

/* 卡片错峰入场 */
.room-card:nth-child(1) { animation-delay: 0.04s; }
.room-card:nth-child(2) { animation-delay: 0.09s; }
.room-card:nth-child(3) { animation-delay: 0.14s; }
.room-card:nth-child(4) { animation-delay: 0.19s; }
.room-card:nth-child(5) { animation-delay: 0.24s; }
.room-card:nth-child(6) { animation-delay: 0.29s; }
.room-card:nth-child(n + 7) { animation-delay: 0.32s; }

/* 状态色左边条（4px） */
.room-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  z-index: 3;
  background: var(--state-color);
  transition: background-color 0.25s ease;
}

.room-card:hover {
  transform: translateY(-2px);
  border-color: var(--state-line);
  box-shadow: inset 0 1px 0 #ffffff, var(--shadow-lift);
}

/* 图片区：固定 1:1 比例，裁切填充不变形，约占卡片 55%–60% */
.rc-media {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.rc-photo {
  position: absolute;
  inset: -6px;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(0.96);
  transform: scale(1.02) translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: transform 0.3s ease, filter 0.3s ease;
  box-shadow: inset 0 -28px 36px -30px rgba(16, 24, 40, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.room-card:hover .rc-photo { transform: scale(1.06) translate3d(var(--px, 0px), var(--py, 0px), 0); }

.room-card.no-photo .rc-photo {
  background-color: #eef2f8;
  background-image:
    repeating-linear-gradient(135deg, rgba(120, 145, 180, 0.1) 0 2px, transparent 2px 12px);
}

/* 状态徽标：白底浅色，清晰可辨 */

/* 信息区：固定顺序，等高排布 */
.rc-inner {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  flex: 1;
  padding: var(--s3) var(--s4) var(--s4);
}

.rc-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-width: 0; }
.rc-code {
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--ink);
  white-space: nowrap;
}
/* 名称固定两行高度，超出省略，不挤压下方信息 */
.rc-name {
  font-size: 13.5px;
  line-height: 17px;
  height: 34px;
  font-weight: 500;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}
/* 房间状态徽标跟随卡片状态色板；收款状态徽标保持独立配色 */
.badge-free, .badge-booked, .badge-using, .badge-ended,
.badge-ending, .badge-overtime {
  color: var(--state-ink);
  background: var(--state-tint);
  border-color: var(--state-line);
}
.badge-paid { color: var(--green); background: var(--green-soft); border-color: #c4e9d8; }
.badge-unpaid { color: var(--red); background: var(--red-soft); border-color: #f0ccd0; }

.rc-meta {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  gap: var(--s2);
  align-items: center;
  flex-wrap: nowrap;
  line-height: 1.4;
  min-width: 0;
  overflow: hidden;
}
.rc-meta > span { white-space: nowrap; }
.rc-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 0 1 auto; }
.rc-price-row { display: flex; justify-content: flex-end; margin-top: 4px; }
.rc-price {
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: normal;
  line-height: 1.4;
}
.rc-price small { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 1px; }

.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: #c5cfdb; flex: none; }

.rc-status { flex: 1; min-height: 92px; display: flex; flex-direction: column; gap: var(--s2); overflow: hidden; }

.info-rows { display: flex; flex-direction: column; gap: 6px; }
.info-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); font-size: 12.5px; line-height: 18px; }
.info-row span { color: var(--muted); flex: none; }
.info-row b {
  font-weight: 600;
  color: var(--ink-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  max-width: 64%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-line { font-size: 12px; line-height: 18px; color: var(--muted); }
.state-line.ok { color: var(--green); font-weight: 600; }
.state-line.warn { color: var(--red); font-weight: 600; }

/* 使用中计时进度（轻量，秒级刷新宽度） */
.rc-progress {
  height: 4px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
}
.rc-progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--blue);
  transition: width 1s linear, background 0.2s ease;
}
.rc-progress.is-over > span { background: var(--red); }

/* 状态切换：一次轻扫高光 + 徽标切换，克制不刺眼 */
.room-card.state-changed::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 46%;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-120%);
  animation: stateSweep 0.5s ease-out both;
}
.state-changed .badge { animation: badgeFlip 0.45s ease both; }
@keyframes stateSweep {
  from { transform: translateX(-120%); }
  to { transform: translateX(320%); }
}
@keyframes badgeFlip {
  0% { transform: rotateX(0); opacity: 0.4; }
  55% { transform: rotateX(88deg); opacity: 0.7; }
  100% { transform: rotateX(0); opacity: 1; }
}

.bill-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 6px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 16px;
}
.bill-mini .muted { color: var(--muted); }
.bill-mini .amount {
  font-size: 15px;
  line-height: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.rc-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto; }
.rc-actions .btn { flex: 1 1 auto; }

/* 卡片底部固定操作条：开始使用 / 赠送时长 文案与位置统一，任何状态下都保留 */
.rc-fixed-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
  flex: none;
  margin-top: var(--s2);
  padding-top: var(--s2);
  padding-bottom: 2px;
  border-top: 1px dashed rgba(120, 145, 180, 0.28);
  position: relative;
  z-index: 5;
  background: #ffffff;
}
.rc-fixed-actions .btn { width: 100%; justify-content: center; white-space: nowrap; }
/* 不可用时不靠透明度隐藏，改用浅底+清晰文字，保证按钮始终看得见 */
.rc-fixed-actions .btn:disabled,
.rc-fixed-actions .btn:disabled:hover {
  opacity: 1;
  color: #6b7c93;
  background: #f1f4f9;
  border-color: #dfe5ee;
}

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 56px var(--s5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--ink-2);
  text-align: center;
}
.empty-state strong { font-size: 15px; color: var(--ink); }
.empty-state p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- 账目统计 ---------- */

.stats-panel { margin-bottom: var(--s4); padding: var(--s4) var(--s5) var(--s5); }
.stats-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s4); }

.dim-tabs { display: flex; gap: var(--s1); padding: 3px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 9px; }
.dim-tabs button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  transition: all 0.16s ease;
}
.dim-tabs button:hover { color: var(--ink); }
.dim-tabs button.active {
  color: var(--accent-dark);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.period-nav { display: flex; align-items: center; gap: var(--s2); }
.period-nav .control { min-width: 158px; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.stat-card {
  padding: var(--s3) var(--s4);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  animation: fadeUp 0.3s ease both;
}
.stat-card:nth-child(1) { animation-delay: 0.03s; }
.stat-card:nth-child(2) { animation-delay: 0.07s; }
.stat-card:nth-child(3) { animation-delay: 0.11s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }
.stat-card span { display: block; font-size: 12px; color: var(--muted); letter-spacing: 0.2px; }
.stat-card b {
  display: block;
  margin-top: var(--s1);
  font-size: 23px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.2;
}
.stat-card em { display: block; margin-top: var(--s1); font-style: normal; font-size: 11.5px; color: var(--muted); }

.chart-row { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--s4); }
.chart-box {
  padding: var(--s3);
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--line);
}
.chart-title { font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: var(--s3); }

.trend { display: flex; align-items: flex-end; gap: 5px; height: 150px; }
.trend-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; }
.trend-bar-wrap { position: relative; flex: 1; width: 100%; display: flex; align-items: flex-end; }
.trend-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #6f9df5, var(--accent));
  transform-origin: bottom;
  animation: growY 0.45s ease both;
  min-height: 2px;
}
.trend-x { font-size: 10.5px; color: var(--muted); margin-top: 6px; white-space: nowrap; }

.share-list { display: flex; flex-direction: column; gap: 11px; }
.share-row { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: var(--s2); font-size: 12.5px; }
.share-name { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-track { height: 7px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.share-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transform-origin: left;
  animation: growX 0.5s ease both;
}
.share-val {
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  white-space: nowrap;
}
.share-val em { font-style: normal; color: var(--muted); margin-left: 6px; font-size: 11.5px; }

.ledger-panel { margin-top: var(--s4); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: flex-end;
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--line);
}
.filter-item { display: flex; flex-direction: column; gap: 5px; }
.filter-item span { font-size: 11.5px; color: var(--muted); }
.filter-item .control { min-width: 118px; }
.filter-actions { display: flex; gap: var(--s2); margin-left: auto; }

/* ---------- 表格 ---------- */

.table-wrap { overflow: auto; max-height: 560px; }
.table-wrap table, .cfg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cfg-table { min-width: 1080px; }

.table-wrap th, .cfg-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 40px;
  text-align: left;
  padding: 0 var(--s3);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.2px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table-wrap td, .cfg-table td {
  height: 46px;
  padding: 0 var(--s3);
  border-bottom: 1px solid #eef2f7;
  color: var(--ink-2);
  vertical-align: middle;
}
.table-wrap tr:hover td { background: #fafcff; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }

.num, .col-num, .amount-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.num, th.num, .col-num { text-align: right; }
.total { font-weight: 700; color: var(--ink); }
.bill-cell { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.cell-sub { display: block; font-size: 11px; color: var(--muted); margin-top: -1px; }
.col-code { font-weight: 600; color: var(--ink); white-space: nowrap; }
.col-name, .col-type, .col-note { color: var(--ink-2); }
.col-actions { width: 84px; text-align: right; }
.table-empty { padding: 44px var(--s4); text-align: center; color: var(--muted); font-size: 13px; }

.cfg-table input, .cfg-table select { width: 100%; min-width: 0; height: 30px; padding: 0 8px; font-size: 12.5px; }
.cfg-table .control { height: 30px; padding: 0 8px; font-size: 12.5px; }
/* 统一列宽：数字列右对齐，单位写在表头第二行，操作列固定宽度；窄屏横向滚动不压缩 */
.cfg-table { table-layout: fixed; min-width: 1330px; }
.cfg-table caption.cfg-floor {
  caption-side: top;
  text-align: left;
  padding: 0 0 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.cfg-table th { height: 46px; vertical-align: middle; }
.cfg-table th .th-unit { display: block; font-size: 10.5px; font-weight: 400; color: var(--muted); line-height: 1.3; }
.cfg-table th.col-num { text-align: right; }
.cfg-table th.col-num .th-unit { text-align: right; }
.cfg-table th.col-name { width: 110px; }
.cfg-table th.col-code { width: 84px; }
.cfg-table th.col-type { width: 96px; }
.cfg-table th.col-cap { width: 78px; }
.cfg-table th.col-money { width: 88px; }
.cfg-table th.col-state { width: 70px; }
.cfg-table th.col-period { width: 230px; }
.cfg-table th.col-min { width: 58px; }
.cfg-table th.col-note { width: 176px; }
.cfg-table th.col-actions { width: 84px; text-align: right; }
.cfg-table input, .cfg-table select, .cfg-table textarea { box-sizing: border-box; }
.cfg-table .col-type select { font-size: 12px; padding: 0 4px; }
.cfg-table .col-money input, .cfg-table .col-min input { text-align: right; font-variant-numeric: tabular-nums; }
.cfg-table .col-money input { font-size: 12px; padding: 0 4px; }
.cfg-table .col-note textarea {
  display: block;
  width: 100%;
  height: 38px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-2);
  font: 11.5px/1.4 inherit;
  font-family: inherit;
  resize: none;
  overflow: hidden;
}
.cfg-table td.col-note { height: auto; padding-top: 4px; padding-bottom: 4px; }
.cfg-table input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.cfg-table input[type="number"]::-webkit-inner-spin-button,
.cfg-table input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cfg-table .col-state .badge { white-space: nowrap; }
.cfg-table .period-line { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.cfg-table .period-line + .period-line { margin-top: 3px; }
.cfg-table .period-line > span { flex: none; width: 26px; font-size: 11.5px; color: var(--muted); }
.cfg-table .period-line input[type="time"] { width: 84px; min-width: 0; padding: 0 4px; }
.cfg-table td.col-actions { padding: 0 8px; white-space: nowrap; }
.cfg-table td.col-note input { padding: 0 6px; }
.del-btn {
  border: 1px solid #edd3d6;
  background: #fff;
  color: #b4535c;
  border-radius: 6px;
  padding: 0 9px;
  height: 30px;
  font-size: 12px;
  transition: all 0.16s ease;
}
.del-btn:hover { border-color: #e0b3b8; background: var(--red-soft); }

.rooms-head-text { max-width: 640px; }
.rooms-head-text h2 { margin: 0; }
.head-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* ---------- 表单 / 弹层 ---------- */

.form { display: flex; flex-direction: column; gap: var(--s4); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); }
.field > span em { font-style: normal; color: var(--red); }
.field .control { width: 100%; }
.field .control[readonly], .readonly {
  min-height: 36px;
  display: flex;
  align-items: center;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 13px;
}
.hint-text { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin: 0; }
.error-text { font-size: 12.5px; color: var(--red); min-height: 16px; margin: 0; }

.seg { display: flex; gap: var(--s1); background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; }
.seg-item {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item:has(input:checked) {
  color: var(--accent-dark);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s6);
  background: rgba(17, 26, 41, 0.42);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.modal-layer.show { opacity: 1; }

.modal {
  width: min(460px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 64px -24px rgba(16, 24, 40, 0.5);
  transform: scale(0.97) translateY(6px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.modal-layer.show .modal { transform: none; opacity: 1; }
.modal.wide { width: min(720px, 100%); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s5);
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 16px; color: var(--ink); }
.modal-head p { margin: 5px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.modal-body { padding: var(--s5); overflow: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s4); }
.confirm-text { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }

.bill-paper {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  padding: var(--s4);
}
.bill-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); padding-bottom: var(--s3); border-bottom: 1px dashed var(--line-strong); }
.bill-top h3 { margin: 0 0 4px; font-size: 15px; }
.bill-top p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.bill-lines { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3) 0; }
.bill-line { display: flex; justify-content: space-between; gap: var(--s3); font-size: 12.5px; color: var(--ink-2); }
.bill-line span { color: var(--muted); }
.bill-line b { font-variant-numeric: tabular-nums; }
.price-lock-note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); text-align: right; }
.bill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2) var(--s4); font-size: 12.5px; padding: var(--s3) 0; border-top: 1px dashed var(--line-strong); }
.bill-grid .bill-cell span { display: block; color: var(--muted); font-size: 11.5px; }
.bill-grid .bill-cell b { color: var(--ink-2); font-weight: 600; }
.bill-total { text-align: right; flex: none; }
.bill-total span { font-size: 12px; color: var(--muted); display: block; }
.bill-total b { font-size: 25px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

.pay-editor { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s4); }
.pay-row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.pay-row .control { min-width: 130px; }
.pay-hint { font-size: 11.5px; color: var(--muted); margin: 0; }

/* ---------- Toast ---------- */

#toast-host {
  position: fixed;
  z-index: 80;
  right: var(--s6);
  bottom: var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  pointer-events: none;
}
.toast {
  min-width: 210px;
  max-width: 360px;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  box-shadow: 0 12px 32px -18px rgba(16, 24, 40, 0.5);
  animation: toastIn 0.24s ease both;
}
.toast.ok { border-left-color: var(--green); }
.toast.err, .toast.error { border-left-color: var(--red); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity 0.24s ease, transform 0.24s ease; }

/* ---------- 入场与动效（轻量） ---------- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@keyframes growY {
  from { transform: scaleY(0); opacity: 0.5; }
  to { transform: scaleY(1); opacity: 1; }
}
@keyframes growX {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.brand { animation: riseIn 0.3s ease both; }
.tabs { animation: riseIn 0.3s 0.04s ease both; }
.statusbar { animation: riseIn 0.3s 0.08s ease both; }
.board-head { animation: riseIn 0.3s 0.06s ease both; }
.panel { animation: fadeUp 0.32s ease both; }

/* ---------- 响应式 ---------- */

@media (max-width: 1180px) {
  .brand-logo { width: 176px; }
  .chart-row { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  :root { --gutter: 20px; }
  .topbar { gap: var(--s4); }
  .brand-logo { width: 156px; }
  .brand-title { font-size: 10.5px; letter-spacing: 0.3px; }
  .tab { padding: 7px 12px; font-size: 13px; }
  .statusbar .conn { display: none; }
  main { padding-top: var(--s5); }
}

@media (max-width: 760px) {
  :root { --gutter: 14px; --topbar-h: 60px; }
  .topbar { gap: var(--s3); }
  .brand-logo { width: 128px; }
  .brand-title { font-size: 10px; letter-spacing: 0.1px; }
  .tab { padding: 7px 10px; font-size: 12.5px; }
  .statusbar { gap: var(--s2); }
  .statusbar .server-clock { display: none; }
  .room-grid { grid-template-columns: 1fr; }
  .board-tools { width: 100%; }
  .board-tools .control { flex: 1; width: auto; }
  .stat-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .filter-actions { margin-left: 0; }
  .filters { gap: var(--s2); }
  .filter-item { flex: 1 1 130px; }
  .filter-item .control { width: 100%; min-width: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .bill-top { flex-direction: column; }
  .bill-total { text-align: left; }
}

/* ---------- 降低动效偏好 ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  .room-card:hover .rc-photo { transform: none; }
  .trend-bar, .share-fill { animation: none; }
}

/* ============ 登录 / 用户 / 审批 / 自动化 ============ */

.hidden { display: none !important; }
body.auth-locked { overflow: hidden; }

.btn:disabled,
.btn:disabled:hover {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ---------- 登录页 ---------- */

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s6);
  overflow: auto;
  background:
    radial-gradient(1100px 520px at 18% -10%, #e9f0ff 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(900px 480px at 100% 100%, #f2f6fc 0%, rgba(255, 255, 255, 0) 58%),
    #ffffff;
}

.auth-card {
  width: min(1000px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 64px -32px rgba(20, 40, 80, 0.35), 0 1px 2px rgba(16, 24, 40, 0.05);
  overflow: hidden;
  animation: fadeUp 0.36s ease both;
}

.auth-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s8);
  padding: 44px 42px;
  background: linear-gradient(160deg, #f4f8ff 0%, #ffffff 72%);
  border-right: 1px solid var(--line);
}
.auth-logo { width: 224px; }
.auth-brand h1 { margin: 20px 0 8px; font-size: 22px; font-weight: 700; letter-spacing: 0.2px; }
.auth-brand > p { margin: 0; font-size: 13px; color: var(--muted); }

.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.auth-points li { position: relative; padding-left: 14px; display: flex; flex-direction: column; gap: 2px; }
.auth-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.45;
}
.auth-points b { font-size: 13px; color: var(--ink); }
.auth-points span { font-size: 12px; color: var(--muted); line-height: 1.6; }

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s5);
  padding: 44px 40px;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}
.auth-tabs button {
  flex: 1;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.16s ease;
}
.auth-tabs button.active {
  background: #ffffff;
  color: var(--accent-dark);
  box-shadow: 0 1px 3px rgba(20, 40, 80, 0.12);
}
#auth-form { display: flex; flex-direction: column; gap: var(--s3); }
#auth-form .field > span { font-size: 12.5px; }
#auth-form .control { height: 40px; }
.auth-submit { width: 100%; height: 42px; margin-top: var(--s1); }
.auth-hint { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.7; }

/* ---------- 用户区 ---------- */

.user-chip {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding-left: var(--s3);
  border-left: 1px solid var(--line);
}
.user-name { font-size: 13px; font-weight: 700; color: var(--ink); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role {
  font-size: 11.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}
#change-pwd-btn { font-size: 12px; letter-spacing: 1px; }
.user-chip .btn.sm { min-height: 30px; }

.tab-badge {
  font-style: normal;
  margin-left: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: var(--red);
}
.tab.active .tab-badge { background: #ffffff; color: var(--red); }

/* ---------- 顶部警示条 ---------- */

.alert-stack {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: min(720px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  pointer-events: none;
}
.alert-bar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 11px 14px;
  border-radius: 10px;
  background: #fffaf0;
  border: 1px solid #efd9ad;
  box-shadow: 0 14px 34px -20px rgba(120, 80, 0, 0.4);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: auto;
}
.alert-bar.show { opacity: 1; transform: none; }
.alert-icon {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(178, 106, 0, 0.14);
  animation: alertPulse 1.8s ease-in-out infinite;
}
.alert-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.alert-text b { font-size: 13.5px; color: #7a4a00; }
.alert-text span { font-size: 12.5px; color: var(--ink-2); }
.alert-close {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #e8d3ad;
  background: #ffffff;
  color: #8a6415;
  font-size: 12px;
  line-height: 1;
}
.alert-close:hover { background: #fff3dd; }

@keyframes alertPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(178, 106, 0, 0.12); }
  50% { box-shadow: 0 0 0 7px rgba(178, 106, 0, 0.03); }
}

/* ---------- 房间卡片：即将结束 / 超时 / 可入场 ---------- */

.room-card.state-ending {
  box-shadow: inset 0 1px 0 #ffffff, var(--shadow);
}
.badge-ending {
  animation: badgePulse 1.9s ease-in-out infinite;
}
.room-card.state-overtime {
  box-shadow: inset 0 1px 0 #ffffff, var(--shadow);
}
.state-line.ending { color: #9a4d00; font-weight: 600; }
.state-line.ending b { color: #9a4d00; font-variant-numeric: tabular-nums; }

.checkin-ready { animation: checkinPulse 1.8s ease-in-out infinite; }
@keyframes checkinPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 111, 237, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(47, 111, 237, 0); }
}
@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.66; }
}

/* 声音开关 */
.sound-chip { gap: 6px; }
.sound-chip .sound-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b6c0cd;
  flex: none;
}
.sound-chip.active { border-color: #bfd4fb; background: var(--accent-soft); color: var(--accent-dark); }
.sound-chip.active .sound-dot { background: var(--green); }
.sound-chip.unsupported { opacity: 0.72; }

/* ---------- 自动化配置 ---------- */

.automation-panel { margin-top: var(--s4); }
.automation-body { padding: var(--s5); }
.automation-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--s8); }
.auto-block h3 { margin: 0 0 var(--s3); font-size: 13.5px; font-weight: 700; color: var(--ink); }
.auto-block h3.auto-sub { margin-top: var(--s4); }
.auto-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: var(--s3); }
.auto-field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.auto-field .control { max-width: 220px; }
.auto-field em { font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.auto-info { display: flex; flex-direction: column; gap: 7px; padding: var(--s3); background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.auto-kv { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); font-size: 12.5px; }
.auto-kv span { color: var(--muted); flex: none; }
.auto-kv b { font-weight: 600; color: var(--ink-2); text-align: right; word-break: break-all; font-variant-numeric: tabular-nums; }
.auto-backups { display: flex; flex-direction: column; gap: 4px; }
.auto-backup-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: var(--muted); }
.auto-backup-row b { color: var(--ink-2); font-weight: 600; }
.auto-note { margin: var(--s4) 0 0; font-size: 11.5px; color: var(--muted); }

/* ---------- 审批中心 ---------- */

.approval-list { padding: var(--s4) var(--s5) var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.approval-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: var(--s3) var(--s4);
  background: #ffffff;
}
.approval-card.status-approved { border-left-color: var(--green); }
.approval-card.status-rejected { border-left-color: var(--red); }
.approval-card.status-failed { border-left-color: var(--red); background: #fffafa; }
.approval-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.approval-title { display: flex; align-items: center; gap: var(--s2); }
.approval-title b { font-size: 13.5px; color: var(--ink); }
.approval-meta { font-size: 12px; color: var(--muted); }
.approval-badge-pending { color: var(--amber); background: var(--amber-soft); border-color: #f0dcb6; }
.approval-badge-approved { color: var(--green); background: var(--green-soft); border-color: #c4e9d8; }
.approval-badge-rejected, .approval-badge-failed { color: var(--red); background: var(--red-soft); border-color: #f0ccd0; }
.approval-diff { list-style: none; margin: var(--s2) 0; padding: 0 0 0 var(--s3); border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.approval-diff li { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.approval-diff.compact { margin: 0 0 var(--s3); }
.approval-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; font-size: 12px; }
.approval-actions { display: flex; gap: var(--s2); align-items: center; }

/* 分控台：审批按钮置灰 + 明确提示，服务端另有 APPROVAL_MASTER_ONLY 强制校验 */
.approval-site-note {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  padding: 9px 12px;
  border: 1px solid #f0dcb6;
  background: var(--amber-soft);
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.6;
}
.approval-site-note b { color: var(--amber); }
.approval-locked-hint { font-size: 12px; color: var(--muted); }
.btn.is-locked {
  opacity: .5;
  filter: grayscale(1);
  cursor: not-allowed;
  box-shadow: none;
}
.btn.is-locked:hover { transform: none; }

/* ---------- 用户 / 审计 / 快照表格 ---------- */

.users-table { min-width: 760px; }
.audit-table { min-width: 920px; }
.snapshot-table { min-width: 640px; }
.audit-table .col-time { width: 136px; white-space: nowrap; }
.audit-table .col-target { width: 150px; word-break: break-all; }
.audit-table .col-detail { color: var(--muted); font-size: 12.5px; }
.users-table .col-actions { width: 190px; text-align: right; white-space: nowrap; }
.users-table .col-actions .btn + .btn { margin-left: var(--s1); }
.snapshot-panel { margin-top: var(--s4); }

/* ---------- 账单调整 ---------- */

.bill-adjust {
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px dashed var(--line-strong);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.bill-adjust-head { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; font-size: 12.5px; }
.bill-adjust-head b { font-size: 13px; color: var(--ink); }
.bill-adjust .bill-line.total { border-top: 1px dashed var(--line-strong); padding-top: var(--s2); margin-top: 2px; font-weight: 700; }
.adjust-form { display: grid; grid-template-columns: 150px 1fr auto; gap: var(--s2); align-items: center; }
.adjust-form .control { min-width: 0; }
.bill-adjust .hint-text { margin: 0; }

/* ---------- 经营分析卡片 ---------- */

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s3);
  padding: 0 var(--s5) var(--s5);
}
.analysis-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  padding: var(--s3) var(--s4);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.analysis-card span { font-size: 11.5px; color: var(--muted); }
.analysis-card b { font-size: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.3; }
.analysis-card b.small { font-size: 14px; }
.analysis-card em { font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.55; }

/* 文本域沿用控件样式 */
textarea.control { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.6; }

/* Toast 警示 */
.toast.warn { border-left-color: var(--amber); }

/* ---------- 新组件响应式 ---------- */

/* 宽屏放宽页面，房间价格表完整展开不横向滚动 */
@media (min-width: 1600px) {
  :root { --page-max: 1488px; }
}

@media (max-width: 1360px) {
  :root { --gutter: 22px; }
  .brand-logo { width: 168px; }
  .tab { padding: 7px 11px; font-size: 13px; }
  .user-role { display: none; }
}

@media (max-width: 1180px) {
  .tabs { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .statusbar { margin-left: 0; }
  .automation-grid { grid-template-columns: 1fr; gap: var(--s5); }
}

@media (max-width: 860px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-panel { padding: var(--s6) var(--s5); }
  .adjust-form { grid-template-columns: 1fr; }
  .alert-stack { top: 8px; }
}

@media (max-width: 760px) {
  .brand-logo { width: 132px; }
  .user-name { max-width: 76px; }
  .approval-list { padding: var(--s3); }
  .automation-body { padding: var(--s4); }
  .auto-field .control { max-width: none; }
}

/* ============ 1.1.0 新增：排期 / 主控 / 实时计费 / 提醒 ============ */

/* 离线提示 */
.offline-banner {
  position: sticky;
  top: var(--topbar-h);
  z-index: 29;
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 10px var(--gutter);
  background: var(--red-soft);
  border-bottom: 1px solid #f3c7ca;
  color: #8f1d26;
  font-size: 13px;
}
.offline-banner.hidden { display: none; }
.offline-banner b { font-weight: 600; }

/* 整屏闪烁提醒：改为右上角浮层，不遮挡表单与操作 */
.flash-layer {
  position: fixed;
  top: calc(var(--topbar-h) + 16px);
  right: 24px;
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  pointer-events: none;
}
.flash-layer.hidden { display: none; }
/* 有表单弹层时只做右上角提示，不显示整屏遮罩 */
.flash-layer:not(.is-full) .flash-bg { display: none; }
.flash-layer.is-full {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  background: rgba(16, 24, 40, 0.52);
}
/* 整屏闪烁边框：强化到点提醒的可见性 */
.flash-layer.is-full::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  border: 10px solid rgba(214, 69, 80, 0.7);
  animation: flashFrame 1.2s ease-in-out infinite;
}
@keyframes flashFrame {
  0%, 100% { border-color: rgba(214, 69, 80, 0.35); box-shadow: inset 0 0 0 0 rgba(214, 69, 80, 0); }
  50% { border-color: rgba(224, 122, 31, 0.9); box-shadow: inset 0 0 60px 10px rgba(214, 69, 80, 0.22); }
}
.flash-layer.is-full .flash-bg { pointer-events: auto; }
.flash-layer.is-full .flash-card { width: min(680px, 92vw); padding: 32px 36px 28px; border-top-width: 8px; }
.flash-layer.is-full .flash-card h2 { font-size: 30px; margin-bottom: var(--s3); }
.flash-layer.is-full .flash-room { font-size: 24px; margin-bottom: var(--s3); }
.flash-layer.is-full .flash-line { font-size: 16px; line-height: 1.7; margin-bottom: 6px; }
.flash-layer.is-full .flash-actions { margin-top: var(--s5); gap: var(--s3); }
.flash-layer.is-full .flash-actions .btn { height: 42px; padding: 0 22px; font-size: 15px; }
.flash-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: rgba(214, 69, 80, 0.10);
  animation: flashPulse 1.5s ease-in-out infinite;
}
@keyframes flashPulse {
  0%, 100% { opacity: 0.2; background: rgba(214, 69, 80, 0.10); }
  50% { opacity: 0.75; background: rgba(224, 122, 31, 0.24); }
}
.flash-card {
  position: relative;
  width: min(400px, calc(100vw - 48px));
  max-height: calc(100vh - var(--topbar-h) - 40px);
  overflow-y: auto;
  pointer-events: auto;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  border-top: 5px solid var(--amber);
  padding: var(--s5) var(--s5) var(--s4);
  animation: flashLift 0.26s ease-out;
}
@keyframes flashLift {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.flash-card h2 { margin: 0 0 var(--s2); font-size: 18px; }
.flash-card .flash-room { font-size: 16px; font-weight: 600; margin-bottom: var(--s2); }
.flash-card .flash-line { color: var(--ink-2); font-size: 13px; margin-bottom: var(--s1); }
.flash-card .flash-actions { margin-top: var(--s4); display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; }
.flash-card .flash-actions .btn.primary { background: var(--amber); border-color: var(--amber); }
@media (max-width: 1100px) {
  .flash-layer { left: 16px; right: 16px; justify-content: center; }
  .flash-card { width: 100%; }
}

/* 审批申请告警：整页居中弹窗 + 遮罩；有表单弹层时退到右上角 */
.approval-alert-layer {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 24, 40, 0.46);
  backdrop-filter: blur(2px);
  animation: approvalFade 0.2s ease-out;
}
.approval-alert-layer.compact {
  inset: auto;
  top: calc(var(--topbar-h) + 16px);
  right: 24px;
  background: transparent;
  backdrop-filter: none;
  align-items: flex-start;
  justify-content: flex-end;
}
@keyframes approvalFade { from { opacity: 0; } to { opacity: 1; } }
.approval-alert {
  width: min(520px, calc(100vw - 48px));
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  border-top: 6px solid var(--red);
  padding: var(--s5);
  animation: approvalLift 0.24s ease-out;
}
.approval-alert-layer.compact .approval-alert { width: min(420px, calc(100vw - 48px)); }
@keyframes approvalLift {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.approval-alert h2 { margin: 0 0 var(--s3); font-size: 18px; color: var(--red); }
.approval-alert-rows { display: grid; gap: var(--s2); }
.approval-alert-rows div { display: flex; gap: var(--s3); font-size: 14px; }
.approval-alert-rows span { flex: none; width: 76px; color: var(--muted); }
.approval-alert-rows b { color: var(--ink); font-weight: 600; }
.approval-alert-change {
  margin: var(--s3) 0 0;
  padding: var(--s2) var(--s3);
  background: var(--bg-soft);
  border-left: 3px solid var(--red);
  color: var(--ink-2);
  font-size: 13px;
  word-break: break-all;
}
.approval-alert-actions { margin-top: var(--s4); display: flex; gap: var(--s2); justify-content: flex-end; }
.approval-alert-actions .btn.primary { background: var(--red); border-color: var(--red); }

/* 排期视图 */
.sched-panel .panel-head { align-items: flex-start; }
.sched-hint { padding: 0 var(--s6) var(--s2); margin: 0; }
.sched-body { padding: 0 var(--s6) var(--s6); overflow-x: auto; }
.sched-loading { padding: var(--s8); text-align: center; color: var(--muted); }
/* 排期卡片：每个房间一张独立卡片 */
.sched-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: var(--s4);
}
.sched-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  overflow: hidden;
}
.sched-card.state-using { border-color: #bfe6dd; box-shadow: 0 1px 2px rgba(15, 159, 143, 0.18); }
.sched-card.state-booked { border-color: #f0dfb9; }
.sc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s2);
  padding: 12px 14px 8px;
}
.sc-title { min-width: 0; }
.sc-title b { display: block; font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.sc-title span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-2); }
.sc-price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.sc-price small { color: var(--muted); font-size: 10.5px; }
.sc-fee { font-weight: 600; color: var(--ink); }
.sc-price-sep { width: 1px; height: 12px; background: var(--line-strong); }
.sc-list { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; }
.sc-item {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr) 82px auto 54px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #eef2f7;
  border-left: 3px solid #d59b2a;
  border-radius: var(--radius-sm);
  background: #fcfdff;
}
.sc-item.st-active { border-left-color: #0f9f8f; background: #f8fdfc; }
.sc-item.st-closed { border-left-color: #98a4b5; background: #fafbfc; }
.sc-item-time b { display: block; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.sc-item-time span { display: block; font-size: 11px; color: var(--muted); }
.sc-item-who { min-width: 0; }
.sc-item-who b { display: block; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-item-who span { display: block; font-size: 11px; color: var(--muted); }
.sc-item-amount { text-align: right; font-variant-numeric: tabular-nums; }
.sc-item-amount b { display: block; font-size: 13px; font-weight: 700; color: var(--green); }
.sc-item-amount span { display: block; font-size: 10.5px; color: var(--muted); }
.sc-edit-btn { min-height: 28px; padding: 0 9px; white-space: nowrap; }
.sc-empty { padding: 16px 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.sc-empty > span { display: block; }
.sc-slots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.sc-slot {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  border-color: #c9dcf5;
  color: var(--blue);
  background: var(--accent-soft);
}
.sc-slot:hover { border-color: var(--accent); color: var(--accent-dark); }
.sc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}
.sc-count { font-size: 11.5px; color: var(--muted); }

/* 实时计费卡片 */
.live-source { display: none; }
.live-time { font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: 0.4px; color: var(--accent); }
.live-amount { color: var(--green); }
.live-amount small { color: var(--muted); font-weight: 400; margin-left: 2px; }
.rc-status { min-height: 92px; }

/* 预约弹层摘要与冲突提示 */
.bk-summary {
  margin: var(--s3) 0 0;
  padding: var(--s3) var(--s4);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}
.bk-summary .bk-summary-title {
  display: inline-block;
  margin-right: var(--s3);
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
}
.conflict-hint {
  margin: var(--s3) 0 0;
  padding: var(--s3) var(--s4);
  border: 1px solid #f0c48a;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: #7a4a00;
  font-size: 13px;
  line-height: 1.7;
}
.conflict-hint.hidden { display: none; }
.warn-text { color: var(--red); }

/* 房间配置：营业时段 */
.period-line { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.period-line span { color: var(--muted); font-size: 11px; width: 24px; flex: none; }
.period-line input { width: 84px; padding: 3px 4px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; font-size: 12px; }

/* 主控面板 */
.master-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s4);
  padding: 0 var(--gutter) var(--s5);
}
.master-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5);
  box-shadow: var(--shadow);
}
.master-card span { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: var(--s2); }
.master-card b { font-size: 26px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.master-card em { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 6px; }
.master-card.alert b { color: var(--amber); }
.master-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: var(--s5);
  padding: 0 var(--gutter) var(--s5);
}
.master-row .panel { margin: 0; }
.master-events { max-height: 320px; overflow: auto; padding: 4px var(--s3) var(--s3); }
.master-event {
  display: flex;
  gap: var(--s2);
  padding: 7px 6px;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
}
.master-event b { font-weight: 600; color: var(--ink); }
.master-event time { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 6px; }
.online-dot.off { background: var(--line-strong); }
.approval-list.compact { max-height: 320px; overflow: auto; }

/* 三选一按钮组 */
.choice-seg { display: flex; gap: var(--s2); flex-wrap: wrap; }
.choice-seg label { flex: 1 1 120px; }
.choice-seg input { position: absolute; opacity: 0; pointer-events: none; }
.choice-seg .choice-box {
  display: block;
  padding: var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 13px;
  color: var(--ink-2);
  background: #fff;
  cursor: pointer;
}

/* 审批实时弹窗 */
.approval-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  width: min(360px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: var(--s4);
  animation: slideIn 240ms ease-out;
}
@keyframes slideIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.approval-toast h3 { margin: 0 0 6px; font-size: 15px; }
.approval-toast p { margin: 0 0 var(--s3); font-size: 12.5px; color: var(--ink-2); }
.approval-toast .approval-actions { display: flex; gap: var(--s2); justify-content: flex-end; }

@media (max-width: 1100px) {
  .master-row { grid-template-columns: 1fr; }
}

/* ---------- 访客登记 / 门禁接入 ---------- */
.visitor-panel .head-actions { align-items: center; }
.access-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 999px; font-size: 12px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--muted);
}
.access-pill.ok { color: var(--green); border-color: #c4e9d8; background: var(--green-soft); }
.access-pill.bad { color: var(--red); border-color: #f0ccd0; background: var(--red-soft); }
.visitor-table table { min-width: 1020px; }
.visitor-table td { vertical-align: top; }
.visitor-table .visitor-reason { max-width: 180px; white-space: normal; }
.visitor-table .col-actions { width: 190px; text-align: right; white-space: nowrap; }
.visitor-actions .btn + .btn { margin-left: 6px; }
.door-result { display: block; font-size: 11.5px; margin-top: 3px; line-height: 1.5; }
.door-result.idle { color: var(--muted); }
.door-result.ok { color: var(--green); }
.door-result.bad { color: var(--red); }
.btn.unconfigured { border-color: #f0ccd0; color: var(--red); background: var(--red-soft); }
.btn.unconfigured:hover { background: #fbe3e6; }
.master-row.single { grid-template-columns: 1fr; }
.access-body { padding: 0 var(--s4) var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.access-status {
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px;
  border: 1px solid var(--line-strong); background: #fff;
}
.access-status.ok { color: var(--green); background: var(--green-soft); border-color: #c4e9d8; }
.access-status.bad { color: var(--red); background: var(--red-soft); border-color: #f0ccd0; }
.access-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s3); }
.access-map textarea { resize: vertical; }
.access-note { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.access-note code { background: #f2f5fa; padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }
.access-test-result {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px;
  border-radius: var(--radius-sm); font-size: 12.5px;
  border: 1px solid var(--line-strong); background: #fff;
}
.access-test-result.ok { border-color: #c4e9d8; background: var(--green-soft); }
.access-test-result.bad { border-color: #f0ccd0; background: var(--red-soft); }
.access-test-result .access-code { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, monospace; }
