:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --ok: #0f9d58;
  --warn: #d97706;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(1.2) blur(6px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff; font-weight: 700; font-size: 18px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}

h1 { font-size: 18px; margin: 0; letter-spacing: .2px; }

.brand-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.meta-right {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted); white-space: nowrap;
}

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #9ca3af; display: inline-block;
}
.dot.live { background: var(--ok); box-shadow: 0 0 0 3px rgba(15, 157, 88, .14); }
.dot.error { background: #dc2626; }

/* ---------- filters ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  padding: 16px;
  margin: 20px 0 16px;
  align-items: flex-end;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 108px; }
.field.grow { flex: 1 1 200px; }
.field.actions { flex-direction: row; gap: 8px; align-items: center; }

label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }

select, input[type="search"] {
  appearance: none;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

select:focus, input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .06s, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: #f9fafb; }
.btn-ghost[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: #c7d7fe;
  color: #1d4ed8;
}

/* ---------- summary ---------- */
.summary {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 4px 2px 14px;
}

.stat { display: flex; align-items: baseline; gap: 6px; }
.stat-num { font-size: 26px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-num.muted { color: var(--muted); }
.stat-label { font-size: 13px; color: var(--muted); }

.bar {
  flex: 1 1 180px;
  height: 6px;
  min-width: 140px;
  background: #e8ecf4;
  border-radius: 999px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #34d399, #2563eb);
  border-radius: 999px;
  transition: width .25s ease;
}

.summary-text { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
  padding-bottom: 8px;
}

.room {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s;
}

.room::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--ok);
  opacity: .85;
}

.room:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d7ddea; }

.room-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2px;
  margin: 0 0 6px;
  word-break: break-all;
}

.room-tag {
  display: inline-block;
  font-size: 11.5px;
  color: var(--muted);
  background: #f3f4f6;
  border-radius: 6px;
  padding: 2px 7px;
}

.room-foot {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ok);
  display: flex;
  align-items: center;
  gap: 5px;
}

.room.busy::before { background: var(--warn); }
.room.busy { opacity: .92; }
.room.busy .room-foot { color: var(--warn); }

/* ---------- empty ---------- */
.empty {
  text-align: center;
  padding: 48px 16px;
  background: var(--surface);
  border: 1px dashed #d7ddea;
  border-radius: var(--radius);
  margin-top: 8px;
}
.empty-title { margin: 0 0 6px; font-weight: 600; }
.empty-hint { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px 0 32px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
.site-footer p { margin: 2px 0; }
.tiny { font-size: 11.5px; opacity: .8; }

@media (max-width: 640px) {
  .filters { padding: 14px; gap: 10px; }
  .field { min-width: 0; flex: 1 1 calc(50% - 10px); }
  .field.actions { flex-basis: 100%; }
  .field.actions .btn { flex: 1; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .stat-num { font-size: 22px; }
  .meta-right { display: none; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --text: #e5e7eb;
    --muted: #9aa3b2;
    --line: #262b36;
    --accent: #60a5fa;
    --accent-soft: #1e293b;
  }
  select, input[type="search"] { background-color: #11141a; color: var(--text); }
  .room-tag { background: #232833; }
  .bar { background: #232833; }
  .btn-ghost { background: #11141a; }
  .btn-ghost:hover { background: #1b2028; }
}
