:root {
    --bg: #f3f6fb;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: #ffffff;
    --surface-soft: #f8fbff;
    --text: #121417;
    --text-soft: #2b3a4a;
    --muted: #667085;
    --line: #d9e0ea;
    --blue: #0071e3;
    --blue-dark: #005bb5;
    --danger: #d92d20;
    --ok: #039855;
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-card: 0 18px 42px rgba(15, 23, 42, 0.08);
    --shadow-float: 0 14px 30px rgba(15, 23, 42, 0.1);
    --focus-ring: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 0 5px rgba(0, 113, 227, 0.34), 0 10px 18px rgba(0, 113, 227, 0.22);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(1000px 460px at 0% -16%, #e7efff 0%, transparent 66%),
        radial-gradient(920px 500px at 100% -24%, #edf2ff 0%, transparent 62%),
        linear-gradient(180deg, #f8fbff 0%, transparent 220px),
        var(--bg);
}

a {
    color: var(--blue);
}

.btn,
.btn:hover,
.btn:focus,
.btn:active,
.btn:visited {
    text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.24);
    border-color: #7db4ee;
}

.btn:focus-visible,
button.btn:focus-visible,
a.btn:focus-visible,
body.page-home .btn-primary:focus-visible,
body.page-home .btn-secondary:focus-visible,
body.page-product .add-cart-btn:focus-visible,
body.page-product .favorite-btn:focus-visible,
body.page-cart .checkout-btn:focus-visible,
body.page-cart .continue-shopping:focus-visible,
body.page-checkout .btn:focus-visible,
body.page-auth .login-btn:focus-visible,
body.page-auth .register-btn:focus-visible,
body.page-password .btn:focus-visible,
body.page-verify .verify-btn:focus-visible,
body.page-admin-review .btn:focus-visible,
body.page-upgrade .btn:focus-visible,
body.page-profile .btn:focus-visible {
    outline: 0;
    border-color: transparent;
    box-shadow: var(--focus-ring);
}

.navbar,
.nav {
    position: sticky;
    top: 0;
    z-index: 60;
    backdrop-filter: blur(18px) saturate(145%);
    background: rgba(248, 251, 255, 0.74);
    border-bottom: 1px solid rgba(132, 146, 166, 0.16);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.brand-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.brand-home-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.brand-home-link:hover {
    color: inherit;
    text-decoration: none;
}

.site-logo {
    width: auto;
    height: 100px;
    max-width: 100%;
    object-fit: contain;
    background: transparent !important;
    border: 0;
    flex: 0 0 auto;
}

.site-logo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
}

.brand-name-seo {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.site-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 12px);
    z-index: 120;
    min-width: 160px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 11px 16px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.site-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.site-toast.ok {
    background: rgba(3, 152, 85, 0.94);
}

.site-toast.err {
    background: rgba(217, 45, 32, 0.94);
}

/* home */
body.page-home .navbar-top {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.36);
}

body.page-home .container,
body.page-content .container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
}

body.page-home .navbar-main,
body.page-content .navbar-main {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
}

/* 内容导航菜单（品牌故事/食谱/常见问题等，后台可编辑） */
.navbar-content-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-menu-item {
    position: relative;
}

.nav-menu-item > a {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 10px 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    white-space: nowrap;
    transition: color .2s, background .2s;
}

.nav-menu-item > a:hover {
    color: var(--blue);
    background: rgba(0, 113, 227, 0.06);
}

.nav-menu-item.active > a {
    color: var(--blue);
}

.nav-menu-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 3px;
    border-radius: 999px;
    background: var(--blue);
}

.nav-menu-item .nav-caret {
    font-size: 10px;
    color: var(--muted);
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 148px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    box-shadow: var(--shadow-float);
    padding: 6px;
    margin-top: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(4px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
    z-index: 70;
}

.nav-menu-item.has-dropdown:hover .nav-dropdown,
.nav-menu-item.has-dropdown:focus-within .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-dropdown a {
    display: block;
    padding: 8px 12px;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 13.5px;
    border-radius: 8px;
    white-space: nowrap;
}

.nav-dropdown a:hover {
    background: var(--surface-soft);
    color: var(--blue);
}

/* 角色常驻管理入口（后台管理/商家审核/商店管理/升级商家），常驻可见不藏进下拉 */
.nav-role-link {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    background: rgba(0, 113, 227, 0.08);
    text-decoration: none;
    margin-right: 6px;
    transition: background .2s;
}
.nav-role-link:hover {
    background: rgba(0, 113, 227, 0.16);
}
body.theme-freshhi .nav-role-link {
    color: #a8222c;
    background: rgba(168, 34, 44, 0.08);
}
body.theme-freshhi .nav-role-link:hover {
    background: rgba(168, 34, 44, 0.16);
}
@media (max-width: 640px) {
    .nav-role-link {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* 图标化的搜索/账号/购物车区域 */
.navbar-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--text);
    background: transparent;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, color .2s;
}
.icon-btn svg {
    width: 20px;
    height: 20px;
}
.icon-btn:hover {
    background: rgba(0, 113, 227, 0.08);
    color: var(--blue);
}

.nav-icon-item {
    position: relative;
}

.nav-search-pop {
    left: auto;
    right: 0;
    transform: translateY(4px);
    min-width: 240px;
    padding: 10px;
}
.nav-icon-item.nav-search:hover .nav-search-pop,
.nav-icon-item.nav-search:focus-within .nav-search-pop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-search-pop form {
    display: flex;
    gap: 6px;
}
.nav-search-pop input {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 12px;
    font-size: 13px;
}
.nav-search-pop button {
    border: 0;
    border-radius: 999px;
    padding: 0 14px;
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.nav-account .nav-dropdown {
    left: auto;
    right: 0;
    transform: translateY(4px);
}
.nav-account:hover .nav-dropdown,
.nav-account:focus-within .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-cart {
    position: relative;
}
.nav-cart .cart-count {
    top: 2px;
    right: 2px;
}

/* 覆盖原有 .navbar-right a 的胶囊按钮样式，图标区域改由 .icon-btn / .nav-dropdown 自行控制 */
body.page-home .navbar-right a.icon-btn,
body.page-content .navbar-right a.icon-btn {
    background: transparent;
    border: 0;
    padding: 0;
    min-height: 38px;
    border-radius: 50%;
}
body.page-home .navbar-right .nav-dropdown a,
body.page-content .navbar-right .nav-dropdown a {
    background: transparent;
    border: 0;
    border-radius: 8px;
    padding: 8px 12px;
    min-height: auto;
    display: block;
}
body.page-home .navbar-right .nav-dropdown a:hover,
body.page-content .navbar-right .nav-dropdown a:hover {
    background: var(--surface-soft);
    border-color: transparent;
}
body.page-home .navbar-right a.nav-role-link,
body.page-content .navbar-right a.nav-role-link {
    background: rgba(0, 113, 227, 0.08);
    border: 0;
    min-height: auto;
    color: var(--blue);
}
body.theme-freshhi .navbar-right a.nav-role-link {
    background: rgba(168, 34, 44, 0.08);
    color: #a8222c;
}

/* 汉堡菜单按钮（中等宽度收纳导航） */
.nav-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}
.nav-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}
.nav-menu-toggle:hover {
    background: rgba(0, 113, 227, 0.08);
}
.nav-menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-menu-toggle.open span:nth-child(2) { opacity: 0; }
.nav-menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1499px) {
    body.page-home .navbar-main,
    body.page-content .navbar-main {
        position: relative;
        min-height: 72px;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: 0;
        padding: 0 18px;
    }

    body.page-home .navbar-brand,
    body.page-content .navbar-brand {
        position: absolute;
        left: 50%;
        top: 50%;
        z-index: 2;
        display: inline-flex;
        width: min(46vw, 250px);
        justify-content: center;
        transform: translate(-50%, -50%);
    }

    body.page-home .navbar-brand .site-logo,
    body.page-content .navbar-brand .site-logo {
        width: auto;
        height: 64px;
        max-width: 100%;
    }

    body.page-home .navbar-right,
    body.page-content .navbar-right {
        position: relative;
        z-index: 3;
        margin-left: auto;
        min-width: 0;
    }

    body.page-home .nav-menu-toggle,
    body.page-content .nav-menu-toggle {
        position: absolute;
        top: 50%;
        left: 18px;
        z-index: 4;
        display: inline-flex;
        width: 46px;
        height: 46px;
        transform: translateY(-50%);
    }

    body.page-home .nav-menu-toggle span,
    body.page-content .nav-menu-toggle span {
        width: 27px;
        height: 3px;
        background: #a8222c;
    }

    body.page-home .navbar-content-menu,
    body.page-content .navbar-content-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 20;
        flex-wrap: wrap;
        margin: 0;
        padding: 0;
        background: #fff;
        box-shadow: var(--shadow-float);
    }

    .nav-menu-toggle {
        display: inline-flex;
    }

    body.page-home .navbar-main,
    body.page-content .navbar-main {
        flex-wrap: wrap;
        gap: 10px;
    }

    body.page-home .navbar-content-menu,
    body.page-content .navbar-content-menu {
        display: none;
        order: 5;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-top: 6px;
        border-top: 1px solid var(--line);
    }
    body.page-home .navbar-content-menu.open,
    body.page-content .navbar-content-menu.open { display: flex; }
    body.page-home .nav-menu-item,
    body.page-content .nav-menu-item { width: 100%; }
    body.page-home .nav-menu-item > a,
    body.page-content .nav-menu-item > a {
        width: 100%;
        padding: 12px 6px;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
    }
    body.page-home .nav-menu-item.active::before,
    body.page-content .nav-menu-item.active::before { display: none; }
    body.page-home .nav-menu-item.active > a,
    body.page-content .nav-menu-item.active > a { font-weight: 700; }
    body.page-home .navbar-content-menu .nav-dropdown,
    body.page-content .navbar-content-menu .nav-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 0;
        border-radius: 0;
        margin: 0 0 6px 14px;
        padding: 0;
        background: transparent;
    }
    body.page-home .navbar-content-menu .nav-dropdown a,
    body.page-content .navbar-content-menu .nav-dropdown a { padding: 8px 6px; font-size: 13px; }

    .navbar-right .nav-role-link { display: none; }

    .navbar-content-menu {
        display: none;
        order: 5;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-top: 6px;
        border-top: 1px solid var(--line);
    }
    .navbar-content-menu.open {
        display: flex;
    }
    .nav-menu-item {
        width: 100%;
    }
    .nav-menu-item > a {
        width: 100%;
        padding: 12px 6px;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
    }
    .nav-menu-item.active::before {
        display: none;
    }
    .nav-menu-item.active > a {
        font-weight: 700;
    }
    .navbar-content-menu .nav-dropdown {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 0;
        border-radius: 0;
        margin: 0 0 6px 14px;
        padding: 0;
        background: transparent;
    }
    .navbar-content-menu .nav-menu-item.has-dropdown.expanded > .nav-dropdown {
        display: block;
    }
    .navbar-content-menu .nav-menu-item.has-dropdown:hover .nav-dropdown,
    .navbar-content-menu .nav-menu-item.has-dropdown:focus-within .nav-dropdown {
        transform: none;
    }
    .navbar-content-menu .nav-dropdown a {
        padding: 8px 6px;
        font-size: 13px;
    }
    .nav-search-pop {
        position: absolute;
        top: calc(100% + 6px);
        right: 0;
        min-width: min(240px, calc(100vw - 32px));
        padding: 10px;
        box-shadow: var(--shadow-float);
        border: 1px solid rgba(148, 163, 184, 0.22);
        background: #fff;
        transform: translateY(4px);
    }
    .nav-icon-item.nav-search:hover .nav-search-pop,
    .nav-icon-item.nav-search:focus-within .nav-search-pop {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* 内容页（品牌故事/食谱/常见问题/活动资讯/联系我们）通用样式 */
body.page-content .content-wrap {
    margin: 28px auto 60px;
    max-width: 900px;
}
body.page-content .content-card {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 32px;
}
body.page-content .content-card h1 {
    margin: 0 0 6px;
    font-size: 26px;
}
body.page-content .content-card .content-lead {
    color: var(--muted);
    margin: 0 0 24px;
}
body.page-content .content-card h2 {
    font-size: 18px;
    margin: 28px 0 10px;
}
body.page-content .content-card p {
    line-height: 1.75;
    color: var(--text-soft);
}
body.page-content .faq-item {
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
}
body.page-content .faq-item:last-child {
    border-bottom: 0;
}
body.page-content .faq-item h3 {
    margin: 0 0 6px;
    font-size: 15px;
}
body.page-content .recipe-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 14px;
    background: var(--surface-soft);
}
body.page-content .recipe-card h3 {
    margin: 0 0 8px;
}
body.page-content .recipe-card ol,
body.page-content .recipe-card ul {
    margin: 6px 0 0;
    padding-left: 20px;
    color: var(--text-soft);
    line-height: 1.7;
}
body.page-content .news-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
body.page-content .news-item:last-child {
    border-bottom: 0;
}
body.page-content .news-date {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    padding-top: 2px;
}
body.page-content .contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
body.page-content .contact-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
body.page-content .contact-list li:last-child {
    border-bottom: 0;
}
@media (max-width: 640px) {
    body.page-content .content-card {
        padding: 20px;
    }
}

/* 首页 Hero 轮播广告位（商家投放，管理员审核后展示） */
.home-banner-carousel {
    position: relative;
    max-width: 1360px;
    margin: 20px auto 0;
    padding: 0 24px;
    overflow: hidden;
}
.home-banner-track {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-soft);
    box-shadow: var(--shadow-card);
}
.home-banner-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s ease;
    display: block;
}
.home-banner-slide.active {
    opacity: 1;
    visibility: visible;
}
.home-banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.home-banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.85);
    color: var(--text);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-float);
}
.home-banner-arrow.prev { left: 40px; }
.home-banner-arrow.next { right: 40px; }
.home-banner-arrow:hover { background: #fff; }
.home-banner-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.home-banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: background .2s, transform .2s;
}
.home-banner-dot.active {
    background: #fff;
    transform: scale(1.3);
}
@media (max-width: 640px) {
    .home-banner-track {
        aspect-ratio: 4 / 3;
    }
    .home-banner-arrow {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    .home-banner-arrow.prev { left: 12px; }
    .home-banner-arrow.next { right: 12px; }
}

/* 首页营销模块：热销商品 / 服务价值 / 活动资讯 / 关于我们 */
.home-sections {
    margin: 28px auto 0;
}
.home-section {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px;
    margin-bottom: 20px;
}
.home-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.home-section-head h2 {
    margin: 0;
    font-size: 20px;
}
.home-section-more {
    font-size: 13px;
    color: var(--blue);
    text-decoration: none;
    white-space: nowrap;
}
.home-section-more:hover {
    text-decoration: underline;
}

.home-products-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}
.home-product-card {
    display: block;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 10px;
    transition: box-shadow .2s, transform .2s;
}
.home-product-card:hover {
    box-shadow: var(--shadow-float);
    transform: translateY(-2px);
}
.home-product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    background: var(--surface-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 8px;
    font-size: 28px;
}
.home-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.home-product-name {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.home-product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--blue);
}

.home-service-values {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    text-align: center;
}
.service-value-item {
    padding: 8px;
}
.service-value-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--surface-soft);
    font-size: 24px;
    margin-bottom: 10px;
}
.service-value-item h3 {
    margin: 0 0 4px;
    font-size: 15px;
}
.service-value-item p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.home-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.home-about p {
    color: var(--text-soft);
    line-height: 1.7;
}
.home-about-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.home-about-actions .btn {
    width: auto;
    display: inline-flex;
    align-items: center;
}

/* 底部导航栏 */
.site-footer {
    margin-top: 32px;
    background: var(--surface-strong);
    border-top: 1px solid var(--line);
    padding: 32px 0 0;
}
.site-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 24px;
    padding-bottom: 24px;
}
.site-footer-col h4 {
    margin: 0 0 12px;
    font-size: 14px;
}
.site-footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-footer-col li {
    margin-bottom: 8px;
    font-size: 13.5px;
    color: var(--text-soft);
}
.site-footer-col a {
    color: var(--text-soft);
    text-decoration: none;
}
.site-footer-col a:hover {
    color: var(--blue);
}
.site-footer-bottom {
    border-top: 1px solid var(--line);
    padding: 14px 0;
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
}
.site-footer-bottom p {
    margin: 0;
}

@media (max-width: 900px) {
    .home-section-grid {
        grid-template-columns: 1fr;
    }
    .home-service-values {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .site-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 480px) {
    .home-products-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .site-footer-grid {
        grid-template-columns: 1fr;
    }
}

body.page-home .navbar-brand {
    color: var(--text);
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    flex: 0 0 auto;
}

body.page-home .navbar-search {
    flex: 0 0 230px;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 230px;
    max-width: 230px;
    min-width: 220px;
    margin-left: 0;
}

body.page-home .navbar-search input {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 13px;
    font-size: 13px;
    background: #fff;
}

body.page-home .navbar-search button {
    min-height: 38px;
    padding: 8px 13px;
    font-size: 13px;
    white-space: nowrap;
}

body.page-home .navbar-search button,
body.page-home .btn,
body.page-product .add-cart-btn,
body.page-product .favorite-btn,
body.page-cart .checkout-btn,
body.page-cart .continue-shopping,
body.page-merchant .btn,
body.page-checkout .btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button[disabled],
.btn[disabled],
body.page-product .add-cart-btn[disabled],
body.page-cart .checkout-btn[disabled],
body.page-auth .login-btn[disabled],
body.page-auth .register-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

body.page-home .navbar-search button,
body.page-home .btn-primary,
body.page-product .add-cart-btn,
body.page-cart .checkout-btn,
body.page-merchant .btn.primary,
body.page-checkout .btn {
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(0, 113, 227, 0.26);
}

body.page-home .btn-secondary,
body.page-product .favorite-btn,
body.page-cart .continue-shopping {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--line);
}

body.page-home .favorite-toggle {
    min-width: 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    color: #8a98aa;
    background: transparent;
    border: 0;
    box-shadow: none;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.favorite-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
}

.favorite-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

body.page-home .favorite-toggle.favorited {
    color: #d92d20;
    background: transparent;
    border: 0;
}

body.page-home .favorite-toggle:hover {
    background: #fff7f5;
    box-shadow: none;
}

body.page-product .favorite-btn.favorited {
    color: #d92d20;
    border-color: #ffd4cc;
    background: #fff7f5;
}

