/**
 * LINLANG - Minimalist Black & White Design
 * 极简黑白风格商城
 */

/* ==========================================
   1. 核心变量系统 (日夜双生)
   ========================================== */
:root {
    /* 🌞 日间模式 */
    --bg: #ffffff;
    --gray-light: #f7f7f7;
    --gray-dark: #e0e0e0;
    --text-main: #000000;
    --text-sub: #888888;
    --text-inverse: #ffffff;
    --overlay-bg: rgba(255, 255, 255, 0.95);
    --img-brightness: 1;

    /* 别名变量（兼容 treasure-wallet-v2.css） */
    --treasure-bg: var(--bg);
    --treasure-gray-light: var(--gray-light);
    --treasure-gray-dark: var(--gray-dark);
    --treasure-text-main: var(--text-main);
    --treasure-text-sub: var(--text-sub);
    --treasure-text-inverse: var(--text-inverse);
    --treasure-serif: 'Noto Serif SC', serif;
    --treasure-sans: 'Inter', sans-serif;
    --treasure-mono: 'JetBrains Mono', monospace;

    --serif: 'Noto Serif SC', serif;
    --sans: 'Inter', sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

/* 强制覆盖 treasure 容器内的变量 */
#treasure,
#treasure-container {
    --text-main: #000000 !important;
    --text-sub: #888888 !important;
}

/* 🌙 夜间模式 */
body.dark-mode #treasure-container,
body[data-theme="dark"] #treasure-container {
    --bg: #121212;
    --gray-light: #1e1e1e;
    --gray-dark: #333333;
    --text-main: #ffffff;
    --text-sub: #a0a0a0;
    --text-inverse: #000000;
    --overlay-bg: rgba(18, 18, 18, 0.95);
    --img-brightness: 0.85;

    /* 别名变量（兼容 treasure-wallet-v2.css） */
    --treasure-bg: var(--bg);
    --treasure-gray-light: var(--gray-light);
    --treasure-gray-dark: var(--gray-dark);
    --treasure-text-main: var(--text-main);
    --treasure-text-sub: var(--text-sub);
    --treasure-text-inverse: var(--text-inverse);
}

/* ==========================================
   2. 容器基础样式
   ========================================== */
#treasure {
    background: var(--bg);
    color: var(--text-main);
    transition: background 0.3s, color 0.3s;
}

#treasure img {
    filter: brightness(var(--img-brightness));
    transition: filter 0.3s;
}

/* ==========================================
   3. 顶栏样式 - LINLANG大写 + 月亮图标
   ========================================== */
.header {
    padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    border-bottom: 1px solid var(--gray-dark);
    transition: 0.3s;
}

.header-back {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.2s;
}

.header-back:active {
    opacity: 0.5;
}

.header-logo {
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.header-icon {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.2s;
}

.header-icon:active {
    opacity: 0.5;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--gray-light);
    border: 1px solid var(--gray-dark);
    border-radius: 0;
    padding: 8px 12px;
    margin: 0 12px;
    transition: 0.3s;
}

.search-box i {
    font-size: 16px;
    color: var(--text-sub);
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    margin-left: 8px;
    font-size: 13px;
    color: var(--text-main);
}

/* ==========================================
   4. 主滚动区域
   ========================================== */
.main-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: calc(65px + env(safe-area-inset-bottom, 0px));
    background: var(--bg);
    position: relative;
    display: flex;
    flex-direction: column;
    transition: 0.3s;
}

/* ==========================================
   4.5 主商品容器（覆盖旧的瀑布流样式）
   ========================================== */
#treasure-products.treasure-waterfall,
.treasure-waterfall {
    column-count: 1 !important;
    display: block !important;
    padding: 0 !important;
    min-height: unset !important;
    background: var(--bg) !important;
    column-gap: 0 !important;
}

/* ==========================================
   5. Hero Banner - 首页大图
   ========================================== */
.hero-banner {
    position: relative;
    height: 280px;
    overflow: hidden;
    margin-bottom: 24px;
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.4));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px 24px;
}

.hero-issue {
    font-family: var(--serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.hero-title {
    font-family: var(--serif);
    font-size: 28px;
    font-weight: 900;
    line-height: 1.2;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* ==========================================
   6. Editor's Pick 区域
   ========================================== */
.section-title {
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 0 20px 16px;
    color: var(--text-main);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 20px 30px;
}

.product-card {
    cursor: pointer;
    transition: 0.2s;
}

.product-card:active {
    opacity: 0.8;
}

.product-img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: var(--gray-light);
    margin-bottom: 10px;
}

.product-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-main);
}

