/* ============================================
   商品分销系统 - 样式文件
   ============================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   顶部导航
   ============================================ */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    gap: 20px;
}

.navbar-logo {
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* 胶囊按钮组 */
.nav-pills {
    display: flex;
    background: rgba(255,255,255,0.15);
    border-radius: 25px;
    padding: 4px;
    gap: 2px;
    flex: 1;
    justify-content: space-around;
}

.nav-pill {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
    flex: 1;
    text-align: center;
}

.nav-pill:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav-pill.active {
    background: rgba(255,255,255,0.25);
    color: white;
    font-weight: 500;
}

.navbar-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ============================================
   主容器
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ============================================
   Hero区域
   ============================================ */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
    border-radius: 0 0 30px 30px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 16px;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   按钮
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: white;
    color: #667eea;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e0e0e0;
    color: #333;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-danger {
    background: #f56c6c;
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

/* ============================================
   卡片
   ============================================ */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   商品列表
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.product-image {
    height: 180px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.product-content {
    padding: 20px;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.product-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.product-price .current {
    font-size: 24px;
    font-weight: bold;
    color: #f56c6c;
}

.product-price .original {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.form-label .required {
    color: #f56c6c;
    margin-left: 4px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ============================================
   价格计算
   ============================================ */
.price-calculator {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

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

.quantity-btns {
    display: flex;
    align-items: center;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f7fa;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
}

.quantity-btn:hover {
    background: #e4e7ed;
}

.quantity-input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}

.price-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e4e7ed;
}

.price-summary .label {
    font-size: 14px;
    color: #666;
}

.price-summary .value {
    font-size: 24px;
    font-weight: bold;
    color: #f56c6c;
}

.discount-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
}

/* ============================================
   订单成功
   ============================================ */
.order-success {
    text-align: center;
    padding: 40px 20px;
}

.order-success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.order-success h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #333;
}

.order-success p {
    font-size: 15px;
    color: #666;
    margin-bottom: 24px;
}

.order-info {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    margin: 20px 0;
}

.order-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e4e7ed;
}

.order-info-row:last-child {
    border-bottom: none;
}

.order-info-row .label {
    color: #666;
}

.order-info-row .value {
    font-weight: 500;
    color: #333;
}

.wechat-payment {
    background: white;
    border: 2px solid #07c160;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
}

.wechat-payment h3 {
    color: #07c160;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wechat-qrcode {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #999;
}

/* ============================================
   分销商中心
   ============================================ */
.distributor-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.stat-card .icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.stat-card .label {
    font-size: 13px;
    color: #999;
}

.promotion-link-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.promotion-link-box h3 {
    margin-bottom: 12px;
}

.promotion-link-input {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.promotion-link-input input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
}

.copy-btn {
    padding: 10px 20px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.copy-btn:hover {
    transform: translateY(-1px);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: #fafafa;
}

/* ============================================
   状态标签
   ============================================ */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: #fdf6ec;
    color: #e6a23c;
}

.status-paid {
    background: #ecf5ff;
    color: #409eff;
}

.status-completed {
    background: #f0f9eb;
    color: #67c23a;
}

.status-cancelled {
    background: #fef0f0;
    color: #f56c6c;
}

/* ============================================
   分页
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination button {
    padding: 8px 16px;
    border: 1px solid #dcdfe6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ============================================
   标签页
   ============================================ */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: #f5f7fa;
    padding: 4px;
    border-radius: 10px;
}

