:root {
    color-scheme: light;
    --ink: #202326;
    --muted: #687077;
    --line: #dfe3e6;
    --soft-line: #eceff1;
    --surface: #ffffff;
    --surface-soft: #f5f6f7;
    --canvas: #eef0f1;
    --accent: #b62d27;
    --accent-dark: #8f211d;
    --green: #1e7148;
    --amber: #9a6417;
    --radius: 6px;
    --sidebar: 224px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; font-size: 14px; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
img { display: block; max-width: 100%; }
.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; }
.store-shell { width: min(1520px, calc(100% - 40px)); margin: 0 auto; }
.full { width: 100%; justify-content: center; }

.primary-button, .secondary-button, .danger-button, .small-button {
    min-height: 38px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid transparent; border-radius: 4px; font-weight: 700; white-space: nowrap;
    transition: background-color .16s ease, border-color .16s ease, transform .08s ease;
}
.primary-button, .small-button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.primary-button:hover, .small-button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.secondary-button, .small-button.secondary { color: var(--ink); background: var(--surface); border-color: #cbd0d3; }
.secondary-button:hover, .small-button.secondary:hover { border-color: #8d959a; background: var(--surface-soft); }
.danger-button { color: #fff; background: #8f211d; border-color: #8f211d; }
.primary-button:active, .secondary-button:active, .danger-button:active, .small-button:active { transform: translateY(1px); }
.small-button { min-height: 31px; padding: 0 10px; font-size: 12px; }
.danger-text { color: var(--accent) !important; }
button:disabled { cursor: not-allowed; opacity: .55; }

.store-header { height: 76px; color: #f7f7f7; background: #202326; border-top: 4px solid var(--accent); }
.header-inner { height: 72px; display: grid; grid-template-columns: minmax(250px, 1fr) minmax(280px, 520px); align-items: center; gap: 28px; }
.store-brand, .admin-brand, .login-brand, .install-heading { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: var(--accent); border-radius: 4px; font-size: 17px; font-weight: 800; }
.store-brand strong, .store-brand small, .admin-brand strong, .admin-brand small, .login-brand strong, .login-brand small { display: block; }
.store-brand strong { font-size: 18px; }
.store-brand small { margin-top: 3px; color: #aeb4b8; font-size: 10px; }
.header-search { height: 40px; display: grid; grid-template-columns: minmax(0, 1fr) 74px; overflow: hidden; background: #fff; border-radius: 4px; }
.header-search input { min-width: 0; padding: 0 13px; color: var(--ink); border: 0; outline: 0; }
.header-search button { color: #fff; background: var(--accent); border: 0; font-weight: 700; }
.store-subnav { height: 50px; background: var(--surface); border-bottom: 1px solid var(--line); }
.store-subnav-inner { height: 50px; display: flex; align-items: stretch; overflow-x: auto; scrollbar-width: none; }
.store-subnav-inner::-webkit-scrollbar { display: none; }
.store-subnav a { position: relative; min-width: 96px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #4f575c; border-bottom: 3px solid transparent; font-size: 14px; font-weight: 700; white-space: nowrap; transition: color .16s ease, background-color .16s ease, border-color .16s ease; }
.store-subnav a:hover { color: var(--accent); background: var(--surface-soft); }
.store-subnav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.store-subnav a:active { background: #eceff1; }

.store-home { padding: 8px 0 30px; }
.top-ad-strip { display: grid; gap: 0; margin-bottom: 0; }
.top-ad-strip a { overflow: hidden; background: transparent; border: 0; border-radius: 0; }
.top-ad-strip img { width: 100%; height: auto; object-fit: contain; background: #d9dddf; }
.grid-ad-strip { margin-bottom: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 120px; align-items: stretch; gap: 0; }
.grid-ad-strip a { min-width: 0; height: 120px; overflow: hidden; background: transparent; border: 0; border-radius: 0; }
.grid-ad-strip img { width: 100%; height: 100%; object-fit: fill; background: #d9dddf; }

.catalog-filters { margin-bottom: 14px; padding: 7px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filter-row { min-height: 47px; display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--soft-line); }
.filter-row:last-child { border-bottom: 0; }
.filter-row > strong { font-size: 12px; }
.filter-row > div { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.filter-row a { min-height: 29px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 3px; color: #555d62; font-size: 12px; }
.filter-row a:hover { background: var(--surface-soft); }
.filter-row a.active { color: #fff; background: var(--accent); }

.version-board { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.board-toolbar { min-height: 61px; padding: 11px 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.board-toolbar h1 { margin: 0; font-size: 16px; }
.board-toolbar div > span { margin-top: 4px; display: block; color: var(--muted); font-size: 10px; }
.board-toolbar form { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.board-toolbar select { height: 35px; padding: 0 28px 0 10px; color: var(--ink); background: var(--surface); border: 1px solid #cbd0d3; border-radius: 4px; }
.version-table-wrap { overflow-x: auto; }
.version-table { width: 100%; min-width: 1180px; border-collapse: collapse; table-layout: fixed; }
.version-table th { height: 40px; padding: 0 13px; color: #646b70; background: var(--surface-soft); border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; font-weight: 600; }
.version-table th:first-child { width: 53%; }
.version-table th:nth-child(2) { width: 10%; }
.version-table th:nth-child(3) { width: 12%; }
.version-table th:nth-child(4) { width: 9%; }
.version-table th:nth-child(5), .version-table th:nth-child(6) { width: 8%; text-align: center; }
.version-table td { min-height: 61px; padding: 11px 13px; border-bottom: 1px solid var(--soft-line); color: #565d62; font-size: 12px; vertical-align: middle; }
.version-table tbody tr:hover { background: #fafbfb; }
.version-table tbody tr:last-child td { border-bottom: 0; }
.version-title-cell a { min-width: 0; display: flex; align-items: flex-start; gap: 7px; font-size: 13px; font-weight: 700; line-height: 1.55; }
.version-title-cell a span { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.version-title-cell > small, .version-table td > small { margin-top: 5px; display: block; color: #8a9196; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.featured-label { flex: 0 0 auto; padding: 2px 5px; color: #fff; background: var(--accent); border-radius: 2px; font-size: 9px; }
.price-cell { color: var(--accent) !important; font-weight: 800; }
.price-cell.free { color: var(--green) !important; }
.action-cell { text-align: center; }
.empty-state, .admin-empty { min-height: 150px; padding: 25px; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-size: 15px; }
.simple-pagination { min-height: 55px; padding: 10px 15px; display: flex; align-items: center; justify-content: center; gap: 13px; border-top: 1px solid var(--line); }
.simple-pagination a, .simple-pagination span { min-height: 31px; padding: 0 10px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; }
.simple-pagination span { color: #9aa0a4; background: var(--surface-soft); }
.simple-pagination strong { font-size: 11px; }

.store-footer { min-height: 62px; color: #9fa5a9; background: #202326; }
.footer-inner { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 11px; }
.footer-inner a:hover { color: #fff; }
.detail-page, .narrow-page { padding: 24px 0 40px; }
.back-link { margin-bottom: 15px; display: inline-flex; align-items: center; color: #596167; font-size: 12px; font-weight: 700; }
.back-link:hover { color: var(--accent); }
.detail-breadcrumb { min-height: 26px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; color: #727a7f; font-size: 11px; }
.detail-breadcrumb a:hover { color: var(--accent); }
.detail-breadcrumb strong { min-width: 0; overflow: hidden; color: #51595e; text-overflow: ellipsis; white-space: nowrap; }
.detail-heading { position: relative; min-width: 0; padding: 25px 180px 24px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.detail-heading-copy { min-width: 0; max-width: none; margin: 0 auto; }
.detail-heading h1 { margin: 0; overflow: visible; font-size: 24px; font-weight: 700; line-height: 1.45; white-space: nowrap; }
.detail-heading-actions { position: absolute; top: 50%; right: 28px; transform: translateY(-50%); }
.detail-site-link { min-height: 36px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; font-size: 11px; font-weight: 700; }
.detail-site-link:hover { color: var(--accent); border-color: #b9c0c4; }
.detail-overview { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(420px, .78fr); gap: 25px; align-items: start; margin-top: 14px; padding: 21px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.detail-cover-gallery, .detail-facts { min-width: 0; }
.detail-gallery-heading, .detail-panel-heading { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.detail-gallery-heading > div, .detail-panel-heading > div { min-width: 0; }
.detail-gallery-heading strong, .detail-panel-heading strong { display: block; color: var(--ink); font-size: 13px; }
.detail-gallery-heading span, .detail-panel-heading span { display: block; margin-top: 3px; color: #8a9196; font-size: 10px; }
.detail-gallery-heading > span, .detail-panel-heading > span { flex: 0 0 auto; margin-top: 0; white-space: nowrap; }
.detail-cover { width: 100%; aspect-ratio: 16 / 10; margin: 9px 0 0; display: grid; place-items: center; overflow: hidden; background: #f0f2f3; border: 1px solid var(--line); border-radius: 4px; }
.detail-cover img { width: 100%; height: 100%; object-fit: contain; }
.detail-cover-empty { display: grid; place-items: center; align-content: center; gap: 7px; height: 100%; color: #fff; text-align: center; }
.detail-cover-empty span { color: #aeb4bd; font-size: 11px; }
.detail-facts { display: flex; flex-direction: column; }
.detail-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 9px 0 0; background: var(--line); border: 1px solid var(--line); }
.detail-specs > div { min-width: 0; min-height: 45px; display: grid; grid-template-columns: 78px minmax(0, 1fr); background: var(--surface-soft); }
.detail-specs dt, .detail-specs dd { min-width: 0; margin: 0; padding: 9px 10px; display: flex; align-items: center; overflow-wrap: anywhere; }
.detail-specs dt { color: var(--muted); background: #eef0f2; font-size: 10px; }
.detail-specs dd { color: var(--ink); font-size: 11px; font-weight: 700; }
.detail-acquire { display: flex; flex-direction: column; justify-content: center; flex: 1 1 auto; }
.detail-purchase { margin-top: 16px; padding: 15px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-price { flex: 0 0 auto; }
.detail-price span, .detail-price strong { display: block; }
.detail-price span { color: var(--muted); font-size: 11px; }
.detail-price strong { margin-top: 3px; color: var(--accent); font-size: 27px; line-height: 1.2; }
.detail-purchase p { max-width: 270px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; text-align: right; }
.detail-checkout { margin-top: 15px; display: grid; gap: 13px; }
.detail-actions { margin-top: 15px; display: grid; }
.detail-primary-action, .detail-secondary-action { min-height: 42px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 4px; font-size: 12px; font-weight: 700; }
.detail-primary-action { width: 100%; color: #fff; background: var(--accent); border-color: var(--accent); cursor: pointer; }
.detail-primary-action:hover { color: #fff; background: var(--accent-dark); border-color: var(--accent-dark); }
.detail-secondary-action { width: 100%; margin-top: 10px; color: var(--ink); background: var(--surface); border-color: var(--line); }
.detail-secondary-action:hover { color: var(--accent); border-color: #b9c0c4; }
.detail-assurance { margin-top: 15px; padding-top: 13px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 15px; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }
.detail-assurance span { position: relative; padding-left: 12px; }
.detail-assurance span::before { position: absolute; top: 5px; left: 1px; width: 5px; height: 5px; background: var(--green); border-radius: 50%; content: ""; }
.detail-content-panel { margin-top: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.detail-section-heading { min-height: 62px; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.detail-section-heading h2 { margin: 0; font-size: 18px; }
.detail-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.detail-section-heading > span { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.detail-article { min-height: 160px; padding: 26px 30px 32px; color: #535b60; font-size: 13px; line-height: 1.85; overflow-wrap: anywhere; }
.detail-notice { padding: 13px 15px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 12px; background: #fafbfb; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px; }
.detail-notice strong { padding: 4px 7px; color: var(--accent); background: #fff4f1; border-radius: 3px; font-size: 10px; white-space: nowrap; }
.detail-notice p { margin: 2px 0 0; color: #596167; font-size: 12px; line-height: 1.75; }
.detail-description { max-width: none; margin: 0; }
.plain-description { color: #535b60; font-size: 13px; line-height: 1.9; }
.detail-screenshots { max-width: none; margin: 28px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.detail-screenshots > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.detail-screenshots > header div { min-width: 0; }
.detail-screenshots h3 { margin: 0; color: var(--ink); font-size: 17px; }
.detail-screenshots header span { color: #8a9196; font-size: 10px; white-space: nowrap; }
.detail-media-grid { margin-top: 14px; display: grid; gap: 16px; }
.detail-media-grid figure { margin: 0; overflow: hidden; background: #f0f2f3; border: 1px solid var(--line); border-radius: 4px; }
.detail-media-grid img { width: 100%; height: auto; margin: 0 auto; object-fit: contain; }
.detail-extra-info { margin-top: 24px; padding-top: 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; border-top: 1px solid var(--line); }
.detail-extra-info section { padding: 14px; background: var(--surface-soft); border-radius: 4px; }
.detail-extra-info h3 { margin: 0 0 10px; color: var(--ink); font-size: 13px; }
.detail-extra-info ul { margin: 0; padding-left: 18px; display: grid; gap: 7px; color: #596167; font-size: 11px; line-height: 1.55; }
.checkout-form { display: grid; gap: 13px; }
.checkout-form label > span, .lookup-panel label > span { margin-bottom: 7px; display: block; color: #51595e; font-size: 11px; font-weight: 700; }
.contact-fields { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; }
.contact-fields select, .contact-fields input { width: 100%; min-width: 0; height: 40px; padding: 0 10px; color: var(--ink); background: var(--surface); border: 1px solid #cbd0d3; border-radius: 4px; }
.payment-methods { margin: 0; padding: 0; border: 0; }
.payment-methods legend { margin-bottom: 7px; color: #51595e; font-size: 11px; font-weight: 700; }
.payment-methods > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.payment-methods label { min-height: 42px; padding: 0 10px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #cbd0d3; border-radius: 4px; cursor: pointer; }
.payment-methods label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.payment-methods input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.payment-methods label > span { margin: 0; }
.payment-logo { width: 24px; height: 24px; flex: 0 0 auto; display: grid !important; place-items: center; margin: 0 !important; color: #fff !important; background: #1478d4; border-radius: 3px; font-size: 12px !important; font-weight: 800; }
.wechat .payment-logo, .payment-logo.wechat { background: #159447; }
.payment-methods strong { font-size: 11px; }
.payment-unavailable { padding: 11px; color: #7a5419; background: #fff6df; border: 1px solid #ead8a8; border-radius: 4px; font-size: 11px; }
.narrow-page { width: min(760px, calc(100% - 40px)); }
.order-panel, .lookup-panel { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.order-panel > header { min-height: 84px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.order-panel header span { color: var(--muted); font-size: 10px; }
.order-panel h1 { margin: 6px 0 0; font-size: 18px; overflow-wrap: anywhere; }
.status-badge { flex: 0 0 auto; padding: 7px 10px; border-radius: 3px; font-size: 11px; }
.status-badge.pending { color: var(--amber); background: #fff4dc; }
.status-badge.paid { color: var(--green); background: #e7f5ed; }
.status-badge.refunded, .status-badge.cancelled, .status-badge.expired { color: #656b6f; background: #eceeef; }
.order-line { min-height: 72px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.order-line strong, .order-line span { display: block; }
.order-line span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.order-line > strong { color: var(--accent); }
.payment-area { padding: 22px; display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: center; gap: 24px; }
.payment-area img { width: 180px; height: 180px; object-fit: contain; border: 1px solid var(--line); }
.payment-qr { display: grid; justify-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.payment-qr img { background: #fff; }
.payment-missing { color: var(--accent) !important; }
.payment-area h2, .paid-message h2 { margin: 0; font-size: 19px; }
.payment-area p, .paid-message p { margin: 8px 0 16px; color: var(--muted); line-height: 1.65; }
.order-panel > form { padding: 0 22px 22px; }
.paid-message { padding: 28px 22px 8px; text-align: center; }
.lookup-panel { padding: 26px; }
.lookup-panel h1 { margin: 0; font-size: 22px; }
.lookup-panel > p { margin: 8px 0 20px; color: var(--muted); }
.lookup-panel form { display: grid; gap: 15px; }
.lookup-panel input { width: 100%; height: 40px; padding: 0 10px; color: var(--ink); background: var(--surface); border: 1px solid #cbd0d3; border-radius: 4px; }

.flash { margin-bottom: 14px; padding: 11px 13px; border: 1px solid; border-radius: 4px; line-height: 1.55; font-size: 12px; }
.flash ul { margin: 5px 0 0; padding-left: 18px; }
.flash.success { color: #195f3d; background: #e8f5ee; border-color: #c8e5d5; }
.flash.error { color: #93231f; background: #fae9e8; border-color: #ecc6c4; }
.toast-stack { position: fixed; top: 76px; right: 22px; z-index: 80; width: min(390px, calc(100vw - 32px)); display: grid; gap: 8px; pointer-events: none; }
.toast-stack .flash { margin: 0; box-shadow: 0 8px 24px rgba(32,35,38,.14); pointer-events: auto; transition: opacity .22s ease, transform .22s ease; }
.toast-stack .flash.is-hidden { opacity: 0; transform: translateY(-6px); }

/* Admin */
.admin-body { min-height: 100dvh; background: #eef0f1; font-size: 15px; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); display: flex; flex-direction: column; color: #d9dde0; background: #202326; border-top: 4px solid var(--accent); }
.admin-brand { height: 75px; padding: 0 17px; border-bottom: 1px solid #35393c; }
.admin-brand .brand-mark { width: 38px; height: 38px; font-size: 15px; }
.admin-brand strong { color: #fff; font-size: 15px; }
.admin-brand small { margin-top: 4px; color: #8f969b; font-size: 11px; }
.admin-nav { min-height: 0; padding: 14px 10px; display: grid; gap: 3px; overflow-y: auto; }
.admin-nav a { min-height: 41px; padding: 0 12px; display: flex; align-items: center; border-radius: 4px; color: #abb2b7; font-size: 13px; font-weight: 700; }
.admin-nav a:hover { color: #fff; background: #2c3033; }
.admin-nav a.active { color: #fff; background: var(--accent); }
.sidebar-store-link { margin: auto 12px 14px; min-height: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid #454a4e; border-radius: 4px; color: #c2c7ca; font-size: 12px; }
.admin-workspace { min-height: 100dvh; margin-left: var(--sidebar); }
.admin-topbar { position: sticky; top: 0; z-index: 10; height: 64px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-title { font-weight: 800; }
.admin-user { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.admin-user form { margin: 0; }
.admin-user button { padding: 5px 7px; color: var(--accent); background: transparent; border: 0; font-weight: 700; }
.menu-toggle, .sidebar-mask { display: none; }
.admin-main { width: 100%; padding: 24px 28px 32px; }
.page-heading { min-height: 57px; margin-bottom: 15px; display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.page-heading h1 { margin: 0; font-size: 24px; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.page-actions { display: flex; align-items: center; gap: 8px; }
.page-actions form { margin: 0; }
.admin-section, .form-section { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.section-heading, .form-section > header { min-height: 54px; padding: 11px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.section-heading h2, .form-section > header h2 { margin: 0; font-size: 15px; }
.section-heading > a, .form-section > header a { color: var(--accent); font-size: 12px; font-weight: 700; }
.section-heading > span { color: var(--muted); font-size: 12px; }
.form-section > header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.metric-grid { margin-bottom: 15px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.metric-grid > div { min-width: 0; min-height: 94px; padding: 15px; display: flex; flex-direction: column; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.metric-grid span { color: var(--muted); font-size: 12px; }
.metric-grid strong { overflow: hidden; font-size: 22px; text-overflow: ellipsis; white-space: nowrap; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; min-width: 840px; border-collapse: collapse; }
.admin-table th { height: 42px; padding: 0 14px; color: #636a6f; background: var(--surface-soft); border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; font-weight: 700; }
.admin-table td { height: 58px; padding: 10px 14px; border-bottom: 1px solid var(--soft-line); color: #525a5f; font-size: 13px; vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table td > a { color: var(--accent); font-weight: 700; }
.admin-table td > small { margin-top: 4px; display: block; color: #8a9196; font-size: 11px; }
.status-text { display: inline-flex; align-items: center; min-height: 26px; padding: 0 8px; border-radius: 3px; color: #5d6469; background: #eceeef; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-text.paid, .status-text.published { color: var(--green); background: #e7f5ed; }
.status-text.pending { color: var(--amber); background: #fff4dc; }
.status-text.refunded, .status-text.cancelled, .status-text.expired { color: #686e72; background: #eceeef; }
.table-toolbar { min-height: 59px; padding: 10px 13px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.table-toolbar input { width: min(320px, 100%); }
.table-toolbar input, .table-toolbar select { height: 37px; padding: 0 10px; color: var(--ink); background: var(--surface); border: 1px solid #cbd0d3; border-radius: 4px; }
.table-toolbar .secondary-button { min-height: 37px; }
.order-toolbar { min-height: 59px; padding-right: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.order-toolbar .table-toolbar { min-width: 0; flex: 1; border-bottom: 0; }
.order-cleanup-form { flex: 0 0 auto; }
.order-cleanup-form .danger-button { min-height: 37px; white-space: nowrap; }
.order-cleanup-form .danger-button:disabled { cursor: not-allowed; opacity: .48; }
.section-tabs { margin-bottom: 10px; display: flex; align-items: center; gap: 4px; }
.section-tabs a { min-height: 37px; padding: 0 13px; display: inline-flex; align-items: center; gap: 6px; color: #656d72; background: #e4e7e9; border-radius: 4px; font-size: 12px; font-weight: 700; }
.section-tabs a.active { color: #fff; background: #202326; }
.section-tabs span { min-width: 18px; height: 18px; display: grid; place-items: center; color: #fff; background: var(--accent); border-radius: 3px; font-size: 9px; }
.admin-product-cell { min-width: 250px; display: flex; align-items: center; gap: 10px; }
.admin-product-cell img { width: 70px; height: 43px; flex: 0 0 auto; object-fit: cover; background: #e0e3e5; border-radius: 3px; }
.admin-product-cell strong, .admin-product-cell small { display: block; }
.admin-product-cell strong { max-width: none; overflow-wrap: anywhere; line-height: 1.45; white-space: normal; }
.admin-product-cell small { margin-top: 4px; max-width: 100%; overflow: hidden; color: #8a9196; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.row-actions { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.row-actions a, .row-actions button { padding: 3px 0; color: #4f575c; background: transparent; border: 0; font-size: 12px; font-weight: 700; }
.row-actions form { margin: 0; }
.product-admin-table { min-width: 1080px; table-layout: fixed; }
.product-admin-table .product-column { width: 45%; }
.product-admin-table .category-column { width: 12%; }
.product-admin-table .price-column { width: 8%; }
.product-admin-table .status-column { width: 9%; }
.product-admin-table .updated-column { width: 14%; }
.product-admin-table .actions-column { width: 12%; }
.product-admin-table td { height: 62px; }
.product-admin-table .row-actions { min-height: 42px; justify-content: flex-start; }

.product-editor { width: min(1080px, 100%); display: grid; gap: 13px; }
.rapid-product-editor, .rapid-product-editor ~ .asset-manager { width: 100%; max-width: none; }
.rapid-editor-panel > header > span { color: var(--muted); font-size: 11px; }
.rapid-form { padding: 4px 18px; }
.rapid-field-row { min-height: 61px; padding: 10px 0; display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 16px; border-bottom: 1px solid var(--soft-line); }
.rapid-field-row:last-child { border-bottom: 0; }
.rapid-field-row.align-start { align-items: start; }
.rapid-field-row > label:first-child, .rapid-field-row > .field-label { padding-top: 1px; color: #434b50; font-size: 12px; font-weight: 700; }
.rapid-field-row.align-start > label:first-child, .rapid-field-row.align-start > .field-label { padding-top: 10px; }
.rapid-field-row > input, .rapid-field-row > textarea, .rapid-field-row > div > input, .rapid-field-row > div > textarea, .compact-field-grid input, .compact-field-grid select, .rapid-price-row input, .upload-control > input[type="file"] {
    width: 100%; min-width: 0; color: var(--ink); background: var(--surface); border: 1px solid #cbd0d3; border-radius: 4px; outline: 0;
}
.rapid-field-row > input, .rapid-field-row > div > input, .compact-field-grid input, .compact-field-grid select, .rapid-price-row input { height: 39px; padding: 0 10px; }
.rapid-field-row > textarea { min-height: 265px; padding: 10px 12px; resize: vertical; line-height: 1.75; }
.rapid-field-row input:focus, .rapid-field-row select:focus, .rapid-field-row textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(182,45,39,.09); }
.rapid-field-row > div { min-width: 0; }
.rapid-full-width-control { width: 100%; }
.compact-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.compact-field-grid label { min-width: 0; display: grid; gap: 6px; }
.compact-field-grid label > span { color: #7b8388; font-size: 11px; }
.title-color-auto { min-height: 39px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.title-color-auto small { flex-basis: 100%; color: #7b8388; font-size: 11px; line-height: 1.5; }
.title-color-auto code { color: #697176; font-size: 11px; }
.title-color-dot { width: 24px; height: 24px; display: inline-block; background: var(--title-color); border: 2px solid #fff; border-radius: 3px; box-shadow: 0 0 0 1px #cbd0d3; }
.color-swatches { display: flex; align-items: center; gap: 6px; }
.color-swatches button { width: 25px; height: 25px; padding: 0; background: var(--swatch); border: 2px solid #fff; border-radius: 3px; box-shadow: 0 0 0 1px #cbd0d3; }
.color-swatches button:hover, .color-swatches button.active { box-shadow: 0 0 0 2px #737b80; }
.rapid-price-row { display: flex; align-items: center; gap: 18px; }
.rapid-price-row .price-field { width: min(320px, 100%); }
.inline-check { min-height: 39px; display: flex; align-items: center; gap: 7px; color: #50585d; font-size: 12px; font-weight: 700; }
.inline-check input { width: 17px; height: 17px; accent-color: var(--accent); }
.upload-control { min-width: 0; display: grid; gap: 7px; }
.upload-control > input[type="file"] { min-height: 39px; padding: 6px 8px; }
.upload-control > small { color: #7b8388; font-size: 11px; line-height: 1.5; }
.description-editor { min-width: 0; display: grid; gap: 8px; }
.description-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.description-tools small { color: #7b8388; font-size: 11px; line-height: 1.5; }
.compact-button { min-height: 32px; padding: 0 10px; font-size: 11px; }
.upload-preview { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.upload-preview[hidden] { display: none; }
.upload-preview figure { position: relative; aspect-ratio: 16 / 10; margin: 0; overflow: hidden; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 4px; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview figcaption { position: absolute; inset: auto 0 0; padding: 5px 7px; overflow: hidden; color: #fff; background: rgba(25,28,30,.76); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.upload-preview figure:first-child::before { content: "封面"; position: absolute; top: 5px; left: 5px; z-index: 1; padding: 3px 5px; color: #fff; background: var(--accent); border-radius: 2px; font-size: 10px; font-weight: 700; }
.rapid-submit { position: sticky; bottom: 0; z-index: 5; padding: 11px 0; background: var(--canvas); }
.rapid-submit .continue { background: #202326; border-color: #202326; }
.simple-form-grid, .upload-grid { padding: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.simple-form-grid label, .upload-grid label, .stack-form > label, .field-grid label, .install-form label { min-width: 0; display: grid; gap: 7px; color: #4e565b; font-size: 12px; font-weight: 700; }
.simple-form-grid label.wide, .upload-grid label.wide { grid-column: 1 / -1; }
.simple-form-grid input, .simple-form-grid select, .simple-form-grid textarea, .upload-grid input, .stack-form input, .stack-form select, .stack-form textarea, .install-form input {
    width: 100%; min-width: 0; color: var(--ink); background: var(--surface); border: 1px solid #cbd0d3; border-radius: 4px; outline: 0;
}
.simple-form-grid input, .simple-form-grid select, .upload-grid input, .stack-form input, .stack-form select, .install-form input { height: 39px; padding: 0 10px; }
.simple-form-grid textarea, .stack-form textarea { padding: 9px 10px; resize: vertical; line-height: 1.65; }
.simple-form-grid input:focus, .simple-form-grid select:focus, .simple-form-grid textarea:focus, .upload-grid input:focus, .stack-form input:focus, .stack-form select:focus, .install-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(182,45,39,.09); }
.simple-form-grid small, .upload-grid small, .stack-form small, .install-form small { color: #7b8388; font-size: 11px; font-weight: 400; line-height: 1.5; }
.check-field { align-self: end; min-height: 39px; display: flex !important; align-items: center; grid-template-columns: none !important; }
.check-field input { width: 17px !important; height: 17px !important; padding: 0 !important; accent-color: var(--accent); }
.color-field { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 8px; }
.color-field input { width: 48px; padding: 3px; }
.color-field code { height: 39px; padding: 0 10px; display: flex; align-items: center; color: #626a6f; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 4px; }
.price-field { display: grid; grid-template-columns: 35px minmax(0, 1fr); }
.price-field > span { display: grid; place-items: center; background: var(--surface-soft); border: 1px solid #cbd0d3; border-right: 0; border-radius: 4px 0 0 4px; }
.price-field input { border-radius: 0 4px 4px 0; }
.option-checks { min-height: 39px; display: flex; align-items: center; gap: 20px; }
.option-checks label { display: flex; align-items: center; gap: 7px; color: #50585d; font-size: 12px; font-weight: 700; }
.option-checks input { width: 17px; height: 17px; accent-color: var(--accent); }
.advanced-section summary { min-height: 61px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.advanced-section summary::-webkit-details-marker { display: none; }
.advanced-section summary span { display: grid; gap: 4px; }
.advanced-section summary strong { font-size: 14px; }
.advanced-section summary small { color: var(--muted); font-size: 11px; font-weight: 400; }
.advanced-section summary b { color: var(--accent); font-size: 12px; }
.advanced-section[open] summary { border-bottom: 1px solid var(--line); }
.editor-submit { padding-bottom: 4px; display: flex; gap: 8px; }
.asset-manager { width: min(1080px, 100%); margin-top: 13px; }
.asset-grid { padding: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.asset-grid figure { margin: 0; overflow: hidden; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 4px; }
.asset-grid img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.asset-grid figcaption { min-height: 38px; padding: 6px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.asset-grid button, .package-list button { padding: 2px; background: transparent; border: 0; font-size: 11px; font-weight: 700; }
.package-list { padding: 3px 15px; }
.package-list > div { min-height: 58px; padding: 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--soft-line); }
.package-list > div:last-child { border-bottom: 0; }
.package-list strong, .package-list span { display: block; }
.package-list span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.admin-empty.compact { min-height: 75px; }

.manager-layout { display: grid; grid-template-columns: minmax(360px, .72fr) minmax(0, 1.28fr); gap: 16px; align-items: start; }
.manager-form { position: sticky; top: 79px; }
.stack-form { padding: 17px; display: grid; gap: 14px; }
.stack-form > .primary-button { justify-self: start; }
.field-grid { display: grid; gap: 12px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.category-list { padding: 5px 14px; }
.category-list > div { min-height: 62px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--soft-line); }
.category-list > div:last-child { border-bottom: 0; }
.category-list > div > form:first-child { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(140px, 1fr) 72px 58px 85px 42px; align-items: center; gap: 7px; }
.category-list input { width: 100%; min-width: 0; height: 34px; padding: 0 8px; color: var(--ink); background: var(--surface); border: 1px solid #d3d7da; border-radius: 4px; }
.category-list label { display: flex; align-items: center; gap: 5px; font-size: 11px; }
.category-list label input { width: 15px; height: 15px; accent-color: var(--accent); }
.category-list span { color: var(--muted); font-size: 11px; }
.category-list button { padding: 4px; color: var(--accent); background: transparent; border: 0; font-size: 11px; font-weight: 700; }
.navigation-options { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.navigation-options label, .navigation-list label { display: flex; align-items: center; gap: 6px; color: #50585d; font-size: 12px; font-weight: 700; }
.navigation-options input, .navigation-list label input { width: 17px; height: 17px; accent-color: var(--accent); }
.navigation-list { padding: 5px 14px; }
.navigation-list > div { min-height: 66px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--soft-line); }
.navigation-list > div:last-child { border-bottom: 0; }
.navigation-edit-form { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(150px, 1.6fr) 70px 58px 72px 38px; align-items: center; gap: 6px; }
.navigation-edit-form > input { width: 100%; min-width: 0; height: 36px; padding: 0 9px; color: var(--ink); background: var(--surface); border: 1px solid #d3d7da; border-radius: 4px; outline: 0; }
.navigation-edit-form > input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(182,45,39,.09); }
.navigation-edit-form button { padding: 4px; color: var(--accent); background: transparent; border: 0; font-size: 11px; font-weight: 700; }
.ad-list { padding: 5px 14px; }
.ad-list article { min-height: 112px; padding: 12px 0; display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--soft-line); }
.ad-list article:last-child { border-bottom: 0; }
.ad-preview { width: 180px; height: 78px; display: grid; place-items: center; overflow: hidden; color: var(--muted); background: var(--surface-soft); border-radius: 4px; }
.ad-preview img { width: 100%; height: 100%; object-fit: contain; }
.ad-list article > div:nth-child(2) { min-width: 0; }
.ad-list strong, .ad-list span, .ad-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-list strong { font-size: 14px; }
.ad-list span { margin-top: 6px; color: #626a6f; font-size: 12px; }
.ad-list span .status-text { margin-left: 7px; display: inline-flex; vertical-align: middle; }
.ad-list small { margin-top: 5px; color: #8a9196; font-size: 11px; }
.ad-list .ad-schedule { color: #626a6f; }
.order-detail-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); gap: 14px; align-items: start; }
.order-detail-layout .detail-facts { margin: 0; padding: 8px 16px; }
.order-detail-layout .detail-facts > div, .payment-list dl > div { min-height: 39px; display: grid; grid-template-columns: 95px minmax(0, 1fr); align-items: center; gap: 10px; border-bottom: 1px solid var(--soft-line); }
.order-detail-layout .detail-facts > div:last-child, .payment-list dl > div:last-child { border-bottom: 0; }
.order-detail-layout .detail-facts dt, .payment-list dt { color: var(--muted); font-size: 11px; }
.order-detail-layout .detail-facts dd, .payment-list dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 700; }
.order-items { border-top: 1px solid var(--line); }
.order-items > div { padding: 13px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 14px; border-bottom: 1px solid var(--soft-line); }
.order-items > div:last-child { border-bottom: 0; }
.order-items span { color: var(--accent); font-weight: 700; }
.order-items small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.payment-list { padding: 5px 16px; }
.payment-list dl { margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.payment-list dl:last-child { margin-bottom: 0; border-bottom: 0; }
.settings-section { width: min(820px, 100%); }
.provider-status { padding: 6px 8px; color: #666d72; background: #eceeef; border-radius: 3px; font-size: 11px; font-weight: 700; }
.provider-status.enabled { color: var(--green); background: #e7f5ed; }
.toggle-row { min-height: 62px; display: flex !important; align-items: center; gap: 10px; }
.toggle-row input { width: 18px !important; height: 18px !important; accent-color: var(--accent); }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row small { margin-top: 4px; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) 62px; }
.copy-field input { border-radius: 4px 0 0 4px; background: var(--surface-soft); }
.copy-field button { color: #555d62; background: var(--surface-soft); border: 1px solid #cbd0d3; border-left: 0; border-radius: 0 4px 4px 0; font-size: 11px; font-weight: 700; }
.payment-form { gap: 16px; }
.payment-channel-card { margin: 0; padding: 15px; display: grid; gap: 13px; border: 1px solid var(--line); border-radius: 4px; }
.payment-channel-card legend { padding: 0 8px; display: flex; align-items: center; gap: 8px; }
.payment-channel-card legend strong { font-size: 12px; }
.payment-channel-card legend small { color: var(--muted); font-size: 11px; font-weight: 400; }
.payment-channel-card .toggle-row { min-height: 44px; }
.payment-credential-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.payment-credential-grid label, .payment-channel-card > label:not(.toggle-row) { min-width: 0; display: grid; gap: 7px; color: #4e565b; font-size: 12px; font-weight: 700; }
.payment-credential-grid input, .payment-channel-card input { width: 100%; min-width: 0; height: 39px; padding: 0 10px; color: var(--ink); background: var(--surface); border: 1px solid #cbd0d3; border-radius: 4px; outline: 0; }
.payment-channel-card .copy-field input { border-radius: 4px 0 0 4px; }
.form-note { margin: 0; padding: 10px 12px; color: #6b7378; background: var(--surface-soft); border-radius: 4px; font-size: 11px; line-height: 1.65; }

/* Login and installer */
.login-body, .install-body { min-height: 100dvh; padding: 28px 18px; display: grid; place-items: center; background: #202326; border-top: 4px solid var(--accent); }
.login-panel { width: min(420px, 100%); padding: 26px; background: #fff; border-radius: var(--radius); box-shadow: 0 18px 55px rgba(0,0,0,.25); }
.login-brand .brand-mark { width: 38px; height: 38px; }
.login-brand strong { color: var(--ink); }
.login-brand small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.login-panel h1 { margin: 27px 0 18px; font-size: 21px; }
.login-panel form { display: grid; gap: 14px; }
.login-panel label { display: grid; gap: 7px; color: #50585d; font-size: 11px; font-weight: 700; }
.login-panel input { width: 100%; height: 41px; padding: 0 10px; border: 1px solid #cbd0d3; border-radius: 4px; outline: 0; }
.login-panel input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(182,45,39,.09); }
.login-back { margin-top: 16px; display: block; color: var(--muted); text-align: center; font-size: 10px; }
.install-body { display: block; }
.install-shell { width: min(720px, 100%); margin: 0 auto; padding: 24px 28px; background: #fff; border-radius: var(--radius); box-shadow: 0 18px 55px rgba(0,0,0,.24); }
.install-heading { padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.install-heading h1 { margin: 0; font-size: 22px; }
.install-heading p { margin: 5px 0 0; color: #626a70; font-size: 11px; line-height: 1.6; }
.install-status { min-height: 47px; margin: 15px 0 17px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid; border-radius: 4px; }
.install-status strong { font-size: 11px; }
.install-status span { font-size: 10px; font-weight: 700; }
.install-status.passed { color: #195f3d; background: #e8f5ee; border-color: #c8e5d5; }
.install-status.failed { display: block; color: #93231f; background: #fae9e8; border-color: #ecc6c4; }
.install-status ul { margin: 8px 0 0; padding-left: 18px; font-size: 10px; line-height: 1.65; }
.install-form { display: grid; gap: 0; }
.install-section { padding: 17px 0; display: grid; gap: 13px; border-top: 1px solid var(--line); }
.install-status + .install-form .install-section:first-child, .flash + .install-form .install-section:first-child { border-top: 0; }
.install-section > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.install-section h2 { margin: 0; font-size: 13px; }
.install-section > header > span { color: #70787d; font-size: 9px; }
.install-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.install-field.has-error input { border-color: var(--accent); }
.install-form small.field-error { color: #93231f; font-weight: 700; }
.install-advanced { padding-top: 2px; }
.install-advanced summary { width: fit-content; color: #596167; font-size: 10px; font-weight: 700; cursor: pointer; }
.install-advanced[open] summary { margin-bottom: 12px; }
.install-actions { padding-top: 17px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); }
.install-actions p { margin: 0; color: #626a70; font-size: 9px; line-height: 1.55; }
.install-submit { min-width: 132px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .detail-heading { padding-right: 26px; padding-left: 26px; }
    .detail-heading-actions { position: static; margin: 14px auto 0; transform: none; }
    .detail-overview { grid-template-columns: minmax(280px, 1fr) minmax(360px, .9fr); gap: 20px; padding: 20px; }
    .manager-layout, .order-detail-layout { grid-template-columns: 1fr; }
    .manager-form { position: static; }
}

@media (max-width: 820px) {
    .store-shell, .narrow-page { width: min(100% - 24px, 1520px); }
    .store-header { height: auto; }
    .header-inner { height: auto; padding: 11px 0; grid-template-columns: 1fr; gap: 10px; }
    .store-brand small { display: none; }
    .grid-ad-strip { grid-template-columns: 1fr; }
    .filter-row { padding: 10px 0; grid-template-columns: 1fr; gap: 7px; }
    .version-table { min-width: 0; table-layout: auto; }
    .version-table thead { display: none; }
    .version-table tbody { padding: 5px 10px; display: grid; gap: 8px; }
    .version-table tr { padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border: 1px solid var(--line); border-radius: 4px; }
    .version-table td { min-height: 0; padding: 0; display: block; border: 0; }
    .version-table td[data-label]::before { content: attr(data-label); margin-bottom: 4px; display: block; color: #8a9196; font-size: 9px; }
    .version-title-cell { grid-column: 1 / -1; }
    .version-title-cell a span { white-space: normal; }
    .action-cell { display: flex !important; }
    .action-cell a { width: 100%; }
    .detail-overview { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 14px; }
    .detail-heading h1 { overflow-wrap: anywhere; white-space: normal; }
    .detail-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-specs > div { grid-template-columns: minmax(0, 1fr); }
    .detail-specs dt, .detail-specs dd { padding: 8px 10px; }
    .detail-specs dt { padding-bottom: 3px; background: var(--surface-soft); }
    .detail-specs dd { padding-top: 3px; }
    .detail-purchase { align-items: flex-start; gap: 14px; }
    .detail-purchase p { text-align: left; }
    .detail-extra-info { grid-template-columns: 1fr; }
    .admin-sidebar { width: min(280px, 86vw); transform: translateX(-100%); transition: transform .18s ease; }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-workspace { margin-left: 0; }
    .admin-topbar { height: 58px; padding: 0 12px; }
    .menu-toggle { width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
    .sidebar-mask.open { position: fixed; inset: 0; z-index: 15; display: block; background: rgba(0,0,0,.5); border: 0; }
    .admin-user > span { display: none; }
    .admin-main { padding: 15px 11px; }
    .page-heading { flex-direction: column; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .simple-form-grid, .upload-grid { padding: 14px; grid-template-columns: 1fr; }
    .simple-form-grid label.wide, .upload-grid label.wide { grid-column: 1; }
    .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .category-list > div { padding: 10px 0; grid-template-columns: 1fr auto; align-items: start; }
    .category-list > div > form:first-child { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .navigation-list > div { padding: 10px 0; align-items: start; }
    .navigation-edit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ad-list article { grid-template-columns: 110px minmax(0, 1fr); }
    .ad-preview { width: 110px; height: 62px; }
    .ad-list .row-actions { grid-column: 1 / -1; }
    .rapid-form { padding: 3px 14px; }
    .rapid-field-row { grid-template-columns: 1fr; gap: 7px; }
    .rapid-field-row.align-start > label:first-child, .rapid-field-row.align-start > .field-label { padding-top: 0; }
    .compact-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .upload-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .payment-credential-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .board-toolbar { align-items: stretch; flex-direction: column; }
    .board-toolbar form { justify-content: space-between; }
    .board-toolbar select { flex: 1; }
    .detail-heading { padding: 17px 15px; }
    .detail-heading h1 { font-size: 20px; }
    .detail-heading-actions { width: 100%; }
    .detail-heading-actions .detail-site-link { width: 100%; }
    .detail-gallery-heading, .detail-panel-heading { align-items: flex-start; }
    .detail-section-heading { align-items: flex-start; padding: 15px; }
    .detail-section-heading > span { display: none; }
    .detail-article { padding: 19px 15px 24px; }
    .detail-notice { grid-template-columns: 1fr; gap: 7px; }
    .detail-screenshots > header { align-items: flex-start; flex-direction: column; gap: 5px; }
    .payment-area { grid-template-columns: 1fr; text-align: center; }
    .payment-area img { margin: 0 auto; }
    .order-panel > header, .order-line { align-items: flex-start; flex-direction: column; }
    .contact-fields { grid-template-columns: 80px minmax(0, 1fr); }
    .detail-purchase { display: block; }
    .detail-purchase p { margin-top: 10px; }
    .detail-assurance { grid-template-columns: minmax(0, 1fr); }
    .metric-grid { grid-template-columns: 1fr; }
    .page-actions { width: 100%; }
    .page-actions > * { flex: 1; }
    .install-body { padding: 16px 10px; }
    .install-shell { padding: 20px 16px; }
    .install-grid { grid-template-columns: 1fr; }
    .install-section > header, .install-actions { align-items: stretch; flex-direction: column; }
    .install-submit { width: 100%; }
    .page-actions .primary-button, .page-actions .danger-button { width: 100%; }
    .table-toolbar { align-items: stretch; flex-direction: column; }
    .table-toolbar input, .table-toolbar select { width: 100%; }
    .order-toolbar { padding: 0; align-items: stretch; flex-direction: column; }
    .order-cleanup-form { padding: 0 13px 13px; }
    .order-cleanup-form .danger-button { width: 100%; }
    .editor-submit { display: grid; grid-template-columns: 1fr 1fr; }
    .rapid-submit { grid-template-columns: 1fr; }
    .rapid-price-row { align-items: stretch; flex-direction: column; gap: 7px; }
    .rapid-price-row .price-field { width: 100%; }
    .compact-field-grid { grid-template-columns: 1fr; }
    .upload-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .asset-grid { grid-template-columns: 1fr; }
    .package-list > div { align-items: flex-start; flex-direction: column; }
    .field-grid.two { grid-template-columns: 1fr; }
    .category-list > div > form:first-child { grid-template-columns: 1fr; }
    .category-list > div { grid-template-columns: 1fr; }
    .navigation-edit-form, .navigation-list > div { grid-template-columns: 1fr; }
    .ad-list article { grid-template-columns: 1fr; }
    .ad-preview { width: 100%; height: auto; aspect-ratio: 3 / 1; }
}

/* Storefront keeps the desktop information density at every window width.
   A narrow browser viewport scrolls horizontally instead of changing the page structure. */
.store-body {
    min-width: 1200px;
    overflow-x: auto;
}
.store-body .store-shell { width: min(1520px, calc(100% - 40px)); }
.store-body .narrow-page { width: min(760px, calc(100% - 40px)); }
.store-body .store-header { height: 76px; }
.store-body .header-inner { height: 72px; padding: 0; grid-template-columns: minmax(250px, 1fr) minmax(280px, 520px); gap: 28px; }
.store-body .store-brand small { display: block; }
.store-body .grid-ad-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.store-body .filter-row { padding: 0; grid-template-columns: 92px minmax(0, 1fr); gap: 0; }
.store-body .version-table { min-width: 1180px; table-layout: fixed; }
.store-body .version-table thead { display: table-header-group; }
.store-body .version-table tbody { padding: 0; display: table-row-group; }
.store-body .version-table tr { padding: 0; display: table-row; border: 0; border-radius: 0; }
.store-body .version-table td { min-height: 61px; padding: 11px 13px; display: table-cell; border-bottom: 1px solid var(--soft-line); }
.store-body .version-table td[data-label]::before { content: none; display: none; }
.store-body .action-cell { display: table-cell !important; }
.store-body .action-cell a { width: auto; }

.store-body .detail-heading { padding: 25px 180px 24px; }
.store-body .detail-heading h1 { overflow-wrap: normal; font-size: 24px; white-space: nowrap; }
.store-body .detail-heading-actions { position: absolute; top: 50%; right: 28px; width: auto; margin: 0; transform: translateY(-50%); }
.store-body .detail-heading-actions .detail-site-link { width: auto; }
.store-body .detail-overview { grid-template-columns: minmax(0, 1.22fr) minmax(420px, .78fr); gap: 25px; padding: 21px; }
.store-body .detail-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.store-body .detail-specs > div { grid-template-columns: 78px minmax(0, 1fr); }
.store-body .detail-specs dt, .store-body .detail-specs dd { padding: 9px 10px; }
.store-body .detail-specs dt { padding-bottom: 9px; background: #eef0f2; }
.store-body .detail-specs dd { padding-top: 9px; }
.store-body .detail-purchase { display: flex; align-items: center; gap: 18px; }
.store-body .detail-purchase p { margin-top: 0; text-align: right; }
.store-body .detail-extra-info { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.store-body .board-toolbar { align-items: center; flex-direction: row; }
.store-body .board-toolbar form { justify-content: initial; }
.store-body .board-toolbar select { flex: 0 0 auto; }
.store-body .detail-gallery-heading, .store-body .detail-panel-heading { align-items: center; }
.store-body .detail-section-heading { align-items: center; padding: 15px 20px; }
.store-body .detail-section-heading > span { display: block; }
.store-body .detail-article { padding: 26px 30px 32px; }
.store-body .detail-notice { grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
.store-body .detail-screenshots > header { align-items: baseline; flex-direction: row; gap: 12px; }
.store-body .payment-area { grid-template-columns: 180px minmax(0, 1fr); text-align: left; }
.store-body .payment-area img { margin: 0; }
.store-body .order-panel > header, .store-body .order-line { align-items: center; flex-direction: row; }
.store-body .contact-fields { grid-template-columns: 88px minmax(0, 1fr); }
.store-body .detail-purchase { display: flex; }
.store-body .detail-purchase p { margin-top: 0; }
.store-body .detail-assurance { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Storefront announcements and customer service */
.site-marquee { height: 40px; display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: stretch; overflow: hidden; color: #f4f5f6; background: #292d30; border-bottom: 1px solid #3a3f42; }
.site-marquee > strong { display: grid; place-items: center; color: #fff; background: var(--accent); font-size: 12px; }
.site-marquee-viewport { min-width: 0; display: flex; align-items: center; overflow: hidden; }
.site-marquee-content { width: max-content; min-width: 100%; padding: 0 18px; display: inline-block; color: #f4f5f6; font-size: 13px; font-weight: 700; line-height: 40px; text-align: right; white-space: nowrap; animation: site-marquee-scroll 24s linear infinite; }
.site-marquee a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.site-marquee-viewport:hover .site-marquee-content { animation-play-state: paused; }
@keyframes site-marquee-scroll { to { transform: translateX(-100%); } }

.customer-widget {
    position: fixed; top: 50%; right: max(10px, calc((100vw - 1520px) / 2 - 184px)); z-index: 30;
    width: 176px; overflow: hidden; color: var(--ink); background: var(--surface);
    border: 1px solid #cfd4d7; border-top: 3px solid var(--accent); border-radius: 6px 0 0 6px;
    box-shadow: 0 10px 28px rgba(32,35,38,.16); transform: translateY(-50%);
}
.customer-widget-toggle { width: 100%; min-height: 42px; padding: 0 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #fff; background: #292d30; border: 0; font-weight: 800; }
.customer-widget-toggle:hover { background: #202326; }
.customer-widget-toggle b { color: #bfc4c7; font-size: 10px; font-weight: 600; }
.customer-widget-body { padding: 5px 10px 10px; }
.customer-contact-row { min-height: 54px; padding: 8px 0; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--soft-line); }
a.customer-contact-row:hover strong { color: var(--accent); }
.customer-contact-mark { width: 32px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: var(--accent); border-radius: 4px; font-size: 11px; font-weight: 800; }
.customer-contact-row > span:last-child { min-width: 0; }
.customer-contact-row strong, .customer-contact-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-contact-row strong { font-size: 12px; }
.customer-contact-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.customer-wechat { padding-top: 11px; display: grid; justify-items: center; gap: 7px; text-align: center; }
.customer-wechat strong { font-size: 12px; }
.customer-wechat img { width: 140px; height: 140px; padding: 4px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.customer-wechat small { color: var(--muted); font-size: 10px; }
.customer-widget[data-collapsed="true"] { width: 46px; border-radius: 6px 0 0 6px; }
.customer-widget[data-collapsed="true"] .customer-widget-toggle { min-height: 116px; padding: 10px 0; justify-content: center; }
.customer-widget[data-collapsed="true"] .customer-widget-toggle span { writing-mode: vertical-rl; }
.customer-widget[data-collapsed="true"] .customer-widget-toggle b, .customer-widget[data-collapsed="true"] .customer-widget-body { display: none; }

/* Admin site settings */
.site-settings-form { display: grid; gap: 14px; }
.site-settings-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr); gap: 14px; align-items: start; }
.site-settings-grid .form-section > header span { color: var(--muted); font-size: 11px; }
.site-settings-grid .one-column { grid-template-columns: minmax(0, 1fr); }
.site-settings-grid .analytics-settings { grid-column: 1 / -1; }
.site-settings-actions { position: sticky; bottom: 0; z-index: 5; padding: 11px 0; background: var(--canvas); }
.site-settings-actions .primary-button { min-width: 160px; }
.analytics-code-input { min-height: 190px; font-family: Consolas, "Microsoft YaHei", monospace; font-size: 12px; }
.customer-qr-current { min-height: 112px; padding: 10px; display: flex; align-items: center; gap: 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 4px; }
.customer-qr-current img { width: 90px; height: 90px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.customer-qr-current label { display: flex; align-items: center; gap: 7px; color: #50585d; font-size: 12px; font-weight: 700; }
.customer-qr-current input { width: 17px; height: 17px; accent-color: var(--accent); }

@media (max-width: 1180px) {
    .site-settings-grid { grid-template-columns: minmax(0, 1fr); }
    .site-settings-grid .analytics-settings { grid-column: 1; }
}

@media (min-width: 900px) and (max-width: 1719px) {
    .store-body main { padding-right: 56px; }
    .customer-widget { right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .site-marquee-content { animation: none; }
}