.product-price {
    font-family: var(--serif);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

/* 骨架屏样式 */
.skeleton-card {
    pointer-events: none;
}

.skeleton-img {
    width: 100%;
    aspect-ratio: 3/4;
    background: linear-gradient(90deg, var(--gray-light) 25%, var(--gray-dark) 50%, var(--gray-light) 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    margin-bottom: 10px;
}

.skeleton-text {
    background: linear-gradient(90deg, var(--gray-light) 25%, var(--gray-dark) 50%, var(--gray-light) 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================
   5. 视图切换动画
   ========================================== */
.treasure-view-section {
    display: none;
    animation: treasureFadeIn 0.3s ease;
    flex-direction: column;
    flex: 1;
}

.treasure-view-section.active {
    display: flex;
}

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

/* ==========================================
   6. 通用排版组件
   ========================================== */
.page-title {
    font-family: var(--serif);
    font-size: 28px !important;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 20px 20px 12px;
    margin-bottom: 0;
    border-bottom: 2px solid var(--text-main) !important;
    color: var(--text-main) !important;
    transition: 0.3s;
}

/* ==========================================
   6.1 钱包余额卡片
   ========================================== */
.wallet-balance-card {
    background: var(--text-main) !important;
    color: var(--text-inverse) !important;
    padding: 30px 20px;
    margin: 20px;
    border-radius: 0;
    position: relative;
    transition: 0.3s;
}

/* 夜间模式 - 奢华纯黑卡片 */
body.dark-mode .wallet-balance-card,
body.night .wallet-balance-card {
    background: var(--text-main) !important;
    color: var(--text-inverse) !important;
    padding: 32px 24px !important;
    box-shadow: none !important;
}

.wallet-balance-label {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 10px;
    color: var(--text-inverse) !important;
}

.wallet-balance-amount {
    font-family: var(--serif);
    font-size: 42px;
    font-weight: 300;
    margin: 10px 0 30px 0;
    color: var(--text-inverse) !important;
}

.wallet-balance-type {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 2px;
    opacity: 0.5;
    color: var(--text-inverse) !important;
}

.wallet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 0 20px;
    margin-bottom: 30px;
}

/* 账号选择器 */
.wallet-account-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-family: var(--sans);
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.wallet-account-selector:active {
    opacity: 0.7;
}

.wallet-account-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--text-main);
    object-fit: cover;
}

.wallet-account-name {
    color: var(--text-main);
}

.wallet-account-selector i {
    font-size: 18px;
    color: var(--text-main);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-sub);
    flex: 1;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--gray-dark);
}

/* ==========================================
   6.2 钱包账号显示
   ========================================== */
.wallet-header {
    padding: 0 20px 20px;
}

.wallet-account {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--gray-light);
    border: 1px solid var(--gray-dark);
    cursor: pointer;
    transition: 0.2s;
}

.wallet-account:active {
    opacity: 0.7;
}

.wallet-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--text-main);
    object-fit: cover;
}

.wallet-account-info {
    flex: 1;
}

.wallet-account-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.wallet-account-role {
    font-size: 12px;
    color: var(--text-sub);
    letter-spacing: 0.5px;
}

.wallet-account i {
    font-size: 20px;
    color: var(--text-sub);
}

/* ==========================================
   6.3 账号选择器抽屉
   ========================================== */
.account-selector-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: flex-end;
    animation: treasureFadeIn 0.3s ease;
}

.account-selector-overlay.show {
    display: flex;
}

.account-selector-sheet {
    width: 100%;
    max-height: 70vh;
    background: var(--bg);
    border-radius: 20px 20px 0 0;
    padding: 24px;
    overflow-y: auto;
    animation: treasureSlideUp 0.3s ease;
    transition: 0.3s;
}

.account-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--text-main);
}

.account-selector-header h3 {
    margin: 0;
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-main);
}

.account-selector-header i {
    font-size: 24px;
    color: var(--text-sub);
    cursor: pointer;
}

.account-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--gray-light);
    border: 1px solid var(--gray-dark);
    cursor: pointer;
    transition: 0.2s;
}

.account-item:active {
    opacity: 0.7;
    transform: scale(0.98);
}

.account-item.active {
    border-color: var(--text-main);
    border-width: 2px;
}

