:root {
  --bg: #fff;
  --surface: #fff;
  --ink: #242625;
  --muted: #8a8f8d;
  --line: #eaedec;
  --accent: #18ad83;
  --accent-soft: #e9f8f3;
  --shadow: 0 18px 42px rgba(23, 45, 39, .14);
}
* { box-sizing: border-box; letter-spacing: 0; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
body { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body.no-scroll { overflow: hidden; }
button, input { font: inherit; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }

.app-shell { width: 100%; min-height: 100vh; }
.topbar { height: 60px; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 0 15px; background: rgba(34,34,34,.96); color: #fff; border-bottom: 1px solid rgba(255,255,255,.12); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(16px); }
.ui-icon { display: block; width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.home-trigger, .refresh-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 4px; }
.refresh-btn:disabled { opacity: .5; cursor: wait; }
.topbar-side { display: flex; align-items: center; gap: 7px; }
.topbar-right { justify-content: flex-end; }
.icon-btn, .category-trigger, .search-trigger { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn { width: 40px; border-radius: 50%; font-size: 24px; line-height: 1; }
.icon-btn:hover { color: var(--accent); background: #f5faf8; }
.topbar button:hover { background: rgba(255,255,255,.1); }
.category-trigger { gap: 5px; padding: 0 7px; font-size: 14px; white-space: nowrap; border-radius: 4px; }
.search-trigger { width: 40px; border-radius: 4px; }
.feed-toolbar { display: flex; align-items: center; min-height: 58px; padding: 0 16px; background: var(--surface); }
.view-tabs { display: flex; align-items: center; gap: 27px; height: 100%; }
.view-tab { position: relative; color: #919593; font-size: 14px; height: 58px; padding: 0; }
.view-tab.active { color: #202321; font-weight: 600; }
.view-tab.active::after { content: ""; position: absolute; width: 18px; height: 3px; border-radius: 3px; background: var(--accent); bottom: 8px; left: 50%; transform: translateX(-50%); }
.toolbar-actions { margin-left: auto; display: flex; gap: 5px; }
.toolbar-actions .icon-btn { font-size: 23px; color: #202422; }
.toolbar-actions .icon-btn.active { color: var(--accent); background: var(--accent-soft); }
.selected-tags { display: flex; align-items: center; gap: 8px; padding: 5px 16px 10px; background: var(--surface); }
.tag-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; overflow-wrap: anywhere; text-align: left; border: 1px solid #dfeae6; border-radius: 8px; color: #3f5a52; background: #f6fbf9; padding: 7px 12px; font-size: 13px; }
.tag-chip span { color: #90a39d; font-size: 15px; }
.tag-placeholder { color: #9a9f9d; font-size: 13px; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 0 4px 28px; }
.product-card { position: relative; min-width: 0; overflow: hidden; background: var(--surface); border-radius: 5px 5px 0 0; cursor: pointer; }
.card-media { position: relative; aspect-ratio: 4 / 5; background: #f3f3f3; overflow: hidden; }
.card-open { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-open:focus-visible { outline-offset: -3px; }
.remote-image, .modal-image { width: 100%; height: 100%; display: block; object-fit: cover; }
.card-media > .remote-image, .card-media > .placeholder { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.placeholder { position: relative; display: flex; align-items: center; justify-content: center; color: #888; background: #eee; font-size: 12px; }
.placeholder::before { content: ""; position: absolute; width: 38%; height: 34%; border: 2px dashed rgba(69, 91, 87, .25); border-radius: 8px; }
.placeholder span { position: relative; z-index: 1; background: rgba(255,255,255,.58); padding: 5px 8px; border-radius: 4px; }
.fallback-placeholder { width: 100%; height: 100%; }
.card-mark { position: absolute; right: 3px; top: 3px; display: grid; place-items: center; width: 32px; height: 32px; color: #fff; z-index: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.card-mark .ui-icon { width: 17px; height: 17px; }
.card-mark:hover { background: rgba(0,0,0,.15); border-radius: 4px; }
.card-gallery-indicator { position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: rgba(255,255,255,.95); color: #555; pointer-events: none; }
.card-gallery-indicator .ui-icon { width: 16px; height: 16px; }
.media-badge { position: absolute; top: 8px; left: 8px; color: white; background: rgba(20, 38, 32, .63); border-radius: 10px; padding: 4px 7px; font-size: 10px; }
.card-body { padding: 9px 8px 11px; min-height: 40px; min-width: 0; }
.card-title { margin: 0; color: #222; font-size: 13px; line-height: 20px; font-weight: 400; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.product-grid.list-mode { grid-template-columns: 1fr; gap: 1px; padding: 0 0 28px; }
.list-mode .product-card { display: grid; grid-template-columns: 122px 1fr; border-radius: 0; }
.list-mode .card-media { aspect-ratio: 1 / 1; }
.list-mode .card-body { padding: 15px 14px; min-height: 0; }
.empty-state { color: #888; padding: 56px 16px; text-align: center; font-size: 14px; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 10; }
.category-drawer { position: fixed; z-index: 11; left: 0; right: 0; bottom: 0; height: min(84dvh, 720px); background: var(--surface); border-radius: 8px 8px 0 0; box-shadow: var(--shadow); overflow: hidden; }
.drawer-head { height: 73px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.drawer-head-actions { display: flex; align-items: center; gap: 13px; }
.drawer-close { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; color: #555; }
.multi-select { color: #2985d8; font-size: 13px; font-weight: 500; min-height: 40px; }
.multi-select.active { color: var(--accent); }
.drawer-content { height: calc(100% - 73px); display: grid; grid-template-columns: 28% minmax(0, 1fr); min-height: 0; }
.category-rail { overflow: auto; background: #f7f8f9; padding-bottom: 30px; overscroll-behavior: contain; border-right: 1px solid #eaedec; }
.rail-item { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 9px 11px 9px 10px; border-left: 3px solid transparent; text-align: left; color: #555; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.rail-item small { color: #999; font-size: 10px; flex-shrink: 0; white-space: nowrap; }
.rail-item.active { background: #e9f8f3; color: var(--accent); font-weight: 600; border-left-color: var(--accent); }
.category-detail { overflow: auto; padding: 19px 15px 34px; overscroll-behavior: contain; }
.detail-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.detail-title-row > span { color: #a0a8a4; font-size: 10px; }
.detail-heading { margin: 0; font-size: 16px; line-height: 1.3; }
.subcategory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 10px; }
.subcategory-item { min-width: 0; padding: 0; text-align: center; font-size: 11px; line-height: 1.5; color: #333; overflow-wrap: anywhere; }
.subcategory-label { display: flex; justify-content: center; align-items: baseline; gap: 3px; }
.subcategory-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.subcategory-label small { flex-shrink: 0; white-space: nowrap; color: #999; font-size: 10px; font-weight: 400; }
.subcategory-item.active { color: var(--accent); font-weight: 600; }
.sub-cover { aspect-ratio: 1 / 1; width: 100%; margin-bottom: 7px; border-radius: 8px; overflow: hidden; background: #f3f3f3; }
.sub-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.subcategory-item.active .sub-cover { box-shadow: 0 0 0 2px var(--accent); }
.search-panel { position: fixed; z-index: 12; inset: 0; background: #f7f8f9; }
.search-box-wrap { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; background: #fff; }
.search-box-wrap input { flex: 1; min-width: 0; height: 36px; border: 1px solid transparent; background: #f7f8f9; border-radius: 20px; padding: 0 14px; outline: none; }
.search-box-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(17,173,131,.12); }
.search-submit { color: var(--accent); padding: 6px 3px; font-size: 14px; }
.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: rgba(12, 20, 18, .68); }
.modal-card { width: min(720px, 100%); max-height: min(94dvh, 860px); overflow: auto; background: #fff; border-radius: 8px; position: relative; box-shadow: var(--shadow); }
.modal-close { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; color: #fff; background: rgba(0,0,0,.45); font-size: 22px; line-height: 1; z-index: 10; display: flex; align-items: center; justify-content: center; }
.modal-hero { position: relative; min-height: 260px; max-height: 62dvh; background: #edf1ef; overflow: hidden; }
.modal-hero .modal-image { width: 100%; height: min(62dvh, 610px); object-fit: contain; background: #edf1ef; }
.gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; color: #fff; background: rgba(0,0,0,.4); font-size: 0; line-height: 0; z-index: 5; display: flex; align-items: center; justify-content: center; }
.gallery-arrow:disabled { opacity: .22; cursor: default; }
.gallery-arrow.prev { left: 12px; }.gallery-arrow.next { right: 12px; }
.gallery-counter { position: absolute; right: 12px; bottom: 10px; padding: 4px 8px; border-radius: 10px; color: #fff; background: rgba(0,0,0,.42); font-size: 11px; }
.modal-thumbs { display: flex; gap: 7px; overflow-x: auto; padding: 10px 14px 2px; }
.modal-thumb { width: 57px; height: 57px; flex: 0 0 57px; padding: 2px; border: 1px solid transparent; border-radius: 7px; overflow: hidden; background: #eef1ef; }
.modal-thumb.active { border-color: var(--accent); }.modal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 4px; }
.modal-copy { padding: 17px 18px 19px; }.eyebrow { color: var(--accent); font-size: 12px; margin: 0 0 8px; }.modal-copy h2 { margin: 0 0 10px; font-size: 20px; line-height: 1.4; }.modal-desc { color: #666f6b; line-height: 1.65; font-size: 13px; margin: 0 0 14px; white-space: pre-wrap; }
.modal-actions { display: flex; gap: 8px; }.modal-share, .modal-copy-link { flex: 1; display: block; padding: 10px 14px; border-radius: 8px; font-weight: 600; }.modal-share { color: white; background: var(--accent); }.modal-copy-link { color: #527269; background: var(--accent-soft); }.modal-note { margin: 13px 0 0; border-radius: 8px; background: #f3f8f6; color: #66847b; padding: 10px; font-size: 11px; line-height: 1.5; }.media-status { margin: 0; padding: 9px 12px; color: #785400; background: #fff5d9; font-size: 12px; line-height: 1.5; }
.toast { position: fixed; left: 50%; bottom: max(25px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(30,30,30,.9); color: #fff; padding: 9px 14px; border-radius: 7px; font-size: 13px; z-index: 30; white-space: nowrap; }
@media (max-width: 399px) { .topbar { padding-left: 8px; padding-right: 8px; }.view-tabs { gap: 18px; }.view-tab { font-size: 13px; }.feed-toolbar { padding: 0 8px; }.toolbar-actions { gap: 0; }.subcategory-grid { gap: 14px 8px; }.category-detail { padding-left: 8px; padding-right: 8px; } }
@media (min-width: 600px) and (max-width: 759px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-left: 10px; padding-right: 10px; }.topbar, .feed-toolbar, .selected-tags { padding-left: 22px; padding-right: 22px; } }
@media (min-width: 760px) { .app-shell { max-width: 1280px; margin: 0 auto; background: var(--bg); }.topbar { padding: 0 26px; }.product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 8px; padding: 0 4px 32px; }.feed-toolbar, .selected-tags { padding-left: 16px; padding-right: 16px; }.category-drawer { left: 50%; right: auto; transform: translateX(-50%); width: min(900px, 100%); }.subcategory-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .product-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }.topbar { padding-left: 32px; padding-right: 32px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }


[hidden] { display: none !important; }



/* Bounded-page navigation remains usable on small screens. */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; padding: 20px 10px 36px; font-size: 13px; }
.pagination-buttons, #pageJump { display: flex; align-items: center; gap: 10px; }
.pagination button { padding: 10px 14px; border: 1px solid #dce6e0; border-radius: 7px; background: #fff; color: #385d50; cursor: pointer; }
.pagination button:disabled { opacity: .4; cursor: default; }
.pagination input { width: 70px; padding: 9px 6px; border: 1px solid #dce6e0; border-radius: 5px; font: inherit; }
.product-grid[aria-busy="true"] { opacity: .55; pointer-events: none; }

.remote-image { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.back-top { position: fixed; right: 16px; bottom: 80px; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; font-size: 20px; display: grid; place-items: center; z-index: 15; opacity: 0; pointer-events: none; transition: opacity .2s; }
.back-top.show { opacity: 1; pointer-events: auto; }
.load-more { text-align: center; padding: 20px; color: #999; font-size: 13px; }
.load-more-end { color: #bbb; }























/* Shared bottom navigation: visible on both the decoration home and catalog pages. */
.site-tabbar { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(1280px, 100%); height: calc(56px + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom); box-sizing: border-box; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: stretch; z-index: 8; border-top: 1px solid #e5e9e7; background: rgba(255,255,255,.97); box-shadow: 0 -3px 14px rgba(34,49,43,.06); backdrop-filter: blur(14px); }
.site-tabbar > button, .site-tabbar > a, .site-tabbar .language-switch { min-width: 0; min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #4e6b60; font-size: 13px; font-weight: 600; text-decoration: none; }
.site-tabbar > button:hover, .site-tabbar > a:hover { color: #159b72; background: #f3faf7; }
.site-tabbar .ui-icon { width: 18px; height: 18px; }
.site-tabbar .language-switch { cursor: pointer; }
.site-tabbar .language-switch select { max-width: 100%; min-width: 94px; padding: 8px 26px 8px 10px; border: 1px solid #dbe6e1; border-radius: 7px; background: #fff; color: #38584c; font: inherit; font-weight: 600; cursor: pointer; }
.site-tabbar .wa-button { color: #118c62; }
.site-tabbar .wa-mark { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: #18a878; color: #fff; font-size: 10px; letter-spacing: -.4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-shell { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
.back-top { bottom: calc(76px + env(safe-area-inset-bottom)); }













.layout-sheet { position: fixed; inset: 0; z-index: 200; }
.layout-sheet.hidden { display: none; }
.layout-sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.layout-sheet-body { position: absolute; bottom: 0; left: 0; right: 0; background: #fff; border-radius: 20px 20px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 80vh; overflow-y: auto; }
.layout-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 18px; font-weight: 600; }
.layout-sheet-close { background: none; border: none; font-size: 24px; color: #999; cursor: pointer; }
.layout-group { font-size: 13px; color: #999; margin: 16px 0 8px; }
.layout-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.layout-opt { background: none; border: none; cursor: pointer; text-align: center; }
.layout-opt .thumb { height: 70px; border-radius: 8px; border: 2px solid #eee; margin-bottom: 6px; background: #f5f5f5; position: relative; overflow: hidden; }
.layout-opt.active .thumb { border-color: #25D366; }
.layout-opt.active { color: #25D366; }
.layout-opt span { font-size: 13px; color: #333; }
.thumb-default::before { content:''; position:absolute; left:8%; right:8%; top:10%; height:40%; background:#ddd; border-radius:4px; box-shadow: 0 50% 0 #ddd, 0 100% 0 #ddd; }
.thumb-large::before { content:''; position:absolute; left:15%; right:15%; top:10%; height:70%; background:#ddd; border-radius:4px; }
.thumb-small::before { content:''; position:absolute; left:8%; right:8%; top:10%; height:35%; background:#ddd; border-radius:3px; box-shadow: 0 45% 0 #ddd, 0 90% 0 #ddd; }
.thumb-waterfall::before { content:''; position:absolute; left:8%; width:40%; top:10%; height:60%; background:#ddd; border-radius:3px; box-shadow: 55% 30% 0 #ddd, 55% 75% 0 #ddd; }
.thumb-list-one::before { content:''; position:absolute; left:8%; width:25%; top:15%; height:70%; background:#ddd; border-radius:3px; }
.thumb-list-multi::before { content:''; position:absolute; left:8%; width:25%; top:15%; height:35%; background:#ddd; border-radius:3px; box-shadow: 0 50% 0 #ddd; }
.thumb-album::before { content:''; position:absolute; left:10%; right:10%; top:15%; height:30%; background:#ddd; border-radius:3px; box-shadow: 0 45% 0 #ddd, 0 80% 0 #ddd; }
/* 布局模式 */
.product-grid.cols-1 { grid-template-columns: 1fr !important; }
.product-grid.cols-1 .card-media { aspect-ratio: 4/3; }
.product-grid.cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
.product-grid.cols-4 { grid-template-columns: repeat(4, 1fr) !important; }
.product-grid.waterfall { grid-template-columns: repeat(2, 1fr) !important; grid-auto-rows: auto; }
.product-grid.waterfall .card-media { aspect-ratio: auto; }
.product-grid.list-mode { grid-template-columns: 1fr !important; }
.product-grid.list-mode .product-card { display: flex; gap: 10px; }
.product-grid.list-mode .card-media { width: 100px; flex-shrink: 0; aspect-ratio: 1; }

.product-grid.cols-4 .card-body { display: none; }
