/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: #1f2937;
    background-color: #ffffff;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 32px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 40px;
    }
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

@media (min-width: 768px) {
    .nav-container {
        padding: 0 32px;
    }
}

@media (min-width: 1024px) {
    .nav-container {
        padding: 0 40px;
    }
}

.nav-logo h2 {
    color: #667eea;
    font-weight: 700;
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    letter-spacing: -0.01em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #2563eb;
}

/* 主页横幅 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 80px;
    margin-top: 70px;
    overflow: hidden;
    position: relative;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 60px;
    align-items: center;
    min-height: 500px;
}

.hero-text {
    text-align: left;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    margin-bottom: 48px;
    opacity: 0.95;
    font-weight: 400;
    line-height: 1.5;
    max-width: 600px;
}

.hero-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 书籍封面样式 */
.hero-book-cover {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.book-cover-image {
    max-width: 100%;
    height: auto;
    max-height: 450px;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
}

.book-cover-image:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.book-cover-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-layout {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .book-cover-image {
        max-height: 300px;
    }
}

.cta-button {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    padding: 16px 48px;
    font-size: clamp(1rem, 2vw, 1.125rem);
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    letter-spacing: -0.01em;
    text-decoration: none;
    display: inline-block;
}

.cta-button:hover {
    background: white;
    color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: white;
}

/* 章节样式 */
.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 800;
    margin-bottom: 72px;
    color: #111827;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    margin: 24px auto 0;
    border-radius: 2px;
}

.about, .chapters, .author {
    padding: clamp(60px, 8vw, 100px) 0;
}

.comments {
    padding: clamp(60px, 8vw, 100px) 0;
}

.about {
    background: white;
}

.about-text p {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    line-height: 1.8;
    color: #374151;
    margin-bottom: 32px;
    text-align: center;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.feature {
    background: #f8fafc;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.feature h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #1f2937;
}

.feature p {
    color: #6b7280;
    line-height: 1.6;
}

/* 章节网格 */
.chapters {
    background: #f8fafc;
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-top: 8px;
}

@media (min-width: 768px) {
    .chapters-grid {
        gap: 40px;
    }
}

.chapter-card {
    background: white;
    border-radius: 20px;
    padding: 36px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
}

.chapter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.chapter-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12);
    border-color: #e2e8f0;
}

.chapter-card:hover::before {
    transform: scaleX(1);
}

.chapter-number {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 20px;
}

.chapter-title {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 700;
    margin-bottom: 16px;
    color: #111827;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.chapter-description {
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 400;
}

.chapter-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
    font-weight: 500;
}

.reading-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 作者介绍 */
.author {
    padding: 80px 0;
    background-color: var(--color-background-alt);
    text-align: center;
}

.author-card {
    background-color: var(--color-card-background);
    border-radius: 12px;
    padding: 40px;
    margin-top: 40px;
    box-shadow: var(--shadow-elevation-medium);
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.author-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 25px;
    border: 5px solid var(--color-primary-light);
    box-shadow: var(--shadow-elevation-small);
}

.author-info h3 {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 10px;
    letter-spacing: -0.03em;
}

.author-title {
    font-size: 1.2em;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
    font-weight: 500;
}

.author-description {
    font-size: 1.1em;
    color: var(--color-text-primary);
    line-height: 1.8;
    margin-bottom: 30px;
    max-width: 700px;
}

.author-achievements {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.achievement {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid var(--color-primary-light);
}

.achievement:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevation-small);
}

/* 评论系统 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

#modalContent {
    line-height: 1.8;
    color: #333;
}

#modalContent h1, #modalContent h2, #modalContent h3 {
    color: #1f2937;
    margin: 20px 0 15px 0;
}

#modalContent p {
    margin-bottom: 15px;
}

/* 评论系统 */
.comments {
    background: #f8fafc;
    padding: 80px 0;
}

.rating-summary {
    background: white;
    border-radius: 20px;
    padding: 48px;
    margin-bottom: 48px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 48px;
    align-items: center;
}

@media (max-width: 768px) {
    .rating-summary {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 32px;
        text-align: center;
    }
}

.overall-rating {
    text-align: center;
}

.rating-score {
    font-size: 4rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.rating-stars {
    font-size: 1.5rem;
    color: #fbbf24;
    margin-bottom: 10px;
}

.rating-count {
    color: #6b7280;
    font-size: 0.9rem;
}

.rating-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rating-label {
    min-width: 30px;
    font-size: 0.9rem;
    color: #4b5563;
}

.bar-container {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.rating-percent {
    min-width: 35px;
    font-size: 0.9rem;
    color: #6b7280;
    text-align: right;
}

/* 评论表单 */
.comment-form-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.comment-form-container h3 {
    margin-bottom: 30px;
    color: #1f2937;
    font-size: 1.5rem;
}

.comment-form {
    display: grid;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.rating-input {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.star-input {
    font-size: 1.5rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s ease;
}

.star-input:hover,
.star-input.active {
    color: #fbbf24;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    justify-self: start;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* 评论列表 */
.comments-list {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.comments-header h3 {
    color: #1f2937;
    font-size: 1.5rem;
}

.sort-options select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

.comment-item {
    padding: 25px 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.author-info h4 {
    margin: 0;
    color: #1f2937;
    font-size: 1rem;
}

.comment-date {
    color: #6b7280;
    font-size: 0.85rem;
    margin-top: 2px;
}

.comment-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.comment-rating .star {
    color: #fbbf24;
    font-size: 0.9rem;
}

.comment-text {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 15px;
}

.comment-actions {
    display: flex;
    gap: 15px;
}

.comment-action {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
}

.comment-action:hover {
    color: #667eea;
}

.comment-action.liked {
    color: #ef4444;
}

.reply-form {
    margin-top: 20px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    display: none;
}

.reply-form.active {
    display: block;
}

.reply-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 10px;
    resize: vertical;
    min-height: 80px;
}

.reply-actions {
    display: flex;
    gap: 10px;
}

.reply-btn, .cancel-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.reply-btn {
    background: #667eea;
    color: white;
}

.cancel-btn {
    background: #e5e7eb;
    color: #374151;
}

.replies {
    margin-top: 20px;
    padding-left: 60px;
    border-left: 2px solid #f3f4f6;
}

.reply-item {
    padding: 15px 0;
    border-bottom: 1px solid #f9fafb;
}

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

.load-more {
    text-align: center;
    margin-top: 30px;
}

.load-more-btn {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: #667eea;
    color: white;
}

/* 页脚 */
.footer {
    background: #1f2937;
    color: white;
    text-align: center;
    padding: 40px 0;
}

.footer p {
    margin-bottom: 10px;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        gap: 30px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .nav-menu {
        display: none;
    }
    
    .chapters-grid {
        grid-template-columns: 1fr;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .author-achievements {
        flex-direction: column;
        align-items: center;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .chapter-card {
        padding: 20px;
    }
}