.account-item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--text-main);
    object-fit: cover;
}

.account-item-info {
    flex: 1;
}

.account-item-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.account-item-role {
    font-size: 12px;
    color: var(--text-sub);
    letter-spacing: 0.5px;
}

.account-item-balance {
    font-family: var(--serif);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

/* ==========================================
   6.4 加载动画
   ========================================== */
.treasure-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    animation: treasureFadeIn 0.3s ease;
}

.treasure-loading-overlay.show {
    display: flex;
}

.treasure-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--gray-dark);
    border-top-color: var(--text-main);
    border-radius: 50%;
    animation: treasureSpin 0.8s linear infinite;
}

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

/* ==========================================
   7. 按钮系统
   ========================================== */
.btn-solid {
    background: var(--text-main);
    color: var(--text-inverse);
    border: none;
    padding: 16px;
    font-family: var(--serif);
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    text-transform: uppercase;
    width: 100%;
    transition: 0.2s;
}

.btn-solid:active {
    transform: scale(0.98);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-main);
    color: var(--text-main);
    padding: 12px 24px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    text-transform: uppercase;
    text-align: center;
    transition: 0.2s;
}

.btn-sm-outline {
    padding: 10px 12px;
    font-size: 10px;
    border: 1px solid var(--text-main);
    color: var(--text-main);
    background: transparent;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
}

.btn-sm-solid {
    padding: 10px 12px;
    font-size: 10px;
    border: 1px solid var(--text-main);
    background: var(--text-main);
    color: var(--text-inverse);
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
}

/* 加载更多按钮 */
.treasure-load-more-box {
    display: flex;
    justify-content: center;
    padding: 30px 20px;
}

.treasure-btn-load-more {
    background: transparent;
    border: 1px solid var(--text-main);
    color: var(--text-main);
    padding: 12px 32px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.treasure-btn-load-more:hover {
    background: var(--gray-light);
}

.treasure-btn-load-more:active {
    transform: scale(0.98);
}

.treasure-btn-load-more i {
    font-size: 16px;
}

/* ==========================================
   8. 首页 Hero 区域
   ========================================== */
.hero {
    position: relative;
    height: 350px;
    margin-bottom: 30px;
}

.hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(20%) brightness(var(--img-brightness));
}

.hero-text {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.hero-text h2 {
    font-family: var(--serif);
    font-size: 36px;
    font-weight: 900;
    letter-spacing: 2px;
    line-height: 1;
}

/* ==========================================
   9. 商品网格
   ========================================== */
.product-grid-alt {
    display: flex;
    flex-wrap: wrap;
    padding: 0 10px;
    gap: 10px;
}

.p-card {
    width: calc(50% - 5px);
    margin-bottom: 20px;
    cursor: pointer;
}

.p-card img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: var(--gray-light);
    margin-bottom: 12px;
}

.p-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    padding: 0 4px;
}

.p-price {
    font-family: var(--serif);
    font-size: 15px;
    font-weight: 700;
    padding: 0 4px;
}

/* ==========================================
   10. 商品详情页
   ========================================== */
.pdp-img {
    width: 100%;
    height: 60vh;
    object-fit: cover;
}

.pdp-info {
    padding: 24px 20px;
    flex: 1;
    margin-bottom: 80px;
}

.pdp-title {
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 8px;
}

.pdp-price {
    font-family: var(--serif);
    font-size: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--gray-dark);
    padding-bottom: 20px;
}

.pdp-desc {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.8;
    text-align: justify;
}

.pdp-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--overlay-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--gray-dark);
    display: none;
    z-index: 100;
    transition: 0.3s;
}

/* ==========================================
   8. 订单列表样式
   ========================================== */
.list-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid var(--gray-dark);
    cursor: pointer;
    transition: 0.3s;
}

.list-item img {
    width: 80px;
    height: 100px;
    object-fit: cover;
    background: var(--gray-light);
    flex-shrink: 0;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main) !important;
    line-height: 1.4;
}

.status-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border: 1px solid var(--text-main);
    color: var(--text-main) !important;
    text-transform: uppercase;
    margin-top: 4px;
    width: fit-content;
}

.status-tag.completed {
    border-color: var(--text-sub);
    color: var(--text-sub) !important;
}

.item-price {
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main) !important;
}

.gift-tag {
    font-family: var(--serif);
    font-size: 12px;
    font-style: italic;
    margin-top: 4px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 4px;
}

