/* =========================================================
   기본
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    background: #f1f2f0;
    color: #3d3f3e;
    font-family:
        "Pretendard",
        "Noto Sans KR",
        "Apple SD Gothic Neo",
        "Malgun Gothic",
        sans-serif;
    line-height: 1.7;
}

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


/* =========================================================
   페이지 배경 (Sub.png ~30%)
   ========================================================= */

.page-bg {
    position: fixed;
    inset: 0;
    background-image: url("../images/Sub.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}


/* =========================================================
   메인 히어로 오버레이 액션 (기존 유지)
   ========================================================= */

.main-hero {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 2850 / 4107;
}

.back-link {
    display: inline-block;
    margin-bottom: 30px;
    color: #777d7a;
    font-size: 14px;
}

.back-link:hover {
    color: #3d423f;
}


/* ==================================================
   추가/확인 페이지 공통 + 추가 페이지 전용
   ================================================== */

.add-page {
    position: relative;

    z-index: 1;

    width: min(
        1000px,
        calc(100% - 40px)
    );

    margin: 0 auto;

    padding:
        12px
        0
        80px;

    min-height: 100vh;
}


.add-back {
    display: inline-block;

    margin-bottom: 28px;

    color: #777d7a;

    font-size: 14px;
}


.add-back:hover {
    color: #3d423f;
}


.add-card {
    padding:
        28px
        34px
        30px;

    background: rgba(250, 251, 249, 0.4);

    border:
        1px
        solid
        #dfe2df;

    border-radius: 1px;

    box-shadow: none;
}


.add-title {
    margin: 0 0 8px;

    color: #343735;

    font-size:
        clamp(
            26px,
            4vw,
            34px
        );

    font-weight: 700;

    line-height: 1.4;

    letter-spacing: -0.04em;
}


.add-description {
    margin:
        0
        0
        16px;

    color: #858a87;

    font-size: 14px;

    line-height: 1.6;
}


.add-guide {
    display: flex;

    flex-direction: column;

    gap: 5px;

    margin-bottom: 14px;

    padding:
        14px
        16px;

    background: rgba(250, 251, 249, 0.4);

    border:
        1px
        solid
        #dfe2df;

    border-radius: 1px;

    color: #6d746f;

    font-size: 12px;

    line-height: 1.65;
}


.add-guide strong {
    color: #555c58;

    font-weight: 700;
}


.add-form {
    display: flex;

    flex-direction: column;

    gap: 8px;
}


.add-input {
    width: 100%;

    min-height: 36px;

    padding:
        0
        10px;

    border:
        1px
        solid
        #dfe2df;

    border-radius: 1px;

    outline: none;

    background: transparent;

    color: #4f5652;

    font-family: inherit;

    font-size: 14px;

    transition:
        border-color
        0.2s ease,

        box-shadow
        0.2s ease;
}





.add-input::placeholder {
    color: #a0a6a2;
}


.add-submit {
    width: clamp(140px, 20vw, 240px);

    align-self: center;

    min-height: 36px;

    margin-top: 0;

    padding:
        7px
        14px;

    border: 1px solid #555a57;

    border-radius: 1px;

    background: #555a57;

    color: #fafbf9;

    font-family: inherit;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;
}


.add-submit:hover {
    background: #3d423f;
    border-color: #3d423f;
    color: #fafbf9;
}


.add-note {
    margin:
        10px
        0
        0;

    color: #9a9f9c;

    font-size: 11px;

    line-height: 1.6;

    text-align: center;
}


/* ==================================================
   확인 페이지 전용
   ================================================== */

.candidate-section {
    margin-top: 24px;
}

.candidate-work-id-note {
    color: #6d746f;
    margin-bottom: 16px;
}

.candidate-hint {
    margin-top: 12px;
    font-size: 11px;
    color: #9a9f9c;
}

.candidate-hint a {
    color: #555a57;
}

.candidate-title {
    font-size: 14px;
    font-weight: 700;
    color: #343735;
    margin-bottom: 12px;
}

.candidate-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.candidate-item {
    padding: 16px;
    background: #ffffff;
    border: 1px solid #dfe2df;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.candidate-item:hover {
    border-color: #b8c0bb;
    background: #f5f7f5;
}

.candidate-item.selected {
    border-color: #555a57;
    background: #f0f1f0;
}

.candidate-item input[type="radio"] {
    display: none;
}

.candidate-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.candidate-work-id {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 28px;
    padding: 0 8px;
    background: #555a57;
    color: #fafbf9;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.candidate-info {
    flex: 1;
    min-width: 0;
}

.candidate-title-text {
    font-size: 14px;
    font-weight: 600;
    color: #343735;
    line-height: 1.4;
    margin-bottom: 4px;
    word-break: keep-all;
}

.candidate-meta {
    font-size: 12px;
    color: #858a87;
}

.candidate-author {
    font-weight: 500;
    color: #555c58;
}

.candidate-platforms {
    margin-top: 4px;
    font-size: 11px;
    color: #9a9f9c;
}

.candidate-action {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e1e4e1;
}

.candidate-action-title {
    font-size: 13px;
    font-weight: 600;
    color: #343735;
    margin-bottom: 12px;
}

.action-radios {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.action-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #4f5652;
}

.action-radio input[type="radio"] {
    accent-color: #555a57;
    width: 16px;
    height: 16px;
}

.confirm-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.confirm-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: #555a57;
    color: #fafbf9;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.confirm-submit:hover {
    background: #3d423f;
}

.confirm-submit.secondary {
    background: #858a87;
}

.confirm-submit.secondary:hover {
    background: #6d746f;
}

.new-work-id {
    display: inline-block;
    padding: 8px 12px;
    background: #f1f3f1;
    border: 1px solid #e1e4e1;
    border-radius: 6px;
    font-size: 12px;
    color: #555c58;
    font-family: monospace;
}

.crawled-info {
    margin-bottom: 20px;
    padding: 16px;
    background: #f5f7f5;
    border: 1px solid #e1e4e1;
    border-radius: 8px;
}

.crawled-info-title {
    font-size: 12px;
    font-weight: 700;
    color: #6d746f;
    margin-bottom: 8px;
}

.crawled-info-row {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #4f5652;
}

.crawled-info-label {
    color: #858a87;
    font-weight: 500;
}


/* ==================================================
   관리자 로그인 페이지
   ================================================== */
.login-wrapper {
    position: relative;

    z-index: 1;

    display: flex;

    align-items: center;

    justify-content: center;

    height: 100vh;

    padding: 0 16px;
}
.login-card {
    width: 100%;
    max-width: 380px;
    padding: 32px;
    background: rgba(250, 251, 249, 0.4);
    border: 1px solid #dfe2df;
    border-radius: 1px;
    box-shadow: none;
}

.login-card h1 {
    margin: 0;
    color: #343735;
    font-size: clamp(24px, 4vw, 30px);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.03em;
}

.login-card p {
    margin: 8px 0 24px;
    color: #858a87;
    font-size: 13px;
}

.login-card label {
    display: block;
    margin-bottom: 7px;
    color: #5f6662;
    font-size: 12px;
    font-weight: 600;
}

.login-card input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #dfe2df;
    border-radius: 1px;
    outline: none;
    background: transparent;
    color: #4f5652;
    font-family: inherit;
    font-size: 13px;
}

