:root {
  --admin-pine: #174e3a;
  --admin-forest: #23674e;
  --admin-sage: #8eaa91;
  --admin-sage-soft: #e8efe7;
  --admin-paper: #fffefa;
  --admin-canvas: #f4f3ed;
  --admin-oat: #ede6d7;
  --admin-ink: #203029;
  --admin-muted: #748078;
  --admin-line: #dfe5dd;
  --admin-amber: #d98735;
  --admin-red: #b84b3e;
  --admin-shadow: 0 8px 26px rgba(36, 64, 50, 0.07);
  --admin-sidebar: 232px;
}

body.admin-shell {
  min-height: 100vh;
  padding-left: var(--admin-sidebar);
  background:
    radial-gradient(circle at 88% 0, rgba(142, 170, 145, 0.12), transparent 28rem),
    var(--admin-canvas);
  color: var(--admin-ink);
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

/* 首帧加载共享主题时只关闭过渡，不隐藏内容，避免旧页面样式参与入场动画。 */
.admin-shell.admin-shell-booting *,
.admin-shell.admin-shell-booting *::before,
.admin-shell.admin-shell-booting *::after {
  scroll-behavior: auto !important;
  transition: none !important;
  animation: none !important;
}

.admin-shell .nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--admin-sidebar);
  height: 100dvh !important;
  padding: 22px 16px 18px !important;
  display: flex !important;
  flex-direction: column;
  align-items: stretch !important;
  gap: 0 !important;
  overflow: hidden auto !important;
  white-space: normal !important;
  border: 0 !important;
  background:
    radial-gradient(circle at 12% 8%, rgba(255,255,255,.08), transparent 12rem),
    linear-gradient(170deg, #1b563f 0%, #123f30 100%) !important;
  box-shadow: 12px 0 36px rgba(24, 58, 44, 0.12);
}

.admin-shell .nav .brand,
.admin-shell .nav-links,
.admin-shell .nav-links a,
.admin-shell .nav .right {
  display: flex;
  align-items: center;
}

.admin-shell .nav .brand {
  height: auto !important;
  min-height: 58px;
  padding: 0 8px 19px !important;
  gap: 11px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  color: #fff !important;
  text-decoration: none;
  flex: 0 0 auto !important;
}

.admin-shell .brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px 11px 5px;
  background: rgba(255,255,255,.13);
  color: #f3ead8;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

.admin-shell .brand-mark svg,
.admin-shell .nav-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-shell .brand-copy {
  display: grid;
  gap: 2px;
}

.admin-shell .brand-copy strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
}

.admin-shell .brand-copy small {
  color: rgba(255,255,255,.58);
  font: 600 9px/1 "Bahnschrift", "Segoe UI", sans-serif;
  letter-spacing: .16em;
}

.admin-shell .nav-title {
  display: none;
}

.admin-shell .nav-links {
  position: fixed;
  top: 98px;
  bottom: 76px;
  left: 16px;
  z-index: 61;
  width: calc(var(--admin-sidebar) - 32px);
  margin: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  min-width: 0;
  overflow-y: auto;
}

.admin-shell .nav-links a {
  width: 100%;
  min-height: 42px;
  padding: 0 12px !important;
  gap: 11px;
  border-radius: 10px !important;
  color: rgba(255,255,255,.74) !important;
  font-size: 13px !important;
  font-weight: 600;
  line-height: 1 !important;
  text-decoration: none;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.admin-shell .nav-links a:hover {
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
  transform: translateX(2px);
}

.admin-shell .nav-links a.active {
  background: rgba(232,239,231,.2) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 0 #b8cbb9;
}

.admin-shell .nav-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #bdd0c0;
  flex: 0 0 auto;
}

.admin-shell .nav-links .muted {
  margin: 7px 5px 2px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: rgba(255,255,255,.6) !important;
  font-size: 11px;
}

.admin-shell .nav .right {
  width: 100%;
  min-height: 42px;
  margin: auto 0 0 !important;
  padding: 0 12px !important;
  justify-content: flex-start;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(0,0,0,.08);
  color: rgba(255,255,255,.72);
  font: 600 12px "Microsoft YaHei UI", sans-serif;
  cursor: pointer;
}

.admin-shell .nav .right:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.admin-shell .main {
  width: 100%;
  max-width: 1480px !important;
  margin: 0 auto !important;
  padding: 22px 28px 44px !important;
}