body.page-product .favorite-btn {
    min-width: 96px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

body.page-home .navbar-search button:hover,
body.page-home .btn:hover,
body.page-product .add-cart-btn:hover,
body.page-product .favorite-btn:hover,
body.page-cart .checkout-btn:hover,
body.page-cart .continue-shopping:hover,
body.page-merchant .btn:hover,
body.page-checkout .btn:hover {
    transform: translateY(-1px);
}

body.page-home .navbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

body.page-home .navbar-right a,
body.page-product .navbar-links a,
body.page-cart .navbar-links a,
body.page-merchant .nav a:not(.brand-home-link),
body.page-checkout .navbar a:not(.brand-home-link) {
    color: #334155;
    text-decoration: none;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    padding: 6px 10px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

body.page-home .navbar-right a:hover,
body.page-product .navbar-links a:hover,
body.page-cart .navbar-links a:hover,
body.page-profile .navbar-links a:hover,
body.page-merchant .nav a:not(.brand-home-link):hover,
body.page-upgrade .nav a:hover,
body.page-admin-review .nav a:not(.brand-home-link):hover,
body.page-checkout .navbar a:not(.brand-home-link):hover {
    border-color: #b8cbe1;
    background: #f8fbff;
}

body.page-home .navbar-right a[aria-current="page"],
body.page-product .navbar-links a[aria-current="page"],
body.page-cart .navbar-links a[aria-current="page"],
body.page-profile .navbar-links a[aria-current="page"],
body.page-checkout .navbar a:not(.brand-home-link)[aria-current="page"] {
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 16px rgba(0, 113, 227, 0.18);
}

body.page-home .cart-icon {
    position: relative;
}

body.page-home .cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.page-home .main-content,
body.page-product .main-content {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 20px;
    margin: 24px auto;
}

body.page-home .sidebar,
body.page-product .sidebar,
body.page-home .products-section,
body.page-product .product-layout,
body.page-product .product-description,
body.page-product .reviews-section,
body.page-cart .cart-header,
body.page-cart .cart-items,
body.page-cart .cart-summary,
body.page-cart .empty-cart,
body.page-merchant .card,
body.page-checkout .card {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(10px);
    transition: box-shadow 0.24s ease, transform 0.24s ease;
}

body.page-home .sidebar:hover,
body.page-product .sidebar:hover,
body.page-home .products-section:hover,
body.page-product .product-layout:hover,
body.page-product .product-description:hover,
body.page-product .reviews-section:hover,
body.page-cart .cart-header:hover,
body.page-cart .cart-items:hover,
body.page-cart .cart-summary:hover,
body.page-cart .empty-cart:hover,
body.page-merchant .card:hover,
body.page-checkout .card:hover {
    box-shadow: var(--shadow-float);
}

body.page-home .sidebar,
body.page-product .sidebar,
body.page-home .products-section {
    padding: 20px;
}

body.page-home .sidebar h3,
body.page-product .sidebar h3,
body.page-home .products-header h2,
body.page-product .product-description h2,
body.page-product .reviews-section h2,
body.page-cart .cart-header h2,
body.page-checkout .card h2,
body.page-merchant .card h2,
body.page-admin-review .card h2,
body.page-profile .card h2,
body.page-upgrade .card h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

body.page-home .sidebar h3,
body.page-product .sidebar h3,
body.page-home .products-header h2 {
    margin: 0;
    letter-spacing: -0.01em;
}

body.page-home .products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

body.page-home .products-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

body.page-home .per-page-select {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

body.page-home .per-page-select:hover {
    border-color: #b8cbe1;
}

body.page-home .per-page-select:focus {
    border-color: #b8cbe1;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

@media (max-width: 640px) {
    body.page-home .products-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    body.page-home .products-meta {
        width: 100%;
        justify-content: space-between;
    }
}

body.page-home .category-list,
body.page-product .category-list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}

body.page-home .category-list li,
body.page-product .category-list li {
    margin: 0 0 8px;
}

body.page-home .category-list a,
body.page-product .category-list a {
    display: block;
    padding: 9px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
}

body.page-home .category-list a:hover,
body.page-home .category-list a.active,
body.page-product .category-list a:hover,
body.page-product .category-list a.active {
    background: #eaf3ff;
    color: var(--blue);
}

body.page-home .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

body.page-home .empty-state {
    text-align: center;
    padding: 40px;
    color: var(--muted);
}

body.page-home .product-card {
    background: var(--surface-strong);
    border-radius: 18px;
    border: 1px solid #e4ebf5;
    overflow: hidden;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

body.page-home .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px rgba(15, 23, 42, 0.1);
    border-color: #d4e3f5;
}

body.page-home .product-image {
    width: 100%;
    height: 188px;
    background: linear-gradient(180deg, #f7f9fe 0%, #edf3fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
}

body.page-home .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.page-home .product-info {
    padding: 16px;
}

body.page-home .product-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    min-height: 39px;
    color: #0f172a;
    word-break: break-word;
}

body.page-home .product-name a {
    color: inherit;
    text-decoration: none;
}

body.page-home .price-current,
body.page-product .product-price,
body.page-cart .summary-total,
body.page-checkout .summary-total {
    color: var(--blue);
    font-weight: 700;
}

body.page-home .price-original,
body.page-product .product-original-price {
    color: #94a3b8;
    text-decoration: line-through;
}

body.page-home .product-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

body.page-home .product-actions .btn-primary {
    flex: 1 1 auto;
    min-height: 38px;
}

body.page-home .product-actions .favorite-toggle {
    flex: 0 0 38px;
}

body.page-home .pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

body.page-home .pagination a,
body.page-home .pagination span {
    border-radius: 999px;
    border: 1px solid var(--line);
    color: #334155;
    text-decoration: none;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.75);
}

body.page-home .pagination .active,
body.page-home .pagination a:hover {
    background: #eaf3ff;
    color: var(--blue);
}

body.page-home footer {
    text-align: center;
    color: var(--muted);
    padding: 28px 16px 34px;
}

/* product */
body.page-product .navbar,
body.page-cart .navbar,
body.page-checkout .navbar,
body.page-merchant .nav {
    padding: 0 20px;
}

body.page-product .navbar-content,
body.page-cart .navbar-content,
body.page-merchant .nav-inner,
body.page-checkout .navbar-inner {
    max-width: 1360px;
    margin: 0 auto;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.page-product .navbar-content h1,
body.page-cart .navbar-content h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
}

body.page-product .navbar-content h1 a,
body.page-cart .navbar-content h1 a {
    display: inline-flex;
    align-items: center;
}

body.page-product .container,
body.page-cart .container,
body.page-checkout .container {
    max-width: 1360px;
    margin: 22px auto;
    padding: 0 18px;
}

body.page-product .breadcrumb {
    color: var(--muted);
    margin-bottom: 14px;
    line-height: 1.5;
    word-break: break-word;
}

body.page-product .breadcrumb a {
    color: #48607a;
    text-decoration: none;
    font-weight: 500;
}

body.page-product .breadcrumb a:hover {
    color: var(--blue);
}

body.page-product .product-layout,
body.page-product .product-description,
body.page-product .reviews-section {
    padding: 22px;
}

body.page-product .product-layout {
    display: grid;
    grid-template-columns: 410px 1fr;
    gap: 24px;
    margin-bottom: 16px;
}

body.page-product .product-media {
    min-width: 0;
}

body.page-product .product-image {
    height: 410px;
    border-radius: 18px;
    border: 1px solid #e1e9f4;
    overflow: hidden;
    background: linear-gradient(180deg, #f6f9ff 0%, #ebf1fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 96px;
}

body.page-product .product-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

body.page-product .product-thumb {
    aspect-ratio: 1;
    border: 1px solid #e1e9f4;
    border-radius: 12px;
    background: #fff;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
}

body.page-product .product-thumb.active {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
}

body.page-product .product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.page-product .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.page-product .product-details h1 {
    font-size: 31px;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

body.page-product .product-category,
body.page-product .rating-count,
body.page-product .product-stock,
body.page-product .review-content,
body.page-product .review-date {
    color: var(--muted);
}

body.page-product .product-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

body.page-product .stars,
body.page-home .stars,
body.page-product .review-rating {
    color: #ff9f0a;
}

body.page-product .product-price {
    font-size: 34px;
    margin-bottom: 8px;
}

body.page-product .product-original-price {
    margin-bottom: 16px;
}

body.page-product .product-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    align-items: center;
}

body.page-product .stock-empty {
    color: #b42318;
}

body.page-product .qty-input,
body.page-cart .item-quantity input,
body.page-checkout input,
body.page-checkout textarea,
body.page-checkout select,
body.page-merchant .field input,
body.page-merchant .field select,
body.page-merchant .field textarea,
body.page-merchant .rich-editor,
body.page-merchant .row-desc-editor {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

body.page-product .qty-input {
    width: 84px;
    text-align: center;
    padding: 11px;
}

body.page-product .product-description img {
    max-width: 100%;
    border-radius: 10px;
    margin: 10px 0;
}

body.page-product .review-item {
    padding: 14px 0;
    border-bottom: 1px solid #ecf0f5;
}

body.page-product .review-compose {
    margin: 8px 0 18px;
    padding: 14px;
    border: 1px solid #dfe8f5;
    border-radius: 14px;
    background: #f9fbff;
}

body.page-product .review-compose h4 {
    margin: 0 0 10px;
}

body.page-product .review-form-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
}

body.page-product .review-form-grid .field-wide {
    grid-column: span 2;
}

body.page-product .review-form-grid label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #3d4f64;
}

body.page-product .review-form-grid input,
body.page-product .review-form-grid select,
body.page-product .review-form-grid textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 9px 10px;
    font-size: 14px;
}

body.page-product .review-tip {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

body.page-product .review-item:last-child {
    border-bottom: 0;
}

body.page-product .review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

body.page-product .no-reviews {
    text-align: center;
    color: var(--muted);
    padding: 24px;
}

/* cart */
body.page-cart .container {
    max-width: 1360px;
}

body.page-cart .cart-header,
body.page-cart .cart-items,
body.page-cart .cart-summary,
body.page-cart .empty-cart {
    padding: 20px;
}

body.page-cart .cart-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 16px;
}

body.page-cart .empty-cart {
    text-align: center;
}

body.page-cart .empty-cart-icon,
body.page-cart .item-image {
    background: linear-gradient(180deg, #f4f7fc 0%, #ebf0f8 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.page-cart .empty-cart-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 12px;
    font-size: 40px;
}

body.page-cart .back-btn {
    text-decoration: none;
    color: #fff;
    display: inline-block;
    padding: 10px 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
}

body.page-cart .cart-item {
    display: grid;
    grid-template-columns: 88px 1fr 120px 84px 36px;
    gap: 12px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #edf2f8;
}

body.page-cart .cart-item:last-child {
    border-bottom: 0;
}

body.page-cart .item-image {
    width: 84px;
    height: 84px;
    font-size: 30px;
    overflow: hidden;
}

body.page-cart .item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.page-cart .item-price {
    color: var(--blue);
    font-weight: 700;
}

body.page-cart .item-quantity input {
    width: 56px;
    text-align: center;
    padding: 6px;
}

body.page-cart .item-remove {
    text-decoration: none;
    color: #98a2b3;
    font-size: 24px;
}

body.page-cart .item-remove:hover {
    color: var(--danger);
}

body.page-cart .cart-summary {
    position: sticky;
    top: 84px;
    height: fit-content;
}

body.page-cart .summary-item,
body.page-checkout .summary-row {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}

body.page-cart .summary-total,
body.page-checkout .summary-total {
    border-top: 1px solid #e8edf5;
    padding-top: 12px;
    margin-top: 12px;
    font-size: 19px;
    letter-spacing: 0.01em;
}

/* merchant */
body.page-merchant {
    color: #1d2939;
}

body.page-merchant .wrap {
    max-width: 1360px;
    margin: 20px auto;
    padding: 0 14px;
}

body.page-merchant .card {
    padding: 18px;
}

body.page-merchant .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

body.page-merchant .compose-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 12px;
    align-items: start;
}

body.page-merchant .compose-side {
    position: sticky;
    top: 78px;
    display: grid;
    gap: 10px;
}

body.page-merchant .compose-side .card {
    padding: 14px;
}

body.page-merchant .compose-side .card h2 {
    margin-bottom: 8px;
    font-size: 18px;
}

body.page-merchant .compose-meta-grid {
    grid-template-columns: repeat(2, 1fr);
}

body.page-merchant .compose-meta-grid .field-wide {
    grid-column: span 2;
}

body.page-merchant .field label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #475467;
}

body.page-merchant .field input,
body.page-merchant .field select,
body.page-merchant .field textarea,
body.page-merchant .rich-editor,
body.page-merchant .row-desc-editor {
    width: 100%;
    padding: 9px;
    font-size: 14px;
}

body.page-merchant .field input:hover,
body.page-merchant .field select:hover,
body.page-merchant .field textarea:hover,
body.page-checkout input:hover,
body.page-checkout textarea:hover,
body.page-checkout select:hover,
body.page-upgrade input:hover,
body.page-upgrade textarea:hover,
body.page-auth .form-group input:hover,
body.page-password input:hover,
body.page-profile .field input:hover,
body.page-profile .field textarea:hover {
    border-color: #bfd0e6;
}

body.page-checkout input:disabled,
body.page-checkout textarea:disabled,
body.page-checkout select:disabled,
body.page-upgrade input:disabled,
body.page-upgrade textarea:disabled,
body.page-auth .form-group input:disabled,
body.page-password input:disabled,
body.page-profile .field input:disabled,
body.page-profile .field textarea:disabled,
body.page-merchant .field input:disabled,
body.page-merchant .field textarea:disabled,
body.page-merchant .field select:disabled {
    background: #f2f5fa;
    color: #8b99ad;
}

body.page-checkout input:invalid,
body.page-checkout textarea:invalid,
body.page-checkout select:invalid,
body.page-upgrade input:invalid,
body.page-upgrade textarea:invalid,
body.page-auth .form-group input:invalid,
body.page-password input:invalid,
body.page-profile .field input:invalid,
body.page-profile .field textarea:invalid,
body.page-merchant .field input:invalid,
body.page-merchant .field textarea:invalid,
body.page-merchant .field select:invalid {
    border-color: #ef9a9a;
}

body.page-merchant .field .small,
body.page-merchant .muted {
    color: #667085;
    font-size: 12px;
}

body.page-merchant .row-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

body.page-merchant .row-inline .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: 104px;
}

body.page-merchant .row-inline input[type="text"],
body.page-merchant .row-inline input[type="file"] {
    min-width: 0;
}

body.page-merchant .thumb-preview {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
}

body.page-merchant .product-name-cell {
    font-weight: 700;
    color: var(--text);
    width: 180px;
    max-width: 180px;
    min-width: 160px;
}

body.page-merchant .product-name-cell a.product-name-link {
    display: block;
    color: #0071e3;
    text-decoration: none;
    overflow-wrap: break-word;
    word-break: break-word;
}

body.page-merchant .product-name-cell a.product-name-link:hover {
    color: #005bb5;
    text-decoration: underline;
}

body.page-merchant .list-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    font-size: 12px;
    color: var(--muted);
}

/* 商品列表操作列：按钮横排紧凑显示，降低行高 */
body.page-merchant .row-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
}

body.page-merchant .row-actions .btn {
    padding: 3px 8px;
    font-size: 12px;
    min-height: 26px;
    line-height: 1.2;
    white-space: nowrap;
}

/* 分类列单行显示，避免窄列把分类名竖排拉高整行 */
body.page-merchant td:nth-child(3) {
    white-space: nowrap;
}

body.page-merchant .empty-thumb {
    border-style: dashed;
}

/* 商品列表筛选工具栏 */
body.page-merchant .merchant-product-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 4px 0 14px;
}

body.page-merchant .merchant-product-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

body.page-merchant .merchant-product-filters select {
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    cursor: pointer;
}

body.page-merchant .merchant-product-count {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

/* 商品列表翻页导航 */
body.page-merchant .merchant-pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}

body.page-merchant .merchant-pagination a,
body.page-merchant .merchant-pagination span {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    text-decoration: none;
    background: #fff;
    font-size: 13px;
}

body.page-merchant .merchant-pagination .active,
body.page-merchant .merchant-pagination a:hover {
    background: #eaf3ff;
    color: var(--blue);
    border-color: #bfdbfe;
}

body.page-merchant .editor-toolbar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    align-items: center;
}

body.page-merchant .editor-toolbar button,
body.page-merchant .editor-toolbar select {
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 6px 11px;
    background: #fff;
    cursor: pointer;
    color: #334155;
    font-size: 13px;
}

body.page-merchant .editor-toolbar select {
    width: auto;
    min-width: 68px;
    max-width: 96px;
    flex: 0 0 auto;
    padding: 6px 28px 6px 10px;
}

body.page-merchant .editor-toolbar .icon-btn {
    min-width: 34px;
    height: 32px;
    padding: 0 9px;
    font-weight: 700;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.page-merchant .editor-toolbar .icon-btn[title="上传并插入图片"] {
    min-width: 48px;
}

body.page-merchant .editor-toolbar button:hover,
body.page-merchant .editor-toolbar select:hover {
    border-color: #bfd0e5;
    background: #f8fbff;
}

body.page-merchant .editor-toolbar .editor-divider {
    width: 1px;
    background: #e5edf7;
    margin: 4px 4px;
}

body.page-merchant .editor-toolbar .toolbar-upload {
    max-width: 200px;
    border-radius: 999px;
    border: 1px dashed #c8d7ea;
    background: #f8fbff;
    padding: 4px 9px;
    opacity: 0.9;
}

body.page-merchant .nav a:not(.brand-home-link):first-child,
body.page-admin-review .nav a:not(.brand-home-link):first-child,
body.page-upgrade .nav a:not(.brand-home-link):first-child {
    background: #eaf3ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

body.page-merchant .nav a:not(.brand-home-link):not(:first-child),
body.page-admin-review .nav a:not(.brand-home-link):not(:first-child),
body.page-upgrade .nav a:not(:first-child) {
    opacity: 0.95;
}

body.page-merchant .nav a[aria-current="page"],
body.page-admin-review .nav a[aria-current="page"],
body.page-upgrade .nav a[aria-current="page"] {
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 16px rgba(0, 113, 227, 0.18);
}

body.page-merchant .editor-panel {
    border: 1px solid #dce5f0;
    border-radius: 14px;
    background: #fbfdff;
    padding: 8px;
}

body.page-merchant .rich-editor,
body.page-merchant .row-desc-editor,
body.page-merchant .editor-source,
body.page-merchant .editor-preview {
    min-height: 180px;
    padding: 12px;
    border-radius: 12px;
    background: #fff;
}

body.page-merchant .editor-source {
    width: 100%;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    resize: vertical;
}

body.page-merchant .editor-preview {
    border: 1px solid #e4ebf5;
    overflow: auto;
}

body.page-merchant .editor-preview img,
body.page-merchant .rich-editor img,
body.page-merchant .row-desc-editor img {
    max-width: 100%;
    border-radius: 8px;
}

body.page-merchant .editor-preview table,
body.page-merchant .rich-editor table,
body.page-merchant .row-desc-editor table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}

body.page-merchant .editor-preview td,
body.page-merchant .editor-preview th,
body.page-merchant .rich-editor td,
body.page-merchant .rich-editor th,
body.page-merchant .row-desc-editor td,
body.page-merchant .row-desc-editor th {
    border: 1px solid #d7e1ee;
    padding: 6px 8px;
}

body.page-merchant .editor-hidden {
    display: none;
}

body.page-merchant .actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

body.page-merchant .category-picker {
    border: 1px solid #e3eaf5;
    border-radius: 12px;
    background: #fbfdff;
    padding: 10px;
}

body.page-merchant .category-collapse-trigger {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    cursor: pointer;
}

body.page-merchant .category-picker .collapse-icon {
    font-size: 14px;
    color: #667085;
    transition: transform 0.18s ease;
}

body.page-merchant .category-picker.collapsed .collapse-icon {
    transform: rotate(180deg);
}

body.page-merchant .category-box-body {
    margin-top: 10px;
}

body.page-merchant .category-picker.collapsed .category-box-body {
    display: none;
}

body.page-merchant .category-search-wrap input {
    padding-left: 10px;
}

body.page-merchant .category-option-list {
    margin-top: 8px;
    max-height: 172px;
    overflow: auto;
    border: 1px solid #e7edf6;
    border-radius: 10px;
    background: #fff;
    padding: 6px;
}

body.page-merchant .category-option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    font-size: 14px;
    color: #1f2937;
}

