:root {
  color-scheme: light;
  --bg: #eef1ee;
  --paper: #fafbf9;
  --ink: #19231f;
  --muted: #65726c;
  --line: #d6ddd8;
  --accent: #1f5946;
  --accent-dark: #153f32;
  --danger: #a5413b;
  --warm: #9a6a22;
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); min-width: 980px; }
button, input, textarea { font: inherit; }
.hidden { display: none !important; }
.shell { min-height: 100vh; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; background: rgba(250,251,249,.94); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 16px; letter-spacing: .04em; }
.brand small { display: block; color: #8c9892; font-size: 9px; letter-spacing: .2em; margin-top: 3px; }
.logo { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--ink); color: white; font-weight: 800; }
.status { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #62a388; box-shadow: 0 0 0 4px rgba(98,163,136,.12); }
main { width: min(1440px, calc(100% - 68px)); margin: 0 auto; padding: 44px 0 70px; }
.auth-card { width: 460px; margin: 80px auto 0; padding: 38px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 20px 70px rgba(25,35,31,.08); }
h1 { font-size: 30px; line-height: 1.2; margin: 5px 0 10px; letter-spacing: -.03em; }
h2 { font-size: 17px; margin: 0 0 4px; }
p { color: var(--muted); margin: 0; line-height: 1.65; }
.eyebrow { color: #789085; font-size: 10px; letter-spacing: .22em; font-weight: 700; }
form { margin-top: 26px; display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #53615b; font-size: 12px; font-weight: 600; }
input, textarea { width: 100%; border: 1px solid #cbd4cf; background: #fff; color: var(--ink); border-radius: 8px; padding: 11px 12px; outline: none; transition: .16s; }
input:focus, textarea:focus { border-color: #6c9684; box-shadow: 0 0 0 3px rgba(53,111,87,.11); }
button { border: 0; border-radius: 8px; padding: 11px 16px; cursor: pointer; font-weight: 650; transition: .16s; }
button:hover { transform: translateY(-1px); }
button:disabled { opacity: .48; cursor: wait; transform: none; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.secondary { background: #e5ebe7; color: #294b3e; }
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.danger { color: var(--danger); background: #f7e9e7; }
.hero { display: flex; justify-content: space-between; align-items: end; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 8px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.metric { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.metric span { display: block; color: var(--muted); font-size: 11px; }
.metric strong { display: block; font-size: 24px; margin-top: 8px; }
.grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.panel.wide { margin-top: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.panel-head p { font-size: 12px; }
.form-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
.full { grid-column: 1 / -1; }
.update-panel { grid-column: 1 / -1; }
.check-label { display: flex; align-items: center; gap: 9px; align-self: end; min-height: 42px; }
.check-label input { width: 16px; height: 16px; padding: 0; }
.badge { border-radius: 999px; padding: 5px 9px; background: #edf0ed; color: var(--muted); font-size: 11px; white-space: nowrap; }
.badge.good { background: #e1efe8; color: #276047; }
.key-result { margin-top: 16px; padding: 14px; border: 1px solid #e3c995; background: #fff9ec; border-radius: 9px; }
.key-warning { color: #785116; font-size: 12px; margin-bottom: 10px; }
.key-result textarea { min-height: 120px; resize: vertical; font-family: Consolas, monospace; line-height: 1.7; }
.key-result button { margin-top: 8px; }
.hint { margin-top: 13px; font-size: 12px; }
.table-wrap { overflow-x: auto; margin: 17px -22px -22px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; color: #7b8882; background: #f0f3f1; font-weight: 600; padding: 10px 16px; }
td { padding: 14px 16px; border-top: 1px solid #e1e6e3; vertical-align: top; }
.key-code { font-family: Consolas, monospace; font-size: 12px; color: #384b43; }
.sub { color: #84908a; font-size: 11px; margin-top: 4px; }
.device { padding: 6px 0; border-bottom: 1px dotted #dce2de; }
.device:last-child { border: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions button { font-size: 11px; padding: 6px 9px; }
.state { display: inline-block; border-radius: 999px; padding: 4px 8px; background: #e2efe8; color: #256148; }
.state.off { background: #f1e3e2; color: #8a3935; }
.empty { text-align: center; padding: 34px; color: #8a9690; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 420px; padding: 13px 16px; border-radius: 9px; background: #1f2d27; color: white; box-shadow: 0 12px 35px rgba(0,0,0,.22); z-index: 10; }
.toast.error { background: #8e3833; }
@media (max-width: 1100px) { .metrics { grid-template-columns: repeat(2,1fr); } .grid { grid-template-columns: 1fr; } .update-panel { grid-column: auto; } }