.admin-page-head {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  margin-bottom: 18px;
  padding: 6px 2px 15px;
  border-bottom: 1px solid rgba(23,78,58,.14);
}

.admin-page-head::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 62px;
  height: 2px;
  background: var(--admin-pine);
}

.admin-page-kicker {
  margin-bottom: 4px;
  color: var(--admin-sage);
  font: 700 9px/1 "Bahnschrift", "Segoe UI", sans-serif;
  letter-spacing: .18em;
}

.admin-page-head h1 {
  margin: 0;
  color: var(--admin-pine);
  font-family: "STSong", "Songti SC", "Noto Serif CJK SC", serif;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: .03em;
}

.admin-page-description {
  max-width: 500px;
  margin: 0 0 2px;
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
}

.admin-shell :where(.card, .panel, .stat-card) {
  border: 1px solid rgba(23,78,58,.1) !important;
  border-radius: 12px !important;
  background: rgba(255,254,250,.96) !important;
  box-shadow: var(--admin-shadow) !important;
}

.admin-shell :where(.card, .panel) {
  padding: 16px !important;
}

.admin-shell :where(.card, .panel, .stat-card) h3 {
  color: var(--admin-ink);
  font-size: 14px !important;
  font-weight: 700;
}

.admin-shell .grid {
  gap: 12px !important;
}

.admin-shell .main > .grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) !important;
  margin-bottom: 12px !important;
}

.admin-shell .main > .grid .card {
  position: relative;
  min-height: 102px;
  padding: 17px 18px 14px 72px !important;
  overflow: hidden;
}

.admin-shell .main > .grid .card::before {
  content: "";
  position: absolute;
  top: 19px;
  left: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50% 50% 43% 47%;
  background: var(--admin-sage-soft);
  box-shadow: inset 0 0 0 1px rgba(23,78,58,.08);
}

.admin-shell .main > .grid .card::after {
  content: "";
  position: absolute;
  top: 33px;
  left: 31px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--admin-forest);
  border-radius: 3px 3px 1px 1px;
}

.admin-shell .main > .grid .card:nth-child(4)::before {
  background: #f7eadb;
}

.admin-shell .main > .grid .card:nth-child(4)::after {
  border-color: var(--admin-amber);
  transform: rotate(45deg);
  border-width: 0 2px 2px 0;
  border-radius: 0;
}

.admin-shell .label {
  color: var(--admin-muted) !important;
  font-size: 11px !important;
}

.admin-shell .value {
  margin-top: 3px !important;
  color: var(--admin-pine);
  font: 700 28px/1.1 "Bahnschrift", "Segoe UI", sans-serif;
}

.admin-shell .value span {
  margin-left: 4px;
  color: var(--admin-muted);
  font: 600 10px/1 "Microsoft YaHei UI", sans-serif;
}

.dashboard-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.dashboard-panels .panel {
  min-width: 0;
  margin-bottom: 12px !important;
}

.dashboard-panels .panel-logs {
  grid-column: 1 / -1;
}

.dashboard-panels .panel h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-tag {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--admin-sage-soft);
  color: var(--admin-forest);
  font-size: 10px;
  font-weight: 700;
}

.panel-tag.attention {
  background: #f8eadc;
  color: #a45f22;
}

.room-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid #cbd8cd;
  border-radius: 6px 6px 3px 6px;
  background: #f1f5ef;
  color: var(--admin-pine);
  font: 700 11px/1 "Bahnschrift", "Segoe UI", sans-serif;
}

.empty-state {
  padding: 18px 4px;
  text-align: center;
}

.admin-shell .panel {
  margin-bottom: 12px !important;
}

.admin-shell .panel h3 {
  margin-bottom: 10px !important;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8ece7;
}

.admin-shell table {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0;
  background: transparent !important;
  box-shadow: none !important;
}

.admin-shell th,
.admin-shell td {
  padding: 8px 9px !important;
  border-bottom: 1px solid #edf0eb !important;
  color: #34443b;
  font-size: 12px !important;
  line-height: 1.45;
  vertical-align: middle;
}

.admin-shell th {
  background: #f0f4ee !important;
  color: #68766d !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .04em;
}

.admin-shell tbody tr:hover td {
  background: rgba(232,239,231,.38);
}