body.page-merchant .category-option-item input {
    width: 16px;
    height: 16px;
}

body.page-merchant .category-empty {
    font-size: 12px;
    color: #667085;
    padding: 8px 4px;
}

body.page-merchant .category-add-link {
    border: 0;
    background: transparent;
    color: #2563eb;
    font-size: 13px;
    padding: 8px 2px 2px;
    cursor: pointer;
}

body.page-merchant .category-add-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

body.page-merchant .category-add-drawer {
    margin-top: 8px;
    border-top: 1px dashed #d6e2f0;
    padding-top: 10px;
    display: grid;
    gap: 8px;
}

body.page-merchant .category-manage-drawer {
    margin-top: 8px;
    border-top: 1px dashed #d6e2f0;
    padding-top: 10px;
}

body.page-merchant .category-add-drawer label {
    font-size: 12px;
    color: #475467;
}

body.page-merchant .category-drawer-actions {
    display: flex;
    justify-content: flex-start;
}

body.page-merchant .cover-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

body.page-merchant .cover-gallery-item {
    position: relative;
    border: 1px solid #e3eaf5;
    border-radius: 10px;
    background: #fff;
    padding: 6px;
}

body.page-merchant .cover-gallery-item img {
    width: 100%;
    height: 82px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

body.page-merchant .cover-main-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.9);
    color: #fff;
    font-size: 11px;
    line-height: 1.4;
}

body.page-merchant .cover-remove-btn {
    width: 100%;
    margin-top: 6px;
    min-height: 28px;
    font-size: 12px;
    padding: 4px 8px;
}

body.page-merchant .category-manage-list {
    display: grid;
    gap: 8px;
    max-height: 320px;
    overflow: auto;
    padding-right: 2px;
}

body.page-merchant .category-layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

body.page-merchant .category-create-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

body.page-merchant .category-create-form .btn {
    justify-self: stretch;
    min-width: 92px;
}

body.page-merchant .category-manage-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    border: 1px solid #e6edf6;
    border-radius: 10px;
    background: #fcfdff;
    padding: 8px;
    overflow: hidden;
}

body.page-merchant .category-manage-drawer .category-manage-item {
    background: #fdfefe;
}

body.page-merchant .category-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

body.page-merchant .category-manage-item input {
    flex: 1;
    padding: 7px 8px;
}

body.page-merchant .category-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

body.page-merchant .category-actions .btn {
    min-width: 58px;
    padding: 6px 8px;
    font-size: 12px;
}

body.page-merchant .category-menu {
    position: relative;
}

body.page-merchant .category-actions .menu-trigger {
    min-width: 34px;
    width: 34px;
    height: 30px;
    padding: 0;
    border-radius: 9px;
    font-size: 16px;
    line-height: 1;
}

body.page-merchant .category-menu .menu-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    display: none;
    min-width: 96px;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid #dce5f0;
    background: #fff;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
    z-index: 4;
}

body.page-merchant .category-menu.open .menu-pop {
    display: block;
}

body.page-merchant .category-menu .menu-pop .btn {
    width: 100%;
    justify-content: center;
}

body.page-merchant .category-pill {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 11px;
    color: #3b4e68;
    background: #edf3fb;
    border: 1px solid #d6e3f3;
}

body.page-merchant .field-wide {
    grid-column: span 2;
}

body.page-merchant .mt-12 {
    margin-top: 12px;
}

body.page-merchant .mt-6 {
    margin-top: 6px;
}

body.page-merchant .input-full {
    width: 100%;
    margin-bottom: 6px;
}

body.page-merchant .hide-input {
    display: none;
}

body.page-merchant .price-input,
body.page-merchant .discount-input {
    width: 110px;
}

body.page-merchant .price-input {
    margin-bottom: 6px;
}

body.page-merchant .stock-input {
    width: 90px;
}

body.page-merchant .action-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body.page-merchant .btn.warn {
    background: #ff9f0a;
    color: #fff;
}

body.page-merchant .btn.danger {
    background: #ff3b30;
    color: #fff;
}

body.page-merchant table {
    width: 100%;
    border-collapse: collapse;
}

body.page-merchant .merchant-order-filter {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 12px 0 16px;
}

body.page-merchant .merchant-order-filter input,
body.page-merchant .merchant-order-filter select {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    padding: 9px 12px;
    min-height: 40px;
}

body.page-merchant .merchant-order-filter input {
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 480px;
}

body.page-merchant .page-merchant-orders td a,
body.page-merchant-orders td a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 700;
}

body.page-merchant .merchant-order-list {
    display: grid;
    gap: 14px;
}

body.page-merchant .merchant-order-card {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr) 210px;
    gap: 16px;
    padding: 14px;
    border: 1px solid #dfe8f5;
    border-radius: 16px;
    background: #fbfdff;
    page-break-inside: avoid;
}

body.page-merchant .merchant-order-media {
    width: 116px;
    height: 116px;
    border-radius: 14px;
    background: #eef5ff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 13px;
}

body.page-merchant .merchant-order-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.page-merchant .merchant-order-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

body.page-merchant .merchant-order-title strong,
body.page-merchant .merchant-order-grid strong,
body.page-merchant .merchant-order-side strong {
    display: block;
    color: var(--text);
}

body.page-merchant .merchant-order-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
}

body.page-merchant .merchant-order-grid a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 700;
}

body.page-merchant .merchant-order-grid small,
body.page-merchant .merchant-order-side small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

body.page-merchant .merchant-order-address {
    grid-column: span 2;
}

/* 订单商品配货供应商标记（仅商家配货用，不出现在小票） */
body.page-merchant .pick-supplier {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 4px 8px;
    background: #fff8e6;
    border: 1px solid #f5e1a4;
    border-radius: 8px;
    font-size: 12px;
    flex-wrap: wrap;
}

body.page-merchant .pick-supplier-tag {
    background: #f59e0b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
}

body.page-merchant .pick-supplier-name {
    color: #92400e;
    font-weight: 700;
}

body.page-merchant .pick-supplier small {
    color: #a16207;
    margin-top: 0;
}

body.page-merchant .merchant-order-side {
    display: grid;
    gap: 12px;
    align-content: start;
    border-left: 1px solid #e4ebf5;
    padding-left: 14px;
}

body.page-merchant .merchant-order-action {
    display: grid;
    gap: 7px;
}

body.page-merchant .merchant-order-action label {
    font-size: 12px;
    font-weight: 700;
    color: #52657a;
}

body.page-merchant .merchant-order-action select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    padding: 9px 12px;
}

body.page-merchant .merchant-order-action .btn {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    white-space: nowrap;
}

body.page-merchant .table-scroll,
body.page-admin-review .table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.page-merchant table thead th,
body.page-admin-review table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f6f9ff;
    color: #334155;
}

body.page-merchant tbody tr:nth-child(even),
body.page-admin-review tbody tr:nth-child(even) {
    background: rgba(248, 251, 255, 0.65);
}

body.page-merchant tbody tr:hover,
body.page-admin-review tbody tr:hover {
    background: #eef5ff;
}

body.page-merchant th,
body.page-merchant td {
    border-bottom: 1px solid #e9eef5;
    padding: 10px 8px;
    font-size: 14px;
    text-align: left;
    vertical-align: top;
}

body.page-merchant td,
body.page-admin-review td {
    line-height: 1.6;
}

body.page-merchant td:last-child,
body.page-admin-review td:last-child,
body.page-admin-review .actions {
    white-space: nowrap;
}

body.page-merchant .badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
}

body.page-merchant .status-active {
    background: #e7f8f0;
    color: #027a48;
}

body.page-merchant .status-inactive {
    background: #fff4e5;
    color: #b54708;
}

body.page-merchant .toast {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    display: none;
}

body.page-merchant .toast.ok {
    background: #e7f8f0;
    color: #027a48;
}

body.page-merchant .toast.err {
    background: #ffece8;
    color: #b42318;
}

/* 自定义确认弹窗（全局） */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirm-overlay[hidden] {
    display: none;
}

.confirm-dialog {
    width: 100%;
    max-width: 340px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
    padding: 22px 20px 18px;
    text-align: center;
}

.confirm-dialog h3 {
    margin: 0 0 10px;
    font-size: 17px;
}

.confirm-dialog p {
    margin: 0 0 18px;
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-actions .btn {
    width: auto;
    min-width: 96px;
    white-space: nowrap;
}

.confirm-actions .btn.danger {
    background: linear-gradient(180deg, #f43f5e 0%, #e11d48 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(225, 29, 72, 0.26);
}

/* checkout */
body.page-checkout .container {
    max-width: 1360px;
}

body.page-checkout .layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
}

body.page-checkout .card {
    padding: 18px;
}

body.page-checkout .card h2 {
    margin-top: 0;
}

body.page-checkout .msg {
    padding: 11px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 14px;
}

body.page-checkout .msg.error {
    background: #ffece8;
    color: #b42318;
}

body.page-checkout .msg.success {
    background: #e7f8f0;
    color: #027a48;
}

body.page-checkout .form-group {
    margin-bottom: 12px;
}

body.page-checkout label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

body.page-checkout input,
body.page-checkout textarea,
body.page-checkout select {
    width: 100%;
    padding: 10px;
    font-size: 14px;
}

body.page-checkout textarea {
    min-height: 76px;
    resize: vertical;
}

body.page-checkout .item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #edf2f8;
}

body.page-checkout .item:last-child {
    border-bottom: 0;
}

body.page-checkout .muted,
body.page-checkout .empty {
    color: var(--muted);
}

body.page-checkout .empty {
    text-align: center;
    padding: 40px 0;
}

body.page-checkout .links {
    margin-top: 12px;
    text-align: center;
}

/* checkout 优化 */
body.page-checkout .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

body.page-checkout .item-main {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

body.page-checkout .checkout-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
    flex: 0 0 auto;
}

body.page-checkout .item-info {
    min-width: 0;
}

body.page-checkout .item-name {
    font-weight: 600;
}

body.page-checkout .submit-btn {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    border-radius: 999px;
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(0, 113, 227, 0.26);
}

body.page-checkout .submit-btn:hover {
    background: linear-gradient(180deg, #1b8bff 0%, #005bb5 100%);
}

body.page-checkout .submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

body.page-checkout .checkout-submit-row {
    margin-top: 14px;
}

body.page-checkout .summary-total span:last-child {
    color: var(--blue);
    font-weight: 700;
}

body.page-checkout .order-table {
    margin-top: 4px;
}

body.page-checkout .order-table-head,
body.page-checkout .order-item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 92px 56px 112px;
    gap: 10px;
    align-items: center;
}

body.page-checkout .order-table-head {
    padding: 8px 0;
    border-bottom: 1px solid #e4ebf5;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

body.page-checkout .order-table-head span:nth-child(3),
body.page-checkout .order-table-head span:nth-child(5) {
    text-align: right;
}

body.page-checkout .order-table-head span:nth-child(4) {
    text-align: center;
}

body.page-checkout .order-item {
    padding: 10px 0;
    border-bottom: 1px solid #edf2f8;
}

body.page-checkout .order-item:last-child {
    border-bottom: 0;
}

body.page-checkout .order-item-name {
    font-weight: 600;
    min-width: 0;
    word-break: break-word;
}

body.page-checkout .order-item-price {
    text-align: right;
    color: var(--muted);
}

body.page-checkout .order-item-qty {
    text-align: center;
    color: var(--muted);
}

body.page-checkout .order-item-subtotal {
    text-align: right;
    font-weight: 600;
}

body.page-checkout .order-item-thumb {
    width: 48px;
    height: 48px;
}

body.page-checkout .thumb-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 11px;
    color: var(--muted);
    background: #f8fbff;
}

body.page-checkout .address-book {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf2f8;
}

body.page-checkout .address-book-hint {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
}

body.page-checkout .address-list {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
}

body.page-checkout .address-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

body.page-checkout .address-option:hover {
    border-color: #b6c4d9;
}

body.page-checkout .address-option.selected {
    border-color: var(--blue);
    box-shadow: 0 0 0 1px var(--blue) inset;
    background: #f3f9ff;
}

body.page-checkout .address-option-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
}