.login-card input:focus {
    border-color: #b8c0bb;
}

.error {
    margin: 0 0 12px;
    padding: 9px 11px;
    background: #f3eaea;
    border: 1px solid #dfcdcd;
    border-radius: 6px;
    color: #795858;
    font-size: 12px;
}

.login-card button {
    width: 100%;
    height: 42px;
    margin-top: 16px;
    border: 1px solid #dfe2df;
    border-radius: 1px;
    background: rgba(250, 251, 249, 0.4);
    color: #7a817d;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.login-card button:hover {
    background: #f1f3f1;
    border-color: #d3d7d4;
    color: #4f5652;
}

.back {
    display: block;
    margin-top: 16px;
    color: #858a87;
    font-size: 12px;
    text-align: center;
}

.back:hover {
    color: #4f5652;
}


/* ==================================================
   추가/확인/로그인 페이지 — 모바일 (max-width: 650px)
   ================================================== */

@media (max-width: 650px) {

    /* 공통 (추가/확인 페이지) */
    .add-page {
        width:
            min(
                100% - 24px,
                1000px
            );

        padding:
            30px
            0
            50px;
    }


    .add-card {
        padding:
            26px
            20px
            24px;
    }


    .add-title {
        font-size: 25px;
    }


    .add-description {
        margin-bottom: 16px;

        font-size: 13px;
    }

    .add-input {

        min-height: 36px;

        font-size: 13px;
    }

    .add-submit {

        min-height: 36px;

        font-size: 13px;
    }

    /* 확인 페이지 전용 */
    .action-radios {
        flex-direction: column;
        gap: 8px;
    }

    .crawled-info-row {
        flex-direction: column;
        gap: 4px;
    }
}


/* =========================================================
   상세 페이지 메인 래퍼 (목록/영타와 동일한 레이아웃)
   ========================================================= */
.novel-page {
    width: min(1000px, calc(100% - 40px));
    margin: 0 auto;
    padding: 12px 0 80px;
}


.novel-header {
    position: relative;
    display: grid;
    grid-template-columns:
        auto minmax(0, 1fr);
    align-items: start;
    column-gap: 30px;
    padding: 30px 34px 24px;
    background: transparent;
    border: 0;
    border-radius: 0;
}


/* =========================================================
   상세 표지
   ========================================================= */

.novel-cover {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: auto;
    height: auto;
    margin: 0 auto;
    padding: 0;
    min-width: 0;
    flex-shrink: 0;
    background: rgba(250, 251, 249, 0.4);
    border: none;
}

.novel-cover-button {
    display: flex;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    font: inherit;
    line-height: 0;
    cursor: pointer;
    align-items: flex-start;
    justify-content: center;
}

.novel-cover-button img {
    display: block;
    width: auto;
    height: 320px;
    max-width: none;
    max-height: 320px;
    min-width: 0;
    border-radius: 1px;
    box-shadow:
        0 5px 15px rgba(
            45,
            50,
            48,
            0.14
        );
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

.cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 145px;
    height: 220px;
    background: #e5e7e5;
    border-radius: 1px;
    color: #929693;
    font-size: 13px;
}


/* =========================================================
   상세 작품 정보
   ========================================================= */

.novel-basic {
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 320px;
    align-items: flex-start;
}

.novel-basic h1 {
    margin: 0 0 8px;
    color: #343735;
    font-size:
        clamp(
            25px,
            4vw,
            34px
        );
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.04em;
}


/* 작가 + 출판사 + 가격 */

.novel-author-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    color: #626765;
    font-size: 14px;
    justify-content: flex-start;
    text-align: left;
}

.novel-author {
    margin: 0;
    color: #626765;
    font-size: 16px;
    text-align: left;
}

.novel-detail-meta {
    position: relative;
    margin-left: 18px;
    color: #858a87;
    font-size: 14px;
}

.novel-detail-meta::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    width: 1px;
    height: 12px;
    background: #d0d3d0;
    transform: translateY(-50%);
}


/* =========================================================
   상세 키워드
   ========================================================= */

.novel-header-keywords,
.novel-platform-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e5e7e5;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
}

.novel-header-keywords .keyword {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 4px 9px;
    background: #f1f3f1;
    border: 1px solid #d9ddda;
    border-radius: 1px;
    color: #69706c;
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}




/* =========================================================
   작품 소개
   ========================================================= */

.info-section {
    margin: 0;
    padding: 0 34px 32px;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.info-section::before {
    content: "";
    display: block;
    height: 1px;
    margin: 18px 0 16px;
    background: #e5e7e5;
}

.info-section h2 {
    display: flex;
    align-items: center;
    margin: 0 0 18px;
    color: #404341;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.025em;
}

.info-section h2::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 20px;
    margin-right: 10px;
    background: #9da49f;
    border-radius: 2px;
}

.description {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: #555a57;
    font-size: 15px;
    line-height: 2;
    white-space: pre-line;
    word-break: keep-all;
}


/* =========================================================
   플랫폼
   ========================================================= */

.admin-platform-section {
    margin-top: 42px;
}


/* =========================================================
    플랫폼 수동 편집
    ========================================================= */

.platform-editor {
    position: relative;
    background: rgba(250, 251, 249, 0.4);
    border: 1px solid #dfe2df;
    border-radius: 1px;
    overflow: hidden;
}

.platform-editor summary {
    padding: 10px 14px;
    color: #777d7a;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}

.platform-editor summary:hover {
    color: #4f5652;
}

.platform-form {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 0 14px 14px;
}

.platform-form-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.platform-form-row span {
    color: #69706c;
    font-size: 12px;
    font-weight: 600;
}

.platform-form-row input {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #dfe2df;
    border-radius: 1px;
    outline: none;
    background: transparent;
    color: #4f5652;
    font-family: inherit;
    font-size: 12px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}



.platform-form-row input::placeholder {
    color: #a0a6a2;
}

.platform-save-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    height: 31px;
    padding: 4px 9px;
    border: 1px solid #dfe2df;
    border-radius: 1px;
    background: rgba(250, 251, 249, 0.4);
    color: #7a817d;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.platform-save-button:hover {
    background: #f1f3f1;
    border-color: #d3d7d4;
    color: #4f5652;
}


/* =========================================================
   작품 관리
    ========================================================= */

.novel-management {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.refresh-form,
.delete-form {
    margin: 0;
}

.management-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    width: 108.672px;
    height: 31px;
    padding: 4px 9px;
    border: 1px solid #dfe2df;
    border-radius: 1px;
    background: rgba(250, 251, 249, 0.4);
    color: #7a817d;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.management-button:hover {
    background: #f1f3f1;
    border-color: #d3d7d4;
    color: #4f5652;
}

