:root {
    --primary-dark: #0A1628;
    --primary-blue: #1E3A5F;
    --accent-green: #00FF88;
    --accent-orange: #FF6B35;
    --accent-red: #FF4757;
    --text-white: #FFFFFF;
    --text-gray: #8E99A4;
    --bg-dark: #0D1B2A;
    --card-bg: hsl(213, 35%, 16%);
    --border-color: #2D3E50;
    --primary-bg: var(--bg-dark);
    --accent-color: var(--accent-green);
    /* 设备浏览器安全区与 Telegram SDK 安全区取更大值，兼容 Web 与 Mini App。 */
    --tg-safe-area-top: 0px;
    --tg-safe-area-bottom: 0px;
    --tg-content-safe-area-top: 0px;
    --tg-content-safe-area-bottom: 0px;
    --tg-top-controls-inset: 0px;
    --safe-area-top: max(env(safe-area-inset-top, 30px), var(--tg-safe-area-top));
    --safe-area-bottom: max(env(safe-area-inset-bottom, 20px), var(--tg-safe-area-bottom));
    /* contentSafeAreaInset 包含 Telegram 的关闭、更多等覆盖式原生操作控件。 */
    --app-top-inset: max(var(--safe-area-top), var(--tg-content-safe-area-top), var(--tg-top-controls-inset));
    --app-bottom-inset: max(var(--safe-area-bottom), var(--tg-content-safe-area-bottom));
    /* Telegram WebApp 适配变量（JS 会动态设置） */
    --tg-header-offset: 0px;
    --tg-viewport-height: 100vh;
    --tg-viewport-stable-height: 100vh;
    --header-height: calc(60px + var(--app-top-inset));
    --tabbar-height: calc(68px + var(--app-bottom-inset));
}
html, body {
    overflow-x: clip;
    width: 100%;
    max-width: 100vw;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; max-width: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg-dark); color: var(--text-white); min-height: 100vh; min-height: var(--tg-viewport-stable-height); padding-bottom: 70px; }
.page { display: none; padding: 20px; padding-top: calc(var(--app-top-inset) + 12px); padding-bottom: var(--tabbar-height); min-height: 100vh; min-height: var(--tg-viewport-stable-height); overflow-x: clip; max-width: 100%; }
.page.active { display: block; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-top: 10px; }
.logo { font-size: 24px; font-weight: 700; background: linear-gradient(135deg, var(--accent-green), #00CC6A); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.lang-switcher {
    display: flex;
    gap: 2px;
    background: rgba(45, 62, 80, 0.6);
    border-radius: 16px;
    padding: 3px;
    border: 1px solid rgba(45, 62, 80, 0.8);
    position: relative;
    z-index: 9999;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-gray);
    padding: 5px 12px;
    border-radius: 13px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    pointer-events: auto;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.lang-btn:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.05);
}
.lang-btn:active {
    transform: scale(0.95);
}
.lang-btn.active {
    background: linear-gradient(135deg, var(--accent-green), #00CC6A);
    color: var(--primary-dark);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.3);
}

/* 移动端适配：保持小巧但保证可点击区域 */
@media (max-width: 640px) {
    .header { align-items: center; }
    .logo { margin-top: 0; font-size: 20px; }
    .lang-switcher {
        gap: 2px;
        padding: 3px;
        border-radius: 14px;
    }
    .lang-btn {
        min-height: 28px;
        min-width: auto;
        padding: 5px 10px;
        font-size: 11px;
        border-radius: 11px;
        line-height: 1.2;
    }
}
.card { background: var(--card-bg); border-radius: 16px; padding: 20px; margin-bottom: 16px; border: 1px solid var(--border-color); transition: transform 0.2s; max-width: 100%; overflow: hidden; }
.card:hover { transform: scale(1.02); }
.card:active { transform: scale(0.98); }
.calculator-btn { display: flex; align-items: center; justify-content: center; gap: 12px; background: linear-gradient(135deg, var(--accent-green), #00CC6A); color: var(--primary-dark); padding: 20px; border-radius: 16px; font-size: 18px; font-weight: 600; cursor: pointer; border: none; width: 100%; transition: transform 0.2s, box-shadow 0.2s; }
.calculator-btn:active { transform: scale(0.98); }
.score-ring { width: 160px; height: 160px; margin: 0 auto 20px; position: relative; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 12; }
.score-ring .bg { stroke: var(--border-color); }
.score-ring .progress { stroke: var(--accent-green); stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.score-ring .score-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.score-ring .score-value { font-size: 36px; font-weight: 700; }
.score-ring .score-label { font-size: 12px; color: var(--text-gray); }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; color: var(--text-gray); margin-bottom: 8px; }
.form-select, .form-input { width: 100%; padding: 14px 16px; background: var(--primary-dark); border: 1px solid var(--border-color); border-radius: 12px; color: var(--text-white); font-size: 16px; appearance: none; }
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238E99A4' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.slider-container { padding: 10px 0; }
.slider-value { text-align: center; font-size: 32px; font-weight: 700; color: var(--accent-green); margin-bottom: 10px; }
.slider-value.warning { color: var(--accent-orange); }
.slider-value.danger { color: var(--accent-red); }
.slider { width: 100%; height: 8px; -webkit-appearance: none; background: var(--border-color); border-radius: 4px; outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; background: var(--accent-green); border-radius: 50%; cursor: pointer; }
.result-card { text-align: center; padding: 24px 16px; }
.result-bac { font-size: 36px; font-weight: 700; margin-bottom: 8px; word-break: break-word; line-height: 1.2; }
.result-bac.safe { color: var(--accent-green); }
.result-bac.warning { color: var(--accent-orange); }
.result-bac.danger { color: var(--accent-red); }
.result-recommendation { color: var(--text-gray); line-height: 1.6; margin: 16px 0; font-size: 14px; }
.result-time { display: flex; justify-content: space-around; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.result-time-item { text-align: center; }
.result-time-item .label { font-size: 12px; color: var(--text-gray); margin-bottom: 4px; }
.result-time-item .value { font-size: 16px; font-weight: 600; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 20px; }
.calendar-header { text-align: center; font-size: 12px; color: var(--text-gray); padding: 8px 0; }
.calendar-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 14px; background: var(--primary-dark); }
.calendar-day.has-drink { background: var(--accent-orange); color: var(--primary-dark); }
.calendar-day.today { border: 2px solid var(--accent-green); }
.week-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-item { background: var(--primary-dark); padding: 16px; border-radius: 12px; text-align: center; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--accent-green); }
.stat-label { font-size: 12px; color: var(--text-gray); margin-top: 4px; }
.knowledge-list { display: flex; flex-direction: column; gap: 16px; }

.masonry-grid { column-count: 2; column-gap: 12px; margin-top: 16px; }
.masonry-item { break-inside: avoid; margin-bottom: 12px; background: var(--card-bg); border-radius: 12px; overflow: hidden; border: 1px solid var(--border-color); cursor: pointer; transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), border-color 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.masonry-item:hover { border-color: rgba(0, 255, 136, 0.42); transform: translateY(-2px); }
.masonry-item .card-cover {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(39, 58, 76, .92), rgba(25, 42, 58, .92));
    /* 不使用 content-visibility：Telegram WebView 在异步点赞后可能丢弃图片栅格缓存。 */
    transition: opacity .2s ease, filter .2s ease;
}
.masonry-item .card-cover.lazy-loading { opacity: .62; filter: saturate(.75); }
.masonry-item .card-cover.lazy-loaded { opacity: 1; filter: none; }
.masonry-item .card-cover.lazy-error { min-height: 88px; opacity: .45; }
.knowledge-list-sentinel { min-height: 56px; padding: 8px 0; }
.masonry-item .card-info { padding: 12px; }
.masonry-item .card-title { font-size: 14px; font-weight: 650; margin: 0; line-height: 1.4; color: var(--text-white); }
@media (max-width: 959px) {
    #insights .masonry-item .card-title {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
}
.masonry-item .card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.masonry-item .card-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--accent-green); }
.card-actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.knowledge-card-action { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 32px; min-height: 32px; padding: 6px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text-gray); font: inherit; cursor: pointer; transition: color 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 160ms cubic-bezier(0.23, 1, 0.32, 1), border-color 160ms cubic-bezier(0.23, 1, 0.32, 1), transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
@media (hover: hover) and (pointer: fine) {
    .knowledge-card-action:hover { color: var(--accent-green); background: rgba(0, 255, 136, 0.08); border-color: rgba(0, 255, 136, 0.28); }
    .knowledge-card-action:active { transform: scale(0.97); }
}
.knowledge-card-action:focus-visible { outline: 2px solid var(--accent-green); outline-offset: 2px; }
.masonry-item .card-likes { font-size: 12px; font-variant-numeric: tabular-nums; background: transparent; border-color: transparent; box-shadow: none; }
.masonry-item .card-likes:hover { background: transparent; border-color: transparent; color: var(--accent-green); }
.card-likes.liked { color: #ff6b7a; background: transparent; border-color: transparent; box-shadow: none; }
.card-likes.liked:hover { color: #ff6b7a; }
.masonry-item .knowledge-card-action svg { width: 16px; height: 16px; flex: 0 0 auto; }
.knowledge-card { background: var(--card-bg); border-radius: 16px; padding: 20px; border: 1px solid var(--border-color); }
.knowledge-card .type-tag { display: inline-block; padding: 4px 10px; background: var(--primary-dark); border-radius: 20px; font-size: 11px; color: var(--accent-green); margin-bottom: 12px; }
.knowledge-card h3 { font-size: 16px; margin-bottom: 8px; }
.knowledge-card p { font-size: 14px; color: var(--text-gray); line-height: 1.6; }
.profile-section { margin-bottom: 24px; }
.profile-section h3 { font-size: 14px; color: var(--text-gray); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.profile-item { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border-color); }
.profile-item:last-child { border-bottom: none; }
.profile-item .label { color: var(--text-gray); }
.profile-item .value { font-weight: 500; cursor: pointer; }
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); z-index: 200; align-items: flex-end; justify-content: center; overflow-x: hidden; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); z-index: 200; align-items: flex-end; justify-content: center; overflow-x: hidden; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal.active { display: flex; }
.modal-overlay.active { display: flex; }



/* 支付弹窗专用触摸边界：遮罩阻止背景手势，内容区仍允许正常滚动与点击。 */
#global-modal.stripe-payment-modal-open {
    overflow: hidden;
    overscroll-behavior: contain;
    touch-action: none;
}
#global-modal.stripe-payment-modal-open .modal-content {
    touch-action: pan-y;
    overscroll-behavior: contain;
}
html.stripe-payment-modal-open,
body.stripe-payment-modal-open {
    overscroll-behavior: none;
}
.modal-content {
    background: linear-gradient(180deg, hsl(213, 35%, 18%) 0%, var(--card-bg) 100%);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    max-height: calc(var(--tg-viewport-stable-height) * 0.85);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 20px 20px;
    padding-bottom: calc(20px + var(--safe-area-bottom));
    box-sizing: border-box;
    position: relative;
    border: 1px solid var(--border-color);
    border-bottom: none;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
    -webkit-overflow-scrolling: touch;
    animation: modalSlideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Top grabber indicator */
.modal-content::before {
    content: '';
    position: sticky;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-bottom: 8px;
    flex-shrink: 0;
    z-index: 10;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    background: linear-gradient(180deg, hsl(213, 35%, 18%) 0%, hsl(213, 35%, 17%) 100%);
    padding: 12px 16px 14px;
    z-index: 5;
}
.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}
.modal-back {
    background: transparent;
    border: none;
    color: var(--text-white);
    width: 32px;
    height: 32px;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
}

.modal-back:active {
    background: rgba(0, 255, 136, 0.12);
    color: var(--accent-green);
    transform: scale(0.9);
    opacity: 1;
}

.modal-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 96px);
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    padding: 0;
    pointer-events: none;
}
.modal-close {
    background: transparent;
    border: none;
    color: var(--text-white);
    width: 32px;
    height: 32px;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
}

.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

.modal-close::before {
    transform: rotate(45deg);
}

.modal-close::after {
    transform: rotate(-45deg);
}

.modal-close:active {
    background: rgba(0, 255, 136, 0.12);
    color: var(--accent-green);
    transform: scale(0.9);
    opacity: 1;
}

/* Modal body scroll area */
.modal-body {
    padding-bottom: 20px;
}

/* Modal actions / button group */
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    position: sticky;
    bottom: 0;
    padding-top: 16px;
    background: linear-gradient(180deg, transparent 0%, var(--card-bg) 20%);
    padding-bottom: calc(20px + var(--safe-area-bottom));
    z-index: 5;
}

.modal-actions .modal-btn {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--accent-green), #00CC6A);
    color: var(--primary-dark);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.25);
}

.modal-btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.2);
}

.modal-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
    border: 1px solid var(--border-color);
}

.modal-btn-secondary:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.12);
}

.modal-btn-danger {
    background: linear-gradient(135deg, var(--accent-red), #E03E4A);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.25);
}

.modal-btn-danger:active {
    transform: scale(0.97);
}

/* Full-screen modal variant (for product detail, knowledge detail etc.) */
.modal-fullscreen .modal-content {
    max-height: 100vh;
    max-height: var(--tg-viewport-stable-height);
    height: 100%;
    border-radius: 0;
    padding-top: calc(var(--app-top-inset) + 12px);
}

/* Form inputs inside modal */
.modal-input, .modal-select {
    width: 100%;
    padding: 14px 16px;
    background: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-white);
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.modal-input:focus, .modal-select:focus {
    outline: none;
    border-color: var(--accent-green);
}

.modal-label {
    display: block;
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 8px;
    font-weight: 500;
}

/* Result / status modal */
.result-modal {
    text-align: center;
    padding: 20px 16px;
}

.result-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.result-icon.success {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 255, 136, 0.05));
}
.result-icon.success svg { stroke: var(--accent-green); }

.result-icon.error {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.2), rgba(255, 71, 87, 0.05));
}
.result-icon.error svg { stroke: var(--accent-red); }

.result-icon.warning {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 107, 53, 0.05));
}
.result-icon.warning svg { stroke: var(--accent-orange); }

.result-icon.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.05));
}
.result-icon.info svg { stroke: #3B82F6; }

.result-icon svg {
    width: 36px;
    height: 36px;
}

.result-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-desc {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 0;
    display: none;
}
.modal-content {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Points history items */
.points-history-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.points-history-item:last-child {
    border-bottom: none;
}
.points-history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}
.points-history-type {
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}
.points-history-change {
    text-align: right;
    white-space: nowrap;
    font-weight: 700;
    font-size: 16px;
}
.points-history-change.positive { color: var(--accent-green); }
.points-history-change.negative { color: var(--accent-red); }
.points-history-reason {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 6px;
    line-height: 1.5;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-all;
}
.points-history-date {
    font-size: 12px;
    color: var(--text-gray);
    opacity: 0.8;
}
.points-history-balance {
    font-size: 12px;
    color: var(--text-gray);
    margin-top: 4px;
    opacity: 0.8;
}

/* Terms of Service modal */
.terms-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}
.terms-warning {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 20px;
    text-align: center;
}
.terms-warning-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}
.terms-warning-desc {
    font-size: 13px;
    opacity: 0.95;
}
.terms-section-title {
    color: var(--text-white);
    margin: 24px 0 10px;
    font-size: 15px;
    font-weight: 600;
}
.terms-section-title:first-of-type {
    margin-top: 0;
}
.terms-content p {
    margin: 0 0 10px;
    color: var(--text-gray);
    line-height: 1.7;
}
.terms-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-gray);
    font-size: 12px;
    opacity: 0.8;
}
.toast { position: fixed; bottom: calc(100px + var(--safe-area-bottom)); left: 50%; transform: translateX(-50%); background: #4CAF50; color: white; padding: 12px 24px; border-radius: 8px; font-size: 14px; z-index: 2147483647; pointer-events: auto; opacity: 0; transition: opacity 0.3s; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; }
.toast.error { background: #f44336; }
.toast.clickable { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.toast.clickable:active { opacity: 0.8; transform: translateX(-50%) scale(0.98); }
.btn-primary { width: 100%; padding: 14px; background: var(--accent-green); color: var(--primary-dark); border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; transition: transform 0.2s; box-sizing: border-box; }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary { width: 100%; padding: 14px; background: transparent; color: var(--text-white); border: 1px solid var(--border-color); border-radius: 12px; font-size: 16px; font-weight: 500; cursor: pointer; margin-top: 12px; box-sizing: border-box; }
.history-list { margin-top: 20px; }
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border-color); transition: transform 0.3s ease; background: var(--primary-bg); }
.history-item:last-child { border-bottom: none; }
.history-item-wrapper { position: relative; overflow: hidden; display: flex; justify-content: flex-end; }
.history-item-actions { position: absolute; right: 0; top: 0; bottom: 0; display: flex; width: 120px; z-index: 1; transform: translateX(100%); transition: transform 0.3s ease; }
.history-item-wrapper.slided .history-item-actions { transform: translateX(0); }
.history-item-wrapper.slided .history-item { transform: translateX(-120px); }
.history-item { position: relative; z-index: 2; flex: 1; transition: transform 0.3s ease; }
.action-edit, .action-delete { border: none; padding: 0 20px; font-size: 14px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; height: 100%; }
.action-edit { background: #4CAF50; color: white; }
.action-delete { background: #f44336; color: white; }
.history-drink { display: flex; align-items: center; gap: 12px; }
.history-drink-icon { width: 40px; height: 40px; background: var(--primary-dark); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.history-time { font-size: 12px; color: var(--text-gray); }
.history-amount { font-weight: 600; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-gray); }
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.5; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.page.active { animation: fadeIn 0.3s ease; }
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; width: 100%; max-width: 100%; }
.product-card { background: var(--card-bg); border-radius: 12px; padding: 12px; border: 1px solid var(--border-color); display: flex; flex-direction: column; cursor: pointer; min-width: 0; overflow: hidden; }
.product-image { width: 100%; aspect-ratio: 1 / 1; background: var(--primary-dark); border-radius: 8px; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; color: var(--text-gray); font-size: 12px; overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-points { font-size: 12px; color: var(--accent-green); font-weight: 600; margin-bottom: 4px; word-break: break-word; }
.product-stock { font-size: 11px; color: var(--text-gray); margin-bottom: 8px; }
.product-redeem-btn { width: 100%; padding: 8px; background: var(--accent-green); color: var(--primary-dark); border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: transform 0.2s, opacity 0.2s; white-space: nowrap; }
.product-redeem-btn:active { transform: scale(0.98); }
.product-redeem-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.product-cart-btn, .product-share-btn { flex-shrink: 0; }
.points-header { background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark)); border-radius: 16px; padding: 20px; margin-bottom: 16px; border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.points-header-label { font-size: 12px; color: var(--text-gray); margin-bottom: 4px; }
.points-header-value { font-size: 32px; font-weight: 700; color: var(--accent-green); }
.points-header-unit { font-size: 14px; color: var(--text-gray); font-weight: 400; margin-left: 4px; }
.order-item { background: var(--primary-dark); border-radius: 12px; padding: 16px; margin-bottom: 12px; border: 1px solid var(--border-color); max-width: 100%; overflow: hidden; }
.order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.order-body { display: flex; }
.order-product-image { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; margin-right: 12px; background: var(--card-bg); flex-shrink: 0; }
.order-product-image-placeholder { width: 60px; height: 60px; border-radius: 8px; margin-right: 12px; background: var(--bg-secondary); border: 1px dashed var(--border-color); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-gray); font-size: 22px; }
.order-detail-image-placeholder { width: 60px; height: 60px; border-radius: 8px; background: var(--bg-secondary); border: 1px dashed var(--border-color); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-gray); font-size: 22px; }
.order-product-info { flex: 1; min-width: 0; overflow: hidden; }
.order-product-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-product-points { font-size: 12px; color: var(--accent-green); margin-bottom: 4px; }
.order-product-type { font-size: 11px; color: var(--text-gray); }
.order-footer { border-top: 1px dashed var(--border-color); padding-top: 12px; margin-top: 12px; color: var(--text-gray); font-size: 12px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.badge-warning { background: #f59e0b20; color: #f59e0b; }
.badge-info { background: #3b82f620; color: #3b82f6; }
.badge-success { background: #10b98120; color: #10b981; }
.badge-error { background: #ef444420; color: #ef4444; }

/* 全屏弹窗通用头部（固定定位，不跟随内容滚动） */
.fullscreen-modal-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 0 16px;
    padding-top: calc(60px + var(--app-top-inset));
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.fullscreen-modal-header > * {
    pointer-events: auto;
}
.fullscreen-modal-back,
.fullscreen-modal-close {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.fullscreen-modal-back:active,
.fullscreen-modal-close:active {
    transform: scale(0.92);
    background: rgba(0, 0, 0, 0.8);
}
.fullscreen-modal-title {
    flex: 1;
    text-align: center;
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7), 0 0 12px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-detail-carousel { width: 100%; aspect-ratio: 1 / 1; position: relative; background: var(--primary-dark); }
.product-detail-carousel .carousel-container { width: 100%; height: 100%; }
.product-detail-carousel .carousel-slide { width: 100%; height: 100%; flex-shrink: 0; scroll-snap-align: start; }
.product-detail-carousel .carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-counter { position: absolute; bottom: 12px; right: 12px; background: rgba(0,0,0,0.6); color: white; padding: 4px 10px; border-radius: 12px; font-size: 12px; }
.product-detail-info { padding: 16px; }
.product-detail-points { font-size: 24px; font-weight: 700; color: var(--accent-green); margin-bottom: 8px; }
.product-detail-title { font-size: 18px; font-weight: 600; margin-bottom: 12px; line-height: 1.4; }
.product-detail-meta { display: flex; gap: 12px; margin-bottom: 16px; }
.product-detail-meta .badge { font-size: 12px; }
.product-detail-desc { font-size: 14px; color: var(--text-gray); line-height: 1.6; margin-bottom: 20px; }
.product-detail-images { margin-top: 20px; }
.product-detail-images img { display: block; width: 100%; margin: 0; }
.product-detail-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    padding-bottom: calc(12px + var(--safe-area-bottom) + var(--tg-main-button-height, 0px));
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    z-index: 100;
}
.product-detail-cart-btn { width: 48px; height: 48px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--primary-dark); color: var(--text-white); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.product-detail-cart-btn:active { opacity: 0.7; }
.product-detail-btn { padding: 14px 32px; border: none; border-radius: 24px; font-size: 16px; font-weight: 600; cursor: pointer; flex: 1; }
.product-detail-btn.points { background: var(--accent-green); color: var(--primary-dark); }
.product-detail-btn.cash { background: #ef4444; color: white; }
.product-detail-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.carousel-container { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; width: 100%; position: relative; }
.carousel-container::-webkit-scrollbar { display: none; }
.carousel-slide { flex-shrink: 0; width: 100%; scroll-snap-align: start; }
.carousel-slide img { width: 100%; height: auto; object-fit: cover; display: block; max-height: 500px; }
.image-counter { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.6); color: white; padding: 4px 12px; border-radius: 12px; font-size: 12px; z-index: 10; pointer-events: none; backdrop-filter: blur(4px); }
.carousel-wrapper { position: relative; }
.knowledge-detail-card { background: var(--card-bg); border-radius: 16px; overflow: hidden; margin: 0 16px 16px 16px; border: 1px solid var(--border-color); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.image-preview-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.95); z-index: 10300; align-items: center; justify-content: center; }
.image-preview-modal.active { display: flex; }
.image-preview-modal img { max-width: 100%; max-height: 100%; object-fit: contain; }
.image-preview-back { position: absolute; top: 100px; left: 20px; background: none; border: none; color: white; font-size: 28px; cursor: pointer; z-index: 10301; padding: 10px; opacity: 0.8; transition: opacity 0.2s; }
.image-preview-back:active { opacity: 1; }
.image-preview-close { position: absolute; top: 100px; right: 20px; background: none; border: none; color: white; font-size: 32px; cursor: pointer; z-index: 10301; padding: 10px; }
.detail-section { background: var(--primary-dark); border-radius: 12px; padding: 16px; }
.detail-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.detail-row:last-child { margin-bottom: 0; }
.detail-label { color: var(--text-gray); font-size: 14px; min-width: 80px; }
.detail-value { color: var(--text-primary); font-size: 14px; text-align: right; word-break: break-all; flex: 1; margin-left: 12px; }

.cart-item { display: flex; align-items: stretch; padding: 12px; margin-bottom: 12px; background: var(--card-bg); border-radius: 8px; border: 1px solid var(--border-color); position: relative; max-width: 100%; overflow: hidden; }
.cart-item-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-right: 12px; }
.cart-item-right { display: flex; flex-direction: column; justify-content: space-between; flex-grow: 1; min-width: 0; padding-right: 30px; overflow: hidden; }
.cart-item-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.cart-item-checkbox { width: 20px; height: 20px; accent-color: var(--accent-green); flex-shrink: 0; cursor: pointer; }
.cart-item-image { width: 70px; height: 70px; border-radius: 8px; object-fit: cover; background: var(--primary-dark); flex-shrink: 0; }
.cart-item-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; line-height: 1.4; word-break: break-word; }
.cart-item-price { font-size: 14px; color: var(--accent-green); font-weight: 600; }
.cart-item-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cart-item-qty { width: 40px; height: 32px; text-align: center; background: #f5f5f5; border: none; border-radius: 4px; color: #333; font-size: 14px; }
.cart-item-btn { min-width: 32px; min-height: 32px; padding: 0 8px; background: #f5f5f5; border: none; border-radius: 4px; color: #333; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.cart-item-delete { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; background: none; border: none; color: var(--accent-red); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }

#user-avatar-container { flex-shrink: 0; }
#user-avatar-img { transition: opacity 0.3s ease; }
#user-avatar-fallback { transition: opacity 0.3s ease; }

@media (max-width: 480px) {
    #user-avatar-container {
        width: 48px !important;
        height: 48px !important;
    }
    #user-avatar-fallback {
        font-size: 20px !important;
    }
}

.order-shop-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

.order-shop-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 4px;
    background: var(--primary-dark);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    min-width: 0;
    overflow: hidden;
}

.order-shop-item:active {
    transform: scale(0.95);
    background: var(--border-color);
}

.order-shop-icon {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-shop-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--accent-green);
}

