:root {
  --bg: #f2efe8;
  --panel: #fffdf8;
  --line: #ddd4c5;
  --text: #251d14;
  --muted: #6f6558;
  --accent: #0d6f63;
  --accent-2: #c96d2d;
  --danger: #b53f2e;
  --ok: #2d7a45;
  --shadow: 0 14px 40px rgba(62, 36, 17, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans TC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #e7f4ec 0, transparent 28%),
    radial-gradient(circle at top right, #fde9d6 0, transparent 22%),
    linear-gradient(180deg, #f7f2ea 0%, var(--bg) 100%);
}

button, input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

button.secondary {
  background: #ece5d8;
  color: var(--text);
}

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

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: white;
}

label span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.page-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.hero, .card, .row-card {
  background: var(--panel);
  border: 1px solid rgba(170, 151, 126, 0.25);
  box-shadow: var(--shadow);
}

.hero {
  border-radius: 28px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
}

h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 0.4rem; font-size: clamp(2rem, 4vw, 3.2rem); }
.subtitle, .muted { color: var(--muted); }
.hero-actions, .inline-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.card {
  border-radius: 24px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.auth-card {
  max-width: 420px;
  margin: 2rem auto 0;
}

.section-head, .block-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.config-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.config-block, .row-card {
  border-radius: 18px;
  padding: 1rem;
}

.config-block {
  overflow: hidden;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.row-grid, .inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.config-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.config-table.wide-table {
  min-width: 1080px;
}

.config-table th,
.config-table td {
  padding: 0.8rem;
  border-bottom: 1px solid #eee5d6;
  vertical-align: middle;
}

.config-table th {
  text-align: left;
  font-size: 0.9rem;
  color: var(--muted);
  background: #faf5ec;
  position: sticky;
  top: 0;
}

.config-table tr:last-child td {
  border-bottom: 0;
}

.config-table td input {
  min-width: 0;
}

.table-row td {
  background: white;
}

.action-col {
  width: 120px;
  text-align: right;
  white-space: nowrap;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.status-group {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(13,111,99,0.03), rgba(255,255,255,0.8));
}

.status-item {
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--line);
}

.status-item:last-child { border-bottom: 0; }
.status-item.ok .status-label { color: var(--ok); }
.status-item.down .status-label { color: var(--danger); }
.status-item.unknown .status-label { color: var(--accent-2); }
.status-label { font-weight: 700; }

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox input {
  width: auto;
}

.top-gap { margin-top: 0.75rem; }
.hidden { display: none !important; }

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--text);
  color: white;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 100;
}

@media (max-width: 800px) {
  .hero, .section-head, .block-head {
    flex-direction: column;
  }

  .config-table {
    min-width: 480px;
  }
}
