/* ========================================
   励梦文化官网 - 主样式文件
   ======================================== */

/* CSS Variables */
:root {
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-color: #2d3748;
    --text-light: #718096;
    --bg-color: #ffffff;
    --bg-light: #f7fafc;
    --bg-dark: #1a202c;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
    --container-width: 1200px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

ul, ol {
    list-style: none;
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   Header
   ======================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.main-nav {
    display: flex;
    align-items: center;
}

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

.nav-list a {
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}

.nav-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: var(--transition);
}

.nav-list a:hover::after,
.nav-list a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-color);
    transition: var(--transition);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    padding: 80px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
}

.hero .container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-content {
    flex: 1;
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-color) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-light);
    margin-bottom: 30px;
}

.hero-cta {
    display: flex;
    gap: 15px;
}

.hero-image {
    flex: 0 0 200px;
}

.hero-illustration {
    width: 100%;
    animation: float 6s ease-in-out infinite;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 24px;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   Features Section
   ======================================== */
.features {
    padding: 80px 0;
}

.section-title {
    font-size: 36px;
    text-align: center;
    margin-bottom: 50px;
    color: var(--text-color);
}

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

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-light);
}

/* ========================================
   About Preview
   ======================================== */
.about-preview {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.about-preview h2 {
    font-size: 32px;
    margin-bottom: 20px;
}

.about-preview p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
    max-width: 700px;
}

.about-preview .btn-outline {
    border-color: white;
    color: white;
}

.about-preview .btn-outline:hover {
    background: white;
    color: var(--primary-color);
}

/* ========================================
   Latest Content
   ======================================== */
.latest-content {
    padding: 80px 0;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.content-section h3 {
    font-size: 24px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.content-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.content-item .date {
    color: var(--text-light);
    font-size: 14px;
    flex-shrink: 0;
}

.content-item a {
    color: var(--text-color);
    font-weight: 500;
}

.content-item a:hover {
    color: var(--primary-color);
}

.more-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--primary-color);
    font-weight: 600;
}

/* ========================================
   Page Header
   ======================================== */
.page-header {
    padding: 60px 0 40px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    text-align: center;
}

.page-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.page-desc {
    color: var(--text-light);
    font-size: 18px;
}

/* ========================================
   List Page
   ======================================== */
.list-content {
    padding: 40px 0 80px;
}

.list-item {
    display: flex;
    gap: 20px;
    padding: 25px 0;
    border-bottom: 1px solid var(--border-color);
}

.list-item:hover {
    background: var(--bg-light);
    margin: 0 -20px;
    padding: 25px 20px;
}

.list-meta .date {
    color: var(--text-light);
    font-size: 14px;
}

.list-item h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.list-item h2 a {
    color: var(--text-color);
}

.list-item h2 a:hover {
    color: var(--primary-color);
}

.list-item .desc {
    color: var(--text-light);
}

/* ========================================
   Content / Prose
   ======================================== */
.page-content {
    padding: 40px 0 80px;
}

.prose {
    max-width: 800px;
    margin: 0 auto;
}

.prose h1 { font-size: 32px; margin: 0 0 30px; }
.prose h2 { font-size: 26px; margin: 40px 0 20px; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; }
.prose h3 { font-size: 20px; margin: 30px 0 15px; }
.prose h4 { font-size: 18px; margin: 20px 0 10px; }

.prose p { margin-bottom: 16px; }

.prose ul, .prose ol {
    margin: 16px 0;
    padding-left: 24px;
}

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

.prose li {
    margin-bottom: 8px;
}

.prose blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    margin: 20px 0;
    background: var(--bg-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.prose code {
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "SF Mono", Monaco, monospace;
    font-size: 14px;
}

.prose pre {
    background: var(--bg-dark);
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 20px 0;
}

.prose pre code {
    background: none;
    padding: 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.prose th, .prose td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}

.prose th {
    background: var(--bg-light);
    font-weight: 600;
}

.prose img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.prose hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 40px 0;
}

