/* ================================
   PurpleMall Home - 紫色主题前台样式
   风格：简约大气、低调典雅
   ================================ */

:root {
    --primary: #7c3aed;
    --primary-light: #8b5cf6;
    --primary-dark: #6d28d9;
    --primary-bg: #f5f3ff;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --bg-body: #fafafc;
    --bg-white: #ffffff;
    --bg-gray: #f8fafc;

    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-white: #ffffff;

    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --max-width: 1560px; /* 1200 * 1.3 = 1560，自适应浏览器宽度，最宽不超过1800px(1.5倍) */
    --header-height: 64px;
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ================================
   顶部导航
   ================================ */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
}

.site-logo .logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.site-logo .logo-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
    background: var(--primary-bg);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
    width: 280px;
}

.search-box input {
    width: 100%;
    height: 40px;
    padding: 0 16px 0 44px;
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    background: var(--bg-gray);
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.search-box .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.header-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.header-icon:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.header-icon .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.user-btn:hover {
    background: var(--primary-bg);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ================================
   Banner
   ================================ */
.banner-section {
    padding: 24px 0;
}

.banner {
    height: 180px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    display: flex;
    align-items: center;
    padding: 0 60px;
    position: relative;
    overflow: hidden;
}

.banner::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    right: -50px;
    top: -100px;
}

.banner::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    right: 150px;
    bottom: -80px;
}

.banner-content {
    position: relative;
    z-index: 1;
    color: #fff;
}

.banner-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.banner-desc {
    font-size: 15px;
    opacity: 0.9;
}

/* ================================
   分类导航
   ================================ */
.category-section {
    margin-bottom: 24px;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    padding: 12px 12px 6px 12px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.category-item:hover {
    background: var(--primary-bg);
    transform: translateY(-2px);
}

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.category-item:hover .category-icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
}

.category-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.category-item:hover .category-name {
    color: var(--primary);
}

/* ================================
   商品列表
   ================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 2px;
}

.section-more {
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.section-more:hover {
    color: var(--primary);
}

.goods-section {
    margin-bottom: 32px;
}

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

.goods-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition);
}

.goods-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.goods-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    position: relative;
    overflow: hidden;
}

.goods-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.goods-badge.hot {
    background: linear-gradient(135deg, #f43f5e, #ec4899);
}

.goods-badge.new {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
}

.goods-info {
    padding: 14px;
}

.goods-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 10px;
}

.goods-card:hover .goods-name {
    color: var(--primary);
}

.goods-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.goods-price {
    color: var(--danger);
    font-size: 18px;
    font-weight: 700;
}

.goods-price .symbol {
    font-size: 12px;
    margin-right: 2px;
}

.goods-sales {
    font-size: 12px;
    color: var(--text-muted);
}

.goods-stock {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.stock-low {
    color: var(--warning);
}

/* ================================
   商品详情页
   ================================ */
.goods-detail {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 32px;
    padding: 24px 0;
}

.detail-image {
    width: 100%;
    height: 420px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 120px;
}

.detail-info h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.detail-price-box {
    background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.detail-price {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.detail-price .current {
    font-size: 36px;
    font-weight: 700;
    color: var(--danger);
}

.detail-price .current .symbol {
    font-size: 18px;
}

.detail-price .price-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 4px;
}

.goods-price .price-range-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 3px;
}

.detail-price .original {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.detail-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-secondary);
}

.detail-fields {
    margin-bottom: 20px;
}

.detail-fields .form-group {
    margin-bottom: 16px;
}

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

.detail-fields input,
.detail-fields select,
.detail-fields textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    background: var(--bg-gray);
    font-family: inherit;
}

.detail-fields select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
}

.detail-fields select:hover {
    border-color: var(--primary-light);
}

.detail-fields input:focus,
.detail-fields select:focus,
.detail-fields textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.quantity-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.quantity-box {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-gray);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.quantity-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.quantity-input {
    width: 60px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    outline: none;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.btn-buy {
    flex: 1;
    height: 48px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cart {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.btn-now {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgb(124 58 237 / 30%);
}

.btn-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgb(124 58 237 / 40%);
}

/* ================================
   底部
   ================================ */
.site-footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    padding: 40px 0 24px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-brand .brand-name {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.footer-brand .brand-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
}

.footer-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ================================
   基础组件 - 卡片
   ================================ */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

/* ================================
   按钮
   ================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgb(124 58 237 / 30%);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px 0 rgb(124 58 237 / 40%);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-gray);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary-light);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%);
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.btn-block {
    width: 100%;
}

/* ================================
   表单
   ================================ */
.form-group {
    margin-bottom: 20px;
}

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

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-gray);
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-input:disabled {
    background: var(--bg-gray);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-tip {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

/* 带图标的输入框 */
.input-icon-group {
    position: relative;
}

.input-icon-group .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
}

.input-icon-group .form-input {
    padding-left: 44px;
}

/* ================================
   表格
   ================================ */
.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    padding: 14px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-gray);
    border-bottom: 2px solid var(--border-light);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--primary-bg);
}

