html {
    scroll-behavior: smooth;
}

main {
    padding-top: 62px;
}

main a {
    text-decoration: none;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
}

.protect {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.protect textarea,
.protect input {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

.crumbs {
    max-width: 940px;
    margin: 0 auto;
    padding: 14px 16px 0;
}

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 12px;
    color: var(--rgba3);
}

.crumbs li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.crumbs li + li::before {
    content: '/';
    opacity: 0.5;
}

.crumbs a {
    color: var(--rgba3);
    transition: color 0.18s ease;
}

.crumbs a:hover {
    color: var(--primary2);
}

.crumbs li[aria-current] span {
    display: block;
    max-width: 56vw;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--text1);
    font-weight: 600;
}

.hero-detail {
    position: relative;
    overflow: hidden;
    min-height: auto;
    background: var(--bg);
}

.hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 22px;
    align-items: flex-start;
    padding: 18px 16px 28px;
    max-width: 940px;
    margin: 0 auto;
}

.cover-block {
    flex-shrink: 0;
    position: relative;
}

.cover-art {
    width: 130px;
    aspect-ratio: 2 / 3;
    border-radius: 6px;
    box-shadow: 0 2px 8px var(--rgba1);
    border: 1px solid var(--rgba2);
    background-color: var(--card);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    display: block;
}

.status-pill {
    position: absolute;
    top: 9px;
    left: -5px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 2px 9px 2px 7px;
    border-radius: 0 3px 3px 0;
    box-shadow: 0 2px 4px var(--rgba1);
}

.status-ongoing {
    background: var(--online);
    color: #ffffff;
}

.status-completed {
    background: var(--primary1);
    color: #ffffff;
}

.status-hiatus {
    background: #facc15;
    color: #000000;
}

.status-unknown {
    background: var(--rgba3);
    color: #ffffff;
}

.meta-block {
    flex: 1;
    min-width: 0;
}

.meta-top {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 9px;
}

.type-chip {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 10px;
    border-radius: 20px;
}

.type-manga {
    background: color-mix(in srgb, #60a5fa 15%, transparent);
    color: #60a5fa;
    border: 1px solid color-mix(in srgb, #60a5fa 30%, transparent);
}

.type-manhwa {
    background: color-mix(in srgb, #c084fc 15%, transparent);
    color: #c084fc;
    border: 1px solid color-mix(in srgb, #c084fc 30%, transparent);
}

.type-manhua {
    background: color-mix(in srgb, #fb923c 15%, transparent);
    color: #fb923c;
    border: 1px solid color-mix(in srgb, #fb923c 30%, transparent);
}

.type-webtoon {
    background: color-mix(in srgb, #34d399 15%, transparent);
    color: #34d399;
    border: 1px solid color-mix(in srgb, #34d399 30%, transparent);
}

.type-other {
    background: var(--rgba2);
    color: var(--rgba3);
    border: 1px solid var(--rgba2);
}

.comic-title {
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(22px, 6vw, 38px);
    line-height: 1.08;
    letter-spacing: 0.8px;
    color: var(--text1);
    margin-bottom: 6px;
    word-break: break-word;
}

.comic-author {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--rgba3);
    font-size: 12px;
    margin-bottom: 14px;
}

.comic-author .bi {
    color: var(--primary2);
    font-size: 13px;
}

.rating-block {
    margin-bottom: 14px;
}

.rating-headline {
    display: flex;
    align-items: baseline;
    gap: 1px;
    margin-bottom: 7px;
}

.r-num {
    font-family: 'Bebas Neue', cursive;
    font-size: 32px;
    color: var(--primary2);
    line-height: 1;
}

.r-denom {
    font-size: 14px;
    color: var(--rgba3);
    margin-right: 6px;
}

.r-count {
    font-size: 11px;
    color: var(--rgba3);
}

.rating-track {
    height: 4px;
    width: 160px;
    background: var(--rgba2);
    border-radius: 2px;
    overflow: hidden;
}

.rating-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary2), var(--level));
    border-radius: 2px;
    transition: width 0.7s ease;
}

.views-row {
    display: flex;
    align-items: center;
    gap: 6px 26px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.v-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
}

.v-num {
    font-family: 'Bebas Neue', cursive;
    font-size: 20px;
    color: var(--text1);
    line-height: 1;
}

.v-lbl {
    font-size: 10px;
    color: var(--rgba3);
    letter-spacing: 0.2px;
    margin-top: 2px;
}

.v-link {
    cursor: pointer;
}

.v-link .v-num {
    transition: color 0.18s ease;
}

.v-link:hover .v-num {
    color: var(--primary2);
}

.action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-primary-action,
.btn-secondary-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.btn-primary-action {
    background: var(--primary2);
    color: #ffffff;
    border: none;
}

.btn-primary-action:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--primary2) 35%, transparent);
}

.btn-secondary-action {
    background: transparent;
    color: var(--text1);
    border: 1px solid var(--rgba2);
}

.btn-secondary-action:hover {
    border-color: var(--primary2);
    color: var(--primary2);
    background: color-mix(in srgb, var(--primary2) 10%, transparent);
}

.btn-bm {
    background: transparent;
    border: 1px solid var(--rgba2);
    color: var(--text1);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.18s ease;
}

.btn-bm:hover,
.btn-bm.bm-active {
    background: color-mix(in srgb, var(--primary2) 10%, transparent);
    border-color: var(--primary2);
    color: var(--primary2);
}

.detail-content {
    max-width: 940px;
    margin: 0 auto;
    padding: 4px 16px 80px;
}

.tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 20px;
}