.management-button.delete-button {
    background: rgba(139, 0, 0, 0.4);
    color: #fafbf9;
}

.management-button.delete-button:hover {
    background: rgba(139, 0, 0, 0.4);
    border-color: #d8c4c4;
    color: #fafbf9;
}


.management-button.refresh-button {
    background: #555a57;
    color: #fafbf9;
    border-color: #555a57;
}

.management-button.refresh-button:hover {
    background: #3d423f;
    border-color: #3d423f;
    color: #fafbf9;
}


/* =========================================================
   표지 확대
   ========================================================= */

body.lightbox-open {
    overflow: hidden;
}

.cover-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    padding: 20px;
    margin: 0;
    background: rgba(35, 35, 35, 0.62);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.cover-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.cover-lightbox-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    height: 100%;
    background: transparent;
    overflow: hidden;
}

.cover-lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 88vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 1px;
    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.28);
    cursor: zoom-out;
}

.cover-lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.18);
    color: #ffffff;
    font-family: inherit;
    font-size: 36px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.cover-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: rotate(90deg);
}


/* =========================================================
   목록 페이지
   ========================================================= */
.novel-list-page {
width: min(
    1000px,
    calc(100% - 40px)
);

margin: 0 auto;

padding:
    12px
    0
    80px;
}

.page-title-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 18px;
}

.site-title-area h1 {
    margin: 0;
    color: #343735;
    font-size: clamp(26px, 4vw, 34px);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.04em;
}

.site-title-area p {
    margin: 8px 0 0;
    color: #858a87;
    font-size: 14px;
}


/* =========================================================
   검색
   ========================================================= */

.search-area {
    margin-bottom: 18px;
}

.search-box {
    position: relative;
    width: 100%;
    height: 46px;
    display: flex;
    align-items: center;
    background: rgba(250, 251, 249, 0.4);
    border: 1px solid #dfe2df;
    border-radius: 1px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.search-box:focus-within {
    border-color: #bfc5c1;
}

.search-icon {
    flex: 0 0 auto;
    margin-left: 14px;
    color: #929894;
    font-size: 20px;
    line-height: 1;
}

#novel-search {
    width: 100%;
    height: 100%;
    padding:
        0
        42px
        0
        10px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #3d423f;
    font-family: inherit;
    font-size: 14px;
}

#novel-search::placeholder {
    color: #a0a6a2;
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8e9590;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%);
    transition:
        opacity 0.15s ease,
        background 0.15s ease,
        visibility 0.15s ease;
}

.search-clear.visible {
    opacity: 1;
    visibility: visible;
}

.search-clear:hover {
    background: #e8ebe9;
    color: #5d6460;
}


/* =========================================================
   브라우저 native search cancel button 제거 (type="search")
   ========================================================= */

input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}


/* =========================================================
    목록 툴바
    ========================================================= */
.list-toolbar {
display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.novel-count {
    margin: 0;
    color: #8a8f8c;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.novel-count strong {
    color: #555a57;
    font-weight: 700;
}




.view-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: rgba(250, 251, 249, 0.4);
    border:
        1px solid #dfe2df;
    border-radius: 1px;
}

.view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 62px;
    height: 31px;
    padding: 4px 9px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #7a817d;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.view-button:hover {
    color: #4f5652;
}

.view-button.active {
    background: #fafbf9;
    color: #404542;
    box-shadow:
        0 1px 4px rgba(
            55,
            60,
            58,
            0.08
        );
}




.keyword-filter-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    width: 350px;
    max-width: calc(100vw - 24px);
    max-height: 390px;
    overflow-y: auto;
    padding: 13px;
    background: #fafbf9;
    border: 1px solid #dfe2df;
    border-radius: 1px;
    box-shadow: 0 10px 28px rgba(55, 60, 58, 0.13);
}

.keyword-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 1px 3px 11px;
    border-bottom: 1px solid #e5e7e5;
    color: #4f5652;
    font-size: 13px;
    font-weight: 700;
}

#keyword-filter-reset {
    padding: 0;
    border: 0;
    background: transparent;
    color: #858a87;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
}

#keyword-filter-reset:hover {
    color: #4f5652;
}




/* =========================================================
   목록
   ========================================================= */

.novel-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.novel-card[hidden] {
    display: none !important;
}

.novel-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 0;
    padding:
        8px
        12px
        8px
        8px;
    background: rgba(250, 251, 249, 0.4);
    border:
        1px
        solid
        #dfe2df;
    border-radius: 1px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    
}


.novel-card:hover {
    background: rgba(250, 251, 249, 0.7);
}


.novel-card:focus-visible {
    outline: 2px solid #4f5652;
    outline-offset: 2px;
}


.novel-card-cover {
    flex:
        0 0 52px;
    width: 52px;
    height: 68px;
}

.novel-card-cover img {
    display: block;
    width: 52px;
    height: 68px;
    object-fit: cover;
    border-radius: 0;
}

.novel-card-cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 68px;
    background: #e5e7e5;
    border-radius: 4px;
    color: #929693;
    font-size: 10px;
}

.novel-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    overflow: hidden;
}

.novel-card-title-row {
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
    width: 100%;
    margin: 0;
    overflow: hidden;
    color: #343735;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.novel-card-title-text {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.novel-card-author-row {
    min-width: 0;
    width: 100%;
    overflow: hidden;
    color: #626765;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.novel-card-author-text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.novel-card-meta-row {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #858a87;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.novel-card-meta-item {
    display: inline;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    white-space: nowrap;
    text-overflow: clip;
}

/* =========================================================
   메타데이터 구분선 (길이, 간격, 높낮이 조절)
   ========================================================= */

/* 부모 영역: 잉여 코드 제거됨 */
.novel-card-meta-divider {
    display: inline;
}

/* 선을 그리는 영역 */
.novel-card-meta-divider::before {
    content: "";
    display: inline-block;
    
    /* 1. 길이 및 두께 조절 */
    width: 1px;         /* 선의 두께 (가로) */
    height: 9px;       /* 선의 길이 (세로) */
    
    /* 2. 양옆 여백 조절 */
    margin: 0 3px;      /* 0은 위아래 여백, 8px은 양옆 간격입니다 */
    
    /* 3. 색상 */
    background: #b8bdb9; 
    
    /* 4. 🚨 상하 정렬 (여기서 높낮이를 맞춥니다) 🚨 */
    vertical-align: middle; 
    transform: translateY(-1px); /* 이 수치로 미세 조절을 합니다 */
}

.novel-card-arrow {
    flex: 0 0 auto;
    color: #a1a6a3;
    font-size: 20px;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}


.novel-grid-title {
    display: none;
}

