:root {
  --ink: #14242e;
  --muted: #60717a;
  --line: #dce6e8;
  --panel: #ffffff;
  --canvas: #f3f7f6;
  --navy: #0d2f3b;
  --teal: #0e826f;
  --teal-dark: #086656;
  --mint: #d9f3eb;
  --coral: #d95d45;
  --shadow: 0 18px 50px rgba(16, 48, 59, .08);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); min-height: 100vh; }
a { color: var(--teal-dark); text-decoration: none; }
button, input, select, textarea { font: inherit; }
.topbar { min-height: 76px; padding: 0 4vw; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 32px; position: sticky; top: 0; z-index: 20; box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; min-width: 220px; }
.brand span:last-child { display: grid; line-height: 1.15; }
.brand small { color: #a9c4c8; font-size: 11px; margin-top: 3px; letter-spacing: .08em; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #27b495; color: #fff; font-weight: 900; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.brand-mark.large { width: 56px; height: 56px; border-radius: 17px; font-size: 24px; flex: 0 0 auto; }
nav { display: flex; gap: 6px; flex: 1; }
nav a { color: #c8d8da; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.logout-form { margin-left: auto; }
.page-shell { max-width: 1420px; margin: 0 auto; padding: 42px 4vw 60px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 15%, #1c6d67, transparent 28%), linear-gradient(145deg, #092831, #0e3c46 55%, #0b665b); }
.auth-card { width: min(480px, 100%); background: rgba(255,255,255,.97); border-radius: 24px; padding: 38px; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.auth-heading { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 28px; }
.auth-heading h1 { margin: 2px 0 6px; }
.auth-heading p:last-child { color: var(--muted); margin: 0; }
.eyebrow { color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .16em; margin: 0 0 7px; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { font-size: clamp(30px, 4vw, 48px); letter-spacing: -.035em; line-height: 1.05; margin: 0; }
h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.hero { background: linear-gradient(125deg, var(--navy), #145b5e); color: #fff; border-radius: 26px; padding: clamp(30px, 5vw, 62px); display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content: ""; width: 320px; height: 320px; border: 52px solid rgba(72,204,171,.12); border-radius: 50%; position: absolute; right: -100px; top: -130px; }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: #6fe0c7; }
.hero .lead { color: #bed7d7; max-width: 700px; margin: 17px 0 0; font-size: 16px; line-height: 1.7; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0 46px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 7px; box-shadow: 0 8px 30px rgba(16,48,59,.035); }
.metric span, .metric small { color: var(--muted); }
.metric strong { font-size: 32px; line-height: 1; }
.metric.accent { border-top: 3px solid var(--teal); }
.metric.danger { border-top: 3px solid var(--coral); }
.metric .domain-value { font-size: 17px; line-height: 1.3; }
.section-heading, .page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 0 0 18px; }
.section-heading.compact { margin-top: 44px; }
.page-heading { align-items: center; margin-bottom: 30px; }
.page-heading h1 { font-size: clamp(30px, 4vw, 42px); }
.page-heading p:not(.eyebrow) { color: var(--muted); margin: 10px 0 0; }
.node-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.node-card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 35px rgba(16,48,59,.045); }
.node-card { padding: 22px; }
.node-card-top, .panel-heading, .domain-title, .row-actions { display: flex; align-items: center; gap: 10px; }
.node-card-top, .panel-heading { justify-content: space-between; }
.hostname { color: var(--muted); font-size: 13px; margin: 10px 0 24px; }
.ip-value { font: 700 22px ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--navy); margin-bottom: 21px; }
dl { margin: 0; display: grid; gap: 10px; }
dl div { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid #edf2f2; padding-top: 10px; font-size: 12px; }
dt { color: var(--muted); } dd { margin: 0; text-align: right; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #a9b6b9; box-shadow: 0 0 0 4px rgba(169,182,185,.15); }
.status-dot.online { background: #13a47f; box-shadow: 0 0 0 4px rgba(19,164,127,.15); }
.badge { display: inline-flex; align-items: center; width: max-content; padding: 5px 9px; border-radius: 999px; background: #edf1f2; color: #627078; font-size: 11px; font-weight: 800; }
.badge.good, .badge.nochg { background: var(--mint); color: #08705d; }
.badge.error { background: #fee8e4; color: #a83827; }
.badge.disabled { background: #edf0f1; color: #68767b; margin-left: 5px; }
.badge.waiting { background: #fff4d7; color: #8a6815; }
.button { border: 1px solid transparent; border-radius: 11px; padding: 10px 15px; cursor: pointer; font-weight: 750; display: inline-flex; justify-content: center; align-items: center; line-height: 1.2; }
.button.primary { background: var(--teal); color: #fff; box-shadow: 0 7px 20px rgba(14,130,111,.2); }
.button.primary:hover { background: var(--teal-dark); }
.button.ghost { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: none; }
.topbar .button.ghost { background: transparent; color: #dce8e9; border-color: rgba(255,255,255,.2); }
.button.danger { background: var(--coral); color: #fff; }
.button.small { padding: 7px 10px; border-radius: 9px; font-size: 12px; }
.button.full { width: 100%; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.panel { padding: 25px; }
.panel-heading { margin-bottom: 22px; }
.panel-heading p { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.split-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.split-layout.wide-left { grid-template-columns: 1.5fr .8fr; }
.sticky-panel { position: sticky; top: 98px; }
.stack-form { display: grid; gap: 17px; }
label { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid #cad8da; border-radius: 11px; padding: 12px 13px; color: var(--ink); background: #fbfdfd; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,130,111,.11); }
.field-help, .fineprint { color: var(--muted); font-size: 12px; margin: 0; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: end; }
.form-panel { max-width: 880px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 10px; }
.check-row { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 9px; font-weight: 500; }
.check-row input, .check-card input { width: 17px; height: 17px; accent-color: var(--teal); }
.check-card { display: flex; grid-template-columns: auto 1fr; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.check-card span { display: grid; gap: 3px; }.check-card small { color: var(--muted); font-weight: 400; }
.alert { border-radius: 12px; padding: 13px 15px; margin: 0 0 18px; background: #e2f5ee; color: #086553; border: 1px solid #c6eadd; }
.alert.error { background: #fff0ed; color: #9a3524; border-color: #f2cec7; }
.zone-list, .domain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.zone-list li, .domain-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px 0; border-top: 1px solid #edf2f2; }
.zone-list span { color: var(--muted); font-size: 11px; }
.domain-row small { color: var(--muted); margin: 6px 0 0 19px; display: block; }
.count-pill { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--teal-dark); font-weight: 900; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(16,48,59,.04); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 14px 16px; border-bottom: 1px solid #edf2f2; text-align: left; vertical-align: middle; font-size: 13px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; background: #f8fbfa; }
td small { display: block; color: var(--muted); margin-top: 5px; }
tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.muted { color: var(--muted); }
.empty-state { padding: 48px 24px; text-align: center; border: 1px dashed #b9ccce; border-radius: var(--radius); background: rgba(255,255,255,.55); }
.empty-state strong { font-size: 22px; }.empty-state p { color: var(--muted); }.empty-state .button { margin-top: 8px; }
.secret-warning { display: flex; gap: 14px; padding: 14px 18px; background: #fff4d9; border: 1px solid #eed99e; border-radius: 12px; color: #725711; margin-bottom: 18px; }
.secret-warning span { color: #806e3b; }
.secret-field, .code-textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.secret-field { background: #f4f8f7; }
.code-panel { margin-top: 18px; }
.code-textarea { min-height: 430px; resize: vertical; background: #0e2630; color: #d5f5ea; border-color: #0e2630; font-size: 12px; line-height: 1.65; }
.danger-menu { position: relative; }
.danger-menu summary { cursor: pointer; color: var(--coral); font-size: 12px; }
.danger-menu form { position: absolute; right: 0; top: 28px; z-index: 5; width: 220px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); display: grid; gap: 12px; }
footer { max-width: 1420px; margin: 0 auto; padding: 0 4vw 30px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
@media (max-width: 1020px) {
  .topbar { gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .brand { min-width: auto; }.topbar nav { order: 3; width: 100%; overflow-x: auto; }.logout-form { margin-left: auto; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }.node-grid { grid-template-columns: repeat(2, 1fr); }
  .split-layout, .split-layout.wide-left { grid-template-columns: 1fr; }.sticky-panel { position: static; }
}
@media (max-width: 680px) {
  .page-shell { padding-top: 24px; }.hero, .page-heading.actions { align-items: flex-start; flex-direction: column; }
  .metric-grid, .node-grid, .form-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; }.section-heading h2 { font-size: 20px; }
  .domain-row { align-items: flex-start; flex-direction: column; }.row-actions { flex-wrap: wrap; }
  .panel, .auth-card { padding: 20px; }.panel-heading { align-items: flex-start; }
  footer { flex-direction: column; gap: 6px; }
}