body.page-checkout .address-option-top {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

body.page-checkout .address-option-top b {
    font-weight: 700;
}

body.page-checkout .address-option-top i {
    font-style: normal;
    color: var(--muted);
    font-size: 13px;
}

body.page-checkout .default-tag {
    font-style: normal;
    font-size: 11px;
    color: #027a48;
    background: #e7f8f0;
    padding: 2px 8px;
    border-radius: 999px;
}

body.page-checkout .address-option-addr {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    word-break: break-word;
}

body.page-checkout .address-add-btn {
    width: 100%;
    background: #fff;
    color: var(--blue);
    border: 1px dashed #9db8dc;
    box-shadow: none;
}

body.page-checkout .address-add-btn:hover {
    background: #f3f9ff;
    border-color: var(--blue);
}

body.page-checkout .btn.ghost {
    background: #fff;
    color: var(--blue);
    border: 1px solid #bfd4ef;
    box-shadow: none;
}

body.page-checkout .btn.ghost:hover {
    background: #f3f9ff;
    border-color: var(--blue);
}

body.page-checkout .address-save-row {
    margin-top: 4px;
}

body.page-checkout .set-default-btn {
    margin-top: 6px;
    align-self: flex-start;
    border: 1px solid #bfd4ef;
    border-radius: 999px;
    background: #fff;
    color: var(--blue);
    font-size: 12px;
    line-height: 1;
    padding: 5px 12px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

body.page-checkout .set-default-btn:hover {
    background: #f3f9ff;
    border-color: var(--blue);
}

body.page-checkout .address-edit-btn {
    margin-left: auto;
    flex: 0 0 auto;
    align-self: flex-start;
    border: 1px solid #bfd4ef;
    border-radius: 999px;
    background: #fff;
    color: var(--blue);
    font-size: 12px;
    line-height: 1;
    padding: 5px 12px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

body.page-checkout .address-edit-btn:hover {
    background: #f3f9ff;
    border-color: var(--blue);
}

body.page-checkout .address-option-side-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
    align-items: stretch;
}

body.page-checkout .address-option-side-actions .address-edit-btn,
body.page-checkout .address-option-side-actions .address-delete-btn,
body.page-checkout .address-option-side-actions .set-default-btn {
    width: 72px;
    min-height: 28px;
    white-space: nowrap;
    text-align: center;
    box-sizing: border-box;
    margin-left: 0;
    margin-top: 0;
    align-self: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.page-checkout .default-badge {
    width: 72px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid #cdebd8;
    border-radius: 999px;
    background: #e7f8f0;
    color: #027a48;
    font-size: 12px;
    line-height: 1;
    padding: 6px 0;
}

body.page-checkout .address-delete-btn {
    border: 1px solid #f2c4bc;
    border-radius: 999px;
    background: #fff;
    color: #b42318;
    font-size: 12px;
    line-height: 1;
    padding: 5px 12px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

body.page-checkout .address-delete-btn:hover {
    background: #ffece8;
    border-color: #d92d20;
}

body.page-checkout .address-form-fields {
    padding-top: 14px;
}

body.page-checkout .checkout-submit-area {
    margin-top: 16px;
}

/* 订单详情页优化 */
body.page-profile .order-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
    padding-bottom: 14px;
    border-bottom: 1px solid #e8edf5;
    margin-bottom: 14px;
}

body.page-profile .order-head-main h2 {
    margin: 0 0 8px;
}

body.page-profile .order-number {
    font-size: 14px;
    color: var(--muted);
}

body.page-profile .order-number strong {
    color: var(--text);
}

body.page-profile .order-badges {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

body.page-profile .order-badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef2f7;
    color: #48607a;
}

body.page-profile .order-badge.status-processing {
    background: #fff4e5;
    color: #b54708;
}

body.page-profile .order-badge.status-waiting_delivery {
    background: #f3e8ff;
    color: #6d28d9;
}

body.page-profile .order-badge.status-shipping {
    background: #e7f8f0;
    color: #027a48;
}

body.page-profile .order-badge.status-delivered {
    background: #e7f0ff;
    color: #1d4ed8;
}

body.page-profile .order-badge.status-cancelled {
    background: #ffece8;
    color: #b42318;
}

body.page-profile .order-amount {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

body.page-profile .order-amount span {
    font-size: 12px;
    color: var(--muted);
}

body.page-profile .order-amount strong {
    font-size: 24px;
    color: var(--blue);
    font-weight: 800;
    line-height: 1;
}

body.page-profile .order-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
    margin-bottom: 6px;
}

body.page-profile .order-field {
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-size: 14px;
    padding: 4px 0;
}

body.page-profile .order-field span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 13px;
    min-width: 64px;
}

body.page-profile .order-field strong {
    font-weight: 600;
    word-break: break-word;
}

body.page-profile .order-field-full {
    display: flex;
}

body.page-profile .order-meta {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
}

body.page-profile .order-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

body.page-profile .order-table-head,
body.page-profile .order-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 80px 48px 96px 88px;
    gap: 10px;
    align-items: center;
}

body.page-profile .order-table-head {
    padding: 8px 0;
    border-bottom: 1px solid #e4ebf5;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

body.page-profile .order-table-head span:nth-child(n+3) {
    text-align: right;
}

body.page-profile .order-table-head span:nth-child(4) {
    text-align: center;
}

body.page-profile .order-item {
    padding: 10px 0;
    border-bottom: 1px solid #edf2f8;
}

body.page-profile .order-item:last-child {
    border-bottom: 0;
}

body.page-profile .order-item-thumb {
    width: 48px;
    height: 48px;
}

body.page-profile .order-item-thumb img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

body.page-profile .order-thumb-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #f8fbff;
    border: 1px solid var(--line);
    font-size: 11px;
    color: var(--muted);
}

body.page-profile .order-item-name {
    font-weight: 600;
    min-width: 0;
    word-break: break-word;
}

body.page-profile .order-item-thumb a {
    display: block;
}

body.page-profile .order-item-thumb a img {
    transition: transform .2s;
}

body.page-profile .order-item-thumb a:hover img {
    transform: scale(1.05);
}

body.page-profile .order-item-name a {
    color: inherit;
    text-decoration: none;
    transition: color .2s;
}

body.page-profile .order-item-name a:hover {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

body.page-profile .order-item-price {
    text-align: right;
    color: var(--muted);
}

body.page-profile .order-item-qty {
    text-align: center;
    color: var(--muted);
}

body.page-profile .order-item-subtotal {
    text-align: right;
    font-weight: 600;
}

body.page-profile .order-item-action {
    text-align: right;
}

body.page-profile .order-item-action .btn {
    white-space: nowrap;
    padding: 8px 12px;
}

@media (max-width: 640px) {
    body.page-profile .order-grid {
        grid-template-columns: 1fr;
    }

    body.page-profile .order-table-head,
    body.page-profile .order-item {
        grid-template-columns: 48px minmax(0, 1fr) 40px 80px;
    }

    body.page-profile .order-table-head span:nth-child(3),
    body.page-profile .order-item-price {
        display: none;
    }

    body.page-profile .order-table-head span:nth-child(6),
    body.page-profile .order-item-action {
        display: none;
    }
}

/* auth + account */
body.page-auth,
body.page-password,
body.page-verify {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

body.page-auth .login-container,
body.page-auth .register-container,
body.page-password .container,
body.page-verify .verify-container {
    width: 100%;
    max-width: 520px;
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(10px);
    padding: 28px;
    position: relative;
    overflow: hidden;
}

body.page-auth .login-container::before,
body.page-auth .register-container::before,
body.page-password .container::before,
body.page-verify .verify-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #b8d9ff 0%, #0071e3 52%, #7cb8ff 100%);
}

body.page-auth .login-header,
body.page-auth .register-header {
    text-align: center;
    margin-bottom: 22px;
}

body.page-auth .login-header h1,
body.page-auth .register-header h1,
body.page-password h1,
body.page-verify .verify-title {
    font-size: 28px;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

body.page-auth .login-header p,
body.page-auth .register-header p,
body.page-password .desc,
body.page-verify .verify-message,
body.page-auth .register-footer,
body.page-auth .login-footer {
    color: var(--muted);
}

body.page-auth .form-group,
body.page-password .form-group {
    margin-bottom: 18px;
}

body.page-auth .form-group label,
body.page-password label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
}

body.page-auth .form-group input,
body.page-password input,
body.page-profile .field input,
body.page-profile .field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px;
    font-size: 14px;
    background: #fff;
}

body.page-auth .form-group input:focus,
body.page-password input:focus,
body.page-profile .field input:focus,
body.page-profile .field textarea:focus {
    outline: none;
    border-color: #8cbaf2;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

body.page-password .back-link {
    margin: 0 0 14px;
}
body.page-password .back-link a {
    color: var(--muted);
    text-decoration: none;
    font-size: 13.5px;
}
body.page-password .back-link a:hover {
    color: var(--blue);
}

body.page-auth .login-btn,
body.page-auth .register-btn,
body.page-password .btn,
body.page-verify .verify-btn,
body.page-profile .btn {
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 11px 16px;
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(0, 113, 227, 0.26);
}

body.page-auth .login-btn:hover,
body.page-auth .register-btn:hover,
body.page-password .btn:hover,
body.page-verify .verify-btn:hover,
body.page-profile .btn:hover {
    transform: translateY(-1px);
}

body.page-auth .login-footer,
body.page-auth .register-footer,
body.page-password .links {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
}

body.page-auth .login-footer p,
body.page-auth .register-footer p,
body.page-password .links p {
    margin: 8px 0;
}

body.page-auth .login-footer a,
body.page-auth .register-footer a,
body.page-password .links a,
body.page-verify .verify-btn.ghost {
    color: var(--blue);
    text-decoration: none;
}

body.page-auth .error,
body.page-password .msg.error,
body.page-verify .error,
body.page-upgrade .msg.error,
body.page-admin-review .msg.error,
body.page-profile .msg.error {
    background: #ffece8;
    color: #b42318;
    border-radius: 10px;
    padding: 11px 12px;
    margin-bottom: 12px;
}

body.page-auth .success,
body.page-password .msg.success,
body.page-verify .success,
body.page-upgrade .msg.success,
body.page-admin-review .msg.success,
body.page-profile .msg.success {
    background: #e7f8f0;
    color: #027a48;
    border-radius: 10px;
    padding: 11px 12px;
    margin-bottom: 12px;
}

body.page-auth .password-requirements {
    background: #f8fbff;
    border: 1px solid #d7e7fb;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 18px;
    color: #46607e;
    font-size: 13px;
}

body.page-auth .password-requirements li {
    list-style: none;
    margin-top: 6px;
}

/* profile */
body.page-profile .navbar {
    padding: 0 20px;
}

body.page-profile .navbar-content {
    max-width: 1360px;
    margin: 0 auto;
    min-height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

body.page-profile .navbar-content h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
}

body.page-profile .navbar-content h1 a {
    display: inline-flex;
    align-items: center;
}

body.page-profile .navbar-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

body.page-profile .navbar-links a {
    color: #334155;
    text-decoration: none;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    padding: 6px 10px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

body.page-profile .container {
    max-width: 1360px;
    margin: 20px auto;
    padding: 0 16px;
}

body.page-profile .layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 16px;
    align-items: start;
}

body.page-profile .layout-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

body.page-profile .card {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 18px;
}

body.page-profile h2 {
    margin: 0 0 12px;
}

body.page-profile .muted {
    color: var(--muted);
    font-size: 13px;
}

body.page-profile .status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ecf4ff;
    color: #1d4ed8;
    font-size: 12px;
}

body.page-profile .status.status-role {
    background: #f1f5f9;
    color: #475569;
}

body.page-profile .status.status-active {
    background: #ecfdf5;
    color: #059669;
}

body.page-profile .status.status-inactive {
    background: #fffbeb;
    color: #b45309;
}

body.page-profile .status.status-suspended {
    background: #fef2f2;
    color: #dc2626;
}

/* 账户信息：两列字段行 */
body.page-profile .account-grid {
    display: grid;
    gap: 0;
    margin: 4px 0 10px;
}

body.page-profile .account-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: baseline;
    padding: 9px 2px;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.28);
}

body.page-profile .account-row:last-child {
    border-bottom: none;
}

body.page-profile .account-label {
    font-weight: 600;
    font-size: 13px;
    color: #64748b;
}

body.page-profile .account-value {
    font-size: 14px;
    color: #1e293b;
    word-break: break-word;
}

body.page-profile .account-regtime {
    margin: 0 0 10px;
}

body.page-profile .shop-name-form,
body.page-profile .shipping-info-form,
body.page-profile .order-search-form {
    display: grid;
    gap: 8px;
    margin: 10px 0 14px;
}

/* 收货信息编辑表单：两列紧凑布局 */
body.page-profile .shipping-info-form {
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
}

body.page-profile .shipping-info-form .field {
    display: grid;
    gap: 5px;
    align-content: start;
}

body.page-profile .shipping-info-form .field.field-wide {
    grid-column: 1 / -1;
}

body.page-profile .shipping-info-form .shipping-form-actions {
    grid-column: 1 / -1;
}

body.page-profile .shop-name-form label,
body.page-profile .shipping-info-form label {
    font-weight: 700;
    font-size: 13px;
    color: #334155;
}

body.page-profile .inline-form-row,
body.page-profile .order-search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

body.page-profile .inline-form-row input,
body.page-profile .order-search-form input,
body.page-profile .shipping-info-form input,
body.page-profile .shipping-info-form textarea {
    min-width: 0;
    flex: 1 1 auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    font-size: 14px;
}

body.page-profile .shipping-info-form textarea {
    resize: vertical;
}

body.page-profile .inline-form-row .btn,
body.page-profile .order-search-form .btn {
    width: auto;
    min-width: 84px;
    white-space: nowrap;
}

body.page-profile .btn.ghost {
    background: #fff;
    color: #334155;
    border: 1px solid var(--line);
    box-shadow: none;
}

/* 收货信息：只读展示 + 编辑切换 */
body.page-profile .shipping-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

body.page-profile .shipping-card-head h2 {
    margin: 0;
}

body.page-profile .shipping-card-head .btn.ghost {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    padding: 6px 18px;
    font-size: 13px;
    border-radius: 999px;
}

body.page-profile .shipping-view {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px 16px;
    margin: 10px 0 12px;
}

body.page-profile .shipping-row {
    display: grid;
    gap: 4px;
    padding: 9px 2px;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.22);
}

body.page-profile .shipping-row.wide {
    grid-column: 1 / -1;
}

body.page-profile .shipping-row:last-of-type {
    border-bottom: none;
}

body.page-profile .shipping-label {
    font-weight: 600;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

body.page-profile .shipping-value {
    font-size: 14px;
    color: #1e293b;
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
}

body.page-profile .shipping-value.empty {
    color: var(--muted);
}

body.page-profile .shipping-view-hint {
    grid-column: 1 / -1;
    margin: 2px 0 0;
}

body.page-profile .shipping-form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

body.page-profile .shipping-form-actions .btn {
    width: auto;
    min-width: 96px;
    white-space: nowrap;
}

body.page-profile .favorite-list {
    display: grid;
    gap: 10px;
}

body.page-profile .favorite-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 8px;
    border: 1px solid #e4ebf5;
    border-radius: 14px;
    background: #fbfdff;
    transition: box-shadow 0.2s, transform 0.2s;
}

body.page-profile .favorite-item:hover {
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.08);
    transform: translateY(-1px);
}

body.page-profile .favorite-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: #f1f6fd;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-decoration: none;
}

body.page-profile .favorite-empty .btn.ghost {
    background: #fff;
    color: #334155;
    border: 1px solid var(--line);
    box-shadow: none;
    width: auto;
}

body.page-profile .favorite-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.page-profile .favorite-info a {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

body.page-profile .favorite-info p {
    margin: 5px 0 0;
}

body.page-profile .favorite-remove {
    width: auto;
    padding: 9px 12px;
    background: #fff;
    color: #b42318;
    border: 1px solid #ffd4cc;
    box-shadow: none;
}

body.page-profile .order-item {
    border-bottom: 1px solid #e9eef5;
    padding: 12px 0;
    word-break: break-word;
}

body.page-profile .order-summary-item {
    display: grid;
    grid-template-columns: 60px 1fr 104px;
    gap: 12px;
    align-items: center;
    padding: 8px;
    border-radius: 14px;
    transition: background 0.2s;
}

body.page-profile .order-summary-item:hover {
    background: #f8fafc;
}

body.page-profile .order-thumb {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #f1f6fd;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-decoration: none;
}

body.page-profile .order-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.page-profile .order-summary-top,
body.page-profile .order-summary-mid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

body.page-profile .order-summary-top {
    margin-bottom: 4px;
}

body.page-profile .order-number-link {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
    font-size: 13px;
}

body.page-profile .order-summary-item .order-badge {
    flex: 0 0 auto;
}

body.page-profile .order-products {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #64748b;
    font-size: 13px;
}

body.page-profile .order-summary-mid .order-amount {
    flex: 0 0 auto;
    color: var(--blue);
    font-weight: 800;
    font-size: 16px;
}

body.page-profile .order-summary-time {
    margin: 4px 0 0;
    font-size: 12px;
}

body.page-profile .order-detail-btn {
    align-self: center;
    padding: 9px 14px;
    font-size: 13px;
}

body.page-profile .order-item:last-child {
    border-bottom: 0;
}

body.page-profile .order-item a:not(.btn) {
    color: var(--blue);
    text-decoration: none;
    font-weight: 700;
}

body.page-profile .order-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

body.page-profile .order-product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.page-profile .profile-pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}

body.page-profile .profile-pagination a,
body.page-profile .profile-pagination span {
    min-width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    text-decoration: none;
    background: #fff;
}

body.page-profile .profile-pagination .active,
body.page-profile .profile-pagination a:hover {
    background: #eaf3ff;
    color: var(--blue);
    border-color: #bfdbfe;
}

body.page-admin-orders .admin-filter,
body.page-admin-orders .order-status-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

body.page-admin-orders select {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    padding: 8px 12px;
}

body.page-profile .divider {
    border: 0;
    border-top: 1px solid #e9eef5;
    margin: 14px 0;
}

body.page-profile .sub-title {
    font-size: 20px;
    margin: 0 0 8px;
}

body.page-profile .mt-10 {
    margin-top: 10px;
}

/* 个人中心 ≤640px 响应式 */
@media (max-width: 640px) {
    body.page-profile .layout {
        grid-template-columns: 1fr;
    }

    body.page-profile .shipping-info-form {
        grid-template-columns: 1fr;
    }

    body.page-profile .shipping-view {
        grid-template-columns: 1fr 1fr;
    }

    body.page-profile .shipping-row.wide {
        grid-column: 1 / -1;
    }

    body.page-profile .favorite-item {
        grid-template-columns: 64px 1fr;
    }

    body.page-profile .favorite-item .favorite-remove {
        grid-column: 2;
        justify-self: end;
        width: auto;
    }

    body.page-profile .order-summary-item {
        grid-template-columns: 60px minmax(0, 1fr);
    }

    /* 防止订单摘要文本把 1fr 列撑破导致横向滚动 */
    body.page-profile .order-summary-info {
        min-width: 0;
        overflow-wrap: break-word;
    }

    body.page-profile .order-summary-item .order-detail-btn {
        grid-column: 2;
        justify-self: end;
        width: auto;
    }

    body.page-profile .order-search-form {
        flex-wrap: wrap;
    }

    body.page-profile .order-search-form input {
        flex-basis: 100%;
    }

    body.page-profile .shipping-form-actions {
        grid-template-columns: 1fr 1fr;
    }

    body.page-profile .shipping-form-actions .btn {
        min-width: 0;
    }
}

/* 个人中心收货地址簿（与结算页一致） */
body.page-profile .shipping-card .address-book {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf2f8;
}

body.page-profile .address-book-hint {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
}

body.page-profile .address-list {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
}

body.page-profile .address-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

body.page-profile .address-option:hover {
    border-color: #b6c4d9;
}

body.page-profile .address-option.selected {
    border-color: var(--blue);
    box-shadow: 0 0 0 1px var(--blue) inset;
    background: #f3f9ff;
}

body.page-profile .address-option-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
}