.order-shop-label {
    font-size: 11px;
    color: var(--text-white);
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-badge-icon {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--accent-red);
    color: white;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 活动领取相关样式 */
.activity-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-green), #00CC6A);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 24px;
}

.activity-icon svg {
    width: 40px;
    height: 40px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.activity-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 12px;
    text-align: center;
}

.activity-desc {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.5;
}

.status-message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.status-message.error {
    background-color: rgba(255, 107, 107, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.status-message.success {
    background-color: rgba(0, 204, 106, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(0, 204, 106, 0.3);
}

.claim-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.claim-btn.primary {
    background-color: var(--accent-green);
    color: var(--primary-dark);
}

.claim-btn.primary:hover {
    background-color: #00CC6A;
}

.claim-btn.secondary {
    background-color: var(--primary-dark);
    color: var(--text-white);
    border: 1px solid var(--border-color);
}

.claim-btn.secondary:hover {
    background-color: var(--border-color);
}

.claim-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-group {
    display: flex;
    gap: 12px;
}

.btn-group .claim-btn {
    flex: 1;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary-dark);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Profile Page Redesign
   ============================================ */

.profile-page {
    animation: profileFadeIn 0.5s ease-out;
}

@keyframes profileFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Profile Header Card */
.profile-header-card {
    position: relative;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15) 0%, rgba(30, 58, 95, 0.8) 50%, rgba(10, 22, 40, 0.9) 100%);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 255, 136, 0.2);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.profile-header-glow {
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.profile-user-row {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.profile-avatar-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.profile-avatar-ring {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green), #00CC6A, var(--accent-green));
    background-size: 200% 200%;
    animation: ringRotate 3s linear infinite;
}

@keyframes ringRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.profile-avatar-img {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: none;
    z-index: 1;
    border: 3px solid var(--primary-dark);
}

.profile-avatar-fallback {
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green), #00CC6A);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-dark);
    z-index: 1;
}

.profile-user-info {
    flex: 1;
    min-width: 0;
}

.profile-user-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-white);
    letter-spacing: 0.3px;
}

.profile-user-id {
    font-size: 12px;
    color: var(--text-gray);
    opacity: 0.8;
}

/* Stats Row */
.profile-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.profile-stat-card {
    background: rgba(10, 22, 40, 0.6);
    border: 1px solid rgba(0, 255, 136, 0.15);
    border-radius: 14px;
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.profile-stat-card:active {
    transform: scale(0.96);
    background: rgba(0, 255, 136, 0.1);
}

.profile-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-green);
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

.profile-stat-value.streak-value {
    color: var(--accent-orange);
}

.profile-stat-value.longest-value {
    color: #A855F7;
}

.profile-stat-label {
    font-size: 11px;
    color: var(--text-gray);
    opacity: 0.9;
}

/* Points Button */
.profile-points-btn {
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-green), #00CC6A);
    color: var(--primary-dark);
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
}

.profile-points-btn svg {
    width: 18px;
    height: 18px;
}

.profile-points-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 10px rgba(0, 255, 136, 0.2);
}

/* Section Title */
.profile-section {
    margin-bottom: 20px;
}

.profile-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding-left: 4px;
    opacity: 0.8;
}

/* Profile Card (replaces .card in profile) */
.profile-card {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 4px 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Order Shop Grid - Enhanced */
.order-shop-grid {
    padding: 12px 0;
}

.order-shop-item {
    background: transparent;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 10px 4px;
}

.order-shop-item:active {
    transform: scale(0.92);
    background: rgba(0, 255, 136, 0.1);
}

.order-shop-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.orders-icon {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 255, 136, 0.05));
}

.orders-icon svg { stroke: var(--accent-green); }

.cart-icon {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 107, 53, 0.05));
}

.cart-icon svg { stroke: var(--accent-orange); }

.coupon-icon {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.05));
}

.coupon-icon svg { stroke: #A855F7; }

.address-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.05));
}

.address-icon svg { stroke: #3B82F6; }

.order-shop-icon svg {
    width: 22px;
    height: 22px;
}

.order-shop-label {
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

/* Profile List Items */
.profile-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-decoration: none;
    color: inherit;
}

a.profile-list-item:hover {
    text-decoration: none;
    color: inherit;
}

.profile-list-item:last-child {
    border-bottom: none;
}

.profile-list-item:active {
    background: rgba(0, 255, 136, 0.05);
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
}

.profile-list-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.profile-list-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-list-icon svg {
    width: 18px;
    height: 18px;
}

.gender-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.05));
}
.gender-icon svg { stroke: #3B82F6; }

.weight-icon {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(255, 107, 53, 0.05));
}
.weight-icon svg { stroke: var(--accent-orange); }

.height-icon {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.05));
}
.height-icon svg { stroke: #A855F7; }

.export-icon {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 255, 136, 0.05));
}
.export-icon svg { stroke: var(--accent-green); }

.admin-icon {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 255, 136, 0.05));
}
.admin-icon svg { stroke: var(--accent-green); }

.admin-label {
    color: var(--accent-green) !important;
    font-weight: 600;
}

.version-icon {
    background: linear-gradient(135deg, rgba(142, 153, 164, 0.2), rgba(142, 153, 164, 0.05));
}
.version-icon svg { stroke: var(--text-gray); }

.social-icon {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(236, 72, 153, 0.05));
}
.social-icon svg { stroke: #EC4899; }

.terms-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.05));
}
.terms-icon svg { stroke: #3B82F6; }

.logout-icon {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.2), rgba(255, 71, 87, 0.05));
}
.logout-icon svg { stroke: var(--accent-red); }

.profile-list-label {
    font-size: 15px;
    color: var(--text-white);
    font-weight: 500;
}

.profile-list-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.profile-list-value {
    font-size: 14px;
    color: var(--text-gray);
    font-weight: 500;
}

.profile-list-arrow {
    width: 18px;
    height: 18px;
    color: var(--text-gray);
    opacity: 0.5;
    flex-shrink: 0;
}

/* Logout Item */
.logout-item .profile-list-label {
    color: var(--accent-red);
}

/* Staggered animation for profile sections */
.profile-page .profile-section:nth-child(1) { animation-delay: 0.05s; }
.profile-page .profile-section:nth-child(2) { animation-delay: 0.1s; }
.profile-page .profile-section:nth-child(3) { animation-delay: 0.15s; }
.profile-page .profile-section:nth-child(4) { animation-delay: 0.2s; }
.profile-page .profile-section:nth-child(5) { animation-delay: 0.25s; }
.profile-page .profile-section:nth-child(6) { animation-delay: 0.3s; }

/* Badge enhancements */
.cart-badge-icon {
    top: -4px;
    right: -6px;
    background: var(--accent-red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--card-bg);
}

/* Responsive */
@media (max-width: 360px) {
    .profile-stat-value {
        font-size: 18px;
    }
    .profile-stat-label {
        font-size: 10px;
    }
    .profile-avatar-wrap {
        width: 60px;
        height: 60px;
    }
    .profile-user-name {
        font-size: 18px;
    }
}

/* 通知始终位于业务浮层上方；小尺寸提示不影响弹窗主体操作。 */

/* 待付款订单入口与数量角标 */
.pending-payment-icon {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.24), rgba(255, 107, 53, 0.08));
}

.pending-payment-icon svg {
    stroke: var(--accent-orange);
}

.pending-payment-badge {
    border-color: var(--card-bg);
}

/* Shipping address form: calm, integrated bottom-sheet treatment */
.address-form-sheet {
    background: linear-gradient(180deg, hsl(213, 35%, 18%) 0%, var(--card-bg) 24%) !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}
.address-form-sheet .address-form-header {
    padding: 4px 0 14px;
    margin-bottom: 2px;
    background: transparent;
}
.address-form-sheet .modal-title {
    font-size: 18px;
    letter-spacing: 0.01em;
}
.address-form-body {
    padding: 2px 1px 8px;
    overscroll-behavior: contain;
}
.address-form-body > div[style*="margin-bottom: 12px"] {
    margin-bottom: 14px !important;
}
.address-form-body label {
    color: rgba(226, 232, 240, 0.78) !important;
    font-size: 13px !important;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.address-form-body .form-input {
    min-height: 48px;
    padding: 12px 14px;
    background: rgba(5, 18, 35, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    color: var(--text-white);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.address-form-body .form-input:focus {
    background: rgba(5, 18, 35, 0.94);
    border-color: rgba(45, 212, 191, 0.7);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12);
    outline: none;
}
.address-form-body .form-input::placeholder {
    color: rgba(148, 163, 184, 0.72);
}
.address-paste-card {
    margin: 0 0 20px !important;
    padding: 14px !important;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.13), rgba(14, 165, 233, 0.08)) !important;
    border: 1px solid rgba(45, 212, 191, 0.22) !important;
    border-radius: 14px !important;
}
.address-paste-title {
    color: #8ee9dc !important;
    font-size: 13px !important;
    letter-spacing: 0.01em;
}
.address-paste-row {
    align-items: stretch;
}
.address-paste-row .form-input {
    min-width: 0;
    min-height: 44px;
    background: rgba(5, 18, 35, 0.82);
}
.address-paste-row button {
    min-width: 68px;
    padding: 0 14px !important;
    background: rgba(45, 212, 191, 0.9) !important;
    border-radius: 10px !important;
    color: #06202a !important;
    font-weight: 700;
    transition: transform 0.2s ease, filter 0.2s ease;
}
.address-paste-row button:active {
    transform: scale(0.97);
    filter: brightness(0.94);
}
.address-paste-hint {
    color: rgba(153, 246, 228, 0.76) !important;
    line-height: 1.45;
}
.address-form-body input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 2px solid rgba(148, 163, 184, 0.58);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.address-form-body input[type="radio"]:checked {
    border-color: var(--accent-green);
    box-shadow: inset 0 0 0 4px var(--card-bg), inset 0 0 0 8px var(--accent-green);
}
.address-form-body input[type="radio"] + span {
    color: rgba(226, 232, 240, 0.9);
    font-size: 13px;
}
#address-is-default {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent-green);
}
#address-is-default + span {
    color: rgba(226, 232, 240, 0.86) !important;
}
.address-form-footer {
    padding: 16px 1px calc(4px + var(--safe-area-bottom)) !important;
    border-top-color: rgba(148, 163, 184, 0.14) !important;
    background: linear-gradient(180deg, rgba(25, 42, 61, 0), var(--card-bg) 32%);
}
.address-save-button {
    min-height: 50px;
    border-radius: 14px !important;
    box-shadow: 0 10px 24px rgba(45, 212, 191, 0.2);
    transition: transform 0.2s ease, filter 0.2s ease;
}
.address-save-button:active {
    transform: translateY(1px) scale(0.99);
    filter: brightness(0.96);
}
@media (max-width: 380px) {
    .address-paste-row { flex-direction: column; }
    .address-paste-row button { min-height: 42px; }
}

/* 商品详情：视觉图库与购买操作层级 */
.product-detail-page {
    padding-bottom: 148px;
}
/* 独立商品页已有固定购买条预留；不能再沿用旧弹窗的 148px 占位。 */
body.seo-page.seo-product-page[data-telegram-runtime="mini_app"] .product-detail-page {
    padding-bottom: 0;
}
body.seo-page.seo-product-page[data-telegram-runtime="mini_app"] .product-related-section {
    margin-top: 20px;
}
.product-detail-layout {
    display: block;
}
.product-detail-visual {
    min-width: 0;
}
.product-visual-gallery {
    width: 100%;
}
.product-detail-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 16px 4px;
    scrollbar-width: thin;
}
.product-detail-thumbnail {
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-bg);
    cursor: pointer;
    opacity: 0.62;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.product-detail-thumbnail.active {
    border-color: var(--accent-green);
    opacity: 1;
}
.product-detail-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-detail-stock {
    color: var(--text-gray);
    font-size: 12px;
}
.product-detail-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}
.product-detail-quantity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.product-detail-quantity-label {
    color: var(--text-gray);
    font-size: 14px;
}
.product-detail-quantity-control {
    display: grid;
    grid-template-columns: repeat(3, 38px);
    width: 114px;
    min-width: 114px;
    max-width: 114px;
    height: 38px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--primary-dark);
}
.product-detail-quantity-control button,
.product-detail-quantity-control span {
    box-sizing: border-box;
    display: grid;
    width: 38px;
    min-width: 0;
    height: 100%;
    place-items: center;
    margin: 0;
    padding: 0;
}
.product-detail-quantity-control button {
    border: 0;
    background: transparent;
    color: var(--text-white);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.product-detail-quantity-control button:active {
    background: rgba(255, 255, 255, 0.08);
}
.product-detail-quantity-control span {
    border-inline: 1px solid var(--border-color);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.product-detail-action-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.product-detail-action-row .product-detail-cart-btn,
.product-detail-action-row .product-detail-share-btn {
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--primary-dark);
    color: var(--text-white);
    cursor: pointer;
}
.product-detail-action-row .product-detail-cart-btn svg,
.product-detail-action-row .product-detail-share-btn svg {
    width: 21px;
    height: 21px;
}
.product-detail-action-row .product-detail-btn {
    min-height: 46px;
}

@media (min-width: 960px) {
    .product-detail-page {
        box-sizing: border-box;
        min-height: 100%;
        padding: 44px 48px 48px;
    }
    .product-detail-layout {
        display: grid;
        grid-template-columns: minmax(440px, 1.05fr) minmax(380px, 0.95fr);
        align-items: start;
        gap: clamp(36px, 5vw, 72px);
    }
    .product-detail-visual {
        position: sticky;
        top: 0;
    }
    .product-detail-carousel {
        border: 1px solid var(--border-color);
        border-radius: 18px;
        overflow: hidden;
        box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
    }
    .product-detail-carousel .carousel-container {
        overflow: hidden;
        scroll-snap-type: x mandatory;
    }
    .product-detail-counter {
        right: 16px;
        bottom: 16px;
    }
    .product-detail-thumbnails {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 10px;
        overflow: visible;
        padding: 14px 0 0;
    }
    .product-detail-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        border-radius: 12px;
    }
    .product-detail-thumbnail:hover {
        border-color: rgba(94, 234, 212, 0.8);
        opacity: 1;
        transform: translateY(-2px);
    }
    .product-detail-info {
        padding: 4px 0 0;
    }
    .product-detail-title {
        font-size: clamp(24px, 2.1vw, 30px);
        line-height: 1.28;
        letter-spacing: -0.02em;
        margin-bottom: 12px;
    }
    .product-detail-price,
    .product-detail-points {
        font-size: 30px;
        margin-bottom: 14px;
    }
    .product-detail-meta {
        align-items: center;
        padding-bottom: 18px;
        margin-bottom: 20px;
        border-bottom: 1px solid var(--border-color);
    }
    .product-detail-desc {
        margin: 22px 0;
        font-size: 15px;
        line-height: 1.75;
    }
    .product-detail-footer {
        position: static;
        margin: 24px 0 0;
        padding: 20px;
        border: 1px solid var(--border-color);
        border-radius: 16px;
        background: color-mix(in srgb, var(--card-bg) 92%, transparent);
        box-shadow: none;
    }
    .product-detail-quantity {
        padding-bottom: 14px;
        border-bottom: 1px solid var(--border-color);
    }
    .product-detail-quantity-label {
        font-size: 15px;
        font-weight: 600;
        color: var(--text-white);
    }
    .product-detail-quantity-control {
        grid-template-columns: repeat(3, 42px);
        width: 126px;
        min-width: 126px;
        max-width: 126px;
        height: 42px;
    }
    .product-detail-quantity-control button,
    .product-detail-quantity-control span {
        width: 42px;
    }
    .product-detail-action-row {
        gap: 12px;
    }
    .product-detail-action-row .product-detail-cart-btn,
    .product-detail-action-row .product-detail-share-btn {
        width: 52px;
        height: 52px;
        transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    }
    .product-detail-action-row .product-detail-cart-btn:hover,
    .product-detail-action-row .product-detail-share-btn:hover {
        border-color: var(--accent-green);
        background: rgba(94, 234, 212, 0.08);
        transform: translateY(-1px);
    }
    .product-detail-action-row .product-detail-btn {
        min-height: 52px;
        border-radius: 14px;
        font-size: 16px;
    }
    .product-detail-images {
        margin-top: 28px;
        padding-top: 24px;
        border-top: 1px solid var(--border-color);
    }
    .product-detail-images img {
        border-radius: 14px;
        overflow: hidden;
        margin-bottom: 12px;
    }
}


/* PC 商城：提高商品展示密度，同时保持卡片信息与操作区可读 */
@media (min-width: 960px) {
    #mall.page {
        max-width: 1760px;
        margin-inline: auto;
        padding: 28px clamp(28px, 3vw, 52px) calc(var(--tabbar-height) + 28px);
    }
    #mall .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
        gap: 16px;
        margin-top: 20px;
    }
    #mall .product-card {
        min-height: 0;
        padding: 10px;
        border-radius: 14px;
        transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }
    #mall .product-card:hover {
        transform: translateY(-3px);
        border-color: color-mix(in srgb, var(--accent-green) 65%, var(--border-color));
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    }
    #mall .product-image {
        margin-bottom: 9px;
        border-radius: 10px;
    }
    #mall .product-name {
        font-size: 14px;
        line-height: 1.35;
    }
    #mall .product-points {
        font-size: 13px;
    }
    #mall .product-stock {
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
    }
    #mall .product-card > div:last-child {
        margin-top: auto;
        gap: 8px !important;
    }
    #mall .product-redeem-btn {
        padding: 8px 10px;
    }
}
@media (min-width: 1440px) {
    #mall .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
        gap: 18px;
    }
}


