/* 加载页面样式 */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #121212 0%, #1E1E1E 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.loader-logo {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #BB86FC 0%, #A876E8 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(187, 134, 252, 0.4);
    animation: float 3s infinite ease-in-out;
}

.loader-logo i {
    font-size: 56px;
    color: white;
    margin-bottom: 0;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.loader-logo i:hover {
    transform: scale(1.1) rotate(5deg);
}

.loader-logo h2 {
    font-size: 36px;
    font-weight: 800;
    margin-top: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #A876E8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 15px rgba(187, 134, 252, 0.4);
    letter-spacing: 0.5px;
}

/* 加载中文字已整合到进度百分比中 */
.loader-spinner {
    display: none;
}

.loader-progress {
    width: 300px;
    margin: 0 auto;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.progress-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, #A876E8 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-percentage {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.2) 0%, rgba(168, 118, 232, 0.1) 100%);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(187, 134, 252, 0.3);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 原有的loader样式 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #121212 0%, #1E1E1E 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.loader {
    text-align: center;
}

/* 圆形加载效果已移除 */
.spinner-circle {
    display: none;
}

.spinner-circle::after { /* 重命名为匹配HTML中的类名 */
    width: 80px;
    height: 80px;
    border: 5px solid rgba(187, 134, 252, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 20px;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border: 3px solid rgba(187, 134, 252, 0.3);
    border-radius: 50%;
    border-top-color: rgba(139, 92, 246, 1);
    animation: spin 2s ease-in-out infinite reverse;
    transform: translate(-50%, -50%);
}

.loader-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #A876E8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loader-subtext {
    font-size: 16px;
    color: var(--text-secondary);
}

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

/* subpage-loader样式 - 与subpage-template.html保持一致 */
.subpage-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity var(--transition-normal);
}

.subpage-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.subpage-loader-content {
    text-align: center;
}

.subpage-loader-icon {
    width: 60px;
    height: 60px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-lg);
}

.subpage-loader-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.subpage-loader-progress {
    width: 200px;
    height: 4px;
    background-color: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.subpage-loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(187, 134, 252, 1), rgba(139, 92, 246, 1));
    border-radius: 2px;
    transition: width var(--transition-normal);
    width: 0%;
}

/* 结果加载动画 */
.result-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 18, 18, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.result-loading-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
}

.result-loading-spinner {
    margin-bottom: 20px;
}

.result-loading-spinner i {
    font-size: 60px;
    color: var(--primary-color);
    animation: spin 2s infinite linear;
}

/* 历史记录加载动画 */
.history-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    width: 100%;
    min-height: 200px;
}

.history-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(187, 134, 252, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
    position: relative;
}

/* 移除 .history-loading-spinner::after 伪元素，避免双圆圈效果 */

.history-loading-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 10px;
}

/* 历史记录删除遮罩 */
.history-delete-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    z-index: 10;
    backdrop-filter: blur(4px);
    cursor: not-allowed;
    gap: 8px;
}

.history-delete-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    flex-shrink: 0;
}

.history-delete-text {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.result-loading-content h3 {
    font-size: 24px;
    color: var(--text-color);
    margin: 0 0 10px 0;
}

.result-loading-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

.rotating {
    animation: spin 2s infinite linear;
}

/* 淡入淡出动画 */
.fade-out {
    opacity: 0;
    visibility: hidden;
}

.fade-in {
    opacity: 1;
    visibility: visible;
}