:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #e9ecef;
    --text-primary: #343a40;
    --text-secondary: #6c757d;
    --accent-color: #495057;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --transition: all 0.3s ease;
    --line-height: 1.8;
}

[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --accent-color: #ced4da;
    --glass-bg: rgba(30, 30, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    background-image: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
}

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

.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 15px 0;
}

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

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: var(--transition);
}

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

.theme-toggle {
    display: flex;
    align-items: center;
}

.glass-btn {
    border-radius: 50px;
    padding: 8px 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.glass-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.2);
}

.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

.reader-page .navbar {
    display: none;
}

.hero {
    padding: 120px 0 80px;
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--text-secondary);
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(73, 80, 87, 0.1);
}

.search-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    background: var(--accent-color);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(73, 80, 87, 0.3);
}

.novel-list {
    padding: 60px 0;
}

.novel-list h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.novel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.novel-card {
    border-radius: 15px;
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
}

.novel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(31, 38, 135, 0.2);
}

.novel-cover {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.novel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.novel-card:hover .novel-cover img {
    transform: scale(1.05);
}

.novel-info h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.author {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.novel-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    margin-right: 5px;
}

.description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.update-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.footer {
    padding: 40px 0;
    margin-top: 60px;
}

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

.footer-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.footer-section p,
.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.novel-detail {
    padding: 100px 0 60px;
}

.detail-header {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    border-radius: 15px;
    padding: 30px;
}

.detail-cover {
    width: 200px;
    height: 300px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info {
    flex: 1;
}

.detail-info h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.detail-meta span {
    color: var(--text-secondary);
}

.detail-description {
    margin-bottom: 30px;
    line-height: 1.6;
    color: var(--text-primary);
}

.detail-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.read-btn {
    background: var(--accent-color);
    color: white;
}

.collect-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.url-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    text-decoration: none;
}

.collect-btn.collected {
    background: #28a745;
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.chapter-list {
    border-radius: 15px;
    padding: 30px;
}

.chapter-list h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

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

.chapter-item {
    padding: 12px 15px;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}

.chapter-item:hover {
    background: rgba(73, 80, 87, 0.1);
}

.chapter-item a {
    color: var(--text-primary);
    text-decoration: none;
    display: block;
}

.reader {
    padding: 100px 0 60px;
}

.reader-container {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 15px;
    padding: 40px;
    position: relative;
}

.reader-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.reader-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.reader-chapter {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.reader-content {
    line-height: var(--line-height);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 40px;
}

.reader-content p {
    margin-bottom: 20px;
    text-indent: 2em;
}

.reader-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.control-btn {
    padding: 10px 20px;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.control-btn:hover {
    background: var(--accent-color);
    color: white;
}

.reader-settings {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 15px;
    padding: 20px;
    z-index: 1000;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-group h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.font-size-controls,
.line-height-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.font-btn,
.line-height-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: var(--glass-bg);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.font-btn:hover,
.line-height-btn:hover {
    background: var(--accent-color);
    color: white;
}

.bg-color-controls {
    display: flex;
    gap: 10px;
}

.bg-color-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.bg-color-btn:hover {
    transform: scale(1.1);
}

.bg-default {
    background: var(--glass-bg);
}

.bg-eyecare {
    background: #f0f4e8;
}

.bg-paper {
    background: #f8f5e6;
}

.chapter-drawer {
    position: fixed;
    left: -300px;
    top: 0;
    width: 300px;
    height: 100vh;
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
    z-index: 1100;
    padding: 20px;
    overflow-y: auto;
}

.chapter-drawer.open {
    left: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.drawer-header h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.close-drawer {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

.drawer-chapters {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drawer-chapter {
    padding: 10px 15px;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}

.drawer-chapter:hover {
    background: rgba(73, 80, 87, 0.1);
}

.drawer-chapter.active {
    background: rgba(73, 80, 87, 0.2);
}

.drawer-chapter a {
    color: var(--text-primary);
    text-decoration: none;
    display: block;
}

.drawer-toggle {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50px;
    padding: 10px;
    cursor: pointer;
    z-index: 1050;
    transition: var(--transition);
}

.drawer-toggle:hover {
    transform: translateY(-50%) scale(1.1);
}

.search-result {
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.novel-card {
    animation: fadeIn 0.5s ease forwards;
}

.novel-card:nth-child(2) {
    animation-delay: 0.1s;
}

.novel-card:nth-child(3) {
    animation-delay: 0.2s;
}

.novel-card:nth-child(4) {
    animation-delay: 0.3s;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .nav-links {
        display: none;
    }

    .detail-header {
        flex-direction: column;
        text-align: center;
    }

    .detail-cover {
        margin: 0 auto;
    }

    .reader-container {
        padding: 20px;
    }

    .reader-settings {
        position: fixed;
        bottom: 20px;
        right: 20px;
        top: auto;
        transform: none;
        display: flex;
        gap: 10px;
        padding: 10px;
    }

    .settings-group {
        margin-bottom: 0;
    }

    .font-size-controls,
    .line-height-controls {
        flex-direction: column;
        gap: 5px;
    }

    .bg-color-controls {
        flex-direction: column;
        gap: 5px;
    }

    .chapter-drawer {
        width: 100%;
        left: -100%;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .search-box {
        flex-direction: column;
    }

    .novel-grid {
        grid-template-columns: 1fr;
    }

    .chapters {
        grid-template-columns: 1fr;
    }
}