/* PC 知识页：多列瀑布流，提高内容浏览密度 */
@media (min-width: 960px) {
    #insights.page {
        max-width: 1760px;
        margin-inline: auto;
        padding: 28px clamp(28px, 3vw, 52px) calc(var(--tabbar-height) + 28px);
    }
    #insights .knowledge-list {
        display: block;
    }
    #insights .masonry-grid {
        column-count: 4;
        column-gap: 16px;
        margin-top: 20px;
    }
    #insights .masonry-item {
        display: inline-block;
        width: 100%;
        box-sizing: border-box;
        break-inside: avoid-column;
        page-break-inside: avoid;
        margin-bottom: 16px;
        border-radius: 14px;
        outline: 1px solid transparent;
        outline-offset: -1px;
        transition: border-color 0.14s ease, outline-color 0.14s ease;
    }
    #insights .masonry-item:hover {
        border-color: color-mix(in srgb, var(--accent-green) 65%, var(--border-color));
        outline-color: rgba(94, 234, 212, 0.42);
    }
    #insights .masonry-item .card-info {
        padding: 12px;
    }
    #insights .masonry-item .card-title {
        font-size: 15px;
        line-height: 1.4;
        margin-bottom: 8px;
    }
    #insights .masonry-item .card-footer {
        margin-top: 10px;
    }
}
@media (min-width: 1280px) {
    #insights .masonry-grid {
        column-count: 5;
        column-gap: 18px;
    }
    #insights .masonry-item {
        margin-bottom: 18px;
    }
}
@media (min-width: 1600px) {
    #insights .masonry-grid {
        column-count: 6;
    }
}



/* ============================================================
   商城首页新模块样式
   ============================================================ */

/* --- 搜索栏 --- */
.mall-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #FF4757 0%, #FF6B35 100%);
    position: sticky;
    top: var(--header-height);
    z-index: 100;
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 0 14px;
    height: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: #999;
    flex-shrink: 0;
    margin-right: 8px;
}

.mall-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    height: 100%;
}

.mall-search-input::placeholder {
    color: #bbb;
}

.search-clear-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: #ddd;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.search-clear-btn svg {
    width: 12px;
    height: 12px;
    color: #fff;
}

.search-btn {
    height: 40px;
    padding: 0 20px;
    border: none;
    border-radius: 20px;
    background: #fff;
    color: #FF4757;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-btn:active {
    transform: scale(0.95);
}

/* --- 搜索建议下拉 --- */
.search-suggestions {
    position: absolute;
    top: calc(var(--header-height) + 64px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 99;
    max-height: 400px;
    overflow-y: auto;
}

.search-suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.search-suggestions-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.search-clear-history {
    border: none;
    background: none;
    color: #999;
    font-size: 12px;
    cursor: pointer;
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    gap: 12px;
}

.search-suggestion-item:hover,
.search-suggestion-item:active {
    background: #f8f8f8;
}

.search-suggestion-icon {
    width: 20px;
    height: 20px;
    color: #ccc;
    flex-shrink: 0;
}

.search-suggestion-text {
    flex: 1;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-suggestion-hot {
    background: linear-gradient(135deg, #FF6B35, #FF4757);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* --- 搜索结果区域 --- */
.search-results-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: calc(var(--header-height) + 64px);
    z-index: 50;
}

.search-back-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-back-btn svg {
    width: 20px;
    height: 20px;
}

.search-results-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-sort-select {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-white);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
}

.search-results-grid {
    padding: 12px;
}

/* --- 轮播 Banner --- */
.mall-banner-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 12px 0;
    border-radius: 12px;
}

.banner-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.banner-slide {
    flex-shrink: 0;
    width: 100%;
    position: relative;
    cursor: pointer;
}

.banner-slide img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.banner-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.banner-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-dot.active {
    width: 20px;
    border-radius: 3px;
    background: #fff;
}

.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mall-banner-carousel:hover .banner-arrow {
    opacity: 1;
}

.banner-arrow svg {
    width: 18px;
    height: 18px;
}

.banner-prev {
    left: 10px;
}

.banner-next {
    right: 10px;
}

/* --- 通知提示栏 --- */
.mall-notification-bar {
    margin: 0 12px 12px;
    border-radius: 10px;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

.notification-bar-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 10px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.notification-bar-item:active {
    opacity: 0.8;
}

.notification-bar-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.notification-bar-text {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-bar-item.marquee .notification-bar-text {
    animation: marquee 10s linear infinite;
    white-space: nowrap;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* --- 商品分类图标入口 --- */
.mall-category-icons {
    padding: 8px 0 16px;
    overflow: hidden;
}

.category-icons-scroll {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 8px 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-icons-scroll::-webkit-scrollbar {
    display: none;
}

.category-icon-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    width: 70px;
    transition: transform 0.2s ease;
}

.category-icon-item:active {
    transform: scale(0.95);
}

.category-icon-image {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-icon-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-icon-image .category-icon-placeholder {
    font-size: 24px;
}

.category-icon-name {
    font-size: 12px;
    color: var(--text-gray);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

/* --- 区块标题 --- */
.mall-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-white);
    padding: 8px 16px 12px;
    margin: 0;
}

/* ============================================================
   响应式适配 - PC 端
   ============================================================ */

@media (min-width: 960px) {
    /* 搜索栏 PC 端调整 */
    .mall-search-bar {
        padding: 16px 24px;
        max-width: 960px;
        margin: 0 auto;
        border-radius: 0;
    }

    .search-input-wrapper {
        height: 44px;
    }

    .search-btn {
        height: 44px;
        padding: 0 24px;
    }

    /* 搜索建议下拉 PC 端调整 */
    .search-suggestions {
        top: calc(var(--header-height) + 76px);
        max-width: 960px;
        margin: 0 auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        border-radius: 0 0 12px 12px;
    }

    /* 搜索结果 PC 端调整 */
    .search-results-header {
        top: calc(var(--header-height) + 76px);
        max-width: 960px;
        margin: 0 auto;
    }

    .search-results-grid {
        max-width: 960px;
        margin: 0 auto;
        padding: 16px 24px;
    }

    /* Banner PC 端调整 */
    .mall-banner-carousel {
        max-width: 960px;
        margin: 16px auto;
        border-radius: 16px;
    }

    .banner-slide img {
        height: 280px;
    }

    /* 通知栏 PC 端调整 */
    .mall-notification-bar {
        max-width: 928px;
        margin: 0 auto 16px;
    }

    /* 分类图标 PC 端调整 */
    .mall-category-icons {
        max-width: 960px;
        margin: 0 auto;
    }

    .category-icons-scroll {
        justify-content: center;
        padding: 12px 24px;
    }

    .category-icon-item {
        width: 80px;
    }

    .category-icon-image {
        width: 60px;
        height: 60px;
    }

    .category-icon-name {
        font-size: 13px;
        max-width: 80px;
    }

    /* 区块标题 PC 端调整 */
    .mall-section-title {
        max-width: 960px;
        margin: 0 auto;
        padding: 12px 24px 16px;
        font-size: 18px;
    }
}

@media (min-width: 1280px) {
    .mall-search-bar,
    .search-results-header,
    .mall-banner-carousel,
    .mall-category-icons,
    .mall-section-title {
        max-width: 1200px;
    }

    .search-results-grid {
        max-width: 1200px;
    }

    .mall-notification-bar {
        max-width: 1168px;
    }

    .banner-slide img {
        height: 320px;
    }
}

@media (min-width: 1440px) {
    .mall-search-bar,
    .search-results-header,
    .mall-banner-carousel,
    .mall-category-icons,
    .mall-section-title {
        max-width: 1360px;
    }

    .search-results-grid {
        max-width: 1360px;
    }

    .mall-notification-bar {
        max-width: 1328px;
    }

    .banner-slide img {
        height: 360px;
    }
}

/* Mobile mall layout: keep the search block in normal flow so homepage modules
   cannot scroll beneath it and visually overlap the input controls. */
@media (max-width: 959px) {
    #mall .mall-search-bar {
        position: relative;
        top: auto;
        z-index: 2;
    }

    #mall .mall-home-content,
    #mall .mall-category-icons {
        position: relative;
        z-index: 1;
    }
}

.search-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px 20px;
}

.search-pagination-btn {
    min-width: 84px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-white);
    font: inherit;
    cursor: pointer;
}

.search-pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.search-pagination-status {
    color: var(--text-gray);
    font-size: 13px;
    white-space: nowrap;
}

.search-suggestion-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
}

.search-suggestion-item.is-active,
.search-suggestion-item:focus-visible {
    background: color-mix(in srgb, var(--accent-green) 14%, transparent);
    outline: none;
}

.search-results-summary {
    margin: 0;
    padding: 8px 16px;
    color: var(--text-gray);
    font-size: 13px;
}

.search-empty-back {
    min-height: 40px;
    margin-top: 12px;
    padding: 8px 14px;
    border: 1px solid var(--accent-green);
    border-radius: 8px;
    background: transparent;
    color: var(--accent-green);
    font: inherit;
    cursor: pointer;
}

.search-recommendations {
    padding: 8px 12px 24px;
}

.search-recommendations-title {
    margin: 0 4px 12px;
    color: var(--text-white);
    font-size: 16px;
}

.search-recommendations-grid {
    padding: 0;
}

@media (max-width: 959px) {
    #search-results-section {
        padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom) + 20px);
    }
    #search-results-section .search-results-header {
        position: relative;
        top: auto;
    }
    #search-results-section .search-pagination {
        padding-bottom: 12px;
    }
    .search-pagination-btn,
    .search-empty-back {
        min-height: 44px;
    }
}



/* Rebuilt search layout: one normal-flow shell on every viewport. */
#mall .mall-search-shell {
    width: min(100%, 1360px);
    margin: 0 auto 14px;
    box-sizing: border-box;
}
#mall .mall-search-shell .mall-search-bar {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 4px;
    box-sizing: border-box;
    overflow: hidden;
    background: #17293A;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
}
#mall .mall-search-shell .search-input-wrapper {
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    box-sizing: border-box;
    background: #1E293B;
    border: 0;
    border-radius: 8px 0 0 8px;
}
#mall .mall-search-shell .search-btn {
    min-width: 84px;
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 0 8px 8px 0;
    background: #00D77A;
    color: #082416;
    box-shadow: none;
}
#mall .mall-search-shell #search-suggestions {
    position: static !important;
    display: none;
    width: 100%;
    max-width: none;
    margin: -1px 0 0;
    box-sizing: border-box;
    overflow: hidden;
    background: #17293A;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 26px rgba(0,0,0,.24);
    transform: none !important;
}
#mall .mall-search-shell #search-suggestions[style*="block"] {
    display: block !important;
}
#mall .mall-search-shell:has(#search-suggestions[style*="block"]) .mall-search-bar {
    border-radius: 12px 12px 0 0;
    border-bottom-color: transparent;
}
#mall .mall-search-shell #search-suggestions .search-suggestions-header {
    display: flex;
    min-height: 48px;
    padding: 10px 16px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
#mall .mall-search-shell #search-suggestions .search-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px 16px;
}
#mall .mall-search-shell #search-suggestions .search-suggestions-title {
    min-width: 0;
    color: var(--text-white);
    font-size: 14px;
    font-weight: 700;
}
#mall .mall-search-shell #search-suggestions .search-clear-history {
    margin-left: auto;
    color: var(--accent-green);
}
#mall .mall-search-shell #search-suggestions .search-history-chip {
    width: auto;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    background: #1E3142;
    color: #F8FAFC;
}
#mall .mall-search-shell #search-suggestions .search-history-chip .search-suggestion-text {
    color: #F8FAFC;
}
#mall #search-results-section .search-results-header {
    position: relative;
    top: auto;
    z-index: auto;
    max-width: none;
    margin: 12px 0 0;
}
@media (max-width: 640px) {
    #mall .mall-search-shell .search-btn { min-width: 74px; padding: 0 14px; }
}

/* High-contrast text treatment for the dark search field. */
#mall .mall-search-shell .mall-search-input {
    color: #F8FAFC !important;
    -webkit-text-fill-color: #F8FAFC;
    font-weight: 500;
}
#mall .mall-search-shell .mall-search-input::placeholder {
    color: #B8C4D1 !important;
    -webkit-text-fill-color: #B8C4D1;
    opacity: 1;
}
#mall .mall-search-shell .search-icon {
    color: #B8C4D1;
}
#mall .mall-search-shell .search-clear-btn {
    background: rgba(255,255,255,.16);
}
#mall .mall-search-shell .search-clear-btn svg {
    color: #F8FAFC;
}



/* Search empty state: isolated rules avoid inherited button conflicts. */
#search-results-section .search-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 300px; margin: 18px auto 20px; padding: 24px; text-align: center; }
#search-results-section .search-empty-illustration { display: grid; width: 82px; height: 82px; margin-bottom: 16px; place-items: center; border: 1px solid rgba(0,215,122,.25); border-radius: 50%; background: rgba(0,215,122,.07); }
#search-results-section .search-empty-beer-icon { display: block; width: 48px; height: 48px; object-fit: contain; }
#search-results-section .search-empty-title { margin: 0; color: #F8FAFC; font-size: 24px; line-height: 1.32; font-weight: 700; }
#search-results-section .search-empty-copy { max-width: 460px; margin: 9px 0 0; color: #AAB8C7; font-size: 15px; line-height: 1.55; }
#search-results-section .search-empty-actions { width: 100%; margin-top: 22px; font-size: 0; line-height: 0; text-align: center; }
#search-results-section .search-empty-back, #search-results-section .search-empty-clear { display: inline-block !important; box-sizing: border-box !important; width: 140px !important; height: 48px !important; min-height: 48px !important; max-height: 48px !important; margin: 0; padding: 0 !important; overflow: hidden; border: 1px solid transparent; border-radius: 10px; appearance: none; -webkit-appearance: none; font-family: inherit; font-size: 15px; font-weight: 600; line-height: 46px; text-align: center; vertical-align: top; white-space: nowrap; cursor: pointer; }
#search-results-section .search-empty-back { border-color: #078A54; background: #078A54; color: #FFFFFF; box-shadow: 0 6px 16px rgba(7,138,84,.22); }
#search-results-section .search-empty-clear { margin-left: 12px; border-color: rgba(184,196,209,.26); background: #1E293B; color: #F8FAFC; }
#search-results-section .search-empty-back:hover, #search-results-section .search-empty-back:focus-visible { background: #0AA967; border-color: #0AA967; }
#search-results-section .search-empty-clear:hover, #search-results-section .search-empty-clear:focus-visible { background: #26384A; border-color: rgba(248,250,252,.48); }
#search-results-section .search-empty-back:focus-visible, #search-results-section .search-empty-clear:focus-visible { outline: 2px solid rgba(0,215,122,.72); outline-offset: 2px; }
#search-results-section .search-recommendations { padding-top: 20px; }
#search-results-section .search-recommendations-title { margin-bottom: 14px; color: #F8FAFC; font-size: 18px; font-weight: 700; }
@media (max-width: 340px) { #search-results-section .search-empty-back, #search-results-section .search-empty-clear { display: block !important; width: min(100%,280px) !important; margin: 0 auto; } #search-results-section .search-empty-clear { margin-top: 10px; } }

/* Preserve the beer mug silhouette and add a restrained search-scanning cue. */
#search-results-section .search-empty-illustration {
    position: relative;
    width: 88px;
    height: 88px;
    overflow: visible;
}
#search-results-section .search-empty-beer-icon {
    width: 60px;
    height: 60px;
    max-width: none;
    max-height: none;
    transform: translateX(-2px);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .24));
}
#search-results-section .search-empty-magnifier {
    position: absolute;
    right: -5px;
    bottom: -4px;
    width: 23px;
    height: 23px;
    box-sizing: border-box;
    border: 2px solid #65E6AA;
    border-radius: 50%;
    background: rgba(9, 47, 39, .82);
    box-shadow: 0 0 0 4px rgba(0, 215, 122, .10), 0 3px 8px rgba(0, 0, 0, .18);
    animation: searchMagnifierScan 2.4s ease-in-out infinite;
}
#search-results-section .search-empty-magnifier::after {
    position: absolute;
    right: -6px;
    bottom: -4px;
    width: 9px;
    height: 2px;
    border-radius: 99px;
    background: #65E6AA;
    content: '';
    transform: rotate(45deg);
    transform-origin: left center;
}
@keyframes searchMagnifierScan {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: .72; }
    42% { transform: translate(-8px, -7px) scale(1.08); opacity: 1; }
    58% { transform: translate(-8px, -7px) scale(1.08); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    #search-results-section .search-empty-magnifier { animation: none; }
}
@media (max-width: 640px) {
    #search-results-section .search-empty-illustration {
        width: 80px;
        height: 80px;
    }
    #search-results-section .search-empty-beer-icon {
        width: 55px;
        height: 55px;
    }
}




/* ===== Unified Site Header (Sticky + Shrink + Two-Row) =====
   所有页面共用的页头基础样式，通过 modifier 区分变体：
   - .site-header--contained: 内容区宽度（SPA 页面用，带负 margin 抵消父容器 padding）
   - .site-header--full: 全屏宽度（SEO/独立页面用，默认）
   设计参考：CNA 风格 — Logo 居中 + 下划线式导航
*/
.site-header {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--app-top-inset);
    z-index: 100;
    background: rgba(13, 27, 42, 0.97);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-bottom: 1px solid rgba(184, 196, 209, .12);
    box-shadow: 0 1px 0 rgba(184, 196, 209, .04), 0 8px 24px rgba(0, 0, 0, .18);
    transition: box-shadow .3s ease, background .3s ease;
}

/* ===== 移动端页头（CNA 风格） ===== */
.site-header__mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 16px;
}
.site-header__mobile-lang {
    display: flex;
    align-items: center;
}
.site-header__mobile-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: background .2s ease;
}
.site-header__mobile-lang-btn img {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(0.78);
    transition: filter .2s ease;
}
.site-header__mobile-lang-btn:hover {
    background: rgba(0, 215, 122, .08);
}
.site-header__mobile-lang-btn:hover img {
    filter: brightness(0) invert(1);
}
.site-header__brand--mobile {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.site-header__brand--mobile .site-header__logo {
    height: 28px;
}
.site-header__mobile-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.site-header__mobile-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #C8D2DC;
    cursor: pointer;
    border-radius: 50%;
    transition: color .2s ease, background .2s ease;
    text-decoration: none;
}
.site-header__mobile-profile-btn > svg {
    width: 22px;
    height: 22px;
}
.site-header__mobile-profile-btn:hover {
    color: var(--accent-green);
    background: rgba(0, 215, 122, .08);
}
.site-header__mobile-profile-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(184, 196, 209, .12);
}
.site-header__mobile-profile-avatar svg {
    width: 16px;
    height: 16px;
    color: #AAB8C7;
}
.site-header__mobile-profile-avatar-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}
.site-header__mobile-profile-avatar-image[src]:not([src=""]) {
    display: block;
}
.site-header__mobile-profile-avatar-image[src]:not([src=""]) + .site-header__mobile-profile-avatar-fallback {
    display: none;
}
.site-header__row--top {
    display: none; /* 移动端隐藏桌面端顶部行 */
}
.site-header__row--nav {
    position: relative;
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid rgba(184, 196, 209, .08);
}
.site-header__nav-scroll-viewport {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.site-header__nav-scroll-viewport::-webkit-scrollbar {
    display: none;
}
/* 滚动按钮 */
.site-header__nav-scroll-btn {
    display: none;
    flex-shrink: 0;
    width: 36px;
    border: 0;
    background: rgba(13, 27, 42, 0.92);
    color: #AAB8C7;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .2s, color .2s;
    position: relative;
    z-index: 2;
}
.site-header__nav-scroll-btn svg {
    width: 18px;
    height: 18px;
}
.site-header__nav-scroll-btn:hover {
    color: #F8FAFC;
    background: rgba(30, 58, 95, 0.95);
}
.site-header__nav-scroll-btn:active {
    transform: scale(0.92);
}
/* 溢出时显示按钮 + 渐变遮罩 */
.site-header__row--nav[data-overflow="left"] .site-header__nav-scroll-btn--left,
.site-header__row--nav[data-overflow="right"] .site-header__nav-scroll-btn--right,
.site-header__row--nav[data-overflow="both"] .site-header__nav-scroll-btn {
    display: flex;
}
.site-header__row--nav[data-overflow="left"] .site-header__nav-scroll-viewport::before,
.site-header__row--nav[data-overflow="right"] .site-header__nav-scroll-viewport::after,
.site-header__row--nav[data-overflow="both"] .site-header__nav-scroll-viewport::before,
.site-header__row--nav[data-overflow="both"] .site-header__nav-scroll-viewport::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 36px;
    pointer-events: none;
    z-index: 1;
}
.site-header__row--nav[data-overflow="left"] .site-header__nav-scroll-viewport::before,
.site-header__row--nav[data-overflow="both"] .site-header__nav-scroll-viewport::before {
    left: 0;
    background: linear-gradient(to right, rgba(13, 27, 42, 0.95), transparent);
}
.site-header__row--nav[data-overflow="right"] .site-header__nav-scroll-viewport::after,
.site-header__row--nav[data-overflow="both"] .site-header__nav-scroll-viewport::after {
    right: 0;
    background: linear-gradient(to left, rgba(13, 27, 42, 0.95), transparent);
}
.site-header__nav-scroll-viewport {
    position: relative;
}
.site-header__nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    padding: 0 8px;
}
.site-header__nav-links.is-overflowing {
    justify-content: flex-start;
    width: auto;
    min-width: 100%;
}
.site-header__nav-links a,
.site-header__nav-links button {
    flex: 0 0 auto;
    position: relative;
    padding: 0 16px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    border: 0;
    background: transparent;
    color: #AAB8C7;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s ease;
}
.site-header__nav-links a::after,
.site-header__nav-links button::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 2px;
    background: var(--accent-green);
    transform: scaleX(0);
    transition: transform .25s ease;
}
.site-header__nav-links a.is-active,
.site-header__nav-links button.is-active {
    color: var(--accent-green);
}
.site-header__nav-links a.is-active::after,
.site-header__nav-links button.is-active::after {
    transform: scaleX(1);
}

/* 移动端缩小状态：隐藏顶部行，导航行保留 */
.site-header.is-shrunk .site-header__mobile-top {
    height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}