.strike {
    text-decoration: line-through;
    color: var(--text-sub);
    font-size: 12px;
}

.sticky-pay-bar {
    position: fixed;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--gray-dark);
    padding: 15px 20px;
    display: none;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    transition: 0.3s;
}

/* ==========================================
   12. 订单详情页
   ========================================== */
.treasure-order-page-transition {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.treasure-order-list-page {
    transform: translateX(0);
    z-index: 1;
}

.treasure-order-detail-page {
    transform: translateX(100%);
    z-index: 2;
}

.treasure-order-detail-page.active {
    transform: translateX(0);
}

.od-nav {
    background: var(--bg);
    padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-dark);
    position: sticky;
    top: 0;
    z-index: 30;
    transition: 0.3s;
}

.od-nav-back {
    width: 32px;
    height: 32px;
    background: var(--gray-light);
    border-radius: 0;
    border: 1px solid var(--gray-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.od-nav-back:active {
    opacity: 0.7;
}

.od-nav-back i {
    font-size: 20px;
    color: var(--text-main) !important;
}

.od-nav-title {
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-main) !important;
}

.od-nav-spacer {
    width: 32px;
}

.od-header {
    padding: 24px 20px;
    border-bottom: 2px solid var(--text-main) !important;
    transition: 0.3s;
}

.od-id {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-sub) !important;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.od-status {
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-main) !important;
}

.od-section {
    padding: 20px;
    border-bottom: 1px solid var(--gray-dark);
    transition: 0.3s;
}

.od-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-sub) !important;
    margin-bottom: 16px;
}

.od-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 12px;
    color: var(--text-main) !important;
}

.od-row:last-child {
    margin-bottom: 0;
}

.od-row.total {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 900;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-dark);
}

.od-action-bar {
    position: fixed;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: var(--bg);
    border-top: 1px solid var(--gray-dark);
    z-index: 40;
    transition: 0.3s;
}

/* 动态物流追踪 */
.track-line {
    position: relative;
    height: 2px;
    background: var(--gray-dark);
    margin: 40px 0;
}

.truck-icon {
    position: absolute;
    top: -24px;
    left: 0%;
    font-size: 24px;
    color: var(--text-main);
    transform: translateX(-50%);
    transition: left 0.3s ease;
}

.track-dot {
    position: absolute;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray-dark);
    transform: translateX(-50%);
    transition: background 0.3s;
}

.track-dot.active {
    background: var(--text-main);
}

.messenger-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    max-height: 250px;
    overflow-y: auto;
    padding: 10px 0;
    border-top: 1px solid var(--gray-dark);
}

.msg-bubble {
    background: var(--gray-light);
    padding: 12px 16px;
    border: 1px solid var(--gray-dark);
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    align-self: flex-start;
    max-width: 85%;
}

.msg-bubble.courier {
    border-left: 4px solid var(--text-main);
}

.msg-bubble.user {
    align-self: flex-end;
    background: var(--text-main);
    color: var(--text-inverse);
    border: none;
}

/* ==========================================
   7. 底部导航 - 简洁黑白图标
   ========================================== */
.nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    background: var(--bg);
    border-top: 1px solid var(--gray-dark);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 100;
    transition: 0.3s;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-sub);
    cursor: pointer;
    transition: 0.2s;
    padding: 8px 16px;
}

.nav-item.active {
    color: var(--text-main);
}

.nav-item i {
    font-size: 22px;
}

.nav-item span {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   14. 抽屉 (Bottom Sheet)
   ========================================== */
.sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

.sheet-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.sheet {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: var(--bg);
    padding: 25px 20px calc(30px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    overflow-y: auto;
}

.sheet-overlay.show .sheet {
    transform: translateY(0);
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--text-main);
    padding-bottom: 10px;
}

.sheet-title {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 900;
}

.sheet-close {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-main);
}

/* ==========================================
   15. Toast 提示
   ========================================== */
.toast {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: var(--text-inverse);
    padding: 12px 24px;
    font-size: 12px;
    border-radius: 4px;
    opacity: 0;
    transition: 0.3s;
    z-index: 4000;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(10px);
}

/* ==========================================
   16. 收货地址占位UI
   ========================================== */
.address-placeholder {
    border: 1px solid var(--text-main);
    padding: 25px;
    text-align: center;
    margin-bottom: 25px;
    cursor: pointer;
    transition: 0.2s;
}

