:root {
    color-scheme: light;
    --bg: #f3f2ee;
    --surface: #fbfaf7;
    --surface-strong: #ffffff;
    --text: #171916;
    --muted: #73766f;
    --line: rgba(23, 25, 22, 0.14);
    --line-strong: rgba(23, 25, 22, 0.28);
    --accent: #19d760;
    --accent-dark: #0b9f42;
    --accent-soft: rgba(25, 215, 96, 0.12);
    --private: #7669f5;
    --private-soft: rgba(118, 105, 245, 0.1);
    --shadow: 0 24px 70px rgba(35, 38, 32, 0.08);
    --font: "Pretendard Variable", Pretendard, SUIT, "Noto Sans KR", sans-serif;
}

:root.dark {
    color-scheme: dark;
    --bg: #10120f;
    --surface: #161915;
    --surface-strong: #1c201b;
    --text: #eef1eb;
    --muted: #989d94;
    --line: rgba(238, 241, 235, 0.12);
    --line-strong: rgba(238, 241, 235, 0.26);
    --accent: #20df68;
    --accent-dark: #18bd57;
    --accent-soft: rgba(32, 223, 104, 0.11);
    --private: #9a91ff;
    --private-soft: rgba(154, 145, 255, 0.11);
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 80% 5%, var(--accent-soft), transparent 29rem),
        radial-gradient(circle at 8% 38%, var(--private-soft), transparent 32rem),
        var(--bg);
    font-family: var(--font);
    font-synthesis: none;
    letter-spacing: -0.02em;
}

button,
input,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.page-grid {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    opacity: 0.48;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.pointer-light {
    position: fixed;
    left: 0;
    top: 0;
    z-index: -1;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.4;
    background: radial-gradient(circle, var(--accent-soft), transparent 66%);
    transform: translate3d(calc(var(--pointer-x, 50vw) - 50%), calc(var(--pointer-y, 30vh) - 50%), 0);
    transition: opacity 220ms ease;
}

.qna-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    padding: 0 clamp(18px, 4vw, 58px);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(18px);
}

.qna-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    text-decoration: none;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.qna-brand i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-soft);
}

.qna-header nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiet-button,
.theme-button,
.refresh-button,
.receipt-close,
.receipt-code-row button,
.admin-heading button {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.quiet-button,
.refresh-button,
.receipt-close,
.receipt-code-row button,
.admin-heading button {
    padding: 0 15px;
    font-size: 11px;
    font-weight: 800;
}

.quiet-button:hover,
.theme-button:hover,
.refresh-button:hover,
.receipt-close:hover,
.receipt-code-row button:hover,
.admin-heading button:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.theme-button {
    display: grid;
    width: 38px;
    padding: 0;
    place-items: center;
}

.theme-button span {
    width: 12px;
    height: 12px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    box-shadow: -4px 0 0 -2px var(--surface), -6px 0 0 -2px currentColor;
}

.qna-shell {
    width: min(1280px, calc(100% - 36px));
    margin: 0 auto;
}

.qna-hero {
    position: relative;
    min-height: clamp(360px, 62vh, 620px);
    padding: clamp(80px, 13vh, 150px) clamp(4px, 5vw, 70px) 48px;
    border-bottom: 1px solid var(--line-strong);
}

.qna-hero > p,
.section-label p,
.admin-heading > div > p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.13em;
}

.qna-hero h1 {
    margin: 14px 0 0;
    font-size: clamp(64px, 12vw, 164px);
    line-height: 0.86;
    letter-spacing: -0.09em;
}

.qna-hero h1::after {
    content: "";
    display: inline-block;
    width: clamp(14px, 2vw, 28px);
    height: clamp(14px, 2vw, 28px);
    margin-left: 16px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 58%, transparent);
}

.qna-hero-index {
    position: absolute;
    top: 34px;
    right: 0;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.15em;
    writing-mode: vertical-rl;
}

.qna-hero-bottom {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-top: clamp(54px, 9vh, 90px);
}

