/**
 * components.css - 组件样式
 * 包含: 模态框、图表、任务卡片、剧场标签、客户端明细等
 */

/* ============================================================
   模态框
   ============================================================ */
.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: 1000;
}
.modal {
    background: var(--card);
    border-radius: 12px;
    width: 600px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.close-btn { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-secondary); }

/* ============================================================
   收入趋势图表 - 垂直柱状图
   ============================================================ */
.income-chart {
    display: flex;
    flex-direction: column;
    height: 220px;
    padding: 10px 0;
}
.chart-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    flex: 1;
    border-bottom: 2px solid var(--border);
    padding: 0 10px;
    position: relative;
}
.chart-container::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px dashed var(--border);
    opacity: 0.5;
}
.chart-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 60px;
}
.chart-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--warning);
    margin-bottom: 6px;
    white-space: nowrap;
}
.chart-bar-wrapper {
    width: 32px;
    height: 140px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.chart-bar {
    width: 100%;
    background: linear-gradient(180deg, #3498db, #2ecc71);
    border-radius: 4px 4px 0 0;
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 4px;
    animation: growUp 0.8s ease-out forwards;
}
@keyframes growUp {
    from { transform: scaleY(0); transform-origin: bottom; }
    to { transform: scaleY(1); transform-origin: bottom; }
}
.chart-bar.bar-today {
    background: linear-gradient(180deg, #e74c3c, #f39c12);
    box-shadow: 0 0 12px rgba(243, 156, 18, 0.4);
}
.chart-labels {
    display: flex;
    justify-content: space-around;
    padding: 10px 10px 0;
}
.chart-label {
    flex: 1;
    max-width: 60px;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
}
.chart-label.label-today {
    color: var(--warning);
    font-weight: 600;
}

/* ============================================================
   任务统计卡片
   ============================================================ */
.task-stats-row {
    display: flex;
    gap: 20px;
    padding: 0 20px 20px;
    flex-wrap: wrap;
}
.task-stat-card {
    flex: 1;
    min-width: 200px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #e8ecf1;
    transition: all 0.3s ease;
}
.task-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.task-stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.task-stat-card .stat-icon.charge {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #e65100;
}
.task-stat-card .stat-icon.income {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
}
.task-stat-card .stat-icon.prev-hour {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
}
.task-stat-card.hot .stat-icon.prev-hour {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    animation: pulse-icon 1.5s infinite;
}
@keyframes pulse-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.task-stat-card .stat-info { flex: 1; }
.task-stat-card .stat-label { font-size: 13px; color: #7f8c8d; margin-bottom: 6px; }
.task-stat-card .stat-value { font-size: 24px; font-weight: 700; }
.task-stat-card .stat-value.charge { color: #e65100; }
.task-stat-card .stat-value.income { color: #2e7d32; }
.task-stat-card .stat-value.prev-hour { color: #1565c0; }
.task-stat-card.hot .stat-value.prev-hour { color: #c62828; }
.task-stat-card.hot {
    border-color: #ffcdd2;
    background: linear-gradient(145deg, #fff8f8 0%, #ffebee 100%);
}

/* ============================================================
   任务卡片网格
   ============================================================ */
.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    padding: 20px;
}
.task-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #e8ecf1;
    display: flex;
    gap: 16px;
}
.task-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    border-color: var(--primary);
}

/* 排名徽章 */
.rank-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
.rank-badge.top1 { background: linear-gradient(135deg, #f5af19 0%, #f12711 100%); box-shadow: 0 4px 12px rgba(245, 175, 25, 0.5); }
.rank-badge.top2 { background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%); box-shadow: 0 4px 12px rgba(149, 165, 166, 0.4); }
.rank-badge.top3 { background: linear-gradient(135deg, #cd7f32 0%, #8B4513 100%); box-shadow: 0 4px 12px rgba(205, 127, 50, 0.4); }

/* 任务封面 */
.task-cover {
    width: 80px;
    height: 110px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.task-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cover-placeholder i {
    font-size: 32px;
    color: white;
    opacity: 0.9;
}

/* 任务信息 */
.task-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.task-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

/* ============================================================
   剧场标签 (通用样式)
   ============================================================ */
.meta-tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.meta-tag.theater {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f4 100%);
    color: #333;
    border: 1px solid #e0e0e0;
}
.meta-tag.theater.clickable {
    cursor: pointer;
    transition: all 0.2s;
}
.meta-tag.theater.clickable:hover {
    background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
    transform: scale(1.05);
    border-color: #ccc;
}
.meta-tag.theater.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}
.meta-tag.theater.active .theater-icon {
    background: rgba(255,255,255,0.3) !important;
    color: white !important;
}

/* 剧场图标 */
.theater-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    margin-right: 4px;
    flex-shrink: 0;
}

/* 客户端标签 */
.meta-tag.client {
    background: linear-gradient(135deg, #f0e6fa 0%, #e4d4f4 100%);
    color: #8e44ad;
}
.meta-tag.client.clickable {
    cursor: pointer;
    transition: all 0.2s;
}
.meta-tag.client.clickable:hover {
    background: linear-gradient(135deg, #e4d4f4 0%, #d4c4e8 100%);
    transform: scale(1.05);
}
.client-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    background: #8e44ad;
    color: white;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
}

/* ============================================================
   客户端明细列表
   ============================================================ */
.client-detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.client-detail-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f4 100%);
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.client-detail-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.client-rank {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    background: #e0e0e0;
    color: #666;
}
.client-rank.gold { background: linear-gradient(135deg, #f1c40f, #f39c12); color: white; }
.client-rank.silver { background: linear-gradient(135deg, #bdc3c7, #95a5a6); color: white; }
.client-rank.bronze { background: linear-gradient(135deg, #e67e22, #d35400); color: white; }
.client-info { flex: 1; }
.client-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    margin-bottom: 10px;
}
.client-name i { color: #8e44ad; }
.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #bdc3c7;
}
.online-dot.online {
    background: #27ae60;
    box-shadow: 0 0 6px rgba(39, 174, 96, 0.5);
}
.client-stats {
    display: flex;
    gap: 24px;
}
.client-stats .stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.client-stats .label { font-size: 12px; color: #95a5a6; }
.client-stats .value { font-size: 16px; font-weight: 600; }
.client-stats .value.primary { color: #3498db; }
.client-stats .value.success { color: #27ae60; }
.client-stats .value.warning { color: #e67e22; }

/* ============================================================
   星图账号选择列表
   ============================================================ */
.xingtu-select-list {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fafafa;
}
.xingtu-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #f0f0f0;
}
.xingtu-select-item:last-child { border-bottom: none; }
.xingtu-select-item:hover { background: #f5f5f5; }
.xingtu-select-item.selected {
    background: linear-gradient(135deg, #e8f4fd 0%, #dbeafe 100%);
    border-color: #3b82f6;
}
.xingtu-select-item.already-accepted {
    background: linear-gradient(135deg, #f0f9f4 0%, #e6f4ea 100%);
    opacity: 0.7;
    cursor: not-allowed;
}
.xingtu-select-item.already-accepted:hover {
    background: linear-gradient(135deg, #f0f9f4 0%, #e6f4ea 100%);
}
.xingtu-select-item.failed-retry {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe6e6 100%);
    border-color: #e74c3c;
}
.xingtu-select-item.failed-retry:hover {
    border-color: #c0392b;
    background: linear-gradient(135deg, #ffe6e6 0%, #ffd4d4 100%);
}
.xingtu-select-item.processing {
    background: linear-gradient(135deg, #fffbf0 0%, #fff3d4 100%);
    opacity: 0.7;
    cursor: not-allowed;
}
.xingtu-select-item.processing:hover {
    background: linear-gradient(135deg, #fffbf0 0%, #fff3d4 100%);
}
.xingtu-status.already,
.xingtu-status.failed,
.xingtu-status.processing {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 2px;
}
.xingtu-select-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    pointer-events: none;
    flex-shrink: 0;
}
.xingtu-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.xingtu-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}
.xingtu-info { flex: 1; min-width: 0; }
.xingtu-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xingtu-mcn { font-size: 12px; color: #999; margin-top: 2px; }
.xingtu-status {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 10px;
    background: #fee2e2;
    color: #dc2626;
    flex-shrink: 0;
}
.xingtu-status.valid { background: #dcfce7; color: #16a34a; }

/* ============================================================
   筛选提示栏
   ============================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #e8f4fd 0%, #d4e8f7 100%);
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid #c1dbef;
}
.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2980b9;
    font-size: 14px;
}
.filter-label i { font-size: 18px; }
.filter-label strong { color: #1a5276; }
.filter-count { color: #5dade2; font-size: 13px; }
.filter-clear {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #3498db;
    color: #3498db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.filter-clear:hover { background: #3498db; color: white; }

/* ============================================================
   收入数据展示
   ============================================================ */
.income-data { margin-top: auto; }
.income-row { display: flex; gap: 16px; }
.income-row.main { margin-bottom: 8px; }
.income-row.secondary {
    padding-top: 8px;
    border-top: 1px dashed #e8ecf1;
}
.income-data .income-item {
    flex: 1;
    padding: 0;
    border: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.income-data .income-item .label {
    font-size: 11px;
    color: #8c9bab;
    font-weight: 500;
}
.income-data .income-item .value {
    font-size: 18px;
    font-weight: 700;
    color: #e67e22;
}
.income-data .income-item .value.highlight { color: #27ae60; }
.income-data .income-item.small .label { font-size: 10px; }
.income-data .income-item.small .value {
    font-size: 13px;
    font-weight: 600;
    color: #95a5a6;
}
.income-data .income-item.small.accent .value { color: #3498db; }
.income-data .income-row.prev-hour {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.08) 0%, rgba(39, 174, 96, 0.05) 100%);
    padding: 6px 10px;
    border-radius: 8px;
    margin-top: 6px;
}
.income-data .income-item.small.trending .label {
    color: #27ae60;
    display: flex;
    align-items: center;
    gap: 4px;
}
.income-data .income-item.small.trending .label i { font-size: 14px; }
.income-data .income-item.small.trending .value { color: #27ae60; font-weight: 600; }

/* 高增长样式：近一小时 > 50 */
.income-data .income-row.prev-hour.hot {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15) 0%, rgba(192, 57, 43, 0.08) 100%);
    animation: pulse-hot 2s infinite;
}
@keyframes pulse-hot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { box-shadow: 0 0 8px 2px rgba(231, 76, 60, 0.2); }
}
.income-data .income-row.prev-hour.hot .income-item.small.trending .label { color: #e74c3c; }
.income-data .income-row.prev-hour.hot .income-item.small.trending .label i { animation: bounce 0.6s infinite; }
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
.income-data .income-row.prev-hour.hot .income-item.small.trending .value {
    color: #e74c3c;
    font-weight: 700;
    font-size: 15px;
}

