:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #657385;
  --line: #dce3ec;
  --accent: #047857;
  --accent-strong: #065f46;
  --blue: #2563eb;
  --danger: #b42318;
  --warn: #b45309;
  --shadow: 0 12px 30px rgba(24, 39, 75, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 0 14px;
}

button:hover {
  background: var(--accent-strong);
}

button.ghost {
  background: #e8eef6;
  color: var(--ink);
}

button.danger {
  background: var(--danger);
}

button.icon {
  width: 40px;
  padding: 0;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 40px;
  padding: 0 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.side {
  background: #111827;
  color: white;
  padding: 26px 18px;
}

.brand {
  display: grid;
  gap: 5px;
  margin-bottom: 28px;
}

.brand strong {
  font-size: 20px;
}

.brand span,
.side small {
  color: #aab6c7;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  color: #d8e0ec;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav button.active,
.nav button:hover {
  background: #243044;
}

.main {
  padding: 28px;
  display: grid;
  align-content: start;
  gap: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel.pad {
  padding: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

.cols {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.stat {
  padding: 18px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat strong {
  display: block;
  font-size: 30px;
  margin-top: 8px;
}

.public-dns {
  display: grid;
  gap: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.section-head.compact {
  align-items: center;
}

.section-head h2,
.section-head h3 {
  margin: 0;
}

.public-stat,
.probe-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.public-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.public-stat strong {
  display: block;
  font-size: 24px;
  margin-top: 6px;
  word-break: break-word;
}

.probe-card {
  display: grid;
  gap: 8px;
}

.probe-card p {
  margin: 0;
}

.flush-form {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  gap: 12px;
  align-items: end;
  justify-content: start;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 120px auto;
  gap: 12px;
  align-items: end;
}

.zone-form {
  grid-template-columns: minmax(220px, 420px) auto;
  justify-content: start;
}

.ns-guide {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.ns-guide h2,
.zone-card h2 {
  margin: 0;
}

.ns-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.zone-list {
  display: grid;
  gap: 16px;
}

.zone-card {
  display: grid;
  gap: 16px;
}

.zone-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.record-form {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) 110px minmax(220px, 1.5fr) 110px 100px auto;
  gap: 12px;
  align-items: end;
}

.table-wrap {
  overflow-x: auto;
}

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.auth-intro {
  padding: 40px;
  background: #0f766e;
  color: white;
  display: grid;
  align-content: center;
  gap: 14px;
}

.auth-intro h1 {
  margin: 0;
  font-size: 36px;
}

.auth-intro p {
  margin: 0;
  line-height: 1.7;
  color: #e7fffb;
}

.auth-form {
  padding: 34px;
  display: grid;
  align-content: center;
  gap: 14px;
}

.tabs,
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tabs button {
  background: #e7edf5;
  color: var(--ink);
}

.tabs button.active {
  background: var(--accent);
  color: white;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-title {
  padding: 14px 14px 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.table-input {
  min-width: 170px;
  width: 100%;
}

.table-input.small {
  min-width: 74px;
}

.table-input.tiny {
  min-width: 64px;
  width: 72px;
  margin-right: 6px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.token,
code {
  font-family: "Cascadia Mono", Consolas, monospace;
  background: #edf2f7;
  padding: 3px 6px;
  border-radius: 6px;
  word-break: break-all;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e8f5ee;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.badge.warn {
  background: #fff4df;
  color: var(--warn);
}

.notice {
  color: var(--muted);
  line-height: 1.7;
}

.pad-inline {
  padding: 0 14px 14px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  background: #111827;
  color: white;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .shell,
  .auth-card,
  .two,
  .cols {
    grid-template-columns: 1fr;
  }

  .side {
    padding: 18px;
  }

  .main {
    padding: 18px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .flush-form {
    grid-template-columns: 1fr;
  }

  .ns-guide,
  .zone-head {
    display: grid;
  }

  .ns-list {
    justify-content: flex-start;
  }

  .record-form {
    grid-template-columns: 1fr;
  }

  th:nth-child(3),
  td:nth-child(3) {
    display: none;
  }
}
