/* 全局样式 */ 
body {
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 98%;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

h1 {
    color: #1F4E79;
    text-align: center;
    margin-bottom: 30px;
    font-size: 32px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, .1);
}

h2 {
    color: #2E5984;
    border-bottom: 3px solid #1F4E79;
    padding-bottom: 10px;
    margin-top: 30px;
    font-weight: bold;
}

/* 紧凑表格：13px 字号 + 较小内边距 */
table, .dataTables_wrapper, .table {
    font-size: 13px;
}

table.dataTable tbody td, table.dataTable thead th {
    padding: 6px 8px !important;
    line-height: 1.2;
}

/* 数据概览区域 */
.summary {
    background: linear-gradient(135deg, #E8F4F8 0%, #D1E7F5 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 5px solid #1F4E79;
}

.summary-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* 大屏幕：显示5个卡片 */
@media (min-width: 1400px) {
    .summary-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 中大屏幕：显示4个卡片 */
@media (min-width: 1200px) and (max-width: 1399px) {
    .summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 中等屏幕：显示3个卡片 */
@media (min-width: 900px) and (max-width: 1199px) {
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 小屏幕：显示2个卡片 */
@media (min-width: 600px) and (max-width: 899px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 超小屏幕：显示1个卡片 */
@media (max-width: 599px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

.summary-item {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
    min-width: 0; /* 防止内容撑爆 */
    overflow: hidden; /* 防止内容溢出 */
    word-wrap: break-word; /* 长文本换行 */
}

.summary-item i {
    font-size: 2em;
    color: #1F4E79;
    margin-bottom: 10px;
}

.summary-item h3 {
    color: #2E5984;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.summary-item p { 
    font-weight: bold;
    color: #1F4E79;
    margin: 0;
}

/* 表格容器 */
.table-container {
    margin: 30px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .1);
}

/* 响应式表格包装器 */
.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* margin: 0 -20px; */
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.dataTables_wrapper {
    padding: 20px;
    background: #fff;
    width: 100% !important;
    box-sizing: border-box;
}

/* DataTables 表格响应式样式 */
table.dataTable {
    width: 100% !important;
    table-layout: auto;
    border-collapse: collapse;
}

/* 确保表格在缩放时保持100%宽度 */
.dataTables_scrollHead,
.dataTables_scrollBody,
.dataTables_scrollFoot {
    width: 100% !important;
}

.dataTables_scrollHeadInner,
.dataTables_scrollBodyInner,
.dataTables_scrollFootInner {
    width: 100% !important;
}

.dataTables_scrollHeadInner table,
.dataTables_scrollBodyInner table,
.dataTables_scrollFootInner table {
    width: 100% !important;
}

table.dataTable thead th {
    background: #1F4E79 !important;
    color: #fff !important;
    font-weight: bold !important;
    border-bottom: 2px solid #2E5984 !important;
}

table.dataTable tbody tr:hover {
    background: #f8f9fa !important;
}

/* 单元格样式 */
.positive {
    background: #FCE5E9 !important;
    color: #d32f2f !important;
    font-weight: bold;
}

.negative {
    background: #E0FAE0 !important;
    color: #388e3c !important;
    font-weight: bold;
}

.neutral {
    background: #F0F0F0 !important;
}

.amount-cell {
    background: #FFFFF5 !important;
    font-weight: bold;
}

.price-cell {
    background: #D7EFFF !important;
    font-weight: bold;
}

.category-cell {
    background: #F0F0F0 !important;
    font-weight: bold;
}

/* 图表区域：响应式布局，最多显示3个 */
.echarts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    margin: 20px 0;
}

/* 限制最多显示3个图表 */
@media (min-width: 1200px) {
    .echarts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .echarts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .echarts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 15px 0;
    }
}

/* 确保图表网格在浏览器缩放时正确调整 */
@media screen and (min-width: 1px) {
    .echarts-grid {
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .echarts-grid .echart-box {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex-shrink: 1;
    }
}

.echart-box {
    text-align: center;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

/* 确保图表容器在窗口缩放时保持正确的尺寸 */
.echart-box::before {
    content: '';
    display: block;
    width: 100%;
    height: 0;
    padding-bottom: 0; /* 移除固定宽高比，让图表自由调整 */
}

/* 响应式图表容器调整 */
@media (max-width: 768px) {
    .echart-box {
        padding: 10px;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .echart-box {
        padding: 8px;
        margin-bottom: 10px;
    }
}

.echart-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #2E5984;
    border-bottom: 2px solid #1F4E79;
    padding-bottom: 8px;
}

.chart-area {
    margin: 0 auto;
    width: 100% !important;
    height: 400px;
    min-height: 350px;
    max-width: 100% !important;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* 确保图表在不同屏幕尺寸下都能正确显示 */
@media (max-width: 1200px) {
    .chart-area {
        height: 350px;
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .chart-area {
        height: 300px;
        min-height: 250px;
    }
}

@media (max-width: 480px) {
    .chart-area {
        height: 250px;
        min-height: 200px;
    }
}

/* 时间戳 */
.timestamp {
    text-align: center;
    color: #666;
    font-size: 12px;
    margin-top: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 导出按钮 */
.export-buttons {
    margin: 20px 0;
    text-align: right;
}

.export-buttons button {
    margin-left: 10px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
}

.loading i {
    font-size: 2em;
    color: #1F4E79;
    animation: spin 1s linear infinite;
}

.loading p {
    margin: 10px 0 0 0;
    color: #666;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 页面切换动画 */
.page-transition {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
}

.page-leave {
    opacity: 1;
    transform: translateY(0);
}

.page-leave-active {
    opacity: 0;
    transform: translateY(-20px);
}

/* 文件列表样式 */
.file-list-container {
    margin: 30px 0;
    animation: fadeInUp 0.5s ease-out;
}

/* 文件分组样式 */
.file-section {
    margin-bottom: 40px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 5px solid #1F4E79;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.5s ease-out;
}

.file-section h3 {
    color: #1F4E79;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: bold;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #1F4E79;
    padding-bottom: 10px;
}

.file-section h3 i {
    margin-right: 10px;
    color: #2E5984;
}

.file-section .file-list-container {
    margin: 20px 0 0 0;
    background: transparent;
}

/* 无数据状态样式 */
.no-data {
    text-align: center;
    padding: 60px 40px;
    background: #f8f9fa;
    border-radius: 12px;
    color: #6c757d;
    border: 2px dashed #dee2e6;
    margin: 30px 0;
}

.no-data i {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
    color: #adb5bd;
}

.no-data span {
    font-size: 1.2em;
    font-weight: 500;
}

/* 标签导航样式 */
.tab-navigation {
    display: flex;
    justify-content: center;
    margin: 30px 0 20px 0;
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    padding: 0;
    overflow: hidden;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: #f8f9fa;
    border: none;
    color: #6c757d;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-right: 1px solid #e9ecef;
    position: relative;
}

.tab-button:last-child {
    border-right: none;
}

.tab-button:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-2px);
}

.tab-button.active {
    background: #1F4E79;
    color: white;
    box-shadow: 0 4px 8px rgba(31, 78, 121, 0.3);
    transform: translateY(-2px);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #1F4E79;
}

.tab-button i {
    font-size: 1.2em;
}

.tab-count {
    background:rgb(184 196 224);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.9em;
    margin-left: 5px;
}

.tab-button.active .tab-count { 
    background:rgb(248 104 104)
}

/* 标签内容区域 */
.tab-content {
    min-height: 400px;
    animation: fadeInUp 0.4s ease-out;
}

.tab-pane {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.tab-pane.active {
    animation: slideInFromBottom 0.4s ease-out;
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式标签导航 */
@media (max-width: 768px) {
    .tab-navigation { 
        margin: 20px 0 15px 0;
    }
    
    .tab-button {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding: 12px 15px;
        font-size: 1em;
    }
    
    .tab-button:last-child {
        border-bottom: none;
    }
    
    .tab-button.active::after {
        display: none;
    }
    
    .tab-content {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .tab-button {
        padding: 10px 12px;
        font-size: 0.9em;
        gap: 6px;
    }
    
    .tab-button i {
        font-size: 1em;
    }
    
    .tab-count {
        font-size: 0.8em;
        padding: 1px 6px;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 报告详情页面动画 */
.report-detail {
    animation: slideInRight 0.4s ease-out;
}

/* 顶部标题和按钮区域 */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between; 
    padding: 15px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.header-left {
    flex: 0 0 auto;
}
 
.header-right {
    flex: 0 0 auto;
}

.main-title {
    color: #1F4E79;
    font-size: 1.8em;
    font-weight: bold;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.main-title i {
    color: #2E5984;
}

.report-type-btn {
    background: #1F4E79;
    color: white;
    border: 2px solid #1F4E79;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.report-type-btn:hover {
    background: white;
    color: #1F4E79;
    border-color: #1F4E79;
}

/* 起止时间区域 */
.time-range-section {
    text-align: center;
    margin-bottom: 16px; 
    background: #f8f9fa;
    font-size: 0.9rem;
    padding: 5px;
}

.time-range-label {
    color: #a0a0a0; 
    font-weight: 500;
}

/* 报表标题样式 */
.report-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 5px solid #1F4E79;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.report-title {
    color: #1F4E79;
    font-size: 2.2em;
    font-weight: bold;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.report-title i {
    font-size: 1.1em;
    color: #2E5984;
}

.time-period {
    color: #6c757d;
    font-size: 1.1em;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    display: inline-flex;
}

.time-period i {
    color: #1F4E79;
    font-size: 0.9em;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.file-item {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-item:hover {
    border-color: #1F4E79;
    box-shadow: 0 4px 16px rgba(31, 78, 121, 0.2);
    transform: translateY(-2px);
}

.file-link {
    display: block;
    text-decoration: none;
    color: #333;
    transition: color 0.3s ease;
}

.file-link:hover {
    color: #1F4E79;
}

.file-link i {
    font-size: 2.5em;
    color: #1F4E79;
    margin-bottom: 15px;
    display: block;
}

.file-name {
    display: block;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 8px;
    color: #2E5984;
}

.file-date {
    display: block;
    font-size: 0.9em;
    color: #666;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 8px;
}

/* 返回按钮样式 */ 
.back-button .btn {
    background: #6c757d;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    transition: background 0.3s ease;   margin: 0;
}

.back-button .btn:hover {
    background: #5a6268;
    color: white;
}

.back-button .btn i {
    margin-right: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    /* 顶部区域响应式 */
    .top-header { 
        text-align: center;
        gap: 10px;
        padding: 10px 0;
    }
    
    .header-left,  .header-right {
        flex: none; 
    }
    
    .main-title {
        font-size: 1.5em;
        margin: 10px 0;
    }
    
    .report-type-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
      
    .time-range-label {
        font-size: 1em;
    }
    
    .report-header {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .report-title {
        font-size: 1.8em;
        gap: 10px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
.echart-box {
    text-align: center;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
    
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .file-item {
        padding: 15px;
    }
    
    .file-link i {
        font-size: 2em;
    }
    
    .file-name {
        font-size: 1em;
    }
    
    /* 响应式表格样式 */
    .table-responsive-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        background: #fff;
    }
    
    .dataTables_wrapper {
        min-width: 600px; /* 移动端最小宽度 */
        padding: 15px;
    }
    
    /* 移动端表格字体调整 */
    table.dataTable, .dataTables_wrapper {
        font-size: 12px;
    }
    
    table.dataTable thead th, table.dataTable tbody td {
        padding: 4px 6px !important;
        font-size: 12px;
    }
    
    /* 移动端分页控件调整 */
    .dataTables_paginate {
        margin-top: 10px;
    }
    
    .dataTables_length, .dataTables_filter {
        margin-bottom: 10px;
    }
    
    .dataTables_length select, .dataTables_filter input {
        font-size: 12px;
        padding: 2px 4px;
    }
    
    /* 移动端表脚搜索框调整 */
    table.dataTable tfoot th input {
        font-size: 11px;
        padding: 2px 4px;
        width: 100%;
    }
    
    table.dataTable tfoot th select {
        font-size: 11px;
        padding: 2px 4px;
        width: 100%;
    }
}

/* 针对更小屏幕的优化 */
@media (max-width: 480px) {
    .table-responsive-wrapper {
        margin: 0 -10px;
        padding: 0 10px;
    }
    
    .dataTables_wrapper {
        min-width: 500px;
        padding: 10px;
    }
    
    table.dataTable, .dataTables_wrapper {
        font-size: 11px;
    }
    
    table.dataTable thead th, table.dataTable tbody td {
        padding: 3px 4px !important;
        font-size: 11px;
    }
    
    /* 隐藏一些不重要的控件以节省空间 */
    .dataTables_length {
        display: none;
    }
    
    .dataTables_filter {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .dataTables_filter label {
        width: 100%;
    }
    
    .dataTables_filter input {
        width: 100%;
        box-sizing: border-box;
    }
}

/* 新增搜索控件样式 */
.number-search-container,
.percentage-search-container {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.number-search-container select,
.percentage-search-container select {
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 11px;
    background: #fff;
    min-width: 60px;
}

.number-search-container input {
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 11px;
    width: 80px;
    box-sizing: border-box;
}

/* 表格底部搜索区域样式 */
table.dataTable tfoot th {
    padding: 4px !important;
    background: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
}

table.dataTable tfoot th input,
table.dataTable tfoot th select {
    font-size: 11px;
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    width: 100%;
    box-sizing: border-box;
}

/* 表格头部搜索行样式 */
table.dataTable thead .search-row th {
    padding: 8px 4px !important;
    background: #e3f2fd !important;
    border: 1px solid #bbdefb !important;
    border-top: 2px solid #2196f3 !important;
}

table.dataTable thead .search-row {
    background: #e3f2fd !important;
}

/* 搜索行控件样式 */
table.dataTable thead .search-row .number-search-container,
table.dataTable thead .search-row .percentage-search-container {
    margin: 0;
    min-height: 32px;
    display: flex;
    align-items: center;
    gap: 4px;
}

table.dataTable thead .search-row .number-operator,
table.dataTable thead .search-row .percentage-filter {
    font-size: 11px;
    padding: 3px 6px;
    border: 1px solid #2196f3;
    border-radius: 4px;
    background: #fff;
    color: #1976d2;
    min-width: 70px;
    height: 28px;
    box-sizing: border-box;
}

table.dataTable thead .search-row .number-value {
    font-size: 11px;
    padding: 3px 6px;
    border: 1px solid #2196f3;
    border-radius: 4px;
    width: 90px;
    background: #fff;
    color: #333;
    height: 28px;
    box-sizing: border-box;
}

table.dataTable thead .search-row input[type="text"].search-input {
    font-size: 11px;
    padding: 3px 6px;
    border: 1px solid #2196f3;
    border-radius: 4px;
    width: 100%;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    height: 28px;
}

/* 搜索行悬停效果 */
table.dataTable thead .search-row th:hover {
    background: #bbdefb !important;
}

/* 搜索控件焦点效果 */
table.dataTable thead .search-row .number-operator:focus,
table.dataTable thead .search-row .percentage-filter:focus,
table.dataTable thead .search-row .number-value:focus,
table.dataTable thead .search-row input[type="text"]:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 3px rgba(33, 150, 243, 0.3);
}

/* 类目搜索控件样式 */
table.dataTable thead .search-row .category-search-container {
    margin: 0;
    min-height: 32px;
    display: flex;
    align-items: center;
}

table.dataTable thead .search-row .category-select {
    font-size: 11px;
    padding: 3px 6px;
    border: 1px solid #2196f3;
    border-radius: 4px;
    background: #fff;
    color: #1976d2;
    width: 100%;
    box-sizing: border-box;
    min-width: 80px;
    height: 28px;
}

/* 类目搜索控件焦点效果 */
table.dataTable thead .search-row .category-select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 3px rgba(33, 150, 243, 0.3);
}

/* 确保搜索控件容器占满整个单元格 */
table.dataTable thead .search-row .number-search-container,
table.dataTable thead .search-row .percentage-search-container,
table.dataTable thead .search-row .category-search-container {
    width: 100%;
}

/* 表格排序样式 */
table.dataTable thead th.sorting {
    cursor: pointer;
    position: relative;
    padding-right: 20px !important;
}

table.dataTable thead th.sorting:after {
    position: absolute;
    top: 50%;
    right: 8px;
    display: block;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    content: "\f0dc";
    color: #fff;
    opacity: 0.5;
    transform: translateY(-50%);
    font-size: 12px;
}

table.dataTable thead th.sorting_asc:after {
    content: "\f0de";
    opacity: 1;
    color: #fff;
}

table.dataTable thead th.sorting_desc:after {
    content: "\f0dd";
    opacity: 1;
    color: #fff;
}

table.dataTable thead th.sorting:hover:after,
table.dataTable thead th.sorting_asc:hover:after,
table.dataTable thead th.sorting_desc:hover:after {
    opacity: 1;
    color: #fff;
}

/* 排序图标悬停效果 */
table.dataTable thead th.sorting:hover {
    background: #2E5984 !important;
}

/* 确保排序图标在深色背景上可见 */
table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 响应式排序控件 */
@media (max-width: 768px) {
    table.dataTable thead th.sorting {
        padding-right: 15px !important;
    }
    
    table.dataTable thead th.sorting:after,
    table.dataDataTable thead th.sorting_asc:after,
    table.dataTable thead th.sorting_desc:after {
        right: 5px;
        font-size: 10px;
    }
}

/* 响应式搜索控件 */
@media (max-width: 768px) {
    .number-search-container,
    .percentage-search-container {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }
    
    .number-search-container select,
    .perceage-search-container select {
        width: 100%;
        min-width: auto;
    }
    
    .number-search-container input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .number-search-container,
    .percentage-search-container {
        gap: 1px;
    }
    
    .number-search-container select,
    .percentage-search-container select,
    .number-search-container input {
        font-size: 10px;
        padding: 1px 2px;
    }
}

/* 页面缩放响应式样式 */
@media screen and (min-width: 1px) {
    /* 确保在所有缩放级别下表格都能正确显示 */
    .table-responsive-wrapper {
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto;
        overflow-y: visible;
    }
    
    .dataTables_wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    table.dataTable {
        width: 100% !important;
        max-width: 100% !important;
        table-layout: auto;
        word-wrap: break-word;
        word-break: break-word;
    }
    
    /* 确保表格单元格内容不会溢出 */
    table.dataTable thead th,
    table.dataTable tbody td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
        box-sizing: border-box;
    }
    
    /* 在较大屏幕上允许更宽的单元格 */
    @media screen and (min-width: 1200px) {
        table.dataTable thead th,
        table.dataTable tbody td {
            max-width: 300px;
        }
    }
    
    /* 在中等屏幕上适中的单元格宽度 */
    @media screen and (min-width: 768px) and (max-width: 1199px) {
        table.dataTable thead th,
        table.dataTable tbody td {
            max-width: 250px;
        }
    }
    
    /* 在小屏幕上较窄的单元格 */
    @media screen and (max-width: 767px) {
        table.dataTable thead th,
        table.dataTable tbody td {
            max-width: 150px;
            font-size: 11px;
            padding: 4px 6px !important;
        }
    }
}

/* 浏览器缩放适配 */
@media screen and (-webkit-min-device-pixel-ratio: 0.5) {
    .dataTables_wrapper {
        zoom: 1;
        transform: scale(1);
        transform-origin: 0 0;
    }
}

/* 高DPI屏幕适配 */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
    table.dataTable thead th,
    table.dataTable tbody td {
        font-size: 13px;
        line-height: 1.3;
    }
}

/* 确保DataTables控件在缩放时正确显示 */
.dataTables_length,
.dataTables_filter,
.dataTables_info,
.dataTables_paginate {
    width: auto !important;
    display: block;
    margin: 5px 0;
}

.dataTables_length select,
.dataTables_filter input {
    width: auto !important;
    max-width: 200px;
    box-sizing: border-box;
}

/* 分页控件响应式 */
.dataTables_paginate {
    text-align: center;
    margin-top: 10px;
}

.dataTables_paginate .paginate_button {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    font-size: 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    cursor: pointer;
}

.dataTables_paginate .paginate_button:hover {
    background: #f5f5f5;
    border-color: #999;
}

.dataTables_paginate .paginate_button.current {
    background: #1F4E79;
    color: #fff;
    border-color: #1F4E79;
}

.dataTables_paginate .paginate_button.disabled {
    color: #999;
    cursor: not-allowed;
    background: #f9f9f9;
}

/* 确保在页面缩放时搜索控件正确显示 */
table.dataTable thead .search-row th {
    min-width: 80px;
    max-width: 200px;
    width: auto;
}

table.dataTable thead .search-row .number-search-container,
table.dataTable thead .search-row .percentage-search-container,
table.dataTable thead .search-row .category-search-container {
    min-width: 80px;
    max-width: 200px;
    width: 100%;
    box-sizing: border-box;
}

/* 合计行样式 */
table.dataTable tfoot {
    background: #f8f9fa;
    border-top: 3px solid #1F4E79;
}

table.dataTable tfoot .table-footer-row th {
    background: #e3f2fd !important;
    color: #1F4E79 !important;
    font-weight: bold !important;
    font-size: 14px !important;
    padding: 12px 8px !important;
    border: 1px solid #bbdefb !important;
    text-align: center;
    vertical-align: middle;
}

table.dataTable tfoot .table-footer-row th.summary-label {
    background: #1F4E79 !important;
    color: white !important;
    font-size: 15px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

table.dataTable tfoot .table-footer-row th.summary-amount {
    background: #e8f5e8 !important;
    color: #2e7d32 !important;
    font-size: 14px !important;
    font-weight: bold !important;
    text-align: center !important;
}

table.dataTable tfoot .table-footer-row th.summary-orders {
    background: #fff3e0 !important;
    color: #f57c00 !important;
    font-size: 14px !important;
    font-weight: bold !important;
    text-align: center !important;
}

/* 合并单元格的特殊样式 */
table.dataTable tfoot .table-footer-row th[colspan="2"] {
    text-align: center !important;
    position: relative;
    border-right: 1px solid #bbdefb !important;
}

table.dataTable tfoot .table-footer-row th[colspan="2"]::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #bbdefb;
}

table.dataTable tfoot .table-footer-row th.summary-price {
    background: #f3e5f5 !important;
    color: #7b1fa2 !important;
    font-size: 14px !important;
    font-weight: bold !important;
}

/* 合计行悬停效果 */
table.dataTable tfoot .table-footer-row th:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

/* 响应式合计行 */
@media (max-width: 768px) {
    table.dataTable tfoot .table-footer-row th {
        font-size: 12px !important;
        padding: 8px 4px !important;
    }
    
    table.dataTable tfoot .table-footer-row th.summary-label {
        font-size: 13px !important;
    }
    
    table.dataTable tfoot .table-footer-row th.summary-amount,
    table.dataTable tfoot .table-footer-row th.summary-orders,
    table.dataTable tfoot .table-footer-row th.summary-price {
        font-size: 12px !important;
    }
    
    /* 响应式下的合并单元格 */
    table.dataTable tfoot .table-footer-row th[colspan="2"] {
        font-size: 12px !important;
        padding: 8px 4px !important;
    }
}

@media (max-width: 480px) {
    table.dataTable tfoot .table-footer-row th {
        font-size: 11px !important;
        padding: 6px 3px !important;
    }
    
    table.dataTable tfoot .table-footer-row th.summary-label {
        font-size: 12px !important;
    }
    
    table.dataTable tfoot .table-footer-row th.summary-amount,
    table.dataTable tfoot .table-footer-row th.summary-orders,
    table.dataTable tfoot .table-footer-row th.summary-price {
        font-size: 11px !important;
    }
    
    /* 小屏幕下的合并单元格 */
    table.dataTable tfoot .table-footer-row th[colspan="2"] {
        font-size: 11px !important;
        padding: 6px 3px !important;
    }
}

/* 防止表格在极小缩放时完全不可见 */
@media screen and (max-width: 320px) {
    .table-responsive-wrapper {
        min-width: 320px;
        overflow-x: scroll;
    }
    
    .dataTables_wrapper {
        min-width: 320px;
    }
    
    table.dataTable {
        min-width: 320px;
        font-size: 10px;
    }
    
    table.dataTable thead th,
    table.dataTable tbody td {
        padding: 2px 4px !important;
        font-size: 10px;
        max-width: 80px;
    }
}

/* 文章页面样式 */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out;
}

.article-content {
    line-height: 1.8;
    color: #333;
}

.article-content h2 {
    color: #1F4E79;
    border-bottom: 2px solid #1F4E79;
    padding-bottom: 8px;
    margin-top: 30px;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.article-content h3 {
    color: #2E5984;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.article-content h4 {
    color: #2E5984;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.article-content p {
    margin-bottom: 15px;
    text-align: justify;
}

.article-content ul, .article-content ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

.article-content li {
    margin-bottom: 8px;
}

/* 技术栈展示 */
.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.tech-item {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid #1F4E79;
}

.tech-item h3 {
    color: #1F4E79;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.tech-item ul {
    margin-bottom: 0;
}

.tech-item li {
    margin-bottom: 8px;
    color: #555;
}

/* 联系信息 */
.contact-info {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.contact-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.contact-info i {
    margin-right: 10px;
    color: #1F4E79;
    width: 20px;
}

/* 许可证部分 */
.license-section {
    margin: 25px 0;
}

.license-section h3 {
    color: #2E5984;
    margin-top: 20px;
    margin-bottom: 15px;
}

.license-section ul {
    background: #f8f9fa;
    padding: 20px 20px 20px 50px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.license-section ul:last-child {
    border-left-color: #dc3545;
}

/* 第三方许可证 */
.third-party-licenses {
    margin: 25px 0;
}

.license-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 4px solid #6c757d;
}

.license-item h4 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #1F4E79;
}

.license-item p {
    margin-bottom: 0;
    font-size: 0.9em;
    color: #666;
}

/* 版权声明 */
.copyright-notice { 
    padding: 20px;  
    margin-top: 30px;
}

.copyright-notice p {
    margin: 0;
    font-weight: bold;
}

.copyright-notice i {
    margin-right: 8px;
}

/* 底部导航样式 */
.footer {
    margin-top: 50px;
    padding: 30px 0; 
    color: white; 
}

.footer-content {
    text-align: center;
}

.footer-links {
    margin-bottom: 15px;
}

.footer-link {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.footer-link i {
    margin-right: 5px;
}

.footer-separator {
    margin: 0 10px;
    color: rgba(255, 255, 255, 0.6);
}

.footer-copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 15px;
    margin-top: 15px;
}

.footer-copyright p {
    margin: 0;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
}

/* 响应式文章页面 */
@media (max-width: 768px) {
    .article-container {
        padding: 0 15px;
    }
    
    .tech-stack {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tech-item {
        padding: 20px;
    }
    
    .article-content h2 {
        font-size: 1.3em;
    }
    
    .article-content h3 {
        font-size: 1.2em;
    }
    
    .contact-info {
        padding: 15px;
    }
    
    .footer {
        margin-top: 30px;
        padding: 20px 0;
    }
    
    .footer-link {
        padding: 6px 12px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    /* 超小屏幕顶部区域 */
    .top-header {
        padding: 5px 0;
        gap: 8px;
    }
    
    .main-title {
        font-size: 1.3em;
        gap: 8px;
    }
    
    .report-type-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .time-range-section {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .time-range-label {
        font-size: 0.9em;
    }
    
    .report-header {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .report-title {
        font-size: 1.5em;
        gap: 8px;
    }
    
    .summary {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .summary-item {
        padding: 15px;
    }
    
    .summary-item i {
        font-size: 1.5em;
        margin-bottom: 8px;
    }
    
    .summary-item h3 {
        font-size: 1em;
        margin-bottom: 4px;
    }
    
    .summary-item p {
        font-size: 1.2em;
    }
    
    .article-content {
        font-size: 14px;
    }
    
    .article-content h2 {
        font-size: 1.2em;
    }
    
    .article-content h3 {
        font-size: 1.1em;
    }
    
    .tech-item {
        padding: 15px;
    }
    
    .contact-info {
        padding: 12px;
    }
    
    .contact-info p {
        font-size: 0.9em;
    }
    
    .footer-links {
        margin-bottom: 10px;
    }
    
    .footer-link {
        display: inline-block;
        margin: 5px 0;
        padding: 8px 15px;
    }
    
    .footer-separator {
        display: none;
    }
}

/* 二级类目占比图表样式 */
.category-distribution-section {
    margin: 30px 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.category-distribution-container {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.category-chart-area {
    width: 100%;
    height: 400px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

/* 二级类目占比图表响应式设计 */
@media (max-width: 768px) {
    .category-chart-area {
        height: 350px;
    }
    
    .category-distribution-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .category-chart-area {
        height: 300px;
    }
    
    .category-distribution-container {
        padding: 10px;
    }
}