.tab {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ============================================
   模态框
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f7fa;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #e4e7ed;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

/* ============================================
   提示消息
   ============================================ */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 3000;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ============================================
   分销招募
   ============================================ */
.recruit-section {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    border-radius: 20px;
    padding: 50px 30px;
    text-align: center;
    color: white;
    margin: 40px 0;
}

.recruit-section h2 {
    font-size: 28px;
    margin-bottom: 16px;
}

.recruit-section p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.recruit-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.recruit-feature {
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.recruit-feature .icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.recruit-feature h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.recruit-feature p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

/* ============================================
   阶梯折扣说明（分销商可见）
   ============================================ */
.discount-tiers {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.discount-tiers h4 {
    font-size: 15px;
    margin-bottom: 12px;
    color: #333;
}

.discount-tier-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.discount-tier-item {
    background: white;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 1px solid #e4e7ed;
}

.discount-tier-item .quantity {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.discount-tier-item .discount {
    font-size: 18px;
    font-weight: bold;
    color: #f56c6c;
}

/* ============================================
   底部
   ============================================ */
.footer {
    background: #2c3e50;
    color: rgba(255,255,255,0.7);
    padding: 40px 20px;
    text-align: center;
    margin-top: 60px;
}

.footer p {
    margin-bottom: 8px;
    font-size: 14px;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 768px) {
    .nav-pills {
        gap: 2px;
        padding: 3px;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .nav-pill {
        font-size: 13px;
        padding: 6px 12px;
        flex: none;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero p {
        font-size: 15px;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .distributor-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .recruit-features {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        flex: none;
        padding: 10px 14px;
        font-size: 13px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .navbar-inner {
        flex-direction: column;
        height: auto;
        padding: 10px 0;
        gap: 8px;
    }

    .nav-pills {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .nav-pill {
        font-size: 12px;
        padding: 6px 12px;
        flex: none;
    }

    .distributor-stats {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* 商品详情顶部布局 - 电脑端左右布局 */
.product-detail-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* 商品详情内容样式 */
.product-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    display: block;
}
.product-detail-content p {
    margin-bottom: 12px;
}
.product-detail-content h1, .product-detail-content h2, .product-detail-content h3 {
    margin: 16px 0 8px 0;
    color: #333;
}
.product-detail-content ul, .product-detail-content ol {
    margin: 8px 0;
    padding-left: 24px;
}
.product-detail-content li {
    margin-bottom: 4px;
}

/* ============================================
   管理员后台 - 电脑端基础样式
   ============================================ */

/* 登录页 */
.login-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 24px;
    color: #333;
}

.login-container .form-group {
    margin-bottom: 16px;
}

.login-container .btn {
    width: 100%;
    margin-top: 8px;
}

/* 后台布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 220px;
    background: #2c3e50;
    color: white;
    padding: 20px 0;
    flex-shrink: 0;
}

.admin-sidebar h2 {
    font-size: 18px;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
}

.admin-menu-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

.admin-menu-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.admin-menu-item.active {
    background: #667eea;
    color: white;
    border-left: 3px solid #764ba2;
}

.admin-content {
    flex: 1;
    padding: 24px;
    background: #f5f7fa;
    overflow-x: auto;
}

.admin-header {
    margin-bottom: 20px;
}

.admin-header h1 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

/* 数据概览 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-box .label {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}

.stat-box .value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.stat-box .value.blue { color: #1890ff; }
.stat-box .value.orange { color: #fa8c16; }
.stat-box .value.green { color: #52c41a; }
.stat-box .value.red { color: #f5222d; }

/* 筛选栏 */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

/* 卡片 */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 16px;
    color: #333;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    background: #fafafa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #eee;
}

td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: #333;
}

tr:hover {
    background: #fafafa;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending { background: #fff7e6; color: #fa8c16; }
.status-completed { background: #f6ffed; color: #52c41a; }
.status-cancelled { background: #fff1f0; color: #f5222d; }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary { background: #1890ff; color: white; }
.btn-primary:hover { background: #40a9ff; }
.btn-success { background: #52c41a; color: white; }
.btn-success:hover { background: #73d13d; }
.btn-danger { background: #f5222d; color: white; }
.btn-danger:hover { background: #ff4d4f; }
.btn-secondary { background: #f0f0f0; color: #333; }
.btn-secondary:hover { background: #d9d9d9; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

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

.pagination button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.pagination button:hover:not(:disabled) {
    border-color: #1890ff;
    color: #1890ff;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .active {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}

/* Toast提示 */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   移动端适配 - 全面优化（手机和IPAD）
   ============================================ */

/* IPAD适配（768px - 1024px） */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        padding: 20px 15px;
    }

    .hero {
        padding: 40px 20px;
    }

    .hero h1 {
        font-size: 30px;
    }

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

    .distributor-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 管理员后台适配 */
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100% !important;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px;
        gap: 8px;
    }

    .admin-menu-item {
        flex: 1;
        min-width: 100px;
        text-align: center;
        padding: 10px 8px;
        font-size: 13px;
    }

    .admin-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 手机适配（<768px）- 全面优化 */
@media (max-width: 767px) {
    /* 基础调整 */
    body {
        font-size: 14px;
        -webkit-text-size-adjust: 100%;
    }

    .container {
        padding: 15px 12px;
    }

    /* 顶部导航 */
    .navbar {
        padding: 0 12px;
    }

    .navbar-inner {
        height: 50px;
    }

    .navbar-logo {
        font-size: 16px;
    }

    .nav-pills {
        gap: 2px;
        padding: 3px;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .nav-pill {
        font-size: 13px;
        padding: 6px 12px;
        flex: none;
    }

    .navbar-auth {
        gap: 6px;
    }

    .navbar-auth .btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Hero区域 */
    .hero {
        padding: 30px 15px;
        margin-bottom: 20px;
        border-radius: 0 0 20px 20px;
    }

    .hero h1 {
        font-size: 22px;
        margin-bottom: 10px;
    }

    .hero p {
        font-size: 14px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    /* 商品网格 */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* 商品详情顶部 - 手机端上下布局 */
    .product-detail-top {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-detail-top h1 {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .product-card {
        padding: 16px;
    }

    .product-card h3 {
        font-size: 16px;
    }

    .product-price {
        font-size: 20px;
    }

    /* 按钮优化 - 确保足够大的点击区域 */
    .btn {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 14px;
        touch-action: manipulation;
    }

    .btn-sm {
        min-height: 36px;
        padding: 6px 12px;
        font-size: 13px;
    }

    /* 表单优化 */
    .form-group {
        margin-bottom: 16px;
    }

    .form-label {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .form-input,
    .form-textarea,
    .form-select {
        padding: 12px;
        font-size: 16px; /* 防止iOS自动缩放 */
        min-height: 44px;
    }

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

    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* 分销商统计卡片 */
    .distributor-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px 10px;
    }

    .stat-card .value {
        font-size: 18px;
    }

    .stat-card .label {
        font-size: 12px;
    }

    /* 推广链接 */
    .promotion-link-box {
        padding: 16px;
    }

    .promotion-link-input {
        flex-direction: column;
        gap: 8px;
    }

    .promotion-link-input input {
        width: 100%;
        font-size: 12px;
    }

    .promotion-link-input .copy-btn {
        width: 100%;
    }

    /* 标签页 */
    .tabs {
        flex-wrap: wrap;
        gap: 4px;
    }

    .tab {
        flex: none;
        padding: 10px 12px;
        font-size: 13px;
        min-height: 40px;
    }

    /* 表格优化 - 横向滚动 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px;
    }

    table {
        font-size: 12px;
        min-width: 600px;
    }

    th, td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    /* 卡片 */
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }

    .card-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    /* 弹窗优化 */
    .modal {
        padding: 10px;
    }

    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px 16px;
        border-radius: 12px;
    }

    .modal-header {
        padding-bottom: 12px;
        margin-bottom: 16px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* 管理员后台适配 */
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100% !important;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 8px;
        gap: 6px;
        position: relative;
    }

    .admin-menu-item {
        flex: 1;
        min-width: 80px;
        text-align: center;
        padding: 10px 6px;
        font-size: 12px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .admin-content {
        padding: 12px;
    }

    .admin-header {
        margin-bottom: 16px;
    }

    .admin-header h1 {
        font-size: 20px;
    }

    /* 数据概览网格 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-box {
        padding: 14px 10px;
    }

    .stat-box .label {
        font-size: 12px;
    }

    .stat-box .value {
        font-size: 18px;
    }

    /* 筛选栏 */
    .filter-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .filter-bar select,
    .filter-bar input {
        flex: 1;
        min-width: 120px;
        font-size: 14px;
        min-height: 40px;
    }

    /* 分页 */
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }

    .pagination button {
        min-width: 44px;
        min-height: 44px;
        font-size: 13px;
    }

    .pagination span {
        width: 100%;
        text-align: center;
        font-size: 13px;
    }

    /* 订单成功页面 */
    .order-success-box {
        padding: 20px 16px;
    }

    .order-success-icon {
        font-size: 48px;
    }

    .order-success-title {
        font-size: 20px;
    }

    /* Toast提示 */
    .toast {
        max-width: 90%;
        font-size: 14px;
        padding: 12px 16px;
    }

    /* 商品详情 */
    .product-detail-content {
        font-size: 14px;
    }

    .product-detail-content img {
        margin: 10px 0;
    }

    /* 招募区域 */
    .recruit-section {
        padding: 20px 16px;
    }

    .recruit-features {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* 底部 */
    .footer {
        padding: 20px 15px;
        font-size: 13px;
    }
}

/* 小屏手机适配（<480px） */
@media (max-width: 480px) {
    .navbar-inner {
        flex-direction: column;
        height: auto;
        padding: 8px 0;
        gap: 6px;
    }

    .navbar-logo {
        font-size: 15px;
    }

    .nav-pills {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        gap: 2px;
        padding: 3px;
    }

    .nav-pill {
        font-size: 12px;
        padding: 6px 12px;
        flex: none;
    }

    .hero h1 {
        font-size: 20px;
    }

    .distributor-stats {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-menu-item {
        min-width: 70px;
        font-size: 11px;
        padding: 8px 4px;
    }
}

/* 确保触摸设备上的交互元素有足够的点击区域 */
@media (hover: none) and (pointer: coarse) {
    button,
    .btn,
    .navbar-link,
    .tab,
    .admin-menu-item,
    .product-card {
        -webkit-tap-highlight-color: transparent;
    }

    button:active,
    .btn:active {
        opacity: 0.8;
    }
}


/* 图片查看器（放大查看） */
.image-viewer-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,0.92) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
}
.image-viewer-overlay img {
    max-width: 90% !important;
    max-height: 90% !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5) !important;
    cursor: default !important;
}
.image-viewer-close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.25) !important;
    color: white !important;
    border: none !important;
    font-size: 24px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000000 !important;
    line-height: 1 !important;
    padding: 0 !important;
}
.image-viewer-close:hover {
    background: rgba(255,255,255,0.45) !important;
}
