:root {
    --ink: #1d2939;
    --muted: #667085;
    --line: #e4e7ec;
    --canvas: #f7f8fa;
    --surface: #ffffff;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --warm: #b45309;
    --danger: #b42318;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.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; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
a { color: inherit; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: 1px; text-decoration: none; white-space: nowrap; }
.main-nav { display: flex; align-items: center; gap: 18px; font-size: 14px; color: var(--muted); }
.main-nav a { text-decoration: none; white-space: nowrap; }
.main-nav a:hover, .main-nav a:focus { color: var(--accent-dark); }
.nav-primary { color: var(--accent-dark) !important; font-weight: 700; }
.nav-count { display: inline-flex; min-width: 18px; height: 18px; align-items: center; justify-content: center; margin-left: 4px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; }
.page-main { min-height: calc(100vh - 126px); padding: 28px 0 56px; }
.compare-dock { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px max(16px, calc((100% - 1180px) / 2)); border-bottom: 1px solid #b8d8d4; background: #e7f5f2; color: var(--accent-dark); }
.compare-dock > div:first-child { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.compare-dock-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.compare-dock .button { min-height: 34px; padding: 6px 11px; }
.conversion-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 22px; padding: 13px 16px; border: 1px solid #fedf89; border-radius: 7px; background: #fffaeb; color: #7a2e0b; }
.conversion-strip div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.conversion-strip strong { font-size: 15px; }
.conversion-strip span { color: #93370d; font-size: 13px; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; }
.footer-inner { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.footer-inner a { color: var(--accent-dark); text-decoration: none; }
.page-title-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--accent-dark); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 36px; line-height: 1.15; }
h2 { font-size: 22px; }
.lead { max-width: 640px; margin-bottom: 0; color: var(--muted); line-height: 1.7; }
.search-form { display: flex; min-width: min(360px, 100%); gap: 8px; }
.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.catalog-filter-form { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.catalog-filter-form label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.catalog-filter-form select { width: auto; min-width: 150px; min-height: 38px; }
.catalog-filter-form input[type="checkbox"] { width: 17px; min-height: 17px; }
.stock-filter { white-space: nowrap; }
input, select, textarea { width: 100%; min-height: 42px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: var(--ink); padding: 9px 11px; font: inherit; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #99d5cf; border-color: var(--accent); }
button, .button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 6px; padding: 9px 15px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--accent-dark); }
.button-secondary { border-color: #cfd4dc; background: #fff; color: var(--ink); }
.button-secondary:hover { background: #f2f4f7; color: var(--ink); }
.button-danger { border-color: #fecdca; background: #fff; color: var(--danger); }
.button-danger:hover { background: #fff1f0; }
.catalog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.product-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.product-card a { text-decoration: none; }
.product-image { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #eef1f2; }
.product-image.placeholder { object-fit: contain; padding: 30px; color: var(--muted); }
.product-card-body { padding: 14px; }
.product-name { min-height: 44px; margin-bottom: 10px; font-size: 15px; line-height: 1.45; }
.product-meta { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 6px 8px; color: var(--muted); font-size: 12px; }
.product-facts { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.product-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.compare-toggle { min-height: 34px; padding: 7px 10px; background: #fff; border-color: #b8d8d4; color: var(--accent-dark); font-size: 12px; }
.compare-toggle:hover, .compare-toggle.is-selected { background: #e7f5f2; color: var(--accent-dark); }
.card-detail-link { color: var(--accent-dark); font-size: 12px; font-weight: 700; text-decoration: none; }
.price { color: var(--warm); font-size: 18px; font-weight: 800; }
.product-fact { color: var(--muted); }
.stock-ok { color: var(--accent-dark); }
.stock-low { color: var(--warm); }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }
.pagination a, .pagination span { min-width: 36px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; text-align: center; text-decoration: none; }
.pagination .current { border-color: var(--accent); background: var(--accent); color: #fff; }
.notice { margin: 0 0 18px; padding: 12px 14px; border: 1px solid; border-radius: 6px; line-height: 1.55; }
.notice-error { border-color: #fecdca; background: #fff1f0; color: var(--danger); }
.notice-success { border-color: #a6f4c5; background: #ecfdf3; color: #067647; }
.status-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.status-strip span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--muted); font-size: 12px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 32px; align-items: start; }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.gallery-main { grid-column: 1 / -1; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #eef1f2; }
.gallery-thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border: 1px solid var(--line); background: #eef1f2; }
.detail-panel { padding: 22px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.detail-panel h1 { font-size: 28px; }
.detail-code { color: var(--muted); font-size: 13px; }
.detail-selling-point { margin: 12px 0; color: #475467; line-height: 1.6; }
.detail-price { margin: 20px 0; color: var(--warm); font-size: 30px; font-weight: 800; }
.detail-facts { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.detail-service-strip { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
.detail-service-strip span { padding: 5px 8px; border: 1px solid #d0d5dd; border-radius: 5px; color: var(--muted); font-size: 12px; }
.detail-coupon { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 15px; padding: 10px 12px; border: 1px solid #fedf89; border-radius: 6px; background: #fffaeb; color: #7a2e0b; }
.detail-coupon div { display: grid; gap: 3px; }
.detail-coupon span { color: #93370d; font-size: 12px; }
.detail-coupon a { color: #9c2c00; font-size: 12px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.field-label { display: block; margin: 16px 0 7px; font-weight: 700; }
.buy-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; margin-top: 20px; }
.description { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); color: #475467; line-height: 1.75; white-space: pre-wrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
th { background: #f9fafb; color: var(--muted); font-size: 12px; font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.summary-panel { padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; margin: 12px 0; color: var(--muted); }
.summary-total { padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink); font-size: 20px; font-weight: 800; }
.empty-state { padding: 52px 20px; border: 1px dashed #cfd4dc; border-radius: 7px; background: #fff; text-align: center; color: var(--muted); }
.form-panel { width: min(100%, 540px); margin: 0 auto; padding: 24px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.form-panel h1 { font-size: 26px; }
.form-help { color: var(--muted); line-height: 1.6; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.metric { padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { margin-top: 6px; font-size: 25px; font-weight: 800; }
.state-list { display: grid; gap: 10px; }
.state-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.state-ok { color: #067647; font-weight: 700; }
.state-blocked { color: var(--warm); font-weight: 700; }
.small { color: var(--muted); font-size: 13px; }
.inline-form { display: inline; }
.cart-quantity-form { display: flex; align-items: center; gap: 6px; min-width: 150px; }
.cart-quantity-form input { width: 66px; min-height: 34px; padding: 6px 8px; }
.cart-quantity-form button { min-height: 34px; padding: 6px 9px; font-size: 12px; }
.coupon-list { display: grid; gap: 12px; }
.coupon-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.coupon-row h2 { margin-bottom: 6px; font-size: 17px; }
.coupon-row p { margin-bottom: 5px; }
.coupon-value { color: var(--warm); font-size: 18px; font-weight: 800; }
.coupon-row.claimed { background: #f9fafb; }
.section-heading { margin-top: 30px; }
.compare-heading { align-items: center; }
.compare-heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.compare-scroll { overflow-x: auto; border: 1px solid var(--line); background: #fff; }
.compare-table { min-width: 760px; table-layout: fixed; }
.compare-table th, .compare-table td { min-width: 190px; }
.compare-table .compare-label-col { width: 150px; min-width: 150px; }
.compare-table thead th { vertical-align: top; background: #f8fafb; }
.compare-product-head { display: grid; gap: 8px; min-height: 220px; align-content: start; }
.compare-product-head a { display: grid; gap: 8px; color: var(--ink); text-decoration: none; }
.compare-product-head img, .compare-image-placeholder { display: block; width: 100%; aspect-ratio: 1 / 1; max-height: 160px; object-fit: contain; background: #eef1f2; }
.compare-image-placeholder { display: grid; place-items: center; color: var(--muted); font-weight: 500; }
.compare-product-head strong { min-height: 42px; line-height: 1.45; }
.compare-remove { min-height: 30px; padding: 5px 9px; border-color: #fecdca; background: #fff; color: var(--danger); font-size: 12px; }
.compare-remove:hover { background: #fff1f0; }
.compare-table tbody th { width: 150px; color: var(--muted); }
.compare-table tbody td { line-height: 1.6; }
.compare-ok { color: #067647; font-weight: 700; }
.compare-warn { color: var(--warm); font-weight: 700; }
.compare-sku-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.compare-sku-list li { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.compare-sku-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.compare-sku-list span { color: var(--muted); font-size: 12px; }
.compare-note { margin-top: 12px; }

@media (max-width: 980px) {
    .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .shell { width: min(100% - 22px, 1180px); }
    .header-inner { min-height: 60px; align-items: flex-start; padding: 14px 0; flex-direction: column; gap: 10px; }
    .main-nav { width: 100%; gap: 12px; overflow-x: auto; }
    .page-main { padding-top: 22px; }
    .page-title-row { align-items: stretch; flex-direction: column; }
    h1 { font-size: 28px; }
    .search-form { min-width: 0; }
    .catalog-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
    .catalog-filter-form { justify-content: flex-start; }
    .compare-dock { align-items: stretch; flex-direction: column; padding: 10px 11px; }
    .compare-dock-actions { width: 100%; }
    .compare-dock-actions .button { flex: 1; }
    .conversion-strip { align-items: stretch; flex-direction: column; gap: 10px; }
    .conversion-strip .button { width: 100%; }
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .product-card-body { padding: 11px; }
    .product-name { min-height: 58px; font-size: 14px; }
    .product-card-actions { padding: 9px 11px 11px; }
    .compare-heading { align-items: stretch; }
    .compare-heading-actions .button { flex: 1; }
    .detail-layout, .cart-layout { grid-template-columns: 1fr; gap: 16px; }
    .detail-panel { padding: 17px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; padding: 12px 0; }
    .coupon-row { align-items: flex-start; flex-direction: column; }
}
