:root {
  color-scheme: light;
  --page: #f0f4f8;
  --shell:
    radial-gradient(560px 300px at 0% 0%, rgba(2, 132, 199, 0.13), transparent 54%),
    radial-gradient(520px 280px at 100% 0%, rgba(255, 102, 153, 0.08), transparent 52%),
    #f0f4f8;
  --surface: #ffffff;
  --surface-soft: #f6f7f8;
  --surface-muted: #f1f2f4;
  --ink: #1b2a4a;
  --muted: #6b7a90;
  --line: rgba(27, 42, 74, 0.12);
  --line-strong: rgba(27, 42, 74, 0.18);
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-soft: rgba(2, 132, 199, 0.14);
  --release: #24734a;
  --release-soft: rgba(36, 115, 74, 0.13);
  --beta: #8a5a14;
  --beta-soft: rgba(138, 90, 20, 0.11);
  --danger: #a73647;
  --danger-soft: rgba(167, 54, 71, 0.11);
  --shadow-shell: 0 24px 70px rgba(27, 42, 74, 0.14);
  --shadow-soft: 0 12px 30px rgba(27, 42, 74, 0.08);
  --radius-shell: 22px;
  --radius-panel: 18px;
  --radius-control: 8px;
  --motion: 160ms ease;
  color: var(--ink);
  background: var(--page);
  font-family: "Microsoft YaHei UI", "Noto Sans SC", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #121820;
    --shell:
      radial-gradient(560px 300px at 0% 0%, rgba(2, 132, 199, 0.17), transparent 54%),
      radial-gradient(520px 280px at 100% 0%, rgba(255, 143, 179, 0.08), transparent 52%),
      #151c26;
    --surface: #1a222c;
    --surface-soft: #202a36;
    --surface-muted: #151c26;
    --ink: #e8eef5;
    --muted: rgba(232, 238, 245, 0.62);
    --line: rgba(232, 238, 245, 0.12);
    --line-strong: rgba(232, 238, 245, 0.2);
    --primary: #38bdf8;
    --primary-hover: #7dd3fc;
    --primary-soft: rgba(2, 132, 199, 0.28);
    --release: #72d19a;
    --release-soft: rgba(63, 151, 99, 0.22);
    --beta: #f0bc67;
    --beta-soft: rgba(165, 111, 35, 0.24);
    --danger: #ff91a0;
    --danger-soft: rgba(166, 58, 76, 0.24);
    --shadow-shell: 0 24px 70px rgba(0, 0, 0, 0.46);
    --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.24);
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page);
}

button,
a {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 34%, transparent);
  outline-offset: 3px;
}

.page-shell {
  width: min(calc(100% - 36px), 1120px);
  margin: 18px auto;
  overflow: hidden;
  background: var(--shell);
  border: 1px solid var(--line);
  border-radius: var(--radius-shell);
  box-shadow: var(--shadow-shell);
}

.site-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 20px;
  align-items: center;
  min-height: 86px;
  padding: 22px 28px;
}

.brand-wordmark {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.manifest-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.manifest-status::before {
  width: 7px;
  height: 7px;
  content: "";
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent);
}

.manifest-status.is-loading {
  color: var(--primary-hover);
  background: color-mix(in srgb, var(--primary-soft) 72%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 18%, transparent);
}

.manifest-status.is-ok {
  color: var(--release);
  background: color-mix(in srgb, var(--release-soft) 78%, var(--surface));
  border-color: color-mix(in srgb, var(--release) 18%, transparent);
}

.manifest-status.is-error {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger-soft) 78%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 18%, transparent);
}

.workspace {
  margin: 0 18px 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-soft);
}

.state-panel {
  min-height: 320px;
  padding: clamp(32px, 7vw, 72px);
}

.loading-state {
  display: grid;
  align-content: center;
  gap: 22px;
}

.loading-line {
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 72%, transparent), transparent),
    var(--surface-muted);
  background-size: 220% 100%, 100% 100%;
  border-radius: 999px;
  animation: loading-sweep 1.4s ease-in-out infinite;
}

.loading-title {
  width: min(180px, 52%);
  height: 18px;
}

.loading-version {
  width: min(430px, 78%);
  height: clamp(64px, 10vw, 110px);
  border-radius: 16px;
}

.loading-meta {
  width: min(560px, 92%);
  height: 54px;
  border-radius: 12px;
}

@keyframes loading-sweep {
  from { background-position: 120% 0, 0 0; }
  to { background-position: -120% 0, 0 0; }
}

.message-state {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 16px;
}

