/* ============================================================
   VPS 管理后台 — 共享样式
   设计沿用 Chris's VPN Tools：米色底 / 深蓝主色 / 极简卡片
   ============================================================ */
:root {
  --bg: #F5F4EF;
  --surface: #FFFFFF;
  --surface-dim: #FAF9F4;
  --border: #E0DDD3;
  --border-strong: #C8C3B5;
  --text: #1A1A1A;
  --text-dim: #6B6B68;
  --text-faint: #9A9892;
  --accent: #0B2545;
  --accent-soft: #1E3A5F;
  --success: #2D7A3E;
  --warning: #B8651E;
  --danger: #A82A2A;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { padding: 32px 24px 64px; }
.container { max-width: 1200px; margin: 0 auto; }
.container-narrow { max-width: 880px; margin: 0 auto; }

/* ── Header ── */
header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
}
.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}
h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 4px;
}
.subtitle { color: var(--text-dim); font-size: 13px; max-width: 580px; }

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.nav-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 3px;
  padding: 6px 12px;
  white-space: nowrap;
  cursor: pointer;
}
.nav-link:hover { border-color: var(--accent); }

/* ── Cards ── */
section.card, .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.section-title { font-size: 15px; font-weight: 600; color: var(--text); }
.section-note  { font-size: 12px; color: var(--text-dim); margin-left: auto; }

/* ── Forms ── */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 5px;
}
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface-dim);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.15s;
}
textarea { font-family: var(--mono); font-size: 12px; line-height: 1.6; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > .field { flex: 1; min-width: 120px; }

/* ── Buttons ── */
button {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; padding: 9px 18px; }
.btn-primary:hover { background: var(--accent-soft); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 7px 14px;
}
.btn-secondary:hover { background: var(--surface-dim); border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger {
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  padding: 5px 10px;
  font-size: 12px;
}
.btn-danger:hover { background: #FCEEEE; border-color: var(--danger); color: var(--danger); }

/* ── Node grid ── */
.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.node-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.node-card:hover { border-color: var(--border-strong); }
.node-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.node-label { font-size: 15px; font-weight: 600; }
.node-host { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.node-meta { font-size: 12px; color: var(--text-dim); line-height: 1.7; }
.node-meta b { color: var(--text); font-weight: 500; }
.node-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); }

/* ── Badges ── */
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  background: var(--surface-dim);
}
.badge.ok { color: var(--success); border-color: #B5D6BC; background: #EEF7F0; }
.badge.warn { color: var(--warning); border-color: #E6CBA8; background: #FBF3E9; }
.badge.bad { color: var(--danger); border-color: #E8B4B4; background: #FCEEEE; }
.badge.tag { color: var(--accent); border-color: #C5D2E0; background: #EFF3F9; }

/* ── Tag list ── */
.tag-row { display: flex; gap: 5px; flex-wrap: wrap; }

/* ── Messages / terminal ── */
.msg-box {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 3px;
  background: #EFF5FF;
  border: 1px solid #C5D8FF;
  color: var(--accent);
  font-size: 12px;
  font-family: var(--mono);
}
.msg-box.error { background: #FCEEEE; border-color: #E8B4B4; color: var(--danger); }
.msg-box.success { background: #EEF7F0; border-color: #B5D6BC; color: var(--success); }

.terminal {
  background: #0E1525;
  color: #D6E2F0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  border-radius: 4px;
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 420px;
  overflow-y: auto;
}

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,12,20,0.45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px;
  z-index: 50;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 100%;
  max-width: 520px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal h2 { font-size: 18px; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ── Empty state ── */
.empty {
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
  padding: 48px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 4px;
}

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: white;
  padding: 8px 18px;
  border-radius: 3px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 100;
}
#toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.footnote {
  color: var(--text-faint);
  font-size: 11px;
  text-align: center;
  margin-top: 28px;
  font-family: var(--mono);
}

@media (max-width: 720px) {
  body { padding: 20px 14px 48px; }
  section.card, .card { padding: 16px; }
  .node-grid { grid-template-columns: 1fr; }
  h1 { font-size: 20px; }
}
