:root {
  color-scheme: light;
  --ground: #f6faf8;
  --surface: #fff;
  --ink: #102019;
  --muted: #687a72;
  --line: #dce6e1;
  --line-strong: #c7d6cf;
  --brand: #087553;
  --brand-hover: #0b8a62;
  --brand-soft: #e8f5ef;
  --shadow: 0 14px 34px -28px rgb(16 32 25 / 45%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark { width: 36px; height: 36px; flex: 0 0 auto; }
.brand h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: 0; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.access-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  color: #075f44;
  background: var(--brand-soft);
  border: 1px solid #c7e7d9;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
}

main { padding-block: 34px 56px; }

.intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.intro h2 { margin: 0; font-size: 24px; letter-spacing: 0; }
.intro p { margin: 6px 0 0; max-width: 680px; color: var(--muted); }

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  cursor: pointer;
}

.icon-button:hover { color: var(--brand); border-color: var(--brand); }
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.resource-group { margin-top: 28px; }
.group-heading { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.group-heading h2 { margin: 0; font-size: 15px; font-weight: 650; }
.group-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.table-wrap {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 13px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
thead { background: #f8fbf9; }
th { color: var(--muted); font-size: 11px; font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfc; }
th:nth-child(1) { width: 18%; }
th:nth-child(2) { width: 38%; }
th:nth-child(3) { width: 30%; }
th:nth-child(4) { width: 14%; }

td strong { font-weight: 620; }
td a:not(.open-button) { color: var(--brand); text-decoration: none; overflow-wrap: anywhere; }
td a:not(.open-button):hover { text-decoration: underline; }
code { color: #24372f; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.muted { color: var(--muted); }

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}

.open-button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}

.open-button {
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
}

.open-button:hover { background: var(--brand-hover); }

.back-link {
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.back-link:hover { text-decoration: underline; }
.releases-page { max-width: 1180px; }
.releases-intro { margin-bottom: 18px; }

.release-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.release-card {
  min-width: 0;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.release-card--empty { background: #f9fbfa; box-shadow: none; }
.release-card__top,
.release-row__title,
.release-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.release-card__top { justify-content: space-between; margin-bottom: 15px; }
.release-card strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.release-card > span { display: block; margin-top: 5px; color: var(--muted); font-size: 11.5px; }

.release-component,
.release-channel,
.release-platform,
.release-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1.3;
}

.release-component { color: #075f44; background: var(--brand-soft); font-weight: 650; }
.release-status { color: var(--brand); background: #f0f8f4; }
.release-channel, .release-platform { color: var(--muted); background: #f0f4f2; }

.release-history { margin-top: 34px; }
.history-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.history-heading h2 { margin: 0; font-size: 17px; }
.history-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.release-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.release-filters button {
  min-height: 30px;
  padding: 5px 9px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.release-filters button:hover { color: var(--brand); border-color: var(--brand); }
.release-filters button.is-active { color: #fff; background: var(--brand); border-color: var(--brand); }
.release-list { display: flex; flex-direction: column; gap: 9px; }
.release-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.release-row__main { min-width: 0; }
.release-row__title strong { overflow-wrap: anywhere; font-size: 14px; }
.release-notes { margin: 9px 0 0; color: #34483f; font-size: 12.5px; white-space: pre-wrap; }
.release-notes--empty { color: var(--muted); }
.release-meta { margin-top: 8px; color: var(--muted); font-size: 11.5px; }
.release-sha { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.release-row__action { flex: 0 0 auto; }
.release-state {
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

.release-state--error { color: #a3323b; background: #fff8f8; border-color: #edc9cd; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 10;
  padding: 9px 13px;
  color: #fff;
  background: #16342a;
  border-radius: 7px;
  box-shadow: 0 12px 30px -16px rgb(0 0 0 / 60%);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity .15s, transform .15s;
}

.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (max-width: 820px) {
  .shell { width: min(100% - 28px, 680px); }
  .header-inner { min-height: 74px; }
  main { padding-block: 26px 44px; }
  .intro h2 { font-size: 21px; }
  .group-heading { display: block; }
  .group-heading p { margin-top: 2px; }
  .table-wrap { overflow: visible; background: transparent; border: 0; box-shadow: none; }
  table, tbody { display: block; }
  thead { display: none; }
  tbody { display: grid; gap: 10px; }
  tr {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }
  th, td {
    width: auto !important;
    min-width: 0;
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
    padding: 6px 0;
    border: 0;
  }
  td::before {
    grid-column: 1;
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
  }
  td > * { grid-column: 2; }
  .actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; padding-top: 10px; }
  .actions::before { display: none; }
  .release-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-heading { display: block; }
  .release-filters { margin-top: 12px; }
}

@media (max-width: 520px) {
  .brand p { display: none; }
  .access-state { padding: 5px 7px; }
  .intro { align-items: center; }
  .intro p { font-size: 13px; }
  tr { grid-template-columns: 72px minmax(0, 1fr); }
  .release-summary { grid-template-columns: 1fr; }
  .release-row { align-items: flex-start; flex-direction: column; gap: 13px; }
  .release-row__action, .release-row__action .open-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