.qna-hero-bottom span {
    color: var(--muted);
    font-size: clamp(14px, 1.7vw, 20px);
}

.qna-hero-bottom a {
    padding-bottom: 5px;
    border-bottom: 1px solid currentColor;
    color: var(--text);
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}

.question-studio,
.public-board,
.secret-desk,
.admin-desk {
    padding: clamp(64px, 9vw, 112px) 0;
    border-bottom: 1px solid var(--line-strong);
}

.section-label {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 26px;
}

.section-label span {
    display: grid;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    place-items: center;
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
}

.question-form {
    padding: clamp(24px, 4vw, 52px);
    border: 1px solid var(--line);
    border-radius: 32px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: var(--shadow);
}

.form-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 22px;
}

.form-heading small,
.field-label,
.secret-copy form label,
.admin-dialog label {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
}

.form-heading h2 {
    margin: 8px 0 0;
    font-size: clamp(28px, 4vw, 54px);
    line-height: 1;
    letter-spacing: -0.06em;
}

.visibility-switch {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    min-width: min(100%, 280px);
    padding: 4px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
}

.visibility-switch label {
    cursor: pointer;
}

.visibility-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.visibility-switch span {
    display: grid;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    place-items: center;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.visibility-switch input:checked + span {
    color: #0d120e;
    background: var(--accent);
}

.visibility-switch label:last-child input:checked + span {
    color: #fff;
    background: var(--private);
}

.privacy-note {
    padding: 13px 16px;
    margin-bottom: 28px;
    border-left: 3px solid var(--accent);
    color: var(--muted);
    background: var(--accent-soft);
    font-size: 12px;
    line-height: 1.6;
}

.privacy-note.is-private {
    border-color: var(--private);
    background: var(--private-soft);
}

.field-label {
    margin: 18px 0 9px;
}

.field-label span {
    margin-left: 5px;
    font-weight: 600;
}

.question-form input[type="text"],
.question-form textarea,
.secret-copy input,
.admin-dialog input,
.admin-card textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 17px;
    color: var(--text);
    background: var(--surface-strong);
    outline: none;
}

.question-form input[type="text"] {
    min-height: 48px;
    padding: 0 15px;
}

.textarea-wrap {
    position: relative;
}

.question-form textarea {
    min-height: 190px;
    padding: 18px 18px 42px;
    resize: vertical;
    font-size: 15px;
    line-height: 1.75;
}

.textarea-wrap > span {
    position: absolute;
    right: 14px;
    bottom: 13px;
    color: var(--muted);
    font-size: 10px;
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
}

.form-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

.send-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 174px;
    min-height: 52px;
    padding: 0 8px 0 20px;
    border: 0;
    border-radius: 999px;
    color: #0d120e;
    background: var(--accent);
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.send-button i {
    display: grid;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    place-items: center;
    background: rgba(255, 255, 255, 0.76);
    font-style: normal;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 38px color-mix(in srgb, var(--accent) 28%, transparent);
}

.send-button:disabled {
    cursor: wait;
    opacity: 0.55;
    transform: none;
}

.private-receipt {
    position: relative;
    padding: clamp(28px, 5vw, 58px);
    margin: 42px 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--private) 45%, var(--line));
    border-radius: 28px;
    background:
        radial-gradient(circle at 100% 0, var(--private-soft), transparent 42%),
        var(--surface);
    box-shadow: var(--shadow);
}

.private-receipt[hidden] {
    display: none;
}