.g-tag {
    background: var(--card);
    border: 1px solid var(--rgba2);
    color: var(--rgba3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.g-tag:hover {
    border-color: var(--primary2);
    color: var(--primary2);
    background: color-mix(in srgb, var(--primary2) 10%, transparent);
}

.t-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: var(--rgba3);
    background: var(--rgba2);
    border: 1px solid transparent;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.t-tag .bi {
    font-size: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}

.info-card {
    background: var(--card);
    border: 1px solid var(--rgba2);
    border-radius: 8px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    transition: border-color 0.18s ease;
}

.info-card:hover {
    border-color: var(--primary2);
}

.info-card .bi {
    font-size: 20px;
    color: var(--primary2);
    margin-bottom: 2px;
}

.ic-val {
    font-family: 'Bebas Neue', cursive;
    font-size: 22px;
    color: var(--text1);
    line-height: 1;
}

.ic-val.ic-text {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.ic-lbl {
    font-size: 10px;
    color: var(--rgba3);
    letter-spacing: 0.2px;
}

.section-box {
    background: var(--card);
    border: 1px solid var(--rgba2);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 22px;
}

.box-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text1);
}

.box-title .bi {
    color: var(--primary2);
}

.synopsis-body {
    position: relative;
    max-height: 76px;
    overflow: hidden;
    transition: max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

.synopsis-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: linear-gradient(transparent, var(--card));
    pointer-events: none;
    transition: opacity 0.3s;
}

.synopsis-body.syn-open {
    max-height: 4000px;
}

.synopsis-body.syn-open::after {
    opacity: 0;
}

.synopsis-body p {
    color: var(--rgba3);
    font-size: 13px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.syn-toggle {
    background: none;
    border: none;
    color: var(--primary2);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 0;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.18s ease;
}

.syn-toggle:hover {
    opacity: 0.8;
}

.syn-toggle[hidden] {
    display: none;
}

.chapters-wrap {
    margin-top: 4px;
}

.ch-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.ch-toolbar .box-title {
    margin-bottom: 0;
}

.ch-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary2);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    min-width: 22px;
    height: 18px;
    padding: 0 6px;
    border-radius: 20px;
    margin-left: 6px;
    font-family: 'Inter', sans-serif;
    vertical-align: middle;
}

.sort-btns {
    display: flex;
    gap: 6px;
}

.s-btn {
    background: var(--card);
    border: 1px solid var(--rgba2);
    color: var(--rgba3);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.18s ease;
    font-family: 'Inter', sans-serif;
}

.s-btn:hover {
    border-color: var(--primary2);
    color: var(--primary2);
}

.s-btn.s-active {
    background: color-mix(in srgb, var(--primary2) 10%, transparent);
    border-color: var(--primary2);
    color: var(--primary2);
}

