:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #7c3aed;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --border-light: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dark-mode {
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --border-light: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    position: relative;
    z-index: 0;
}

.main-header {
    background-color: var(--bg-secondary);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switch {
    display: flex;
    background-color: var(--bg-primary);
    border-radius: 9999px;
    padding: 0.25rem;
}

.lang-btn {
    padding: 0.25rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 9999px;
    transition: all 0.2s;
}

.lang-btn.active {
    background-color: var(--bg-secondary);
    color: var(--primary);
    box-shadow: var(--shadow);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.logout-icon {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
}

.logout-btn:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 64px);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
}

.auth-backdrop {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 0 auto;
    box-sizing: border-box;
}

.auth-card {
    background-color: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    width: 90%;
    max-width: 400px;
    margin: 0 auto;
    box-sizing: border-box;
    transform: translateX(0);
    overflow: hidden;
}

.auth-header {
    margin-bottom: 2rem;
    text-align: center;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.molecule-animation {
    font-size: 1.125rem;
    color: var(--primary);
    font-weight: 500;
    animation: pulse 2s infinite;
    will-change: opacity;
}

@keyframes pulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 0;
    font-size: 1rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-group input:focus {
    outline: none;
    border-bottom-color: var(--primary);
}

.form-group label {
    position: absolute;
    top: 0.5rem;
    left: 0;
    color: var(--text-secondary);
    pointer-events: none;
    transition: top 0.3s ease, font-size 0.3s ease, color 0.3s ease;
    z-index: 2;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
    top: -0.25rem;
    font-size: 0.75rem;
    color: var(--primary);
    background-color: var(--bg-secondary);
    padding: 0 0.25rem;
}

.form-actions {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.auth-submit-btn {
    padding: 1rem 1.5rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 0.25rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.auth-submit-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.auth-switch {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-switch-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    padding: 0 0.25rem;
}

.dashboard-container {
    display: none;
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.back-btn {
    position: fixed;
    top: 2rem;
    left: 2rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 10;
}

.back-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: var(--text-primary);
}

.dashboard-section {
    margin-bottom: 2rem;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.section-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.section-content {
    padding: 1.5rem;
}

.section-description {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.file-upload-area {
    margin-bottom: 1.5rem;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed var(--border-light);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-label:hover {
    border-color: var(--primary);
    background-color: rgba(37, 99, 235, 0.05);
}

.upload-icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    stroke: var(--primary);
}

.upload-text {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.research-input {
    position: relative;
    margin-bottom: 1.5rem;
}

.research-input textarea {
    width: 100%;
    min-height: 8rem;
    padding: 1rem;
    font-size: 1rem;
    background-color: var(--bg-primary);
    border: none;
    border-radius: 0.25rem;
    color: var(--text-primary);
    resize: vertical;
}

.research-input textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.research-input textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary);
}

.research-input label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.3s;
}

.research-input textarea:focus + label,
.research-input textarea:not(:placeholder-shown) + label {
    top: -0.5rem;
    left: 0.5rem;
    font-size: 0.75rem;
    background-color: var(--bg-secondary);
    padding: 0 0.25rem;
    color: var(--primary);
}

.analysis-btn {
    padding: 1rem 1.5rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 0.25rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.analysis-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
    }
    
    .auth-container {
        padding: 1rem;
        min-height: calc(100vh - 56px);
        margin: 0 auto;
    }
    
    .auth-backdrop {
        padding: 0.5rem;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .auth-card {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .form-group label {
        top: 0.25rem;
    }
    
    .form-group input:focus + label,
    .form-group input:not(:placeholder-shown) + label {
        top: -0.1rem;
    }
    
    .back-btn {
        top: 1rem;
        left: 1rem;
    }
    
    .dashboard-container {
        padding: 1rem;
    }
}

/* 电池型号选择器样式 */
.model-selection-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.model-selection {
    flex: 1;
    padding: 1rem;
    background-color: var(--bg-primary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
}

.selection-title {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}

.model-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.model-option {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.model-option:hover {
    border-color: var(--primary);
}

.model-option input[type="radio"] {
    margin-right: 0.5rem;
}

.model-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.model-icon {
    font-size: 1.25rem;
}

.model-info {
    display: flex;
    flex-direction: column;
}

.model-info strong {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.model-info small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.model-option input[type="radio"]:checked + .model-label {
    color: var(--primary);
}

/* 导入模型按钮样式 */
.import-model-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(37, 99, 235, 0.1);
    border: 2px solid var(--primary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 150px;
    height: fit-content;
}

.import-model-btn:hover {
    background-color: rgba(37, 99, 235, 0.2);
    border-color: var(--primary-dark);
}

.import-model-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.import-model-content .upload-icon {
    width: 2rem;
    height: 2rem;
    stroke: var(--primary);
}

.import-model-content span {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.875rem;
}

/* 图像显示优化样式 */
.image-display-section {
    margin: 2rem 0;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.image-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0 1.5rem;
}

.nav-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-indicator {
    font-weight: 500;
    color: var(--text-secondary);
}

.current-page {
    color: var(--primary);
    font-weight: 600;
}

.image-viewer {
    position: relative;
    min-height: 450px;
}

.image-slide {
    display: none;
    padding: 0 1.5rem 1.5rem;
}

.image-slide.active {
    display: block;
}

.image-slide h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    text-align: center;
}

.image-container {
    position: relative;
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 0.25rem;
    overflow: hidden;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: none;
    transition: transform 0.3s ease;
}

.image-container:hover img {
    transform: scale(1.02);
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    height: 100%;
    width: 100%;
}

.placeholder-icon {
    font-size: 3rem;
    opacity: 0.7;
}

.image-description {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
}

.model-info-display {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    font-size: 0.875rem;
}

.current-model {
    color: var(--primary);
    font-weight: 500;
}

.file-info {
    color: var(--text-secondary);
}

/* 文献分析结果区域的样式 */
.analysis-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 100%;
    font-family: 'Inter', sans-serif;
}

.dark-mode .analysis-result {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
}

.result-placeholder {
    color: var(--text-secondary);
    text-align: center;
    font-size: 1rem;
}

.dark-mode .result-placeholder {
    color: var(--text-secondary);
}

.analysis-result p {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.6;
    text-align: left;
    word-wrap: break-word;
}

.dark-mode .analysis-result p {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .analysis-result {
        padding: 1rem;
    }

    .analysis-result p {
        font-size: 0.875rem;
    }
}

/* ============== 新增：文件上传状态样式 ============== */
/* 上传状态容器 - 确保不影响布局 */
.upload-status-container {
    width: 100%;
    margin-top: 1rem;
}

/* 上传状态样式 */
.upload-status {
    padding: 1rem;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 0.5rem;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.status-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.status-icon {
    font-size: 1.25rem;
}

.status-text {
    color: var(--primary);
    font-weight: 500;
}

.status-success {
    background-color: rgba(16, 185, 129, 0.1);
}

.status-success .status-icon {
    color: #10b981;
}

.status-success .status-text {
    color: #10b981;
}

.status-error {
    background-color: rgba(239, 68, 68, 0.1);
}

.status-error .status-icon {
    color: #ef4444;
}

.status-error .status-text {
    color: #ef4444;
}

/* 重新上传按钮 */
.reupload-btn {
    margin-top: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.reupload-btn:hover {
    background-color: var(--primary-dark);
}

/* 上传完成后的标签样式 */
.upload-complete .file-upload-label {
    opacity: 0.6;
    pointer-events: none;
}

/* 确保文件上传区域布局一致 */
.file-upload-area {
    margin-bottom: 1.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed var(--border-light);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

/* 确保两个模块内容区域宽度一致 */
#voltage-section .section-content,
#research-section .section-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 研究分析区域特定调整 */
.research-input {
    position: relative;
    margin-bottom: 1.5rem;
    width: 100%;
}

.research-input textarea {
    width: 100%;
    min-height: 8rem;
    padding: 1rem;
    font-size: 1rem;
    background-color: var(--bg-primary);
    border: none;
    border-radius: 0.25rem;
    color: var(--text-primary);
    resize: vertical;
    box-sizing: border-box;
}

.analysis-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    width: 100%;
    box-sizing: border-box;
}

/* 文件信息显示 */
.file-info {
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-align: center;
    width: 100%;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .upload-status {
        padding: 0.75rem;
    }
    
    .reupload-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .file-upload-label {
        padding: 1.5rem;
    }
}

/* ============== 新增：电压预测表格样式 ============== */
.prediction-table {
    width: 100%;
    margin-top: 1.5rem;
    border-collapse: collapse;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.prediction-table th,
.prediction-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.prediction-table th {
    background-color: var(--bg-primary);
    font-weight: 600;
    color: var(--text-primary);
}

.prediction-table tr:last-child td {
    border-bottom: none;
}

/* ============== 新增：通知样式 ============== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-left: 4px solid #3498db;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 300px;
    max-width: 500px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 10000;
}

.notification.show {
    transform: translateX(0);
}

.notification-error {
    border-left-color: #e74c3c;
}

.notification-success {
    border-left-color: #2ecc71;
}

.notification-warning {
    border-left-color: #f39c12;
}

.notification-info {
    border-left-color: #3498db;
}

.notification-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.notification-message {
    flex: 1;
    margin-right: 10px;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #777;
    padding: 0;
    margin: 0;
}

.notification-close:hover {
    color: #333;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
}

.image-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.image-fullscreen img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
}
/* 视频模块样式 */
.video-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
}

.video-info {
    padding: 20px;
    text-align: center;
}

.video-info h3 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 1.5em;
    font-weight: 600;
}

.video-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1em;
    line-height: 1.5;
}

/* 响应式视频 */
.video-responsive {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 宽高比 */
}

.video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 视频控制按钮样式 */
video::-webkit-media-controls {
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

video::-webkit-media-controls-play-button,
video::-webkit-media-controls-volume-slider,
video::-webkit-media-controls-mute-button {
    filter: brightness(2);
}