.novel-list.grid-view {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns:
        repeat(
            6,
            minmax(
                0,
                1fr
            )
        );
    gap: 26px 18px;
    padding: 18px;
    background: rgba(250, 251, 249, 0.4);
    border:
        1px
        solid
        #dfe2df;
    border-radius: 1px;
}

.novel-list.grid-view:not(:has(.novel-card:not([hidden]))) {
    background: transparent;
    border: 0;
    padding: 0;
}

.novel-list.grid-view .novel-card {
    display: block;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.novel-list.grid-view .novel-card-cover {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    height: auto;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #e5e7e5;
    border-radius: 0;
    box-shadow:
        0 4px 12px rgba(
            45,
            50,
            48,
            0.10
        );
}


.novel-list.grid-view .novel-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.novel-list.grid-view .novel-card-cover-empty {
    width: 100%;
    height: 100%;
    font-size: 11px;
}

.novel-list.grid-view .novel-card-info {
    display: none;
}

.novel-list.grid-view .novel-card-arrow {
    display: none;
}

.novel-list.grid-view .novel-grid-title {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 10px;
    min-height: 39px;
    color: #3d423f;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}


/* =========================================================
   검색 결과 없음
   ========================================================= */

.search-empty {
    position: relative;
    padding: 65px 20px;
    background: rgba(250, 251, 249, 0.4);
    border:
        1px
        solid
        #dfe2df;
    border-radius: 1px;
    text-align: center;
}

.search-empty h2 {
    margin: 0 0 5px;
    color: #4a4e4c;
    font-size: 17px;
}

.search-empty p {
    margin: 0;
    color: #8a8f8c;
    font-size: 13px;
}


/* =========================================================
   빈 사이트
   ========================================================= */

.empty-state {
    padding: 80px 20px;
    background: rgba(250, 251, 249, 0.4);
    border:
        1px
        solid
        #dfe2df;
    border-radius: 1px;
    text-align: center;
}

.empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin:
        0
        auto
        18px;
    background: #e5e7e5;
    border-radius: 50%;
    color: #858a87;
    font-size: 24px;
}

.empty-state h2 {
    margin: 0 0 5px;
    color: #4a4e4c;
    font-size: 17px;
}

.empty-state p {
    margin: 0 0 22px;
    color: #8a8f8c;
    font-size: 13px;
}

.empty-button {
    display: inline-flex;
    padding: 9px 16px;
    background: #555a57;
    border-radius: 7px;
    color: #fafbf9;
    font-size: 13px;
    font-weight: 600;
}

.empty-button:hover {
    background: #3d423f;
}


/* =========================================================
   반응형
   ========================================================= */

@media (max-width: 800px) {

    .novel-list.grid-view {
        grid-template-columns:
            repeat(
                4,
                minmax(
                    0,
                    1fr
                )
            );

        gap: 22px 14px;
    }
}


@media (max-width: 650px) {

    .novel-page {
        width:
            min(
                100% - 24px,
                1000px
            );

        padding:
            30px
            0
            50px;
    }

    .novel-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 22px 18px;
        padding:
            26px
            20px
            0;
        text-align: center;
    }

    .novel-cover {
        height: 218px;
        flex:
            0 0 200px;
        justify-content: center;
    }

    .novel-cover-button {
        height: 218px;
    }

    .novel-cover-button img {
        height:
            218px;
        max-width: none;
        max-height: 218px;
    }

    .cover-empty {
        width: 135px;
        height: 200px;
    }

    .novel-basic {
        min-height: 218px;
    }

    .novel-basic h1 {
        font-size: 25px;
    }

    .novel-author-row {
        display: block;
    }

    .novel-author {
        display: inline;
        margin-left: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
        user-select: text;
        font-size: 15px;
    }

    .novel-detail-meta {
        font-size: 13px;
    }

    .info-section {
        padding: 0 20px 32px;
    }

    .platform-form-row {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .novel-management {
        flex-wrap: wrap;
    }

    .cover-lightbox {
        padding: 10px;
    }

    .cover-lightbox-image {
        max-width: 92vw;
        max-height: 82vh;
    }

    .cover-lightbox-close {
        top: 8px;
        right: 10px;
        width: 38px;
        height: 38px;
        font-size: 27px;
    }

    .novel-list-page {
        width:
            min(
                100% - 24px,
                1000px
            );

        padding:
            30px
            0
            50px;
    }

    .site-title-area h1 {
        font-size: 26px;
    }

    .site-title-area p {
        font-size: 13px;
    }

    .search-box {
        height: 44px;
    }

    #novel-search {
        font-size: 13px;
    }

    .list-toolbar {
        gap: 8px;
        margin-bottom: 14px;
        flex-wrap: wrap;
    }

    .novel-sort {
        min-width: 84px;
    }

    .view-switcher {
        padding: 2px;
    }

    .list-toolbar-right {
        position: relative;
    }

    .keyword-filter {
        position: static;
    }




    .keyword-filter-panel {
        width: 310px;
    }



    .view-button {
        min-width: 56px;
    }

    .view-button span {
        display: none;
    }

    .novel-list {
        gap: 8px;
    }

    .novel-card {
        gap: 10px;
        padding: 8px;
    }

    .novel-card-cover {
        flex:
            0 0 48px;
        height: 64px;
    }

    .novel-card-cover img {
        width: 48px;
        height: 64px;
    }

    .novel-card-cover-empty {
        height: 64px;
    }

    .novel-card-arrow {
        align-self: center;
        font-size: 18px;
    }

    .novel-list:not(.grid-view) .novel-card-meta-row {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .novel-list.grid-view {
        grid-template-columns:
            repeat(
                3,
                minmax(
                    0,
                    1fr
                )
            );

        gap: 24px 12px;
    }

    .novel-list.grid-view
    .novel-grid-title {
        margin-top: 8px;
        min-height: 35px;
        font-size: 12px;
        line-height: 1.45;
    }

    .empty-state,
    .search-empty {
        padding:
            60px
            18px;
    }

    .novel-platform-links {
        gap: 5px;
    }
}


@media (max-width: 420px) {

    .novel-list.grid-view {
        grid-template-columns:
            repeat(
                3,
                minmax(
                    0,
                    1fr
                )
            );

        gap: 22px 14px;
    }

    .list-toolbar {
        gap: 6px;
        align-items: center;
        position: relative;
    }

    .list-toolbar-right {
        position: static;
    }

    .list-toolbar-right .keyword-filter {
        position: static;
    }

    select.novel-sort {
        width: 74px;
        min-width: 74px;
        -webkit-appearance: none;
        padding: 0 20px 0 11px;
    }

    button.keyword-filter-button {
        min-width: 74px;
    }

    .view-button {
        min-width: 48px;
    }




    .keyword-filter-panel {
        left: 0;
        right: auto;
        width: calc(100vw - 24px);
    }

    .platform-form-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .platform-save-button {
        align-self: stretch;
    }
}

/* =========================================================
   상단 관리자 버튼
   ========================================================= */

.top-admin-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 34px;
    padding:
        7px
        12px;
    border:
        1px
        solid
        #dfe2df;
    border-radius: 1px;
    background: #fafbf9;
    color: #69706c;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.top-admin-button:hover {
    background: #f1f3f1;
    border-color: #d3d7d4;
}

