@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800;900&family=Noto+Serif+KR:wght@500;600;700;800&display=swap');

/* portfolio / lab */

.portfolio_wrap {
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    min-height: 100vh;
}

.portfolio_header,
.portfolio_footer {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.portfolio_header {
    border-bottom: 1px solid var(--line-soft);
}

.portfolio_brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.portfolio_brand span {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #17120c;
    font-family: var(--font-serif);
    font-weight: 800;
}

.portfolio_nav {
    display: flex;
    align-items: center;
    gap: 26px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.portfolio_nav a:hover,
.portfolio_nav a[aria-current="page"] {
    color: var(--ink-strong);
}

.portfolio_hero {
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
    gap: 70px;
    align-items: center;
    padding: 90px 0;
}

.portfolio_hero h1,
.lab_intro h1 {
    margin: 0;
    font-family: var(--font-serif);
    color: var(--ink-strong);
    font-size: clamp(48px, 7vw, 86px);
    line-height: 1.14;
    letter-spacing: -.075em;
}

.portfolio_intro,
.lab_intro > p:last-child {
    max-width: 660px;
    margin: 30px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.9;
}

.portfolio_actions {
    display: flex;
    gap: 10px;
    margin-top: 38px;
}

.portfolio_note {
    min-height: 310px;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 4px 40px 4px 4px;
    background: linear-gradient(145deg, rgba(35, 40, 51, .9), rgba(25, 29, 37, .65));
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.portfolio_note span,
.portfolio_card > span {
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .18em;
}

.portfolio_note strong {
    margin-top: 10px;
    font-family: var(--font-serif);
    font-size: 23px;
}

.portfolio_note p,
.portfolio_card p,
.lab_card p {
    color: var(--muted);
    line-height: 1.75;
}

.portfolio_section {
    padding: 100px 0 120px;
    border-top: 1px solid var(--line-soft);
}

.portfolio_section_head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 40px;
    margin-bottom: 42px;
}

.portfolio_section_head h2,
.lab_card h2 {
    margin: 0;
    font-family: var(--font-serif);
    color: var(--ink-strong);
    font-size: 36px;
}

.portfolio_section_head > p {
    max-width: 430px;
    color: var(--muted);
    line-height: 1.7;
}

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

.portfolio_card {
    min-height: 310px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(28, 32, 40, .72);
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.portfolio_card:hover,
.lab_card:hover {
    transform: translateY(-4px);
    border-color: rgba(197, 164, 109, .55);
    background: rgba(35, 40, 51, .92);
}

.portfolio_card h3 {
    margin: 28px 0 0;
    font-family: var(--font-serif);
    font-size: 28px;
    color: var(--ink-strong);
}

.portfolio_card em {
    margin-top: auto;
    color: var(--ink-strong);
    font-style: normal;
    font-weight: 800;
}

.portfolio_card.featured {
    background: linear-gradient(145deg, rgba(64, 53, 39, .78), rgba(28, 32, 40, .92));
}

.portfolio_footer {
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 13px;
}

.portfolio_footer a:hover {
    color: var(--ink-strong);
}

.lab_main {
    padding: 100px 0 120px;
}

.lab_intro {
    max-width: 820px;
    margin-bottom: 80px;
}

.lab_grid {
    display: grid;
    gap: 18px;
}

.lab_card {
    min-height: 230px;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(28, 32, 40, .72);
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    align-items: center;
    gap: 30px;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.lab_number {
    color: var(--muted-2);
    font-family: var(--font-serif);
    font-size: 34px;
}

.lab_card strong {
    color: var(--accent);
    white-space: nowrap;
}

@media (max-width: 850px) {
    .portfolio_hero {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .portfolio_note {
        min-height: 220px;
    }

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

    .lab_card {
        grid-template-columns: 50px minmax(0, 1fr);
    }

    .lab_card > strong {
        grid-column: 2;
    }
}

@media (max-width: 600px) {
    .portfolio_wrap {
        width: min(100% - 28px, 1240px);
    }

    .portfolio_header {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px 0;
    }

    .portfolio_nav {
        width: 100%;
        gap: 0;
        justify-content: space-between;
    }

    .portfolio_hero,
    .lab_main {
        padding: 70px 0;
    }

    .portfolio_hero {
        min-height: auto;
    }

    .portfolio_hero h1,
    .lab_intro h1 {
        font-size: 45px;
    }

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

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

    .lab_card {
        padding: 26px;
        grid-template-columns: 1fr;
    }

    .lab_card > strong {
        grid-column: 1;
    }
}

:root {
    --font-body: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
    --font-serif: "Noto Serif KR", serif;

    --bg: #111318;
    --bg-soft: #171a21;
    --panel: #1c2028;
    --panel-2: #232833;
    --paper: #191d25;

    --ink: #e8e3d8;
    --ink-strong: #f5efe3;
    --muted: #9b958b;
    --muted-2: #706b63;

    --line: #2d3340;
    --line-soft: #262b35;

    --accent: #c5a46d;
    --accent-dark: #9f7e48;
    --brown: #33271e;

    --danger-bg: #2a1818;
    --danger-line: #6f3630;
    --danger: #e28b7d;

    --green-bg: #17251b;
    --green-line: #315c3d;
    --green: #86c28c;

    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    --shadow-soft: 0 16px 48px rgba(0, 0, 0, 0.26);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    font-family: var(--font-body);
    background:
        radial-gradient(circle at 20% 0%, rgba(197, 164, 109, 0.08), transparent 28%),
        radial-gradient(circle at 85% 15%, rgba(83, 96, 122, 0.12), transparent 30%),
        var(--bg);
    color: var(--ink);
    letter-spacing: -0.035em;
}

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

img {
    max-width: 100%;
}

input,
select,
textarea,
button {
    font-family: inherit;
}

button {
    cursor: pointer;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #151922;
    color: var(--ink);
    border-radius: 12px;
    padding: 14px 15px;
    font-size: 15px;
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: #6f746f;
}

textarea {
    resize: vertical;
    line-height: 1.75;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(197, 164, 109, 0.8);
    box-shadow: 0 0 0 3px rgba(197, 164, 109, 0.08);
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 13px) calc(50% - 3px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.auth_head h1,
.simple_card h1,
.page_head h1,
.project_info h1,
.chapter_title_input,
.book_noimage strong,
.cover_preview strong,
.hero_text h1,
.book_cover strong {
    font-family: var(--font-serif);
}

/* common buttons */

.btn_primary,
.btn_line,
.btn_danger {
    min-height: 44px;
    padding: 0 19px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    border: 0;
    transition:
        background .18s ease,
        border-color .18s ease,
        color .18s ease,
        transform .18s ease;
}

.btn_primary {
    background: var(--accent);
    color: #17120c;
}

.btn_primary:hover {
    background: #d3b77f;
    transform: translateY(-1px);
}

.btn_line {
    border: 1px solid var(--line);
    color: var(--ink);
    background: rgba(28, 32, 40, 0.78);
}

.btn_line:hover {
    border-color: rgba(197, 164, 109, 0.65);
    color: var(--ink-strong);
    background: rgba(35, 40, 51, 0.95);
}

.btn_danger {
    border: 1px solid var(--danger-line);
    background: var(--danger-bg);
    color: var(--danger);
}

.btn_danger:hover {
    background: #351c1b;
}

.full {
    width: 100%;
}

/* simple / auth */

.simple_page,
.auth_wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.simple_card,
.auth_card {
    width: 100%;
    max-width: 460px;
    background: rgba(28, 32, 40, 0.92);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 36px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.auth_head h1,
.simple_card h1 {
    margin: 0;
    font-size: 34px;
    color: var(--ink-strong);
    letter-spacing: -0.07em;
}

.auth_head p,
.simple_card p {
    color: var(--muted);
    line-height: 1.7;
}

.eyebrow {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.22em;
    color: var(--accent);
}

.auth_form,
.form_card {
    display: grid;
    gap: 17px;
}

.auth_form label,
.form_card label,
.file_label {
    display: grid;
    gap: 8px;
}

.auth_form span,
.form_card span,
.file_label span {
    font-size: 13px;
    font-weight: 800;
    color: var(--muted);
}

.auth_bottom {
    margin-top: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

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

.error_box {
    margin: 18px 0;
    padding: 13px 15px;
    border-radius: 13px;
    background: var(--danger-bg);
    border: 1px solid var(--danger-line);
    color: var(--danger);
    font-size: 14px;
    font-weight: 800;
}

/* landing */

.landing_wrap {
    min-height: 100vh;
    padding: 30px;
}

.landing_header {
    max-width: 1180px;
    margin: 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing_nav {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
    font-size: 14px;
}

.landing_nav a:hover {
    color: var(--ink-strong);
}

.nav_btn {
    padding: 9px 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(28, 32, 40, 0.74);
}

.landing_main {
    max-width: 1180px;
    margin: 0 auto;
}

.hero_section {
    min-height: calc(100vh - 124px);
    display: grid;
    grid-template-columns: 1.12fr 0.88fr;
    align-items: center;
    gap: 74px;
}

.hero_text h1 {
    margin: 0;
    font-size: 62px;
    line-height: 1.16;
    letter-spacing: -0.075em;
    color: var(--ink-strong);
}

.hero_desc {
    margin: 26px 0 0;
    font-size: 17px;
    line-height: 1.8;
    color: var(--muted);
}

.hero_actions {
    margin-top: 34px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.hero_actions form {
    margin: 0;
}

.hero_book {
    display: flex;
    justify-content: center;
}

.book_cover {
    width: 330px;
    aspect-ratio: 3 / 4.25;
    padding: 34px;
    border-radius: 16px 24px 24px 16px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.08), rgba(0,0,0,0.22)),
        #2c241f;
    color: var(--ink-strong);
    box-shadow:
        var(--shadow),
        inset 12px 0 0 rgba(0,0,0,0.22);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.book_label {
    font-size: 11px;
    letter-spacing: 0.22em;
    color: rgba(232, 227, 216, 0.58);
}

.book_cover strong {
    font-size: 31px;
    line-height: 1.35;
    letter-spacing: -0.06em;
}

.book_cover em {
    font-style: normal;
    color: rgba(232, 227, 216, 0.58);
    font-size: 14px;
}

/* app layout */

.app_wrap {
    min-height: 100vh;
}

.topbar {
    height: 72px;
    padding: 0 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(17, 19, 24, 0.88);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand_mark {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #252015;
    color: var(--accent);
    border: 1px solid rgba(197, 164, 109, 0.34);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 800;
}

.brand_name {
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--ink-strong);
}

.topnav {
    display: flex;
    align-items: center;
    gap: 17px;
    font-size: 14px;
    color: var(--muted);
}

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

.library_page,
.form_page,
.project_view {
    max-width: 1180px;
    margin: 0 auto;
    padding: 50px 32px 80px;
}

.page_head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
}

.page_head h1 {
    margin: 0;
    font-size: 44px;
    letter-spacing: -0.075em;
    color: var(--ink-strong);
}

.page_head p {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.7;
}

.empty_box {
    padding: 64px 30px;
    text-align: center;
    border: 1px dashed #39404e;
    border-radius: 24px;
    background: rgba(28, 32, 40, 0.52);
}

.empty_box h2 {
    color: var(--ink-strong);
    margin-top: 0;
}

.empty_box p {
    color: var(--muted);
}

.empty_box.small {
    padding: 32px;
}

/* book grid */

.book_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
    gap: 28px;
}

.book_card {
    display: block;
}

.book_thumb {
    aspect-ratio: 3 / 4.2;
    border-radius: 15px 23px 23px 15px;
    overflow: hidden;
    background: #2c241f;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255,255,255,0.04);
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

.book_card:hover .book_thumb {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: rgba(197, 164, 109, 0.28);
}

.book_thumb img,
.project_cover img,
.cover_preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book_noimage {
    width: 100%;
    height: 100%;
    padding: 25px;
    color: var(--ink-strong);
    background:
        linear-gradient(135deg, rgba(255,255,255,0.07), rgba(0,0,0,0.22)),
        #2d261f;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset 10px 0 0 rgba(0,0,0,0.22);
}

.book_noimage span {
    font-size: 10px;
    letter-spacing: 0.22em;
    color: rgba(232, 227, 216, 0.54);
}

.book_noimage strong {
    font-size: 24px;
    line-height: 1.35;
    letter-spacing: -0.06em;
}

.book_noimage.large strong {
    font-size: 28px;
}

.book_info {
    padding: 17px 4px 0;
}

.book_info h2 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--ink-strong);
    letter-spacing: -0.045em;
}

.book_info p,
.book_info small {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

/* forms */

.book_form {
    display: grid;
    grid-template-columns: 330px 1fr;
    gap: 40px;
    align-items: start;
}

.cover_panel {
    display: grid;
    gap: 17px;
}

.cover_preview {
    aspect-ratio: 3 / 4.25;
    border-radius: 16px 24px 24px 16px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.07), rgba(0,0,0,0.24)),
        #2c241f;
    color: var(--ink-strong);
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow:
        inset 12px 0 0 rgba(0,0,0,0.24),
        var(--shadow-soft);
    border: 1px solid rgba(255,255,255,0.04);
    overflow: hidden;
}

.cover_preview strong {
    font-size: 29px;
    letter-spacing: -0.06em;
}

.form_card {
    background: rgba(28, 32, 40, 0.86);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 18px 56px rgba(0, 0, 0, 0.18);
}

.form_actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* project view */

.project_hero {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 48px;
    align-items: center;
    margin-bottom: 58px;
}

.project_cover {
    aspect-ratio: 3 / 4.2;
    border-radius: 16px 24px 24px 16px;
    overflow: hidden;
    background: #2c241f;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.05);
}

.project_info h1 {
    margin: 0;
    font-size: 50px;
    letter-spacing: -0.08em;
    color: var(--ink-strong);
}

.meta_line {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta_line span {
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(28, 32, 40, 0.9);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.summary {
    margin-top: 26px;
    color: var(--muted);
    line-height: 1.85;
    max-width: 720px;
}

.section_head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section_head h2 {
    margin: 0;
    color: var(--ink-strong);
    font-size: 23px;
    letter-spacing: -0.05em;
}

.chapter_list {
    display: grid;
    gap: 10px;
}

.chapter_row {
    display: grid;
    grid-template-columns: 1fr 70px;
    gap: 10px;
    align-items: stretch;
}

.chapter_item {
    display: grid;
    grid-template-columns: 70px 1fr 110px 90px;
    gap: 14px;
    align-items: center;
    padding: 17px 19px;
    background: rgba(28, 32, 40, 0.86);
    border: 1px solid var(--line);
    border-radius: 16px;
    transition:
        border-color .18s ease,
        background .18s ease,
        transform .18s ease;
}

.chapter_item:hover {
    border-color: rgba(197, 164, 109, 0.38);
    background: rgba(35, 40, 51, 0.92);
    transform: translateY(-1px);
}

.chapter_item strong {
    color: var(--accent);
}

.chapter_item span {
    color: var(--ink);
}

.chapter_item em {
    font-style: normal;
    color: var(--muted);
    font-size: 13px;
}

.chapter_item small {
    color: var(--muted);
    text-align: right;
}

.chapter_delete_btn {
    width: 70px;
    border: 1px solid var(--danger-line);
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.chapter_delete_btn:hover {
    background: #351c1b;
}

/* write editor */

.write_layout {
    min-height: 100vh;
    padding-bottom: 88px;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px),
        var(--bg);
    background-size: 80px 80px;
}

.write_top {
    height: 78px;
    padding: 0 34px;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(17, 19, 24, 0.92);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
}

.write_top h1 {
    margin: 4px 0 0;
    font-size: 23px;
    color: var(--ink-strong);
}

.back_link {
    font-size: 13px;
    color: var(--muted);
}

.back_link:hover {
    color: var(--accent);
}

.write_meta {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-weight: 800;
    font-size: 13px;
}

#autoSaveStatus {
    min-width: 120px;
    text-align: right;
}

#autoSaveStatus.is_waiting {
    color: var(--muted);
}

#autoSaveStatus.is_saving {
    color: var(--accent);
}

#autoSaveStatus.is_saved {
    color: var(--green);
}

#autoSaveStatus.is_error {
    color: var(--danger);
}

.chapter_form {
    max-width: 920px;
    margin: 0 auto;
    padding: 36px 24px;
}

.chapter_head_inputs {
    display: grid;
    grid-template-columns: 140px 180px;
    gap: 12px;
    margin-bottom: 18px;
}

.chapter_head_inputs label {
    display: grid;
    gap: 8px;
}

.chapter_head_inputs span {
    font-size: 13px;
    color: var(--muted);
    font-weight: 800;
}

.chapter_title_input {
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 18px 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.075em;
    color: var(--ink-strong);
    border: 1px solid #3c3c3c;
    box-shadow: none;
    background-color: #25252600;
}

.chapter_title_input:focus {
    box-shadow: none;
}

.chapter_editor {
    min-height: 62vh;
    border: 1px solid var(--line);
    background: #171b23;
    border-radius: 20px;
    padding: 34px;
    font-size: 18px;
    line-height: 2;
    color: var(--ink);
    box-shadow: var(--shadow-soft);
}

.chapter_editor:focus {
    border-color: rgba(197, 164, 109, 0.48);
}

.fixed_savebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 74px;
    background: rgba(17, 19, 24, 0.92);
    border-top: 1px solid var(--line-soft);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 30;
}

/* trash */

.trash_section {
    margin-top: 44px;
}

.count_badge {
    min-width: 42px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(28, 32, 40, 0.88);
    border: 1px solid var(--line);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
}

.trash_list {
    display: grid;
    gap: 10px;
}

.trash_item {
    display: grid;
    grid-template-columns: 1fr 86px;
    gap: 12px;
    align-items: center;
    padding: 18px 20px;
    background: rgba(28, 32, 40, 0.86);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.trash_main strong {
    display: block;
    color: var(--ink-strong);
    font-size: 16px;
    letter-spacing: -0.04em;
}

.trash_main p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.trash_item form {
    margin: 0;
}

.btn_restore {
    width: 86px;
    min-height: 42px;
    border-radius: 999px;
    border: 1px solid var(--green-line);
    background: var(--green-bg);
    color: var(--green);
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.btn_restore:hover {
    background: #1c3022;
}

/* utility */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #111318;
}

::-webkit-scrollbar-thumb {
    background: #2f3541;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #454c5a;
}

.note_form {
    max-width: 820px;
}

.note_section {
    margin-top: 58px;
}

.note_quick_actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.note_quick_actions .btn_line {
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
}

.note_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.note_card {
    background: rgba(28, 32, 40, 0.86);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    transition:
        border-color .18s ease,
        transform .18s ease,
        background .18s ease;
}

.note_card:hover {
    border-color: rgba(197, 164, 109, 0.38);
    background: rgba(35, 40, 51, 0.94);
    transform: translateY(-2px);
}

.note_card_body {
    display: block;
    min-height: 190px;
    padding: 20px;
}

.note_type {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    background: rgba(197, 164, 109, 0.12);
    color: var(--accent);
    border: 1px solid rgba(197, 164, 109, 0.2);
}

.note_type_character {
    background: rgba(111, 139, 191, 0.13);
    color: #9fb6e8;
    border-color: rgba(111, 139, 191, 0.24);
}

.note_type_world {
    background: rgba(134, 194, 140, 0.12);
    color: #86c28c;
    border-color: rgba(134, 194, 140, 0.22);
}

.note_type_plot {
    background: rgba(197, 164, 109, 0.12);
    color: var(--accent);
    border-color: rgba(197, 164, 109, 0.22);
}

.note_type_foreshadow {
    background: rgba(184, 122, 213, 0.12);
    color: #c99be3;
    border-color: rgba(184, 122, 213, 0.22);
}

.note_type_memo {
    background: rgba(155, 149, 139, 0.12);
    color: var(--muted);
    border-color: rgba(155, 149, 139, 0.22);
}

.note_card h3 {
    margin: 16px 0 10px;
    color: var(--ink-strong);
    font-size: 18px;
    letter-spacing: -0.05em;
}

.note_card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.75;
}

.note_card form {
    margin: 0;
    padding: 0 14px 14px;
}

.note_delete_btn {
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--danger-line);
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.note_delete_btn:hover {
    background: #351c1b;
}


.admin_stat_grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 46px;
}

