/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 导入Poppins字体 */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f8fafc;
    line-height: 1.6;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

/* 添加网格背景效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    animation: gridMove 25s linear infinite;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 头部样式 */
.header {
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 0 40px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.8s ease;
}

.header:hover::before {
    left: 100%;
}

.header:hover {
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.3),
        0 0 50px rgba(99, 102, 241, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* 语言切换按钮样式 */
.language-switch {
    display: flex;
    gap: 8px;
    background: rgba(41, 51, 71, 0.8);
    padding: 6px;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.lang-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: #94a3b8;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.lang-btn:hover {
    color: #f8fafc;
    background: rgba(99, 102, 241, 0.1);
}

.lang-btn.active {
    color: white;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 15px;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    letter-spacing: 1.5px;
    background: linear-gradient(90deg, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title i {
    font-size: 2.8rem;
    color: #10b981;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    animation: pulse 2s ease-in-out infinite;
    background: linear-gradient(135deg, #10b981, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 按钮样式 */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 30px rgba(99, 102, 241, 0.4),
        0 0 25px rgba(99, 102, 241, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 
        0 4px 15px rgba(99, 102, 241, 0.3),
        0 0 15px rgba(99, 102, 241, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    box-shadow: 
        0 10px 30px rgba(99, 102, 241, 0.4),
        0 0 25px rgba(99, 102, 241, 0.2);
}

/* 章节样式 */
.section {
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 0 40px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #10b981);
    border-radius: 16px 16px 0 0;
}

.section:hover {
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.3),
        0 0 50px rgba(99, 102, 241, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(-3px);
}

.section-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #10b981);
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    background: linear-gradient(90deg, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header i {
    font-size: 2rem;
    color: #10b981;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    animation: pulse 2s ease-in-out infinite;
    background: linear-gradient(135deg, #10b981, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Log上传区域样式 */
.log-upload-container {
    background: rgba(36, 46, 66, 0.9);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.log-upload-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.05), transparent);
    transition: left 0.8s ease;
}

.log-upload-container:hover::before {
    left: 100%;
}

.log-upload-container:hover {
    box-shadow: 
        0 10px 35px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.log-upload-section h3 {
    color: #f8fafc;
    margin-bottom: 25px;
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(90deg, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.file-upload-area {
    position: relative;
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 70px 25px;
    text-align: center;
    transition: all 0.3s ease;
    background: rgba(41, 51, 71, 0.8);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.file-upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.05), transparent);
    transition: left 0.6s ease;
}

.file-upload-area:hover::before {
    left: 100%;
}

.file-upload-area:hover {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(46, 56, 76, 0.9);
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.file-upload-area.drag-active {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.3);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    color: #94a3b8;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.file-label i {
    font-size: 4rem;
    color: #6366f1;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.file-upload-area:hover .file-label i {
    color: #10b981;
    transform: scale(1.15);
    background: linear-gradient(135deg, #10b981, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.file-upload-area:hover .file-label span {
    color: #f8fafc;
    font-weight: 500;
}

/* 分析结果样式 */
.analysis-summary {
    margin-bottom: 40px;
}

.summary-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    background: rgba(36, 46, 66, 0.9);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.05), transparent);
    transition: left 0.8s ease;
}

.summary-card:hover::before {
    left: 100%;
}

.summary-card:hover {
    box-shadow: 
        0 10px 35px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.summary-item {
    text-align: center;
    position: relative;
    padding: 16px;
    border-radius: 12px;
    background: rgba(41, 51, 71, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 120px;
}

.summary-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #10b981);
    border-radius: 12px 12px 0 0;
}

.summary-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    background: rgba(46, 56, 76, 0.9);
    border-color: rgba(99, 102, 241, 0.3);
}

.summary-label {
    display: block;
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: #f8fafc;
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    background: linear-gradient(90deg, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 图表样式 */
.chart-container {
    background: rgba(36, 46, 66, 0.9);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 
        0 6px 25px rgba(0, 0, 0, 0.2),
        0 0 40px rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
    height: 450px;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #10b981);
    border-radius: 16px 16px 0 0;
}

.chart-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.05), transparent);
    transition: left 0.8s ease;
}

.chart-container:hover::after {
    left: 100%;
}

.chart-container:hover {
    box-shadow: 
        0 10px 35px rgba(0, 0, 0, 0.3),
        0 0 50px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-3px);
}

/* 加载指示器 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.loading.hidden {
    display: none;
}

.loading-spinner {
    width: 70px;
    height: 70px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top: 4px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
    margin-bottom: 25px;
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.4);
}

.loading-text {
    font-size: 1.3rem;
    color: #f8fafc;
    font-weight: 600;
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
    animation: pulse 2s ease-in-out infinite;
    background: linear-gradient(90deg, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 错误提示 */
.error-message {
    position: fixed;
    top: 30px;
    right: 30px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 18px 24px;
    border-radius: 12px;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(239, 68, 68, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1500;
    animation: slideInRight 0.3s ease;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.1rem;
}

.error-message.hidden {
    display: none;
}

.error-message i {
    font-size: 1.4rem;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* 战斗回放样式 */
.combat-replay {
    background: rgba(36, 46, 66, 0.9);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 
        0 6px 25px rgba(0, 0, 0, 0.2),
        0 0 40px rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
    margin-top: 30px;
    position: relative;
    overflow: hidden;
}

.combat-replay::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.05), transparent);
    transition: left 0.8s ease;
}

.combat-replay:hover::before {
    left: 100%;
}

.combat-replay:hover {
    box-shadow: 
        0 10px 35px rgba(0, 0, 0, 0.3),
        0 0 50px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.combat-events {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 15px;
}

.combat-event {
    background: rgba(41, 51, 71, 0.8);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid;
    transition: all 0.3s ease;
    border: 1px solid rgba(99, 102, 241, 0.15);
    position: relative;
    overflow: hidden;
}

.combat-event::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 12px 0 0 12px;
}

.combat-event.damage::before {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.combat-event.repair::before {
    background: linear-gradient(180deg, #10b981, #059669);
}

.combat-event.received_repair::before {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
}

.combat-event:hover {
    transform: translateX(8px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    background: rgba(46, 56, 76, 0.9);
    border-color: rgba(99, 102, 241, 0.3);
}

.event-timestamp {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 8px;
    font-weight: 500;
}

.event-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.event-type {
    font-weight: 600;
    color: #f8fafc;
    font-size: 1.1rem;
}

.event-value {
    font-weight: 800;
    font-size: 1.3rem;
}

.event-value.damage {
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.event-value.repair {
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.event-value.received_repair {
    color: #3b82f6;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.event-target {
    font-size: 1rem;
    color: #94a3b8;
    margin-top: 8px;
    font-weight: 500;
}

/* 滚动条样式 */
.combat-events::-webkit-scrollbar {
    width: 10px;
    border-radius: 5px;
}

.combat-events::-webkit-scrollbar-track {
    background: rgba(41, 51, 71, 0.5);
    border-radius: 5px;
}

.combat-events::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 5px;
    border: 2px solid rgba(41, 51, 71, 0.8);
    transition: all 0.3s ease;
}

.combat-events::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.8);
    transform: scaleX(1.1);
}

/* 页脚样式 */
.footer {
    position: fixed;
    bottom: 0;
    right: 0;
    padding: 15px 20px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px 0 0 0;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    border-left: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: -2px -2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.footer-content {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        padding-bottom: 80px; /* 为页脚留出空间 */
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .title i {
        font-size: 1.6rem;
    }
    
    .section {
        padding: 15px;
    }
    
    .file-upload-area {
        padding: 40px 15px;
    }
    
    .file-label i {
        font-size: 2.5rem;
    }
    
    .file-label span {
        font-size: 1rem;
    }
    
    .summary-card {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .combat-events {
        max-height: 250px;
    }
    
    .footer {
        padding: 10px 15px;
        font-size: 0.8rem;
    }
}