.admin-shell tbody tr:last-child td {
  border-bottom: 0 !important;
}

.admin-shell :where(.muted, .info) {
  color: var(--admin-muted) !important;
}

.admin-shell .bad {
  color: var(--admin-red) !important;
}

.admin-shell .ok {
  color: var(--admin-forest) !important;
}

.admin-shell :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  border: 1px solid #d7dfd8 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--admin-ink) !important;
  font-family: inherit;
}

.admin-shell :where(input:not([type="checkbox"]):not([type="radio"]), select) {
  min-height: 38px;
}

.admin-shell :where(input, select, textarea):focus {
  border-color: var(--admin-forest) !important;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(35,103,78,.09) !important;
}

.admin-shell :where(button, .btn, a.btn) {
  border-radius: 8px !important;
  font-family: inherit;
  font-weight: 600 !important;
  cursor: pointer;
}

.admin-shell :where(.btn-primary, .btn.primary, button.primary) {
  border-color: var(--admin-pine) !important;
  background: var(--admin-pine) !important;
  color: #fff !important;
  box-shadow: 0 5px 13px rgba(23,78,58,.13);
}

.admin-shell :where(.btn-primary, .btn.primary, button.primary):hover {
  background: var(--admin-forest) !important;
}

.admin-shell :where(.btn-outline, .btn.outline, button.outline) {
  border-color: #b9c6bd !important;
  background: #fff !important;
  color: var(--admin-pine) !important;
}

.admin-shell .toolbar {
  margin-bottom: 12px !important;
  padding: 12px !important;
  border: 1px solid rgba(23,78,58,.1);
  border-radius: 11px;
  background: rgba(255,254,250,.92);
  box-shadow: 0 5px 18px rgba(36,64,50,.04);
}

.admin-shell .readonlyBanner {
  position: relative;
  margin-bottom: 12px !important;
  padding: 12px 22px 12px 15px !important;
  border: 1px solid #ddd4c4 !important;
  border-right: 4px solid var(--admin-pine) !important;
  border-radius: 9px !important;
  background: linear-gradient(90deg,#f5efe3,#eee7da) !important;
  color: #5f5a51 !important;
}

.admin-shell .toast {
  border-radius: 9px !important;
  background: var(--admin-pine) !important;
  box-shadow: 0 12px 30px rgba(23,78,58,.2) !important;
}

.admin-shell :where(.modal-overlay, .modal) {
  backdrop-filter: blur(4px);
}

.admin-shell .modal-overlay > .modal,
.admin-shell > .modal > .panel {
  border-color: rgba(23,78,58,.12) !important;
  border-radius: 15px !important;
  background: var(--admin-paper) !important;
  box-shadow: 0 24px 70px rgba(25,55,42,.2) !important;
}

.admin-shell :where(a, button, input, select, textarea):focus-visible,
.login-page :where(button, input):focus-visible {
  outline: 3px solid rgba(35,103,78,.24);
  outline-offset: 2px;
}

/* 登录页：链接在页面内联样式之前，使用更高特异性保持 B 风格。 */
html body.login-page {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 75% 15%, rgba(142,170,145,.18), transparent 25rem),
    linear-gradient(145deg,#e7ede7,#f7f4ec 52%,#e6eee8) !important;
}

body.login-page .card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(23,78,58,.13) !important;
  border-radius: 20px !important;
  background: rgba(255,254,250,.97) !important;
  box-shadow: 0 24px 70px rgba(28,59,47,.16) !important;
}

body.login-page .card::before {
  content: "LIGHT STAY · SERVICE DESK";
  display: block;
  margin: -32px -32px 28px;
  padding: 23px 32px;
  background: var(--admin-pine);
  color: rgba(255,255,255,.7);
  font: 600 9px/1 "Bahnschrift","Segoe UI",sans-serif;
  letter-spacing: .18em;
}

body.login-page .card h1 {
  color: var(--admin-pine);
  font-family: "STSong","Songti SC",serif;
  font-size: 27px;
  font-weight: 600;
}

body.login-page .sub {
  color: var(--admin-muted);
}

body.login-page .fg label {
  color: #435148;
  font-weight: 600;
}

body.login-page .fg input {
  border-color: #d7dfd8;
  border-radius: 8px;
  background: #fff;
}

