/**
 * Affiliate Area 页面样式
 * 与整站风格统一：深蓝主色 #00247D，红色辅色 #C8102E
 *
 * @package Redstar
 */

/* ==========================================================================
   页面布局
   ========================================================================== */
.affiliate-area-page {
    background: #f5f6f8;
    min-height: 70vh;
}

/* 页面标题区 - 与首页英雄区风格一致 */
.affiliate-hero {
    background: linear-gradient(135deg, #00247D 0%, #012169 100%);
    color: white;
    padding: 60px 20px;
    position: relative;
    overflow: hidden;
}

/* 装饰气泡效果 */
.affiliate-hero::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    top: -150px;
    right: -100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.affiliate-hero::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    bottom: -100px;
    left: -80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 16, 46, 0.12) 0%, rgba(200, 16, 46, 0) 70%);
    pointer-events: none;
}

.affiliate-hero-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.affiliate-hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: white;
}

.affiliate-hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.92;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 主体容器 */
.affiliate-body {
    padding: 60px 20px 80px;
}

.affiliate-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================================================
   统计卡片区域
   ========================================================================== */
.affiliate-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.affiliate-stat-card {
    background: white;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 28px 32px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.affiliate-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #00247D 0%, #C8102E 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.affiliate-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 36, 125, 0.1);
    border-color: #00247D;
}

.affiliate-stat-card:hover::before {
    opacity: 1;
}

.affiliate-stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.affiliate-stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.affiliate-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.affiliate-stat-icon.primary {
    background: rgba(0, 36, 125, 0.1);
    color: #00247D;
}

.affiliate-stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.affiliate-stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.affiliate-stat-icon.danger {
    background: rgba(200, 16, 46, 0.1);
    color: #C8102E;
}

.affiliate-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
    line-height: 1.2;
}

.affiliate-stat-change {
    font-size: 13px;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 4px;
}

.affiliate-stat-change.negative {
    color: #C8102E;
}

/* ==========================================================================
   推荐链接区域
   ========================================================================== */
.affiliate-section {
    background: white;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 36px;
    margin-bottom: 28px;
}

.affiliate-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.affiliate-section-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00247D 0%, #012169 100%);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* 推荐链接输入框 */
.affiliate-link-box {
    background: #fafbfc;
    border: 1px solid #e8eaed;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.affiliate-link-label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin-bottom: 10px;
    display: block;
}

.affiliate-link-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.affiliate-link-input {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    border: 1px solid #dde1e7;
    border-radius: 5px;
    font-size: 14px;
    color: #333;
    background: white;
    font-family: 'Courier New', monospace;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.affiliate-link-input:focus {
    outline: none;
    border-color: #00247D;
    box-shadow: 0 0 0 3px rgba(0, 36, 125, 0.08);
}

.affiliate-copy-btn {
    height: 44px;
    padding: 0 24px;
    background: #00247D;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.affiliate-copy-btn:hover {
    background: #012169;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 36, 125, 0.2);
}

.affiliate-copy-btn.copied {
    background: #10b981;
}

/* ==========================================================================
   佣金表格
   ========================================================================== */
.affiliate-table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
}

.affiliate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
}

.affiliate-table thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #e8eaed;
    background: #fafbfc;
    white-space: nowrap;
}

.affiliate-table tbody td {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    vertical-align: middle;
}

.affiliate-table tbody tr:last-child td {
    border-bottom: none;
}

.affiliate-table tbody tr:hover {
    background: #fafbfc;
}

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

.affiliate-status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.affiliate-status-badge.paid {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.affiliate-status-badge.rejected {
    background: rgba(200, 16, 46, 0.1);
    color: #C8102E;
}

/* ==========================================================================
   信息提示框
   ========================================================================== */
.affiliate-info-box {
    background: #f0f3f9;
    border: 1px solid #d1dae8;
    border-left: 4px solid #00247D;
    border-radius: 6px;
    padding: 20px 24px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.affiliate-info-box.warning {
    background: #fff9e6;
    border-color: #ffe5a3;
    border-left-color: #f59e0b;
}

.affiliate-info-box.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    border-left-color: #10b981;
}

.affiliate-info-icon {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 20px;
}

.affiliate-info-icon.primary {
    color: #00247D;
}

.affiliate-info-icon.warning {
    color: #f59e0b;
}

.affiliate-info-icon.success {
    color: #10b981;
}

.affiliate-info-content {
    flex: 1;
}

.affiliate-info-content strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1a1a2e;
}

.affiliate-info-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

/* ==========================================================================
   操作按钮
   ========================================================================== */
.affiliate-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.affiliate-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.affiliate-btn-primary {
    background: #00247D;
    color: white;
}

.affiliate-btn-primary:hover {
    background: #012169;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 36, 125, 0.2);
}

.affiliate-btn-secondary {
    background: white;
    color: #00247D;
    border: 2px solid #00247D;
}

.affiliate-btn-secondary:hover {
    background: #00247D;
    color: white;
}

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

.affiliate-btn-danger:hover {
    background: #A00D26;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(200, 16, 46, 0.2);
}

/* ==========================================================================
   空状态
   ========================================================================== */
.affiliate-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.affiliate-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: #f0f3f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #00247D;
}

.affiliate-empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.affiliate-empty-text {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto 28px;
}

/* ==========================================================================
   响应式设计
   ========================================================================== */
@media (max-width: 900px) {
    .affiliate-hero-title {
        font-size: 2rem;
    }
    
    .affiliate-hero-subtitle {
        font-size: 1rem;
    }
    
    .affiliate-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .affiliate-section {
        padding: 24px 20px;
    }
    
    .affiliate-link-input-group {
        flex-direction: column;
    }
    
    .affiliate-copy-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .affiliate-hero {
        padding: 40px 20px;
    }
    
    .affiliate-hero-title {
        font-size: 1.75rem;
    }
    
    .affiliate-body {
        padding: 40px 15px 60px;
    }
    
    .affiliate-section {
        padding: 20px 16px;
    }
    
    .affiliate-section-title {
        font-size: 1.25rem;
    }
    
    .affiliate-stat-card {
        padding: 20px;
    }
    
    .affiliate-table thead {
        display: none;
    }
    
    .affiliate-table tbody td {
        display: block;
        padding: 10px 16px;
        text-align: left;
        border-bottom: none;
    }
    
    .affiliate-table tbody td::before {
        content: attr(data-title) ": ";
        font-weight: 600;
        color: #999;
        font-size: 12px;
        display: inline-block;
        min-width: 100px;
    }
    
    .affiliate-table tbody tr {
        display: block;
        border-bottom: 1px solid #e8eaed;
        padding: 12px 0;
        margin-bottom: 12px;
    }
    
    .affiliate-actions {
        flex-direction: column;
    }
    
    .affiliate-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   加载动画
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.affiliate-stat-card,
.affiliate-section {
    animation: fadeInUp 0.5s ease-out;
}

.affiliate-stat-card:nth-child(1) { animation-delay: 0.1s; }
.affiliate-stat-card:nth-child(2) { animation-delay: 0.2s; }
.affiliate-stat-card:nth-child(3) { animation-delay: 0.3s; }
.affiliate-stat-card:nth-child(4) { animation-delay: 0.4s; }