.address-placeholder:active {
    opacity: 0.7;
}

.address-placeholder i {
    font-size: 24px;
}

.address-placeholder .address-title {
    font-weight: 700;
    margin-top: 10px;
}

.address-placeholder .address-status {
    font-size: 10px;
    color: var(--text-sub);
}

/* ==========================================
   17. 购物车标题
   ========================================== */
.cart-title {
    margin-bottom: 16px;
    font-weight: 700;
    font-size: 18px;
}

/* ==========================================
   18. 购物车样式 - 极简黑白
   ========================================== */
.treasure-cart-group {
    padding: 0 20px 20px;
}

.treasure-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-dark);
    transition: 0.3s;
}

.treasure-c-check {
    font-size: 20px;
    color: var(--text-sub);
    cursor: pointer;
    transition: 0.2s;
}

.treasure-c-check.checked {
    color: var(--text-main);
}

.treasure-c-img-box {
    width: 60px;
    height: 75px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: var(--gray-light);
}

.treasure-c-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.treasure-c-img-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
}

.treasure-c-main {
    flex: 1;
    min-width: 0;
}

.treasure-c-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.treasure-c-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.treasure-c-price {
    font-family: var(--serif);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.treasure-c-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.treasure-c-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-dark);
    background: var(--bg);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-main);
    transition: 0.2s;
}

.treasure-c-btn:active {
    background: var(--gray-light);
}

.treasure-c-delete {
    border-color: var(--text-main);
}

.treasure-c-num {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    min-width: 24px;
    text-align: center;
}

/* ==========================================
   19. 订单页面标题区域
   ========================================== */
.order-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.order-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.order-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 20px calc(140px + env(safe-area-inset-bottom, 0px));
}

/* ==========================================
   19. 钱包交易标题
   ========================================== */
.trans-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

/* ==========================================
   20. 空状态样式
   ========================================== */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-sub);
}

.empty-cart i {
    font-size: 64px;
    opacity: 0.3;
}

.empty-cart-text {
    margin-top: 16px;
}

.empty-orders {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-sub);
}

.empty-orders i {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-orders-text {
    font-size: 14px;
}

.empty-orders-subtext {
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.7;
}

/* ==========================================
   21. AI错误提示
   ========================================== */
.ai-error {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-sub);
}

.ai-error i {
    font-size: 64px;
    opacity: 0.3;
}

.ai-error-text {
    margin-top: 16px;
}

/* ==========================================
   22. AI未配置提示
   ========================================== */
.ai-unconfigured {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    text-align: center;
}

.ai-unconfigured i {
    font-size: 64px;
    color: var(--text-main);
    opacity: 0.5;
}

.ai-unconfigured-title {
    margin-top: 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.ai-unconfigured-desc {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-sub);
    line-height: 1.8;
    max-width: 280px;
}

/* ==========================================
   23. 无限商城欢迎界面
   ========================================== */
.welcome {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-sub);
}

.welcome i {
    font-size: 80px;
    opacity: 0.3;
    color: var(--text-main);
}

.welcome-title {
    margin-top: 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.welcome-desc {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.6;
}

/* ==========================================
   24. 物品模态框
   ========================================== */
.item-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    pointer-events: auto;
}

.item-modal-content {
    background: var(--bg);
    border: 1px solid var(--gray-dark);
    border-radius: 0;
    max-width: 350px;
    width: 90%;
    padding: 0;
    overflow: hidden;
    pointer-events: auto;
}

.item-modal-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--gray-light);
    overflow: hidden;
}

.item-modal-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 0;
    background: var(--bg);
    border: 1px solid var(--gray-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.item-modal-close i {
    font-size: 20px;
    color: var(--text-main);
}

.item-modal-body {
    padding: 20px;
}

.item-modal-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}

.item-modal-meta {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 16px;
}

.item-modal-desc {
    font-size: 13px;
    color: var(--text-main);
    opacity: 0.85;
    line-height: 1.6;
    margin-bottom: 20px;
}

.item-modal-actions {
    display: flex;
    gap: 10px;
}