.site-header.is-shrunk .site-header__row--nav {
    border-bottom-width: 1px;
}
.site-header.is-shrunk {
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
}
.site-header__mobile-top,
.site-header__row--nav {
    transition: height .3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity .2s ease,
                padding .3s cubic-bezier(0.4, 0, 0.2, 1);
}
.site-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.site-header__brand {
    display: inline-flex;
    align-items: center;
}
.site-header__logo {
    height: 36px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
    transition: height .3s cubic-bezier(0.4, 0, 0.2, 1);
}
.site-header__row {
    display: flex;
    align-items: center;
}
.site-header__row--top {
    display: none; /* 移动端隐藏桌面端顶部行 */
}

/* 桌面端：隐藏移动端元素，显示桌面端布局 */
@media (min-width: 960px) {
    .site-header {
        top: 0;
    }
    .site-header__mobile-top {
        display: none;
    }
    .site-header__row--top {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        min-height: 56px;
        padding-top: 12px;
        padding-bottom: 8px;
        transition: min-height .3s cubic-bezier(0.4, 0, 0.2, 1),
                    padding-top .3s cubic-bezier(0.4, 0, 0.2, 1),
                    padding-bottom .3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .site-header__row--top .site-header__brand {
        grid-column: 2;
        justify-self: center;
    }
    .site-header__row--top .site-header__actions {
        grid-column: 3;
        justify-self: end;
    }
    .site-header__row--nav {
        justify-content: center;
        min-height: 44px;
        overflow: visible;
    }
    .site-header__nav-links {
        display: flex;
        align-items: stretch;
        gap: 0;
        height: 100%;
        padding: 0;
        min-width: auto;
    }
    .site-header__nav-links a,
    .site-header__nav-links button {
        height: 100%;
        min-height: 44px;
    }
    /* 桌面端缩小状态：单行布局（Logo 左 + 导航中 + actions 右） */
    .site-header.is-shrunk {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        box-shadow: 0 1px 0 rgba(184, 196, 209, .06), 0 12px 32px rgba(0, 0, 0, .28);
    }
    .site-header.is-shrunk .site-header__row--top {
        display: contents;
    }
    .site-header.is-shrunk .site-header__row--top .site-header__brand {
        grid-column: auto;
        justify-self: flex-start;
        order: 1;
    }
    .site-header.is-shrunk .site-header__row--top .site-header__actions {
        grid-column: auto;
        justify-self: flex-end;
        order: 3;
    }
    .site-header.is-shrunk .site-header__row--nav {
        order: 2;
        flex: 1;
        min-height: 44px;
        max-height: none;
        opacity: 1;
        overflow: visible;
        border-bottom-width: 0;
        transform: none;
        justify-content: center;
        padding: 0;
    }
    .site-header.is-shrunk .site-header__logo {
        height: 28px;
    }
}

/* Variant: contained (SPA 页面用，内容区宽度，带负 margin 抵消父容器 padding) */
.site-header--contained {
    margin: 0 -1px 22px;
    padding: 0 clamp(32px, 4vw, 56px);
}
.site-header--contained.is-shrunk {
    padding-top: 0;
    padding-bottom: 0;
}

/* 移动端：SPA 页面（.page 容器内）header 全宽显示，与商品/知识详情页一致 */
@media (max-width: 959px) {
    .page .site-header--contained {
        margin-left: -20px;
        margin-right: -20px;
        max-width: none;
    }
}

/* Variant: full-width (SEO/独立页面用，全屏宽度，内容居中) */
.site-header--full .site-header__row {
    width: min(100%, 1360px);
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 clamp(32px, 4vw, 56px);
}

/* Desktop storefront base. */
.mall-desktop-nav,
.mall-desktop-profile {
    display: none;
}
/* 移动端导航标签栏显示（覆盖 mall-desktop-nav 的 display:none） */
.site-header .site-header__nav-links {
    display: flex;
}
.mall-desktop-footer {
    margin-top: 48px;
    padding: 28px 20px 20px;
    background: var(--bg-tertiary, #0f172a);
    border-top: 1px solid var(--border-primary);
    color: var(--text-secondary, #94A3B8);
    font-size: 13px;
    line-height: 1.6;
}
.mall-desktop-footer .footer-chrome-inner {
    max-width: 100%;
    margin: 0 auto;
}
.mall-desktop-footer .footer-columns {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.mall-desktop-footer .footer-col h3 {
    margin: 0 0 12px;
    color: var(--text-primary, #F8FAFC);
    font-size: 13px;
    font-weight: 600;
}
/* 品牌列：居中 */
.mall-desktop-footer .footer-col-brand {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.mall-desktop-footer .footer-col-brand > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.mall-desktop-footer .footer-col-brand strong {
    font-size: 18px;
    color: var(--text-primary, #F8FAFC);
    letter-spacing: -.02em;
    font-weight: 700;
}
.mall-desktop-footer .footer-col-brand span {
    font-size: 12px;
    color: var(--text-muted, #64748B);
}
/* 支付方式：4 列网格，居中 */
.mall-desktop-footer .footer-payment-methods {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mall-desktop-footer .footer-payment-label {
    display: block;
    margin-bottom: 10px;
    font-size: 11px;
    color: var(--text-muted, #64748B);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.mall-desktop-footer .footer-payment-icons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
}
.mall-desktop-footer .footer-payment-icons img {
    width: 100%;
    height: 28px;
    object-fit: contain;
    padding: 3px 4px;
    background: rgba(248, 250, 252, .95);
    border-radius: 6px;
    box-sizing: border-box;
}
/* 链接列：2 列网格，居中 */
.mall-desktop-footer .footer-col-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
    justify-items: center;
}
.mall-desktop-footer .footer-col-links h3 {
    grid-column: 1 / -1;
    text-align: center;
}
.mall-desktop-footer .footer-col-links a,
.mall-desktop-footer .footer-col-links button {
    text-align: center;
    text-decoration: none;
    color: var(--text-secondary, #94A3B8);
    font-size: 13px;
    background: none;
    border: 0;
    padding: 4px 0;
    min-height: 22px;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mall-desktop-footer .footer-col-links a:hover,
.mall-desktop-footer .footer-col-links button:hover {
    color: var(--accent-green, #00D77A);
}
/* 联系信息 */
.mall-desktop-footer .footer-col-contact {
    text-align: center;
}
.mall-desktop-footer .footer-col-contact .footer-contact-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.mall-desktop-footer .footer-contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-secondary, #94A3B8);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
}
.mall-desktop-footer .footer-contact-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--accent-green, #00D77A);
}
.mall-desktop-footer .footer-contact-item svg path {
    fill: currentColor;
    stroke: currentColor;
}
/* 社交媒体图标区 */
.mall-desktop-footer .footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}
.mall-desktop-footer .footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    transition: transform .2s, box-shadow .2s;
}
.mall-desktop-footer .footer-social a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}
.mall-desktop-footer .footer-social img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}
/* 法律链接：底部弱化，居中，竖线分隔 */
.mall-desktop-footer .footer-col-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    justify-content: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.mall-desktop-footer .footer-col-legal h3 {
    display: none;
}
.mall-desktop-footer .footer-col-legal a {
    color: var(--text-muted, #64748B);
    text-decoration: none;
    font-size: 12px;
    padding: 4px 0;
    position: relative;
}
.mall-desktop-footer .footer-col-legal a + a {
    margin-left: 12px;
    padding-left: 12px;
}
.mall-desktop-footer .footer-col-legal a + a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, .15);
}
.mall-desktop-footer .footer-col-legal a:hover {
    color: var(--accent-green, #00D77A);
}
/* 版权信息：左对齐，小字号 */
.mall-desktop-footer .footer-copyright {
    margin-top: 16px;
    text-align: left;
    color: var(--text-muted, #64748B);
    font-size: 11px;
}
@media (min-width: 960px) {
    .mall-desktop-footer {
        margin-top: 0;
        padding: 0;
        background: transparent;
        border-top: 0;
    }
    #mall.page {
        width: min(100%, 1360px);
        max-width: 1360px;
        min-height: 100vh;
        margin: 0 auto;
        padding: 0 clamp(32px, 4vw, 56px) 48px;
    }
    #mall .lang-switcher {
        margin-left: 0;
    }
}


@media (min-width: 960px) {
    .mall-desktop-nav button,
    .mall-desktop-nav a,
    .mall-desktop-profile {
        border: 0;
        background: transparent;
        color: #C8D2DC;
        font: inherit;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        text-decoration: none;
    }
    .mall-desktop-nav button,
    .mall-desktop-nav a {
        position: relative;
        padding: 0 16px;
        height: 100%;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        border-radius: 0;
        transition: color .2s ease;
    }
    .mall-desktop-nav button::after,
    .mall-desktop-nav a::after {
        content: '';
        position: absolute;
        left: 16px;
        right: 16px;
        bottom: 0;
        height: 2px;
        background: var(--accent-green);
        transform: scaleX(0);
        transition: transform .25s ease;
    }
    .mall-desktop-nav button:hover,
    .mall-desktop-nav a:hover {
        color: var(--accent-green);
    }
    .mall-desktop-nav button:hover::after,
    .mall-desktop-nav a:hover::after {
        transform: scaleX(1);
    }
    .mall-desktop-nav button.is-active,
    .mall-desktop-nav a.is-active {
        color: var(--accent-green);
    }
    .mall-desktop-nav button.is-active::after,
    .mall-desktop-nav a.is-active::after {
        transform: scaleX(1);
    }
    .mall-desktop-profile {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 6px 0;
        border: 0;
        border-radius: 0;
        color: #C8D2DC;
        font-size: 14px;
        font-weight: 600;
        transition: color .2s ease;
    }
    .mall-desktop-profile:hover {
        color: var(--accent-green);
    }
    .mall-desktop-profile .mall-desktop-profile-label {
        font-size: 14px;
        font-weight: 600;
    }
    .mall-desktop-profile:not(.has-user-avatar) .mall-desktop-profile-avatar {
        display: none;
    }
    #mall .mall-search-shell {
        width: 100%;
        max-width: none;
        margin-bottom: 24px;
    }
}

@media (min-width: 960px) {
    #mall .mall-desktop-footer {
        display: block;
        margin-top: 54px;
        padding: 22px 0;
        border-top: 1px solid rgba(184,196,209,.12);
    }
}

@media (min-width: 960px) {
    #mall .product-card {
        min-height: 0;
        padding: 0 0 16px;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 12px;
        background: #1A2A3A;
        overflow: hidden;
        transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
    }
    #mall .product-card:hover {
        transform: translateY(-2px);
        border-color: rgba(0,215,122,.56);
        box-shadow: 0 14px 30px rgba(0,0,0,.24);
    }
    #mall .product-image {
        aspect-ratio: 4 / 3;
        margin: 0 0 15px;
        border-radius: 0;
    }
    #mall .product-name {
        display: -webkit-box;
        min-height: 42px;
        margin: 0 16px 8px;
        overflow: hidden;
        color: #F8FAFC;
        font-size: 16px;
        font-weight: 500;
        line-height: 1.34;
        white-space: normal;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }
    #mall .product-points {
        margin: 0 16px 10px;
        color: var(--accent-green);
        font-size: 19px;
        font-weight: 700;
    }
    #mall .product-stock {
        margin: 0 16px 14px;
        color: #8E99A4;
        font-size: 12px;
    }
}

@media (min-width: 960px) {
    #mall .product-card-actions {
        display: flex;
        min-height: 38px;
        margin: auto 16px 0;
        align-items: center;
        justify-content: flex-end;
        gap: 9px;
    }
    #mall .product-card-actions .product-cart-btn {
        display: none !important;
    }
    #mall .product-card-actions .product-share-btn {
        order: -1;
        color: #8E99A4 !important;
    }
    #mall .product-card-actions .product-redeem-btn {
        flex: 0 0 auto !important;
        width: auto;
        min-width: 96px;
        min-height: 38px;
        padding: 0 15px;
        border-radius: 8px;
        box-shadow: none;
    }
    #mall .product-card-actions .product-redeem-btn:hover {
        filter: brightness(1.08);
        box-shadow: 0 5px 12px rgba(0,215,122,.20);
    }
}

.search-empty-desktop-icon { display: none; }
@media (min-width: 960px) {
    #mall #search-results-section {
        width: 100%;
    }
    #mall #search-results-section .search-results-header {
        display: flex;
        min-height: 64px;
        margin: 0;
        padding: 10px 16px;
        align-items: center;
        border: 1px solid rgba(184,196,209,.14);
        border-bottom-color: rgba(184,196,209,.20);
        border-radius: 12px;
        background: #18283A;
        box-shadow: none;
    }
    #mall #search-results-section .search-back-btn {
        border-radius: 8px;
        transition: background .2s ease, color .2s ease;
    }
    #mall #search-results-section .search-back-btn:hover {
        background: rgba(0,215,122,.10);
        color: var(--accent-green);
    }
    #mall #search-results-section .search-results-title {
        font-size: 16px;
        font-weight: 700;
        white-space: nowrap;
    }
    #mall #search-results-section .search-sort-select {
        min-height: 38px;
        border-color: rgba(184,196,209,.20);
        background: #1E293B;
        color: #F8FAFC;
        transition: border-color .2s ease, background .2s ease;
    }
    #mall #search-results-section .search-sort-select:hover {
        border-color: rgba(0,215,122,.48);
        background: #223548;
    }
    #mall #search-results-section .search-empty-state {
        width: 100%;
        max-width: none;
        min-height: min(430px,calc(100vh - 310px));
        margin: 18px 0 30px;
        padding: 42px 24px;
    }
}

@media (min-width: 960px) {
    #mall #search-results-section .search-empty-illustration {
        width: 96px;
        height: 96px;
        margin-bottom: 20px;
        background: rgba(0,215,122,.08);
        color: #54D99A;
    }
    #mall #search-results-section .search-empty-beer-icon,
    #mall #search-results-section .search-empty-magnifier {
        display: none;
    }
    #mall #search-results-section .search-empty-desktop-icon {
        display: block;
        width: 64px;
        height: 64px;
    }
    #mall #search-results-section .search-empty-title {
        max-width: none;
        font-size: 28px;
        line-height: 1.25;
        white-space: nowrap;
    }
    #mall #search-results-section .search-empty-copy {
        max-width: none;
        margin-top: 10px;
        font-size: 16px;
    }
    #mall #search-results-section .search-empty-actions {
        margin-top: 24px;
    }
    #mall #search-results-section .search-empty-back,
    #mall #search-results-section .search-empty-clear {
        width: 148px !important;
        height: 46px !important;
        min-height: 46px !important;
        max-height: 46px !important;
        line-height: 44px;
        transition: background .2s ease, border-color .2s ease  box-shadow .2s ease;
    }
    #mall #search-results-section .search-empty-clear {
        margin-left: 12px;
    }
    #mall #search-results-section .search-empty-back:hover {
        box-shadow: 0 7px 16px rgba(7,138,84,.28);
    }
    #mall #search-results-section .search-recommendations {
        padding: 0;
    }
    #mall #search-results-section .search-recommendations-title {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0 0 18px;
        color: #F8FAFC;
        font-size: 22px;
    }
    #mall #search-results-section .search-recomme  ations-title::before {
        width: 4px;
        height: 22px;
        border-radius: 99px;
        background: var(--accent-green);
        content: '';
    }
    #mall #search-results-section .search-recommendations-grid {
        grid-template-columns: repeat(4,minmax(0,1fr));
        gap: 24px;
        margin: 0;
        padding: 0;
    }
}

/* Product action row: shared mobile baseline and desktop cart recovery. */
#mall .product-card-actions {
    display: flex;
    min-height: 38px;
    margin-top: auto;
    align-items: center;
    gap: 8px;
}
#mall .product-card-actions .product-cart-btn,
#mall .product-card-actions .product-share-btn {
    display: inline-flex !important;
    width: 30px;
    height: 38px;
    padding: 0 !important;
    align-items: center;
    justify-content: center;
    color: var(--text-gray) !important;
    background: transparent !important;
    border: 0 !important;
    flex: 0 0 30px;
}
#mall .product-card-actions .product-cart-btn svg,
#mall .product-card-actions .product-share-btn svg {
    width: 19px !important;
    height: 19px !important;
}
#mall .product-card-actions .product-redeem-btn {
    display: inline-flex;
    flex: 1 1 auto !important;
    min-height: 38px;
    align-items: center;
    justify-content: center;
}
@media (max-width: 959px) {
    #mall .product-card-actions {
        margin: 0;
    }
}
@media (min-width: 960px) {
    #mall .product-card-actions .product-cart-btn {
        display: inline-flex !important;
        order: 0;
    }
    #mall .product-card-actions .product-share-btn {
        order: 0;
    }
    #mall .product-card-actions .product-redeem-btn {
        flex: 0 0 auto !important;
    }
}

/* High-contrast search suggestions for the dark storefront. */
#mall .mall-search-shell #search-suggestions .search-suggestions-header {
    color: #F8FAFC;
    background: #1B2D3F;
    border-bottom-color: rgba(184,196,209,.14);
}
#mall .mall-search-shell #search-suggestions .search-suggestions-title {
    color: #F8FAFC;
}
#mall .mall-search-shell #search-suggestions .search-suggestion-item {
    color: #F8FAFC;
}
#mall .mall-search-shell #search-suggestions .search-suggestion-text {
    color: #F8FAFC !important;
    font-weight: 500;
}
#mall .mall-search-shell #search-suggestions .search-suggestion-leading-icon,
#mall .mall-search-shell #search-suggestions .search-suggestion-icon {
    color: #9FB0C1;
}
#mall .mall-search-shell #search-suggestions .search-suggestion-item:hover,
#mall .mall-search-shell #search-suggestions .search-suggestion-item.is-active {
    background: rgba(0,215,122,.10);
}
#mall .mall-search-shell #search-suggestions .search-suggestion-hot {
    background: #BD4E45;
    color: #FFFFFF;
    font-weight: 700;
}

@media (min-width: 960px) {
    #mall #search-results-list .search-empty-state {
        grid-column: 1 / -1 !important;
        grid-row: auto;
        justify-self: stretch;
        align-self: stretch;
        width: 100%;
        max-width: none;
    }
}

/* Shared desktop header for dashboard, game, insights and profile. */
@media (min-width: 960px) {
    #dashboard.page,
    #game.page,
    #insights.page,
    #profile.page {
        width: min(100%, 1360px);
        max-width: 1360px;
        min-height: 100vh;
        margin: 0 auto;
        padding: 0 clamp(32px, 4vw, 56px) 48px;
    }
    .mall-desktop-nav {
        display: flex;
        align-items: center;
        gap: 4px;
    }
    #dashboard .lang-switcher,
    #game .lang-switcher,
    #insights .lang-switcher,
    #profile .lang-switcher {
        margin-left: 0;
    }
}

@media (min-width: 960px) {
    .mall-desktop-profile.is-active {
        color: var(--accent-green);
    }
}

@media (min-width: 960px) {
    .mall-desktop-profile.has-user-avatar {
        width: 42px;
        height: 42px;
        padding: 3px;
        justify-content: center;
        border-color: rgba(0, 255, 136, .42);
        border-radius: 50%;
        background: rgba(0, 215, 122, .08);
        box-shadow: 0 0 0 3px rgba(0, 255, 136, .06);
    }
    .mall-desktop-profile.has-user-avatar .mall-desktop-profile-label { display: none; }
    .mall-desktop-profile-avatar {
        display: grid;
        width: 100%;
        height: 100%;
        overflow: hidden;
        place-items: center;
        border-radius: 50%;
        background: linear-gradient(135deg, #00ff88, #00b962);
        color: #06291a;
        font-size: 14px;
        font-weight: 800;
        line-height: 1;
    }
    .mall-desktop-profile-avatar-image,
    .mall-desktop-profile-avatar-fallback {
        width: 100%;
        height: 100%;
    }
    .mall-desktop-profile-avatar-image { display: none; object-fit: cover; }
    .mall-desktop-profile-avatar-fallback { display: grid; place-items: center; }
    #profile .mall-desktop-profile.has-user-avatar.is-active { box-shadow: 0 0 0 3px rgba(0, 255, 136, .16); }
    .mall-desktop-profile.has-user-avatar:hover { border-color: var(--accent-green); transform: translateY(-1px); }
    .mall-desktop-profile:focus-visible { outline: 2px solid var(--accent-green); outline-offset: 3px; }
}
@media (min-width: 960px) {
    #mall .product-image {
        background: #132234;
    }
    #mall .product-image img {
        object-fit: contain !important;
        object-position: center;
        padding: 8px;
        background: #132234;
    }
}

@media (min-width: 960px) {
    #mall .product-image {
        aspect-ratio: 1 / 1;
        background: var(--primary-dark);
    }
    #mall .product-image img {
        width: 100% !important;
        height: 100% !important;
        padding: 0 !important;
        background: transparent !important;
        object-fit: cover !important;
    }
}

/* Desktop module footer anchoring. */
@media (min-width: 960px) {
    #dashboard.page.active,
    #game.page.active,
    #insights.page.active,
    #profile.page.active,
    #mall.page.active {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        padding-bottom: 32px;
        overflow-x: visible;
    }
    .desktop-module-footer {
        display: block;
        width: 100%;
        margin-top: auto;
        padding: 22px 0;
        border-top: 1px solid rgba(184,196,209,.12);
    }
}

@media (min-width: 960px) {
    .desktop-module-footer-inner,
    .mall-desktop-footer-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        color: #8E99A4;
        font-size: 13px;
    }
    .desktop-module-footer strong,
    .mall-desktop-footer strong {
        color: #F8FAFC;
        font-size: 15px;
    }
    .desktop-module-footer button,
    .mall-desktop-footer button {
        border: 0;
        background: transparent;
        color: #8E99A4;
        cursor: pointer;
    }
    .desktop-module-footer button:hover,
    .mall-desktop-footer button:hover {
        color: var(--accent-green);
    }
}

@media (min-width: 960px) {
    #mall .desktop-module-footer {
        margin-top: auto;
    }
}

/* Unified desktop container for all primary modules. */
@media (min-width: 960px) {
    #dashboard.page,
    #game.page,
    #insights.page,
    #profile.page {
        width: min(100%, 1360px);
        max-width: 1360px;
        margin: 0 auto;
        padding: 22px clamp(32px, 4vw, 56px) 48px;
    }
}

@media (min-width: 960px) {
    .desktop-module-footer-links button.is-active,
    .mall-desktop-footer-links button.is-active {
        color: var(--accent-green);
        font-weight: 700;
    }
}

