:root {
    --market-bg: #f3f4f2;
    --market-panel: #ffffff;
    --market-ink: #161817;
    --market-muted: #7c817d;
    --market-line: #e7e9e6;
    --market-soft: #f6f7f5;
    --market-accent: #151716;
    --market-green: #1f8f5f;
}

body.shanzhe-storefront {
    min-height: 100vh;
    color: var(--market-ink);
    background: var(--market-bg) !important;
    background-image: none !important;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.shanzhe-storefront .navbar-acg {
    position: sticky;
    top: 12px;
    z-index: 1000;
    width: min(1180px, calc(100% - 28px));
    min-height: 64px;
    margin: 12px auto 0;
    padding: 0 10px;
    border: 1px solid rgba(18, 20, 19, .08);
    border-radius: 22px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 12px 38px rgba(21, 25, 22, .06);
    backdrop-filter: blur(18px) saturate(170%);
}

.shanzhe-storefront .navbar-acg .container { max-width: none; }
.shanzhe-storefront .navbar-brand { gap: 10px; color: var(--market-ink) !important; font-size: 16px; letter-spacing: -.02em; }
.shanzhe-brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--market-accent); font-size: 14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.shanzhe-storefront .navbar-nav { gap: 2px; }
.shanzhe-storefront .nav-link { padding: 10px 13px !important; border-radius: 12px; color: #606460 !important; font-size: 12px; font-weight: 650; }
.shanzhe-storefront .nav-link:hover, .shanzhe-storefront .nav-link.active { color: var(--market-ink) !important; background: var(--market-soft); }
.shanzhe-storefront .nav-icon { display: inline-block; margin-right: 6px; }
.shanzhe-storefront .user-login-box { display: flex; gap: 7px; }
.shanzhe-storefront .user-login-box .btn { min-height: 36px; display: inline-flex; align-items: center; padding: 0 15px; border-radius: 999px !important; font-size: 11px; font-weight: 700; }
.shanzhe-storefront .user-login-box .btn-primary { border-color: var(--market-accent); background: var(--market-accent); }

.shanzhe-market {
    max-width: 1180px;
    min-height: calc(100vh - 110px);
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
    margin-top: 22px;
    padding-bottom: 70px;
}

.market-categories, .market-products {
    border: 1px solid var(--market-line);
    border-radius: 22px;
    background: var(--market-panel);
    box-shadow: 0 10px 34px rgba(21, 25, 22, .035);
}

.market-categories { align-self: start; position: sticky; top: 96px; overflow: hidden; padding: 24px 14px 14px; }
.category-heading { padding: 0 10px 18px; }
.category-heading > span, .toolbar-kicker { color: #9a9e9a; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.category-heading h1 { margin: 7px 0 5px; font-size: 22px; line-height: 1.2; letter-spacing: -.035em; }
.category-heading p { margin: 0; color: var(--market-muted); font-size: 10px; }
.category-list { display: grid; gap: 5px; }
.category-list a { min-height: 48px; display: grid; grid-template-columns: 28px 1fr 14px; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 14px; color: #525753; font-size: 12px; font-weight: 680; transition: background .18s ease, color .18s ease; }
.category-list a:hover { color: var(--market-ink); background: var(--market-soft); }
.category-list a.is-primary { color: var(--market-ink); background: #eef0ed; }
.category-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--market-line); border-radius: 9px; color: #747975; background: #fff; font-size: 11px; }
.category-list a.is-primary .category-icon { color: #fff; border-color: var(--market-accent); background: var(--market-accent); }
.category-arrow { justify-self: end; color: #b4b7b4; font-size: 9px; }
.category-note { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 13px 11px; border-top: 1px solid var(--market-line); color: var(--market-muted); font-size: 9px; }
.category-note i { color: #e5a115; }

.market-products { min-width: 0; overflow: hidden; }
.products-toolbar { min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 24px; border-bottom: 1px solid var(--market-line); }
.products-toolbar h2 { margin: 6px 0 0; font-size: 22px; line-height: 1.2; letter-spacing: -.035em; }
.market-search { width: min(360px, 48%); min-height: 42px; display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 8px; padding: 4px 5px 4px 13px; border: 1px solid var(--market-line); border-radius: 14px; background: var(--market-soft); }
.market-search > i { color: #8b908c; font-size: 11px; }
.market-search input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--market-ink); font-size: 11px; }
.market-search button { min-height: 32px; padding: 0 15px; border: 0; border-radius: 10px; color: #fff; background: var(--market-accent); font-size: 10px; font-weight: 750; cursor: pointer; }

.product-table-head, .product-row { display: grid; grid-template-columns: minmax(260px, 1fr) 92px 72px 72px 82px; align-items: center; gap: 12px; }
.product-table-head { min-height: 44px; padding: 0 24px; border-bottom: 1px solid var(--market-line); color: #9a9e9a; font-size: 9px; font-weight: 750; }
.product-table-head span:not(:first-child) { text-align: center; }
.item-list { min-height: 320px; }
.product-row { min-height: 102px; padding: 15px 24px; border-bottom: 1px solid var(--market-line); color: inherit; text-decoration: none; transition: background .18s ease; }
.product-row:last-child { border-bottom: 0; }
.product-row:hover { color: inherit; background: #fafbf9; }
.product-main { min-width: 0; display: flex; align-items: center; gap: 14px; }
.product-thumb { width: 66px; height: 66px; flex: 0 0 66px; overflow: hidden; border: 1px solid var(--market-line); border-radius: 14px; background: var(--market-soft); }
.product-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.product-copy { min-width: 0; }
.product-copy h3 { margin: 7px 0 4px; overflow: hidden; color: var(--market-ink); font-size: 13px; font-weight: 760; line-height: 1.38; text-overflow: ellipsis; white-space: nowrap; }
.product-copy small { color: #a0a4a0; font-size: 8px; }
.product-tags { display: flex; gap: 5px; }
.tag { display: inline-flex; align-items: center; min-height: 18px; padding: 0 7px; border-radius: 999px; font-size: 8px; font-weight: 750; }
.tag-delivery { color: #237e58; background: #eaf7f0; }
.tag-recommend { color: #9b5b0d; background: #fff1d8; }
.product-price { color: #151716; text-align: center; font-size: 17px; font-weight: 820; }
.product-price small { margin-right: 2px; font-size: 10px; }
.product-stat { text-align: center; }
.product-stat small { display: none; }
.product-stat strong { color: #666b67; font-size: 11px; font-weight: 650; }
.product-action { text-align: right; }
.product-action span { min-width: 64px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; color: #fff; background: var(--market-accent); font-size: 10px; font-weight: 750; }
.product-row.is-soldout { cursor: default; opacity: .55; }
.product-row.is-soldout .product-action span { color: #8b8f8c; background: #eceeeb; }

.item-message, .market-empty { min-height: 320px; display: flex; align-items: center; justify-content: center; color: var(--market-muted); font-size: 11px; }
.item-message { gap: 9px; }
.loading-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--market-accent); animation: marketPulse 1.1s infinite alternate; }
.market-empty { flex-direction: column; text-align: center; }
.market-empty > span { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 18px; color: #8d918e; background: var(--market-soft); font-size: 19px; }
.market-empty h3 { margin: 0 0 6px; color: #4e534f; font-size: 13px; }
.market-empty p { margin: 0; color: #a0a4a0; font-size: 9px; }
.shanzhe-storefront footer { margin: 0; padding: 20px; color: #929692; background: transparent; font-size: 9px; }

@keyframes marketPulse { to { opacity: .25; transform: scale(.75); } }

@media (max-width: 991.98px) {
    .shanzhe-storefront .navbar-acg { top: 8px; width: calc(100% - 20px); margin-top: 8px; }
    .shanzhe-storefront .navbar-collapse { padding: 10px 0; }
    .shanzhe-market { grid-template-columns: 1fr; margin-top: 14px; }
    .market-categories { position: static; padding: 18px 14px 14px; }
    .category-heading { padding-bottom: 12px; }
    .category-heading p, .category-note { display: none; }
    .category-list { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
    .category-list::-webkit-scrollbar { display: none; }
    .category-list a { min-width: max-content; min-height: 38px; display: flex; padding: 5px 11px 5px 6px; border: 1px solid var(--market-line); border-radius: 12px; }
    .category-icon { width: 27px; height: 27px; }
    .category-arrow { display: none; }
}

@media (max-width: 680px) {
    .shanzhe-storefront .navbar-acg { min-height: 58px; border-radius: 18px; }
    .shanzhe-storefront .navbar-brand { font-size: 14px; }
    .shanzhe-brand-mark { width: 32px; height: 32px; }
    .shanzhe-storefront .user-login-box { right: 56px; top: 10px; }
    .shanzhe-storefront .user-login-box .btn { min-height: 33px; padding: 0 11px; }
    .shanzhe-storefront .user-login-box .btn-primary { display: none; }
    .shanzhe-market { width: 100%; padding-right: 10px; padding-left: 10px; }
    .market-categories, .market-products { border-radius: 18px; }
    .products-toolbar { min-height: auto; display: block; padding: 18px; }
    .products-toolbar h2 { font-size: 20px; }
    .market-search { width: 100%; margin-top: 15px; }
    .product-table-head { display: none; }
    .product-row { min-height: 0; grid-template-columns: 1fr auto auto auto; gap: 11px 12px; padding: 16px; }
    .product-main { grid-column: 1 / -1; }
    .product-thumb { width: 62px; height: 62px; flex-basis: 62px; }
    .product-copy h3 { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
    .product-price { align-self: center; text-align: left; }
    .product-stat { display: inline-flex; align-items: center; gap: 4px; text-align: left; }
    .product-stat small { display: inline; color: #a0a4a0; font-size: 8px; }
    .product-stat strong { font-size: 9px; }
    .product-action { align-self: center; grid-row: 2; }
    .item-message, .market-empty { min-height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
    .loading-dot { animation: none; }
    .product-row, .category-list a { transition: none; }
}
