:root {
  --brand-50: #f6eff6;
  --brand-100: #eadaea;
  --brand-300: #c6a9c3;
  --brand-500: #a87ca1;
  --brand-600: #956a8f;
  --brand-700: #7b5475;
  --neutral-0: #ffffff;
  --neutral-50: #fbfafc;
  --neutral-100: #f4f1f6;
  --neutral-200: #e9e3ed;
  --neutral-300: #d7cedd;
  --neutral-500: #93879c;
  --neutral-700: #5d5165;
  --neutral-800: #453b4d;
  --accent-sky: #8ec7dc;
  --accent-pink: #e6afc9;
  --accent-lilac: #c7a9d6;
  --success: #7fbf9b;
  --warning: #e3a96c;
  --error: #d7769a;
  --info: #79b7d6;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --shadow-sm: 0 2px 8px rgba(75, 51, 72, 0.08);
  --shadow-md: 0 6px 18px rgba(75, 51, 72, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans", "Yu Gothic",
    "Malgun Gothic", "Apple SD Gothic Neo", "Microsoft YaHei", sans-serif;
  font-size: var(--text-md);
  line-height: 24px;
  color: var(--neutral-700);
  background: linear-gradient(180deg, var(--neutral-50), #f8f4f8);
  min-height: 100vh;
}

h1,
h2,
h3 {
  margin: 0 0 var(--space-2);
  color: var(--neutral-800);
}

h1 {
  font-size: var(--text-xl);
  line-height: 30px;
  font-weight: 700;
}

h2 {
  font-size: var(--text-2xl);
  line-height: 34px;
  font-weight: 700;
}

h3 {
  font-size: var(--text-lg);
  line-height: 28px;
  font-weight: 600;
}

p {
  margin: 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--neutral-100);
  padding: 1px 6px;
  border-radius: 4px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) var(--space-8);
  background: rgba(251, 250, 252, 0.9);
  border-bottom: 1px solid var(--neutral-200);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--brand-500);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.logo-sm {
  width: 32px;
  height: 32px;
  font-size: var(--text-sm);
}

.brand p {
  color: var(--neutral-500);
  font-size: var(--text-sm);
}

.topbar-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.lang-switcher {
  position: relative;
  margin-left: var(--space-1);
}

.lang-switcher-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  background: var(--neutral-0);
  color: var(--neutral-700);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.lang-switcher-btn:hover {
  background: var(--brand-50);
  border-color: var(--brand-300);
  color: var(--brand-700);
}

.lang-switcher-btn:focus-visible {
  outline: 2px solid var(--brand-300);
  outline-offset: 2px;
}

.lang-switcher-btn[aria-expanded="true"] {
  background: var(--brand-50);
  border-color: var(--brand-300);
  color: var(--brand-700);
}

.lang-switcher-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 132px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  background: var(--neutral-0);
  box-shadow: var(--shadow-md);
}

.lang-menu[hidden] {
  display: none;
}

.lang-menu li {
  margin: 0;
}

.lang-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--neutral-700);
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
}

.lang-menu button:hover {
  background: var(--brand-50);
  color: var(--brand-700);
}

.lang-menu button.is-active {
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 600;
}

.page {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: var(--space-6) var(--space-8) var(--space-8);
  display: grid;
  gap: var(--space-6);
}

.card {
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
}

.intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
}

.product-picker {
  display: grid;
  gap: var(--space-4);
}

.product-picker-head h2 {
  margin: 0;
}

.product-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.product-card {
  appearance: none;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: var(--space-2);
  min-height: 132px;
  padding: var(--space-5) var(--space-5);
  background: var(--neutral-0);
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--neutral-700);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.product-card:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.product-card.active {
  border-color: var(--brand-500);
  background: linear-gradient(180deg, #fff, var(--brand-50));
  box-shadow: 0 0 0 3px rgba(168, 124, 161, 0.18), var(--shadow-md);
}

.product-card-name {
  font-size: var(--text-xl);
  line-height: 28px;
  font-weight: 700;
  color: var(--neutral-800);
}

.product-card.active .product-card-name {
  color: var(--brand-700);
}

.product-card-desc {
  font-size: var(--text-sm);
  color: var(--neutral-500);
}

.product-card-meta {
  margin-top: auto;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--brand-600);
}

.product-bar {
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
}

.effects-docs-card {
  margin-bottom: var(--space-4);
}

.effects-docs-head {
  margin-bottom: var(--space-3);
}

.effects-docs-title {
  margin: 0 0 var(--space-1);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--neutral-900);
}

.effects-docs-desc {
  margin: 0;
}

.effects-docs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.effects-doc-btn {
  gap: var(--space-2);
  min-height: 40px;
  height: auto;
  padding: 8px var(--space-4);
  text-align: center;
  white-space: normal;
  line-height: 1.35;
}

.effects-doc-state {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--neutral-500);
}

.row-between.compact {
  margin-bottom: 0;
  align-items: center;
}

.notice {
  margin: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--neutral-200);
  background: var(--neutral-50);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}

.notice.warning,
.bandwidth-tip {
  border-color: rgba(232, 179, 123, 0.4);
  background: rgba(232, 179, 123, 0.16);
}

.muted {
  color: var(--neutral-500);
  font-size: var(--text-sm);
}

.btn {
  height: 40px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-primary {
  background: var(--brand-500);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-600);
}

.btn-secondary {
  background: #fff;
  border-color: var(--brand-300);
  color: var(--brand-700);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--brand-50);
}

