/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

/* 认证页面 */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-box {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 450px;
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
    margin: 0 1rem;
}

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

/* 用户中心布局 */
.user-layout {
    display: flex;
    min-height: 100vh;
}

.user-sidebar {
    width: 260px;
    background: white;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.user-info {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1rem;
}

.user-info h3 {
    margin-bottom: 0.5rem;
}

.user-info p {
    color: #666;
    font-size: 0.9rem;
}

.user-nav {
    padding: 1rem 0;
}

.user-nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: #333;
    text-decoration: none;
    transition: background 0.3s;
}

.user-nav a:hover,
.user-nav a.active {
    background: #f8f9fa;
    border-left: 3px solid #667eea;
}

.user-content {
    flex: 1;
    padding: 2rem;
}

.user-content h1 {
    margin-bottom: 2rem;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

/* 区块 */
.section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.section h2 {
    margin-bottom: 1rem;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
}

/* 订单卡片 */
.order-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.order-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
}

.order-body {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-amount {
    text-align: right;
}

.order-amount p {
    color: #666;
    font-size: 0.9rem;
}

.order-amount h2 {
    color: #e74c3c;
}

.order-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* 信息表格 */
.info-table {
    width: 100%;
}

.info-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.info-table td:first-child {
    font-weight: 600;
    width: 150px;
    color: #666;
}

/* 响应式 */
@media (max-width: 768px) {
    .user-layout {
        flex-direction: column;
    }
    
    .user-sidebar {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .order-body {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .order-amount {
        margin-top: 1rem;
        text-align: left;
    }
}

/* 分销中心样式 */
.referral-link-box {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.referral-link-box input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: #f8f9fa;
}

.level-info {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 1rem;
}

.current-level {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    flex: 1;
}

.level-icon {
    font-size: 3rem;
}

.current-level h3 {
    margin-bottom: 0.5rem;
    color: white;
}

.current-level p {
    color: rgba(255,255,255,0.9);
}

.next-level {
    flex: 1;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.next-level ul {
    list-style: none;
    margin-top: 1rem;
}

.next-level li {
    padding: 0.5rem 0;
    color: #666;
}

@media (max-width: 768px) {
    .level-info {
        flex-direction: column;
    }
    
    .referral-link-box {
        flex-direction: column;
    }
}
