* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8B6914;
    --secondary-color: #D4AF37;
    --accent-color: #C9A227;
    --bg-color: #FAF8F5;
    --card-bg: #FFFFFF;
    --text-color: #2C2C2C;
    --text-light: #666666;
    --border-color: #E5E0D8;
    --shadow: 0 4px 20px rgba(139, 105, 20, 0.1);
    --shadow-hover: 0 8px 30px rgba(139, 105, 20, 0.2);
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo h1 {
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 2px;
}

.logo span {
    font-size: 14px;
    opacity: 0.9;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s;
    padding: 8px 16px;
    border-radius: 20px;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hero {
    background: linear-gradient(rgba(139, 105, 20, 0.85), rgba(139, 105, 20, 0.9)), url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 300"><rect fill="%23D4AF37" opacity="0.1" width="1200" height="300"/></svg>');
    padding: 80px 0;
    text-align: center;
    color: white;
}

.hero h2 {
    font-size: 42px;
    margin-bottom: 15px;
    font-weight: bold;
}

.hero p {
    font-size: 18px;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
}

.search-section {
    margin-top: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-box {
    display: flex;
    gap: 10px;
    background: white;
    padding: 8px;
    border-radius: 50px;
    box-shadow: var(--shadow);
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 30px;
}

.search-box button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.search-box button:hover {
    background: var(--accent-color);
}

main {
    padding: 60px 0;
}

.section-title {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    margin: 15px auto 0;
    border-radius: 2px;
}

.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.category-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-color);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.category-card h3 {
    font-size: 22px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.category-card p {
    color: var(--text-light);
    font-size: 14px;
}

.category-card .count {
    display: inline-block;
    margin-top: 15px;
    background: var(--secondary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 13px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.book-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.book-cover {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
}

.book-info {
    padding: 20px;
}

.book-info h3 {
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.book-info p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

footer {
    background: var(--primary-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 20px;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.footer-section a:hover {
    color: white;
    padding-left: 5px;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.reader-page {
    display: flex;
    gap: 30px;
}

.reader-content {
    flex: 1;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.reader-sidebar {
    width: 300px;
}

.reader-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.nav-btn:hover {
    background: var(--accent-color);
}

.nav-btn.secondary {
    background: var(--text-light);
}

.nav-btn.secondary:hover {
    background: var(--text-color);
}

.reader-title {
    text-align: center;
    margin-bottom: 40px;
}

.reader-title h1 {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.reader-meta {
    color: var(--text-light);
    font-size: 14px;
}

.reader-body {
    font-size: 17px;
    line-height: 2;
    color: var(--text-color);
}

.reader-body p {
    margin-bottom: 20px;
    text-align: justify;
}

.sidebar-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.sidebar-card h4 {
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.toc-list {
    list-style: none;
}

.toc-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.toc-list a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.toc-list a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.comment-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.comment-section h3 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.comment-form {
    background: var(--bg-color);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
    font-family: inherit;
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s;
}

.comment-form button:hover {
    background: var(--accent-color);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment {
    padding: 20px;
    background: var(--bg-color);
    border-radius: 10px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: bold;
    color: var(--primary-color);
}

.comment-date {
    font-size: 13px;
    color: var(--text-light);
}

.donate-section {
    text-align: center;
}

.donate-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.donate-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s;
}

.donate-btn:hover {
    transform: scale(1.05);
}

.publish-page {
    max-width: 800px;
    margin: 0 auto;
}

.publish-form {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
}

.form-group textarea {
    min-height: 300px;
    resize: vertical;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.submit-btn:hover {
    opacity: 0.9;
}

.search-results {
    margin-top: 40px;
}

.result-item {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.result-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.result-item h4 {
    color: var(--primary-color);
    font-size: 20px;
    margin-bottom: 10px;
}

.result-item p {
    color: var(--text-light);
    font-size: 14px;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    nav ul {
        gap: 15px;
    }
    
    .reader-page {
        flex-direction: column;
    }
    
    .reader-sidebar {
        width: 100%;
    }
    
    .hero h2 {
        font-size: 30px;
    }
}