/* =========================================================
   INDEX TOOLBAR
   ========================================================= */

.list-toolbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-left: auto;
}


/* =========================================================
    KEYWORD FILTER
    ========================================================= */

.keyword-filter {
    position: relative;
    flex-shrink: 0;
}

.keyword-filter-button {
    appearance: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 5px;

    min-width: 100px;
    height: 35px;

    padding:
        0
        13px;

    border:
        1px
        solid
        #dfe2df;

    border-radius: 1px;

    background: #fafbf9;
    color: #606762;

    font-family: inherit;
    font-size: 12px;
    line-height: 1;

    cursor: pointer;
}

.keyword-filter-button:hover {
    border-color: #c5cbc7;
    background: #f7f8f7;
}

.keyword-filter-button[aria-expanded="true"] {
    border-color: #b8c0bb;
    background: #f7f8f7;

    box-shadow:
        0
        0
        0
        3px
        rgba(
            125,
            133,
            128,
            0.07
        );
}

.keyword-filter-arrow {
    width: 0;
    height: 0;

    margin-left: auto;

    border-left:
        4px
        solid
        transparent;

    border-right:
        4px
        solid
        transparent;

    border-top:
        5px
        solid
        #858c87;

    font-size: 0;
    line-height: 0;
}


/* =========================================================
   KEYWORD PANEL
   ========================================================= */

.keyword-filter-list {
    display: flex;
    flex-wrap: wrap;

    align-items: flex-start;

    gap: 6px;

    width: 100%;
}

.keyword-filter-item {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    flex:
        0
        0
        auto;

    min-height: 19px;

    padding:
        6px;

    border:
        1px
        solid
        #d9ddda;

    border-radius: 1px;

    background: #f1f3f1;
    color: #69706c;

    font-family: inherit;
    font-size: 11px;
    line-height: 1;

    white-space: nowrap;

    cursor: pointer;
}

.keyword-filter-item:hover {
    background: #e7eae8;
    border-color: #c8cdca;
    color: #424744;
}

.keyword-filter-item.selected {
    background: #3d423f;
    border-color: #3d423f;
    color: #f1f3f1;
}


/* =========================================================
    0+ FILTER
    ========================================================= */

.keyword-filter-item.general-filter.selected {
    background: #abc70b;
    border-color: #abc70b;
    color: #f1f3f1;
}


/* =========================================================
     19+ FILTER
     ========================================================= */

.keyword-filter-item.adult-filter.selected {
    background: #b80300;
    border-color: #b80300;
    color: #ffffff;
}


/* =========================================================
    PLATFORM FILTER (Ridi / Kakao)
    ========================================================= */

.keyword-filter-item.ridi-filter.selected {
    background: #0086ff;
    border-color: #0086ff;
    color: #ffffff;
}

.keyword-filter-item.kakao-filter.selected {
    background: #F4C100;
    border-color: #F4C100;
    color: #1a1a1a;
}


  /* =========================================================
     STATUS (연재/완결) SYSTEM FILTER
     Uses default .keyword-filter-item styles (no color override)
     ========================================================= */


 /* =========================================================
    DETAIL PAGE STATUS SYSTEM TAG
    ========================================================= */

 .novel-header-keywords .status-keyword {
     background: #eaf1f8;
     border-color: #cdddea;
     color: #3f6b8a;
     font-weight: 700;
 }

 .novel-header-keywords .adult-keyword {
     background: #faf0f0;
     border: 1px solid #d9bcbc;
     color: #a04d4d;
     font-weight: 700;
     justify-content: center;
 }

 .novel-header-keywords .general-keyword {
     background: #edf6ea;
     border: 1px solid #d4e7d0;
     color: #5f705a;
     font-weight: 700;
     justify-content: center;
 }


/* =========================================================
   TITLE BADGES
   ========================================================= */
.novel-title-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 3px;

    font-size: 9px;
    font-weight: 700;
    line-height: 1;

    vertical-align: middle;

    width: 14px;
    height: 14px;
    padding: 0;
    flex-shrink: 0;

    border-color: #b8c0bb;
    background: #eef0ee;
    color: #1a1a1a;
}

.novel-title-adult {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 3px;

    font-size: 9px;
    font-weight: 700;
    line-height: 1;

    vertical-align: middle;

    width: 14px;
    height: 14px;
    padding: 0;
    flex-shrink: 0;

    border-color: #d9bcbc;
    background: #B80300;
    color: #ffffff;
}

.novel-title-platform {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 3px;

    font-size: 9px;
    font-weight: 700;
    line-height: 1;

    vertical-align: middle;

    width: 14px;
    height: 14px;
    padding: 0;
    flex-shrink: 0;
}

.novel-title-platform.platform-ridi {
    border-color: #0086ff;
    background: #0086ff;
    color: #ffffff;
}

.novel-title-platform.platform-kakao {
    border-color: #F4C100;
    background: #F4C100;
    color: #1a1a1a;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 650px) {

    .keyword-filter-button {
        min-width: 84px;

        height: 35px;

        padding:
            0
            10px;

        font-size: 12px;
    }

    .keyword-filter-item {
        min-height: 18px;

        font-size: 10px;
    }

}


@media (max-width: 420px) {

    .list-toolbar-right {
        flex-wrap: wrap;
        gap: 4px;
    }


}

/* =========================================================
   SORT
   ========================================================= */

.novel-sort-wrap {
    position: relative;
    flex-shrink: 0;
}

.novel-sort {
    appearance: none;

    min-width: 100px;
    height: 35px;

    padding:
        0
        30px
        0
        11px;

    border:
        1px
        solid
        #dfe2df;

    border-radius: 1px;

    background:
        #fafbf9;

    color:
        #606762;

    font-family: inherit;

    font-size:
        12px;

    line-height: 1;

    outline: none;

    cursor: pointer;
}

.novel-sort:hover {
    border-color:
        #c5cbc7;
}

.novel-sort:focus {
    border-color:
        #b8c0bb;

    box-shadow:
        0
        0
        0
        3px
        rgba(
            125,
            133,
            128,
            0.08
        );
}

.novel-sort option {
    background:
        #fafbf9;

    color:
        #4f5652;

    font-family: inherit;

    font-size:
        13px;
}


/* 키워드 버튼과 동일한 CSS 삼각형 */
.novel-sort-wrap::after {
    content: "";

    position: absolute;

    right: 10px;
    top: 50%;

    width: 0;
    height: 0;

    margin-top: -2px;

    border-left:
        4px
        solid
        transparent;

    border-right:
        4px
        solid
        transparent;

    border-top:
        5px
        solid
        #858c87;

    pointer-events: none;
}

