/*qna List*/
.qna.list .container {
    border-radius: var(--card-rounding);
    box-shadow: var(--card-shaodw);
    padding: 20px 40px;

}

.qna.list .scroll-area {
    width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.qna.list table {
    min-width: 100%;
}

.qna.list table thead {
    border-bottom: 1px inset var(--color-gray);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-gray);
}

.qna.list table tbody > tr {
    border-bottom: 1px solid #ccc;
}


.qna.list table th {
    padding: 5px 15px;
}

.qna.list table th,
.qna.list table td {
    line-height: 40px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}


.qna.list table td {
    position: relative;
    padding: 15px 10px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.qna.list table td i {
    cursor: pointer;
}

.qna.list table td em {
    color: var(--color-error);
    font-weight: 500;
}

.qna.list table .index,
.qna.list table .writer,
.qna.list table .hit,
.qna.list table .attachment {
    width: 100px;
}

.qna.list table .index,
.qna.list table .hit {
    text-align: center;
}

.qna.list table .category {
    width: 300px;
}

.qna.list table .code {
    width: 150px;
}

.qna.list table td.subject {
    text-align: start;
    display: flex;
    flex-direction: column;
}

.qna.list table td.subject > .category {
    width: fit-content;
    display: inline-block;
    line-height: normal;
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    background-color: var(--color-primary);
    color: #fff;
    border-radius: 0.3rem;
    position: relative;
}

.qna.list table td.subject > a {
    padding: 0 0.6rem;
}

.qna.list table .comment {
    width: 120px;
}

.qna.list table .date {
    width: 100px;
}

.qna.list table a:hover {
    text-decoration: underline;
}

.qna.list table tr:has(a:hover) {
    background-color: var(--color-hover-back);
}

.qna.list table .empty {
    text-align: center;
    font-size: 15px;
    color: #cfcfcf;
}

.qna.list table td.empty {
    line-height: 220px;
}

.qna.list table tbody tr:not(:last-child) {
    border-bottom: 1px solid var(--color-gray-100);
}


.qna.list table .attachment ul {
    position: absolute;
    z-index: 1;
    left: 10px;
    top: 50px;
    padding: 5px 15px;
    box-shadow: var(--card-shaodw);
    border-radius: var(--card-rounding);
    background-color: var(--color-background);
    font-size: 14px;
    line-height: 30px;
    opacity: 0;
    pointer-events: none;
    transition: all 200ms ease-in-out;
}

.qna.list table .attachment:hover ul {
    opacity: 1;
    pointer-events: all;
}

.qna.list table .attachment ul a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.qna.list table .attachment ul i {
    font-size: 14px;
}

.qna.list table td.comment {
    font-weight: 600;
    color: var(--color-primary);
}

span.notice {
    line-height: 22px;
    font-size: 14px;
    background-color: var(--color-primary);
    color: var(--color-on-primary);
    border-radius: 13px;
    padding: 3px 8px;
}

/*qna view*/
.qna.view .wrapper {
    margin-top: 1.5rem;
    margin-bottom: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

.qna.view .qna-thread {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px 28px 24px;
    border: 1px solid rgba(0, 10, 87, 0.08);
    border-radius: var(--card-rounding);
    box-shadow: var(--card-shaodw);
    background: #fff;
}

.qna.view .qna-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.qna.view .qna-badge {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin-top: 2px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
}

.qna.view .qna-body {
    flex: 1;
    min-width: 0;
}

/* Q 질문 */
.qna.view .qna-question {
    padding: 0;
    border: none;
    background: transparent;
}

.qna.view .qna-question .qna-badge {
    color: var(--color-primary);
    background: #fff;
    border: 2px solid var(--color-primary);
    box-shadow: 0 4px 14px rgba(0, 10, 87, 0.08);
}

.qna.view .qna-question .qna-body {
    padding: 20px 22px;
    border-radius: 14px;
    background: #fafbfd;
    border: 1px solid rgba(0, 10, 87, 0.08);
    box-shadow: none;
}

.qna.view .qna-question__title {
    margin: 0 0 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #edf0f5;
    color: var(--color-primary);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.45;
    word-break: keep-all;
}

.qna.view .qna-question__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 18px;
}

.qna.view .qna-question__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qna.view .qna-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 10, 87, 0.08);
    color: var(--color-primary);
    font-size: 0.82rem;
    font-weight: 600;
}