.admin_stat_card {
    background: rgba(28, 32, 40, 0.86);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--shadow-soft);
}

.admin_stat_card span {
    display: block;
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.18em;
}

.admin_stat_card strong {
    display: block;
    margin-top: 12px;
    color: var(--ink-strong);
    font-size: 34px;
    letter-spacing: -0.06em;
}

.admin_stat_card p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.admin_section {
    margin-top: 42px;
}

.admin_filter {
    display: grid;
    grid-template-columns: 1fr 170px auto auto;
    gap: 10px;
    margin-bottom: 18px;
    align-items: center;
}

.admin_table_wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(28, 32, 40, 0.74);
}

.admin_table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.admin_table th,
.admin_table td {
    padding: 14px 15px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    font-size: 14px;
    white-space: nowrap;
}

.admin_table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    background: rgba(17, 19, 24, 0.5);
}

.admin_table td {
    color: var(--ink);
}

.admin_table tr:last-child td {
    border-bottom: 0;
}

.admin_badge,
.status_pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.admin_badge {
    background: rgba(197, 164, 109, 0.12);
    border: 1px solid rgba(197, 164, 109, 0.24);
    color: var(--accent);
}

.status_active {
    background: var(--green-bg);
    border: 1px solid var(--green-line);
    color: var(--green);
}