/* ========================================
   E-Book Styles
   ======================================== */
.ebook-toc-page {
    min-height: calc(100vh - 200px);
    padding: 60px 0;
}

.ebook-toc-header {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--radius-lg);
    margin-bottom: 50px;
}

.ebook-toc-header h1 {
    font-size: 40px;
    margin-bottom: 15px;
}

.ebook-toc-header .subtitle {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.ebook-toc-header .author {
    font-size: 14px;
    opacity: 0.7;
}

.ebook-toc-content {
    max-width: 900px;
    margin: 0 auto;
}

.full-toc {
    display: grid;
    gap: 30px;
}

.toc-section {
    background: white;
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.toc-section h2 {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.toc-chapters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.toc-chapters li a {
    display: block;
    padding: 8px 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    transition: var(--transition);
}

.toc-chapters li a:hover {
    background: var(--primary-color);
    color: white;
}

/* E-Book Reader */
.ebook-page {
    display: flex;
    min-height: calc(100vh - 70px);
}

.ebook-sidebar {
    width: 280px;
    background: var(--bg-light);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 25px;
}

.sidebar-header h2 {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 10px;
}

.back-toc {
    display: inline-block;
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.ebook-toc {
    font-size: 14px;
}

.ebook-toc ul {
    list-style: none;
}

.ebook-toc li {
    margin-bottom: 5px;
}

.ebook-toc a {
    display: block;
    padding: 6px 10px;
    color: var(--text-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.ebook-toc a:hover,
.ebook-toc a.active {
    background: var(--primary-color);
    color: white;
}

.ebook-toc > ul > li > a {
    font-weight: 600;
    margin-top: 15px;
}

.ebook-content {
    flex: 1;
    padding: 40px;
    max-width: 900px;
}

.ebook-container {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.ebook-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.chapter-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.nav-btn {
    padding: 8px 16px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    font-size: 14px;
}

.nav-btn:hover {
    background: var(--primary-color);
    color: white;
}

.chapter-title {
    font-size: 32px;
    color: var(--text-color);
}

.chapter-content {
    font-size: 17px;
    line-height: 1.8;
}

.ebook-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.page-info {
    color: var(--text-light);
    font-size: 14px;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background: var(--bg-dark);
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-size: 24px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand p {
    color: #a0aec0;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 16px;
    margin-bottom: 15px;
    color: white;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a,
.footer-contact p {
    color: #a0aec0;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #2d3748;
    color: #718096;
    font-size: 14px;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    color: var(--text-color);
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
}

.pagination .active {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .ebook-sidebar {
        display: none;
    }
    
    .ebook-content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero-cta {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hero-image {
        display: none;
    }
    
    .nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        box-shadow: var(--shadow-md);
    }
    
    .nav-list.active {
        display: flex;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* ========================================
   Ebook List (书籍列表页)
   ======================================== */
.ebook-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.ebook-card {
    display: flex;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ebook-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.ebook-cover {
    width: 140px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    color: white;
    text-align: center;
}

.ebook-cover h2 {
    font-size: 18px;
    line-height: 1.4;
    margin: 0;
}

.ebook-cover-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ebook-cover-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.ebook-cover-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.ebook-info {
    flex: 1;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
}

.ebook-info h3 {
    font-size: 18px;
    margin: 0 0 8px;
}

.ebook-info h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.ebook-info h3 a:hover {
    color: var(--primary-color);
}

.ebook-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 10px;
    flex: 1;
}

.ebook-meta {
    color: var(--text-tertiary);
    font-size: 12px;
    margin: 0 0 15px;
}

.ebook-btn {
    display: inline-block;
    padding: 8px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-align: center;
    transition: background 0.3s ease;
}

.ebook-btn:hover {
    background: var(--primary-dark);
    color: white;
}

@media (max-width: 768px) {
    .ebook-list {
        grid-template-columns: 1fr;
    }
    
    .ebook-card {
        flex-direction: column;
    }
    
    .ebook-cover {
        width: 100%;
        min-height: 120px;
    }
}