.message-state h2 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.message-state p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.release-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.72fr);
  min-height: 320px;
  border-bottom: 1px solid var(--line);
}

.release-story {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: clamp(28px, 5vw, 52px);
}

.release-label-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 850;
  white-space: nowrap;
}

.tag-release,
.release-count {
  color: var(--release);
  background: var(--release-soft);
}

.tag-beta {
  color: var(--beta);
  background: var(--beta-soft);
}

.release-version {
  margin: 22px 0 0;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: clamp(3.4rem, 9vw, 6.8rem);
  font-weight: 700;
  letter-spacing: -0.085em;
  line-height: 0.9;
  white-space: nowrap;
}

.release-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  gap: 22px;
  margin: 34px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
}

.summary-item,
.download-fact {
  min-width: 0;
}

dt,
.history-label {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

dd {
  margin: 6px 0 0;
  font-size: 0.84rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.mono {
  font-family: "Cascadia Mono", Consolas, monospace;
}

.download-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 34px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--primary-soft) 45%, transparent), transparent 58%),
    var(--surface-soft);
  border-left: 1px solid var(--line);
}

.download-panel h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.download-facts {
  display: grid;
  gap: 18px;
  margin: 28px 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.button-stack {
  display: grid;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  color: var(--primary-hover);
  cursor: pointer;
  background: var(--primary-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
  transition:
    color var(--motion),
    background-color var(--motion),
    border-color var(--motion),
    transform var(--motion);
}

.button:hover:not(:disabled) {
  color: var(--primary-hover);
  background: color-mix(in srgb, var(--primary-soft) 72%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 22%, transparent);
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.button-secondary {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.button-secondary:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-muted);
  border-color: var(--line-strong);
}

.beta-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 26px 34px;
  background: color-mix(in srgb, var(--beta-soft) 38%, var(--surface));
  border-bottom: 1px solid var(--line);
}

.beta-copy {
  min-width: 0;
}

.beta-title-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.beta-version {
  margin: 0;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}

.beta-notes {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.beta-meta {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.beta-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  min-width: 278px;
}

.history-section {
  padding: 32px 34px 36px;
}

.section-header {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.section-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.history-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.history-row {
  display: grid;
  grid-template-columns: 120px minmax(205px, 0.8fr) minmax(0, 1.4fr) 168px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.history-row:last-child {
  border-bottom: 0;
}

.history-row-head {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.7rem;
  font-weight: 800;
}

.history-cell {
  min-width: 0;
  padding: 15px 16px;
  border-right: 1px solid var(--line);
}

.history-cell:last-child {
  border-right: 0;
}

.history-primary {
  margin: 5px 0 0;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.history-version {
  font-size: 0.86rem;
  font-weight: 850;
}

.history-notes {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.history-links {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.text-link {
  color: var(--primary-hover);
  font-size: 0.76rem;
  font-weight: 800;
  text-underline-offset: 3px;
}

.noscript-message {
  width: min(calc(100% - 36px), 1120px);
  margin: 18px auto;
  padding: 18px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 18%, transparent);
  border-radius: 12px;
  font-size: 0.84rem;
}

@media (max-width: 720px) {
  .page-shell {
    width: calc(100% - 20px);
    margin: 10px auto;
    border-radius: 18px;
  }

  .site-header {
    min-height: 72px;
    padding: 20px;
  }

  .manifest-status {
    justify-self: start;
  }

  .workspace {
    margin: 0 10px 10px;
    border-radius: 16px;
  }

  .state-panel {
    min-height: 280px;
    padding: 36px 22px;
  }

  .release-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .release-story {
    padding: 28px 22px;
  }

  .release-version {
    margin-top: 18px;
    font-size: clamp(3.2rem, 18vw, 5.3rem);
  }

  .release-summary {
    gap: 18px 12px;
    margin-top: 26px;
    padding-top: 20px;
  }

  .download-panel {
    padding: 24px 22px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .download-facts {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
    gap: 16px;
    margin: 22px 0;
  }

  .beta-strip {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 22px;
  }

  .beta-actions {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
    min-width: 0;
  }

  .history-section {
    padding: 28px 22px;
  }

  .section-header {
    align-items: flex-start;
  }

  .history-table {
    display: grid;
    gap: 12px;
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .history-row.history-row-head {
    display: none;
  }

  #history-body {
    display: grid;
    gap: 12px;
  }

  .history-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
    overflow: hidden;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .history-cell {
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .history-cell:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .history-cell:nth-child(3),
  .history-cell:nth-child(4) {
    grid-column: 1 / -1;
    border-right: 0;
  }

  .history-cell:last-child {
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
