/* 下载详情专属布局；产品矩阵复用 site-layout.css 的页面与卡片规则。 */
.products-page [hidden] { display: none; }
.products-heading { margin-bottom: 28px; }
.products-heading h1 { font-size: 34px; line-height: 1.4; font-weight: 600; letter-spacing: -.025em; }
.products-heading p { margin-top: 10px; color: var(--lp-muted); font-size: 14px; line-height: 1.8; }
.product-matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.product-platforms { grid-column: 2; margin-top: 20px; color: var(--lp-muted); font-size: 12px; line-height: 1.7; }
.product-entry-link span { transition: transform .2s ease; }
.product-entry:hover .product-entry-link span { transform: translateX(3px); }
.product-back { display: inline-flex; align-items: center; gap: 8px; color: var(--lp-muted); text-decoration: none; font-size: 13px; padding-block: 4px; }
.product-back:hover, .product-docs-link:hover { color: var(--lp-blue); }
.product-detail-heading { display: flex; align-items: center; gap: 16px; margin: 24px 0 32px; }
.product-detail-heading img { flex-shrink: 0; border-radius: 11px; object-fit: contain; }
.product-detail-heading h1 { font-size: 30px; font-weight: 600; line-height: 1.4; }
.product-detail-heading p { margin-top: 6px; color: var(--lp-muted); font-size: 14px; line-height: 1.7; }
.product-docs-link { display: inline-flex; gap: 8px; margin-left: auto; padding: 8px 0 8px 20px; color: var(--lp-muted); font-size: 13px; white-space: nowrap; text-decoration: none; }
.product-section-title { margin-bottom: 16px; font-size: 18px; font-weight: 600; line-height: 1.5; }
.download-list { overflow: hidden; border: 1px solid var(--lp-line); border-radius: 10px; background: #fff; }
.download-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 88px; align-items: center; gap: 12px 20px; padding: 22px 24px; }
.download-card + .download-card { border-top: 1px solid var(--lp-line); }
.download-icon { display: flex; align-items: center; justify-content: center; color: #536273; }
.download-copy h3 { font-size: 16px; line-height: 1.5; font-weight: 550; }
.download-copy p { margin-top: 4px; font-size: 13px; line-height: 1.6; color: var(--lp-muted); overflow-wrap: anywhere; }
.download-version { display: grid; gap: 5px; text-align: right; font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.download-version small { color: var(--lp-muted); font-size: 12px; }
.download-action { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 8px 16px; border-radius: 6px; background: var(--lp-ink); color: #fff; font-size: 13px; line-height: 1.5; text-decoration: none; transition: background .2s ease; }
.download-action:hover { background: #343944; }
.download-action { border: 0; font-family: inherit; cursor: pointer; }
.download-action:focus-visible {
  outline: 2px solid var(--lp-blue); outline-offset: 3px;
}
.download-list { display: grid; grid-template-columns: repeat(var(--platform-count, 1), minmax(0, 1fr)); overflow: visible; }
.download-platform-card { --download-hover-lift: 12px; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; padding: 28px 16px; text-align: center; }
.download-platform-card + .download-platform-card { border-top: 0; border-left: 1px solid var(--lp-line); }
.download-platform-action, .download-platform-unavailable { display: flex; flex-direction: column; align-items: center; width: 100%; }
.download-platform-action { gap: 24px; }
.download-platform-unavailable { gap: 0; }
.download-platform-unavailable .download-platform-title { margin-top: 24px; }
.download-platform-unavailable .download-unavailable { margin-top: 8px; }
.download-platform-action { width: max-content; max-width: 100%; min-width: min(152px, 100%); align-self: center; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-decoration: none; cursor: pointer; }
.download-platform-icon, .download-platform-hover { display: flex; align-items: center; justify-content: center; width: 92px; height: 92px; border-radius: 50%; background: #f5f6f7; color: #8e939b; }
.download-platform-icon img, .download-platform-icon svg { width: 38px; height: 38px; }
.download-platform-hover svg { width: 104px; height: 104px; max-width: 100%; flex: none; }
.download-platform-icon-stage { position: relative; display: block; width: min(152px, 100%); height: 152px; flex: none; transition: transform .4s ease; }
.download-platform-icon-stage .download-platform-icon, .download-platform-hover {
  position: absolute; inset: 0; margin: auto; transition: opacity .3s ease;
}
.download-platform-hover { width: 100%; height: 100%; opacity: 0; background: transparent; }
.download-platform-action:hover .download-platform-icon, .download-platform-action:focus-visible .download-platform-icon, .miniapp-action[aria-expanded="true"] .download-platform-icon { opacity: 0; }
.download-platform-action:hover .download-platform-hover, .download-platform-action:focus-visible .download-platform-hover, .miniapp-action[aria-expanded="true"] .download-platform-hover { opacity: 1; }
.download-platform-action:focus-visible, .download-option-link:focus-visible, .download-options-close:focus-visible { outline: 2px solid var(--lp-blue); outline-offset: 4px; }
.download-platform-action .download-platform-title { transition: transform .4s ease; }
.download-platform-title { font-size: 16px; font-weight: 550; }
.download-platform-hint { margin-top: 4px; color: #a7abb2; font-size: 12px; line-height: 1.5; opacity: 0; transition: opacity .4s ease, transform .4s ease; }
.download-platform-action:hover .download-platform-icon-stage, .download-platform-action:focus-visible .download-platform-icon-stage,
.download-platform-action:hover .download-platform-title, .download-platform-action:focus-visible .download-platform-title,
.download-platform-action:hover ~ .download-platform-hint, .download-platform-action:focus-visible ~ .download-platform-hint,
.miniapp-action[aria-expanded="true"] .download-platform-icon-stage, .miniapp-action[aria-expanded="true"] .download-platform-title, .miniapp-action[aria-expanded="true"] ~ .download-platform-hint { transform: translateY(calc(-1 * var(--download-hover-lift))); }
.download-platform-action:hover ~ .download-platform-hint, .download-platform-action:focus-visible ~ .download-platform-hint, .miniapp-action[aria-expanded="true"] ~ .download-platform-hint { opacity: 1; }
.download-platform-meta { margin-top: 8px; color: var(--lp-muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.download-platform-card .download-unavailable { font-size: 13px; text-align: center; }
.download-options {
  position: fixed; inset: 0; margin: auto; box-sizing: border-box; width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  overflow-y: auto; padding: 54px 48px 48px; color: var(--lp-ink); border: 0; border-radius: 12px;
  background: #fff; box-shadow: 0 16px 48px rgba(20, 28, 40, .2); text-align: center;
}
.download-options::backdrop { background: rgba(0, 0, 0, .65); }
.download-options-close { position: absolute; top: 14px; right: 20px; padding: 4px; border: 0; background: none; color: #92979e; font: inherit; font-size: 28px; line-height: 1; cursor: pointer; }
.download-options-title { margin: 0 0 32px; font-size: 24px; font-weight: 600; }
.download-options-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.download-option { flex: 1 1 220px; max-width: 300px; min-width: 0; }
.download-option-link { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 18px; border-radius: 8px; background: var(--lp-blue); color: #fff; font-size: 15px; font-weight: 550; text-decoration: none; }
.download-option-link:hover { filter: brightness(.92); }
.download-option-meta, .download-option-description { display: block; margin-top: 8px; color: var(--lp-muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.release-variants-admin { grid-column: 2 / -1; font-size: 13px; }
.release-variants-admin > summary { cursor: pointer; color: var(--lp-muted); }
.release-variant-admin { padding-top: 12px; }
.release-variant-admin > strong { font-weight: 500; }
.upload-field { display: grid; gap: 6px; font-size: 13px; }
.download-unavailable { grid-column: 3 / -1; color: var(--lp-muted); font-size: 13px; text-align: right; }
.download-card .release-admin-row { grid-column: 2 / -1; margin-top: 0; flex-wrap: wrap; }
.download-card .upload-panel { grid-column: 2 / -1; margin-top: 0; }
.release-admin-btn.danger:hover { opacity: 1; background: rgba(225, 29, 72, .08); }
.release-add-card { grid-column: 1 / -1; display: block; width: 100%; border: 0; border-top: 1px solid var(--lp-line); padding: 14px 24px; background: transparent; text-align: left; font: inherit; font-size: 13px; color: var(--lp-muted); cursor: pointer; }
.release-add-card:hover { color: var(--lp-blue); background: #f8faff; }
.miniapp-qr img { display: block; flex: none; width: 144px; height: 144px; max-width: 100%; object-fit: contain; }
.product-changelog { margin-top: 36px; }
.history-entry { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; padding: 24px 0; border-top: 1px solid var(--lp-line); }
.history-meta h3 { font-size: 16px; line-height: 1.5; font-weight: 550; overflow-wrap: anywhere; }
.history-meta time { display: block; margin-top: 8px; color: var(--lp-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.history-body h4 { font-size: 13px; line-height: 1.5; font-weight: 500; }
.history-body p { margin-top: 10px; color: var(--lp-muted); font-size: 14px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.product-status { padding-block: 20px; color: var(--lp-muted); font-size: 14px; line-height: 1.7; }
.download-list > .product-status { padding-inline: 24px; }
.product-more { display: inline-flex; padding: 8px 0; border: 0; background: transparent; color: var(--lp-blue); font: inherit; font-size: 13px; cursor: pointer; }
.product-more:disabled { opacity: .5; cursor: wait; }
.download-list > .product-more { margin: 0 24px 16px; }
/* ── 卡内上传面板（表单 → 进度，不遮罩页面）── */
.upload-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed var(--card-border);
  background: var(--close-bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upload-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.upload-file-name {
  flex: 1;
  font-size: 12px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}
.upload-input:focus { border-color: var(--input-focus-border); }
.upload-notes { resize: vertical; line-height: 1.6; }
.upload-actions { display: flex; gap: 8px; }
.release-admin-btn.primary {
  background: var(--cta-bg);
  color: var(--cta-color);
  border-color: transparent;
}
.upload-bar {
  height: 7px;
  background: var(--input-border);
  border-radius: 4px;
  overflow: hidden;
}
.upload-bar-fill {
  height: 100%;
  width: 0;
  background: var(--docs-accent, #4f6bff);
  border-radius: 4px;
  transition: width 0.25s ease;
}
.upload-status {
  font-size: 12.5px;
  color: var(--text-secondary);
  min-height: 17px;
}
.upload-status.error { color: var(--error); }

@media (max-width: 700px) {
  .products-heading h1 { font-size: 28px; }
  .product-matrix { grid-template-columns: 1fr; gap: 14px; }
  .product-detail-heading { flex-wrap: wrap; gap: 12px; margin-block: 20px 24px; }
  .product-detail-heading > div { flex: 1; min-width: 0; }
  .product-detail-heading h1 { font-size: 26px; }
  .product-docs-link { width: 100%; margin: 0; padding: 0 0 0 60px; }
  .download-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .download-card:not(.download-platform-card) { grid-template-columns: 28px minmax(0, 1fr) 76px; gap: 12px; padding: 18px; }
  .download-icon { grid-column: 1; grid-row: 1; }
  .download-copy { grid-column: 2; grid-row: 1; }
  .download-action { grid-column: 3; grid-row: 1 / 3; }
  .download-version { grid-column: 2; grid-row: 2; text-align: left; }
  .download-options { padding: 48px 20px 28px; }
  .download-card .release-admin-row, .download-card .upload-panel, .release-variants-admin { grid-column: 1 / -1; }
  .product-changelog { margin-top: 28px; }
  .history-entry { grid-template-columns: 1fr; gap: 12px; padding-block: 20px; }
  .history-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; }
  .history-meta time { margin: 0; }
}
@media (max-width: 360px) {
  .product-platforms { grid-column: 1 / -1; }
  .download-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .product-entry, .product-entry-link span, .download-action, .download-platform-icon-stage, .download-platform-icon-stage .download-platform-icon, .download-platform-hover, .download-platform-hint, .download-platform-action .download-platform-title { transition: none; }
  .product-entry:hover, .product-entry:hover .product-entry-link span { transform: none; }
}

.download-platform-card .release-admin-row { justify-content: center; }
.download-platform-card .release-variants-admin, .download-platform-card .upload-panel { width: 100%; text-align: left; }
.download-list > .product-status { grid-column: 1 / -1; }
.download-list > [data-new-package] { grid-column: 1 / -1; }