.receipt-mark {
    position: absolute;
    top: 20px;
    right: -28px;
    padding: 8px 34px;
    color: white;
    background: var(--private);
    transform: rotate(28deg);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.private-receipt p {
    margin: 0 0 7px;
    color: var(--private);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.private-receipt h2 {
    margin: 0 0 10px;
    font-size: clamp(24px, 3.6vw, 42px);
    letter-spacing: -0.055em;
}

.private-receipt > div > span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.receipt-code-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 28px 0 18px;
}

.receipt-code-row code {
    min-width: 0;
    flex: 1;
    padding: 18px;
    overflow-wrap: anywhere;
    border: 1px dashed color-mix(in srgb, var(--private) 55%, var(--line));
    border-radius: 14px;
    color: var(--text);
    background: var(--private-soft);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 750;
}

.board-heading,
.admin-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.board-heading h2,
.secret-copy h2,
.admin-heading h2 {
    margin: 0;
    font-size: clamp(34px, 5vw, 70px);
    line-height: 0.95;
    letter-spacing: -0.065em;
}

.board-heading p,
.secret-copy > p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.board-heading > div:last-child {
    display: flex;
    align-items: center;
    gap: 12px;
}

.board-heading > div:last-child span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.question-list,
.private-list,
.admin-list {
    display: grid;
    gap: 14px;
}

.question-card,
.private-card,
.admin-card,
.empty-state {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.question-card,
.private-card,
.admin-card {
    padding: clamp(19px, 3vw, 30px);
    transition: transform 180ms ease, border-color 180ms ease;
}

.question-card:hover,
.private-card:hover {
    border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
    transform: translateY(-2px);
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.card-meta > span:first-child {
    color: var(--text);
}

.question-card > p,
.private-card > p,
.admin-card > p {
    margin: 18px 0;
    font-size: 15px;
    line-height: 1.78;
    white-space: pre-wrap;
}

.answer-block {
    position: relative;
    padding: 18px 18px 18px 22px;
    border-left: 2px solid var(--accent);
    border-radius: 0 15px 15px 0;
    background: var(--accent-soft);
}

.answer-block.is-waiting {
    border-color: var(--line-strong);
    background: color-mix(in srgb, var(--surface-strong) 74%, transparent);
}

.answer-block span {
    display: block;
    margin-bottom: 7px;
    color: var(--accent-dark);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: 0.12em;
}

.answer-block.is-waiting span {
    color: var(--muted);
}

.answer-block p {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.75;
    white-space: pre-wrap;
}

.answer-block.is-waiting p {
    color: var(--muted);
}

.empty-state {
    padding: 36px 22px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
    line-height: 1.7;
}

.secret-desk-layout {
    display: grid;
    grid-template-columns: minmax(270px, 0.72fr) minmax(0, 1.28fr);
    gap: clamp(24px, 5vw, 68px);
}

.secret-copy {
    align-self: start;
}

.key-symbol {
    position: relative;
    display: block;
    width: 42px;
    height: 42px;
    margin-bottom: 28px;
    border: 1px solid var(--private);
    border-radius: 50%;
}

.key-symbol::before {
    content: "";
    position: absolute;
    top: 19px;
    left: 38px;
    width: 32px;
    height: 1px;
    background: var(--private);
}

.key-symbol::after {
    content: "";
    position: absolute;
    top: 19px;
    left: 62px;
    width: 8px;
    height: 9px;
    border-right: 1px solid var(--private);
    border-bottom: 1px solid var(--private);
}

.secret-copy form {
    padding-top: 28px;
    margin-top: 28px;
    border-top: 1px solid var(--line);
}

.secret-copy form > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 9px;
}

.secret-copy input {
    min-height: 46px;
    padding: 0 14px;
    font-size: 11px;
}

.secret-copy form button {
    min-width: 72px;
    border: 0;
    border-radius: 14px;
    color: white;
    background: var(--private);
    cursor: pointer;
    font-size: 11px;
    font-weight: 850;
}

.secret-copy form > p {
    min-height: 1.4em;
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.private-card {
    border-color: color-mix(in srgb, var(--private) 28%, var(--line));
}

.private-card .card-meta > span:first-child::before,
.admin-card.is-private .card-meta > span:first-child::before {
    content: "PRIVATE";
    padding: 4px 7px;
    margin-right: 8px;
    border-radius: 999px;
    color: white;
    background: var(--private);
    font-size: 7px;
    letter-spacing: 0.08em;
}

.admin-desk {
    border-bottom: 0;
}

.admin-desk[hidden] {
    display: none;
}

.admin-heading > div > p {
    margin-bottom: 10px;
    color: var(--accent-dark);
}

.admin-card textarea {
    min-height: 116px;
    padding: 14px;
    resize: vertical;
    font-size: 13px;
    line-height: 1.7;
}

.admin-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.admin-card-actions button {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface-strong);
    cursor: pointer;
    font-size: 10px;
    font-weight: 850;
}

.admin-card-actions .answer-save {
    border-color: var(--accent);
    color: #0d120e;
    background: var(--accent);
}

.admin-card-status {
    min-height: 1.4em;
    margin: 8px 0 0;
    color: var(--muted);
    text-align: right;
    font-size: 10px;
}

.qna-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1280px, calc(100% - 36px));
    min-height: 110px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 10px;
}