/* ================================
   徽章
   ================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.badge-purple { background: rgba(124, 58, 237, 0.1); color: var(--primary); }
.badge-muted { background: var(--bg-gray); color: var(--text-muted); }

/* ================================
   分页
   ================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    padding-top: 20px;
    flex-wrap: wrap;
}

.pagination .page-item,
.pagination .page-btn {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-gray);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.pagination .page-item:hover,
.pagination .page-btn:hover {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary-light);
}

.pagination .page-item.active,
.pagination .page-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px 0 rgb(124 58 237 / 30%);
}

.pagination .page-info {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: 12px;
}

/* ================================
   工具类
   ================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-strong { font-weight: 600; }
.text-small { font-size: 12px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 24px; }

.w-full { width: 100%; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* ================================
   用户中心布局
   ================================ */
.user-layout {
    display: flex;
    gap: 24px;
    padding: 24px 0;
    align-items: flex-start;
}

.user-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
}

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

/* 侧边栏菜单项 */
.user-sidebar .menu-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-secondary);
    transition: var(--transition);
    border-radius: var(--radius-sm);
    margin: 2px 8px;
    font-size: 14px;
    font-weight: 500;
}

.user-sidebar .menu-item:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.user-sidebar .menu-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 12px 0 rgb(124 58 237 / 30%);
}

.user-sidebar .menu-item .menu-icon {
    width: 20px;
    text-align: center;
    margin-right: 12px;
    font-style: normal;
}

/* ================================
   独立认证页面 (登录/注册/找回密码)
   ================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
    top: -200px;
    right: -200px;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    bottom: -100px;
    left: -100px;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 10;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-circle {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 30px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px 0 rgb(124 58 237 / 30%);
}

.auth-logo h1 {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

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

.auth-form .input-icon-group .form-input {
    padding: 13px 16px 13px 44px;
    background: var(--bg-gray);
}

.auth-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
    box-shadow: 0 4px 14px 0 rgb(124 58 237 / 30%);
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 rgb(124 58 237 / 40%);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ================================
   移动端汉堡菜单
   ================================ */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 20px;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    background: var(--primary);
    color: #fff;
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    background: #fff;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0,0,0,0.1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav.active {
    transform: translateX(0);
}

.mobile-nav-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    margin-bottom: 8px;
}

.mobile-nav-header .site-logo {
    color: #fff;
}

.mobile-nav-header .site-logo .logo-text {
    -webkit-text-fill-color: #fff;
    color: #fff;
}

.mobile-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.mobile-nav .nav-item:hover,
.mobile-nav .nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
}

.mobile-nav .nav-divider {
    height: 1px;
    background: var(--border-light);
    margin: 8px 0;
}

/* ================================
   充值页面
   ================================ */
.recharge-balance-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    color: #fff;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.recharge-balance-box::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    right: -50px;
    top: -80px;
}

.recharge-balance-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    position: relative;
}

.recharge-balance-amount {
    font-size: 36px;
    font-weight: 700;
    position: relative;
}

.recharge-balance-amount .symbol {
    font-size: 18px;
    margin-right: 2px;
}

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

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ================================
   滚动条
   ================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ================================
   响应式 - 全局缩放
   ================================ */