.ch-search {
    position: relative;
    margin-bottom: 12px;
}

.ch-search .bi {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rgba3);
    font-size: 13px;
    pointer-events: none;
}

.ch-search input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 38px;
    border-radius: 10px;
    border: 1px solid var(--rgba2);
    background: var(--card);
    color: var(--text1);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    -webkit-appearance: none;
    appearance: none;
}

.ch-search input:focus {
    border-color: var(--primary2);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary2) 18%, transparent);
}

.ch-list {
    border: 1px solid var(--rgba2);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--rgba2);
    transition: background 0.18s ease;
    text-decoration: none;
    color: inherit;
    gap: 8px;
}

.ch-row:last-of-type,
.ch-row.ch-last {
    border-bottom: none;
}

.ch-row:hover {
    background: var(--bg);
}

.ch-row.ch-row-hidden,
.ch-row.ch-filtered {
    display: none;
}

.ch-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.ch-num {
    font-family: 'Bebas Neue', cursive;
    font-size: 17px;
    color: var(--primary2);
    white-space: nowrap;
    min-width: 50px;
}

.ch-name {
    font-size: 12px;
    color: var(--rgba3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    max-width: 220px;
}

.ch-new-badge {
    background: var(--online);
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.ch-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.ch-views-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--rgba3);
}

.ch-views-stat .bi {
    font-size: 10px;
}

.ch-date-stat {
    font-size: 11px;
    color: var(--rgba3);
    white-space: nowrap;
    min-width: 72px;
    text-align: right;
}

.ch-empty {
    text-align: center;
    color: var(--rgba3);
    font-size: 13px;
    padding: 22px 0;
}

.ch-empty[hidden] {
    display: none;
}

.load-more-btn {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--rgba2);
    color: var(--rgba3);
    padding: 13px;
    border-radius: 8px;
    margin-top: 10px;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.18s ease;
}

.load-more-btn:hover {
    border-color: var(--primary2);
    color: var(--primary2);
    background: color-mix(in srgb, var(--primary2) 10%, transparent);
}

.load-more-btn[hidden] {
    display: none;
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: progress;
}

.lm-count {
    font-weight: 700;
    color: var(--primary2);
}

.dt-missing-wrap {
    min-height: calc(100vh - 62px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px 60px;
}

.dt-missing {
    text-align: center;
    max-width: 420px;
}

.dt-missing-icon {
    font-size: 46px;
    color: var(--primary2);
}

.dt-missing h1 {
    font-family: 'Bebas Neue', cursive;
    font-size: 34px;
    letter-spacing: 0.8px;
    margin: 10px 0 8px;
    color: var(--text1);
}

.dt-missing p {
    color: var(--rgba3);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 20px;
}

.dt-missing .action-row {
    justify-content: center;
}

@media (max-width: 480px) {
    .hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 16px 16px 28px;
        gap: 18px;
    }

    .cover-art {
        width: 148px;
    }

    .status-pill {
        left: 50%;
        transform: translateX(-50%);
        top: -10px;
        border-radius: 3px;
    }

    .meta-top,
    .rating-headline,
    .comic-author,
    .views-row,
    .action-row {
        justify-content: center;
    }

    .v-stat {
        align-items: center;
    }

    .rating-track {
        margin: 0 auto;
    }

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

    .ch-date-stat {
        display: none;
    }

    .ch-name {
        max-width: 120px;
    }}

@media (min-width: 481px) and (max-width: 768px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cover-art {
        width: 150px;
    }}

@media (min-width: 769px) {
    .cover-art {
        width: 190px;
    }

    .detail-content {
        padding: 4px 28px 80px;
    }

    .hero-inner {
        gap: 32px;
        padding: 28px 28px 36px;
    }

    .crumbs {
        padding: 16px 28px 0;
    }

    .comic-title {
        font-size: 40px;
    }

    .ch-search input {
        height: 40px;
    }}

@media (min-width: 1024px) {
    .detail-content {
        padding: 4px 0 80px;
    }

    .hero-inner {
        padding: 30px 0 40px;
    }

    .crumbs {
        padding: 18px 0 0;
    }}

@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    .rating-fill,
    .synopsis-body {
        transition: none;
    }}
