:root {
  color-scheme: dark;
  font-family: system-ui, "Microsoft YaHei", sans-serif;
  color: #f1f3fa;
  background: #10131c;
  --border: #34394a;
  --muted: #b2bbd2;
  --accent: #c5d0ff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
main { width: min(100% - 2rem, 68rem); margin: 3.5rem auto; }
.masthead { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.eyebrow { color: var(--accent); font-size: .85rem; font-weight: 700; letter-spacing: .08em; margin: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); margin: .3rem 0 .35rem; }
h2 { font-size: 1.15rem; margin: 0 0 .85rem; }
.summary, .hint { color: var(--muted); line-height: 1.55; }
.summary { margin: 0; }
.hint { font-size: .9rem; }
.badge { padding: .4rem .75rem; border: 1px solid var(--border); border-radius: 1.2rem; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.badge[data-online="true"] { color: #a3efd0; border-color: #427365; background: #193832; }
.panel { border: 1px solid var(--border); border-radius: .85rem; padding: 1.2rem; background: #191e2a; min-width: 0; }
.login { max-width: 31rem; }
.login-controls { display: flex; gap: .55rem; margin-top: .5rem; }
input[type="password"] { min-width: 0; width: 100%; border: 1px solid #566076; border-radius: .4rem; background: #111521; color: inherit; font: inherit; padding: .6rem .65rem; }
button { border: 1px solid #566076; border-radius: .4rem; padding: .6rem .85rem; background: #272e40; color: inherit; font: inherit; white-space: nowrap; cursor: pointer; }
button:hover:not(:disabled) { filter: brightness(1.18); }
button.primary { border-color: #a7b8ff; background: #c5d0ff; color: #121935; font-weight: 700; }
button.danger { border-color: #9b5962; background: #472931; color: #ffd4d6; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, input:focus-visible { outline: 2px solid #b9c9ff; outline-offset: 3px; }
.columns { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1rem; }
.message { color: var(--accent); min-height: 1.4em; overflow-wrap: anywhere; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: .75rem 0 0; }
.metrics > div { border: 1px solid var(--border); border-radius: .4rem; padding: .55rem .65rem; }
.metrics dt { font-size: .8rem; color: var(--muted); }
.metrics dd { margin: .2rem 0 0; overflow-wrap: anywhere; }
.confirmation { display: flex; gap: .55rem; align-items: flex-start; margin: 1.15rem 0 .75rem; font-size: .9rem; }
.confirmation input { margin: .2rem 0 0; accent-color: var(--accent); }
.buttons { display: flex; flex-wrap: wrap; gap: .45rem; }
.preview { margin-top: 1rem; }
.placeholder { display: grid; place-items: center; min-height: 9rem; border: 1px dashed #4a5266; border-radius: .5rem; color: var(--muted); padding: .8rem; text-align: center; margin: 0; }
.preview img { display: block; margin: auto; max-width: 100%; max-height: 26rem; border-radius: .4rem; }
.notice { border: 1px solid #4c5a7f; border-radius: .45rem; padding: .65rem .85rem; background: #232c43; overflow-wrap: anywhere; }
.notice[data-error="true"] { border-color: #9b5962; background: #472931; color: #ffd4d6; }
footer { display: flex; justify-content: flex-end; margin-top: .85rem; }

@media (max-width: 45rem) {
  main { margin-top: 1.6rem; }
  .columns { grid-template-columns: 1fr; }
}