/* Footer is desktop-only, matching the mall mobile layout. */
.desktop-module-footer {
    display: none;
}
@media (min-width: 960px) {
    .desktop-module-footer {
        display: block;
    }
}

/* 页脚四列结构：品牌+支付方式 | 快速链接 | 联系方式 | 法律声明，底部居中版权 */
@media (min-width: 960px) {
    footer .footer-chrome-inner {
        display: block;
    }
    .footer-columns {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: space-between;
        gap: clamp(28px, 3vw, 48px);
    }
    .footer-col { min-width: 0; }
    .footer-col h3 {
        margin: 0 0 12px;
        color: var(--product-text, #F8FAFC);
        font-size: 14px;
        font-weight: 600;
    }
    /* 列取自然内容宽 + space-between 均布：短内容列（快速链接/法律声明）
       不再用 flex-grow 撑出右侧空白，法律声明列文字抵达容器右缘，
       页脚视觉上铺满整行、左右对称。品牌列基准 340px 保障 960px 单行。 */
    .footer-col-brand { flex: 0 1 340px; }
    .footer-col-links { flex: 0 1 auto; }
    .footer-col-contact { flex: 0 1 auto; }
    .footer-col-legal { flex: 0 1 auto; }

    /* 品牌列：品牌名与标语纵向堆叠 */
    .footer-columns .footer-col-brand > div {
        display: block;
    }
    .footer-col-brand strong {
        display: block;
        font-size: 17px;
        letter-spacing: -.02em;
    }
    .footer-col-brand > div > span {
        display: block;
        margin-top: 5px;
    }

    /* 快速链接列：纵向堆叠 */
    .footer-columns .footer-col-links {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .footer-columns .footer-col-links a,
    .footer-columns .footer-col-links button {
        text-align: left;
        text-decoration: none;
    }

    /* 法律声明列 */
    .footer-col-legal {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .footer-col-legal a {
        color: inherit;
        text-decoration: none;
    }
    .footer-col-legal a:hover {
        color: var(--accent-green, #00FF88);
    }

    /* 联系方式列 */
    .footer-contact-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .footer-contact-item {
        display: inline-flex;
        align-items: flex-start;
        gap: 8px;
        font-size: 13px;
        color: inherit;
        text-decoration: none;
        line-height: 1.5;
    }
    a.footer-contact-item:hover {
        color: var(--accent-green, #00FF88);
    }
    .footer-contact-item svg {
        width: 15px;
        height: 15px;
        fill: currentColor;
        flex-shrink: 0;
        margin-top: 2px;
        opacity: .85;
    }

    /* 支付方式（品牌列内，标签在上图标在下） */
    .footer-payment-methods {
        margin-top: 18px;
        display: block;
    }
    .footer-payment-label {
        display: block;
        margin-bottom: 10px;
        font-size: 13px;
        color: #AAB8C7;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .05em;
    }
    .footer-payment-icons {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        flex-wrap: wrap;
    }
    .footer-payment-icons img {
        width: 48px;
        height: 30px;
        object-fit: contain;
        padding: 3px 5px;
        background: #F8FAFC;
        border-radius: 6px;
        opacity: 1;
        transition: transform .2s, box-shadow .2s;
    }
    .footer-payment-icons img:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    }

    /* 社交图标 */
    .footer-social {
        margin-top: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .footer-social a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, .1);
        border-radius: 50%;
        transition: background .2s, transform .2s;
    }
    .footer-social a:hover {
        background: rgba(255, 255, 255, .2);
        transform: translateY(-2px);
    }
    .footer-social img {
        width: 16px;
        height: 16px;
        object-fit: contain;
    }

    /* 底部版权：分隔线 + 居中 */
    .footer-copyright {
        margin-top: 26px;
        padding-top: 18px;
        border-top: 1px solid rgba(184, 196, 209, .12);
        text-align: center;
    }

    /* === 覆盖 mall-desktop-footer 移动端样式，确保桌面端正确显示 === */
    .mall-desktop-footer .footer-columns {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: clamp(28px, 3vw, 48px);
    }
    .mall-desktop-footer .footer-col h3 {
        margin: 0 0 12px;
        font-size: 14px;
    }
    .mall-desktop-footer .footer-col-brand {
        text-align: left;
        padding-bottom: 0;
        border-bottom: 0;
        flex: 0 1 340px;
    }
    .mall-desktop-footer .footer-col-brand > div {
        align-items: flex-start;
        display: block;
    }
    .mall-desktop-footer .footer-col-brand strong {
        font-size: 17px;
        font-weight: 600;
    }
    .mall-desktop-footer .footer-col-brand span {
        display: block;
        margin-top: 5px;
        font-size: inherit;
        color: inherit;
    }
    .mall-desktop-footer .footer-payment-methods {
        margin-top: 18px;
        display: block;
        align-items: flex-start;
    }
    .mall-desktop-footer .footer-payment-label {
        margin-bottom: 10px;
        font-size: 13px;
        color: #AAB8C7;
        font-weight: 600;
        letter-spacing: .05em;
    }
    .mall-desktop-footer .footer-payment-icons {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        flex-wrap: wrap;
        width: auto;
    }
    .mall-desktop-footer .footer-payment-icons img {
        width: 48px;
        height: 30px;
        padding: 3px 5px;
        background: #F8FAFC;
        border-radius: 6px;
        opacity: 1;
        transition: transform .2s, box-shadow .2s;
    }
    .mall-desktop-footer .footer-payment-icons img:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    }
    .mall-desktop-footer .footer-col-links {
        display: flex;
        flex-direction: column;
        gap: 10px;
        flex: 0 1 auto;
    }
    .mall-desktop-footer .footer-col-links h3 {
        grid-column: auto;
        text-align: left;
    }
    .mall-desktop-footer .footer-col-links a,
    .mall-desktop-footer .footer-col-links button {
        padding: 0;
        min-height: auto;
        font-size: inherit;
        display: inline;
    }
    .mall-desktop-footer .footer-col-contact {
        text-align: left;
    }
    .mall-desktop-footer .footer-col-contact .footer-contact-info {
        gap: 10px;
        align-items: flex-start;
    }
    .mall-desktop-footer .footer-contact-item {
        display: inline-flex;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 8px;
        font-size: 13px;
        line-height: 1.5;
    }
    .mall-desktop-footer .footer-contact-item svg {
        width: 15px;
        height: 15px;
        margin-top: 2px;
    }
    .mall-desktop-footer .footer-social {
        margin-top: 12px;
        gap: 8px;
        justify-content: flex-start;
    }
    .mall-desktop-footer .footer-social a {
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, .1);
    }
    .mall-desktop-footer .footer-social img {
        width: 16px;
        height: 16px;
    }
    .mall-desktop-footer .footer-col-legal {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 10px;
        padding-top: 0;
        border-top: 0;
        flex: 0 1 auto;
    }
    .mall-desktop-footer .footer-col-legal h3 {
        display: block;
    }
    .mall-desktop-footer .footer-col-legal a {
        font-size: inherit;
        color: inherit;
        padding: 0;
        position: static;
    }
    .mall-desktop-footer .footer-col-legal a + a {
        margin-left: 0;
        padding-left: 0;
    }
    .mall-desktop-footer .footer-col-legal a + a::before {
        display: none;
    }
    .mall-desktop-footer .footer-copyright {
        margin-top: 26px;
        padding-top: 18px;
        border-top: 1px solid rgba(184, 196, 209, .12);
        text-align: center;
        font-size: inherit;
    }
}

/* Mobile empty-result actions: equal stacked controls. */
@media (max-width: 959px) {
    #mall #search-results-section .search-empty-actions {
        display: flex;
        width: 100%;
        margin-top: 22px;
        align-items: center;
        flex-direction: column;
        gap: 12px;
    }
    #mall #search-results-section .search-empty-back,
    #mall #search-results-section .search-empty-clear {
        display: inline-flex !important;
        width: min(100%, 260px) !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }
}

/* Mobile checkout: keep scroll gestures inside the confirmation modal. */
@media (max-width: 959px) {
    html.checkout-modal-open,
    body.checkout-modal-open {
        overflow: hidden;
        overscroll-behavior: none;
    }
    #checkout-modal {
        overscroll-behavior: contain;
    }
    #checkout-modal .modal-content {
        max-height: calc(100dvh - 32px) !important;
        overscroll-behavior: contain;
    }
    #checkout-items {
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
}

/* Banner base: responsive artwork without blank fallback space. */
#mall .mall-banner-carousel[hidden] {
    display: none !important;
}

#mall .mall-banner-carousel picture,
#mall .mall-banner-carousel picture img {
    display: block;
    width: 100%;
    height: 100%;
}

#mall .banner-slide picture {
    height: 160px;
}

#mall .banner-slide img {
    height: 100%;
    object-fit: cover;
}

#mall .banner-dot {
    border: 0;
    padding: 0;
}

@media (min-width: 960px) {
    #mall .mall-banner-carousel {
        margin: 20px 0 24px;
        border: 1px solid rgba(184, 196, 209, .14);
        background: #132234;
        box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
    }
    #mall .banner-slide picture {
        height: 280px;
    }
}

@media (min-width: 1280px) {
    #mall .banner-slide picture {
        height: 320px;
    }
}

@media (min-width: 1440px) {
    #mall .banner-slide picture {
        height: 360px;
    }
}

#mall .banner-arrow[hidden] {
    display: none;
}

#mall .banner-dot:focus-visible,
#mall .banner-arrow:focus-visible {
    outline: 2px solid var(--accent-green);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    #mall .banner-track {
        transition: none;
    }
}

/* 首页通知栏：深色商城主题、可访问性与轮播状态 */
#mall .mall-notification-bar {
    position: relative;
    width: min(calc(100% - 24px), 1360px);
    min-height: 44px;
    margin: 0 auto 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
    animation: slideDown 0.3s ease;
}

#mall .mall-notification-bar[hidden] {
    display: none;
}

#mall .notification-bar-item {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 16px;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    box-sizing: border-box;
}

#mall .mall-notification-bar.is-interactive .notification-bar-item {
    cursor: pointer;
}

#mall .mall-notification-bar.is-interactive .notification-bar-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

#mall .notification-bar-item:focus-visible {
    outline: 2px solid var(--accent-green);
    outline-offset: -2px;
}

#mall .notification-bar-icon {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1;
}

#mall .notification-text-viewport {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

#mall .notification-bar-text {
    display: block;
    overflow: hidden;
    color: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#mall .notification-bar-item.marquee .notification-bar-text {
    width: max-content;
    padding-left: 100%;
    overflow: visible;
    text-overflow: clip;
    animation: notification-marquee var(--notification-marquee-duration, 10s) linear infinite;
}

#mall .mall-notification-bar.is-paused .notification-bar-item.marquee .notification-bar-text {
    animation-play-state: paused;
}

@keyframes notification-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@media (max-width: 959px) {
    #mall .mall-notification-bar {
        width: calc(100% - 24px);
        margin-bottom: 12px;
    }

    #mall .notification-bar-item {
        min-height: 48px;
        padding: 11px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #mall .mall-notification-bar,
    #mall .notification-bar-item.marquee .notification-bar-text {
        animation: none;
    }
}

/* 首页分类图标入口：键盘可达与筛选选中态 */
#mall .category-icon-item {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
}

#mall .category-icon-item:focus-visible {
    outline: 2px solid var(--accent-green);
    outline-offset: 3px;
    border-radius: 10px;
}

#mall .category-icon-item.is-active .category-icon-image {
    background: color-mix(in srgb, var(--accent-green) 16%, var(--card-bg));
    box-shadow: 0 0 0 2px var(--accent-green), 0 6px 14px rgba(0, 255, 136, 0.18);
    transform: translateY(-1px);
}

#mall .category-icon-item.is-active .category-icon-name {
    color: var(--accent-green);
    font-weight: 600;
}

@media (min-width: 960px) {
    #mall .mall-category-icons {
        width: min(100%, 1360px);
        margin: 0 auto;
    }

    #mall .category-icons-scroll {
        justify-content: center;
        gap: 16px;
        padding: 12px 20px;
    }
}

/* Banner 按双端推荐源图比例渲染，避免固定高度造成额外裁切。 */
#mall .banner-slide picture {
    height: auto;
    aspect-ratio: 75 / 32;
}

@media (min-width: 960px) {
    #mall .banner-slide picture {
        height: auto;
        aspect-ratio: 16 / 5;
    }
}

/* 统一 PC 与移动端轮播展示比例；移动端素材按 16:5 导出即可避免裁切差异。 */
#mall .banner-slide picture {
    aspect-ratio: 16 / 5;
}

/* Banner 的 PC 与移动端统一使用 16:9 展示比例。 */
#mall .banner-slide picture {
    aspect-ratio: 16 / 9;
}

/* 通知提示栏：语义化可点击控件与展示类型动效。 */
#mall button.notification-bar-item {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
}

#mall .notification-bar-item.scrolling {
    animation: notification-fade-in 0.28s ease both;
}

@keyframes notification-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    #mall .notification-bar-item.scrolling {
        animation: none;
    }
}

/* 首页“全部”分类入口：保留首屏快捷分类，并以弹窗展示完整分类列表。 */
#mall .category-icon-item-all .category-icon-image-all {
    background: color-mix(in srgb, var(--accent-green) 10%, var(--card-bg));
    border: 1px dashed color-mix(in srgb, var(--accent-green) 65%, transparent);
    box-shadow: none;
}

#mall .category-icon-item-all:hover .category-icon-image-all,
#mall .category-icon-item-all:focus-visible .category-icon-image-all {
    background: color-mix(in srgb, var(--accent-green) 18%, var(--card-bg));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-green) 45%, transparent);
}

#mall .category-icon-all-mark {
    color: var(--accent-green);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 0.7;
    transform: translateY(-3px);
}

.all-categories-modal[hidden] {
    display: none !important;
}

.all-categories-modal {
    position: fixed;
    z-index: 11000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.all-categories-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: 100%;
    border: 0;
    background: rgba(5, 12, 20, 0.72);
    backdrop-filter: blur(5px);
    cursor: default;
}

.all-categories-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 720px);
    max-height: min(720px, calc(100vh - 40px));
    overflow: auto;
    box-sizing: border-box;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: #17293A;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}


.all-categories-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.all-categories-dialog-header h2 {
    margin: 0;
    color: var(--text-white);
    font-size: 20px;
    line-height: 1.3;
}
.all-categories-dialog-header p {
    margin: 5px 0 0;
    color: var(--text-gray);
    font-size: 13px;
    line-height: 1.5;
}
.all-categories-close {
    display: inline-grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    background: #1E293B;
    color: var(--text-white);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.all-categories-close:hover,
.all-categories-close:focus-visible {
    border-color: color-mix(in srgb, var(--accent-green) 62%, transparent);
    outline: 2px solid color-mix(in srgb, var(--accent-green) 46%, transparent);
    outline-offset: 2px;
}
.all-categories-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px 12px;
}
.all-category-item {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 8px 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-gray);
    font: inherit;
    cursor: pointer;
}
.all-category-item:hover,
.all-category-item:focus-visible,
.all-category-item.is-active {
    color: var(--accent-green);
    background: color-mix(in srgb, var(--accent-green) 8%, transparent);
}
.all-category-item:focus-visible {
    outline: 2px solid var(--accent-green);
    outline-offset: 2px;
}
.all-category-image {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}
.all-category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.all-category-image .category-icon-placeholder {
    font-size: 24px;
}
.all-category-item.is-active .all-category-image {
    box-shadow: 0 0 0 2px var(--accent-green), 0 5px 14px rgba(0, 255, 136, 0.16);
}
.all-category-name {
    width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: 12px;
    line-height: 1.35;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.all-categories-dialog-open {
    overflow: hidden;
}

@media (max-width: 599px) {
    .all-categories-modal {
        align-items: end;
        padding: 0;
    }

    .all-categories-dialog {
        width: 100%;
        max-height: min(78vh, 640px);
        padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
        border-width: 1px 0 0;
        border-radius: 18px 18px 0 0;
    }

    .all-categories-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px 10px;
    }
}

/* “全部”分类始终位于快捷分类首位，并在横向浏览时保持可见。 */
#mall .category-icons-scroll {
    isolation: isolate;
}

#mall .category-icon-item-all {
    position: sticky;
    z-index: 3;
    left: 0;
    flex: 0 0 auto;
    background: #102033;
}

#mall .category-icon-item-all::after {
    position: absolute;
    top: 5px;
    right: -10px;
    bottom: 5px;
    width: 10px;
    background: linear-gradient(90deg, #102033 0%, rgba(16, 32, 51, 0%));
    content: '';
    pointer-events: none;
}

/* 商城首页首屏效率：压缩横幅和区块间距，让商品更早进入可视区域。 */
#mall .mall-banner-carousel {
    margin: 8px 12px 10px;
}
#mall .banner-slide picture {
    height: clamp(118px, 33vw, 142px);
    aspect-ratio: auto;
}
#mall .mall-category-icons {
    padding: 4px 0 8px;
}
#mall .category-icons-scroll {
    padding-top: 4px;
    padding-bottom: 4px;
}
#mall .mall-section-title {
    padding-top: 4px;
    padding-bottom: 8px;
}
#mall .product-grid {
    margin-top: 8px;
}
@media (min-width: 960px) {
    #mall .mall-banner-carousel {
        margin: 16px auto 14px;
    }
    #mall .banner-slide picture {
        height: clamp(190px, 18vw, 230px);
    }
    #mall .mall-category-icons {
        padding: 6px 0 10px;
    }
    #mall .mall-section-title {
        padding-top: 8px;
        padding-bottom: 10px;
    }
}

/* 分类发现：渐变箭头提示横向可滑，并让名称最多显示两行。 */
#mall .mall-category-icons {
    position: relative;
}
#mall .category-icons-scroll {
    scroll-snap-type: x proximity;
    scroll-padding-inline: 12px;
    padding-right: 56px;
}
#mall .category-icon-item {
    scroll-snap-align: start;
}
#mall .category-icon-name {
    display: -webkit-box;
    min-height: 32px;
    max-width: 76px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.28;
    text-overflow: clip;
    white-space: normal;
}
#mall .mall-category-icons.has-category-overflow::after {
    position: absolute;
    z-index: 4;
    top: 8px;
    right: 0;
    bottom: 8px;
    display: grid;
    width: 42px;
    place-items: center;
    background: linear-gradient(90deg, rgba(16, 32, 51, 0), #102033 46%);
    color: var(--accent-green);
    content: '›';
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    pointer-events: none;
}
#mall .mall-category-icons.has-category-overflow::before {
    position: absolute;
    z-index: 5;
    right: 5px;
    bottom: 4px;
    color: rgba(255, 255, 255, 0.72);
    content: '滑动查看更多';
    font-size: 10px;
    line-height: 1;
    pointer-events: none;
    transform: scale(0.86);
    transform-origin: right center;
}
@media (min-width: 960px) {
    #mall .category-icons-scroll {
        padding-right: 56px;
    }
}

/* PC 商城二级分类导航：把高频找货入口固定在内容区顶部。 */
.mall-category-nav {
    display: none;
}
@media (min-width: 960px) {
    #mall .mall-category-nav {
        position: sticky;
        top: 0;
        z-index: 30;
        display: flex;
        gap: 8px;
        margin: -8px 0 18px;
        padding: 10px 0;
        overflow-x: auto;
        background: linear-gradient(180deg, var(--primary-dark) 78%, rgba(16, 32, 51, 0));
        scrollbar-width: none;
    }
    #mall .mall-category-nav::-webkit-scrollbar {
        display: none;
    }
    #mall .mall-category-nav button {
        flex: 0 0 auto;
        min-height: 34px;
        padding: 7px 13px;
        border: 1px solid rgba(184, 196, 209, .16);
        border-radius: 999px;
        background: #17293A;
        color: #B8C4D1;
        font: inherit;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
    }
    #mall .mall-category-nav button:hover,
    #mall .mall-category-nav button:focus-visible,
    #mall .mall-category-nav button.is-active {
        border-color: rgba(0, 215, 122, .62);
        background: rgba(0, 215, 122, .12);
        color: var(--accent-green);
        outline: none;
    }
}

/* 辅助交互：通知可收起，移动端购物车始终可达。 */
#mall .mall-notification-bar {
    padding-right: 44px;
}
#mall .mall-notification-close {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 8px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    color: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}
#mall .mall-notification-close:hover,
#mall .mall-notification-close:focus-visible {
    background: rgba(255, 255, 255, .38);
    outline: 2px solid rgba(255, 255, 255, .75);
    outline-offset: 2px;
}
.mall-floating-cart {
    position: fixed;
    z-index: 90;
    right: 16px;
    bottom: calc(var(--tabbar-height) + 18px);
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(0, 215, 122, .58);
    border-radius: 50%;
    background: #173A31;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .30);
    color: var(--accent-green);
    cursor: pointer;
}
.mall-floating-cart svg {
    width: 24px;
    height: 24px;
}
.mall-floating-cart-badge {
    position: absolute;
    top: -5px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    place-items: center;
    padding: 0 4px;
    border: 2px solid var(--primary-dark);
    border-radius: 999px;
    background: #FF5B5B;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}
@media (min-width: 960px) {
    .mall-floating-cart {
        display: none;
    }
}

/* 移动端不得展示桌面端二级分类导航。 */
@media (max-width: 959px) {
    #mall .mall-category-nav {
        display: none !important;
    }
}
@media (min-width: 960px) {
    #mall .mall-category-nav {
        display: flex !important;
    }
}

/* PC 横幅按原图比例展示，避免固定高度配合 cover 造成大面积裁切。 */
@media (min-width: 960px) {
    #mall .mall-banner-carousel picture,
    #mall .mall-banner-carousel picture img {
        height: auto;
    }
    #mall .mall-banner-carousel picture img {
        object-fit: contain;
    }
}

/* 搜索历史以覆盖式下拉显示，展开时不改变热门搜索和页面内容的位置。 */
#mall .mall-search-shell {
    position: relative;
}
#mall .mall-search-shell #search-suggestions {
    position: absolute !important;
    z-index: 60;
    top: 52px;
    right: 0;
    left: 0;
    margin: 0;
}
#mall .mall-search-shell:has(#search-suggestions[style*="block"]) .mall-search-bar {
    border-radius: 12px;
    border-bottom-color: rgba(255,255,255,.10);
}