.qna.view .qna-chip--code {
    background: var(--color-primary);
    color: #fff;
}

.qna.view .qna-question__info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #666;
    font-size: 0.88rem;
}

.qna.view .qna-question__info li {
    position: relative;
    margin: 0;
}

.qna.view .qna-question__info li:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -7px;
    top: 20%;
    width: 1px;
    height: 60%;
    background: #d8dbe7;
}

.qna.view .qna-question__info .bold {
    color: #333;
    font-weight: 600;
}

.qna.view .qna-question__content,
.qna.view .answer-body {
    margin: 0;
    padding: 16px 18px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid rgba(0, 10, 87, 0.06);
    line-height: 1.75;
    color: #333;
    word-break: break-word;
    box-sizing: border-box;
}

.qna.view .qna-question__content {
    min-height: 48px;
}

.qna.view .qna-question__content.content {
    padding: 16px 18px;
}

.qna.view .qna-question__content > :first-child,
.qna.view .answer-body > :first-child {
    margin-top: 0;
}

.qna.view .qna-question__content > :last-child,
.qna.view .answer-body > :last-child {
    margin-bottom: 0;
}

.qna.view .qna-question__content p,
.qna.view .answer-body p {
    margin: 0 0 0.75em;
}

.qna.view .qna-question__content p:last-child,
.qna.view .answer-body p:last-child {
    margin-bottom: 0;
}

.qna.view .qna-question__content img,
.qna.view .answer-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.qna.view .answer-body {
    white-space: pre-wrap;
}

.qna.view .qna-question__extras {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #edf0f5;
}

.qna.view .qna-question__extras h5 {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: #555;
}

.qna.view .qna-question__extras ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.qna.view .qna-question__extras li a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-primary);
    text-decoration: none;
}

.qna.view .qna-question__extras li a:hover {
    text-decoration: underline;
}

/* A 답변 */
.qna.view .qna-answers {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.qna.view .qna-answer {
    padding: 0;
    border: none;
    background: transparent;
}

.qna.view .qna-answer .qna-badge {
    color: #fff;
    background: var(--color-primary);
    box-shadow: 0 4px 14px rgba(0, 10, 87, 0.12);
}

.qna.view .qna-answer .qna-body {
    padding: 18px 20px;
    border-radius: 14px;
    background: #fafbfd;
    border: 1px solid rgba(0, 10, 87, 0.08);
}

.qna.view .answer-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8ebf2;
}

.qna.view .answer-head .writer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.88rem;
}

.qna.view .answer-head .writer strong {
    color: #222;
    font-weight: 600;
}

.qna.view .comment_actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.qna.view .comment_actions button {
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    color: #444;
    font-size: 0.82rem;
    cursor: pointer;
}

.qna.view .comment_actions button[type="submit"] {
    color: #b42318;
    border-color: #fecdca;
    background: #fff5f5;
}

/* 답변 작성 — A 배지 + qna-body (등록된 답변과 동일 레이아웃) */
.qna.view .qna-reply {
    padding: 0;
    border: none;
    background: transparent;
}

.qna.view .qna-reply .qna-badge {
    color: #fff;
    background: var(--color-primary);
    box-shadow: 0 4px 14px rgba(0, 10, 87, 0.12);
}

.qna.view .qna-reply .qna-body {
    padding: 18px 20px;
    border-radius: 14px;
    background: #fafbfd;
    border: 1px solid rgba(0, 10, 87, 0.08);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.qna.view .qna-reply .qna-body:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 10, 87, 0.08);
}

.qna.view .qna-reply .qna-body:has(.qna-reply-box.edit) {
    background: #fffdf5;
    border-color: #f0dfa0;
}

