@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

/* ===== Quiz Page Styles ===== */

.qz-topbar {
    background: var(--cd-primary);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.qz-topbar a { color: #fff; opacity: .7; text-decoration: none; transition: opacity .2s; }
.qz-topbar a:hover { opacity: 1; }
.qz-topbar .sep { opacity: .3; }
.qz-topbar .active { opacity: 1; font-weight: 700; }

.qz-hero { text-align: center; padding: 48px 20px 36px; }
.qz-hero-badge {
    display: inline-block;
    background: var(--cd-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 5px 16px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}
.qz-hero h1 {
    font-size: 2.6rem;
    font-weight: 900;
    line-height: 1.35;
    margin-bottom: 10px;
}
.qz-hero h1 em { font-style: normal; color: var(--cd-primary); }
.qz-hero p { color: var(--cd-text-muted); font-size: 16px; max-width: 560px; margin: 0 auto; }

.qz-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 28px auto 40px;
    flex-wrap: wrap;
}
.qz-stat-box {
    background: var(--cd-card);
    border: 1px solid var(--cd-border);
    border-radius: 14px;
    padding: 16px 28px;
    text-align: center;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(80,60,30,0.06);
}
.qz-stat-num { font-size: 2.6rem; font-weight: 900; line-height: 1; }
.qz-stat-label { font-size: 14px; color: var(--cd-text-muted); margin-top: 4px; font-weight: 600; }

/* ── CTA Button ── */
.qz-cta-wrap { text-align: center; margin: 0 auto 44px; padding: 0 24px; }
.qz-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #0a5439 0%, #1a7a5a 60%, #2a9070 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 15px 32px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(10,84,57,0.32);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.qz-cta-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 28px rgba(10,84,57,0.38);
    color: #fff;
}
.qz-cta-icon { font-size: 19px; }

.qz-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 860px;
    margin: 0 auto;
    padding: 0 4px;
}
.qz-card {
    background: var(--cd-card);
    border: 1px solid var(--cd-border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(80,60,30,0.06);
}
.qz-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(80,60,30,0.12);
}
.qz-card-header { padding: 24px 20px 18px; }
.qz-card-icon { font-size: 2.8rem; margin-bottom: 10px; }
.qz-card-title { font-size: 1.6rem; font-weight: 800; }
.qz-card-sub { font-size: 14px; color: var(--cd-text-muted); margin-top: 6px; line-height: 1.5; }
.qz-card-footer {
    margin-top: auto;
    padding: 12px 20px;
    border-top: 1px solid var(--cd-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    color: var(--cd-text-muted);
    background: var(--cd-card-soft);
}
.qz-card-count { font-weight: 800; font-size: 1.3rem; }

.qz-page-header { text-align: center; padding: 40px 20px 24px; }
.qz-lang-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 5px 16px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.qz-page-header h1 { font-size: 2.1rem; font-weight: 900; line-height: 1.35; }
.qz-page-header h1 em { font-style: normal; }
.qz-page-header .subtitle { color: var(--cd-text-muted); font-size: 15px; margin-top: 8px; }

.qz-section { max-width: 860px; margin: 0 auto; padding: 0 16px; }

.qz-type-section { margin-top: 24px; }
.qz-type-title {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.qz-click-hint { font-size: 13px; color: var(--cd-text-muted); opacity: .6; margin-left: auto; }

.qz-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--cd-card);
    border: 1px solid var(--cd-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(80,60,30,0.05);
}
.qz-table thead th {
    background: var(--cd-primary-soft);
    font-size: 14px;
    font-weight: 700;
    color: var(--cd-primary);
    padding: 14px 16px;
    text-align: left;
    border-bottom: 2px solid var(--cd-primary);
}
.qz-table thead th:nth-child(n+2) { text-align: center; }
.qz-table tbody tr { cursor: pointer; transition: background .15s; }
.qz-table tbody tr:hover { background: rgba(10, 84, 57, 0.04); }
.qz-table tbody tr:not(:last-child) td { border-bottom: 1px solid var(--cd-border); }
.qz-table tbody td { padding: 14px 16px; font-size: 15px; vertical-align: middle; }
.qz-table tbody td:nth-child(n+2) { text-align: center; }

.qz-type-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.qz-type-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.qz-type-count { font-weight: 900; font-size: 1.3rem; color: var(--cd-primary); min-width: 22px; text-align: right; }
.qz-type-pct { font-weight: 700; color: var(--cd-primary); }

/* ── Type stats bar ── */
.qz-bar-row { display: flex; align-items: center; gap: 9px; justify-content: center; }
.qz-bar-track {
    flex: 1;
    min-width: 60px;
    max-width: 120px;
    height: 9px;
    background: var(--cd-border);
    border-radius: 5px;
    overflow: hidden;
}
.qz-bar-fill { height: 100%; border-radius: 5px; transition: width .4s ease; }
.qz-bt1 { background: linear-gradient(90deg, #9b2828, #c94040); }
.qz-bt2 { background: linear-gradient(90deg, #b86020, #d89040); }
.qz-bt3 { background: linear-gradient(90deg, #c0981a, #d8b840); }
.qz-bt4 { background: linear-gradient(90deg, #2a7a50, #48a870); }
.qz-bt5 { background: linear-gradient(90deg, #1a6080, #3090b0); }

.qz-problem-section { display: none; margin-top: 24px; padding-bottom: 40px; }
.qz-problem-section.show { display: block; }
.qz-back-btn {
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    color: var(--cd-primary);
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    background: none;
    border: none;
    font-family: inherit;
}
.qz-back-btn:hover { text-decoration: underline; }

.qz-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--cd-primary);
}
.qz-sh-title { font-size: 1.5rem; font-weight: 800; }
.qz-sh-count {
    color: #fff;
    font-size: 14px;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 700;
}

.qz-year-tag { font-size: 14px; font-weight: 600; color: var(--cd-text-muted); }
.qz-type-tag {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 10px;
    color: #fff;
    margin-right: 6px;
}

/* ───────── Pretendard 폰트 (카드 문제/풀이 텍스트만) ───────── */
body.cd-page .qz-pcard .qz-desc,
body.cd-page .qz-pcard .qz-answer-value,
body.cd-page .qz-pcard .qz-hint-text,
body.cd-page .qz-pcard .variant-q,
body.cd-page .qz-pcard .variant-q *,
body.cd-page .qz-pcard .variant-ans-val {
    font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", sans-serif !important;
}
/* 코드 블록은 monospace 유지 (자식 span 포함) */
body.cd-page .qp-code-wrap,
body.cd-page .qp-code-wrap * {
    font-family: 'JetBrains Mono', monospace !important;
}

/* ───────── Problem cards (모달 → 카드 리스트로 통일) ───────── */
.qz-pcard-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}
.qz-pcard {
    background: var(--cd-card);
    border: 1px solid var(--cd-border);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.qz-pcard-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.qz-pcard-qid {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--cd-text-muted);
    margin-left: auto;
}
.qz-pcard-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--cd-text);
}
.qz-pcard .qp-code-wrap {
    border-radius: 12px;
    margin: 14px 0;
}
.qz-pcard .qp-code {
    font-size: 12.5px;
    line-height: 1.6;
    padding: 14px 16px;
}

/* ── Desc row: description + hint button ── */
.qz-desc-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}
.qz-desc-row .qz-desc { flex: 1; margin-bottom: 0; }
.qz-hint-toggle {
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1.5px solid #f59e0b;
    background: #fffbeb;
    color: #92400e;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all .2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.qz-hint-toggle:hover { background: #fef3c7; }
.qz-hint-toggle.active { background: #fef3c7; border-color: #d97706; }

/* ── Hint content ── */
.qz-hint-area { margin-top: 0; margin-bottom: 4px; }
.qz-hint-content {
    display: none;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #fde68a;
    animation: qzFadeIn .2s;
}
.qz-hint-content.show { display: block; }
.qz-hint-box {
    padding: 16px 20px;
    background: #fffdf5;
}
.qz-hint-label {
    font-size: 13px;
    font-weight: 700;
    color: #d97706;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.qz-hint-text {
    font-size: 15px;
    line-height: 1.75;
    color: #000;
    white-space: pre-line;
}

/* ── Action row: answer + inquiry buttons ── */
.qz-action-row {
    display: flex;
    align-items: center;
    margin-top: 20px;
    gap: 12px;
    flex-wrap: wrap;
}
.qz-primary-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.qz-answer-toggle {
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--qwp-confirm-accent, #0F766E);
    border: 1px solid var(--qwp-confirm-accent, #0F766E);
    border-radius: 10px;
    padding: 8px 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity .15s, transform .15s, box-shadow .15s;
}
.qz-answer-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15,118,110,.18);
}
.qz-answer-content {
    display: none;
    margin-top: 14px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--cd-border);
    animation: qzFadeIn .2s;
}
.qz-answer-content.show { display: block; }
@keyframes qzFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.qz-answer-box {
    padding: 16px 20px;
    background: #f0faf0;
}
.qz-answer-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--cd-success);
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.qz-answer-value { font-size: 1.4rem; font-weight: 800; color: #1b5e20; white-space: pre-line; }

/* 신고 영역은 qzInquiry 컴포넌트(quiz-kakao.js + quiz-kakao.css)로 통합 */

/* ── Explanation (해설) ── */
.qz-action-row .qp-btn-explanation {
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 12px;
    color: #2980b9;
    background: #eaf2fa;
    border: 1px solid #bdd8f1;
    cursor: pointer;
    transition: all .15s;
}
.qz-action-row .qp-btn-explanation:hover { background: #d4e8f8; border-color: #93c5e8; }
.qp-explanation-section {
    display: none;
    margin-top: 10px;
    padding: 14px;
    background: #f8f9ff;
    border: 1px solid #d5ddf6;
    border-radius: 8px;
}
.qp-explanation-section.open { display: block; }
.qp-explanation-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #2980b9;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.qp-explanation-label::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: #2980b9;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 2v4M6 8v1' stroke='%23fff' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: cover;
}
.qp-explanation-body { font-size: 14px; line-height: 1.7; color: #333; }
.qp-explanation-body img { max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; }

@media (max-width: 700px) {
    .qz-cards { grid-template-columns: 1fr; }
    .qz-hero h1 { font-size: 1.9rem; }
    .qz-stats { gap: 10px; }
    .qz-stat-box { padding: 12px 18px; min-width: 90px; }
    .qz-stat-num { font-size: 1.9rem; }
}
@media (max-width: 640px) {
    .qz-page-header h1 { font-size: 1.6rem; }
    .qz-table thead th, .qz-table tbody td { padding: 10px 10px; font-size: 14px; }
    .qz-pcard { padding: 16px; border-radius: 14px; }
    .qz-pcard-title { font-size: 1.15rem; }
    .qz-pcard .qp-code { font-size: 12.5px; padding: 14px 16px; }
}

/* ===== Variant (변형문제) ===== */
.qz-variant-wrap { margin-top: 14px; padding-top: 14px; border-top: 1.5px dashed #e0e0e0; }
.qt-variant-btn-wrap { margin: 12px 16px 16px; }
.qt-btn-variant {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 700; letter-spacing: .02em;
  padding: 8px 18px; border-radius: 20px;
  border: 1.5px solid #186460; color: #186460; background: #E3F2F1;
  cursor: pointer; transition: all .18s; user-select: none;
}
.qt-btn-variant:hover { background: #186460; color: #fff; }
.qt-btn-variant .v-icon { font-size: 15px; transition: transform .2s; }
.qt-btn-variant.open .v-icon { transform: rotate(45deg); }
.qt-variant-section {
  display: none; margin-top: 12px;
  background: linear-gradient(135deg, #f0faf9 0%, #e8f7f6 100%);
  border: 1.5px solid #b2dfdb; border-radius: 10px;
  padding: 1rem 1.2rem; animation: qzFadeInV .25s ease;
}
.qt-variant-section.open { display: block; }
@keyframes qzFadeInV {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.qt-variant-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.qt-variant-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  background: #186460; color: #fff; padding: 2px 9px; border-radius: 20px;
}
.qt-variant-title { font-size: 12px; color: #186460; font-weight: 600; }
.qt-variant-ans-wrap {
  display: none; margin-top: 10px; padding-top: 10px;
  border-top: 1.5px dashed #b2dfdb;
}
.qt-variant-ans-wrap.open { display: block; }
.qt-variant-ans-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: #186460; text-transform: uppercase; margin-bottom: 6px;
  display: flex; align-items: center; gap: 5px;
}
.qt-variant-ans-label::before {
  content: ''; display: inline-block; width: 14px; height: 14px;
  background: #186460; border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%23fff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: cover;
}
.variant-ans-val {
  font-size: 14px; font-weight: 700; color: #186460;
  background: #c8eeec; border-radius: 6px;
  padding: 9px 13px; margin-bottom: 7px; line-height: 1.65;
}
.qt-btn-variant-ans {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px; font-size: 11.5px; font-weight: 600;
  padding: 5px 14px; border-radius: 16px;
  border: 1.5px solid #186460; color: #186460; background: transparent;
  cursor: pointer; transition: all .15s;
}
.qt-btn-variant-ans:hover { background: #186460; color: #fff; }