.refresh-filter {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 12px;
    padding: 16px 18px;
    background: #fafbf9;
    border: 1px solid #dfe2df;
    border-radius: 1px;
}

.refresh-filter[hidden] {
    display: none;
}

.refresh-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.refresh-filter-title {
    color: #404542;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.refresh-filter-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 12px;
    border: 1px solid #d8dcd9;
    border-radius: 1px;
    background: #fafbf9;
    color: #69706c;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.refresh-filter-close:hover {
    background: #f1f3f1;
    border-color: #d3d7d4;
}

.refresh-full {
    margin-top: 14px;
}

.refresh-full form {
    margin: 0;
}

.refresh-full-button {
    width: 100%;
    background: #555a57;
    border-color: #555a57;
    color: #fafbf9;
}

.refresh-full-button:hover {
    background: #3d423f;
    border-color: #3d423f;
}

.refresh-kakao-session {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e5e7e5;
}

.refresh-kakao-session form {
    margin: 0;
}

.refresh-kakao-button {
    width: 100%;
    background: #ffb800;
    border-color: #ffb800;
    color: #1a1a1a;
    font-weight: 700;
}

.refresh-kakao-button:hover {
    background: #e6a600;
    border-color: #e6a600;
}

.refresh-kakao-button:disabled {
    background: #ccc;
    border-color: #ccc;
    color: #888;
    cursor: not-allowed;
}

.refresh-kakao-note {
    margin: 8px 0 0;
    color: #858a87;
    font-size: 12px;
    text-align: center;
}

.refresh-divider {
    height: 1px;
    margin: 16px 0;
    background: #e5e7e5;
}

.refresh-partial-title {
    margin: 0;
    color: #404542;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.refresh-note {
    margin: 6px 0 0;
    color: #858a87;
    font-size: 13px;
}

.refresh-filter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.refresh-row {
    display: flex;
    align-items: center;
    gap: 6px 12px;
}

.refresh-row > label {
    flex: 0 0 100px;
    color: #69706c;
    font-size: 13px;
    font-weight: 600;
}

.refresh-example {
    margin-top: 18px;
    padding: 14px 16px;
    background: #f4f6f4;
    border: 1px solid #e0e4e1;
    border-radius: 1px;
}

.refresh-example-title {
    margin: 0 0 8px;
    color: #6b726e;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.refresh-example-line {
    margin: 3px 0;
    color: #6f766f;
    font-size: 12px;
}

.refresh-example-note {
    margin: 8px 0 0;
    color: #5f665f;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

.refresh-row select,
.refresh-row input[type="number"],
.refresh-row input[type="date"] {
    width: 100%;
    max-width: 260px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d8dcd9;
    border-radius: 1px;
    background: #ffffff;
    color: #4f5652;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.refresh-row select:focus,
.refresh-row input:focus {
    border-color: #b8c0bb;
    box-shadow: 0 0 0 3px rgba(125, 133, 128, 0.08);
}

.refresh-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-range input {
    width: 90px;
    max-width: 90px;
}

.refresh-range-sep {
    color: #8a8f8c;
    font-size: 13px;
}

.refresh-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.refresh-submit {
    background: #555a57;
    border-color: #555a57;
    color: #fafbf9;
}

.refresh-submit:hover {
    background: #3d423f;
    border-color: #3d423f;
}

.refresh-help-toggle {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e5e7e5;
}

.refresh-help-toggle > summary {
    color: #777d7a;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.refresh-help {
    margin-top: 8px;
}

.refresh-help p {
    margin: 4px 0;
    color: #858a87;
    font-size: 12px;
    line-height: 1.6;
}

.refresh-help-item {
    margin: 7px 0 0;
    color: #6f766f;
    font-size: 12px;
    line-height: 1.6;
}

.refresh-help-item b {
    color: #4f5652;
    font-weight: 700;
}

.refresh-help-example {
    margin: 7px 0 0;
    padding: 8px 12px;
    background: #f4f6f4;
    border: 1px solid #e0e4e1;
    border-radius: 1px;
    color: #6f766f;
    font-size: 12px;
    line-height: 1.55;
}


.refresh-result {
    margin-top: 12px;
    padding: 14px 16px;
    background: #fafbf9;
    border: 1px solid #dfe2df;
    border-radius: 1px;
}

.refresh-result-title {
    color: #404542;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.refresh-result-summary {
    margin-top: 6px;
    color: #69706c;
    font-size: 13px;
}

.refresh-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.refresh-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e1e4e1;
    border-radius: 1px;
    background: #eef0ee;
    color: #555a57;
    font-size: 13px;
    font-weight: 600;
}

.refresh-stat.success {
    background: #edf6ea;
    border-color: #d4e7d0;
    color: #5f705a;
}

.refresh-stat.fail {
    background: #faf0f0;
    border-color: #d9bcbc;
    color: #a04d4d;
}

.refresh-failures {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e5e7e5;
}

.refresh-failures > summary {
    color: #a04d4d;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.refresh-failures ul {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.refresh-failures li {
    padding: 4px 0;
    border-bottom: 1px solid #f0f2f0;
    color: #555a57;
    font-size: 13px;
    word-break: break-all;
}

.refresh-result-truncated {
    margin-top: 6px;
    color: #858a87;
    font-size: 12px;
}


@media (max-width: 650px) {

    .refresh-filter {
        padding: 14px;
    }

    .refresh-row select,
    .refresh-row input[type="number"],
    .refresh-row input[type="date"] {
        max-width: 100%;
    }

    .refresh-range {
        flex: 1 1 auto;
        min-width: 0;
    }

    .refresh-range input {
        width: 100%;
        max-width: 100%;
        flex: 1 1 80px;
        min-width: 0;
    }

    .refresh-actions {
        justify-content: stretch;
    }

    .refresh-submit {
        width: 100%;
    }

    .refresh-stats .refresh-stat {
        flex: 1 1 auto;
        justify-content: center;
    }
}


/* =========================================================
   HOME — editorial redesign (2026-09-01)
   A fresh spread: the site name IS the wave. Dominant, staggered
   display type with a purposeful SVG swell, a clean cover insert
   the title bleeds into, and a quiet colophon. No card assembly.
   ========================================================= */


.home {
    --home-ink: #343735;
    --home-bg: #f7f6f3;            /* warm paper */
    background: var(--home-bg);
    color: var(--home-ink);
    font-family: "Pretendard","Pretendard Variable","Noto Sans KR","Apple SD Gothic Neo","Malgun Gothic",system-ui,-apple-system,sans-serif;
    min-height: 100vh;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================================
    TYPING TOOL CARD (preserved — used by /typing only)
   ========================================================= */

.typing-page-main {
    width: min(1000px, calc(100% - 40px));
    margin: 0 auto;
    padding: 12px 0 80px;
}

.typing-page {
    width: 100%;
}

.typing-page-title {
    margin: 0 0 8px;
    color: #343735;
    font-size: clamp(26px, 4vw, 34px);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.04em;
}

.typing-page-description {
    margin: 0;
    color: #858a87;
    font-size: 14px;
}

.typing-row {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: stretch;
}

.typing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-height: 0;
    padding: 12px;
    background: rgba(250, 251, 249, 0.4);
    border: 1px solid #dfe2df;
    border-radius: 1px;
    flex: 1 1 0%;
}

.typing-field-label {
    font-size: 13px;
    font-weight: 600;
    color: #626765;
    flex-shrink: 0;
}

.typing-textarea {
    width: 100%;
    min-width: 0;
    min-height: 180px;
    padding: 12px 14px;
    border: 1px solid #dfe2df;
    border-radius: 1px;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.7;
    color: #343735;
    outline: 0;
    resize: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    overflow-y: auto;
}

.typing-textarea:focus {
    border-color: #bfc5c1;
}

.typing-textarea[readonly] {
    background: transparent;
    color: #555a57;
}

.typing-textarea::placeholder {
    color: #a0a6a2;
}

.typing-field-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    align-self: flex-end;
}