.item-modal-btn-gift {
    flex: 1;
    padding: 14px;
    border-radius: 0;
    border: 2px solid var(--text-main);
    background: transparent;
    color: var(--text-main);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.item-modal-btn-gift:active {
    opacity: 0.7;
}

.item-modal-btn-use {
    flex: 1;
    padding: 14px;
    border-radius: 0;
    border: 2px solid var(--text-main);
    background: var(--text-main);
    color: var(--text-inverse);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.item-modal-btn-use:active {
    opacity: 0.7;
}

/* ==========================================
   25. 购物车图片容器
   ========================================== */
.c-img-box {
    position: relative;
    overflow: hidden;
}

.c-img-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.c-img-fallback img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================
   26. 商品瀑布流图片容器
   ========================================== */
.w-img-box {
    position: relative;
}

.w-img-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
}

.w-img-fallback img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================
   27. 商品价格样式
   ========================================== */
.w-price-symbol {
    font-size: 12px;
}

/* ==========================================
   29. 欢迎页面和分类导航
   ========================================== */
.welcome-v3 {
    padding: 20px;
}

.hero-section {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
}

.hero-title {
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--text-main);
    margin-bottom: 12px;
}

.hero-desc {
    font-size: 14px;
    color: var(--text-sub);
    line-height: 1.8;
}

.main-card {
    background: var(--bg);
    border: 1px solid var(--gray-dark);
    padding: 24px;
    transition: 0.3s;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-dark);
}

.section-title i {
    font-size: 16px;
}

.cats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}

.cat:active {
    opacity: 0.6;
}

.cat-box {
    width: 60px;
    height: 60px;
    background: var(--gray-light);
    border: 1px solid var(--gray-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: 0.2s;
}

.cat:hover .cat-box {
    background: var(--gray-dark);
}

.cat-box i {
    font-size: 24px;
    color: var(--text-main);
}

.cat-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

.bottom-hint {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-dark);
    font-size: 12px;
    color: var(--text-sub);
    text-align: center;
    line-height: 1.6;
}
   ========================================== */
.inventory-sheet {
    width: 100%;
    max-height: 80vh;
    background: var(--treasure-bg);
    border-radius: 0;
    border-top: 2px solid var(--treasure-text-main);
    padding: 24px;
    overflow-y: auto;
    animation: treasureSlideUp 0.3s ease;
    transition: 0.3s;
}

.inventory-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--treasure-gray-dark);
}

.inventory-sheet-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--treasure-text-main);
}

.inventory-sheet-close {
    font-size: 24px;
    color: var(--treasure-text-sub);
    cursor: pointer;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.inventory-item {
    background: var(--treasure-gray-light);
    border-radius: 0;
    border: 1px solid var(--treasure-gray-dark);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.inventory-item:hover {
    background: var(--treasure-gray-dark);
    transform: translateY(-2px);
}

.inventory-item-img {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 0;
    border: 1px solid var(--treasure-gray-dark);
    overflow: hidden;
}

.inventory-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inventory-item-img-fallback {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.inventory-item-qty {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--treasure-text-main);
    color: var(--treasure-text-inverse);
    padding: 2px 6px;
    border-radius: 0;
    font-size: 11px;
    font-weight: 600;
}

.inventory-item-name {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--treasure-text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 背包空状态 */
.inventory-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.inventory-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.inventory-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--treasure-text-sub);
    margin-bottom: 8px;
}

.inventory-empty-desc {
    font-size: 13px;
    color: var(--treasure-text-sub);
    opacity: 0.7;
    margin-bottom: 24px;
}

.inventory-empty-btn {
    padding: 12px 32px;
    background: var(--treasure-text-main);
    color: var(--treasure-text-inverse);
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inventory-empty-btn:hover {
    opacity: 0.8;
}
   ========================================== */
.treasure-order-card-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed var(--treasure-gray-dark);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.treasure-order-card-id {
    font-size: 12px;
    font-weight: 700;
    color: var(--treasure-text-main);
}

.treasure-order-card-id i {
    font-size: 14px;
    vertical-align: middle;
    opacity: 0.5;
}

.treasure-order-card-status {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.treasure-order-card-status i {
    font-size: 14px;
}

.treasure-order-card-body {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.treasure-order-card-img {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    position: relative;
    border-radius: 0;
    overflow: hidden;
    background: var(--treasure-gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--treasure-gray-dark);
}

.treasure-order-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.treasure-order-card-img-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.treasure-order-card-img-fallback img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.treasure-order-card-img-emoji {
    font-size: 32px;
}

.treasure-order-card-info {
    flex: 1;
}

.treasure-order-card-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--treasure-text-main);
}

.treasure-order-card-price {
    font-size: 12px;
    color: var(--treasure-text-main);
}

.treasure-order-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--treasure-gray-dark);
}