/* 移动端首屏居中：避免 100% 横幅叠加左右外边距后向右溢出。 */
@media (max-width: 959px) {
    #mall .mall-banner-carousel {
        width: calc(100% - 24px);
        margin: 8px auto 10px;
    }
    #mall .category-icons-scroll {
        /* 保留首项的图标内侧安全区，避免圆形图标被左侧裁切。 */
        padding-left: 0;
        padding-right: 42px;
    }
    #mall .mall-category-icons.has-category-overflow::after {
        width: 34px;
    }
    #mall .mall-category-icons.has-category-overflow::before {
        content: none;
    }
}

/* 移动端“全部”分类与其他图标同属滚动轨道，避免固定项留下左侧残影。 */
@media (max-width: 959px) {
    #mall .category-icons-scroll {
        isolation: auto;
    }
    #mall .category-icon-item-all {
        position: relative;
        z-index: auto;
        left: auto;
        background: transparent;
    }
    #mall .category-icon-item-all::after {
        content: none;
    }
}

/* PC 端“全部”入口与其余分类使用同一布局轨道，避免居中轨道与吸顶定位叠加。 */
@media (min-width: 960px) {
    #mall .category-icon-item-all {
        position: relative;
        z-index: auto;
        left: auto;
        flex: 0 0 80px;
        background: transparent;
    }
    #mall .category-icon-item-all::after {
        content: none;
    }
}

/* 分类箭头只覆盖图标圆形行，避免被名称行拉低视觉中心。 */
@media (max-width: 959px) {
    #mall .mall-category-icons.has-category-overflow::after {
        top: 8px;
        bottom: auto;
        height: 52px;
    }
}

/* Mobile cart: confine swipe gestures to the cart sheet and keep the mall page fixed. */
@media (max-width: 959px) {
    html.cart-modal-open,
    body.cart-modal-open {
        overflow: hidden;
        overscroll-behavior: none;
    }
    #cart-modal {
        overscroll-behavior: contain;
        touch-action: none;
    }
    #cart-modal .modal-content {
        max-height: calc(100dvh - 32px) !important;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }
    #cart-list {
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
}

/* 商品通知与 Banner 共享容器：通知成为横幅顶部信息条，而非独立区块。 */
#mall .mall-banner-stack {
    position: relative;
    width: min(calc(100% - 24px), 1360px);
    margin: 16px auto 14px;
    overflow: hidden;
    border: 1px solid rgba(184, 196, 209, .16);
    border-radius: 14px;
    background: #132234;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
}
#mall .mall-banner-stack:has(.mall-notification-bar[hidden]):has(.mall-banner-carousel[hidden]) {
    display: none;
}
#mall .mall-banner-stack .mall-notification-bar[hidden] {
    display: none !important;
}
#mall .mall-banner-stack .mall-notification-bar {
    display: flex;
    width: 100%;
    max-width: none;
    min-height: 34px;
    margin: 0;
    padding-right: 36px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .16);
    border-radius: 0;
    box-shadow: none;
    animation: none;
}
#mall .mall-banner-stack .notification-content-wrapper {
    display: flex;
    min-width: 0;
    flex: 1;
}
#mall .mall-banner-stack .notification-bar-item {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 6px 14px;
    gap: 8px;
}
#mall .mall-banner-stack .notification-text-viewport {
    min-width: 0;
}
#mall .mall-banner-stack .notification-bar-icon {
    font-size: 15px;
}
#mall .mall-banner-stack .notification-bar-text {
    font-size: 12px;
    line-height: 1.3;
}
#mall .mall-banner-stack .mall-notification-close {
    right: 6px;
    width: 24px;
    height: 24px;
    font-size: 17px;
}
#mall .mall-banner-stack .mall-banner-carousel {
    width: 100%;
    margin: 0 !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
#mall .mall-banner-stack .mall-banner-carousel[hidden] {
    display: none !important;
}

@media (max-width: 959px) {
    #mall .mall-banner-stack {
        width: calc(100% - 24px);
        margin: 8px auto 10px;
        border-radius: 12px;
    }
    #mall .mall-banner-stack .mall-notification-bar {
        min-height: 34px;
        padding-right: 34px;
    }
    #mall .mall-banner-stack .notification-bar-item {
        min-height: 34px;
        padding: 6px 10px;
        gap: 7px;
    }
    #mall .mall-banner-stack .notification-bar-icon {
        font-size: 14px;
    }
    #mall .mall-banner-stack .notification-bar-text {
        font-size: 12px;
    }
    #mall .mall-banner-stack .mall-notification-close {
        right: 5px;
        width: 22px;
        height: 22px;
        font-size: 16px;
    }
}

/* 前台 Banner 统一以轮播容器为尺寸基准：PC 与移动端均展示为 2.3:1，且使用同一裁切策略。 */
#mall .mall-banner-stack .mall-banner-carousel {
    width: 100%;
    max-width: none;
    aspect-ratio: 23 / 10;
}
#mall .mall-banner-stack .banner-track,
#mall .mall-banner-stack .banner-slide {
    height: 100%;
}
#mall .mall-banner-stack .banner-track {
    display: flex;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
}
#mall .mall-banner-stack .banner-slide {
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
}
#mall .mall-banner-stack .banner-slide picture {
    display: block;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    aspect-ratio: auto;
}
#mall .mall-banner-stack .banner-slide picture img {
    display: block;
    width: 100% !important;
    min-width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
}

/* 首屏信息层级：缩小搜索权重、收紧桌面横幅间距，并让 PC 商品卡片优先居中展示。 */
@media (min-width: 960px) {
    #mall .mall-search-shell {
        width: min(calc(100% - 24px), 1360px);
        max-width: 1360px;
        margin: 0 auto 8px;
    }
    #mall .mall-search-shell .mall-search-bar {
        padding: 3px;
        border-radius: 10px;
    }
    #mall .mall-search-shell .search-input-wrapper {
        height: 38px;
        padding: 0 12px;
        border-radius: 7px 0 0 7px;
    }
    #mall .mall-search-shell .search-btn {
        min-width: 72px;
        height: 38px;
        padding: 0 16px;
        border-radius: 0 7px 7px 0;
        font-size: 13px;
    }
    #mall .mall-search-shell .mall-search-input {
        font-size: 13px;
    }
    #mall .mall-search-shell .search-icon {
        width: 16px;
        height: 16px;
        margin-right: 7px;
    }
    #mall .mall-banner-stack {
        margin-top: 8px;
    }
    #mall .product-grid {
        justify-content: stretch;
    }
    #mall .product-card-actions {
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr) 30px;
        justify-content: initial;
        gap: 8px;
    }
    #mall .product-card-actions .product-cart-btn {
        display: inline-flex !important;
        grid-column: 1;
        order: initial;
    }
    #mall .product-card-actions .product-share-btn {
        grid-column: 3;
        order: initial;
    }
    #mall .product-card-actions .product-redeem-btn {
        grid-column: 2;
        width: 100%;
        min-width: 0;
        padding: 0 12px;
        flex: 0 1 auto !important;
    }
}
@media (min-width: 960px) and (max-width: 1279px) {
    #mall .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1280px) and (max-width: 1599px) {
    #mall .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1600px) {
    #mall .product-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 959px) {
    #mall .mall-search-shell {
        width: calc(100% - 24px);
        margin: 0 auto 10px;
    }
    #mall .mall-search-shell .mall-search-bar {
        padding: 3px;
        border-radius: 10px;
    }
    #mall .mall-search-shell .search-input-wrapper {
        height: 38px;
        padding: 0 12px;
        border-radius: 7px 0 0 7px;
    }
    #mall .mall-search-shell .search-btn {
        min-width: 72px;
        height: 38px;
        padding: 0 14px;
        border-radius: 0 7px 7px 0;
        font-size: 14px;
    }
    #mall .mall-search-shell .mall-search-input {
        font-size: 14px;
    }
    #mall .mall-search-shell .search-icon {
        width: 16px;
        height: 16px;
        margin-right: 7px;
    }
}

/* PC 商品区与页脚之间保持舒适留白，避免自动顶开规则在内容较长时压缩间距。 */
@media (min-width: 960px) {
    #mall .mall-desktop-footer.desktop-module-footer {
        margin-top: clamp(40px, 4vw, 64px);
    }
}

/* 当前分类标题以可点击标签呈现，数量以独立徽标弱化展示。 */
#mall .mall-section-title-category-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin: -7px -10px;
    padding: 7px 10px;
    border: 1px solid rgba(0, 255, 136, .22);
    border-radius: 12px;
    color: var(--text-white);
    background: linear-gradient(135deg, rgba(0, 255, 136, .13), rgba(30, 58, 95, .28));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
    text-decoration: none;
    transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}
#mall .mall-section-title-category-link::after {
    content: '›';
    flex: 0 0 auto;
    color: var(--accent-green);
    font-size: 1.12em;
    line-height: .7;
    transition: transform .2s ease;
}
#mall .mall-section-title-category-link:hover,
#mall .mall-section-title-category-link:focus-visible {
    border-color: rgba(0, 255, 136, .62);
    color: var(--accent-green);
    background: linear-gradient(135deg, rgba(0, 255, 136, .2), rgba(30, 58, 95, .36));
    outline: none;
    transform: translateY(-1px);
}
#mall .mall-section-title-category-link:hover::after,
#mall .mall-section-title-category-link:focus-visible::after { transform: translateX(2px); }
#mall .mall-section-title-category-link:active { transform: translateY(0) scale(.98); }
#mall .mall-section-title-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 2px 7px;
    border-radius: 999px;
    color: #06291a;
    background: var(--accent-green);
    font-size: .52em;
    font-weight: 800;
    line-height: 1.25;
}
#mall .mall-section-title-count::before { content: none; }

/* ===========================================================================
   商品列表差异化加载
   =========================================================================== */
.list-sentinel {
    display: none;
    padding: 20px 0;
    color: var(--text-gray);
    font-size: 14px;
    text-align: center;
}

.infinite-scroll-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 0;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-green);
    border-radius: 50%;
    animation: product-list-spin 0.8s linear infinite;
}

@keyframes product-list-spin {
    to { transform: rotate(360deg); }
}

.infinite-scroll-end {
    padding: 20px 0;
    color: var(--text-gray);
    font-size: 13px;
    opacity: 0.75;
}

.infinite-scroll-error {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 0;
    color: #ff6b6b;
    font-size: 14px;
}

.infinite-scroll-error .retry-btn {
    padding: 6px 16px;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 600;
    background: var(--accent-green);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.infinite-scroll-error .retry-btn:hover {
    opacity: 0.9;
}

.product-pagination {
    margin-top: 16px;
}

.product-pagination .pagination-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.product-pagination .pagination-info,
.product-pagination .pagination-size-selector,
.product-pagination .pagination-jump {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-gray);
    font-size: 14px;
}

.product-pagination .pagination-size-selector select,
.product-pagination .pagination-jump input[type="number"] {
    padding: 4px 8px;
    color: var(--text-primary);
    font: inherit;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: border-color .15s ease;
}

.product-pagination .pagination-size-selector select {
    cursor: pointer;
}

.product-pagination .pagination-jump input[type="number"] {
    width: 64px;
    text-align: center;
}

/* 数字输入框去除原生上下箭头，避免挤占输入空间 */
.product-pagination .pagination-jump input[type="number"]::-webkit-outer-spin-button,
.product-pagination .pagination-jump input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.product-pagination .pagination-jump input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.product-pagination .pagination-size-selector select:hover,
.product-pagination .pagination-jump input[type="number"]:hover {
    border-color: color-mix(in srgb, var(--accent-green) 45%, var(--border-color));
}

.product-pagination .pagination-size-selector select:focus,
.product-pagination .pagination-jump input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-green);
}

.product-pagination .pagination-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

/* 商品页分页继承全局表单按钮时会被拉成全宽，桌面端需保持紧凑横向操作栏。 */
@media (min-width: 960px) {
    .product-pagination .pagination-actions .btn {
        flex: 0 0 auto;
        width: auto;
        min-width: 42px;
        margin-top: 0;
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 14px;
        line-height: 1.2;
    }
}

.product-pagination .pagination-ellipsis {
    padding: 0 4px;
    color: var(--text-gray);
}

.product-pagination .pagination-jump input[type="number"]::-webkit-inner-spin-button,
.product-pagination .pagination-jump input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.product-pagination .pagination-jump input[type="number"] {
    -moz-appearance: textfield;
}

@media (max-width: 959px) {
    .product-pagination {
        display: none;
    }
}

@media (min-width: 960px) {
    .list-sentinel,
    .list-sentinel .infinite-scroll-loading,
    .list-sentinel .infinite-scroll-end,
    .list-sentinel .infinite-scroll-error {
        display: none !important;
    }
}

/* 多平台分享面板 */
.share-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.62);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.share-overlay[hidden] {
    display: none;
}
.share-overlay.is-visible {
    opacity: 1;
}
.share-panel {
    width: min(100%, 380px);
    padding: 24px;
    color: var(--text-primary, var(--text-white));
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}
.share-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.share-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}
.share-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--text-gray);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 50%;
}
.share-close:hover,
.share-close:focus-visible {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}
.share-platforms {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.share-platform-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 92px;
    padding: 12px 6px;
    color: var(--text-white);
    cursor: pointer;
    background: var(--primary-dark);
    border: 1px solid transparent;
    border-radius: 12px;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.share-platform-btn:hover,
.share-platform-btn:focus-visible {
    border-color: var(--platform-color);
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transform: translateY(-2px);
}
.share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    background: var(--platform-color);
    border-radius: 50%;
}
.share-icon.share-icon-image {
    padding: 6px;
    background: #fff;
}
.share-platform-btn[data-platform="x"] .share-icon.share-icon-image {
    background: var(--platform-color);
}
.share-icon img {
    display: block;
    width: 22px;
    height: 22px;
    object-fit: contain;
}
.share-name {
    font-size: 12px;
    line-height: 1.2;
}
.share-qr-code {
    margin-top: 18px;
    padding-top: 18px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}
.share-qr-code p {
    margin: 0 0 12px;
    color: var(--text-gray);
    font-size: 14px;
}
.share-qr-code img {
    display: block;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    border-radius: 10px;
}
@media (max-width: 360px) {
    .share-panel { padding: 18px; }
    .share-platforms { gap: 8px; }
    .share-platform-btn { min-height: 84px; }
}

/* 独立页面导航：保留原有视觉语言，并在文档导航前后提供轻量过渡。 */
body[data-app-page] {
    opacity: 1;
    transition: opacity 180ms ease, transform 180ms ease;
}

html.app-page-leaving body[data-app-page] {
    opacity: 0;
    transform: translateY(6px);
}

@media (prefers-reduced-motion: reduce) {
    body[data-app-page] {
        transition: none;
    }
}

/* 知识首页：与商城商品卡片统一的动效反馈，并在 PC 端改用满宽自适应栅格。 */
#insights .masonry-item {
    position: relative;
    touch-action: manipulation;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
@media (hover: hover) and (pointer: fine) {
    #insights .masonry-item:hover {
        transform: translateY(-3px);
        border-color: color-mix(in srgb, var(--accent-green) 65%, var(--border-color));
        box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
    }
    #insights .masonry-item:active {
        transform: scale(.98);
    }
}
@media (min-width: 960px) {
    #insights.page {
        width: min(100%, 1360px);
        max-width: 1360px;
        padding-inline: clamp(32px, 4vw, 56px);
    }
    #insights .knowledge-list {
        width: 100%;
    }
    #insights .masonry-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
        column-count: unset;
        gap: 18px;
        margin-top: 24px;
    }
    #insights .masonry-item {
        display: flex;
        flex-direction: column;
        width: auto;
        min-height: 0;
        margin: 0;
        break-inside: auto;
        border-radius: 14px;
        background: #1a2a3a;
        outline: 0;
    }
    #insights .masonry-item .card-cover {
        flex: 0 0 auto;
        aspect-ratio: 4 / 3;
        object-fit: cover;
    }
    #insights .masonry-item .card-info {
        display: flex;
        min-height: 104px;
        flex: 1;
        flex-direction: column;
        padding: 13px 14px 14px;
    }
    #insights .masonry-item .card-footer {
        margin-top: auto;
    }
}
@media (prefers-reduced-motion: reduce) {
    #insights .masonry-item { transition: none; }
}

/* 商品卡片图片：首屏优先、视口外延迟加载时保持稳定占位。 */
#mall .product-image {
    position: relative;
    overflow: hidden;
    background: #132234;
}
#mall .product-image .product-card-cover {
    display: block;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(135deg, rgba(39, 58, 76, .92), rgba(25, 42, 58, .92));
    object-fit: cover !important;
    transition: opacity .2s ease, filter .2s ease;
}
#mall .product-image .product-card-cover.lazy-loading {
    opacity: .62;
    filter: saturate(.75);
}
#mall .product-image .product-card-cover.lazy-loaded {
    opacity: 1;
    filter: none;
}
#mall .product-image .product-card-cover.lazy-error {
    min-height: 72px;
    opacity: .45;
}
#mall .product-image.is-image-error {
    background: linear-gradient(145deg, rgba(38, 57, 76, .96), rgba(22, 38, 53, .96));
}
#mall .product-image-fallback {
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 120px;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 14px;
    box-sizing: border-box;
    color: var(--text-gray);
    text-align: center;
}
#mall .product-image-fallback-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid rgba(255, 190, 90, .58);
    border-radius: 50%;
    color: #ffcb78;
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
}
#mall .product-image-fallback-message {
    font-size: 12px;
    font-weight: 600;
}
#mall .product-image-retry {
    min-height: 28px;
    padding: 4px 11px;
    border: 1px solid rgba(0, 255, 136, .62);
    border-radius: 999px;
    background: rgba(0, 255, 136, .10);
    color: var(--accent-green);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
#mall .product-image-retry:hover { background: rgba(0, 255, 136, .20); }
#mall .product-image-retry:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* 社群营销结算前提示 */
.community-promo-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, .68);
    backdrop-filter: blur(4px);
}
.community-promo-dialog {
    position: relative;
    width: min(100%, 430px);
    padding: 30px;
    border: 1px solid rgba(0, 255, 136, .35);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .46);
    text-align: center;
}
.community-promo-close { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; color: var(--text-gray); font-size: 26px; cursor: pointer; }
.community-promo-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; background: rgba(0, 255, 136, .12); color: var(--accent-green); font-size: 28px; }
.community-promo-dialog h2 { margin: 0 0 10px; color: var(--text-white); font-size: 23px; }
.community-promo-description { margin: 0 0 12px; color: var(--text-gray); white-space: pre-line; line-height: 1.6; }
.community-promo-coupon { margin: 0 0 8px; color: var(--accent-green); font-weight: 700; font-size: 17px; }
.community-promo-subtext { margin: 0 0 20px; color: var(--text-gray); font-size: 13px; line-height: 1.5; }
.community-promo-actions { display: grid; gap: 10px; }
.community-promo-actions button { min-height: 44px; border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.community-promo-primary { background: var(--accent-green); color: var(--primary-dark); }
.community-promo-secondary { background: rgba(0, 255, 136, .10); color: var(--accent-green); }

/* 未登录现金购买路径选择 */
.guest-purchase-choice-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, .68);
    backdrop-filter: blur(4px);
}
.guest-purchase-choice {
    position: relative;
    width: min(100%, 420px);
    padding: 30px;
    border: 1px solid rgba(0, 255, 136, .35);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .46);
    text-align: center;
}
.guest-purchase-choice-close { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; color: var(--text-gray); font-size: 26px; cursor: pointer; }
.guest-purchase-choice-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%; background: rgba(0, 255, 136, .12); font-size: 26px; }
.guest-purchase-choice h2 { margin: 0 0 10px; color: var(--text-white); font-size: 22px; }
.guest-purchase-choice p { margin: 0 0 20px; color: var(--text-gray); line-height: 1.6; }
.guest-purchase-choice-primary, .guest-purchase-choice-secondary { width: 100%; min-height: 46px; border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 650; cursor: pointer; }
.guest-purchase-choice-primary { margin-bottom: 10px; background: var(--accent-green); color: var(--primary-dark); }
.guest-purchase-choice-secondary { background: rgba(0, 255, 136, .10); color: var(--accent-green); }

/* --------------------------------------------------------------------------
   Desktop commerce workspace
   These overrides intentionally start at 960px, retaining the focused
   mobile / Telegram bottom-sheet experience below that breakpoint.
   -------------------------------------------------------------------------- */
