/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.25rem;
    text-align: left;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.5rem 0.5rem 0 0 !important;
    padding: 1rem 1.25rem;
}

.card-title {
    color: #495057;
    font-weight: 600;
}

/* 按钮样式 */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* 表单样式 */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 文本域样式 */
#inputText {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
    background-color: #ffe6e6;
}

/* 结果展示区域 */
#parseResults {
    max-height: 500px;
    overflow-y: auto;
}

/* 表格样式优化 */
.table-responsive {
    border-radius: 0.375rem;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.table thead th {
    background-color: #0d6efd;
    color: white;
    border: none;
    font-weight: 600;
    padding: 0.75rem 0.5rem;
    text-align: center;
    vertical-align: middle;
}

.table tbody td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
    border-color: #dee2e6;
}

/* 确保daily-reports页面的表格样式优先级更高 */
#daily-reports .table tbody td {
    padding: 14px 12px !important;
    height: 50px !important;
    box-sizing: border-box;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

.table tbody tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

/* 徽章样式 */
.badge {
    font-size: 0.75em;
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.bg-success {
    background-color: #198754 !important;
}

.bg-info {
    background-color: #0dcaf0 !important;
}

.bg-secondary {
    background-color: #6c757d !important;
}

/* 警告信息样式 */
.alert-warning {
    position: relative;
    border-left: 4px solid #ffc107;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-warning .warning-details {
    font-size: 0.9rem;
}

.alert-warning ul {
    padding-left: 1.2rem;
}

.alert-warning li {
    margin-bottom: 0.3rem;
    color: #856404;
}

.alert-warning .btn-close {
    background-size: 0.8rem;
}

/* Toast 通知样式 */
.toast {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.toast-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* 加载动画 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
        text-align: left;
    }
}

@media (max-width: 576px) {
    .col-lg-6 {
        margin-bottom: 1rem;
    }
    
    .d-grid.gap-2 {
        gap: 0.5rem !important;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

/* 徽章样式 */
.badge {
    font-size: 0.75em;
    font-weight: 500;
}

/* 保存警告样式 */
.save-warnings {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 2px solid #dc3545;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(220, 53, 69, 0.3);
    z-index: 1050;
    max-width: 500px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
}

.warning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.save-warnings .warning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.save-warnings .warning-title {
    color: #dc3545;
    font-weight: bold;
    font-size: 1.1em;
    margin: 0;
}

.save-warnings .close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-warnings .close-btn:hover {
    color: #dc3545;
}

.save-warnings .warning-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.save-warnings .warning-item {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
    font-size: 0.9em;
}

/* 统计概览卡片样式 */
.stats-overview-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: none;
    height: 160px;
    display: flex;
    align-items: center;
}

.stats-overview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.stats-overview-card.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stats-overview-card.bg-gradient-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

.stats-overview-card.bg-gradient-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stats-overview-card.bg-gradient-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stats-icon {
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
    right: 20px;
    top: 20px;
}

.stats-content {
    flex: 1;
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

.stats-label {
    font-size: 0.9rem;
    margin: 5px 0 10px 0;
    opacity: 0.9;
}

.stats-trend {
    margin-top: 10px;
}

.trend-indicator {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* 图表卡片样式 */
.chart-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.chart-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.chart-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 15px 15px 0 0;
    padding: 20px;
}

.chart-card .card-body {
    padding: 25px;
}

/* 排名卡片样式 */
.ranking-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.ranking-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.ranking-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 15px 15px 0 0;
    padding: 15px 20px;
}

/* 右侧排行榜区域高度对齐 */
.col-lg-4 {
    display: flex;
    flex-direction: column;
}

.ranking-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ranking-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ranking-list {
    flex: 1;
    overflow-y: auto;
    max-height: none;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.2s ease;
}

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

.ranking-item:hover {
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 0 -10px;
    padding: 12px 10px;
}

.ranking-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 15px;
}

.ranking-number.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #b45309;
}

.ranking-number.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #e5e7eb);
    color: #374151;
}

.ranking-number.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #d97706);
    color: white;
}

.ranking-number.rank-other {
    background: #f3f4f6;
    color: #6b7280;
}

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    font-size: 0.95rem;
}

.ranking-count {
    color: #6b7280;
    font-size: 0.85rem;
    margin: 2px 0 0 0;
}

.ranking-percentage {
    font-weight: 600;
    color: #059669;
    font-size: 0.9rem;
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .stats-overview-card {
        height: 140px;
        padding: 20px;
    }
    
    .stats-number {
        font-size: 2rem;
    }
    
    .stats-icon {
        font-size: 2.5rem;
    }
    
    .chart-card .card-body {
        padding: 15px;
    }
    
    .ranking-card .card-body {
        padding: 15px;
    }
}

/* 按钮组样式优化 */
.btn-group .btn-outline-primary {
    border-color: #6c757d;
    color: #6c757d;
}

.btn-group .btn-outline-primary:hover,
.btn-group .btn-outline-primary.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 0;
    color: #6c757d;
    font-weight: 500;
    padding: 12px 20px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #007bff;
    background-color: #f8f9fa;
}

.nav-tabs .nav-link.active {
    color: #007bff;
    background-color: transparent;
    border-color: transparent;
    font-weight: 600;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #007bff;
    border-radius: 2px 2px 0 0;
}

.nav-tabs .nav-link i {
    margin-right: 8px;
}

/* 标签页内容样式 */
.tab-content {
    background-color: #fff;
    border-radius: 0 0 0.5rem 0.5rem;
    min-height: 500px;
}

.tab-pane {
    padding: 0;
}

/* 统计页面专用样式 */
.stats-overview-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.stats-overview-card .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.stats-overview-card .card-title {
    color: white;
}

.stats-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.stats-section h6 {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* 统计面板样式 */
.stats-container {
    max-height: 400px;
    overflow-y: auto;
}

.stat-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stat-item-header {
    font-weight: bold;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.stat-numbers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
}

.stat-number {
    text-align: center;
    flex: 1;
}

.stat-number .label {
    color: #6c757d;
    font-size: 0.8em;
    display: block;
    margin-bottom: 2px;
}

.stat-number .value {
    font-weight: bold;
    color: #495057;
    font-size: 1.1em;
}

.stat-number.today .value {
    color: #28a745;
}

.stat-number.week .value {
    color: #007bff;
}

.stat-number.month .value {
    color: #6f42c1;
}

.stats-loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.stats-empty {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

/* 统计面板响应式设计 */
@media (max-width: 1200px) {
    .stats-container {
        max-height: 350px;
    }
    
    .stat-item {
        padding: 10px;
    }
    
    .stat-numbers {
        font-size: 0.8em;
    }
}

@media (max-width: 768px) {
    .nav-tabs .nav-link {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    
    .stats-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .stat-numbers {
        flex-direction: column;
        gap: 8px;
    }
    
    .stat-number {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .stat-number .label {
        margin-bottom: 0;
    }
}