.treasure-order-btn-track {
    padding: 6px 14px;
    border: 1px solid var(--treasure-gray-dark);
    background: var(--treasure-bg);
    border-radius: 0;
    font-size: 12px;
    color: var(--treasure-text-main);
    cursor: pointer;
}

.treasure-order-btn-receive {
    padding: 6px 14px;
    border: none;
    background: var(--treasure-text-main);
    border-radius: 0;
    font-size: 12px;
    color: var(--treasure-text-inverse);
    font-weight: 600;
    cursor: pointer;
}

/* ==========================================
   商品详情页
   ========================================== */
.treasure-detail-page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 200;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    transition: 0.3s;
}

.treasure-detail-page.active {
    display: flex;
}

.treasure-detail-header {
    padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    border-bottom: 1px solid var(--gray-dark);
    position: sticky;
    top: 0;
    z-index: 10;
}

.treasure-detail-header i {
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
}

.treasure-detail-header span {
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.treasure-detail-content {
    flex: 1;
    overflow-y: auto;
}

.treasure-detail-img-box {
    width: 100%;
    height: 60vh;
    background: var(--gray-light);
}

.treasure-detail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.treasure-detail-info {
    padding: 24px 20px;
}

.treasure-detail-name {
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 8px;
    color: var(--text-main);
}

.treasure-detail-price {
    font-family: var(--serif);
    font-size: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--gray-dark);
    padding-bottom: 20px;
    color: var(--text-main);
}

.treasure-detail-desc {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.8;
    text-align: justify;
}

.treasure-detail-footer {
    position: sticky;
    bottom: 0;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--overlay-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--gray-dark);
}

.treasure-detail-btn-add {
    width: 100%;
    padding: 16px;
    background: var(--text-main);
    color: var(--text-inverse);
    border: none;
    font-family: var(--serif);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.treasure-detail-btn-add:active {
    transform: scale(0.98);
}

/* ==========================================
   拆箱动画系统
   ========================================== */
.treasure-unbox-overlay {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    animation: treasureFadeIn 0.4s ease;
}

@keyframes treasureShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.treasure-unbox-close {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 20px);
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: 0.2s;
}

.treasure-unbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.treasure-unbox-stage {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
}

.treasure-unbox-stage.active {
    display: flex;
}

.treasure-package-box {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 40px;
    cursor: pointer;
    transition: transform 0.3s;
}

.treasure-package-box:hover {
    transform: scale(1.05);
}

.treasure-package-box.opening {
    animation: treasureBoxShake 0.6s ease;
}

@keyframes treasureBoxShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.treasure-box-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, var(--gray-dark), transparent);
    animation: treasureGlowPulse 2s infinite;
}

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

.treasure-box-ribbon {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 48px;
    z-index: 3;
}

.treasure-box-lid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--gray-light);
    border: 2px solid var(--gray-dark);
    z-index: 2;
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.treasure-package-box.opening .treasure-box-lid {
    transform: translateY(-80px) rotateX(45deg);
    opacity: 0;
}

.treasure-box-body {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-light);
    border: 2px solid var(--gray-dark);
}

.treasure-box-tape-h,
.treasure-box-tape-v {
    position: absolute;
    background: var(--gray-dark);
}

.treasure-box-tape-h {
    top: 50%;
    left: 0;
    right: 0;
    height: 20px;
    transform: translateY(-50%);
}

.treasure-box-tape-v {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 20px;
    transform: translateX(-50%);
}

.treasure-package-label {
    text-align: center;
    color: #ffffff;
}

.treasure-package-product-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.treasure-package-product-sub {
    font-size: 14px;
    opacity: 0.7;
}

.treasure-unbox-action-btn {
    margin-top: 30px;
    padding: 16px 48px;
    background: var(--text-main);
    color: var(--text-inverse);
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.treasure-unbox-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.6);
}

.treasure-opening-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.treasure-burst-ring {
    position: absolute;
    width: 300px;
    height: 300px;
    border: 3px solid rgba(255, 215, 0, 0.8);
    border-radius: 50%;
    opacity: 0;
}

.treasure-burst-ring.animate {
    animation: treasureBurstRing 0.8s ease-out;
}

@keyframes treasureBurstRing {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.treasure-floating-decor {
    position: absolute;
    font-size: 24px;
    animation: treasureFloatUp 3s ease-out forwards;
    pointer-events: none;
}

@keyframes treasureFloatUp {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-200px) rotate(360deg); opacity: 0; }
}

