:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-soft: #eef3fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #4b5563;
  --line: #d6dfec;
  --primary: #0b5fd3;
  --primary-strong: #094aa4;
  --accent: #0a7a52;
  --warn: #a33a10;
  --shadow: 0 16px 40px rgba(16, 24, 40, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b1220;
    --bg-soft: #111b30;
    --card: #121b2f;
    --text: #e6edf8;
    --muted: #9fb0cc;
    --line: #2a3750;
    --primary: #4f97ff;
    --primary-strong: #82b5ff;
    --accent: #3fc293;
    --warn: #ff9b73;
    --shadow: 0 22px 50px rgba(0, 0, 0, 0.42);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 580px at 10% -10%, rgba(11, 95, 211, 0.14), transparent),
    radial-gradient(1000px 540px at 90% -30%, rgba(10, 122, 82, 0.12), transparent),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  padding: 1.8rem 0 0.7rem;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 92%, var(--bg-soft));
  color: var(--text);
  border-radius: 10px;
  padding: 0.42rem 0.72rem;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.brand {
  display: flex;
  align-items: flex-start;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-title {
  margin: 0 0 0.28rem;
  line-height: 1;
}

.brand-text-logo {
  display: block;
  width: clamp(240px, 42vw, 360px);
  max-width: 100%;
  height: auto;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.note {
  margin: 0.18rem 0 0;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.8rem;
  padding-bottom: 1.6rem;
}

.grid-tools {
  grid-column: span 12;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.05rem;
}

.card {
  grid-column: span 12;
  background: color-mix(in srgb, var(--card) 95%, transparent);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.95rem 0.9rem;
}

.card h2 {
  margin: 0;
  font-size: 1.18rem;
}

.subsection-title {
  margin: 0.75rem 0 0.4rem;
  font-size: 1rem;
}

.section-text {
  margin: 0.5rem 0;
  color: var(--muted);
}

.command-wrap {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.command {
  flex: 1 1 460px;
  margin: 0;
  background: #081229;
  color: #e7eefb;
  border: 1px solid #1f3050;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
}

.copy-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  min-width: 96px;
  padding: 0.68rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.details {
  margin-top: 0.9rem;
}

.details summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
}

.inline-link-btn {
  display: inline-block;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card) 90%, var(--bg-soft));
  color: var(--text);
  padding: 0.55rem 0.78rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.inline-link-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.details-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 16, 32, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal {
  width: min(980px, 100%);
  max-height: min(85vh, 760px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.04rem;
}

.modal-close {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 9px;
  padding: 0.4rem 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.modal .small {
  margin: 0;
  padding: 0.75rem 1rem 0.2rem;
}

.modal-script {
  margin: 0.5rem 1rem 1rem;
  padding: 0.85rem;
  border-radius: 10px;
  border: 1px solid #1f3050;
  background: #081229;
  color: #e7eefb;
  font-size: 0.83rem;
  overflow: auto;
  white-space: pre;
  flex: 1;
}

.small {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.warn { color: var(--warn); }
.muted { color: var(--muted); }

.table-wrap { margin-top: 0.5rem; }

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

th,
td {
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--line);
  padding: 0.62rem 0.45rem;
}

th {
  width: 32%;
  font-weight: 700;
}

td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.status-list {
  margin: 0.52rem 0 0.4rem;
  padding-left: 1rem;
}

.links-line {
  margin: 0.4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.links-line a,
a {
  color: var(--primary);
}

a:hover { color: var(--primary-strong); }

.changelog {
  margin: 0.85rem 0 0;
  background: #081229;
  color: #e7eefb;
  border: 1px solid #1f3050;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 70%, #ffffff);
  outline-offset: 2px;
  border-radius: 8px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-soft: #eef3fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #4b5563;
  --line: #d6dfec;
  --primary: #0b5fd3;
  --primary-strong: #094aa4;
  --accent: #0a7a52;
  --warn: #a33a10;
  --shadow: 0 16px 40px rgba(16, 24, 40, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-soft: #111b30;
  --card: #121b2f;
  --text: #e6edf8;
  --muted: #9fb0cc;
  --line: #2a3750;
  --primary: #4f97ff;
  --primary-strong: #82b5ff;
  --accent: #3fc293;
  --warn: #ff9b73;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.42);
}

@media (min-width: 880px) {
  #install { grid-column: span 7; }
  #hosts { grid-column: span 5; }
  #status { grid-column: span 7; }
  #support { grid-column: span 5; }
}