body.page-profile .address-option-top {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

body.page-profile .address-option-top b {
    font-weight: 700;
}

body.page-profile .address-option-top i {
    font-style: normal;
    color: var(--muted);
    font-size: 13px;
}

body.page-profile .default-tag {
    font-style: normal;
    font-size: 11px;
    color: #027a48;
    background: #e7f8f0;
    padding: 2px 8px;
    border-radius: 999px;
}

body.page-profile .address-option-addr,
body.page-profile .address-option-contact {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    word-break: break-word;
}

body.page-profile .address-add-btn {
    width: 100%;
    background: #fff;
    color: var(--blue);
    border: 1px dashed #9db8dc;
    box-shadow: none;
}

body.page-profile .address-add-btn:hover {
    background: #f3f9ff;
    border-color: var(--blue);
}

body.page-profile .address-save-row {
    margin-top: 4px;
    display: flex;
    gap: 8px;
    align-items: center;
}

body.page-profile .set-default-btn {
    margin-top: 6px;
    align-self: flex-start;
    border: 1px solid #bfd4ef;
    border-radius: 999px;
    background: #fff;
    color: var(--blue);
    font-size: 12px;
    line-height: 1;
    padding: 5px 12px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

body.page-profile .set-default-btn:hover {
    background: #f3f9ff;
    border-color: var(--blue);
}

body.page-profile .address-edit-btn {
    margin-left: auto;
    flex: 0 0 auto;
    align-self: flex-start;
    border: 1px solid #bfd4ef;
    border-radius: 999px;
    background: #fff;
    color: var(--blue);
    font-size: 12px;
    line-height: 1;
    padding: 5px 12px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

body.page-profile .address-edit-btn:hover {
    background: #f3f9ff;
    border-color: var(--blue);
}

body.page-profile .address-option-side-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
    align-items: stretch;
}

body.page-profile .address-option-side-actions .address-edit-btn,
body.page-profile .address-option-side-actions .address-delete-btn,
body.page-profile .address-option-side-actions .set-default-btn {
    width: 72px;
    min-height: 28px;
    white-space: nowrap;
    text-align: center;
    box-sizing: border-box;
    margin-left: 0;
    margin-top: 0;
    align-self: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.page-profile .default-badge {
    width: 72px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid #cdebd8;
    border-radius: 999px;
    background: #e7f8f0;
    color: #027a48;
    font-size: 12px;
    line-height: 1;
    padding: 6px 0;
}

body.page-profile .address-delete-btn {
    border: 1px solid #f2c4bc;
    border-radius: 999px;
    background: #fff;
    color: #b42318;
    font-size: 12px;
    line-height: 1;
    padding: 5px 12px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

body.page-profile .address-delete-btn:hover {
    background: #ffece8;
    border-color: #d92d20;
}

body.page-profile .address-form-fields {
    padding-top: 14px;
}

body.page-profile .address-form-fields .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

body.page-profile .address-form-fields .form-group {
    margin-bottom: 12px;
}

body.page-profile .address-form-fields label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

body.page-profile .address-form-fields input,
body.page-profile .address-form-fields textarea {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
}

body.page-profile .address-form-fields textarea {
    min-height: 76px;
    resize: vertical;
}

@media (max-width: 640px) {
    body.page-profile .address-form-fields .form-row {
        grid-template-columns: 1fr;
    }
}

/* admin/upgrade reuse shell */
body.page-upgrade .nav,
body.page-admin-review .nav {
    padding: 0 20px;
}

body.page-upgrade .nav-inner,
body.page-admin-review .nav-inner {
    max-width: 1360px;
    margin: 0 auto;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.page-merchant .nav .brand-home-link,
body.page-admin-review .nav .brand-home-link {
    margin-left: 0;
    padding: 0;
    min-height: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

body.page-upgrade .nav a,
body.page-admin-review .nav a:not(.brand-home-link) {
    color: #334155;
    text-decoration: none;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    padding: 6px 10px;
    margin-left: 8px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}


body.page-upgrade .wrap,
body.page-admin-review .wrap {
    max-width: 1360px;
    margin: 14px auto;
    padding: 0 14px;
}

body.page-upgrade .card,
body.page-admin-review .card {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 14px;
    margin-bottom: 12px;
}

body.page-upgrade .row {
    margin-bottom: 14px;
}

body.page-upgrade label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

body.page-upgrade input,
body.page-upgrade textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
}

body.page-upgrade textarea {
    min-height: 100px;
    resize: vertical;
}

body.page-upgrade .btn,
body.page-admin-review .btn {
    border: 0;
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}

body.page-upgrade .btn {
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
}

body.page-upgrade .muted {
    color: var(--muted);
    font-size: 13px;
}

body.page-upgrade .status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eaf3ff;
    color: #2457a8;
    font-size: 12px;
}

body.page-admin-review table {
    width: 100%;
    border-collapse: collapse;
}

body.page-admin-review th,
body.page-admin-review td {
    border-bottom: 1px solid #e9eef5;
    padding: 10px 8px;
    font-size: 14px;
    text-align: left;
    line-height: 1.55;
}

body.page-admin-review .actions {
    display: flex;
    gap: 8px;
}

body.page-admin-review .review-content-cell {
    max-width: 340px;
    white-space: normal;
    word-break: break-word;
}

body.page-admin-review .btn.approve {
    background: #039855;
    color: #fff;
}

body.page-admin-review .btn.reject {
    background: #d92d20;
    color: #fff;
}

body.page-admin-dashboard .admin-entry-row {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

body.page-admin-dashboard .admin-entry-row .btn {
    width: auto;
}

/* 后台管理页优化 */
body.page-admin-dashboard .admin-page-head {
    margin: 0 0 12px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

body.page-admin-dashboard .admin-page-head h1 {
    margin: 0 0 2px;
    font-size: 21px;
    letter-spacing: -0.02em;
}

body.page-admin-dashboard .admin-page-head p {
    margin: 0;
}

/* 页头时钟（右侧当前时间 + 时区） */
body.page-admin-dashboard .admin-clock {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fd 100%);
    border: 1px solid #dce7f4;
    border-radius: 999px;
    padding: 6px 13px;
}
body.page-admin-dashboard .admin-clock-time {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
body.page-admin-dashboard .admin-clock-tz {
    font-size: 11.5px;
    color: var(--muted);
    background: #fff;
    border: 1px solid #dfe8f2;
    border-radius: 999px;
    padding: 2px 9px;
}

body.page-admin-dashboard .stats-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

body.page-admin-dashboard .stats-head h2 {
    margin: 0;
}

body.page-admin-dashboard .stats-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

body.page-admin-dashboard .stats-actions .btn {
    width: auto;
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 999px;
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
    box-shadow: 0 6px 14px rgba(0, 113, 227, 0.18);
    transition: transform .2s, box-shadow .2s;
}

body.page-admin-dashboard .stats-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0, 113, 227, 0.3);
}

body.page-admin-dashboard .admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

/* 设置区布局：左网站基础设置 + 右侧货币/时区纵向 */
body.page-admin-dashboard .admin-settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}
body.page-admin-dashboard .admin-settings-layout .card {
    margin-bottom: 0;
}
body.page-admin-dashboard .admin-side-col {
    display: grid;
    gap: 12px;
    align-content: start;
}

/* 时区卡服务器时间胶囊 */
body.page-admin-dashboard .server-time-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0f6ff;
    border: 1px solid #d5e4f6;
    color: #334155;
    border-radius: 10px;
    padding: 6px 11px;
    font-size: 12.5px;
    margin: 2px 0 10px;
}
body.page-admin-dashboard .server-time-chip strong {
    color: var(--blue);
    font-variant-numeric: tabular-nums;
}

/* 危险操作区标题 */
body.page-admin-dashboard .admin-danger-head {
    margin: 16px 0 10px;
    padding-top: 14px;
    border-top: 1px solid #f0e4e4;
}
body.page-admin-dashboard .admin-danger-head h2 {
    margin: 0 0 4px;
    font-size: 18px;
    color: #b42318;
}
body.page-admin-dashboard .admin-danger-head p {
    margin: 0;
}
body.page-admin-dashboard .admin-danger-grid {
    margin-top: 0;
}
body.page-admin-dashboard .admin-danger-grid .card {
    margin-bottom: 0;
}

body.page-admin-dashboard .admin-grid-2 .card {
    margin-bottom: 0;
}

body.page-admin-review .badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
}

body.page-admin-review .active { background: #e7f8f0; color: #027a48; }
body.page-admin-review .inactive { background: #fff4e5; color: #b54708; }
body.page-admin-review .suspended { background: #ffece8; color: #b42318; }
body.page-admin-review .empty { color: var(--muted); padding: 14px 0; }

body.page-admin-dashboard .admin-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: none;
}

body.page-admin-dashboard .admin-form .form-item {
    display: grid;
    gap: 6px;
    min-width: 0;
}

body.page-admin-dashboard .admin-form .form-item.field-wide {
    grid-column: 1 / -1;
}

body.page-admin-dashboard .admin-form label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

body.page-admin-dashboard .admin-form input,
body.page-admin-dashboard .admin-form select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 8px 11px;
    font-size: 13.5px;
}

body.page-admin-dashboard .logo-upload-row {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
}

body.page-admin-dashboard .logo-preview {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    border: 1px solid #dce5f0;
    background: #f8fbff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 28px;
}

body.page-admin-dashboard .logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.page-admin-dashboard .favicon-preview {
    width: 54px;
    height: 54px;
    border-radius: 12px;
}

body.page-admin-dashboard .admin-form .btn,
body.page-admin-dashboard .danger-card .btn.reject {
    justify-self: start;
    margin-top: 2px;
    padding: 7px 16px;
    border-radius: 999px;
}

body.page-admin-dashboard .admin-form .btn {
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(0, 113, 227, 0.26);
    transition: transform .2s, box-shadow .2s;
}

body.page-admin-dashboard .admin-form .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0, 113, 227, 0.32);
}

body.page-admin-dashboard .stat-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

body.page-admin-dashboard .stat-grid div {
    border: 1px solid #e4ebf5;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #f8fbff, #fbfdff);
    padding: 10px 12px;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

body.page-admin-dashboard .stat-grid div:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-float);
    border-color: #bfd4ef;
}

