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

:root {
    --primary-color: #ff6b9d;
    --secondary-color: #4ecdc4;
    --dark-bg: #1a1a2e;
    --light-bg: #f5f5f5;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.tagline {
    font-size: 14px;
    opacity: 0.9;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 25px;
    flex-wrap: wrap;
}

.nav-list a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-list a:hover {
    opacity: 0.8;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    padding: 10px 15px;
    border: none;
    border-radius: 25px;
    width: 250px;
    font-size: 14px;
}

.search-box button {
    padding: 10px 20px;
    background: white;
    color: var(--primary-color);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.3s;
}

.search-box button:hover {
    transform: scale(1.05);
}

/* Main Content */
.main {
    padding: 40px 0;
}

.section-title {
    font-size: 24px;
    margin-bottom: 30px;
    color: var(--text-dark);
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}

/* Featured Section */
.featured-section {
    margin-bottom: 50px;
}

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

.comic-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.comic-card img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.comic-card.featured img {
    height: 500px;
}

.comic-info {
    padding: 20px;
}

.comic-info h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.comic-desc {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.tag {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
}

.update {
    color: var(--text-light);
    font-size: 12px;
}

.read-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s;
    text-align: center;
    width: 100%;
}

.read-btn:hover {
    transform: scale(1.05);
}

/* Categories Section */
.categories-section {
    margin-bottom: 50px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.category-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-dark);
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    text-align: center;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.category-card h3 {
    padding: 15px;
    font-size: 16px;
}

.category-card p {
    padding: 0 15px 15px;
    font-size: 12px;
    color: var(--text-light);
}

/* Updates Section */
.updates-section {
    margin-bottom: 50px;
}

.updates-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.update-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.update-item:hover {
    transform: translateX(5px);
}

.update-item img {
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.update-info {
    flex: 1;
}

.update-info h3 {
    margin-bottom: 10px;
}

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

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

.update-desc {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.6;
}

.update-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-light);
}

.time {
    color: var(--primary-color);
}

/* Trending Section */
.trending-section {
    margin-bottom: 50px;
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.trending-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
}

.rank {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.trending-item img {
    width: 80px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.trending-info {
    flex: 1;
}

.trending-info h3 {
    margin-bottom: 5px;
}

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

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

.trending-info p {
    font-size: 12px;
    color: var(--text-light);
}

/* Recommend Section */
.recommend-section {
    margin-bottom: 50px;
}

.recommend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

/* SEO Content */
.seo-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 50px;
    box-shadow: var(--shadow);
}

.seo-content h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.seo-content h3 {
    font-size: 18px;
    margin: 25px 0 15px;
    color: var(--text-dark);
}

.seo-content p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: var(--text-light);
    text-align: justify;
}

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

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

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

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

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    font-size: 14px;
}

/* Reader Page Styles */
.reader-container {
    max-width: 100%;
    padding: 0;
    background: #000;
}

.reader-header {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reader-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.reader-controls button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.reader-controls button:hover {
    background: rgba(255,255,255,0.3);
}

.reader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.reader-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 0;
}

/* Night Mode */
.night-mode {
    background: #1a1a1a;
    filter: invert(1) hue-rotate(180deg);
}

.night-mode img {
    filter: invert(1) hue-rotate(180deg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
    }

    .nav-list {
        justify-content: center;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        flex: 1;
        width: auto;
    }

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

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .update-item {
        flex-direction: column;
    }

    .update-item img {
        width: 100%;
        height: 250px;
    }

    .trending-item {
        flex-wrap: wrap;
    }

    .seo-content {
        padding: 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 22px;
    }

    .tagline {
        font-size: 12px;
    }

    .nav-list {
        gap: 15px;
        font-size: 14px;
    }

    .section-title {
        font-size: 20px;
    }

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

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}
