* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(180deg, #2c2419 0%, #1a1612 100%);
    color: #fff;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* 顶部标题区 */
.header {
    padding: 8px 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(180deg, #3d3228 0%, rgba(44,36,25,0.96) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.logo-circle {
    width: 65px;
    height: 65px;
    min-width: 65px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 20px rgba(200,150,60,0.4);
    border: 1px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.header-title {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 1px;
    font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
    background: linear-gradient(135deg, #fdf4e3 0%, #e8d5b7 30%, #c9a87c 70%, #b8956c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.stats-primary {
    font-size: 13px;
    font-weight: 600;
    color: #fdf4e3;
    text-shadow: 0 1px 4px rgba(0,0,0,0.35);
    letter-spacing: 0.5px;
}

.stats-num {
    color: #ffd700;
    font-weight: 700;
}

.header-service {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: 10px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.header-service:active {
    background: rgba(255,255,255,0.1);
}

.service-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5e6d3 0%, #e8d5b7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5c3d1e;
}

.service-icon.wechat-icon {
    background: #2c2419;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    overflow: hidden;
    padding: 0;
}

.service-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.service-text {
    font-size: 11px;
    color: #e8d5b7;
    text-align: center;
    line-height: 1.3;
    font-weight: 500;
    white-space: nowrap;
}

/* 主体布局 */
.main-container {
    display: flex;
    min-height: calc(100vh - 120px);
}

/* 左侧导航 */
.side-nav {
    width: 62px;
    min-width: 62px;
    background: rgba(0,0,0,0.2);
    position: sticky;
    top: 90px;
    height: calc(100vh - 90px);
    overflow-y: auto;
    scrollbar-width: none;
    padding-top: 4px;
}

.side-nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    padding: 13px 4px;
    text-align: center;
    font-size: 13px;
    color: #a89b8c;
    cursor: pointer;
    position: relative;
    transition: all 0.25s;
    line-height: 1.5;
    border-left: 3px solid transparent;
}

.nav-item.active {
    color: #5c3d1e;
    background: linear-gradient(90deg, #f5e6d3 0%, #e8d5b7 100%);
    font-weight: 700;
    border-left: 3px solid #c8956c;
}

.nav-item:not(.active):active {
    background: rgba(255,255,255,0.05);
}

/* 右侧内容 */
.content-area {
    flex: 1;
    padding: 10px 8px;
    padding-bottom: 50px;
    min-width: 0;
    overflow: hidden;
}

.category-section {
    margin-bottom: 20px;
    scroll-margin-top: 100px;
}

.section-title {
    font-size: 16px;
    color: #e8d5b7;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, #c9a87c 0%, #b8956c 100%);
    border-radius: 2px;
}

/* 商品列表 */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, #fefaf3 0%, #f5e6d3 100%);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.product-item:active {
    transform: scale(0.98);
}

/* App图标风格 */
.item-logo {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    object-fit: contain;
    display: block;
}

.item-logo-fallback {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.item-name {
    font-size: 14px;
    color: #3d2b1f;
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-users {
    font-size: 11px;
    color: #a08060;
    display: flex;
    align-items: center;
    gap: 4px;
}

.item-users::before {
    content: '';
    display: inline-block;
    width: 11px;
    height: 11px;
    min-width: 11px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a08060' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='9' cy='7' r='4'%3E%3C/circle%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'%3E%3C/path%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'%3E%3C/path%3E%3C/svg%3E") center/contain no-repeat;
}

.item-btn {
    padding: 6px 10px;
    background: linear-gradient(135deg, #ff3b2f 0%, #e02020 100%);
    border-radius: 16px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(224,32,32,0.35);
    flex-shrink: 0;
    transition: transform 0.15s;
    white-space: nowrap;
    letter-spacing: 0.5px;
    border: none;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.item-btn:active {
    transform: scale(0.92);
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 24px 16px;
    color: #a89b8c;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* 客服弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(180deg, #fefaf3 0%, #f5e6d3 100%);
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 300px;
    position: relative;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 28px;
    color: #a08060;
    cursor: pointer;
    line-height: 1;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #3d2b1f;
    margin-bottom: 16px;
}

.modal-qr {
    width: 180px;
    height: 180px;
    margin: 0 auto 16px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.modal-qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-fallback {
    flex-direction: column;
    gap: 8px;
    color: #3d2b1f;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    display: flex;
}

.qr-placeholder {
    font-size: 14px;
    color: #a08060;
}

.qr-wechat {
    font-size: 16px;
    font-weight: 700;
    color: #3d2b1f;
}

.modal-tip {
    font-size: 13px;
    color: #a08060;
    line-height: 1.5;
}

/* 响应式 */
/* 平板/大屏 */
@media (min-width: 768px) {
    .side-nav {
        width: 80px;
        min-width: 80px;
    }
    .nav-item {
        font-size: 14px;
        padding: 16px 8px;
    }
    .header {
        padding: 12px 20px;
    }
    .header-title {
        font-size: 28px;
        letter-spacing: 2px;
    }
    .logo-circle {
        width: 72px;
        height: 72px;
        min-width: 72px;
    }
    .item-logo,
    .item-logo-fallback {
        width: 52px;
        height: 52px;
        min-width: 52px;
    }
    .item-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    .product-item {
        gap: 12px;
        padding: 12px;
    }
    .item-name {
        font-size: 14px;
    }
    .content-area {
        padding: 12px 10px;
    }
}

/* 极小屏适配 (<= 359px: iPhone SE 1代等) */
@media (max-width: 359px) {
    .header {
        padding: 6px 6px;
    }
    .header-main {
        gap: 4px;
    }
    .header-title {
        font-size: 17px;
        letter-spacing: 0;
    }
    .logo-circle {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }
    .stats-primary {
        font-size: 11px;
    }
    .service-icon {
        width: 34px;
        height: 34px;
    }
    .service-text {
        font-size: 10px;
    }
    .side-nav {
        width: 52px;
        min-width: 52px;
    }
    .nav-item {
        font-size: 11px;
        padding: 11px 2px;
    }
    .item-logo,
    .item-logo-fallback {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 10px;
    }
    .item-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
    .product-item {
        gap: 6px;
        padding: 8px;
    }
    .item-name {
        font-size: 12px;
    }
    .item-users {
        font-size: 10px;
    }
    .content-area {
        padding: 8px 5px;
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-item {
    animation: fadeIn 0.4s ease-out;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(200,150,60,0.4); }
    50% { box-shadow: 0 4px 32px rgba(200,150,60,0.65); }
}

.logo-circle {
    animation: pulse 3s ease-in-out infinite;
}