.qna-footer a {
    color: inherit;
    text-decoration: none;
}

.admin-dialog {
    width: min(430px, calc(100% - 32px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 26px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 36px 110px rgba(0, 0, 0, 0.32);
}

.admin-dialog::backdrop {
    background: rgba(9, 11, 9, 0.56);
    backdrop-filter: blur(8px);
}

.admin-dialog form {
    position: relative;
    padding: 34px;
}

.admin-dialog form > p {
    margin: 0 0 8px;
    color: var(--accent-dark);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.13em;
}

.admin-dialog h2 {
    margin: 0 0 28px;
    font-size: 34px;
    letter-spacing: -0.06em;
}

.admin-dialog label {
    margin-bottom: 9px;
}

.admin-dialog input {
    min-height: 48px;
    padding: 0 14px;
}

.admin-dialog form > span {
    display: block;
    min-height: 1.5em;
    margin: 9px 0;
    color: var(--muted);
    font-size: 10px;
}

.dialog-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--text);
    background: transparent;
    cursor: pointer;
}

.admin-submit {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 14px;
    color: #0d120e;
    background: var(--accent);
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 60;
    max-width: min(340px, calc(100% - 48px));
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 15px;
    color: var(--text);
    background: var(--surface-strong);
    box-shadow: var(--shadow);
    font-size: 11px;
    line-height: 1.55;
}

.toast[hidden] {
    display: none;
}

@media (max-width: 760px) {
    .pointer-light {
        display: none;
    }

    .qna-header {
        min-height: 62px;
        padding-inline: 16px;
    }

    .qna-brand {
        font-size: 10px;
    }

    .qna-shell {
        width: min(100% - 24px, 1280px);
    }

    .qna-hero {
        min-height: 430px;
        padding-top: 105px;
    }

    .qna-hero h1 {
        font-size: clamp(60px, 21vw, 92px);
    }

    .qna-hero-bottom,
    .form-heading,
    .form-footer,
    .board-heading,
    .admin-heading,
    .qna-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .question-form {
        padding: 20px 16px;
        border-radius: 24px;
    }

    .visibility-switch {
        width: 100%;
    }

    .send-button {
        width: 100%;
    }

    .receipt-code-row {
        align-items: stretch;
        flex-direction: column;
    }

    .receipt-code-row button,
    .receipt-close {
        width: 100%;
    }

    .board-heading > div:last-child {
        width: 100%;
        justify-content: space-between;
    }

    .secret-desk-layout {
        grid-template-columns: 1fr;
    }

    .secret-copy form > div {
        grid-template-columns: 1fr;
    }

    .secret-copy form button {
        min-height: 44px;
    }

    .admin-card-actions {
        display: grid;
        grid-template-columns: 1fr 1.4fr;
    }

    .admin-card-actions button {
        width: 100%;
    }

    .qna-footer {
        justify-content: center;
        min-height: 130px;
        gap: 12px;
    }

    .toast {
        right: 12px;
        bottom: 12px;
        max-width: calc(100% - 24px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
