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

:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #1f2933;
    --muted: #66788a;
    --nav: #233648;
    --nav-hover: #31495f;
    --primary: #d94841;
    --primary-dark: #b73a34;
    --accent: #2b86c5;
    --line: #d9e2ec;
    --shadow: 0 16px 32px rgba(31, 41, 51, 0.08);
    --radius: 14px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
    line-height: 1.7;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(35, 54, 72, 0.96);
    color: #fff;
    backdrop-filter: blur(14px);
    box-shadow: 0 6px 24px rgba(17, 24, 39, 0.14);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
}

.logo a {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-links a {
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.92);
    padding: 8px 14px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--nav-hover);
    color: #fff;
}

.search-box {
    margin-left: auto;
}

.site-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-search input {
    width: min(220px, 42vw);
    border: none;
    border-radius: 999px;
    padding: 10px 14px;
    outline: none;
}

.site-search button {
    background: var(--primary);
    border: none;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    padding: 10px 16px;
    transition: background-color 0.25s ease;
}

.site-search button:hover {
    background: var(--primary-dark);
}

.page-main {
    padding-bottom: 48px;
}

.carousel {
    height: 420px;
    margin-bottom: 32px;
    overflow: hidden;
    position: relative;
}

.carousel-container,
.carousel-item {
    height: 100%;
}

.carousel-item {
    inset: 0;
    opacity: 0;
    position: absolute;
    transition: opacity 0.45s ease;
}

.carousel-item.active {
    opacity: 1;
    z-index: 1;
}

.carousel-item a {
    display: block;
    height: 100%;
    position: relative;
}

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

.carousel-caption {
    background: linear-gradient(180deg, rgba(16, 24, 40, 0.05) 0%, rgba(16, 24, 40, 0.78) 100%);
    color: #fff;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px;
    position: absolute;
}

.carousel-caption h1,
.carousel-caption h2 {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.15;
    margin-bottom: 10px;
    max-width: 720px;
}

.carousel-caption p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    max-width: 620px;
}

.category-nav,
.page-hero,
.comic-section,
.chapter-list,
.comic-detail {
    margin-bottom: 32px;
}

.category-nav .container,
.page-hero .container,
.comic-section .container,
.chapter-list .container {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

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

.breadcrumb {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.breadcrumb a {
    color: var(--accent);
}

.section-intro {
    color: var(--muted);
    margin: 8px 0 24px;
}

.content-panel .container {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}

.category-nav h2,
.page-hero h1,
.comic-section h2,
.chapter-list h2,
.detail-info h1 {
    color: #243b53;
}

.category-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.category-links a {
    background: #ecf2f8;
    border-radius: 999px;
    color: #334e68;
    padding: 10px 16px;
    transition: all 0.25s ease;
}

.category-links a:hover {
    background: var(--accent);
    color: #fff;
}

.comic-grid,
.category-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.comic-item,
.category-item {
    background: var(--card);
    border: 1px solid rgba(217, 226, 236, 0.85);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.comic-item:hover,
.category-item:hover {
    border-color: rgba(43, 134, 197, 0.3);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.12);
    transform: translateY(-4px);
}

.comic-item a,
.category-item a {
    display: block;
    height: 100%;
}

.comic-item img {
    aspect-ratio: 4 / 5;
    object-fit: cover;
    width: 100%;
}

.category-item img {
    aspect-ratio: 1 / 1;
    border-bottom: 1px solid rgba(217, 226, 236, 0.85);
    object-fit: cover;
    width: 100%;
}

.comic-item h3,
.category-item h3 {
    font-size: 18px;
    line-height: 1.35;
    padding: 14px 14px 6px;
}

.comic-item p,
.category-item p {
    color: var(--muted);
    font-size: 14px;
    padding: 0 14px 14px;
}

.comic-meta {
    color: #486581;
    font-weight: 700;
    padding-bottom: 6px !important;
}

.comic-desc {
    line-height: 1.65;
    min-height: 72px;
}

.update-tag,
.new-tag {
    display: inline-block;
    margin: 0 14px 16px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.update-tag {
    background: #e8f1fb;
    color: #1d4f91;
}

.new-tag {
    background: #fde8e7;
    color: #b42318;
}

.comic-detail {
    margin-bottom: 0;
}

.detail-header {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.detail-cover {
    flex: 0 0 220px;
}

.detail-cover img {
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    object-fit: cover;
    width: 100%;
}

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

.detail-meta span {
    background: #f0f4f8;
    border-radius: 999px;
    color: #486581;
    font-size: 14px;
    padding: 8px 12px;
}

.detail-description {
    color: #334e68;
    margin-bottom: 22px;
}

.detail-description p + p {
    margin-top: 10px;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.info-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card {
    background: #f6f9fc;
    border: 1px solid rgba(217, 226, 236, 0.9);
    border-radius: 12px;
    padding: 18px;
}

.info-card h3 {
    color: #243b53;
    font-size: 17px;
    margin-bottom: 10px;
}

.info-card p {
    color: #52606d;
    line-height: 1.75;
}

.read-btn,
.secondary-btn {
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    min-height: 44px;
    padding: 0 18px;
}

.read-btn {
    background: var(--primary);
    color: #fff;
}

.read-btn:hover {
    background: var(--primary-dark);
}

.secondary-btn {
    background: #e8f1fb;
    color: #1d4f91;
}

.chapter-item {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 16px 0;
}

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

.chapter-item a {
    font-weight: 700;
}

.chapter-date {
    color: var(--muted);
    flex-shrink: 0;
    font-size: 14px;
    line-height: 1.6;
    max-width: 420px;
    text-align: right;
}

.result-summary,
.empty-state {
    color: var(--muted);
    margin-bottom: 18px;
}

.quick-search-links {
    margin-bottom: 18px;
}

.footer {
    background: var(--nav);
    color: #fff;
    padding: 34px 0;
}

.footer-content {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 20px;
}

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

.footer-section a,
.footer-section p {
    color: rgba(255, 255, 255, 0.86);
    display: block;
    margin-bottom: 8px;
}

.footer-section a:hover {
    color: #fff;
}

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

@media (max-width: 1024px) {
    .comic-grid,
    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .navbar .container {
        flex-wrap: wrap;
    }

    .search-box {
        width: 100%;
    }

    .site-search {
        width: 100%;
    }

    .site-search input {
        width: 100%;
    }
}

    @media (max-width: 768px) {
        .container {
            width: min(100% - 24px, 100%);
        }

    .navbar .container {
        align-items: stretch;
        flex-direction: column;
    }

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

    .comic-grid,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-header {
        flex-direction: column;
    }

    .detail-cover {
        max-width: 280px;
        width: 100%;
    }

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

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

        .carousel {
            height: 300px;
        }
    }

@media (max-width: 480px) {
    .comic-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .category-nav .container,
    .page-hero .container,
    .comic-section .container,
    .chapter-list .container {
        padding: 20px;
    }

    .carousel {
        height: 230px;
    }

    .carousel-caption {
        padding: 20px;
    }

        .chapter-item {
            align-items: flex-start;
            flex-direction: column;
        }

        .chapter-date {
            max-width: none;
            text-align: left;
        }
    }