.treasure-sparkle-particle {
    position: absolute;
    font-size: 16px;
    pointer-events: none;
}

.treasure-reveal-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    animation: treasureFadeIn 0.5s ease;
}

.treasure-reveal-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: var(--gray-light);
    border: 1px solid var(--gray-dark);
    border-radius: 50px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 30px;
}

.check-icon {
    width: 20px;
    height: 20px;
    background: var(--text-main);
    color: var(--text-inverse);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.treasure-reveal-image-wrap {
    width: 240px;
    height: 240px;
    margin-bottom: 30px;
    position: relative;
}

.treasure-reveal-image-inner {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: treasureRevealPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes treasureRevealPop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.treasure-reveal-image-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.treasure-reveal-product-name {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    text-align: center;
}

.treasure-reveal-product-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    text-align: center;
}

.treasure-reveal-done-btn {
    padding: 14px 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.treasure-reveal-done-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==========================================
   搬砖系统样式
   ========================================== */
.treasure-work-done-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.treasure-work-done-toast.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.toast-emoji {
    font-size: 64px;
    margin-bottom: 16px;
}

.toast-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.toast-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.treasure-cd-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 90%;
    max-width: 360px;
    background: var(--bg);
    border: 1px solid var(--gray-dark);
    border-radius: 20px;
    padding: 30px 24px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.treasure-cd-modal.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.treasure-cd-modal-top {
    text-align: center;
    margin-bottom: 24px;
}

.treasure-cd-modal-emoji {
    font-size: 48px;
    margin-bottom: 12px;
}

.treasure-cd-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.treasure-cd-modal-body {
    text-align: center;
}

.treasure-cd-modal-msg {
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.6;
    margin-bottom: 24px;
}

.treasure-cd-modal-ring {
    width: 160px;
    height: 160px;
    margin: 0 auto 24px;
    position: relative;
}

.treasure-cd-modal-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--gray-light);
    stroke-width: 8;
}

.ring-fill {
    fill: none;
    stroke: url(#treasureCdGradient);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
}

.treasure-cd-modal-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.treasure-cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.treasure-cd-unit-value {
    font-size: 36px;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--text-main);
    line-height: 1;
}

.treasure-cd-unit-label {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 4px;
}

.treasure-cd-colon-big {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-sub);
    line-height: 1;
}

.treasure-cd-modal-btn {
    width: 100%;
    padding: 14px;
    background: var(--text-main);
    color: var(--text-inverse);
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.treasure-cd-modal-btn:active {
    transform: scale(0.98);
}

.treasure-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.treasure-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.treasure-coin-float {
    position: fixed;
    font-size: 32px;
    pointer-events: none;
    z-index: 10001;
    animation: treasureCoinFloat 1s ease-out forwards;
}

@keyframes treasureCoinFloat {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-100px) scale(1.5); opacity: 0; }
}

/* ==========================================
   背包系统样式
   ========================================== */
.inventory-sheet {
    width: 100%;
    max-height: 80vh;
    background: var(--bg);
    border-radius: 20px 20px 0 0;
    padding: 24px;
    overflow-y: auto;
    animation: treasureSlideUp 0.3s ease;
    transition: 0.3s;
}

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

.inventory-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-dark);
}

.inventory-sheet-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.inventory-sheet-close {
    font-size: 24px;
    color: var(--text-sub);
    cursor: pointer;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.inventory-item {
    background: var(--gray-light);
    border-radius: 12px;
    border: 1px solid var(--gray-dark);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.inventory-item:hover {
    background: var(--gray-dark);
    transform: translateY(-2px);
}

.inventory-item-img {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 8px;
    border: 1px solid var(--gray-dark);
    overflow: hidden;
}

.inventory-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inventory-item-img-fallback {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.inventory-item-qty {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--text-main);
    color: var(--text-inverse);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.inventory-item-name {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.inventory-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.inventory-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.inventory-empty-desc {
    font-size: 13px;
    color: var(--text-sub);
    opacity: 0.7;
    margin-bottom: 24px;
}

.inventory-empty-btn {
    padding: 12px 32px;
    background: var(--text-main);
    color: var(--text-inverse);
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inventory-empty-btn:hover {
    opacity: 0.8;
}

/* ==========================================
   通用动画
   ========================================== */
@keyframes treasureFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes treasureFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}


