/* ===== 前台基础样式 · 闲鱼风格 v5 ===== */
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    background: #f7f7f7;
    color: #1a1a1a;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    font-feature-settings: "tnum" 1;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; outline: none; }

.container { max-width: 1000px; margin: 0 auto; padding: 0 14px; }

/* ===== 头部 ===== */
.mall-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.mall-header .container {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
}
.mall-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
    font-size: 1.12rem;
    flex-shrink: 0;
    letter-spacing: -0.3px;
}
.mall-logo .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, #FFE033, #FFC800);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255,200,0,0.3);
}
.mall-logo img {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    object-fit: cover;
    flex-shrink: 0;
}
.mall-nav {
    display: flex;
    gap: 2px;
    font-size: 0.86rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-width: 0;
}
.mall-nav::-webkit-scrollbar { display: none; }
.mall-nav a {
    padding: 7px 11px;
    border-radius: 8px;
    color: #4b5563;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    font-weight: 500;
    flex-shrink: 0;
}
.mall-nav a:hover { color: #1a1a1a; background: #f5f7fa; }
.mall-nav a.active {
    color: #1a1a1a;
    font-weight: 700;
    background: #FFF8E1;
}

/* 主内容 */
.mall-main { padding: 14px 0 40px; min-height: calc(100vh - 170px); }

/* 页脚 */
.mall-footer {
    text-align: center;
    padding: 26px 16px;
    color: #b8bcc4;
    font-size: 0.75rem;
    border-top: 1px solid #f0f0f0;
    background: #fff;
}
.mall-footer .footer-sub { font-size: 0.7rem; margin-top: 5px; color: #cbd0d8; }

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    line-height: 1.2;
    letter-spacing: 0.2px;
}
.btn-primary {
    background: linear-gradient(135deg, #FFE033, #FFC800);
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(255, 200, 0, 0.22);
}
.btn-primary:hover {
    filter: brightness(0.98);
    box-shadow: 0 4px 14px rgba(255, 200, 0, 0.35);
    transform: translateY(-1px);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-dark {
    background: #1a1a1a;
    color: #FFE033;
}
.btn-dark:hover { background: #000; transform: translateY(-1px); }
.btn-ghost { background: #f3f4f6; color: #374151; }
.btn-ghost:hover { background: #e5e7eb; }
.btn-block { display: block; width: 100%; }

/* ===== 弹窗 ===== */
.mall-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    padding: 20px;
    backdrop-filter: blur(2px);
}
.mall-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 460px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
.mall-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f5f5f5;
}
.mall-modal-header h3 { font-size: 0.98rem; font-weight: 700; letter-spacing: -0.2px; }
.mall-modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #b8bcc4;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s;
}
.mall-modal-close:hover { color: #6b7280; }
.mall-modal-body { padding: 18px 20px; overflow-y: auto; }
.mall-modal-footer { padding: 14px 20px 18px; }

/* ===== 移动端 ===== */
@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .mall-header .container {
        height: 54px;
        gap: 8px;
    }
    .mall-logo {
        font-size: 1.05rem;
        gap: 7px;
    }
    .mall-logo .logo-icon,
    .mall-logo img {
        width: 30px;
        height: 30px;
    }
    .mall-nav {
        font-size: 0.8rem;
    }
    .mall-nav a {
        padding: 6px 9px;
    }
    .mall-main {
        padding: 12px 0 24px;
        min-height: calc(100vh - 140px);
    }
}

@media (max-width: 380px) {
    .mall-logo .logo-text { display: none; }
    .mall-nav { font-size: 0.76rem; }
    .mall-nav a { padding: 6px 7px; }
}

/* __WIDER_PADDING__ 加大商品区左右留白，屏幕越宽留白越大 */
.mall-main .container {
    padding-left: clamp(16px, 4vw, 40px);
    padding-right: clamp(16px, 4vw, 40px);
}