@media (min-width: 960px) {
    #checkout-modal,
    #my-orders-modal,
    #order-detail-modal,
    #coupons-modal,
    #addresses-modal,
    #address-form-modal {
        align-items: center;
        padding: clamp(24px, 4vw, 56px);
        background:
            radial-gradient(circle at 15% 0%, rgba(0, 255, 136, .09), transparent 34%),
            rgba(3, 11, 23, .76);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    #checkout-modal .modal-content,
    #my-orders-modal .modal-content,
    #order-detail-modal .modal-content,
    #coupons-modal .modal-content,
    #addresses-modal .modal-content,
    #address-form-modal .modal-content {
        border: 1px solid rgba(148, 163, 184, .22);
        border-radius: 22px;
        border-bottom: 1px solid rgba(148, 163, 184, .22);
        box-shadow: 0 30px 80px rgba(0, 0, 0, .48);
        animation: desktopModalEnter .22s cubic-bezier(.2, .8, .2, 1);
    }

    #checkout-modal .modal-content::before,
    #my-orders-modal .modal-content::before,
    #order-detail-modal .modal-content::before,
    #coupons-modal .modal-content::before,
    #addresses-modal .modal-content::before,
    #address-form-modal .modal-content::before {
        display: none;
    }

    @keyframes desktopModalEnter {
        from { opacity: 0; transform: translateY(12px) scale(.985); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .checkout-workspace {
        width: min(1160px, 100%);
        max-width: 1160px;
        height: min(820px, calc(100dvh - 64px));
        max-height: min(820px, calc(100dvh - 64px));
        padding: 0 !important;
        overflow: hidden;
        background:
            linear-gradient(135deg, rgba(23, 43, 64, .98), rgba(11, 26, 43, .98));
    }

    .checkout-workspace-header {
        min-height: 78px;
        padding: 14px 24px;
        border-bottom: 1px solid rgba(148, 163, 184, .14);
        background: rgba(9, 23, 39, .64);
    }

    .checkout-workspace-header::after { display: none; }
    .checkout-workspace-header .modal-back,
    .checkout-workspace-header .modal-close {
        width: 40px;
        height: 40px;
        border: 1px solid rgba(148, 163, 184, .22);
        border-radius: 10px;
        background: rgba(255, 255, 255, .035);
        opacity: 1;
    }

    .checkout-workspace-header .modal-close::before,
    .checkout-workspace-header .modal-close::after { width: 14px; }

    .checkout-title-block {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
    }
    .checkout-title-block .modal-title {
        position: static;
        width: auto;
        transform: none;
        font-size: 20px;
        letter-spacing: .015em;
    }
    .checkout-overline,
    .checkout-section-kicker {
        color: var(--accent-green);
        font-size: 11px;
        font-weight: 750;
        letter-spacing: .1em;
        line-height: 1.2;
        text-transform: uppercase;
    }
    .checkout-overline { margin-bottom: 4px; }

    .checkout-workspace-body {
        display: grid;
        grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr);
        height: calc(100% - 78px);
        min-height: 0;
    }

    .checkout-lines-panel {
        display: flex;
        min-width: 0;
        min-height: 0;
        flex-direction: column;
        padding: 28px clamp(24px, 3vw, 40px);
        border-right: 1px solid rgba(148, 163, 184, .14);
        background: linear-gradient(180deg, rgba(13, 31, 50, .48), rgba(12, 28, 45, .2));
    }

    .checkout-summary-panel {
        min-width: 0;
        overflow-y: auto;
        padding: 26px clamp(22px, 2.5vw, 34px) 28px;
        background: rgba(7, 18, 31, .36);
        scrollbar-width: thin;
        scrollbar-color: rgba(148, 163, 184, .34) transparent;
    }

    .checkout-summary-panel::-webkit-scrollbar { width: 7px; }
    .checkout-summary-panel::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(148, 163, 184, .3); }

    .checkout-section-heading {
        display: flex;
        align-items: end;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 20px;
    }
    .checkout-section-heading h3 {
        margin-top: 5px;
        color: var(--text-white);
        font-size: 18px;
        line-height: 1.2;
    }
    .checkout-section-heading-compact { margin-bottom: 14px; }
    .checkout-section-heading-compact h3 { font-size: 15px; }
    .checkout-line-hint { color: var(--text-gray); font-size: 12px; }

    .checkout-items-list {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding-right: 8px;
        scrollbar-width: thin;
        scrollbar-color: rgba(148, 163, 184, .34) transparent;
    }
    .checkout-items-list::-webkit-scrollbar { width: 7px; }
    .checkout-items-list::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(148, 163, 184, .3); }

    .checkout-items-list .checkout-item,
    .checkout-items-list > div {
        border-radius: 14px;
    }

    .checkout-config-section {
        padding: 0 0 21px;
        margin: 0 0 21px;
        border-bottom: 1px solid rgba(148, 163, 184, .13);
    }
    .checkout-config-section:last-of-type { margin-bottom: 18px; }

    .checkout-delivery-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .checkout-delivery-option {
        display: flex;
        min-height: 74px;
        align-items: center;
        gap: 11px;
        padding: 12px 13px;
        border: 1px solid rgba(148, 163, 184, .22);
        border-radius: 12px;
        background: rgba(255, 255, 255, .025);
        cursor: pointer;
        transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
    }
    .checkout-delivery-option:has(input:checked),
    .checkout-delivery-option.is-selected {
        border-color: rgba(0, 255, 136, .64);
        background: linear-gradient(135deg, rgba(0, 255, 136, .13), rgba(0, 255, 136, .045));
        box-shadow: inset 0 0 0 1px rgba(0, 255, 136, .1);
    }
    .checkout-delivery-option input { width: 18px; height: 18px; accent-color: var(--accent-green); }
    .checkout-delivery-option-copy { display: grid; gap: 4px; }
    .checkout-delivery-option-copy strong { font-size: 14px; }
    .checkout-delivery-option-copy small { color: var(--text-gray); font-size: 12px; }
    .checkout-delivery-option:has(input:checked) small { color: var(--accent-green); }

    .checkout-control,
    .checkout-summary-panel .form-input {
        width: 100%;
        min-height: 46px;
        padding: 11px 13px;
        border: 1px solid rgba(148, 163, 184, .24);
        border-radius: 10px;
        background: rgba(5, 18, 35, .72);
        color: var(--text-white);
        font: inherit;
        font-size: 14px;
        transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
    }
    .checkout-control:focus,
    .checkout-summary-panel .form-input:focus {
        border-color: rgba(0, 255, 136, .74);
        outline: none;
        background: rgba(5, 18, 35, .94);
        box-shadow: 0 0 0 3px rgba(0, 255, 136, .10);
    }

    .checkout-address-controls { display: grid; gap: 10px; }
    .checkout-inline-action {
        justify-self: start;
        min-height: 34px;
        padding: 0 10px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--accent-green);
        font: inherit;
        font-size: 13px;
        font-weight: 650;
        cursor: pointer;
    }
    .checkout-helper-card,
    .checkout-coupon-detail {
        display: grid;
        gap: 5px;
        margin-top: 10px;
        padding: 11px 12px;
        border: 1px solid rgba(0, 255, 136, .22);
        border-radius: 10px;
        background: rgba(0, 255, 136, .07);
        color: rgba(226, 232, 240, .88);
        font-size: 13px;
        line-height: 1.5;
    }

    .checkout-guest-fields { margin-top: 14px; }
    .checkout-summary-panel .address-paste-card {
        margin-bottom: 16px !important;
        padding: 13px !important;
    }
    .checkout-form-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 13px;
    }
    .checkout-field { display: grid; gap: 7px; min-width: 0; }
    .checkout-field > span { color: rgba(226, 232, 240, .8); font-size: 12px; font-weight: 650; }
    .checkout-field > span em { color: var(--accent-green); font-size: 11px; font-style: normal; font-weight: 600; }
    .checkout-field-wide { grid-column: 1 / -1; }
    .checkout-field-inline { display: flex; min-width: 0; gap: 8px; }
    .checkout-field-inline .form-input { min-width: 0; }
    .checkout-field-inline button,
    .checkout-manual-coupon button {
        flex: 0 0 auto;
        min-height: 46px;
        padding: 0 12px;
        border: 1px solid rgba(0, 255, 136, .55);
        border-radius: 10px;
        background: rgba(0, 255, 136, .10);
        color: var(--accent-green);
        font: inherit;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
    }
    .checkout-field-help { margin-top: 9px; color: var(--text-gray); font-size: 12px; line-height: 1.5; }
    .checkout-manual-coupon { display: flex; gap: 8px; margin-top: 10px; }
    .checkout-manual-coupon .form-input { min-width: 0; }

    .checkout-price-card {
        margin: 0 0 14px;
        padding: 16px;
        border: 1px solid rgba(148, 163, 184, .18);
        border-radius: 14px;
        background: linear-gradient(135deg, rgba(32, 63, 88, .52), rgba(13, 31, 50, .74));
    }
    .checkout-price-row,
    .checkout-price-total {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }
    .checkout-price-row { margin-bottom: 10px; color: var(--text-gray); font-size: 13px; }
    .checkout-price-row > span:last-child { color: var(--text-white); font-weight: 650; font-variant-numeric: tabular-nums; }
    .checkout-price-row .checkout-price-discount { color: var(--accent-green); }
    .checkout-price-total { margin-top: 12px; padding-top: 14px; border-top: 1px solid rgba(148, 163, 184, .18); font-size: 15px; font-weight: 700; }
    .checkout-price-total strong { color: var(--accent-green); font-size: 21px; font-variant-numeric: tabular-nums; }

    .checkout-submit-btn {
        width: 100%;
        min-height: 50px;
        border: 0;
        border-radius: 12px;
        background: linear-gradient(135deg, #24f0a0, var(--accent-green));
        box-shadow: 0 10px 24px rgba(0, 255, 136, .18);
        color: #06231b;
        cursor: pointer;
        font: inherit;
        font-size: 15px;
        font-weight: 800;
        letter-spacing: .02em;
        transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
    }
    .checkout-submit-hint { margin: 9px 0 0; color: var(--text-gray); font-size: 11px; text-align: center; }

    .checkout-workspace button:focus-visible,
    .checkout-workspace select:focus-visible,
    .checkout-workspace input:focus-visible {
        outline: 2px solid var(--accent-green);
        outline-offset: 2px;
    }

    @media (hover: hover) and (pointer: fine) {
        .checkout-workspace-header .modal-back:hover,
        .checkout-workspace-header .modal-close:hover,
        .checkout-inline-action:hover {
            border-color: rgba(0, 255, 136, .55);
            background: rgba(0, 255, 136, .09);
            color: var(--accent-green);
        }
        .checkout-delivery-option:hover {
            border-color: rgba(148, 163, 184, .52);
            transform: translateY(-1px);
        }
        .checkout-field-inline button:hover,
        .checkout-manual-coupon button:hover {
            background: rgba(0, 255, 136, .18);
        }
        .checkout-submit-btn:hover {
            filter: brightness(1.04);
            box-shadow: 0 14px 30px rgba(0, 255, 136, .28);
            transform: translateY(-1px);
        }
    }

    @media (max-width: 1110px) {
        .checkout-workspace { width: min(1000px, 100%); }
        .checkout-workspace-body { grid-template-columns: minmax(0, 1fr) minmax(340px, .78fr); }
        .checkout-lines-panel { padding: 24px; }
        .checkout-summary-panel { padding: 22px; }
        .checkout-delivery-options { grid-template-columns: 1fr; }
    }
}

