/* WordPress / WooCommerce 适配层：原型样式在 site.css（逐字副本，不在这里改），这里只补 WordPress 输出的结构差异。 */

/* ── 页头导航：wp_nav_menu 输出 ul > li > a ─────────────────── */
.main-navigation .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px 20px; flex-wrap: wrap; }
.main-navigation .current-menu-item > a, .main-navigation .current_page_item > a { border-bottom-color: var(--brand); color: var(--brand); }
.skip-link:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 100; background: var(--surface); padding: 8px 12px; }
.admin-bar .site-header { top: calc(env(safe-area-inset-top, 0px) + 32px); }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }

/* ── 图片：原型用 SVG 示意图，正式站是产品照片 ───────────────── */
/* 方框是 display:grid + aspect-ratio 的正方形；grid 里图片的 height:100% 不按方框计算，
   长方形照片会按自身比例撑高、被 overflow:hidden 切掉。改为绝对定位铺满方框，再用 contain 整张放进去。 */
li.product .product-image, .gallery-main, .gallery-thumbs button { position: relative; }
/* 图框用纯白、不跟随深色模式：Amazon 主图是白底，非正方形照片放进框里时两侧不会露出灰边或深色边 */
li.product .product-image, .gallery-main, .gallery-thumbs button { background: #fff; }
li.product .product-image img, .gallery-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; }
.category-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── 分类页 ──────────────────────────────────────────────── */
.shop-results { min-width: 0; }
.archive-head .term-description, .archive-head .page-description, .archive-description { color: var(--muted); max-width: 60ch; }
.archive-head .term-description p + p, .archive-head .page-description p + p { margin-top: 8px; }
.shop-toolbar .woocommerce-result-count { margin: 0; }
.shop-toolbar .woocommerce-ordering { margin: 0; }
.shop-toolbar .woocommerce-ordering select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg); }
.filter-link { display: flex; gap: 8px; align-items: center; font-size: 0.92rem; padding-block: 2px; color: var(--fg); text-decoration: none; }
.filter-link span { margin-left: auto; color: var(--muted); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.filter-link:hover, .filter-link[aria-current="page"] { color: var(--brand); }
.filter-link[aria-current="page"] { font-weight: 600; }
.filter-form { display: grid; gap: 16px; }
.filter-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.filter-form legend { padding: 0; }
.filter-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.filter-actions .button { padding: 8px 12px; }
.js .filter-actions [data-filter-apply] { display: none; }
.woocommerce-pagination ul.page-numbers { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.woocommerce-pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.no-results-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── 产品页 ──────────────────────────────────────────────── */
.buy-actions > :only-child { grid-column: 1 / -1; }
.product-section h2 + * { margin-top: 0; }
.product-section > h2:not(:first-child) { margin-top: 14px; }
.product-section .entry-content { max-width: 65ch; }
.related-products { padding-top: 0; }
.woocommerce-notices-wrapper:empty { display: none; }

/* ── 普通页面 / 新闻 ─────────────────────────────────────── */
.entry { padding-block: 20px 48px; max-width: 760px; }
.entry-head { padding-bottom: 16px; display: grid; gap: 6px; }
.entry-head h1 { font-size: var(--step-4); font-weight: 600; }
.entry-image { margin-bottom: 20px; }
.entry-image img { border-radius: var(--radius); height: auto; }
.entry-content { display: grid; gap: 14px; line-height: 1.65; }
.entry-content > * { margin: 0; }
.entry-content h2 { font-size: var(--step-2); font-weight: 600; margin-top: 10px; }
.entry-content h3 { font-size: var(--step-1); font-weight: 600; }
.entry-content ul, .entry-content ol { padding-left: 1.2em; display: grid; gap: 6px; }
.entry-content ul.downloads { padding-left: 0; }
.entry-content img { height: auto; border-radius: var(--radius); }
.post-list { display: grid; gap: 16px; padding-bottom: 32px; }
.post-card { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.post-card:not(:has(.post-thumb)) { grid-template-columns: 1fr; }
.post-card h2 { font-size: var(--step-2); font-weight: 600; margin-block: 4px 8px; }
.post-card h2 a { color: var(--fg); text-decoration: none; }
.post-card h2 a:hover { color: var(--brand); }
.post-card .post-thumb img { width: 100%; height: auto; border-radius: 4px; }
.post-excerpt { color: var(--muted); }
@media (max-width: 600px) { .post-card { grid-template-columns: 1fr; } }
.post-nav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 48px; }
.legal-layout.no-toc { grid-template-columns: minmax(0, 1fr); }

/* ── 首页：区块样式（Group / Buttons / Table）映射到原型结构 ───── */
.home-content > * { margin: 0; }
.home-hero .wp-block-group.wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; padding-block: clamp(32px, 6vw, 64px); }
@media (max-width: 820px) { .home-hero .wp-block-group.wrap { grid-template-columns: 1fr; } }
.home-hero h1, .home-hero h2 { color: #fff; font-size: var(--step-4); font-weight: 600; }
.home-hero .wrap > .wp-block-group:first-child .eyebrow { color: #B9D8DE; }
.home-hero .wp-block-buttons { margin-top: 24px; }
.pack-calc .wp-block-table { margin: 0; overflow-x: auto; }
.pack-calc .wp-block-table td:not(:first-child), .pack-calc .wp-block-table th:not(:first-child) { text-align: right; }
.pack-calc .wp-block-table thead { border: 0; }
.pack-calc .wp-block-table th, .pack-calc .wp-block-table td { border: 0; border-bottom: 1px solid var(--line); padding: 8px 4px; }
.pack-calc .wp-block-table th { padding-block: 6px; font-weight: 500; color: var(--muted); }
.section-head p { margin: 0; }
.bulk-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; counter-reset: step; }
.bulk-steps > .wp-block-group { background: var(--surface); border-top: 3px solid var(--brand); padding: 18px; border-radius: 0 0 var(--radius) var(--radius); counter-increment: step; }
.bulk-steps > .wp-block-group::before { content: counter(step); font-family: var(--font-display); font-size: var(--step-3); color: var(--accent); display: block; line-height: 1; margin-bottom: 8px; }
.bulk-steps > .wp-block-group h3 { font-size: var(--step-1); margin-bottom: 6px; }
.bulk-steps > .wp-block-group p { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 760px) { .bulk-steps { grid-template-columns: 1fr; } }
.section.is-style-tinted, .section.tinted { background: var(--surface-2); }
.section + .section:not(.tinted) { padding-top: 0; }

/* 按钮区块：在块编辑器里选 "Quote" / "Outline" 样式 */
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: var(--radius); font: inherit; font-weight: 600; text-decoration: none; border: 1px solid transparent; line-height: 1.2; background: var(--brand); color: var(--surface); }
.wp-block-button__link:hover { background: var(--brand-strong); color: var(--surface); }
.wp-block-button.is-style-quote .wp-block-button__link { background: var(--accent); color: #fff; }
.wp-block-button.is-style-quote .wp-block-button__link:hover { filter: brightness(0.95); }
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; border-color: var(--line); color: var(--fg); }
.home-hero .wp-block-button.is-style-outline .wp-block-button__link { color: #fff; border-color: rgba(255,255,255,.5); }
.home-hero .wp-block-button.is-style-outline .wp-block-button__link:hover { border-color: #fff; }

/* ── 下载汇总页 [yoiyee_downloads] ──────────────────────── */
.downloads-index { display: grid; gap: 20px; padding-bottom: 32px; }
.downloads-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.downloads-filter input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg); width: min(100%, 22rem); }
.downloads-group { display: grid; gap: 8px; }
.downloads-group h3 { font-family: var(--font-body); font-size: var(--step-0); font-weight: 600; }
.downloads-group h3 a { color: var(--fg); }

/* ── 询价清单抽屉 ───────────────────────────────────────── */
.quote-drawer .drawer-note { margin: 12px 16px 0; font-size: var(--step--1); color: var(--muted); }
.quote-drawer .fine { font-size: var(--step--1); color: var(--muted); }
.quote-line .t a { color: var(--fg); text-decoration: none; }
.quote-line .t a:hover { color: var(--brand); }

/* ── 询价表单 [yoiyee_quote] ─────────────────────────────── */
.quote-form { display: grid; gap: 24px; max-width: 760px; padding-bottom: 32px; }
.quote-form section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 3vw, 24px); display: grid; gap: 12px; }
.quote-form h2 { font-size: var(--step-2); font-weight: 600; }
.quote-form .quote-lines { padding: 0; overflow: visible; }
.entry-content .quote-form ul.quote-lines { padding-left: 0; gap: 0; }
.quote-form .quote-empty { padding: 0; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
@media (max-width: 600px) { .field-grid { grid-template-columns: 1fr; } }
.quote-form .field { display: grid; gap: 4px; margin: 0; }
.quote-form label { font-weight: 500; font-size: 0.92rem; }
.quote-form .req { color: var(--accent); }
.quote-form .opt { color: var(--muted); font-weight: 400; font-size: var(--step--1); }
.quote-form input[type="text"], .quote-form input[type="email"], .quote-form input[type="tel"], .quote-form textarea {
  font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--fg);
}
.quote-form textarea { resize: vertical; min-height: 7em; }
.quote-form input:focus-visible, .quote-form textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.quote-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.quote-form .fine { font-size: var(--step--1); color: var(--muted); }
.form-errors { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; color: var(--fg); }
.form-errors ul { margin: 6px 0 0; padding-left: 1.2em; }
.form-notice { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius); padding: 10px 12px; }
.quote-received { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--ok); border-radius: var(--radius); padding: 24px; display: grid; gap: 10px; max-width: 760px; margin-bottom: 32px; }
.quote-received h2 { font-size: var(--step-3); font-weight: 600; }
.quote-received .ref { font-family: var(--font-mono); color: var(--brand); }
