:root {
  color-scheme: dark;
  --bg: #0b1526;
  --surface: #14243a;
  --field: #101e31;
  --text: #e9f4ff;
  --muted: #a6bacd;
  --accent: #58dfff;
  --mint: #64f2bd;
  --border: #2b405a;
  --warning: #ffd389;
  --error: #ff8796;
  font-family: "Segoe UI", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 95% 0%, #153a3e 0%, transparent 43%),
    radial-gradient(ellipse at 0% 35%, #102a43 0%, transparent 56%),
    var(--bg);
}

.filter-definitions { position: absolute; }

.topbar, .page {
  width: min(1090px, calc(100% - 64px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 78px;
  border-bottom: 1px solid var(--border);
}

.platform {
  color: var(--mint);
  font-size: .875rem;
  font-weight: 660;
}

.page {
  display: grid;
  align-content: center;
  min-height: calc(100svh - 78px);
  padding-block: 44px 72px;
}

.download-card {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  min-height: 418px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 18px 72px #0005;
}

.download-content {
  align-self: center;
  min-width: 0;
  padding: clamp(32px, 5vw, 68px);
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(2rem, 4.8vw, 3.8rem);
  font-weight: 740;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.release-status {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.release-status::before {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--status-color, var(--accent));
  content: "";
}

.release-status[data-state="ready"] { --status-color: var(--mint); }
.release-status[data-state="pending"] { --status-color: var(--warning); }
.release-status[data-state="error"] { --status-color: var(--error); }

.release-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

dt {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.5;
}

dd {
  margin: 4px 0 0;
  font-weight: 640;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.download-button, .refresh-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border-radius: 10px;
  padding: 10px 19px;
  font: inherit;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}

.download-button {
  min-width: 148px;
  border: 1px solid transparent;
  color: #082331;
  background: linear-gradient(108deg, var(--accent), var(--mint));
  text-decoration: none;
}

a.download-button:hover { filter: brightness(1.13); }

.download-button:disabled {
  color: var(--muted);
  background: #20364c;
  cursor: default;
}

.refresh-button {
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text);
}

.refresh-button:hover { border-color: var(--accent); }
.refresh-button[aria-busy="true"] { cursor: progress; }

:where(a, button, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.install-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.6;
}

.verification {
  margin-top: 17px;
  font-size: .875rem;
}

.verification summary {
  width: fit-content;
  min-height: 32px;
  padding-block: 5px;
  color: var(--accent);
  cursor: pointer;
}

.verification dl { margin: 7px 0 0; }
.verification dd + dt { margin-top: 11px; }
.verification code { font-size: .78rem; }

.brand-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 100%;
  padding: clamp(26px, 5vw, 58px);
  border-inline-start: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 48% 52%, #224b50, transparent 68%),
    repeating-linear-gradient(90deg, #4cb9a00b 0px 1px, transparent 1px 29px),
    repeating-linear-gradient(0deg, #4cb9a00b 0px 1px, transparent 1px 29px),
    #102239;
}

.brand-plate {
  display: grid;
  place-items: center;
  width: min(100%, 300px);
  aspect-ratio: 1.15;
  padding: 28px;
  border: 1px solid #5abfb351;
  border-radius: 22px;
  background: #10243799;
  box-shadow: inset 0 0 36px #58dfff12, 0 20px 40px #05111c65;
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  filter: url(#remove-logo-white) drop-shadow(0 0 4px #7ddf9d65);
}

@media (max-width: 740px) {
  .topbar, .page { width: min(540px, calc(100% - 32px)); }
  .topbar { min-height: 62px; }
  .page { min-height: auto; padding-block: 24px 42px; }
  .download-card { grid-template-columns: minmax(0, 1fr); border-radius: 18px; }
  .brand-stage {
    order: -1;
    min-height: 158px;
    padding: 18px;
    border-inline-start: 0;
    border-bottom: 1px solid var(--border);
  }
  .brand-plate { width: 135px; padding: 13px; border-radius: 13px; }
  .download-content { padding: 27px 22px; }
}
