:root {
  color-scheme: light;
  --ink: #16231b;
  --muted: #56645c;
  --line: #d7e0d9;
  --accent: #237a4b;
  --canvas: #edf1ec;
  --surface: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.6 "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
button, input, select { font: inherit; }
button, .button { cursor: pointer; }
button { min-height: 42px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); white-space: nowrap; }
button:hover { border-color: var(--accent); }
button:active { transform: translateY(1px); }
button:disabled { cursor: wait; opacity: .6; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.danger { color: #922d2d; }
:focus-visible { outline: 3px solid #72b78c; outline-offset: 3px; }
input, select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #aab9ae; border-radius: 8px; color: var(--ink); background: var(--surface); }
input::placeholder { color: var(--muted); }
label { display: grid; gap: 7px; font-weight: 600; }
form { display: grid; gap: 18px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 28px; line-height: 1.3; }
h2 { font-size: 20px; }
small, .muted { color: var(--muted); }
.hidden, [hidden] { display: none !important; }
.status { min-height: 24px; margin: 12px 0; overflow-wrap: anywhere; color: var(--muted); }
.status.error { color: #922d2d; }
.status.success { color: #17603a; }
.loginShell { display: grid; min-height: 100dvh; grid-template-columns: minmax(300px, .85fr) 1.15fr; }
.brandPanel { display: flex; flex-direction: column; justify-content: space-between; gap: 44px; padding: clamp(28px, 5vw, 72px); color: #f7fbf8; background: #173e2a; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 700; }
.mark { display: grid; width: 46px; height: 46px; place-items: center; color: #173e2a; background: #f1d46a; border-radius: 10px; font-size: 22px; }
.brandCopy h2 { font-size: clamp(32px, 4vw, 52px); line-height: 1.25; letter-spacing: -.03em; }
.brandCopy p, .brandPanel small { color: #d2dfd6; }
.loginContent { display: grid; padding: 28px; place-items: center; }
.loginCard { width: min(440px, 100%); }
.loginCard > p { margin-bottom: 30px; color: var(--muted); }
.loginCard form { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.loginCard small { display: block; margin-top: 20px; }
.adminWrap { max-width: 1300px; margin: 0 auto; padding: 32px; }
.adminHeader { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.adminHeader h1 { margin-bottom: 6px; }
.adminLayout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 28px; align-items: start; }
.panel { min-width: 0; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tableWrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; }
td, th { padding: 13px 10px; border-bottom: 1px solid var(--line); }
td { vertical-align: top; }
td button { min-height: 32px; padding: 4px 10px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 5px; color: #17603a; background: #e4f2e9; white-space: nowrap; }
.badge.off { color: #922d2d; background: #fbe9e9; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
dialog { width: min(720px, calc(100% - 32px)); max-height: 90dvh; padding: 28px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgb(14 35 22 / .45); }
.dialogHeader { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialogSection { padding: 20px 0; border-top: 1px solid var(--line); }
.dialogSection h3 { margin: 0 0 12px; font-size: 15px; }
.inlineForm { grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.deviceRow { display: flex; gap: 16px; align-items: start; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.deviceRow p { margin-bottom: 4px; overflow-wrap: anywhere; }
.deviceRow small { display: block; }
.empty { padding: 28px 12px; color: var(--muted); text-align: center; }
.audit { margin-top: 28px; }
@media (max-width: 767px) {
  .loginShell, .adminLayout { grid-template-columns: minmax(0, 1fr); }
  .brandPanel { padding: 24px; gap: 24px; }
  .brandCopy, .brandPanel > small { display: none; }
  .loginShell { grid-template-rows: auto 1fr; }
  .loginContent { align-items: start; padding: 32px 20px; }
  .loginCard form { padding: 22px; }
  .adminWrap { padding: 20px 16px; }
  .panel { padding: 18px; }
  .inlineForm { grid-template-columns: 1fr; }
}
