/* 下载详情专属布局；产品矩阵复用 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, .download-option:focus-visible {
  outline: 2px solid var(--lp-blue); outline-offset: 3px;
}
.download-options {
  position: fixed; inset: auto; margin: 0; padding: 8px; box-sizing: border-box;
  width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  overflow-y: auto; overscroll-behavior: contain; color: var(--lp-ink);
  border: 1px solid var(--lp-line); border-radius: 12px; background: #fff;
  box-shadow: 0 12px 36px rgba(20, 28, 40, .14);
}
.download-options-title { margin: 0; padding: 8px 12px 12px; font-size: 14px; font-weight: 600; }
.download-option { display: block; padding: 12px; border-radius: 7px; color: inherit; text-decoration: none; }
.download-option + .download-option { border-top: 1px solid var(--lp-line); }
.download-option:hover, .download-option:focus-visible { background: #f5f7fa; }
.download-option-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
.download-option-heading strong { font-size: 14px; font-weight: 550; }
.download-option-heading > span { color: var(--lp-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.download-option > small { display: block; margin-top: 5px; 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; }
@supports not selector(:popover-open) {
  .download-options:not([hidden]) { position: static; grid-column: 1 / -1; width: 100%; box-shadow: none; }
}
.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 { 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; }
.product-downloads.has-miniapp { display: grid; grid-template-columns: minmax(0, 1fr) 208px; align-items: start; gap: 0 20px; }
.product-downloads.has-miniapp > .product-section-title { grid-column: 1 / -1; }
.product-miniapp { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; border: 1px solid var(--lp-line); border-radius: 10px; background: #fff; text-align: center; }
.product-miniapp h3 { font-size: 14px; line-height: 1.5; font-weight: 550; }
.product-miniapp p { margin-top: 0; color: var(--lp-muted); font-size: 13px; line-height: 1.6; }
.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: 1000px) {
  .product-downloads.has-miniapp { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .product-downloads.has-miniapp > .product-section-title { margin-bottom: 0; }
  .product-miniapp { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; text-align: left; align-items: center; }
  .product-miniapp h3 { align-self: end; }
  .product-miniapp p { grid-column: 1; grid-row: 2; align-self: start; }
  .product-miniapp .site-qr-frame { grid-column: 2; grid-row: 1 / 3; }
}
@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-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-unavailable { grid-column: 2 / -1; text-align: left; }
  .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; }
}
@media (prefers-reduced-motion: reduce) {
  .product-entry, .product-entry-link span, .download-action { transition: none; }
  .product-entry:hover, .product-entry:hover .product-entry-link span { transform: none; }
}
