:root {
  color-scheme: light;
  --ink: #202923;
  --muted: #647168;
  --green: #246a48;
  --line: #dce3de;
  --wash: #f4f7f5;
  --paper: #fff;
  --danger: #a12e2e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.7 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: 0; }
button, .button { cursor: pointer; }
button, .button, input, select, textarea { border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
button, .button { min-height: 42px; padding: 8px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
button:hover, .button:hover { border-color: var(--green); }
button:disabled { opacity: .55; cursor: not-allowed; }
input, select, textarea { min-height: 42px; padding: 8px 10px; max-width: 100%; min-width: 0; }
input:not([type="checkbox"]), textarea { width: 100%; }
input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--green); }
textarea { resize: vertical; line-height: 1.7; }
input[type="file"] { font-size: 12px; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #2783c9; outline-offset: 3px; }
h1, h2, h3, p, figure { margin: 0; }
h1 { font-size: 28px; line-height: 1.4; }
h2 { font-size: 21px; line-height: 1.5; }
h3 { font-size: 17px; line-height: 1.55; }
p, h1, h2, h3, a, dd, dt, span, output, label { overflow-wrap: anywhere; }
.container { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 700; flex-shrink: 0; }
.brand img { border-radius: 7px; }
.brand-sub { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 12px; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 14px; }
.site-header nav a[aria-current="page"] { color: var(--green); font-weight: 600; }
.site-header nav a:hover, .footer a:hover, .text-link:hover, .related-links a:hover { text-decoration: underline; }
.muted, .card-meta, .card-summary, .result-count, figcaption { color: var(--muted); }
.catalog-page { min-height: 65vh; padding-block: 34px 0; }
.catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.catalog-heading .muted { margin-top: 6px; font-size: 13px; }
.search { display: flex; align-items: center; gap: 5px; width: 300px; max-width: 100%; }
.icon-button { width: 42px; height: 42px; padding: 0; flex: 0 0 42px; font-size: 22px; line-height: 1; }
.filter-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.categories { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.categories a { padding: 7px 0; border-bottom: 2px solid transparent; font-size: 13px; color: var(--muted); }
.categories a[aria-current="page"] { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.sort-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.sort-control select { max-width: 168px; }
.result-count { margin-block: 16px; font-size: 12px; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: stretch; }
.catalog-card { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; min-width: 0; display: flex; flex-direction: column; }
.catalog-card:hover { border-color: #8dafa0; }
.cover-link { display: block; }
.catalog-cover { width: 100%; aspect-ratio: 16 / 10; background: var(--wash); padding: 15px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.catalog-cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cover-missing { color: var(--muted); font-size: 13px; }
.card-body { padding: 17px; flex: 1; display: flex; flex-direction: column; }
.card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 7px; }
.catalog-card h2, .catalog-card h3 { font-size: 18px; }
.card-summary { font-size: 13px; margin-top: 7px; white-space: pre-wrap; }
.card-bottom { margin-top: auto; padding-top: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; }
.text-link { color: var(--green); font-size: 13px; }
.empty-state { grid-column: 1 / -1; padding: 60px 0; text-align: center; }
.empty-state h2 { font-size: 18px; margin-bottom: 15px; }
.service-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 30px; padding-block: 25px; margin-top: 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 24px; margin-top: 28px; font-size: 13px; }
.pagination a { padding: 10px 4px; color: var(--green); }
.pagination [aria-disabled="true"] { color: var(--muted); }
.footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-block: 26px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }
.footer div { display: flex; flex-direction: column; gap: 4px; }
.footer strong { font-size: 13px; color: var(--ink); }
.product-page { padding-block: 26px 48px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 28px; }
.product-heading { display: flex; justify-content: space-between; gap: 30px; align-items: center; }
.product-heading > div { min-width: 0; }
.product-heading h1 { margin-top: 6px; }
.product-summary { margin-top: 12px; max-width: 760px; color: var(--muted); }
.purchase { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; flex-shrink: 0; }
.purchase .price { font-size: 30px; }
.primary { background: var(--green); border-color: var(--green); color: #fff; }
.primary:hover { background: #174f34; color: #fff; }
.product-facts { display: flex; flex-wrap: wrap; gap: 20px 44px; border-block: 1px solid var(--line); padding-block: 18px; margin-block: 26px; }
dt { color: var(--muted); font-size: 12px; }
dd { margin: 4px 0 0; }
.product-preview { width: 100%; aspect-ratio: 1444 / 1160; background: var(--wash); }
.product-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.product-figure, .feature-screenshot { max-width: 900px; margin-inline: auto; }
.detail-section { margin-top: 38px; padding-top: 28px; border-top: 1px solid var(--line); }
.detail-section h2 { margin-bottom: 18px; }
.plain-text { white-space: pre-wrap; }
.feature-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; }
.feature-columns p { color: var(--muted); margin-top: 12px; font-size: 14px; }
.feature-columns ul { padding-left: 20px; color: var(--muted); font-size: 13px; }
.feature-screenshot { margin-top: 24px; }
.feature-screenshot img { display: block; width: 100%; height: auto; }
figcaption { font-size: 12px; margin-top: 10px; }
.related-links { display: flex; flex-wrap: wrap; gap: 14px 26px; color: var(--green); font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* Product management shares the storefront typography, not its page hierarchy. */
.admin-page { width: min(1320px, calc(100% - 64px)); padding-block: 30px 48px; min-height: 70vh; }
.admin-heading, .admin-toolbar, .editor-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.admin-heading { margin-bottom: 20px; }
.admin-heading h1 { font-size: 25px; }
.admin-actions, .form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-login { max-width: 460px; padding-block: 20px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.stack { display: grid; gap: 16px; }
.stack label, .form-grid label { display: grid; gap: 6px; font-size: 13px; }
.message { color: var(--danger); white-space: pre-wrap; margin-bottom: 16px; }
.message:empty { display: none; }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); gap: 32px; align-items: start; }
.admin-layout:has(.product-editor[hidden]) { grid-template-columns: minmax(0, 1fr); }
.admin-toolbar { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.admin-search { flex: 1; min-width: 160px; }
.admin-status-filter { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.admin-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-layout:has(.product-editor[hidden]) .admin-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-gallery .catalog-cover { aspect-ratio: 16 / 9; padding: 12px; }
.admin-gallery .card-body { padding: 14px; }
.admin-gallery h3 { font-size: 16px; }
.admin-gallery .card-bottom { padding-top: 14px; }
.publication { font-size: 12px; color: #825e12; }
.publication[data-status="published"] { color: var(--green); }
.switch-label { display: flex; align-items: center; gap: 7px; font-size: 12px; cursor: pointer; }
.product-editor { border-left: 1px solid var(--line); padding-left: 28px; min-width: 0; }
.editor-heading { margin-bottom: 18px; }
.editor-heading h2 { font-size: 21px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.full-width { grid-column: 1 / -1; }
.upload-field { padding-top: 16px; border-top: 1px solid var(--line); }
.upload-field output { font-size: 12px; color: var(--muted); display: block; white-space: pre-wrap; }
.conflict { margin-bottom: 20px; border-left: 3px solid #b4871b; padding: 12px 0 12px 16px; }
.conflict p { font-size: 13px; margin-block: 9px; }
.conflict h3 { font-size: 16px; }
.conflict dl { font-size: 12px; max-height: 340px; overflow: auto; margin-block: 14px; }
.conflict dl > div { padding-block: 7px; border-bottom: 1px solid var(--line); }
.conflict dd { white-space: pre-wrap; }
.conflict .confirm-label { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; }

@media (max-width: 1000px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout { grid-template-columns: minmax(0, 1fr) minmax(310px, 380px); gap: 22px; }
  .admin-gallery { grid-template-columns: minmax(0, 1fr); }
  .admin-layout:has(.product-editor[hidden]) .admin-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-heading { align-items: flex-start; flex-direction: column; gap: 20px; }
}
@media (max-width: 760px) {
  .container, .admin-page { width: calc(100% - 36px); }
  .header-inner { min-height: 72px; flex-wrap: wrap; gap: 14px; padding-block: 16px; }
  .site-header nav { gap: 12px 22px; font-size: 13px; }
  .catalog-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
  .search { width: 100%; }
  .catalog-page { padding-top: 25px; }
  h1 { font-size: 25px; }
  .feature-columns { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .admin-layout, .admin-layout:has(.product-editor[hidden]) { grid-template-columns: minmax(0, 1fr); }
  .product-editor { order: -1; border-left: 0; padding-left: 0; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
  .admin-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer { align-items: flex-start; gap: 16px 24px; }
  .footer > div { width: 100%; }
}
@media (max-width: 560px) {
  .catalog-grid, .admin-gallery, .admin-layout:has(.product-editor[hidden]) .admin-gallery { grid-template-columns: minmax(0, 1fr); }
  .catalog-cover { aspect-ratio: 16 / 10; }
  .catalog-heading { margin-bottom: 20px; }
  .filter-row { gap: 12px; }
  .categories { gap: 6px 17px; }
  .sort-control { width: 100%; justify-content: flex-end; }
  .service-links { justify-content: flex-start; gap: 12px 24px; }
  .purchase { width: 100%; justify-content: space-between; gap: 12px; }
  .brand { font-size: 19px; gap: 9px; }
  .brand-sub { font-size: 12px; margin-left: 8px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
