:root {
  color-scheme: light;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1d2939;
  background: #f2f5f8;
  --border: #dfe5ed;
  --muted: #566579;
  --accent: #075a52;
  --accent-dark: #063e39;
  --surface: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); letter-spacing: -.045em; }
h2 { font-size: 1.13rem; }
h3 { font-size: 1rem; word-break: break-word; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%;
  border: 1px solid #b8c5d3;
  color: #1d2939;
  background: #fff;
  border-radius: .52rem;
  padding: .62rem .74rem;
  min-height: 2.65rem;
}
textarea { resize: vertical; font-family: ui-monospace, monospace; line-height: 1.55; }
button, .button {
  color: #fff;
  border: 1px solid var(--accent);
  background: var(--accent);
  border-radius: .52rem;
  font-weight: 650;
  padding: .59rem .86rem;
  min-height: 2.65rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
button:hover, .button:hover { background: var(--accent-dark); }
button.outline { background: #fff; color: var(--accent); border-color: #b8c5d3; }
button.outline:hover, button.link:hover { background: #edf5f4; }
button.small { min-height: 2rem; padding: .34rem .63rem; font-size: .84rem; }
button.link { background: transparent; border-color: transparent; min-height: 2rem; padding: .3rem .45rem; }
button.danger { color: #9a271d; }
:focus-visible { outline: 3px solid #168a7d; outline-offset: 2px; }
label { display: grid; gap: .39rem; font-size: .88rem; font-weight: 650; }
label input, label select { font-weight: 400; }
code { font-family: ui-monospace, monospace; }
.topbar {
  display: flex; align-items: center; gap: clamp(.7rem, 3vw, 2.4rem);
  background: #fff; padding: .9rem max(1rem, calc((100% - 1180px) / 2));
  border-bottom: 1px solid var(--border);
}
.brand { color: #1d2939; text-decoration: none; font-weight: 800; font-size: 1.1rem; letter-spacing: -.04em; }
.brand span { color: var(--accent); }
.topbar nav { display: flex; gap: clamp(.65rem, 2vw, 1.55rem); margin-right: auto; }
.topbar nav a { text-decoration: none; color: var(--muted); font-size: .9rem; }
.topbar nav a:hover { color: var(--accent); }
.dashboard { width: min(1180px, calc(100% - 2rem)); margin: 2.1rem auto 4rem; display: grid; gap: 1.1rem; }
.page-heading, .section-heading, .node-summary { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.page-heading { margin-bottom: .3rem; }
.muted { color: var(--muted); font-size: .86rem; font-weight: 400; overflow-wrap: anywhere; }
.columns { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: .9rem; padding: 1.1rem; min-width: 0; }
.section-heading { margin-bottom: .85rem; }
.count, .tag { color: var(--accent); background: #eaf5f2; border-radius: 1rem; padding: .1rem .55rem; font-size: .79rem; font-weight: 650; }
.tag { margin-left: .48rem; }
.status { border-radius: 1rem; background: #eef0f3; color: var(--muted); padding: .2rem .56rem; font-size: .77rem; white-space: nowrap; }
.status.good { background: #e8f6ed; color: #19623d; }
.status.warn { background: #fff3de; color: #845909; }
.node { padding: .9rem 0; border-top: 1px solid var(--border); }
.node:last-child { padding-bottom: 0; }
.node-meta { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .34rem; color: var(--muted); font-size: .78rem; }
.node details { margin-top: .6rem; font-size: .83rem; }
.node summary { color: var(--accent); cursor: pointer; width: fit-content; }
.upload, .node-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .55rem; }
.upload input { width: min(20rem, 100%); font-size: .78rem; padding: .42rem; }
.quota-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: .5rem; margin: .55rem 0; }
.quota-form input { width: min(10rem, 100%); }
.stack, .auth-panel form { display: grid; gap: .88rem; }
.stack button { justify-self: start; }
.inline-form { display: flex; align-items: flex-end; gap: .7rem; flex-wrap: wrap; margin: .65rem 0 1rem; }
.inline-form label { flex: 1 1 12rem; }
.device { display: flex; align-items: flex-end; gap: .65rem; padding: .85rem 0 .2rem; border-top: 1px solid var(--border); }
.device label { flex: 1; min-width: 10rem; display: block; overflow-wrap: anywhere; }
.device input { display: block; font-family: ui-monospace, monospace; font-size: .83rem; margin-top: .43rem; }
.device button { min-height: 2.65rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; flex-wrap: wrap; gap: .65rem; padding: .46rem 0; border-top: 1px solid var(--border); font-size: .87rem; }
.timeline time, .empty { color: var(--muted); }
.error, .notice { border-radius: .55rem; padding: .67rem .85rem; background: #eff8f5; color: #174b41; }
.error { background: #feefec; color: #852c22; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-panel { background: #fff; border: 1px solid var(--border); border-radius: 1rem; padding: 1.55rem; width: min(100%, 28rem); display: grid; gap: .85rem; }
.auth-panel h1 { font-size: 1.8rem; }
.auth-panel ol, .auth-panel ul { margin-block: 0; }
.auth-panel code { overflow-wrap: anywhere; }
.auth-qr { display: block; width: 12rem; max-width: 100%; height: auto; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .36rem; padding: .7rem; background: #f2f5f8; }
@media (max-width: 680px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
  .device { flex-wrap: wrap; }
  .device label { flex-basis: 100%; }
  .topbar { padding: .75rem 1rem; }
}