.qna.view .qna-reply-box {
    width: 100%;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.qna.view .qna-reply-box__editor {
    padding: 16px 18px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid rgba(0, 10, 87, 0.06);
    box-sizing: border-box;
}

.qna.view .qna-reply-box__editor textarea {
    display: block;
    width: 100%;
    min-height: 120px;
    max-height: 280px;
    padding: 0;
    border: none;
    border-radius: 0;
    resize: vertical;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.75;
    color: #333;
    background: transparent;
    box-sizing: border-box;
}

.qna.view .qna-reply-box__editor textarea:focus {
    outline: none;
}

.qna.view .qna-reply-box__editor textarea::placeholder {
    color: #9aa3b2;
}

.qna.view .qna-reply-box__footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e8ebf2;
    background: transparent;
}

.qna.view .qna-reply-box__btn {
    min-width: 76px;
    height: 38px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, filter 0.15s;
    box-sizing: border-box;
}

.qna.view .qna-reply-box__btn--primary {
    border: 1px solid var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.qna.view .qna-reply-box__btn--primary:hover {
    filter: brightness(1.06);
}

.qna.view .qna-reply-box__btn--ghost {
    display: none;
    border: 1px solid #cfd5e0;
    background: #fff;
    color: #555;
}

.qna.view .qna-reply-box__btn--ghost:hover {
    background: #f0f2f6;
}

.qna.view .qna-reply-box.edit .qna-reply-box__btn--ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qna.view .qna-reply-box.edit .qna-reply-box__footer {
    border-top-color: #f0dfa0;
}

@media all and (max-width: 1024px) {
    .qna.list table .index,
    .qna.list table .writer,
    .qna.list table .hit,
    .qna.list table .date,
    .qna.list table .attachment {
        width: 100px;
    }

    .qna.view .qna-question__title {
        font-size: 1.2rem;
    }

    .qna.view .qna-item {
        gap: 10px;
    }

    .qna.view .qna-badge {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .qna.view .qna-question .qna-body,
    .qna.view .qna-answer .qna-body,
    .qna.view .qna-reply .qna-body {
        padding: 16px;
    }

    .qna.view .qna-question__meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .qna.view .answer-head {
        flex-direction: column;
    }
}

@media all and (max-width: 768px) {
    .qna.list table th, .qna.list table td {
        text-align: center;
        max-width: none;
    }

    .qna.list table .index,
    .qna.list table .hit {
        width: 60px;
    }

    .qna.list table th, .qna.list table td {
        line-height: 30px;
    }

    .qna.list .container {
        padding: 15px 20px;
        background-color: var(--color-white);
    }

    .qna.list table thead {
        display: none;
    }

    .qna.list table tbody tr {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        row-gap: 5px;
        padding: 5px 0;
        border-radius: 10px;
    }

    .qna.list table tbody > tr:last-child {
        border-bottom: 0;
    }

    .qna.list table td {
        padding: 0 0.6rem;
    }

    .qna.list table .subject {
        width: calc(100% - 30px);
        max-width: none;
        padding: 0;
    }

    .qna.list table .index,
    .qna.list table .code,
    .qna.list table .category {
        width: fit-content;
    }

    .qna.list table .writer,
    .qna.list table .hit,
    .qna.list table .attachment,
    .qna.list table .date,
    .qna.list table .comment {
        line-height: 20px;
        padding: 5px;
        color: #999;
        width: auto;
        font-size: 0.9rem;
    }

    /*view*/
    .qna.view .wrapper {
        margin-top: 0;
        margin-bottom: 1.5rem;
    }

    .qna.view .qna-thread {
        padding: 18px 16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .qna.view .qna-reply-box__footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
    }

    .qna.view .qna-reply-box__btn {
        width: 100%;
        flex: none;
        min-width: 0;
    }
}

@media all and (max-width: 500px) {
    .qna.view .qna-question__title {
        font-size: 1.15rem;
    }

    .qna.view .qna-badge {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .qna.view .qna-question__content,
    .qna.view .answer-body,
    .qna.view .qna-reply-box__editor {
        padding: 14px 16px;
        border-radius: 8px;
    }

    .qna.view .qna-question__content.content {
        padding: 14px 16px;
    }
}