.typing-card--input .typing-field-actions {
    width: 100%;
}

.typing-card--input .typing-direction {
    margin-right: auto;
}

.typing-card--output .typing-field-actions {
    justify-content: flex-end;
}

.typing-copy {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 124px;
    height: 31px;
    padding: 4px 9px;
    border: 1px solid #555a57;
    border-radius: 1px;
    background: #555a57;
    color: #fafbf9;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.typing-copy:hover {
    background: #3d423f;
    border-color: #3d423f;
    color: #fafbf9;
}

.typing-clear {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 31px;
    padding: 0;
    border: 1px solid #dfe2df;
    border-radius: 1px;
    background: rgba(250, 251, 249, 0.4);
    color: #7a817d;
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.typing-clear:hover {
    background: #f1f3f1;
    border-color: #d3d7d4;
    color: #4f5652;
}


.typing-direction {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: rgba(250, 251, 249, 0.4);
    border: 1px solid #dfe2df;
    border-radius: 1px;
}

.typing-dir-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 62px;
    height: 31px;
    padding: 4px 9px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #7a817d;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.typing-dir-btn:hover {
    color: #4f5652;
}

.typing-dir-btn.active {
    background: #fafbf9;
    color: #404542;
    box-shadow: 0 1px 4px rgba(55, 60, 58, 0.08);
}

.typing-dir-btn:active {
    transform: translateY(1px);
}

.typing-hint {
    margin: 18px 0 0;
    font-size: 12px;
    color: #8a8f8c;
    line-height: 1.6;
}


/* =========================================================
   RESPONSIVE — TYPING TOOL (preserved)
   ========================================================= */

@media (max-width: 768px) {
    .typing-page-main {
        width: min(100% - 24px, 1000px);
        padding: 20px 0 60px;
    }

    .typing-page-title {
        font-size: 22px;
    }

    .typing-row {
        flex-direction: column;
        gap: 12px;
    }

    .typing-field-actions {
        width: 100%;
        align-self: stretch;
        padding: 2px;
        gap: 2px;
    }

    .typing-card--input .typing-field-actions .typing-direction {
        flex: 2 1 0;
        justify-content: space-between;
        margin-right: 0;
    }

    .typing-card--input .typing-field-actions .typing-dir-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 4px 6px;
    }

    .typing-card--input .typing-field-actions .typing-clear {
        flex: 0 0 31px;
        width: 31px;
        align-self: auto;
    }

    .typing-card--input .typing-field-actions .typing-copy {
        flex: 3 1 0;
        min-width: 0;
        width: auto;
        align-self: auto;
    }

    .typing-card--output .typing-field-actions .typing-copy {
        flex: 0 0 auto;
        min-width: 62px;
         width: calc((100% - 61px) * 3 / 5 + 20px);
        align-self: auto;
    }
}

@media (max-width: 650px) {
    .typing-page-main {
        padding: 30px 0 50px;
    }

    .typing-page-title {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .typing-page-main {
        padding: 16px 0 50px;
    }

    .typing-textarea {
        min-height: 160px;
        font-size: 14px;
        padding: 12px;
    }

    .typing-dir-btn {
        min-width: 56px;
        padding: 4px 6px;
    }
}

/* =========================================================
   MAIN HERO — NEW DESIGN (main.png + 3 overlay actions)
   ========================================================= */

.main-hero-image {
    position: absolute;
    inset: 0;
    background-image: url("../images/main.png");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
}

.main-overlay-actions {
    position: relative;
    pointer-events: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    width: min(1000px, calc(100% - 40px));
    margin: 0 auto;
    padding: 12px 0;
}

@media (max-width: 650px) {
    .main-overlay-actions {
        width: min(1000px, calc(100% - 24px));
    }
}

/* 홈에서만 main.png 위에 헤더가 겹치도록 하는 modifier */
.home-overlay-actions {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
}

/* 로그인 페이지: 헤더를 문서 흐름에서 분리하여 레이아웃 높이 초과/스크롤 방지 */
.login-page .main-overlay-actions {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.main-overlay-actions > * {
    pointer-events: auto;
}

/* Left group: 아카이브 + 영타 + 검색 */
.main-nav-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
}

/* Common button style */
.main-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.main-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.main-action-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

/* 아카이브 버튼 */
.main-action-btn--archive {
    flex-shrink: 0;
    width: 90px;
}

/* 영타 버튼 */
.main-action-btn--typing {
    flex-shrink: 0;
    width: 90px;
}

/* 메인 버튼 */
.main-action-btn--home {
    flex-shrink: 0;
    width: 90px;
}

/* 관리자 그룹 버튼 (작품등록 / 새로고침 / 로그아웃 / 고나리) */
.main-action-btn--admin {
    flex-shrink: 0;
    width: 90px;
    height: 36px;
    line-height: 36px;
    padding: 0;
    text-align: center;
    font-size: 14px;
}

.main-action-btn--add,
.main-action-btn--refresh,
.main-action-btn--logout,
.main-action-btn--login {
    width: 90px;
}

/* Center: Search form */
.main-search-form {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 0 1 240px;
    min-width: 120px;
    max-width: 240px;
    pointer-events: auto;
}

.main-search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-right: 0;
    border-radius: 1px 0 0 1px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: inherit;
    font-size: 14px;
    color: #fff;
    outline: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.main-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.main-search-input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.8);
}