.status_pending {
    background: rgba(197, 164, 109, 0.12);
    border: 1px solid rgba(197, 164, 109, 0.24);
    color: var(--accent);
}

.status_blocked {
    background: var(--danger-bg);
    border: 1px solid var(--danger-line);
    color: var(--danger);
}

.inline_form {
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 0;
}

.inline_form select {
    width: 96px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 13px;
}

.small_btn {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(197, 164, 109, 0.32);
    background: rgba(197, 164, 109, 0.12);
    color: var(--accent);
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.small_btn:hover {
    background: rgba(197, 164, 109, 0.2);
}

.muted_text {
    color: var(--muted);
    font-size: 13px;
}



/* responsive */

@media (max-width: 900px) {
    .landing_wrap {
        padding: 20px;
    }

    .hero_section {
        grid-template-columns: 1fr;
        gap: 48px;
        padding: 64px 0;
    }

    .hero_text h1 {
        font-size: 42px;
    }

    .hero_desc {
        font-size: 16px;
    }

    .hero_book {
        justify-content: flex-start;
    }

    .book_cover {
        width: 260px;
    }
    .admin_stat_grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 800px) {

    .note_quick_actions {
        width: 100%;
    }

    .note_quick_actions .btn_line {
        flex: 1;
    }

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


    .topbar {
        height: auto;
        min-height: 68px;
        padding: 14px 18px;
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }

    .topnav {
        flex-wrap: wrap;
        gap: 12px;
    }

    .library_page,
    .form_page,
    .project_view {
        padding: 36px 18px 70px;
    }

    .page_head {
        display: grid;
        align-items: start;
    }

    .page_head h1 {
        font-size: 36px;
    }

    .book_form,
    .project_hero {
        grid-template-columns: 1fr;
    }

    .cover_panel,
    .project_cover {
        max-width: 280px;
    }

    .project_info h1 {
        font-size: 40px;
    }

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

    .chapter_delete_btn {
        width: 100%;
        min-height: 40px;
    }

    .chapter_item {
        grid-template-columns: 56px 1fr;
    }

    .chapter_item em,
    .chapter_item small {
        display: none;
    }

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

    .chapter_title_input {
        font-size: 30px;
    }

    .write_top {
        height: auto;
        min-height: 78px;
        padding: 16px 20px;
        gap: 10px;
        align-items: flex-start;
        flex-direction: column;
    }

    .write_meta {
        width: 100%;
        justify-content: space-between;
    }

    .chapter_form {
        padding: 28px 18px;
    }

    .chapter_editor {
        padding: 24px;
        font-size: 16px;
    }

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

    .btn_restore {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .admin_stat_grid {
        grid-template-columns: 1fr;
    }
}