@media (max-width: 1024px) {
    .goods-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .category-list {
        grid-template-columns: repeat(5, 1fr);
    }
    .goods-detail {
        grid-template-columns: 1fr;
    }
    .detail-image {
        height: 320px;
    }
    .user-layout {
        gap: 16px;
    }
    .user-sidebar {
        width: 200px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    .container {
        padding: 0 12px;
        box-sizing: border-box;   /* 防止 padding 把 container 撑出视口 */
        max-width: 100%;
    }

    /* 显示移动端汉堡菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
    }

    /* 头部导航 */
    .header-inner {
        flex-wrap: wrap;
        gap: 8px;
    }
    .site-header {
        /* 手机端 header 会折行（logo+登录/头像 第1行，搜索框第2行），不能再固定 56px，
           否则第2行内容被切 → 改 min-height + height:auto，让高度随内容撑开，
           解决截图 4/5 顶部被挤出屏幕的问题 */
        height: auto;
        min-height: var(--header-height);
        padding-bottom: 6px;
    }
    .site-logo {
        font-size: 18px;
        flex: 1 1 auto;
        min-width: 0;           /* 防止 logo 名过长把容器撑宽 */
        max-width: 55%;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .site-logo h1 {
        font-size: 17px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    .site-logo .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
        flex-shrink: 0;
    }
    .header-nav {
        display: none;
    }
    .search-box {
        width: 100%;
        order: 3;
    }
    .search-box input {
        height: 36px;
        font-size: 13px;
    }
    .header-right {
        gap: 8px;
    }
    .user-name {
        display: none;
    }
    .header-icon {
        width: 36px;
        height: 36px;
    }

    /* Banner */
    .banner {
        height: 120px;
        padding: 0 20px;
        border-radius: var(--radius-md);
    }
    .banner-title {
        font-size: 20px;
    }
    .banner-desc {
        font-size: 12px;
    }

    /* 分类导航 */
    .category-list {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        padding: 10px 10px 4px 10px;
    }
    .category-item {
        padding: 6px 4px;
        gap: 3px;
    }
    .category-icon {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }
    .category-name {
        font-size: 11px;
    }

    /* 商品列表 */
    .goods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .goods-image {
        height: 130px;
        font-size: 40px;
    }
    .goods-info {
        padding: 10px;
    }
    .goods-name {
        font-size: 13px;
        height: 36px;
    }
    .goods-price {
        font-size: 16px;
    }

    /* 商品详情 */
    .goods-detail {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 12px 0;
    }
    .detail-image {
        height: 240px;
        font-size: 80px;
    }
    .detail-info h1 {
        font-size: 18px;
    }
    .detail-price .current {
        font-size: 28px;
    }
    .detail-meta {
        flex-wrap: wrap;
        gap: 12px;
    }
    .action-buttons {
        flex-direction: row;
    }
    .action-buttons .btn-buy {
        width: auto;
        height: 48px;
    }

    /* 用户中心 - 移动端切换为顶部Tab式 */
    .user-layout {
        flex-direction: column;
        gap: 12px;
        padding: 12px 0;
    }
    .user-sidebar {
        width: 100%;
        position: static;
    }
    .user-sidebar .card {
        margin-bottom: 0;
    }
    .user-sidebar .user-profile-card {
        padding: 16px;
    }
    .user-sidebar .user-profile-card .avatar-circle {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    /* 移动端菜单横向滚动 */
    .user-sidebar .user-menu {
        display: flex;
        overflow-x: auto;
        gap: 4px;
        padding: 8px;
        -webkit-overflow-scrolling: touch;
    }
    .user-sidebar .user-menu .menu-item {
        flex-shrink: 0;
        padding: 8px 14px;
        margin: 0;
        font-size: 13px;
        white-space: nowrap;
    }
    .user-sidebar .user-menu .menu-item .menu-icon {
        margin-right: 4px;
        font-size: 14px;
    }
    .user-sidebar .user-menu .menu-divider {
        display: none;
    }

    /* 表单单列 */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    /* 解决截图 4/5 右侧「佣金余额 / 累计消费」被切到屏幕外：
       每格强制 box-sizing:border-box + overflow-wrap + min-width:0，
       大号价格改成 18px（原24px太大），避免撑破列宽 */
    .stats-grid > div {
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-align: center;
    }
    .stats-grid > div > div:first-child {
        font-size: 18px !important;
        line-height: 1.25;
        overflow-wrap: anywhere;
        word-break: break-all;
    }
    .stats-grid > div > div:last-child {
        font-size: 11px !important;
        margin-top: 2px !important;
        overflow-wrap: anywhere;
    }
    .user-layout .card-body {
        padding: 14px !important;   /* 从 20px 缩，避免左右 padding 撑破 */
        box-sizing: border-box;
    }
    .user-main {
        min-width: 0;               /* flex child 需要，否则会溢出父容器 */
        max-width: 100%;
        overflow-x: hidden;
    }

    /* 快捷入口 */
    .quick-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
    }
    .quick-grid > a {
        padding: 12px 8px !important;
    }
    .quick-grid > a > div:first-child {
        font-size: 22px !important;
    }

    /* 认证页面 */
    .auth-card {
        padding: 32px 24px;
    }
    .auth-logo h1 {
        font-size: 22px;
    }

    /* 购物车 */
    .cart-layout {
        flex-direction: column;
    }
    .cart-summary {
        width: 100%;
        position: static;
    }

    /* 订单详情 */
    .order-detail-grid {
        grid-template-columns: 1fr !important;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .site-footer {
        padding: 24px 0 16px;
    }
    .footer-brand .brand-desc {
        font-size: 12px;
    }

    /* 表格滚动 */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table {
        font-size: 12px;
    }
    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    /* 分页 */
    .pagination {
        gap: 4px;
    }
    .pagination .page-item,
    .pagination .page-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .goods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .category-list {
        grid-template-columns: repeat(3, 1fr);
    }
    .auth-card {
        padding: 24px 20px;
    }
}

/* ================================
   全局Toast提示组件
   ================================ */
.pm-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s;
    max-width: 90vw;
    text-align: center;
}
.pm-toast.success { background: #10b981; }
.pm-toast.error { background: #ef4444; }
.pm-toast.warning { background: #f59e0b; }
.pm-toast.info { background: #3b82f6; }

/* ================================
   响应式增强 - 确保所有页面移动端友好
   ================================ */
/* 全局第一层：任何屏幕（含平板/PC窄屏）都避免横向溢出 */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}
* {
    box-sizing: border-box;
}
img, iframe, video, table, pre, code {
    max-width: 100%;
    overflow-x: auto;
}
section, .card, .goods-grid, .product-list-grid, .category-nav-section,
.category-nav, .featured-slider, .slider-container, .site-header,
.site-footer, main, footer, header {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}
.container > * {
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .container {
        max-width: 100% !important;
        padding: 0 12px !important;
        box-sizing: border-box;
    }
    main {
        min-height: calc(100vh - var(--header-height) - 200px);
    }

    /* Header 手机端适配：防止横向溢出 */
    .site-header {
        width: 100vw !important;
        max-width: 100vw;
        box-sizing: border-box;
    }
    .header-inner {
        flex-wrap: wrap;
        padding: 0 12px;
        box-sizing: border-box;
        max-width: 100%;
        width: 100%;
        min-width: 0;
    }
    .search-box {
        width: auto !important;
        flex: 1;
        min-width: 0;
        max-width: 55vw;
    }
    .header-nav {
        display: none !important;
    }
    .user-name {
        display: none !important;
    }
    .user-btn {
        padding: 6px !important;
    }

    /* 卡片内边距缩小 */
    .card-body {
        padding: 14px !important;
    }
    .card-header {
        padding: 12px 14px !important;
        flex-wrap: wrap;
        gap: 8px;
    }
    .card-title {
        font-size: 15px !important;
    }

    /* 表格水平滚动 */
    .data-table {
        min-width: 500px;
    }

    /* 分页简化 */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    .page-info {
        width: 100%;
        text-align: center;
        font-size: 12px;
        margin-bottom: 8px;
    }

    /* 弹窗适配 */
    .modal-mask,
    [style*="position:fixed"][style*="z-index:9999"] {
        padding: 12px !important;
    }
    .modal-mask > div,
    [style*="position:fixed"][style*="z-index:9999"] > div {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }

    /* 订单列表项适配 */
    .user-main [style*="display:flex"][style*="align-items:center"][style*="gap:16px"] {
        flex-wrap: wrap !important;
        gap: 10px !important;
        padding: 12px !important;
    }

    /* 统计卡片两列 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* 充值金额按钮两列 */
    .recharge-amount-btn {
        font-size: 14px !important;
        padding: 10px !important;
    }

    /* 分销页面双栏改单栏 */
    [class*="dist-grid"] {
        grid-template-columns: 1fr !important;
    }

    /* 提现弹窗全宽 */
    #withdrawModal > div {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px !important;
    }
    /* 极小屏幕统计卡片仍保持两列 */
    .stats-grid {
        gap: 8px !important;
    }
    .stats-grid > div > div:first-child {
        font-size: 20px !important;
    }
    /* 卡片内边距再缩小 */
    .card-body {
        padding: 10px !important;
    }
    /* 字体微调 */
    body {
        font-size: 13px;
    }
}

/* ================================
   通用辅助样式
   ================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 600; }
.font-mono { font-family: 'Courier New', monospace; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.full-width { width: 100%; }