body.login-page .btn {
  min-height: 46px;
  border-radius: 8px;
  background: var(--admin-pine);
  box-shadow: 0 8px 20px rgba(23,78,58,.16);
}

body.login-page .refresh {
  border-color: #d7dfd8;
  border-radius: 8px;
  color: var(--admin-pine);
  background: #f4f7f3;
}

@media (max-width: 1050px) and (min-width: 761px) {
  :root { --admin-sidebar: 208px; }
  .admin-shell .nav { padding-inline: 13px !important; }
  .admin-shell .main { padding-inline: 20px !important; }
}

@media (max-width: 760px) {
  html { overflow-x: hidden; }

  body.admin-shell {
    min-width: 0;
    padding-left: 0;
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
    background: var(--admin-canvas);
  }

  .admin-shell .nav {
    position: sticky;
    top: 0;
    right: auto;
    bottom: auto;
    z-index: 40;
    width: 100%;
    height: 56px !important;
    padding: 0 14px !important;
    display: grid !important;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center !important;
    gap: 10px !important;
    overflow: visible !important;
    background: rgba(255,254,250,.96) !important;
    border-bottom: 1px solid var(--admin-line) !important;
    box-shadow: 0 4px 18px rgba(31,67,50,.07);
  }

  .admin-shell .nav .brand {
    min-height: 0;
    padding: 0 !important;
    border: 0;
  }

  .admin-shell .brand-mark {
    width: 34px;
    height: 34px;
    color: #fff;
    background: var(--admin-pine);
  }

  .admin-shell .brand-copy { display: none; }

  .admin-shell .nav-title {
    display: block;
    overflow: hidden;
    color: var(--admin-pine);
    font-family: "STSong","Songti SC",serif;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-shell .nav .right {
    justify-content: center;
    width: auto;
    min-width: 44px;
    min-height: 44px;
    margin: 0 !important;
    padding: 0 7px !important;
    border: 0;
    background: transparent;
    color: var(--admin-muted);
  }

  .admin-shell .nav-links {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: auto;
    height: calc(64px + env(safe-area-inset-bottom));
    margin: 0;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    background: rgba(255,254,250,.98);
    border-top: 1px solid var(--admin-line);
    box-shadow: 0 -8px 24px rgba(31,67,50,.07);
    backdrop-filter: blur(14px);
  }

  .admin-shell .nav-links::-webkit-scrollbar { display: none; }

  .admin-shell .nav-links a {
    justify-content: center;
    min-width: 68px;
    min-height: 50px;
    padding: 5px 10px !important;
    flex-direction: column;
    gap: 4px;
    border-radius: 11px !important;
    color: #718078 !important;
    font-size: 10px !important;
    line-height: 1 !important;
    scroll-snap-align: center;
  }

  .admin-shell .nav-links a:hover { transform: none; }

  .admin-shell .nav-links a.active {
    background: var(--admin-sage-soft) !important;
    color: var(--admin-pine) !important;
    box-shadow: none;
  }

  .admin-shell .nav-icon {
    width: 18px;
    height: 18px;
    color: currentColor;
  }

  .admin-shell .nav-icon svg { width: 17px; height: 17px; }

  .admin-shell .nav-links > .muted {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin: 0;
    padding: 0 8px;
    border: 0;
    color: var(--admin-muted) !important;
    font-size: 10px;
  }

  .admin-shell .main {
    width: 100%;
    max-width: none !important;
    padding: 12px !important;
  }

  .admin-page-head {
    min-height: 58px;
    margin-bottom: 12px;
    padding: 5px 2px 12px;
  }

  .admin-page-head h1 { font-size: 21px; }
  .admin-page-description { display: none; }

  .admin-shell :where(.card, .panel, .stat-card) {
    padding: 14px !important;
    overflow: visible !important;
    border-radius: 12px !important;
  }

  .admin-shell .main > .grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 9px !important;
  }

  .admin-shell .main > .grid .card {
    min-height: 88px;
    padding: 14px 12px 12px 52px !important;
  }

  .admin-shell .main > .grid .card::before {
    top: 16px;
    left: 12px;
    width: 31px;
    height: 31px;
  }

  .admin-shell .main > .grid .card::after {
    top: 27px;
    left: 22px;
    width: 10px;
    height: 10px;
  }

  .admin-shell .value { font-size: 24px; }
  .dashboard-panels { grid-template-columns: minmax(0,1fr); }
  .dashboard-panels .panel-logs { grid-column: auto; }

  .admin-shell :where(.card, .panel) > :where(.grid, .row, .edit-grid),
  .admin-shell .modal :where(.grid, .row, .edit-grid) {
    grid-template-columns: minmax(0,1fr) !important;
  }

  .admin-shell .toolbar {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px !important;
    align-items: stretch !important;
  }

  .admin-shell .toolbar > :where(input, select, button) {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .admin-shell .toolbar > :where(.refresh-meta, .muted) {
    grid-column: 1 / -1;
    width: auto !important;
    margin: 0 !important;
  }

  .admin-shell :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    min-height: 44px !important;
    font-size: 16px !important;
  }

  .admin-shell :where(button, .btn, a.btn) {
    min-height: 44px;
    font-size: 13px !important;
    touch-action: manipulation;
  }

  .admin-shell .actions {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px !important;
  }

  .admin-shell .actions > :where(button, .btn) {
    width: 100%;
    margin: 0 !important;
  }

  .admin-shell :where(#wrap, #list, .card, .panel) {
    overflow-x: visible !important;
  }

  .admin-shell table[data-mobile-ready] {
    display: block;
    width: 100%;
    min-width: 0 !important;
    overflow: visible;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }

  .admin-shell table[data-mobile-ready] thead { display: none; }

  .admin-shell table[data-mobile-ready] tbody {
    display: grid;
    gap: 9px;
  }

  .admin-shell table[data-mobile-ready] tr {
    display: block;
    overflow: hidden;
    background: var(--admin-paper);
    border: 1px solid var(--admin-line);
    border-radius: 11px;
    box-shadow: 0 4px 14px rgba(31,67,50,.05);
  }

  .admin-shell table[data-mobile-ready] td {
    display: grid;
    grid-template-columns: minmax(88px,34%) minmax(0,1fr);
    gap: 12px;
    align-items: start;
    width: 100%;
    max-width: none !important;
    padding: 9px 11px !important;
    overflow: visible !important;
    border-bottom: 1px solid #edf0eb !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .admin-shell table[data-mobile-ready] td::before {
    content: attr(data-label);
    color: #7b887f;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
  }

  .admin-shell table[data-mobile-ready] td:last-child { border-bottom: 0 !important; }
  .admin-shell table[data-mobile-ready] td:only-child { display: block; }
  .admin-shell table[data-mobile-ready] td:only-child::before { display: none; }

  .admin-shell table[data-mobile-ready] td :where(button, .btn, a.btn) {
    margin: 2px 4px 2px 0 !important;
  }

  .admin-shell .topic {
    max-width: none !important;
    overflow: visible !important;
    white-space: normal !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere;
  }

  .admin-shell .pagination {
    justify-content: flex-start !important;
    padding: 4px 0;
    overflow-x: auto;
  }

  .admin-shell .pagination button {
    min-width: 44px;
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 auto;
  }

  .admin-shell :where(.modal-overlay, .modal) { overscroll-behavior: contain; }

  .admin-shell .modal-overlay,
  .admin-shell > .modal {
    /* Keep dialog actions above the fixed mobile navigation. */
    z-index: 1000;
    align-items: flex-end !important;
    padding-top: 56px;
  }

  .admin-shell .modal-overlay > .modal,
  .admin-shell > .modal > .panel {
    width: 100% !important;
    max-width: none !important;
    max-height: calc(100dvh - 56px);
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto;
    border-radius: 18px 18px 0 0 !important;
  }

  .admin-shell .toast {
    top: 68px !important;
    width: max-content;
    max-width: calc(100vw - 32px);
    text-align: center;
  }

  body.login-page .card::before {
    margin: -24px -20px 24px;
    padding: 20px;
  }
}