body.page-admin-dashboard .stat-grid .stat-ico {
    font-style: normal;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #eaf3ff;
    color: var(--blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    font-size: 14px;
}

body.page-admin-dashboard .stat-grid strong {
    display: block;
    font-size: 21px;
    color: var(--blue);
}

body.page-admin-dashboard .stat-grid span,
body.page-admin-dashboard .muted {
    color: var(--muted);
    font-size: 13px;
}

body.page-admin-dashboard .danger-card {
    border-color: rgba(217, 45, 32, 0.35);
    background: linear-gradient(180deg, #fff6f5, #fff);
}

body.page-admin-dashboard .danger-card h2 {
    color: #b42318;
}

body.page-admin-dashboard .danger-card .btn.reject {
    background: linear-gradient(180deg, #f43f5e, #e11d48);
    color: #fff;
    box-shadow: 0 10px 22px rgba(225, 29, 72, 0.26);
}

@media (max-width: 1024px) {
    body.page-admin-dashboard .stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    body.page-admin-dashboard .admin-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body.page-admin-dashboard .admin-form {
        grid-template-columns: 1fr;
    }

    body.page-admin-dashboard .admin-form .btn {
        width: 100%;
        justify-content: center;
    }

    body.page-admin-dashboard .admin-settings-layout {
        grid-template-columns: 1fr;
    }

    body.page-admin-dashboard .admin-danger-grid {
        grid-template-columns: 1fr;
    }

    body.page-admin-dashboard .stats-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.page-admin-dashboard .stats-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 危险操作区：中屏仍双列，窄屏单列 */
@media (min-width: 641px) and (max-width: 900px) {
    body.page-admin-dashboard .admin-danger-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    body.page-admin-dashboard .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.page-admin-dashboard .stat-grid div {
        padding: 10px;
    }
}

body.page-home .empty-state,
body.page-cart .empty-cart,
body.page-checkout .empty,
body.page-admin-review .empty,
body.page-product .no-reviews {
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
}

/* verify */
body.page-verify .verify-container {
    text-align: center;
}

body.page-verify .verify-icon {
    font-size: 54px;
    margin-bottom: 12px;
}

body.page-verify .verify-btn {
    margin: 6px;
    width: auto;
    min-width: 132px;
}

body.page-verify .verify-btn.ghost {
    background: #fff;
    color: var(--text);
    box-shadow: none;
    border: 1px solid var(--line);
}

/* setup + redirect */
body.page-setup,
body.page-redirect {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

body.page-setup .setup-card,
body.page-redirect .redirect-card {
    width: 100%;
    max-width: 740px;
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

body.page-setup .setup-card::before,
body.page-redirect .redirect-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #b8d9ff 0%, #0071e3 52%, #7cb8ff 100%);
}

body.page-setup .setup-card h1,
body.page-redirect .redirect-card h1 {
    margin: 0 0 10px;
    font-size: 30px;
}

body.page-setup .setup-card p,
body.page-redirect .redirect-card p {
    color: var(--muted);
    margin: 8px 0;
}

body.page-setup .msg {
    border-radius: 10px;
    padding: 10px 12px;
    margin: 10px 0 14px;
}

body.page-setup .msg.ok {
    background: #e7f8f0;
    color: #027a48;
}

body.page-setup .msg.err {
    background: #ffece8;
    color: #b42318;
}

body.page-setup ul {
    margin: 8px 0 10px 18px;
}

body.page-setup li {
    margin: 6px 0;
}

body.page-setup .actions,
body.page-redirect .actions {
    margin-top: 14px;
}

body.page-setup .actions a,
body.page-redirect .actions a {
    display: inline-block;
    text-decoration: none;
    border-radius: 999px;
    padding: 10px 16px;
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(0, 113, 227, 0.26);
}

/* responsive */
@media (max-width: 1024px) {
    body.page-home .main-content,
    body.page-product .main-content,
    body.page-cart .cart-layout,
    body.page-checkout .layout {
        grid-template-columns: 1fr;
    }

    body.page-cart .cart-summary {
        position: static;
        /* 单列折叠时限制结算摘要宽度，避免全宽拉伸空洞 */
        width: min(100%, 560px);
        margin-left: auto;
    }

    /* 结算页：订单摘要卡在单列折叠时居中限宽，与下方表单卡形成协调节奏 */
    body.page-checkout .card-order-summary {
        width: min(100%, 640px);
        margin: 0 auto;
    }

    body.page-home .navbar-search {
        flex: 0 0 230px;
        width: 230px;
        max-width: 32vw;
        min-width: 220px;
    }

    body.page-profile .layout {
        grid-template-columns: 1fr;
    }

    body.page-merchant .merchant-order-card {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    body.page-merchant .merchant-order-media {
        width: 96px;
        height: 96px;
    }

    body.page-merchant .merchant-order-side {
        grid-column: span 2;
        border-left: 0;
        border-top: 1px solid #e4ebf5;
        padding-left: 0;
        padding-top: 12px;
        /* 平板单列折叠：侧栏改 2 列紧凑排布，避免横铺成一条线 */
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px 16px;
    }

    body.page-merchant .merchant-order-side .no-print .btn {
        width: 100%;
        justify-content: center;
        padding: 8px 10px;
        font-size: 12.5px;
    }

    /* 配送操作表单占整行（保持单列竖排：标签→下拉→按钮） */
    body.page-merchant .merchant-order-action {
        grid-column: 1 / -1;
    }

    /* 「无需操作」提示横跨两列，避免单独占格显得零散 */
    body.page-merchant .merchant-order-side .no-print.muted {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    body.page-checkout .form-row {
        grid-template-columns: 1fr;
    }

    body.page-checkout .order-table-head,
    body.page-checkout .order-item {
        grid-template-columns: 48px minmax(0, 1fr) 40px 84px;
    }

    body.page-checkout .order-table-head span:nth-child(3),
    body.page-checkout .order-item-price {
        display: none;
    }
}

@media (max-width: 900px) {
    body.page-home .navbar-main {
        flex-wrap: wrap;
    }

    /* 中屏导航：搜索框弹性缩窄与链接同排，避免独占一行浪费空间 */
    body.page-home .navbar-search {
        flex: 1 1 170px;
        width: auto;
        max-width: 250px;
        min-width: 140px;
    }

    body.page-home .navbar-right a {
        flex: 0 0 auto;
    }
}

@media (max-width: 768px) {
    .navbar,
    .nav {
        backdrop-filter: blur(8px);
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    }

    body.page-home .container,
    body.page-product .container,
    body.page-cart .container,
    body.page-checkout .container {
        padding: 0 12px;
    }

    body.page-home .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }

    body.page-home .product-card {
        border-radius: 16px;
    }

    body.page-home .product-image {
        height: 170px;
    }

    body.page-home .navbar-top {
        display: none;
    }

    body.page-home .navbar-main {
        gap: 10px;
        padding: 8px 0;
    }

    body.page-home .navbar-brand {
        font-size: 18px;
    }

    body.page-home .navbar-search {
        order: 3;
        flex-basis: 100%;
        flex-grow: 1;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-left: 0;
    }

    body.page-home .navbar-search input,
    body.page-home .navbar-search button {
        height: 44px;
    }

    body.page-home .navbar-right {
        width: 100%;
        gap: 8px;
        overflow: visible;
        white-space: nowrap;
        flex-wrap: wrap;
        padding-bottom: 2px;
        position: relative;
    }

    body.page-home .navbar-right a {
        flex: 0 0 auto;
    }

    body.page-home .products-section,
    body.page-home .sidebar,
    body.page-product .product-layout,
    body.page-product .product-description,
    body.page-product .reviews-section,
    body.page-cart .cart-header,
    body.page-cart .cart-items,
    body.page-cart .cart-summary,
    body.page-checkout .card,
    body.page-merchant .card,
    body.page-admin-review .card,
    body.page-upgrade .card,
    body.page-profile .card {
        border-radius: 16px;
        padding: 14px;
    }

    body.page-home .btn,
    body.page-home .btn-primary,
    body.page-home .btn-secondary,
    body.page-product .add-cart-btn,
    body.page-product .favorite-btn,
    body.page-cart .checkout-btn,
    body.page-cart .continue-shopping,
    body.page-merchant .btn,
    body.page-admin-review .btn,
    body.page-upgrade .btn,
    body.page-auth .login-btn,
    body.page-auth .register-btn,
    body.page-password .btn,
    body.page-verify .verify-btn,
    body.page-profile .btn {
        min-height: 44px;
        line-height: 1.2;
    }

    body.page-product .navbar-content,
    body.page-cart .navbar-content,
    body.page-profile .navbar-content,
    body.page-upgrade .nav-inner,
    body.page-admin-review .nav-inner,
    body.page-merchant .nav-inner,
    body.page-checkout .navbar-inner {
        flex-wrap: wrap;
        gap: 8px;
    }

    body.page-product .navbar-links,
    body.page-cart .navbar-links,
    body.page-profile .navbar-links {
        width: 100%;
        display: flex;
        background: rgba(255, 255, 255, 0.78);
        border: 1px solid rgba(148, 163, 184, 0.22);
        white-space: nowrap;
        position: relative;
        mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
    }

        transition: all 0.2s ease;
    body.page-product .navbar-links a,
    body.page-cart .navbar-links a,
    body.page-profile .navbar-links a,
    body.page-upgrade .nav a,
    body.page-admin-review .nav a:not(.brand-home-link),
    body.page-merchant .nav a:not(.brand-home-link),
    body.page-checkout .navbar a:not(.brand-home-link) {
        flex: 0 0 auto;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        margin-left: 0;
    }

    body.page-merchant .actions,
    body.page-admin-review .actions,
    body.page-upgrade .actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.page-merchant .actions .btn,
    body.page-admin-review .actions .btn,
    body.page-upgrade .actions .btn {
        width: 100%;
        white-space: nowrap;
        justify-content: center;
    }

    body.page-admin-dashboard .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.page-product .product-layout {
        grid-template-columns: 1fr;
    }

    body.page-product .product-details h1 {
        font-size: 25px;
    }

    body.page-product .product-price {
        font-size: 28px;
    }

    body.page-product .product-image {
        height: 320px;
    }

    body.page-product .product-actions {
        flex-direction: column;
    }

    body.page-product .review-form-grid {
        grid-template-columns: 1fr;
    }

    body.page-product .review-form-grid .field-wide {
        grid-column: span 1;
    }

    body.page-product .qty-input {
        width: 100%;
        min-height: 44px;
    }

    body.page-cart .cart-item {
        grid-template-columns: 64px 1fr;
    }

    body.page-cart .item-image {
        width: 64px;
        height: 64px;
    }

    body.page-cart .item-price,
    body.page-cart .item-quantity,
    body.page-cart .item-remove {
        grid-column: 2;
    }

    body.page-cart .item-remove {
        font-size: 30px;
        line-height: 1;
    }

    body.page-cart .item-quantity input {
        min-height: 40px;
    }

    body.page-checkout .item {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    body.page-checkout .summary-total,
    body.page-cart .summary-total {
        font-size: 16px;
    }

    body.page-checkout input,
    body.page-checkout textarea,
    body.page-checkout select,
    body.page-upgrade input,
    body.page-upgrade textarea,
    body.page-auth .form-group input,
    body.page-password input {
        min-height: 44px;
    }

    body.page-merchant .row-inline {
        flex-wrap: wrap;
    }

    body.page-merchant .row-inline input[type="file"],
    body.page-merchant .row-inline input[type="text"],
    body.page-merchant .row-inline button {
        width: 100%;
    }

    body.page-merchant .editor-toolbar .toolbar-upload {
        max-width: 100%;
    }

    body.page-merchant .price-input,
    body.page-merchant .discount-input,
    body.page-merchant .stock-input {
        width: 100%;
    }

    body.page-merchant .table-scroll,
    body.page-admin-review .table-scroll {
        margin-top: 10px;
        border: 1px solid #e8edf5;
        border-radius: 12px;
        padding: 0 4px;
    }

    body.page-merchant table,
    body.page-admin-review table {
        min-width: 920px;
    }

    body.page-auth .login-container,
    body.page-auth .register-container,
    body.page-password .container,
    body.page-verify .verify-container {
        padding: 18px;
        border-radius: 16px;
    }

    body.page-auth .login-header h1,
    body.page-auth .register-header h1,
    body.page-password h1,
    body.page-verify .verify-title {
        font-size: 24px;
    }

    body.page-merchant .grid {
        grid-template-columns: 1fr;
    }

    body.page-merchant .compose-layout {
        grid-template-columns: 1fr;
    }

    body.page-merchant .compose-side {
        position: static;
    }

    body.page-merchant .compose-meta-grid {
        grid-template-columns: 1fr;
    }

    body.page-merchant .compose-meta-grid .field-wide {
        grid-column: span 1;
    }

    body.page-merchant .category-layout {
        grid-template-columns: 1fr;
    }

    body.page-merchant .category-manage-item {
        grid-template-columns: 1fr;
    }

    body.page-merchant .category-create-form {
        grid-template-columns: 1fr;
    }

    body.page-merchant .category-manage-list {
        max-height: none;
    }

    body.page-merchant .category-option-list {
        max-height: 210px;
    }

    body.page-merchant .cover-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.page-merchant .category-actions {
        width: auto;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
    }

    body.page-merchant .category-actions .btn {
        width: auto;
        min-width: 72px;
    }
}

/* ===== 购物小票（打印）===== */
body.page-receipt {
    background: #f1f5f9;
    margin: 0;
    padding: 24px 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body.page-receipt .receipt-toolbar {
    max-width: 320px;
    margin: 0 auto 16px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

body.page-receipt .receipt-toolbar .btn {
    width: auto;
    min-width: 96px;
    padding: 9px 16px;
    font-size: 13px;
}

body.page-receipt .receipt-sheet {
    width: 300px;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    color: #111;
    padding: 22px 18px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
    font-size: 13px;
    line-height: 1.55;
}

body.page-receipt .receipt-head {
    text-align: center;
}

body.page-receipt .receipt-head h1 {
    margin: 0 0 2px;
    font-size: 17px;
    letter-spacing: 1px;
}

body.page-receipt .receipt-head p {
    margin: 2px 0;
    color: #444;
}

body.page-receipt .receipt-meta {
    font-size: 12px;
    color: #666;
    word-break: break-all;
}

body.page-receipt .receipt-rule {
    border-top: 1px dashed #9aa4b2;
    margin: 12px 0;
}

body.page-receipt .receipt-items .receipt-item {
    margin-bottom: 9px;
}

body.page-receipt .receipt-item-name {
    font-weight: 600;
    word-break: break-all;
}

body.page-receipt .receipt-item-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #333;
    font-size: 12.5px;
}

body.page-receipt .receipt-total-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 0;
}

body.page-receipt .receipt-total-row.receipt-grand {
    font-weight: 700;
    font-size: 15px;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid #d7dde5;
}

body.page-receipt .receipt-sec-title {
    font-weight: 700;
    margin: 0 0 4px;
}

body.page-receipt .receipt-ship p {
    margin: 3px 0;
    color: #333;
    word-break: break-all;
}

body.page-receipt .receipt-foot {
    text-align: center;
    color: #555;
    font-size: 12px;
}

body.page-receipt .receipt-foot p {
    margin: 3px 0;
}

@media print {
    body.page-receipt {
        background: #fff !important;
        padding: 0 !important;
    }

    body.page-receipt .receipt-toolbar,
    body.page-receipt .no-print {
        display: none !important;
    }

    body.page-receipt .receipt-sheet {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 8px !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    body.page-receipt .receipt-rule {
        margin: 8px 0;
    }

    @page {
        size: auto;
        margin: 6mm;
    }

    body.page-merchant.page-merchant-orders {
        background: #fff;
    }

    body.page-merchant.page-merchant-orders .nav,
    body.page-merchant.page-merchant-orders .merchant-order-filter,
    body.page-merchant.page-merchant-orders .merchant-order-action,
    body.page-merchant.page-merchant-orders .no-print {
        display: none !important;
    }

    body.page-merchant.page-merchant-orders .wrap {
        max-width: none;
        margin: 0;
        padding: 0;
    }

    body.page-merchant.page-merchant-orders .card,
    body.page-merchant.page-merchant-orders .merchant-order-card {
        box-shadow: none;
        border-color: #cbd5e1;
    }

    body.page-merchant.page-merchant-orders .merchant-order-card {
        grid-template-columns: 96px 1fr 150px;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.page-merchant.page-merchant-orders .merchant-order-media {
        width: 96px;
        height: 96px;
    }
}

/* 公开食堂菜单与菜谱 */
.public-canteen-hero { padding: 12px 2px 22px; }
.public-canteen-eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.public-canteen-hero h1 { margin: 8px 0 5px; font-size: clamp(26px, 4vw, 40px); letter-spacing: 0; }
.public-canteen-hero p { margin: 0; color: var(--muted); font-size: 14px; }
.public-canteen-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 16px; }
.page-content .public-canteen-toolbar .btn,
.page-content .public-recipe-filters .btn {
    border: 1px solid var(--line);
    background: #fff;
    color: #334155;
    box-shadow: none;
}
.page-content .public-canteen-toolbar .btn:hover,
.page-content .public-recipe-filters .btn:hover {
    border-color: var(--blue);
    background: #eef5ff;
    color: var(--blue-dark);
}
.page-content .public-canteen-toolbar .btn.primary,
.page-content .public-recipe-filters .btn.primary {
    border-color: transparent;
    background: linear-gradient(180deg, #c22d38, #a8222c);
    color: #fff;
    box-shadow: 0 8px 16px rgba(168, 34, 44, .22);
}
.page-content .public-canteen-toolbar .btn.primary:hover,
.page-content .public-recipe-filters .btn.primary:hover,
.page-content .public-recipe-detail-layout aside .btn.primary:hover { color: #fff; }
.page-content .public-recipe-detail-layout aside .btn.primary {
    border-color: transparent;
    background: linear-gradient(180deg, #c22d38, #a8222c);
    color: #fff;
    box-shadow: 0 8px 16px rgba(168, 34, 44, .22);
}
.public-menu-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; overflow-x: visible; padding-bottom: 4px; }
.public-menu-day { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.public-menu-day > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px; background: #eef5ff; color: #334155; }
.public-menu-day > header span { color: var(--muted); font-size: 12px; }
.public-menu-meal { min-height: 104px; padding: 14px; border-top: 1px solid var(--line); }
.public-menu-meal-title { display: flex; justify-content: space-between; gap: 6px; color: var(--blue-dark); font-size: 12px; font-weight: 800; }
.public-menu-meal-title small { color: var(--muted); font-size: 11px; font-weight: 500; }
.public-menu-meal ul { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.public-menu-meal li { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; font-size: 13px; line-height: 1.55; }
.public-menu-meal li a { color: var(--text); font-weight: 600; text-decoration: none; }
.public-menu-meal li a:hover { color: var(--blue); }
.public-menu-meal li small { color: var(--muted); font-size: 10px; }
.public-menu-empty { margin: 8px 0 0; color: #98a2b3; font-size: 12px; }
.public-canteen-note { margin: 14px 2px 0; color: var(--muted); font-size: 12px; }
.public-recipe-hero { padding-bottom: 16px; }
.public-recipe-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 18px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #f8fafc; }
.public-recipe-filters label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.public-recipe-filters select,
.public-recipe-filters input { min-width: 170px; min-height: 38px; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--text); font: inherit; }
.public-recipe-search { flex: 1 1 240px; }
.public-recipe-search input { width: 100%; }
.public-recipe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.public-recipe-card { position: relative; min-height: 190px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.public-recipe-card-mark { position: absolute; top: 17px; right: 18px; color: #b8cbe1; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.public-recipe-category { display: inline-block; color: var(--blue); font-size: 12px; font-weight: 800; }
.public-recipe-card h2 { max-width: 78%; margin: 10px 0 8px; font-size: 19px; letter-spacing: 0; }
.public-recipe-card p { min-height: 44px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.public-recipe-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; color: var(--muted); font-size: 11px; }
.public-recipe-meta a { color: var(--blue); font-size: 12px; font-weight: 700; text-decoration: none; }
.public-canteen-empty { display: grid; place-items: center; gap: 10px; min-height: 220px; padding: 30px; border: 1px dashed var(--line); border-radius: var(--radius-md); color: var(--muted); text-align: center; }
.public-canteen-empty strong { color: var(--text); }
.public-recipe-detail { padding: 8px 2px 12px; }
.public-back-link { color: var(--blue); font-size: 13px; font-weight: 700; text-decoration: none; }
.public-recipe-detail > header { max-width: 760px; padding: 34px 0 28px; }
.public-recipe-detail h1 { margin: 10px 0 8px; font-size: 36px; letter-spacing: 0; }
.public-recipe-detail > header p { margin: 0; color: var(--muted); line-height: 1.8; }
.public-recipe-detail-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); gap: 16px; }
.public-recipe-detail-layout > section,
.public-recipe-detail-layout > aside { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.public-recipe-detail h2 { margin: 0 0 14px; font-size: 18px; letter-spacing: 0; }
.public-ingredient-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.public-ingredient-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f8fafc; }
.public-ingredient-list span { color: var(--muted); font-size: 11px; }
.public-recipe-detail-layout aside p { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.8; }

@media (max-width: 900px) {
    .public-menu-grid { grid-template-columns: repeat(7, minmax(136px, 1fr)); }
    .public-recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 901px) {
    .public-menu-day > header { padding: 15px 16px; }
    .public-menu-day > header strong { font-size: 16px; }
    .public-menu-day > header span { font-size: 13px; }
    .public-menu-meal-title { font-size: 13px; }
    .public-menu-meal li { overflow-wrap: anywhere; }
    .public-menu-meal li a { min-width: 0; }
}
@media (max-width: 640px) {
    .public-canteen-toolbar { justify-content: flex-start; flex-wrap: wrap; }
    .public-recipe-grid,
    .public-recipe-detail-layout { grid-template-columns: 1fr; }
    .public-recipe-filters { align-items: stretch; }
    .public-recipe-filters label,
    .public-recipe-filters select,
    .public-recipe-filters input,
    .public-recipe-filters .btn { width: 100%; }
    .public-ingredient-list { grid-template-columns: 1fr; }
    .public-recipe-detail h1 { font-size: 28px; }

    .public-menu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; overflow-x: visible; }
    .public-menu-day { min-width: 0; }
    .public-menu-day > header { flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px; }
    .public-menu-day > header strong { font-size: 13px; }
    .public-menu-day > header span { font-size: 10px; }
    .public-menu-meal { min-height: auto; padding: 8px; }
    .public-menu-meal-title { font-size: 10.5px; }
    .public-menu-meal-title small { font-size: 9px; }
    .public-menu-meal ul { gap: 4px; }
    .public-menu-meal li { flex-direction: column; align-items: flex-start; gap: 0; font-size: 11px; line-height: 1.4; }
    .public-menu-meal li a { overflow-wrap: anywhere; }
    .public-menu-meal li small { font-size: 9px; }
    .public-menu-empty { font-size: 10.5px; }
}

@media (max-width: 420px) {
    body.page-merchant .actions,
    body.page-admin-review .actions,
    body.page-upgrade .actions {
        grid-template-columns: 1fr;
    }

    body.page-merchant .category-actions {
        width: 100%;
        justify-content: space-between;
    }

    body.page-merchant .category-actions .btn {
        width: auto;
        min-width: 0;
    }

    body.page-merchant .cover-gallery {
        grid-template-columns: 1fr;
    }
}

/* 导航统一相对视口布局：内容左右内边距由视口宽度计算，
   保证所有页面 LOGO 与右侧链接相对浏览器显示区域位置一致 */
body.page-home .navbar,
body.page-product .navbar,
body.page-cart .navbar,
body.page-checkout .navbar,
body.page-profile .navbar,
body.page-merchant .nav,
body.page-upgrade .nav,
body.page-admin-review .nav {
    padding-left: 0;
    padding-right: 0;
}

body.page-home .navbar-main,
body.page-product .navbar-content,
body.page-cart .navbar-content,
body.page-profile .navbar-content,
body.page-checkout .navbar-inner,
body.page-merchant .nav-inner,
body.page-upgrade .nav-inner,
body.page-admin-review .nav-inner {
    max-width: none;
    padding-left: max(16px, calc((100vw - 1360px) / 2));
    padding-right: max(16px, calc((100vw - 1360px) / 2));
}

/* 发布商品：自动找图候选区 */
body.page-merchant .image-search-results {
    border: 1px dashed rgba(148, 163, 184, 0.5);
    border-radius: 12px;
    padding: 10px;
    background: #f8fbff;
}

body.page-merchant .image-search-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}

body.page-merchant .image-search-head .link-btn {
    background: none;
    border: 0;
    color: var(--blue);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
}

body.page-merchant .image-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}

body.page-merchant .image-search-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    cursor: pointer;
    background: #fff;
    transition: transform .15s, box-shadow .15s;
}

body.page-merchant .image-search-cell:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-float);
}

body.page-merchant .image-search-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.page-merchant .image-search-insert {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    padding: 2px 8px;
    font-size: 11px;
    line-height: 1.5;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #1388ff, #0071e3);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
    transition: transform .15s;
}

body.page-merchant .image-search-insert:hover {
    transform: scale(1.06);
}

/* 商品发货/服务信息（弱化小字，与蓝色按钮明显区分） */
body.page-home .product-ship {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(148, 163, 184, .45);
}
body.page-home .ship-badge {
    display: block;
    padding: 0;
    font-size: 11px;
    line-height: 1.6;
    font-weight: 400;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow-wrap: break-word;
}
body.page-home .ship-badge::before {
    content: "▸ ";
    color: #aab2bf;
    font-size: 10px;
}
body.page-home .ship-badge .ship-key {
    color: #8b93a1;
    white-space: nowrap;
}
body.page-product .product-ship-info {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fbff;
    font-size: 13px;
}
body.page-product .product-ship-info h4 {
    margin: 0 0 8px;
    font-size: 14px;
}
body.page-product .ship-row {
    display: flex;
    gap: 8px;
    margin: 4px 0;
    color: var(--text);
}
body.page-product .ship-label {
    flex: 0 0 auto;
    color: var(--muted);
}

/* 分类侧边栏：窄屏折叠为汉堡按钮，点击展开 */
body.page-home .category-toggle,
body.page-product .category-toggle {
    display: none;
}

@media (max-width: 1024px) {
    body.page-home .category-toggle,
    body.page-product .category-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 12px 14px;
        border: 1px solid rgba(148, 163, 184, 0.28);
        border-radius: 12px;
        background: linear-gradient(180deg, #f8fbff, #f2f7fe);
        font: inherit;
        font-size: 14px;
        font-weight: 600;
        color: var(--text);
        cursor: pointer;
        transition: box-shadow .2s, transform .2s;
    }

    body.page-home .category-toggle:hover,
    body.page-product .category-toggle:hover {
        box-shadow: var(--shadow-float);
        transform: translateY(-1px);
    }

    body.page-home .category-toggle-label,
    body.page-product .category-toggle-label {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    body.page-home .category-toggle-icon,
    body.page-product .category-toggle-icon {
        font-size: 15px;
        line-height: 1;
        color: var(--blue);
    }

    body.page-home .category-toggle-arrow,
    body.page-product .category-toggle-arrow {
        font-size: 12px;
        color: var(--muted);
        transition: transform .2s;
    }

    body.page-home .sidebar.open .category-toggle-arrow,
    body.page-product .sidebar.open .category-toggle-arrow {
        transform: rotate(180deg);
    }

    body.page-home .sidebar h3,
    body.page-product .sidebar h3 {
        display: none;
    }

    body.page-home .category-list,
    body.page-product .category-list {
        display: none;
        margin-top: 10px;
    }

    body.page-home .sidebar.open .category-list,
    body.page-product .sidebar.open .category-list {
        display: block;
    }
}

/* ===== 供应商管理页（admin-suppliers.php）===== */
body.page-admin-dashboard .admin-page-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

body.page-admin-dashboard .admin-page-title .admin-page-ico {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(180deg, #eaf3ff, #dcebff);
    border: 1px solid #d5e6fb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex: 0 0 auto;
}

body.page-admin-dashboard .admin-page-title h1 {
    margin: 0 0 2px;
}

/* 统计概览 */
body.page-admin-dashboard .sup-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 4px 0 18px;
}

body.page-admin-dashboard .sup-stat {
    background: linear-gradient(180deg, #f8fbff, #fbfdff);
    border: 1px solid #e4ebf5;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

body.page-admin-dashboard .sup-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-float);
    border-color: #bfd4ef;
}

body.page-admin-dashboard .sup-stat .sup-stat-ico {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #eaf3ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex: 0 0 auto;
}

body.page-admin-dashboard .sup-stat strong {
    font-size: 22px;
    line-height: 1;
    color: #0b1f33;
}

body.page-admin-dashboard .sup-stat em {
    display: block;
    font-style: normal;
    font-size: 12px;
    color: #7a8798;
    margin-top: 3px;
}

/* 表单卡片 */
body.page-admin-dashboard .sup-form-card .sup-mode-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 600;
}

body.page-admin-dashboard .sup-form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 供应商列表 */
body.page-admin-dashboard .sup-count-badge {
    padding: 4px 12px;
    border-radius: 999px;
    background: #eaf3ff;
    color: #0a66c2;
    font-size: 12px;
    font-weight: 600;
}

body.page-admin-dashboard .sup-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
}

body.page-admin-dashboard .sup-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #eef4fb;
    border: 1px solid #e2ecf7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex: 0 0 auto;
}

body.page-admin-dashboard .sup-name-text {
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

body.page-admin-dashboard .sup-tags {
    display: flex;
    gap: 4px;
    margin-top: 3px;
    flex-wrap: wrap;
}

body.page-admin-dashboard .sup-tag {
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

body.page-admin-dashboard .sup-tag-global { background: #eef2ff; color: #4f46e5; }
body.page-admin-dashboard .sup-tag-mine { background: #e7f8f0; color: #027a48; }
body.page-admin-dashboard .sup-tag-readonly { background: #f1f5f9; color: #64748b; }

body.page-admin-dashboard .sup-product-link {
    color: #0071e3;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

body.page-admin-dashboard .sup-product-link:hover { text-decoration: underline; }

body.page-admin-dashboard .sup-ops {
    display: flex;
    gap: 6px;
    align-items: center;
}

body.page-admin-dashboard .sup-readonly-text {
    color: #b0b8c4;
    font-size: 13px;
}

body.page-admin-dashboard .sup-empty {
    text-align: center;
    color: #94a3b8;
    padding: 26px 0;
    font-size: 14px;
}

/* 供应商详情 */
body.page-admin-dashboard .sup-detail .sup-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

body.page-admin-dashboard .sup-detail .sup-detail-item {
    background: #f8fbff;
    border: 1px solid #e8eef6;
    border-radius: 12px;
    padding: 12px 14px;
}

body.page-admin-dashboard .sup-detail .sup-detail-item span {
    display: block;
    font-size: 12px;
    color: #7a8798;
    margin-bottom: 4px;
}

body.page-admin-dashboard .sup-detail .sup-detail-item b {
    font-size: 14px;
    color: #1f2a37;
}

body.page-admin-dashboard .sup-detail .sup-products-title {
    margin: 0 0 10px;
    font-size: 15px;
    color: #1f2a37;
}

body.page-admin-dashboard .sup-status {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

body.page-admin-dashboard .sup-status-on { background: #e7f8f0; color: #027a48; }
body.page-admin-dashboard .sup-status-off { background: #fff4e5; color: #b54708; }
body.page-admin-dashboard .sup-status-del { background: #ffece8; color: #b42318; }

/* 响应式 */
@media (max-width: 900px) {
    body.page-admin-dashboard .sup-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    body.page-admin-dashboard .sup-detail .sup-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 供应商页：表单 + 卡片网格 布局 */
body.page-admin-dashboard .sup-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

body.page-admin-dashboard .sup-layout .sup-form-card {
    position: sticky;
    top: 16px;
}

/* 供应商卡片网格 */
body.page-admin-dashboard .sup-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

body.page-admin-dashboard .sup-card {
    border: 1px solid #e4ebf5;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfdff, #f8fbff);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

body.page-admin-dashboard .sup-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-float);
    border-color: #bfd4ef;
}

body.page-admin-dashboard .sup-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.page-admin-dashboard .sup-card-title {
    min-width: 0;
}

body.page-admin-dashboard .sup-card-title .sup-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

body.page-admin-dashboard .sup-card-body {
    display: grid;
    gap: 6px;
}

body.page-admin-dashboard .sup-card-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
}

body.page-admin-dashboard .sup-card-row .sup-row-key {
    flex: 0 0 62px;
    color: #7a8798;
    font-size: 12px;
}

body.page-admin-dashboard .sup-card-row .sup-row-val {
    color: #334155;
    font-weight: 600;
    word-break: break-word;
    min-width: 0;
}

body.page-admin-dashboard .sup-card-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px dashed #e2e8f0;
    padding-top: 10px;
    margin-top: auto;
}

@media (max-width: 900px) {
    body.page-admin-dashboard .sup-layout {
        grid-template-columns: 1fr;
    }
    body.page-admin-dashboard .sup-layout .sup-form-card {
        position: static;
    }
}

/* ========== 移动端体验优化（≤640px） ========== */

/* 首页导航：品牌行与搜索行间距收紧，链接与搜索分离更清晰 */
@media (max-width: 640px) {
    body.page-home .navbar-main {
        gap: 8px;
        padding: 8px 0;
    }

    body.page-home .navbar-right {
        gap: 6px;
    }

    /* 发货/服务徽章改为横排紧凑展示，避免占满整行 */
    body.page-home .product-ship {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px 10px;
    }

    body.page-home .ship-badge {
        display: inline-block;
        max-width: 100%;
    }

    /* 商品卡片信息区更紧凑 */
    body.page-home .product-info {
        padding: 14px;
    }

    body.page-home .product-name {
        font-size: 14px;
        min-height: 0;
    }

    /* 卡片操作按钮：主按钮更易点按 */
    body.page-home .product-actions .btn-primary {
        min-height: 40px;
    }

    /* 详情页操作区按钮全宽排列 */
    body.page-product .product-actions {
        align-items: stretch;
    }

    body.page-product .add-cart-btn,
    body.page-product .favorite-btn {
        width: 100%;
        justify-content: center;
    }

    body.page-product .favorite-btn {
        min-height: 44px;
    }
}

/* 商家订单管理：移动端订单卡片布局 */
@media (max-width: 640px) {
    /* 订单标题允许换行，防止长订单号把状态徽章挤出视口 */
    body.page-merchant .merchant-order-title {
        flex-wrap: wrap;
    }

    body.page-merchant .merchant-order-title > div {
        min-width: 0;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    /* 订单信息网格降为 2 列，避免 3 列过窄撑破容器造成横向滚动 */
    body.page-merchant .merchant-order-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.page-merchant .merchant-order-grid > div {
        min-width: 0;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    body.page-merchant .merchant-order-address {
        grid-column: span 2;
    }

    /* 移动端侧栏单列排布 */
    body.page-merchant .merchant-order-side {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    body.page-merchant .merchant-order-side .no-print .btn {
        width: 100%;
    }

    body.page-merchant .merchant-order-action {
        grid-column: 1;
    }
}

/* 超窄屏（≤420px）进一步收拢 */
@media (max-width: 420px) {
    body.page-home .navbar-right {
        width: 100%;
    }

    body.page-home .navbar-search {
        min-width: 0;
    }

    body.page-home .navbar-right a {
        font-size: 12px;
        padding: 6px 9px;
    }

    body.page-merchant .merchant-order-grid {
        grid-template-columns: 1fr;
    }

    body.page-merchant .merchant-order-address {
        grid-column: span 1;
    }
}

/* ========== 在线咨询（实时聊天）组件 ========== */

/* 商品页「在线咨询」按钮 */
body.page-product .inquiry-btn {
    border: 1px solid #c9d8ec;
    background: #f2f7ff;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
body.page-product .inquiry-btn:hover {
    background: #e4efff;
    transform: translateY(-1px);
}

/* 咨询弹窗遮罩 */
.inquiry-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.inquiry-overlay[hidden] { display: none; }

.inquiry-dialog {
    width: 100%;
    max-width: 420px;
    max-height: min(640px, 88vh);
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inquiry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #f8fbff 0%, #f0f6ff 100%);
}
.inquiry-head h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text);
}
.inquiry-close {
    border: 0;
    background: transparent;
    font-size: 16px;
    color: var(--muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.inquiry-close:hover { background: #e8eef7; color: var(--text); }

.inquiry-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 14px 16px;
}
.inquiry-sub {
    margin: 0 0 10px;
    font-size: 12.5px;
    color: var(--muted);
    background: #f4f8ff;
    border-radius: 8px;
    padding: 7px 10px;
    word-break: break-word;
}

/* 消息列表 */
.chat-messages {
    flex: 1;
    min-height: 220px;
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 6px 2px;
}
.chat-messages.admin { min-height: 320px; max-height: none; }

.chat-msg {
    max-width: 82%;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
    white-space: pre-wrap;
}
.chat-msg.from-customer {
    align-self: flex-start;
    background: #f0f4fa;
    color: #1d2939;
    border-bottom-left-radius: 4px;
}
.chat-msg.from-shop {
    align-self: flex-end;
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}
/* 客户视角（微信布局）：自己的消息在右、对方在左 */
.chat-messages.customer-view .chat-msg.from-customer {
    align-self: flex-end;
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 4px;
}
.chat-messages.customer-view .chat-msg.from-shop {
    align-self: flex-start;
    background: #f0f4fa;
    color: #1d2939;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 14px;
}
.chat-time {
    display: block;
    font-size: 10.5px;
    opacity: 0.7;
    margin-top: 3px;
}

/* 游客联系方式表单 */
.inquiry-guest-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0 0;
}
.inquiry-guest-form input {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 13px;
    min-height: 38px;
    width: 100%;
    box-sizing: border-box;
}

/* 输入行 */
.inquiry-input-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
}
.inquiry-input-row input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13.5px;
    min-height: 40px;
    box-sizing: border-box;
}
.inquiry-send {
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
    box-shadow: 0 8px 16px rgba(0, 113, 227, 0.22);
    min-height: 40px;
}
.inquiry-send:hover { transform: translateY(-1px); }

/* 导航角标（商家菜单未读提示） */
body.page-merchant .nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 999px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    vertical-align: 1px;
}

/* ========== 商家客户咨询管理页 ========== */
body.page-merchant .inquiry-page-card h2 { margin-bottom: 2px; }

.inquiry-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 14px 0;
}
.inquiry-tab {
    border: 1px solid var(--line);
    background: #fff;
    color: #334155;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.inquiry-tab.active {
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(0, 113, 227, 0.18);
}

.inquiry-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 14px;
    min-height: 480px;
}
.inquiry-list {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfdff;
    overflow-y: auto;
    max-height: 640px;
}
.inquiry-list-item {
    padding: 12px 14px;
    border-bottom: 1px solid #edf2f8;
    cursor: pointer;
    transition: background 0.15s ease;
    border-left: 3px solid transparent;
}
.inquiry-list-item:hover { background: #f0f6ff; }
.inquiry-list-item.active {
    background: #eaf3ff;
    border-left-color: var(--blue);
}
.inquiry-list-item.has-unread { background: #fffbea; }
.inquiry-list-item.has-unread.active { background: #fdf3d7; }

.ili-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.ili-top strong { font-size: 13.5px; color: var(--text); }
/* 会话列表项微信风格 */
.ili-name {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}
.ili-name strong { font-weight: 600; }
.ili-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex: 0 0 auto;
    min-width: 26px;
}
.ili-time { font-size: 10.5px; color: #98a2b3; line-height: 1; }
.ili-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
}
.inquiry-list-item.has-unread .ili-name strong { font-weight: 800; }
.inquiry-list-item.has-unread .ili-last { color: #1d2939; font-weight: 500; }
.ili-product { font-size: 12px; color: #475467; margin: 4px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ili-last { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ili-contact { font-size: 11.5px; color: #98a2b3; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.inquiry-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    flex: 0 0 auto;
}
.inquiry-status.s-open { background: #ffece8; color: #b42318; }
.inquiry-status.s-replied { background: #e7f8f0; color: #027a48; }
.inquiry-status.s-closed { background: #eef0f4; color: #667085; }

/* 聊天窗 */
.inquiry-chat {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 480px;
}
.inquiry-chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #475467;
}
.inquiry-chat-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: #f8fbff;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 14px 14px 0 0;
}
.inquiry-chat-head > div:first-child { display: flex; align-items: center; gap: 8px; }
.inquiry-chat-head strong { font-size: 14px; }
.inquiry-chat-head .ili-product { margin: 0; color: var(--blue); text-decoration: none; }
.inquiry-chat-head .ili-product:hover { text-decoration: underline; }

.inquiry-chat .chat-messages { padding: 12px 16px; flex: 1; }
.inquiry-chat .inquiry-input-row { padding: 0 16px 12px; margin-top: 0; }
.inquiry-close-session {
    align-self: flex-end;
    margin: 0 16px 14px;
    border: 1px solid #ffd4cc;
    background: #fff7f5;
    color: #b42318;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12.5px;
    cursor: pointer;
}
.inquiry-close-session:hover { background: #ffece8; }

/* 商家咨询页响应式 */
@media (max-width: 768px) {
    .inquiry-layout {
        grid-template-columns: 1fr;
    }
    .inquiry-list { max-height: 260px; }
    .inquiry-chat { min-height: 420px; }
}
@media (max-width: 480px) {
    .inquiry-guest-form { grid-template-columns: 1fr; }
    .inquiry-dialog { max-height: 92vh; }
}

/* ========== 全站浮动消息按钮（chat-launcher） ========== */
.chat-launcher {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 9999;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f8cff, #2563eb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    user-select: none;
    -webkit-user-select: none;
}
.chat-launcher:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.55);
}
.chat-launcher:active { transform: scale(0.96); }
.chat-launcher-icon { width: 28px; height: 28px; }
.chat-launcher-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 11px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    border: 2px solid #fff;
    box-sizing: border-box;
}
.chat-launcher-badge.hidden { display: none; }
@keyframes chatLauncherPulse {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.18); }
    50%  { transform: scale(0.94); }
    70%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.chat-launcher.attention { animation: chatLauncherPulse .8s ease 3; }

/* 客户消息页补充 */
.inquiry-closed-tip {
    padding: 12px 16px;
    color: #888;
    font-size: 13px;
    text-align: center;
    border-top: 1px dashed #e2e2e2;
}

/* ========== 客户消息页 my-inquiries.php（对齐前台导航/卡片规范） ========== */
body.page-my-inquiries .navbar {
    padding: 0 20px;
}
body.page-my-inquiries .navbar-content {
    max-width: 1360px;
    margin: 0 auto;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
body.page-my-inquiries .navbar-content h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
}
body.page-my-inquiries .navbar-content h1 a {
    display: inline-flex;
    align-items: center;
}
body.page-my-inquiries .navbar-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
body.page-my-inquiries .navbar-links a {
    color: #334155;
    text-decoration: none;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    padding: 6px 10px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}
body.page-my-inquiries .navbar-links a:hover {
    border-color: #b8cbe1;
    background: #f8fbff;
}
body.page-my-inquiries .navbar-links a[aria-current="page"] {
    background: linear-gradient(180deg, #1388ff 0%, #0071e3 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 16px rgba(0, 113, 227, 0.18);
}
body.page-my-inquiries .wrap {
    max-width: 1360px;
    margin: 22px auto;
    padding: 0 18px;
}
body.page-my-inquiries .card {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(10px);
    transition: box-shadow 0.24s ease, transform 0.24s ease;
    padding: 18px;
}
body.page-my-inquiries .card:hover { box-shadow: var(--shadow-float); }
body.page-my-inquiries .inquiry-page-card h2 { margin-bottom: 2px; }

/* ========================================================================
   主题：鲜潮（借鉴 freshhi.com.tw/product 视觉——暖米底、赤陶红、衬线中文、
   无阴影平面卡片、黑底价格徽标）。仅当 body 带 .theme-freshhi 时生效，
   由管理员后台「网站主题」切换写入 app_settings.site_theme。
   ======================================================================== */
body.theme-freshhi {
    --bg: #f4ede0;
    --surface: rgba(255, 255, 255, 0.94);
    --surface-strong: #ffffff;
    --surface-soft: #faf5ea;
    --text: #2c211a;
    --text-soft: #4a392c;
    --muted: #8a7a67;
    --line: #e8dcc4;
    --blue: #a8222c;
    --blue-dark: #841a22;
    --danger: #a8222c;
    --ok: #4c7a3f;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 8px;
    --shadow-card: 0 2px 10px rgba(60, 40, 20, 0.06);
    --shadow-float: 0 6px 18px rgba(60, 40, 20, 0.1);
    --focus-ring: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 0 5px rgba(168, 34, 44, 0.3), 0 10px 18px rgba(168, 34, 44, 0.18);
    font-family: "Noto Serif TC", "Microsoft JhengHei", "PingFang SC", "Microsoft YaHei", serif;
    background:
        radial-gradient(1000px 460px at 0% -16%, #f8f1e3 0%, transparent 66%),
        radial-gradient(920px 500px at 100% -24%, #f6efe0 0%, transparent 62%),
        var(--bg);
}
body.theme-freshhi h1,
body.theme-freshhi h2,
body.theme-freshhi h3,
body.theme-freshhi h4 {
    font-family: "Noto Serif TC", "Microsoft JhengHei", "PingFang SC", serif;
}
body.theme-freshhi a { color: var(--blue); }

/* 统一改写全站蓝色渐变按钮/高亮徽标为赤陶红实色（覆盖硬编码渐变值） */
body.theme-freshhi .navbar-search button,
body.theme-freshhi .btn-primary,
body.theme-freshhi .add-cart-btn,
body.theme-freshhi .checkout-btn,
body.theme-freshhi .btn.primary,
body.theme-freshhi .navbar-right a[aria-current="page"],
body.theme-freshhi .navbar-links a[aria-current="page"],
body.theme-freshhi .navbar a[aria-current="page"],
body.theme-freshhi .back-btn,
body.theme-freshhi .nav a[aria-current="page"],
body.theme-freshhi .verify-btn,
body.theme-freshhi .upgrade-shop .btn,
body.theme-freshhi .stats-actions .btn,
body.theme-freshhi .admin-form .btn,
body.theme-freshhi .setup .actions a,
body.theme-freshhi .redirect .actions a,
body.theme-freshhi .nav-badge,
body.theme-freshhi .chat-msg.from-shop,
body.theme-freshhi .chat-messages.customer-view .chat-msg.from-customer,
body.theme-freshhi .inquiry-send,
body.theme-freshhi .inquiry-tab.active,
body.theme-freshhi .chat-launcher {
    background: linear-gradient(180deg, #c22d38 0%, #a8222c 100%) !important;
    box-shadow: 0 8px 16px rgba(168, 34, 44, 0.22) !important;
}
body.theme-freshhi .navbar-brand[aria-current="page"] {
    background: transparent !important;
    box-shadow: none !important;
}
body.theme-freshhi .btn:hover,
body.theme-freshhi .navbar-search button:hover,
body.theme-freshhi .add-cart-btn:hover,
body.theme-freshhi .checkout-btn:hover {
    filter: brightness(1.04);
}
body.theme-freshhi .product-price,
body.theme-freshhi .price,
body.theme-freshhi .product-original-price + .product-price {
    color: var(--blue);
}
body.theme-freshhi .favorite-btn.favorited,
body.theme-freshhi .favorite-toggle.favorited {
    color: var(--blue);
    border-color: var(--blue);
}

body.theme-freshhi .navbar a.navbar-brand[aria-current="page"] {
    background: transparent !important;
    box-shadow: none !important;
}

/* 内容导航菜单：赤陶红主题下 active 指示条与文字改为红色 */
body.theme-freshhi .nav-menu-item.active > a,
body.theme-freshhi .nav-menu-item > a:hover {
    color: #a8222c;
}
body.theme-freshhi .nav-menu-item > a:hover {
    background: rgba(168, 34, 44, 0.06);
}
body.theme-freshhi .nav-menu-item.active::before {
    background: #a8222c;
}
body.theme-freshhi .nav-dropdown a:hover {
    background: #fff1f2;
    color: #8f1d27 !important;
}
body.theme-freshhi .navbar-content-menu .nav-dropdown,
body.theme-freshhi .navbar-right .nav-dropdown {
    background: #fff;
}
body.theme-freshhi .navbar-content-menu .nav-dropdown a,
body.theme-freshhi .navbar-right .nav-dropdown a {
    color: #334155 !important;
}
body.theme-freshhi .navbar-content-menu .nav-dropdown a:hover,
body.theme-freshhi .navbar-right .nav-dropdown a:hover {
    background: #fff1f2;
    color: #8f1d27 !important;
}

/* 食堂用量计划：独立测试工作台 */
.page-canteen { overflow-x: clip; }
.page-canteen .canteen-wrap { max-width: 1360px; }
.canteen-page-head,
.canteen-section-head,
.canteen-toolbar,
.canteen-editor-actions,
.canteen-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.canteen-page-head { margin: 14px 0 12px; }
.canteen-page-head h1 { margin: 4px 0 2px; font-size: 26px; letter-spacing: 0; }
.canteen-page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.canteen-filter-bar {
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #f8fafc;
}
.canteen-inline-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
    flex: 1 1 440px;
}
.canteen-inline-filter label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.canteen-inline-filter select,
.canteen-inline-filter input {
    box-sizing: border-box;
    min-width: 150px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font: inherit;
}
.canteen-search-field {
    min-width: min(260px, 100%);
    flex: 1 1 200px;
}
.canteen-page-size {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}
.canteen-page-size select {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    padding: 7px 10px;
}
.canteen-page-summary {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 12px;
}
.page-canteen-ingredients .canteen-library-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
    grid-template-areas: "list side";
    align-items: start;
    gap: 16px;
}
.page-canteen-ingredients .canteen-library-grid > section.card:first-child { grid-area: list; min-width: 0; }
.page-canteen-ingredients .canteen-ingredient-side {
    grid-area: side;
    display: grid;
    gap: 16px;
    min-width: 0;
    position: sticky;
    top: 80px;
    align-self: start;
}
.page-canteen-ingredients .canteen-ingredient-side > * {
    grid-area: auto;
}
.page-canteen-ingredients .canteen-ingredient-side .canteen-editor,
.page-canteen-ingredients .canteen-ingredient-side .canteen-categories-panel {
    position: static;
    margin: 0;
}
.page-canteen-ingredients .canteen-editor .canteen-ingredient-form {
    grid-template-columns: 1fr 1fr;
}
.page-canteen-ingredients .canteen-editor .canteen-ingredient-form .btn {
    grid-column: 1 / -1;
}
.page-canteen-ingredients .canteen-categories-panel .canteen-category-columns {
    grid-template-columns: 1fr;
}
.page-canteen-ingredients .canteen-category-row {
    grid-template-columns: minmax(100px, 1fr) 58px 72px auto;
}
.canteen-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.canteen-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.52);
}
.canteen-modal-backdrop[hidden] {
    display: none;
}
.canteen-modal-panel {
    width: min(760px, 100%);
    max-height: min(86vh, 840px);
    overflow-y: auto;
    margin: 0;
}
.canteen-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.canteen-dialog-head h2 { margin: 0; }
body.modal-open {
    overflow: hidden;
}
.canteen-group-title {
    margin: 16px 0 8px;
    font-size: 14px;
    color: var(--muted);
}
.canteen-note-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: grid;
    gap: 8px;
}
.canteen-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #f8fafc;
}
.canteen-note.is-done .canteen-note-text {
    color: var(--muted);
    text-decoration: line-through;
}
.canteen-note-text { flex: 1; min-width: 0; }
.canteen-note-toggle { display: inline-flex; }
.canteen-note-check {
    border: 0;
    background: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    color: var(--blue);
}
.canteen-note-tag {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.canteen-note-tag.tag-clean { background: #e7f8f0; color: #027a48; }
.canteen-note-tag.tag-marinate { background: #fff4e5; color: #b54708; }
.canteen-note-tag.tag-thaw { background: #eef5ff; color: #0071e3; }
.canteen-note-tag.tag-other { background: #f1f5f9; color: #475569; }
.canteen-note-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.canteen-note-form select,
.canteen-note-form input {
    box-sizing: border-box;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    font: inherit;
}
.canteen-note-form input { flex: 1 1 220px; }
@media print {
    body.page-canteen .nav,
    .canteen-no-print,
    .site-toast { display: none !important; }
    body.page-canteen .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #cbd5e1;
    }
    .table-scroll { overflow: visible; }
}
.canteen-test-badge {
    display: inline-flex;
    padding: 3px 8px;
    border: 1px solid #fedf89;
    border-radius: 999px;
    background: #fffaeb;
    color: #b54708;
    font-size: 11px;
    font-weight: 700;
}
.canteen-week-nav { display: flex; gap: 6px; }
.canteen-week-nav .btn { min-width: 40px; }
.page-canteen .btn {
    border: 1px solid #b8cbe1;
    background: #fff;
    color: #334155;
    box-shadow: none;
    text-decoration: none;
}
.page-canteen .btn:hover {
    border-color: var(--blue);
    background: #eef5ff;
    color: var(--blue-dark);
}
.page-canteen .btn.primary {
    border-color: transparent;
    background: linear-gradient(180deg, #1388ff, #0071e3);
    color: #fff;
    box-shadow: 0 8px 16px rgba(0, 113, 227, 0.22);
}
.page-canteen .btn.primary:hover {
    color: #fff;
    filter: brightness(1.06);
}
.page-canteen .btn:disabled {
    opacity: .48;
    cursor: not-allowed;
    filter: grayscale(.15);
}
.canteen-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    padding: 4px;
    width: fit-content;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}
.canteen-tabs a {
    padding: 9px 16px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}
.canteen-tabs a[aria-selected="true"] {
    background: linear-gradient(180deg, #1388ff, #0071e3);
    color: #fff;
    box-shadow: 0 5px 12px rgba(0, 113, 227, 0.2);
}
.canteen-plan-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 304px;
    gap: 16px;
    align-items: start;
}
.canteen-plan-layout > *,
.canteen-library-grid > * { min-width: 0; }
.page-canteen .card { margin-bottom: 16px; }
.canteen-section-head { margin-bottom: 14px; }
.canteen-plan-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.canteen-section-head h2,
.canteen-summary h2,
.canteen-editor h2 { margin: 0 0 3px; font-size: 18px; letter-spacing: 0; }
.canteen-section-head p { margin: 0; }
.canteen-summary { position: sticky; top: 80px; }
.canteen-summary dl { margin: 12px 0; }
.canteen-summary dl div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}
.canteen-summary dt { color: var(--muted); font-size: 13px; }
.canteen-summary dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.canteen-summary > .btn { width: 100%; margin-top: 10px; text-align: center; }
.canteen-warning,
.canteen-missing { color: #b54708; font-weight: 700; }
.canteen-warning { display: block; padding: 10px; border-radius: var(--radius-sm); background: #fffaeb; font-size: 12px; text-decoration: none; }
.canteen-matrix-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.canteen-matrix {
    display: grid;
    grid-template-columns: 72px repeat(7, minmax(124px, 1fr));
    min-width: 940px;
    background: var(--line);
    gap: 1px;
}
.canteen-corner,
.canteen-day-head,
.canteen-meal-label,
.canteen-meal-cell { background: #fff; }
.canteen-corner,
.canteen-day-head {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.canteen-corner,
.canteen-meal-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.canteen-day-head { flex-direction: column; gap: 1px; }
.canteen-day-head strong { font-size: 13px; }
.canteen-day-head span { color: var(--muted); font-size: 11px; }
.canteen-meal-label { display: flex; align-items: center; justify-content: center; }
.canteen-meal-cell { min-height: 112px; padding: 8px; }
.canteen-meal-cell > label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.canteen-meal-cell input[data-diners] { width: 68px; min-height: 30px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.canteen-cell-dishes { display: grid; gap: 4px; margin: 7px 0; }
.canteen-dish-chip {
    display: block;
    overflow: hidden;
    padding: 5px 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7f9fc;
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.canteen-add-dish { padding: 4px 0; border: 0; background: transparent; color: var(--blue); font-size: 11px; font-weight: 700; cursor: pointer; }
.canteen-day-switch { display: none; }
.canteen-empty { display: grid; place-items: center; gap: 8px; min-height: 220px; padding: 40px 16px; text-align: center; }
.canteen-empty strong { font-size: 16px; }
.canteen-empty span { color: var(--muted); font-size: 13px; }
.canteen-library-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
    grid-template-areas: "recipes editor" "ingredients editor" "categories editor";
    gap: 16px;
    align-items: start;
}
.canteen-library-grid > .card:first-child { grid-area: recipes; }
.canteen-ingredients-panel { grid-area: ingredients; }
.canteen-categories-panel { grid-area: categories; }
.canteen-table { min-width: 720px; }
.canteen-table th { font-size: 12px; white-space: nowrap; }
.canteen-table td { height: 46px; padding: 8px 10px; font-size: 13px; vertical-align: middle; }
.canteen-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.canteen-table-empty { padding: 36px !important; color: var(--muted); text-align: center; }
.canteen-editor { grid-area: editor; position: sticky; top: 80px; align-self: start; }
.canteen-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.canteen-form-grid label:last-child { grid-column: 1 / -1; }
.canteen-editor label,
.canteen-ingredient-form label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
.canteen-form-wide { grid-column: 1 / -1; }
.canteen-form-wide textarea { box-sizing: border-box; width: 100%; min-height: 76px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); resize: vertical; font: inherit; }
.canteen-public-toggle { display: flex !important; grid-column: 1 / -1; align-items: center; gap: 8px !important; color: var(--text) !important; }
.canteen-public-toggle input { width: 17px; height: 17px; accent-color: var(--blue); }
.canteen-editor input,
.canteen-editor select,
.canteen-ingredient-form input,
.canteen-ingredient-form select,
.canteen-toolbar input,
.canteen-drawer input {
    box-sizing: border-box;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font: inherit;
}
.canteen-recipe-items { display: grid; gap: 8px; margin: 14px 0 10px; }
.canteen-recipe-item { display: grid; grid-template-columns: 1.4fr repeat(3, .8fr) 38px; gap: 6px; align-items: end; padding: 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f8fafc; }
.canteen-ingredient-picker { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
.canteen-select-search { position: relative; display: grid; gap: 6px; }
.canteen-ingredient-search {
    box-sizing: border-box;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 12px;
}
.canteen-ingredient-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    list-style: none;
}
.canteen-ingredient-results li {
    padding: 8px 9px;
    border-radius: 6px;
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
}
.canteen-ingredient-results li:hover,
.canteen-ingredient-results li:focus {
    background: #eef5ff;
    color: var(--blue);
}
.canteen-icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); font-size: 22px; cursor: pointer; }
.canteen-editor-actions { margin-top: 10px; }
.canteen-ingredient-form { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; align-items: end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.canteen-ingredient-form .btn { min-height: 38px; }
.canteen-category-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.canteen-category-group { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #f8fafc; }
.canteen-category-group h3 { margin: 0 0 10px; font-size: 15px; letter-spacing: 0; }
.canteen-category-create,
.canteen-category-row { display: grid; grid-template-columns: minmax(120px, 1fr) 72px auto; gap: 6px; align-items: center; }
.canteen-category-create { margin-bottom: 10px; }
.canteen-category-row { grid-template-columns: minmax(110px, 1fr) 64px 76px auto; padding: 7px 0; border-top: 1px solid var(--line); }
.canteen-category-order-field { display: grid; gap: 4px; min-width: 0; }
.canteen-category-order-field span { color: var(--muted); font-size: 11px; font-weight: 700; }
.canteen-category-create input,
.canteen-category-row input,
.canteen-category-row select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 12px;
}
.canteen-category-create .btn,
.canteen-category-row .btn { min-height: 36px; padding: 7px 11px; }
.canteen-toolbar form { display: flex; gap: 6px; }
.canteen-toolbar input { width: 220px; }
.canteen-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-md); margin-bottom: 14px; overflow: hidden; }
.canteen-kpis div { display: grid; gap: 4px; padding: 12px 14px; border-right: 1px solid var(--line); }
.canteen-kpis div:last-child { border-right: 0; }
.canteen-kpis span { color: var(--muted); font-size: 11px; }
.canteen-kpis strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.canteen-requirement-table { min-width: 1080px; }
.canteen-requirement-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.canteen-requirement-table th:not(:first-child) { text-align: right; }
.canteen-requirement-table summary { cursor: pointer; font-weight: 700; }
.canteen-sources { display: grid; gap: 5px; min-width: 300px; padding: 9px 0 2px; }
.canteen-sources span { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; font-weight: 400; }
.canteen-sources b { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.canteen-drawer-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(17, 24, 39, .38); backdrop-filter: blur(2px); }
.canteen-drawer {
    position: fixed;
    z-index: 210;
    top: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    width: 420px;
    max-width: calc(100vw - 32px);
    background: #fff;
    box-shadow: var(--shadow-float);
    transform: translateX(105%);
    transition: transform .2s ease;
}
.canteen-drawer[aria-hidden="false"] { transform: translateX(0); }
.canteen-drawer[aria-hidden="true"] { visibility: hidden; pointer-events: none; }
.canteen-drawer header,
.canteen-drawer footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.canteen-drawer footer { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; }
.canteen-drawer h2 { margin: 2px 0 0; font-size: 19px; }
.canteen-drawer-search { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.canteen-drawer-search span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.canteen-drawer-list { overflow-y: auto; padding: 8px 16px; }
.canteen-recipe-option { display: grid; grid-template-columns: 20px minmax(0, 1fr) 72px; gap: 9px; align-items: center; padding: 11px 3px; border-bottom: 1px solid var(--line); cursor: pointer; }
.canteen-recipe-option > input { width: 18px; min-height: 18px; }
.canteen-recipe-option span { min-width: 0; }
.canteen-recipe-option strong,
.canteen-recipe-option small { display: block; }
.canteen-recipe-option small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.canteen-coverage { display: flex !important; align-items: center; gap: 3px; color: var(--muted); font-size: 12px; }
.canteen-coverage input { min-height: 32px; padding: 5px; text-align: right; }
body.canteen-drawer-open { overflow: hidden; }
.canteen-print-sheet { display: none; }

@media (max-width: 1024px) {
    .canteen-plan-layout { grid-template-columns: minmax(0, 1fr) 280px; }
    .canteen-library-grid { grid-template-columns: 1fr; grid-template-areas: "recipes" "editor" "ingredients" "categories"; }
    .canteen-editor { position: static; }
    .canteen-ingredient-form { grid-template-columns: repeat(2, 1fr); }
    .page-canteen-ingredients .canteen-library-grid {
        grid-template-columns: 1fr;
        grid-template-areas: "list" "side";
    }
    .page-canteen-ingredients .canteen-ingredient-side {
        position: static;
    }
}
@media (max-width: 900px) {
    .canteen-plan-layout { grid-template-columns: 1fr; }
    .canteen-summary { position: static; order: -1; }
    .canteen-summary dl { display: grid; grid-template-columns: repeat(4, 1fr); }
    .canteen-summary dl div { display: grid; padding: 8px; border-right: 1px solid var(--line); border-bottom: 0; text-align: center; }
    .canteen-day-switch { display: flex; overflow-x: auto; gap: 4px; margin-bottom: 10px; }
    .canteen-day-switch button { flex: 1 0 54px; min-height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-weight: 700; }
    .canteen-day-switch button.active { border-color: var(--blue); background: #eef5ff; color: var(--blue); }
    .canteen-matrix-scroll { overflow: visible; }
    .canteen-matrix { grid-template-columns: 64px minmax(0, 1fr); min-width: 0; }
    .canteen-matrix [data-day-column] { display: none; }
    .canteen-matrix [data-day-column].mobile-active { display: flex; }
    .canteen-meal-cell[data-day-column].mobile-active { display: block; }
}
@media (max-width: 640px) {
    body.page-canteen .nav { padding: 6px 14px; }
    body.page-canteen .nav-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 64px;
        gap: 8px;
    }
    body.page-canteen .nav .brand-home-link {
        overflow: hidden;
        max-width: 170px;
        font-size: 0;
    }
    body.page-canteen .nav .site-logo {
        width: auto;
        height: 54px;
        max-width: 160px;
    }
    body.page-canteen .nav-inner > div { display: flex; flex-wrap: nowrap; }
    body.page-canteen .nav a:not(.brand-home-link) { margin-left: 4px; white-space: nowrap; }
    .canteen-page-head { align-items: flex-end; }
    .canteen-page-head h1 { font-size: 22px; }
    .canteen-week-nav .btn:nth-child(2) { display: none; }
    .canteen-tabs { width: 100%; }
    .canteen-tabs a { flex: 1; padding: 10px 7px; text-align: center; }
    .canteen-section-head { align-items: flex-start; flex-direction: column; }
    .canteen-section-head > .btn { width: 100%; }
    .canteen-plan-actions { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; }
    .canteen-plan-actions .btn.primary { grid-column: 1 / -1; }
    .canteen-summary dl { grid-template-columns: repeat(2, 1fr); }
    .canteen-summary dl div:nth-child(2) { border-right: 0; }
    .canteen-form-grid,
    .canteen-ingredient-form { grid-template-columns: 1fr; }
    .canteen-form-grid label:last-child { grid-column: auto; }
    .canteen-recipe-item { grid-template-columns: 1fr 1fr; }
    .canteen-recipe-item label:first-child { grid-column: 1 / -1; }
    .canteen-recipe-item .canteen-icon-btn { align-self: end; }
    .canteen-toolbar { width: 100%; align-items: stretch; flex-direction: column; }
    .canteen-toolbar form { display: grid; grid-template-columns: 1fr auto; }
    .canteen-toolbar input { width: 100%; }
    .canteen-kpis { grid-template-columns: repeat(2, 1fr); }
    .canteen-kpis div { border-bottom: 1px solid var(--line); }
    .canteen-kpis div:nth-child(even) { border-right: 0; }
    .canteen-kpis div:last-child { border-right: 1px solid var(--line); border-bottom: 0; }
    .canteen-drawer { width: 100%; max-width: none; }
    .canteen-drawer header,
    .canteen-drawer footer { padding: 12px 14px; }
    .canteen-drawer footer .btn { min-height: 44px; }
    .canteen-category-columns { grid-template-columns: 1fr; }
    .canteen-category-row { grid-template-columns: minmax(100px, 1fr) 58px 72px auto; }
}

@media print {
    @page { size: A4 landscape; margin: 10mm; }
    body.page-canteen { background: #fff !important; overflow: visible; }
    body.page-canteen > :not(.canteen-print-sheet) { display: none !important; }
    .canteen-print-sheet {
        display: block;
        width: 100%;
        color: #121417;
        font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    }
    .canteen-print-sheet header { margin-bottom: 8mm; text-align: center; }
    .canteen-print-sheet h1 { margin: 0 0 2mm; font-size: 22pt; letter-spacing: 0; }
    .canteen-print-sheet header p { margin: 0; color: #667085; font-size: 10pt; }
    .canteen-print-sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; }
    .canteen-print-sheet th,
    .canteen-print-sheet td { border: 1px solid #b8c2d1; padding: 4mm 2.5mm; text-align: center; vertical-align: middle; }
    .canteen-print-sheet thead th { background: #eef5ff !important; color: #334155; font-size: 10pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .canteen-print-sheet thead th:first-child,
    .canteen-print-sheet tbody th { width: 18mm; }
    .canteen-print-sheet th span { display: block; margin-top: 1mm; color: #667085; font-size: 8pt; font-weight: 400; }
    .canteen-print-sheet tbody th { background: #f7f9fc !important; font-size: 10pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .canteen-print-sheet td { height: 27mm; }
    .canteen-print-sheet td strong { display: block; font-size: 9pt; line-height: 1.55; }
    .canteen-print-sheet td span { display: block; margin-top: 2mm; color: #667085; font-size: 8pt; }
    .canteen-print-sheet footer { margin-top: 4mm; color: #98a2b3; font-size: 7.5pt; text-align: right; }
}