.main-search-submit {
    flex: 0 0 auto;
    height: 36px;
    width: 38px;
    min-width: 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-left: 0;
    border-radius: 0 1px 1px 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.main-search-submit:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

/* 모바일 검색 버튼: 데스크톱에서는 숨김, 모바일에서 돋보기 링크로 표시 */
.main-action-btn--mobile-search {
    display: none;
}

/* Right: 관리자 group */
.main-action-btn-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* 새로고침 드롭다운 (메인: .home-refresh-dropdown, 기타: .refresh-dropdown) */
.home-refresh-dropdown,
.refresh-dropdown {
    position: fixed;
    top: 64px;
    right: 16px;
    width: 360px;
    max-width: calc(100% - 32px);
    z-index: 100;
    pointer-events: none;
}

.home-refresh-dropdown > .admin-refresh-panel-wrap,
.refresh-dropdown > .admin-refresh-panel-wrap {
    pointer-events: auto;
    padding: 0;
}

.home-refresh-dropdown > .admin-refresh-panel-wrap > .refresh-filter,
.refresh-dropdown > .admin-refresh-panel-wrap > .refresh-filter {
    margin-top: 0;
    margin-bottom: 0;
    border-radius: 1px;
    box-shadow: 0 8px 24px rgba(55, 60, 58, 0.15);
    background: #fafbf9;
    border: 1px solid #dfe2df;
    border-top: none;
}

.home-refresh-dropdown > .admin-refresh-panel-wrap > .refresh-result,
.refresh-dropdown > .admin-refresh-panel-wrap > .refresh-result {
    margin-top: 0;
    margin-bottom: 0;
    border-radius: 1px;
    box-shadow: 0 8px 24px rgba(55, 60, 58, 0.15);
    background: #fafbf9;
    border: 1px solid #dfe2df;
    border-top: none;
}

/* 관리자 새로고침 패널 래퍼 (드롭다운 내부에서 사용) */
.admin-refresh-panel-wrap {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

.admin-refresh-panel-wrap > .refresh-filter {
    margin-top: 8px;
    margin-bottom: 16px;
}

.admin-refresh-panel-wrap > .refresh-result {
    margin-top: 0;
    margin-bottom: 16px;
}

@media (max-width: 650px) {
    .admin-refresh-panel-wrap {
        padding: 0 12px;
    }

    .home-refresh-dropdown,
    .refresh-dropdown {
        top: 56px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }
}

/* =========================================================
   RESPONSIVE — MAIN HERO
   ========================================================= */

@media (max-width: 640px) {
    .main-hero {
        aspect-ratio: 2850 / 5106;
    }

    .main-hero-image {
        overflow: hidden;
        background-image: none;
        background-size: auto;
    }

    .main-hero-image::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: calc(100vw * (5106 / 2850));
        height: 100vw;
        background-image: url("../images/main-mobile.png");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        transform: translate(-50%, -50%) rotate(-90deg);
        transform-origin: center;
    }

    .home-overlay-actions {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        transform: none;
    }

    .main-overlay-actions {
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .main-nav-left {
        flex: 1 1 auto;
        flex-wrap: wrap;
    }

    .main-search-form {
        display: none;
        flex: 1 1 100%;
        max-width: none;
        min-width: 0;
        order: 3;
    }

    .main-action-btn--mobile-search {
        display: inline-flex;
        order: 3;
        flex-shrink: 0;
    }

    .main-action-btn--archive {
        order: 0;
    }

    .main-action-btn--typing {
        order: 1;
    }

    .main-action-btn-group {
        order: 2;
        flex-shrink: 0;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .main-overlay-actions {
        gap: 4px;
        padding: 10px 0;
    }

    .main-action-btn {
        min-height: 32px;
        padding: 4px 8px;
        font-size: 11px;
    }

    .main-action-btn--home,
    .main-action-btn--archive,
    .main-action-btn--typing,
    .main-action-btn--admin {
        width: 72px;
        height: 32px;
    }

    .main-action-btn--mobile-search {
        width: 32px;
        min-width: 32px;
        height: 32px;
        padding: 0;
    }

    .main-search-input,
    .main-search-submit {
        height: 32px;
        font-size: 12px;
        padding: 0 8px;
    }

    .main-search-submit {
        width: 32px;
        min-width: 32px;
        padding: 0;
    }

    .main-action-btn-group {
        gap: 4px;
    }
}

@media (max-width: 375px) {
    .main-hero-image {
        position: absolute;
        inset: 0;
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
    }
}

/* ==================================================
   ?곸꽭 ?곷떒
================================================== */

.novel-detail-card {
    position: relative;
    z-index: 1;
    background: rgba(250, 251, 249, 0.4);
    border: 1px solid #dfe2df;
    border-radius: 1px;
    overflow: hidden;
}


/* ==================================================
   ?뚮옯??
================================================== */

.novel-platform-link {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 28px;

    padding: 5px 10px;

    border: 1px solid #dfe2df;

     border-radius: 1px;

     background: rgba(250, 251, 249, 0.4);

     text-decoration: none;

    font-size: 12px;

    font-weight: 700;

    line-height: 16px;
}


/* ==================================================
   ?뚮옯??대쫫 怨듯넻
================================================== */

.novel-platform-name {

    margin-right: 4px;

    color: #343735;
}


/* ==================================================
   由щ뵒
================================================== */

.novel-platform-link.platform-ridi .novel-platform-name {

    color: #0086ff;
}


/* ==================================================
   移댁뭅?ㅽ럹?댁?
================================================== */



.novel-platform-link.platform-kakao .novel-platform-name {

    color: #F4C100;
}






/* ==================================================
   ?덉뒪24
================================================== */

.novel-platform-link.platform-yes24 .novel-platform-name {

    color: #111111;
}


/* ==================================================
   援먮낫臾멸퀬
================================================== */

.novel-platform-link.platform-kyobo .novel-platform-name {

    color: #073b7a;

    background-image:
        linear-gradient(
            135deg,
            #073b7a 0%,
            #0b4f9c 100%
        );

    -webkit-background-clip: text;

    background-clip: text;

    -webkit-text-fill-color: transparent;
}


/* ==================================================
   ?뚮씪??
================================================== */

.novel-platform-link.platform-aladin .novel-platform-name {

    color: #8a2f72;

    background-image:
        linear-gradient(
            135deg,
            #8a2f72 0%,
            #a43b8c 50%,
            #c052a8 100%
        );

    -webkit-background-clip: text;

    background-clip: text;

    -webkit-text-fill-color: transparent;
}


/* ==================================================
   ?뚮옯??붿궡??
================================================== */

.novel-platform-arrow {
    color: #9a9f9c;

    font-size: 11px;

    line-height: 1;
}


/* ==================================================
   紐⑤컮??
================================================== */

@media (max-width: 650px) {

    .novel-detail-meta {
        margin-left: 0;
        overflow-wrap: anywhere;
    }


    .novel-detail-meta::before {
        position: static;
        display: inline-block;
        margin: 0 1px;
        vertical-align: middle;
        transform: none;
        pointer-events: none;
    }



    .novel-platform-link {
        min-height: 26px;

        padding: 4px 8px;

        font-size: 11px;

        line-height: 15px;
    }


}


/* ==================================================
   ?꾩＜ 醫곸? ?붾㈃
================================================== */

@media (max-width: 560px) {

    .novel-header {
        gap: 20px;
    }


    .novel-basic {
        min-height: 0;

        text-align: left;
    }


    .novel-author-row {
        width: 100%;
    }


}
