/* 全局样式和变量 */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #7209b7;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --success-color: #4cc9f0;
    --warning-color: #f72585;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --shadow-md: 0 .5rem 1rem rgba(0,0,0,.15);
    --transition-slow: all 0.3s ease-in-out;
    --transition-fast: all 0.15s ease-in-out;
}

/* 基本样式 */
body {
    background-color: var(--light-color);
    padding-top: 40px;
    padding-bottom: 40px;
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 960px;
    padding: 0 15px;
}

/* 头部样式 */
.header {
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-size: 2.8rem;
    letter-spacing: -0.5px;
}

.header .lead {
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.header::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    margin: 25px auto 0;
    border-radius: 2px;
}

/* 上传表单样式 */
.form-container {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-slow);
    border: 1px solid var(--gray-200);
}

.form-container:hover {
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.1);
    transform: translateY(-5px);
}

.api-key-input .form-control,
#book-file {
    padding: 12px 15px;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.api-key-input .form-control:focus,
#book-file:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.btn-primary:hover, 
.btn-primary:focus {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* 结果展示区域 */
.result-container {
    display: none;
    margin-top: 50px;
    animation: fadeIn 0.5s ease-in-out;
}

.result-container h3 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

#result-info {
    margin-bottom: 25px;
    border-radius: 8px;
    background-color: #e3f2fd;
    border-color: #90caf9;
    padding: 15px;
}

.chapter-analysis {
    margin-bottom: 30px;
    background-color: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    border: 1px solid var(--gray-200);
}

.chapter-analysis:hover {
    box-shadow: var(--shadow-md);
}

.chapter-title {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.4rem;
}

.analysis-section {
    margin-bottom: 18px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gray-200);
}

.analysis-section:last-child {
    border-bottom: none;
}

.section-title {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.section-content {
    white-space: pre-line;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* 加载和错误提示 */
.loading {
    display: none;
    text-align: center;
    margin: 40px auto;
    max-width: 400px;
    padding: 20px;
    border-radius: 12px;
    background-color: white;
    box-shadow: var(--shadow-sm);
}

.loading .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--primary-color);
}

.error-container {
    display: none;
    margin-top: 25px;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    background-color: #ffebee;
    border-color: #ffcdd2;
}

/* 按钮样式 */
.btn-download {
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    margin-top: 20px;
    transition: var(--transition-fast);
}

.btn-download:hover {
    background-color: #3db8e0;
    transform: translateY(-2px);
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.2rem;
    }
    
    .form-container, 
    .chapter-analysis {
        padding: 20px;
    }
    
    .header::after {
        width: 60px;
        margin-top: 15px;
    }
}

/* SVG图标样式 */
.logo-container {
    margin-bottom: 1.5rem;
}

.logo-img {
    max-width: 160px;
    height: auto;
    margin: 0 auto;
    animation: float 6s ease-in-out infinite;
}

.file-upload-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.upload-icon {
    position: absolute;
    right: -100px;
    top: -80px;
    width: 300px;
    height: 225px;
    z-index: -1;
    opacity: 0.7;
    pointer-events: none;
}

svg {
    display: inline-block;
    vertical-align: middle;
}

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