@media (max-width: 380px) {
  .admin-shell .toolbar { grid-template-columns: minmax(0,1fr); }
  .admin-shell .main > .grid { grid-template-columns: minmax(0,1fr) !important; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-shell *,
  .login-page * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 460px) {
  body.login-page {
    min-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  }

  .login-page .card {
    width: 100%;
    max-width: 400px;
    padding: 24px 20px;
    border-radius: 16px;
  }

  .login-page .fg input,
  .login-page .btn {
    min-height: 48px;
    font-size: 16px;
  }

  .login-page .captcha-row {
    grid-template-columns: minmax(0,1fr) 124px 44px;
    gap: 6px;
  }

  .login-page .captcha-row img {
    width: 124px;
    height: 48px;
  }

  .login-page .refresh {
    width: 44px;
    height: 48px;
    padding: 0 5px;
    overflow: hidden;
    font-size: 12px;
  }
}

/* C 版运营台：深蓝工作区 + 青色状态线，业务页面保持低密度信息层级。 */
body.admin-shell {
  --admin-c: #071a2b;
  --admin-c-slate: #0d2f4a;
  --admin-c-cyan: #27c7e8;
  --admin-c-green: #39c98b;
  --admin-c-amber: #f2b84b;
  --admin-c-red: #f05a5a;
  --admin-pine: var(--admin-c-slate);
  --admin-forest: var(--admin-c-green);
  --admin-sage: #62b8cb;
  --admin-sage-soft: #e4f6fa;
  --admin-paper: #ffffff;
  --admin-canvas: #eef3f6;
  --admin-oat: #e5edf2;
  --admin-ink: #10283b;
  --admin-muted: #647f92;
  --admin-line: #d6e2e9;
  --admin-amber: var(--admin-c-amber);
  --admin-red: var(--admin-c-red);
  --admin-shadow: 0 10px 28px rgba(7, 26, 43, .08);
  --admin-sidebar: 248px;
  background:
    radial-gradient(circle at 94% 0, rgba(39, 199, 232, .1), transparent 28rem),
    var(--admin-canvas) !important;
  color: var(--admin-ink) !important;
}

body.admin-shell .nav {
  width: var(--admin-sidebar) !important;
  background:
    radial-gradient(circle at 10% 5%, rgba(39, 199, 232, .17), transparent 13rem),
    linear-gradient(165deg, #0d2f4a 0%, #071a2b 68%, #061523 100%) !important;
  box-shadow: 14px 0 36px rgba(7, 26, 43, .18) !important;
}

.admin-shell .nav .brand {
  border-bottom-color: rgba(255, 255, 255, .14) !important;
}

.admin-shell .brand-mark {
  border-radius: 10px !important;
  background: rgba(39, 199, 232, .18) !important;
  color: var(--admin-c-cyan) !important;
  box-shadow: inset 0 0 0 1px rgba(39, 199, 232, .26) !important;
}

.admin-shell .brand-copy strong {
  letter-spacing: .08em;
}

.admin-shell .brand-copy small {
  color: rgba(179, 233, 243, .68) !important;
}

.admin-shell .nav-links a {
  border-radius: 9px !important;
  color: rgba(230, 244, 249, .72) !important;
}

.admin-shell .nav-links a:hover {
  background: rgba(39, 199, 232, .1) !important;
  color: #fff !important;
  transform: translateX(2px);
}

.admin-shell .nav-links a.active {
  background: rgba(39, 199, 232, .16) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 0 var(--admin-c-cyan) !important;
}

.admin-shell .nav-icon {
  color: #7ad8e8;
}

.admin-shell .nav-links .muted {
  border-color: rgba(125, 216, 232, .16) !important;
  color: rgba(230, 244, 249, .6) !important;
}

.admin-shell .nav .right {
  border-color: rgba(125, 216, 232, .18) !important;
  background: rgba(0, 0, 0, .16) !important;
  color: rgba(230, 244, 249, .7) !important;
}

.admin-shell .nav .right:hover {
  background: rgba(39, 199, 232, .12) !important;
  color: #fff !important;
}

.admin-page-head {
  border-bottom-color: rgba(13, 47, 74, .16) !important;
}

.admin-page-head::after {
  width: 76px;
  background: var(--admin-c-cyan) !important;
}

.admin-page-kicker {
  color: #168da8 !important;
  letter-spacing: .2em;
}

.admin-page-head h1 {
  color: var(--admin-c-slate) !important;
  font-family: "Bahnschrift", "Microsoft YaHei UI", sans-serif !important;
  font-weight: 750 !important;
  letter-spacing: .02em;
}

.admin-page-description {
  color: var(--admin-muted) !important;
}

.admin-shell :where(.card, .panel, .stat-card) {
  border-color: #d6e2e9 !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: var(--admin-shadow) !important;
}

.admin-shell :where(.card, .panel, .stat-card) h3 {
  color: var(--admin-c-slate) !important;
  letter-spacing: .01em;
}

.admin-shell .main > .grid .card {
  min-height: 108px;
  padding-left: 76px !important;
  border-top: 3px solid rgba(39, 199, 232, .72) !important;
}

.admin-shell .main > .grid .card::before {
  background: #e4f6fa !important;
  box-shadow: inset 0 0 0 1px rgba(39, 199, 232, .18) !important;
}

.admin-shell .main > .grid .card::after {
  border-color: var(--admin-c-cyan) !important;
}

.admin-shell .main > .grid .card:nth-child(2) {
  border-top-color: rgba(57, 201, 139, .72) !important;
}

.admin-shell .main > .grid .card:nth-child(2)::before {
  background: #e5f8f0 !important;
}

.admin-shell .main > .grid .card:nth-child(2)::after {
  border-color: var(--admin-c-green) !important;
}

.admin-shell .main > .grid .card:nth-child(3) {
  border-top-color: rgba(242, 184, 75, .78) !important;
}

.admin-shell .main > .grid .card:nth-child(3)::before {
  background: #fff5dc !important;
}

.admin-shell .main > .grid .card:nth-child(3)::after {
  border-color: var(--admin-c-amber) !important;
}

.admin-shell .main > .grid .card:nth-child(4) {
  border-top-color: rgba(240, 90, 90, .72) !important;
}

.admin-shell .main > .grid .card:nth-child(4)::before {
  background: #ffeded !important;
}

.admin-shell .main > .grid .card:nth-child(4)::after {
  border-color: var(--admin-c-red) !important;
}

.admin-shell .label {
  color: var(--admin-muted) !important;
  font-weight: 650;
  letter-spacing: .03em;
}

.admin-shell .value {
  color: var(--admin-c-slate) !important;
  font-family: "Bahnschrift", "Segoe UI", sans-serif !important;
  letter-spacing: .01em;
}

.admin-shell .value span {
  color: var(--admin-muted) !important;
}

.dashboard-panels .panel {
  min-height: 178px;
}

.dashboard-panels .panel h3 {
  margin-bottom: 10px !important;
  border-bottom-color: #e2ebf0 !important;
}

.panel-tag {
  background: #e4f6fa !important;
  color: #0d7791 !important;
}

.panel-tag.attention {
  background: #fff4d9 !important;
  color: #96670e !important;
}

.room-chip {
  border-color: #b8e8f0 !important;
  background: #eefbfd !important;
  color: var(--admin-c-slate) !important;
}

.admin-shell th {
  background: #f2f7fa !important;
  color: #607b8e !important;
}

.admin-shell th,
.admin-shell td {
  border-bottom-color: #e7eef2 !important;
}

.admin-shell tbody tr:hover td {
  background: #f3fbfd !important;
}

.admin-shell :where(.muted, .info) {
  color: var(--admin-muted) !important;
}

.admin-shell .bad,
.admin-shell .badge.red {
  color: var(--admin-c-red) !important;
}

.admin-shell .ok,
.admin-shell .badge.green {
  color: #10865c !important;
}

.admin-shell .badge.green {
  background: #e5f8f0 !important;
}

.admin-shell .badge.red {
  background: #ffeded !important;
}

.admin-shell .badge.purple {
  background: #e9f3ff !important;
  color: #2874b9 !important;
}

.admin-shell .badge.gray {
  background: #edf2f5 !important;
  color: #647f92 !important;
}

.admin-shell :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  border-color: #cbdbe4 !important;
  color: var(--admin-ink) !important;
}

.admin-shell :where(input, select, textarea):focus {
  border-color: var(--admin-c-cyan) !important;
  box-shadow: 0 0 0 3px rgba(39, 199, 232, .15) !important;
}

.admin-shell :where(.btn-primary, .btn.primary, button.primary) {
  border-color: var(--admin-c-slate) !important;
  background: var(--admin-c-slate) !important;
  box-shadow: 0 6px 16px rgba(13, 47, 74, .16) !important;
}

.admin-shell :where(.btn-primary, .btn.primary, button.primary):hover {
  border-color: #124967 !important;
  background: #124967 !important;
}

.admin-shell :where(.btn-outline, .btn.outline, button.outline) {
  border-color: #bfd1dc !important;
  background: #fff !important;
  color: var(--admin-c-slate) !important;
}

.admin-shell :where(.btn-outline, .btn.outline, button.outline):hover {
  border-color: var(--admin-c-cyan) !important;
  background: #f2fbfd !important;
}

.admin-shell .toolbar {
  border-color: #d6e2e9 !important;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 6px 18px rgba(7, 26, 43, .05) !important;
}

.admin-shell .readonlyBanner {
  border-color: #b8e8f0 !important;
  border-right-color: var(--admin-c-cyan) !important;
  background: linear-gradient(90deg, #eafafd, #f7fcfd) !important;
  color: #386378 !important;
}

.admin-shell .toast {
  background: var(--admin-c-slate) !important;
  box-shadow: 0 12px 30px rgba(7, 26, 43, .22) !important;
}

.admin-shell :where(.modal-overlay, .modal) {
  background-color: rgba(7, 26, 43, .46);
}

.admin-shell .modal-overlay > .modal,
.admin-shell > .modal > .panel {
  border-color: #cfe0e8 !important;
  background: #fff !important;
  box-shadow: 0 24px 70px rgba(7, 26, 43, .24) !important;
}

.admin-shell :where(a, button, input, select, textarea):focus-visible,
.login-page :where(button, input):focus-visible {
  outline-color: rgba(39, 199, 232, .48) !important;
}

html body.login-page {
  --admin-c-slate: #0d2f4a;
  --admin-c-cyan: #27c7e8;
  background:
    radial-gradient(circle at 76% 16%, rgba(39, 199, 232, .18), transparent 23rem),
    linear-gradient(145deg, #dceaf1, #f5f8fa 54%, #dce9f0) !important;
}

body.login-page .card {
  border-color: rgba(13, 47, 74, .16) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, .98) !important;
  box-shadow: 0 24px 70px rgba(7, 26, 43, .18) !important;
}

body.login-page .card::before {
  background: linear-gradient(135deg, #0d2f4a, #071a2b) !important;
  color: rgba(179, 233, 243, .78) !important;
}

body.login-page .card h1 {
  color: var(--admin-c-slate) !important;
  font-family: "Bahnschrift", "Microsoft YaHei UI", sans-serif !important;
  font-weight: 750 !important;
}

body.login-page .sub {
  color: #648094 !important;
}

body.login-page .fg label {
  color: #36566b !important;
}

body.login-page .fg input {
  border-color: #cbdbe4 !important;
}

body.login-page .fg input:focus {
  border-color: var(--admin-c-cyan) !important;
  box-shadow: 0 0 0 3px rgba(39, 199, 232, .15) !important;
}

body.login-page .btn {
  background: var(--admin-c-slate) !important;
  box-shadow: 0 8px 20px rgba(13, 47, 74, .18) !important;
}

body.login-page .btn:hover {
  background: #124967 !important;
}

body.login-page .refresh {
  border-color: #cbdbe4 !important;
  color: var(--admin-c-slate) !important;
  background: #f2fbfd !important;
}

@media (max-width: 760px) {
  body.admin-shell {
    --admin-sidebar: 0px;
  }

  .admin-shell .nav {
    background: rgba(255, 255, 255, .97) !important;
    border-bottom-color: #d6e2e9 !important;
    box-shadow: 0 4px 18px rgba(7, 26, 43, .08) !important;
  }

  .admin-shell .brand-mark {
    color: #fff !important;
    background: var(--admin-c-slate) !important;
  }

  .admin-shell .nav-title {
    color: var(--admin-c-slate) !important;
    font-family: "Bahnschrift", "Microsoft YaHei UI", sans-serif !important;
    font-weight: 750;
  }

  .admin-shell .nav .right {
    color: var(--admin-muted) !important;
    background: transparent !important;
  }

  .admin-shell .nav-links {
    background: rgba(255, 255, 255, .98) !important;
    border-top-color: #d6e2e9 !important;
    box-shadow: 0 -8px 24px rgba(7, 26, 43, .08) !important;
  }

  .admin-shell .nav-links a {
    color: #6b8494 !important;
  }

  .admin-shell .nav-links a.active {
    background: #e4f6fa !important;
    color: #0d7791 !important;
    box-shadow: none !important;
  }

  .admin-shell .main > .grid .card {
    min-height: 92px;
  }
}
