/* 引入现代化设计样式 */
@import url('./data-analytics-modern.css');
@import url('./income-analytics-modern.css');

/* 数据分析中心专业样式 */
.data-analytics-content {
    padding: 0;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title:first-child {
    margin-top: 0;
}

.section-title i {
    color: #667eea;
}

/* 数据更新提示信息 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}


/* 数据卡片样式 - 参考收益分析界面 */
.data-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.data-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border: 1px solid #e8edff;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.data-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.data-card.primary {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8edff 50%, #dde4ff 100%);
    border: 2px solid #667eea;
    position: relative;
    overflow: hidden;
}

.data-card.primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.data-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.data-card.primary .data-title {
    color: #555;
    font-weight: 600;
}

.data-value {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.2;
}

.data-card.primary .data-value {
    font-size: 26px;
    color: #333;
}

.data-desc {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.data-card.primary .data-desc {
    color: #666;
    font-weight: 500;
}

.data-trend {
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

.data-trend.no-change {
    color: #999;
}

.data-trend.positive {
    color: #52c41a;
}

.data-trend.negative {
    color: #ff4d4f;
}

/* 今日趋势样式 */
.stat-trend {
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

.stat-trend.positive {
    color: #52c41a;
}

.stat-trend.negative {
    color: #ff4d4f;
}

.stat-trend.no-change {
    color: #999;
}

/* 图表容器 - 简化背景 */
.chart-container {
    margin-top: 20px;
}

/* 数据中心的图表容器特殊样式 - 覆盖dashboard.css中的height:300px */
#data-content .chart-container {
    height: auto !important;
}

#data-content .reading-trend-chart,
#reading-trend-chart {
    height: 380px !important;
    min-height: 380px !important;
}

.reading-trend-chart,
.interaction-chart {
    background: white;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #e8edff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    height: 450px !important;
    min-height: 450px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.chart-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8edff;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.section-controls {
    display: flex;
    align-items: center;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.month-select {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.month-select:hover {
    border-color: #667eea;
    color: #667eea;
}

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

.chart-btn {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

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

/* 趋势图表 */
.trend-chart {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
}

.chart-area {
    width: 100%;
    height: 100%;
    position: relative;
}

.chart-grid {
    display: flex;
    height: 200px;
    margin-bottom: 20px;
}

.y-axis {
    width: 45px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 12px;
}

.y-label {
    font-size: 13px;
    color: #666;
    text-align: right;
    line-height: 1;
    font-weight: 500;
}

.chart-plot {
    flex: 1;
    position: relative;
    border-left: 2px solid #667eea;
    border-bottom: 2px solid #667eea;
    background: #fff;
    border-radius: 4px;
}

.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
}

.grid-line {
    height: 1px;
    background: #e8edff;
    width: 100%;
    opacity: 0.6;
}

.trend-line-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.trend-svg {
    width: 100%;
    height: 100%;
}

.trend-line {
    stroke-dasharray: 0;
    transition: all 0.3s ease;
}

.trend-line:hover {
    stroke-width: 4;
}

.x-axis {
    display: flex;
    justify-content: space-between;
    padding-left: 57px;
    margin-top: 15px;
    border-top: 1px solid #e8edff;
    padding-top: 12px;
    padding-bottom: 8px;
}

.x-label {
    font-size: 13px;
    color: #666;
    text-align: center;
    flex: 1;
    font-weight: 500;
    padding: 4px 2px;
}




/* 作品排行榜 */
.works-ranking {
    margin-top: 30px;
}

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

/* 移除排行榜图标样式 */

.ranking-table {
    background: white;
    border: 1px solid #e8edff;
    border-radius: 8px;
    overflow: hidden;
}

.ranking-header {
    background: #f8f9ff;
    display: grid;
    grid-template-columns: 70px 1fr 120px 100px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #e8edff;
}

.ranking-body {
    min-height: 200px;
}

.ranking-row {
    display: grid;
    grid-template-columns: 70px 1fr 120px 100px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    transition: background 0.2s ease;
}

.ranking-row:hover {
    background: #fafafa;
}

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

.rank-col {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.rank-number:nth-child(1) {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.ranking-row:nth-child(1) .rank-number {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.ranking-row:nth-child(2) .rank-number {
    background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}

.ranking-row:nth-child(3) .rank-number {
    background: linear-gradient(135deg, #cd7f32 0%, #b8860b 100%);
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

.work-col {
    font-size: 14px;
    color: #333;
}

.reads-col {
    font-size: 14px;
    color: #666;
    text-align: center;
}

.trend-col {
    font-size: 12px;
    text-align: center;
}

.trend-up {
    color: #52c41a;
}

.trend-down {
    color: #ff4d4f;
}

.trend-same {
    color: #999;
}


.empty-ranking {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

/* 移除空状态图标样式 */

.empty-ranking p {
    font-size: 14px;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .data-stats-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    
    .ranking-header,
    .ranking-row {
        grid-template-columns: 50px 1fr 90px 80px;
        font-size: 12px;
    }
    
    .rank-number {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    
    .data-stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
}

/* 收益分析内容样式 */
.income-analytics-content {
    padding: 0;
}

.income-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.income-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border: 1px solid #e8edff;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.income-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.income-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    margin-top: -4px;
    margin-right: -8px;
}

.income-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 0;
}

.income-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.income-trend {
    font-size: 12px;
    color: #999;
}

.income-trend.positive {
    color: #52c41a;
}

.income-trend.negative {
    color: #ff4d4f;
}

.income-trend.error {
    color: #ff4d4f;
}

.income-desc {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    font-style: italic;
}

.settlement-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-top: -2px;
    margin-right: 4px;
    font-weight: 500;
    flex-shrink: 0;
}

.settlement-status.pending {
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
}

.settlement-status.settled {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

/* Tooltip 样式 */
.settlement-status[data-tooltip] {
    position: relative;
    cursor: help;
}

.settlement-status[data-tooltip]:hover::before,
.settlement-status[data-tooltip]:hover::after {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.settlement-status[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    right: 0;
    transform: translateY(-8px);
    background: #fff;
    color: #999;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.4;
    width: 280px;
    white-space: normal;
    word-wrap: break-word;
    text-align: justify;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid #f0f0f0;
    font-weight: normal;
    text-align: left;
}

.settlement-status[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 20px;
    transform: translateY(-3px);
    border: 6px solid transparent;
    border-top-color: #fff;
    z-index: 1001;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

/* 状态徽章样式 */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    min-width: 60px;
}

.status-pending_generation {
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.status-pending {
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
}

/* 状态文本样式（无背景框架） */
.status-text {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.status-text.status-pending_generation {
    color: #22c55e !important; /* 绿色字体 */
    background: none !important; /* 移除背景 */
    border: none !important; /* 移除边框 */
    padding: 0 !important; /* 移除内边距 */
}

.status-text.status-pending {
    color: #f59e0b !important; /* 橙色字体 */
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

.status-text.status-settled {
    color: #3b82f6 !important; /* 蓝色字体 */
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

.status-text.status-processing {
    color: #8b5cf6 !important; /* 紫色字体 */
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

.status-text.status-rejected {
    color: #ef4444 !important; /* 红色字体 */
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

.status-processing {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.status-settled {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-rejected {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.status-cancelled {
    background: #f5f5f5;
    color: #8c8c8c;
    border: 1px solid #d9d9d9;
}

/* 金额单元格样式 */
.amount-cell {
    font-weight: 400 !important;
    color: #22c55e !important;
    font-size: 14px !important;
}

.settlement-records .amount-cell {
    font-weight: 400 !important;
    color: #22c55e !important;
    font-size: 14px !important;
}

.settlement-records tbody .amount-cell {
    font-weight: 400 !important;
    color: #22c55e !important;
    font-size: 14px !important;
}

/* 结算时间单元格样式 */
.settlement-date-cell {
    font-weight: 400;
    color: #333;
    font-size: 14px;
}

/* 结算方式单元格样式 */
.settlement-method-cell {
    font-weight: 400;
    color: #666;
    font-size: 13px;
    font-family: inherit;
}

/* 钱包卡片特殊样式 */
.wallet-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border: 2px solid #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    position: relative;
    overflow: hidden;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #ffd700 100%);
}

.wallet-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.25);
    border-color: #5a6fd8;
}

.wallet-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    margin-top: 8px;
}

.wallet-header i {
    font-size: 18px;
    color: #ffd700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wallet-card .income-title {
    color: #333;
    font-weight: 600;
    margin: 0;
}

.wallet-balance {
    font-size: 28px;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 16px;
}

.wallet-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.wallet-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.withdraw-btn {
    background: #667eea;
    color: white;
    border: 1px solid #667eea;
}

.withdraw-btn:hover {
    background: #5a6fd8;
    border-color: #5a6fd8;
    transform: translateY(-1px);
}

.history-btn {
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
}

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

/* 数据更新时间样式 */
.header-title-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.data-update-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.update-frequency {
    font-size: 12px;
    color: #28a745;
    font-weight: 500;
}

.last-update {
    font-size: 11px;
    color: #6c757d;
}

#last-update-time,
#income-last-update-time {
    font-weight: 500;
    color: #495057;
}