@media (min-width: 960px) and (max-height: 760px) {
    .checkout-workspace { height: calc(100dvh - 36px); max-height: calc(100dvh - 36px); }
    .checkout-workspace-header { min-height: 66px; }
    .checkout-workspace-body { height: calc(100% - 66px); }
    .checkout-config-section { padding-bottom: 15px; margin-bottom: 15px; }
    .checkout-section-heading { margin-bottom: 13px; }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Desktop management workspaces: pending payment, orders, coupons and addresses. */
@media (min-width: 960px) {
    .desktop-management-modal {
        display: flex;
        flex-direction: column;
        min-width: 0;
        width: min(1100px, 100%);
        max-width: 1100px;
        height: min(760px, calc(100dvh - 72px));
        max-height: min(760px, calc(100dvh - 72px));
        padding: 0 !important;
        overflow: hidden;
        background: linear-gradient(135deg, rgba(23, 43, 64, .985), rgba(10, 25, 42, .985));
    }
    .order-detail-workspace { width: min(900px, 100%); max-width: 900px; }
    .address-form-sheet { width: min(820px, 100%) !important; max-width: 820px !important; max-height: min(760px, calc(100dvh - 72px)) !important; }

    .management-modal-header {
        flex: 0 0 auto;
        min-height: 78px;
        padding: 14px 24px;
        border-bottom: 1px solid rgba(148, 163, 184, .14);
        background: rgba(7, 18, 31, .46);
    }
    .management-modal-header::after { display: none; }
    .management-modal-header .modal-back,
    .management-modal-header .modal-close {
        width: 40px;
        height: 40px;
        border: 1px solid rgba(148, 163, 184, .22);
        border-radius: 10px;
        background: rgba(255, 255, 255, .035);
        opacity: 1;
    }
    .management-title-block {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: grid;
        gap: 4px;
        text-align: center;
    }
    .management-overline {
        color: var(--accent-green);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .12em;
        line-height: 1;
    }
    .management-title-block .modal-title {
        position: static;
        width: auto;
        transform: none;
        font-size: 20px;
        letter-spacing: .01em;
    }

    .management-toolbar {
        display: flex;
        flex: 0 0 auto;
        min-height: 76px;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        padding: 14px 26px;
        border-bottom: 1px solid rgba(148, 163, 184, .14);
        background: rgba(5, 17, 30, .24);
    }
    .management-filter-group,
    .management-toolbar-actions { display: flex; align-items: center; gap: 8px; }
    .management-filter {
        min-height: 34px;
        padding: 0 12px;
        border: 1px solid transparent;
        border-radius: 8px;
        background: transparent;
        color: var(--text-gray);
        cursor: pointer;
        font: inherit;
        font-size: 13px;
        font-weight: 650;
        transition: color .18s ease, background .18s ease, border-color .18s ease;
    }
    .management-filter.is-active {
        border-color: rgba(0, 255, 136, .36);
        background: rgba(0, 255, 136, .11);
        color: var(--accent-green);
    }
    .management-search { position: relative; display: block; min-width: min(310px, 32vw); }
    .management-search::before {
        content: '⌕';
        position: absolute;
        top: 50%;
        left: 12px;
        color: var(--text-gray);
        font-size: 18px;
        line-height: 1;
        pointer-events: none;
        transform: translateY(-53%);
    }
    .management-search input {
        width: 100%;
        min-height: 40px;
        padding: 0 12px 0 34px;
        border: 1px solid rgba(148, 163, 184, .22);
        border-radius: 10px;
        background: rgba(5, 18, 35, .68);
        color: var(--text-white);
        font: inherit;
        font-size: 13px;
        transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
    }
    .management-search input:focus {
        border-color: rgba(0, 255, 136, .68);
        outline: none;
        background: rgba(5, 18, 35, .92);
        box-shadow: 0 0 0 3px rgba(0, 255, 136, .10);
    }
    .management-summary { color: var(--text-gray); font-size: 13px; font-weight: 600; }
    .management-primary-action {
        min-height: 40px;
        padding: 0 15px;
        border: 0;
        border-radius: 10px;
        background: var(--accent-green);
        color: #05251a;
        cursor: pointer;
        font: inherit;
        font-size: 13px;
        font-weight: 800;
        white-space: nowrap;
        transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    }
    .management-content {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        overflow-y: auto;
        padding: 24px 26px 28px;
        scrollbar-width: thin;
        scrollbar-color: rgba(148, 163, 184, .34) transparent;
    }
    .desktop-management-modal > .management-content,
    .desktop-management-modal > .orders-management-content,
    .desktop-management-modal > .desktop-coupon-list,
    .desktop-management-modal > .desktop-address-list { flex: 1; }
    .management-content::-webkit-scrollbar { width: 7px; }
    .management-content::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(148, 163, 184, .32); }

    .desktop-order-list { display: grid; gap: 12px; }
    .desktop-order-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0 20px;
        margin: 0;
        padding: 18px 20px;
        border: 1px solid rgba(148, 163, 184, .19);
        border-radius: 14px;
        background: linear-gradient(135deg, rgba(18, 41, 62, .76), rgba(9, 24, 40, .68));
        cursor: pointer;
        transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
    }
    .desktop-order-card[hidden] { display: none; }
    .desktop-order-card .order-header { grid-column: 1 / -1; margin-bottom: 14px; }
    .desktop-order-card .order-body { min-width: 0; }
    .desktop-order-card .order-product-image,
    .desktop-order-card .order-product-image-placeholder { width: 68px; height: 68px; margin-right: 14px; border-radius: 10px; }
    .desktop-order-card .order-product-name { font-size: 15px; }
    .desktop-order-card .order-product-points { margin-top: 7px; font-size: 14px; font-weight: 750; }
    .desktop-order-card > div[style*="margin-top"] { grid-column: 1 / -1; }
    .desktop-order-card > button { grid-column: 2; grid-row: 2; align-self: end; }
    .desktop-order-card:focus-visible { outline: 2px solid var(--accent-green); outline-offset: 3px; }
    .order-detail-content { color: var(--text-white); }

    .desktop-coupon-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-content: start; }
    .desktop-coupon-card {
        position: relative;
        display: grid;
        grid-template-columns: 116px minmax(0, 1fr) auto;
        min-height: 144px;
        overflow: hidden;
        border: 1px solid rgba(148, 163, 184, .20);
        border-radius: 14px;
        background: linear-gradient(135deg, rgba(22, 48, 71, .92), rgba(10, 25, 43, .96));
    }
    .desktop-coupon-card::after {
        content: '';
        position: absolute;
        top: 14px;
        bottom: 14px;
        left: 116px;
        border-left: 1px dashed rgba(148, 163, 184, .26);
    }
    .desktop-coupon-value {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 16px 10px;
        background: linear-gradient(135deg, rgba(0, 255, 136, .22), rgba(0, 255, 136, .07));
        color: var(--accent-green);
        text-align: center;
    }
    .desktop-coupon-value strong { font-size: 23px; line-height: 1.1; }
    .desktop-coupon-value span { color: rgba(220, 255, 240, .75); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
    .desktop-coupon-main { min-width: 0; padding: 18px 15px 14px 22px; }
    .desktop-coupon-main h3 { overflow: hidden; margin: 0 0 10px; color: var(--text-white); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
    .desktop-coupon-code { margin: 0; color: var(--text-gray); font-size: 12px; }
    .desktop-coupon-code code { margin-left: 5px; color: var(--accent-green); font-size: 12px; font-weight: 700; }
    .desktop-coupon-meta { display: grid; gap: 4px; margin-top: 12px; color: var(--text-gray); font-size: 11px; line-height: 1.35; }
    .desktop-coupon-copy {
        align-self: end;
        margin: 0 14px 14px 0;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--accent-green);
        cursor: pointer;
        font: inherit;
        font-size: 12px;
        font-weight: 750;
    }

    .desktop-address-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-content: start; }
    .desktop-address-card {
        min-height: 198px;
        padding: 18px;
        border: 1px solid rgba(148, 163, 184, .20);
        border-radius: 14px;
        background: linear-gradient(135deg, rgba(18, 41, 62, .76), rgba(9, 24, 40, .68));
    }
    .desktop-address-card.is-default { border-color: rgba(0, 255, 136, .58); box-shadow: inset 0 0 0 1px rgba(0, 255, 136, .08); }
    .desktop-address-card-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
    .desktop-address-recipient { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; }
    .desktop-address-recipient strong { font-size: 16px; }
    .desktop-address-recipient span { padding: 3px 7px; border-radius: 5px; background: rgba(0, 255, 136, .12); color: var(--accent-green); font-size: 11px; font-weight: 700; }
    .desktop-address-recipient em { color: var(--accent-green); font-size: 11px; font-style: normal; font-weight: 700; }
    .desktop-address-actions { display: flex; flex: 0 0 auto; gap: 6px; }
    .desktop-address-actions button,
    .desktop-address-default {
        min-height: 30px;
        padding: 0 9px;
        border: 1px solid rgba(148, 163, 184, .28);
        border-radius: 7px;
        background: transparent;
        color: var(--text-gray);
        cursor: pointer;
        font: inherit;
        font-size: 12px;
        font-weight: 650;
    }
    .desktop-address-actions .is-danger { border-color: rgba(255, 71, 87, .48); color: #ff8792; }
    .desktop-address-phone { margin: 17px 0 6px; color: rgba(226, 232, 240, .88); font-size: 13px; font-variant-numeric: tabular-nums; }
    .desktop-address-value { min-height: 39px; margin: 0; color: var(--text-gray); font-size: 13px; line-height: 1.55; }
    .desktop-address-default { margin-top: 15px; border-color: rgba(0, 255, 136, .46); color: var(--accent-green); }
    .desktop-address-default-state { display: inline-block; margin-top: 18px; color: var(--accent-green); font-size: 12px; font-weight: 750; }
    .management-empty-result { grid-column: 1 / -1; padding: 54px 20px; color: var(--text-gray); text-align: center; }

    .address-form-sheet .address-form-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; padding: 8px 2px 14px; }
    .address-form-sheet .address-form-body > .address-paste-card,
    .address-form-sheet .address-form-body > div:nth-of-type(4),
    .address-form-sheet .address-form-body > div:nth-of-type(7),
    .address-form-sheet .address-form-body > div:nth-of-type(8),
    .address-form-sheet .address-form-body > label { grid-column: 1 / -1; }
    .address-form-sheet .address-form-footer { padding: 17px 2px 2px !important; }

    @media (hover: hover) and (pointer: fine) {
        .management-filter:hover { color: var(--text-white); background: rgba(255, 255, 255, .055); }
        .management-primary-action:hover { filter: brightness(1.05); box-shadow: 0 10px 22px rgba(0, 255, 136, .20); transform: translateY(-1px); }
        .desktop-order-card:hover { border-color: rgba(0, 255, 136, .38); background: linear-gradient(135deg, rgba(24, 54, 78, .9), rgba(10, 29, 47, .88)); box-shadow: 0 10px 24px rgba(0, 0, 0, .18); transform: translateY(-1px); }
        .desktop-coupon-card:hover { border-color: rgba(0, 255, 136, .44); box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
        .desktop-coupon-copy:hover,
        .desktop-address-default:hover { background: rgba(0, 255, 136, .10); }
        .desktop-address-actions button:hover { border-color: rgba(0, 255, 136, .42); color: var(--accent-green); }
        .desktop-address-actions .is-danger:hover { border-color: rgba(255, 71, 87, .75); background: rgba(255, 71, 87, .08); color: #ff9ca5; }
    }

    .management-filter:focus-visible,
    .management-search input:focus-visible,
    .management-primary-action:focus-visible,
    .desktop-coupon-copy:focus-visible,
    .desktop-address-actions button:focus-visible,
    .desktop-address-default:focus-visible { outline: 2px solid var(--accent-green); outline-offset: 2px; }
}

@media (min-width: 960px) and (max-width: 1120px) {
    .desktop-management-modal { width: min(920px, 100%); }
    .desktop-coupon-list { grid-template-columns: 1fr; }
    .desktop-address-list { grid-template-columns: 1fr; }
    .management-search { min-width: 250px; }
}

@media (max-width: 959px) {
    .management-toolbar { display: grid; gap: 12px; margin: 0 -4px; padding: 10px 4px 14px; }
    .management-filter-group { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; }
    .management-filter { flex: 0 0 auto; min-height: 34px; padding: 0 10px; border: 1px solid var(--border-color); border-radius: 8px; background: transparent; color: var(--text-gray); font: inherit; font-size: 12px; }
    .management-filter.is-active { border-color: var(--accent-green); color: var(--accent-green); }
    .management-search { display: block; width: 100%; }
    .management-search input { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--border-color); border-radius: 9px; background: var(--primary-dark); color: var(--text-white); font: inherit; }
    .management-toolbar-actions { display: grid; gap: 10px; }
    .management-primary-action { min-height: 42px; border: 0; border-radius: 9px; background: var(--accent-green); color: var(--primary-dark); font: inherit; font-weight: 750; }
    .desktop-coupon-list,
    .desktop-address-list { display: grid; gap: 12px; }
    .desktop-coupon-card { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; min-height: 124px; overflow: hidden; border: 1px solid var(--border-color); border-radius: 12px; background: var(--primary-dark); }
    .desktop-coupon-value { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px; background: rgba(0, 255, 136, .12); color: var(--accent-green); text-align: center; }
    .desktop-coupon-value strong { font-size: 17px; }
    .desktop-coupon-value span { font-size: 9px; }
    .desktop-coupon-main { min-width: 0; padding: 14px 7px 12px 13px; }
    .desktop-coupon-main h3 { overflow: hidden; margin: 0 0 8px; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
    .desktop-coupon-code,
    .desktop-coupon-meta { color: var(--text-gray); font-size: 11px; }
    .desktop-coupon-meta { display: grid; gap: 3px; margin-top: 8px; }
    .desktop-coupon-copy { align-self: end; margin: 0 10px 12px 0; padding: 0; border: 0; background: transparent; color: var(--accent-green); font: inherit; font-size: 11px; }
    .desktop-address-card { padding: 15px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--primary-dark); }
    .desktop-address-card + .desktop-address-card { margin-top: 12px; }
    .desktop-address-card-head,
    .desktop-address-actions,
    .desktop-address-recipient { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .desktop-address-recipient { justify-content: flex-start; flex-wrap: wrap; }
    .desktop-address-recipient strong { font-size: 15px; }
    .desktop-address-recipient span,
    .desktop-address-recipient em { color: var(--accent-green); font-size: 11px; font-style: normal; }
    .desktop-address-actions button,
    .desktop-address-default { min-height: 30px; padding: 0 8px; border: 1px solid var(--border-color); border-radius: 7px; background: transparent; color: var(--text-gray); font: inherit; font-size: 11px; }
    .desktop-address-actions .is-danger { color: #ff8792; }
    .desktop-address-phone { margin: 13px 0 5px; color: var(--text-white); font-size: 13px; }
    .desktop-address-value { margin: 0; color: var(--text-gray); font-size: 13px; line-height: 1.5; }
    .desktop-address-default { display: inline-block; margin-top: 13px; border-color: var(--accent-green); color: var(--accent-green); }
    .desktop-address-default-state { display: inline-block; margin-top: 13px; color: var(--accent-green); font-size: 12px; }
    .management-empty-result { padding: 40px 16px; color: var(--text-gray); text-align: center; }
}

/* PC 端 Telegram 登录：居中卡片式账号选择弹窗。 */
@media (min-width: 960px) {
    .telegram-browser-auth-choice {
        z-index: 12100;
        padding: clamp(20px, 3vw, 36px);
    }
    .telegram-browser-auth-backdrop {
        background:
            radial-gradient(circle at 50% 0%, rgba(0, 255, 136, .08), transparent 38%),
            rgba(2, 10, 20, .76);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    .telegram-browser-auth-card {
        width: min(640px, 100%);
        gap: 18px;
        padding: 36px 38px 38px;
        border: 1px solid rgba(148, 163, 184, .28);
        border-radius: 22px;
        background: linear-gradient(145deg, rgba(29, 48, 69, .99), rgba(17, 34, 53, .99));
        box-shadow: 0 24px 64px rgba(0, 0, 0, .50);
    }
    .telegram-browser-auth-card strong {
        padding-right: 52px;
        color: var(--text-white);
        font-size: clamp(24px, 1.8vw, 28px);
        font-weight: 800;
        letter-spacing: -.025em;
        line-height: 1.25;
    }
    .telegram-browser-auth-card p {
        max-width: 520px;
        color: #aeb9c6;
        font-size: clamp(16px, 1.25vw, 18px);
        font-weight: 500;
        line-height: 1.55;
    }
    .telegram-browser-auth-close {
        top: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        border-color: rgba(148, 163, 184, .28);
        background: rgba(5, 18, 34, .58);
        color: var(--text-white);
        font-size: 30px;
        line-height: 1;
        transition: border-color .18s ease, background .18s ease, transform .18s ease;
    }
    .telegram-browser-auth-login,
    .telegram-browser-auth-mini {
        min-height: 64px;
        padding: 12px 22px;
        border-radius: 15px;
        font-size: clamp(18px, 1.45vw, 21px);
        font-weight: 800;
        letter-spacing: -.02em;
        transition: transform .18s ease, filter .18s ease, border-color .18s ease, background .18s ease;
    }
    .telegram-browser-auth-login {
        background: linear-gradient(135deg, #16ef8c, var(--accent-green));
        color: #05251a;
        box-shadow: 0 12px 26px rgba(0, 255, 136, .18);
    }
    .telegram-browser-auth-mini {
        border-color: rgba(148, 163, 184, .30);
        background: rgba(8, 24, 41, .64);
        color: var(--text-white);
    }
    .telegram-browser-auth-close:hover {
        border-color: rgba(0, 255, 136, .52);
        background: rgba(0, 255, 136, .10);
        transform: scale(.96);
    }
    .telegram-browser-auth-login:hover {
        filter: brightness(1.05);
        transform: translateY(-1px);
    }
    .telegram-browser-auth-mini:hover {
        border-color: rgba(0, 255, 136, .50);
        background: rgba(0, 255, 136, .08);
        color: var(--accent-green);
    }
    .telegram-browser-auth-close:focus-visible,
    .telegram-browser-auth-login:focus-visible,
    .telegram-browser-auth-mini:focus-visible {
        outline: 2px solid var(--accent-green);
        outline-offset: 3px;
    }
}

@media (min-width: 960px) {
    .telegram-browser-auth-choice {
        position: fixed;
        inset: 0;
        display: grid;
        place-items: center;
    }
    .telegram-browser-auth-backdrop {
        position: absolute;
        inset: 0;
        width: 100%;
        border: 0;
        cursor: default;
    }
    .telegram-browser-auth-card {
        position: relative;
        z-index: 1;
        display: grid;
    }
    .telegram-browser-auth-close {
        position: absolute;
        display: grid;
        place-items: center;
        padding: 0;
        cursor: pointer;
    }
    .telegram-browser-auth-login,
    .telegram-browser-auth-mini { cursor: pointer; }
}

/* 手机端访客结算：保留底部抽屉结构，并为后续新增的访客字段补齐触控样式。 */
@media (max-width: 959px) {
    .checkout-workspace-body {
        display: block;
        padding: 0 2px 8px;
    }
    .checkout-lines-panel {
        padding: 4px 0 18px;
        border-bottom: 1px solid rgba(148, 163, 184, .16);
    }
    .checkout-summary-panel {
        padding: 18px 0 calc(12px + var(--safe-area-bottom));
    }
    .checkout-section-heading {
        display: flex;
        align-items: end;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
    }
    .checkout-section-heading h3 {
        margin: 3px 0 0;
        color: var(--text-white);
        font-size: 17px;
        line-height: 1.25;
    }
    .checkout-section-kicker {
        color: var(--accent-green);
        font-size: 11px;
        font-weight: 750;
        letter-spacing: .08em;
    }
    .checkout-line-hint {
        max-width: 128px;
        color: var(--text-gray);
        font-size: 11px;
        line-height: 1.4;
        text-align: right;
    }
    .checkout-config-section {
        margin: 0 0 18px;
        padding: 0 0 18px;
        border-bottom: 1px solid rgba(148, 163, 184, .14);
    }
    .checkout-config-section:last-of-type {
        margin-bottom: 16px;
        border-bottom: 0;
    }
    .checkout-delivery-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }
    .checkout-delivery-option {
        display: flex;
        min-height: 66px;
        align-items: center;
        gap: 9px;
        padding: 10px 11px;
        border: 1px solid rgba(148, 163, 184, .24);
        border-radius: 12px;
        background: rgba(5, 18, 35, .50);
    }
    .checkout-delivery-option:has(input:checked),
    .checkout-delivery-option.is-selected {
        border-color: rgba(0, 255, 136, .62);
        background: rgba(0, 255, 136, .10);
    }
    .checkout-delivery-option input {
        width: 18px;
        height: 18px;
        accent-color: var(--accent-green);
        flex: 0 0 auto;
    }
    .checkout-delivery-option-copy { display: grid; gap: 2px; min-width: 0; }
    .checkout-delivery-option-copy strong { color: var(--text-white); font-size: 13px; }
    .checkout-delivery-option-copy small { color: var(--text-gray); font-size: 11px; }
    .checkout-address-controls,
    .checkout-guest-fields { display: grid; gap: 10px; }
    .checkout-guest-fields { margin-top: 12px; }
    .checkout-control,
    .checkout-summary-panel .form-input {
        width: 100%;
        min-height: 48px;
        padding: 12px 14px;
        border: 1px solid rgba(148, 163, 184, .22);
        border-radius: 12px;
        background: rgba(5, 18, 35, .76);
        color: var(--text-white);
        font: inherit;
        font-size: 16px;
    }
    .checkout-control:focus,
    .checkout-summary-panel .form-input:focus {
        border-color: rgba(0, 255, 136, .72);
        outline: none;
        box-shadow: 0 0 0 3px rgba(0, 255, 136, .10);
    }
    .checkout-control { appearance: auto; -webkit-appearance: auto; }
    .checkout-inline-action {
        justify-self: start;
        min-height: 38px;
        padding: 0 10px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--accent-green);
        font: inherit;
        font-size: 13px;
        font-weight: 700;
    }
    .checkout-form-grid { display: grid; grid-template-columns: 1fr; gap: 13px; }
    .checkout-field { display: grid; min-width: 0; gap: 7px; }
    .checkout-field > span { color: rgba(226, 232, 240, .88); font-size: 14px; font-weight: 700; }
    .checkout-field > span em { display: block; margin-top: 4px; color: var(--accent-green); font-size: 11px; font-style: normal; font-weight: 600; }
    .checkout-field-inline { display: flex; min-width: 0; gap: 8px; }
    .checkout-field-inline .form-input { min-width: 0; }
    .checkout-field-inline button,
    .checkout-manual-coupon button {
        flex: 0 0 auto;
        min-height: 48px;
        padding: 0 13px;
        border: 1px solid rgba(0, 255, 136, .45);
        border-radius: 11px;
        background: rgba(0, 255, 136, .10);
        color: var(--accent-green);
        font: inherit;
        font-size: 13px;
        font-weight: 750;
    }
    .checkout-field-help {
        margin: 1px 0 0;
        color: var(--text-gray);
        font-size: 13px;
        line-height: 1.55;
    }
    .checkout-coupon-detail,
    .checkout-helper-card {
        margin-top: 10px;
        padding: 11px 12px;
        border: 1px solid rgba(0, 255, 136, .20);
        border-radius: 11px;
        background: rgba(0, 255, 136, .07);
        color: rgba(226, 232, 240, .86);
        font-size: 13px;
        line-height: 1.5;
    }
    .checkout-manual-coupon { display: flex; gap: 8px; margin-top: 10px; }
    .checkout-manual-coupon .form-input { min-width: 0; }
    .checkout-price-card {
        margin: 2px 0 14px;
        padding: 16px;
        border: 1px solid rgba(148, 163, 184, .20);
        border-radius: 14px;
        background: linear-gradient(135deg, rgba(26, 56, 79, .78), rgba(10, 27, 45, .78));
    }
    .checkout-price-row,
    .checkout-price-total {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .checkout-price-row { margin-bottom: 10px; color: var(--text-gray); font-size: 14px; }
    .checkout-price-row > span:last-child { color: var(--text-white); font-weight: 700; font-variant-numeric: tabular-nums; }
    .checkout-price-row .checkout-price-discount { color: var(--accent-green); }
    .checkout-price-total { margin-top: 12px; padding-top: 13px; border-top: 1px solid rgba(148, 163, 184, .18); color: var(--text-white); font-size: 16px; font-weight: 750; }
    .checkout-price-total strong { color: var(--accent-green); font-size: 22px; font-variant-numeric: tabular-nums; }
    .checkout-submit-btn {
        width: 100%;
        min-height: 52px;
        border: 0;
        border-radius: 14px;
        background: linear-gradient(135deg, #1cf19a, var(--accent-green));
        box-shadow: 0 10px 24px rgba(0, 255, 136, .18);
        color: #05261a;
        font: inherit;
        font-size: 16px;
        font-weight: 800;
    }
    .checkout-submit-btn:disabled { opacity: .55; box-shadow: none; }
    .checkout-submit-hint { margin: 9px 0 0; color: var(--text-gray); font-size: 12px; line-height: 1.45; text-align: center; }
}

@media (max-width: 380px) {
    .checkout-delivery-options { grid-template-columns: 1fr; }
    .checkout-field-inline { flex-direction: column; }
    .checkout-field-inline button { width: 100%; }
}

/* 手机端订单工作台沿用抽屉标题栏，仅显示当前页面标题，避免桌面副标题叠加。 */
@media (max-width: 959px) {
    .management-modal-header .management-overline {
        display: none;
    }
    .management-modal-header .management-title-block {
        display: contents;
    }
    .management-modal-header .modal-title {
        position: absolute;
        top: 50%;
        left: 50%;
        width: calc(100% - 96px);
        transform: translate(-50%, -50%);
        text-align: center;
    }
}

/* 手机端确认订单使用单层抽屉标题；Telegram 原生顶部操作区不覆盖站内返回与关闭按钮。 */
@media (max-width: 959px) {
    .checkout-workspace-header .checkout-overline {
        display: none;
    }
    .checkout-workspace-header .checkout-title-block {
        display: contents;
    }
    .checkout-workspace-header .modal-title {
        position: absolute;
        top: 50%;
        left: 50%;
        width: calc(100% - 96px);
        transform: translate(-50%, -50%);
        text-align: center;
    }

    /* Telegram 原生关闭与返回控件由宿主渲染；隐藏会被其覆盖的站内按钮，
       让订单抽屉保持原生紧凑高度，而不是给整张内容卡片增加顶部留白。 */
    html.tg-mini-app #checkout-modal .modal-content,
    body[data-telegram-runtime="mini_app"] #checkout-modal .modal-content {
        padding-top: 12px;
    }
    html.tg-mini-app #checkout-modal .modal-content::before,
    body[data-telegram-runtime="mini_app"] #checkout-modal .modal-content::before {
        top: 0;
    }
    html.tg-mini-app #checkout-modal .checkout-workspace-header,
    body[data-telegram-runtime="mini_app"] #checkout-modal .checkout-workspace-header {
        min-height: 58px;
        justify-content: center;
    }
    html.tg-mini-app #checkout-modal .checkout-workspace-header .modal-back,
    html.tg-mini-app #checkout-modal .checkout-workspace-header .modal-close,
    body[data-telegram-runtime="mini_app"] #checkout-modal .checkout-workspace-header .modal-back,
    body[data-telegram-runtime="mini_app"] #checkout-modal .checkout-workspace-header .modal-close {
        display: none;
    }
}

/* ============================================================
   site-footer — 统一页脚组件（基础样式 + mall 主题）
   主题变体：site-footer--mall / site-footer--product / site-footer--knowledge
   通过 variant 参数统一控制
   ============================================================ */

/* ---- 移动端基础样式 ---- */
.site-footer {
    margin-top: 48px;
    padding: 28px 20px 20px;
    background: var(--footer-bg, var(--bg-tertiary, #0f172a));
    border-top: 1px solid var(--footer-border, var(--border-primary));
    color: var(--footer-text-secondary, var(--text-secondary, #94A3B8));
    font-size: 13px;
    line-height: 1.6;
}
.site-footer__inner {
    max-width: 100%;
    margin: 0 auto;
}
.site-footer .footer-columns {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.site-footer .footer-col h3 {
    margin: 0 0 12px;
    color: var(--footer-text-primary, var(--text-primary, #F8FAFC));
    font-size: 13px;
    font-weight: 600;
}
/* 品牌列 */
.site-footer .footer-col-brand {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.site-footer__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.site-footer__brand strong {
    font-size: 18px;
    color: var(--footer-text-primary, var(--text-primary, #F8FAFC));
    letter-spacing: -.02em;
    font-weight: 700;
}
.site-footer__brand span {
    font-size: 12px;
    color: var(--footer-text-muted, var(--text-muted, #64748B));
}
/* 支付方式 */
.site-footer .footer-payment-methods {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.site-footer .footer-payment-label {
    display: block;
    margin-bottom: 10px;
    font-size: 11px;
    color: var(--footer-text-muted, var(--text-muted, #64748B));
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.site-footer .footer-payment-icons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
}
.site-footer .footer-payment-icons img {
    width: 100%;
    height: 28px;
    object-fit: contain;
    padding: 3px 4px;
    background: rgba(248, 250, 252, .95);
    border-radius: 6px;
    box-sizing: border-box;
}
/* 链接列 */
.site-footer .footer-col-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
    justify-items: center;
}
.site-footer .footer-col-links h3 {
    grid-column: 1 / -1;
    text-align: center;
}
.site-footer .footer-col-links a,
.site-footer .footer-col-links button {
    text-align: center;
    text-decoration: none;
    color: var(--footer-text-secondary, var(--text-secondary, #94A3B8));
    font-size: 13px;
    background: none;
    border: 0;
    padding: 4px 0;
    min-height: 22px;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.site-footer .footer-col-links a:hover,
.site-footer .footer-col-links button:hover {
    color: var(--footer-accent, var(--accent-green, #00D77A));
}
/* 联系信息 */
.site-footer .footer-col-contact {
    text-align: center;
}
.site-footer .footer-col-contact .footer-contact-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.site-footer .footer-contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--footer-text-secondary, var(--text-secondary, #94A3B8));
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
}
.site-footer .footer-contact-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--footer-accent, var(--accent-green, #00D77A));
}
.site-footer .footer-contact-item svg path {
    fill: currentColor;
    stroke: currentColor;
}
/* 社交媒体 */
.site-footer .footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}
.site-footer .footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    transition: transform .2s, box-shadow .2s;
}
.site-footer .footer-social a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}
.site-footer .footer-social img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}
/* 法律链接 */
.site-footer .footer-col-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    justify-content: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.site-footer .footer-col-legal h3 {
    display: none;
}
.site-footer .footer-col-legal a {
    color: var(--footer-text-muted, var(--text-muted, #64748B));
    text-decoration: none;
    font-size: 12px;
    padding: 4px 0;
    position: relative;
}
.site-footer .footer-col-legal a + a {
    margin-left: 12px;
    padding-left: 12px;
}
.site-footer .footer-col-legal a + a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, .15);
}
.site-footer .footer-col-legal a:hover {
    color: var(--footer-accent, var(--accent-green, #00D77A));
}
/* 版权 */
.site-footer .footer-copyright {
    margin-top: 16px;
    text-align: center;
    color: var(--footer-text-muted, var(--text-muted, #64748B));
    font-size: 11px;
}

/* ---- mall 主题（默认） ---- */
.site-footer--mall {
    --footer-bg: var(--bg-tertiary, #0f172a);
    --footer-border: var(--border-primary);
    --footer-text-primary: var(--text-primary, #F8FAFC);
    --footer-text-secondary: var(--text-secondary, #94A3B8);
    --footer-text-muted: var(--text-muted, #64748B);
    --footer-accent: var(--accent-green, #00D77A);
}

/* ---- 桌面端样式 ---- */
@media (min-width: 960px) {
    .site-footer {
        margin-top: 0;
        padding: 32px 0 0;
        background: transparent;
        border-top: 1px solid rgba(184, 196, 209, .12);
    }
    .site-footer .footer-columns {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: space-between;
        gap: clamp(28px, 3vw, 48px);
    }
    .site-footer .footer-col { min-width: 0; }
    .site-footer .footer-col h3 {
        font-size: 14px;
    }
    /* 品牌列基准 340px，其余列取自然内容宽 */
    .site-footer .footer-col-brand {
        flex: 0 1 340px;
        padding-bottom: 0;
        border-bottom: 0;
        text-align: left;
    }
    .site-footer__brand {
        align-items: flex-start;
    }
    .site-footer .footer-payment-methods {
        align-items: flex-start;
    }
    .site-footer .footer-col-links { flex: 0 1 auto; }
    .site-footer .footer-col-contact { flex: 0 1 auto; text-align: left; }
    .site-footer .footer-col-contact .footer-contact-info {
        align-items: flex-start;
    }
    .site-footer .footer-contact-item {
        justify-content: flex-start;
    }
    .site-footer .footer-social {
        justify-content: flex-start;
    }
    .site-footer .footer-col-legal { flex: 0 1 auto; justify-content: flex-start; }

    /* 快速链接列：纵向堆叠 */
    .site-footer .footer-col-links {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .site-footer .footer-col-links h3 {
        text-align: left;
    }
    .site-footer .footer-col-links a,
    .site-footer .footer-col-links button {
        text-align: left;
        text-decoration: none;
    }

    /* 法律声明列 */
    .site-footer .footer-col-legal {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-top: 0;
        border-top: 0;
    }
    .site-footer .footer-col-legal h3 {
        display: block;
    }
    .site-footer .footer-col-legal a {
        font-size: inherit;
        color: inherit;
        padding: 0;
        position: static;
    }
    .site-footer .footer-col-legal a + a {
        margin-left: 0;
        padding-left: 0;
    }
    .site-footer .footer-col-legal a + a::before {
        display: none;
    }

    /* 版权声明 */
    .site-footer .footer-copyright {
        margin-top: 26px;
        padding-top: 18px;
        border-top: 1px solid rgba(184, 196, 209, .12);
        text-align: center;
        font-size: inherit;
    }
}