.btn-block {
  width: 100%;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
}

.chip-success {
  background: rgba(156, 207, 184, 0.2);
  color: #39684f;
}

.chip-warning {
  background: rgba(232, 179, 123, 0.25);
  color: #7e542b;
}

.chip-info {
  background: rgba(142, 199, 220, 0.2);
  color: #2e6076;
}

.chip-pink {
  background: rgba(230, 175, 201, 0.26);
  color: #7c4761;
}

.pkg-code {
  font-size: var(--text-xs);
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-xs);
  padding: 2px 8px;
}

.release-card {
  display: grid;
  gap: var(--space-6);
}

.release-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--neutral-200);
}

.eyebrow {
  margin: 0 0 var(--space-1);
  color: var(--brand-600);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.release-head h2 {
  margin-bottom: var(--space-1);
  font-size: 30px;
  line-height: 1.2;
  color: var(--brand-700);
}

.release-notes {
  margin-top: calc(-1 * var(--space-2));
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
}

.release-notes-label {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--brand-700);
}

.release-notes p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--neutral-700);
}

.release-notes.is-empty {
  background: var(--neutral-50);
  border-color: var(--neutral-200);
}

.archive-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.archive-toggle-text h2 {
  margin-bottom: 2px;
}

.archive-chevron {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--brand-300);
  background: var(--brand-50);
  flex-shrink: 0;
  position: relative;
}

.archive-chevron::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--brand-700);
  border-bottom: 2px solid var(--brand-700);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.18s ease;
}

.archive-card.is-expanded .archive-chevron::before {
  transform: translateY(2px) rotate(225deg);
}

.archive-content {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--neutral-200);
  display: grid;
  gap: var(--space-4);
}

.archive-content[hidden] {
  display: none;
}

.pkg-groups {
  display: grid;
  gap: var(--space-5);
}

.pkg-group-head {
  margin-bottom: var(--space-3);
}

.pkg-group-head h3 {
  margin-bottom: 2px;
}

.slot-list {
  display: grid;
  gap: var(--space-2);
}

.slot-list-firmware-dual {
  gap: var(--space-3);
}

.firmware-notice {
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(227, 169, 108, 0.55);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(227, 169, 108, 0.14), rgba(251, 250, 252, 0.9));
}

.firmware-notice-title {
  margin: 0 0 var(--space-2);
  font-weight: 700;
  color: var(--neutral-800);
}

.firmware-notice-list {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 4px;
  color: var(--neutral-700);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.firmware-notice-tip {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
}

.slot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  background: var(--neutral-50);
}

.slot-row.firmware-standard {
  border-color: rgba(121, 183, 214, 0.55);
  background: linear-gradient(90deg, rgba(121, 183, 214, 0.1), var(--neutral-50));
}

.slot-row.firmware-v2 {
  border-color: rgba(127, 191, 155, 0.55);
  background: linear-gradient(90deg, rgba(127, 191, 155, 0.12), var(--neutral-50));
}

.slot-hint {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--neutral-700);
}

.slot-row.store-row {
  background: linear-gradient(90deg, rgba(142, 199, 220, 0.12), var(--neutral-50));
  border-color: rgba(142, 199, 220, 0.45);
}

.slot-row.is-empty {
  opacity: 0.72;
}

.slot-main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.slot-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.slot-platform {
  font-weight: 600;
  color: var(--neutral-800);
}

.slot-file {
  font-size: var(--text-sm);
  color: var(--neutral-700);
  word-break: break-all;
}

.empty-block {
  text-align: center;
  padding: var(--space-6) var(--space-4);
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tab {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--neutral-200);
  background: var(--neutral-50);
  color: var(--neutral-700);
  cursor: pointer;
  font-size: var(--text-sm);
}

.tab.active,
.tab:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
  color: var(--brand-700);
}

.code {
  margin-top: var(--space-4);
  background: var(--neutral-100);
  border-radius: var(--radius-sm);
  border: 1px solid var(--neutral-200);
  padding: var(--space-4);
  font-size: var(--text-sm);
  overflow: auto;
  line-height: 1.6;
}

.actions-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(69, 59, 77, 0.3);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 40;
}

.modal-mask.show {
  display: flex;
}

.modal {
  width: min(480px, 100%);
  border-radius: var(--radius-lg);
}

.modal p {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}

.toast {
  position: fixed;
  right: var(--space-6);
  bottom: var(--space-6);
  background: var(--brand-700);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.22s ease;
  z-index: 50;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.footer-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--neutral-200);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.footer-brand strong {
  color: var(--neutral-800);
  font-size: var(--text-lg);
  line-height: 28px;
}

.footer-copy {
  margin: 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--neutral-200);
  width: 100%;
  font-size: var(--text-sm);
  line-height: 22px;
}

.beian-link {
  color: var(--brand-700);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.beian-link:hover {
  border-bottom-color: var(--brand-300);
}

@media (max-width: 960px) {
  .intro,
  .row-between,
  .release-head,
  .slot-row {
    flex-direction: column;
    align-items: stretch;
  }

  .product-card-grid {
    grid-template-columns: 1fr;
  }

  .slot-row .btn {
    width: 100%;
  }

  .effects-docs-actions {
    flex-direction: column;
  }

  .effects-doc-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: var(--space-4);
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .lang-switcher {
    margin-left: auto;
  }

  .page {
    padding: var(--space-4);
  }

  .release-head h2 {
    font-size: 26px;
  }
}
