﻿:root {
    --qp-bg: #f5f7fb;
    --qp-panel: #ffffff;
    --qp-border: #d9e1ef;
    --qp-text: #172033;
    --qp-muted: #68758a;
    --qp-primary: #2563eb;
    --qp-primary-soft: #eaf1ff;
    --qp-danger: #dc2626;
    --qp-green: #059669;
}

.question-paper-page {
    background: var(--qp-bg);
    color: var(--qp-text);
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

.question-paper-page [hidden] {
    display: none !important;
}

.qp-shell {
    width: calc(100% - 172px);
    max-width: 1200px;
    height: calc(100vh - var(--site-nav-height, 54px));
    margin: var(--site-nav-height, 54px) auto 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.qp-app {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.qp-closed {
    min-height: calc(100vh - 140px);
    display: grid;
    place-items: center;
}

.qp-closed-box {
    width: min(520px, 100%);
    background: var(--qp-panel);
    border: 1px solid var(--qp-border);
    border-radius: 8px;
    padding: 42px;
    text-align: center;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.qp-closed-box i {
    font-size: 36px;
    color: var(--qp-primary);
}

.qp-closed-box h1 {
    margin: 16px 0 8px;
    font-size: 24px;
}

.qp-closed-box p {
    margin: 0;
    color: var(--qp-muted);
}

.qp-header {
    margin: 0;
    min-height: 0;
}

.qp-header h1 {
    margin: 0 0 4px;
    font-size: 24px;
    line-height: 1.25;
}

.qp-header p {
    margin: 0;
    color: var(--qp-muted);
    font-size: 14px;
}

.qp-basket-pill {
    position: fixed;
    right: 0;
    top: 58%;
    transform: translateY(-50%);
    z-index: 900;
    width: 62px;
    height: 78px;
    padding: 10px 6px 8px;
    box-sizing: border-box;
    appearance: none;
    border: 1px solid var(--qp-border);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    background: var(--qp-panel);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    display: grid;
    grid-template-rows: 26px 1fr;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    color: var(--qp-primary);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.qp-basket-pill:hover {
    transform: translateY(-50%) translateX(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.18);
}

.qp-basket-pill i {
    font-size: 22px;
    line-height: 1;
    color: var(--qp-primary);
    grid-row: 1;
    justify-self: center;
}

.qp-basket-pill span {
    color: var(--qp-muted);
    font-size: 12px;
    line-height: 1.1;
    grid-row: 2;
    justify-self: center;
}

.qp-basket-pill strong {
    position: absolute;
    top: 8px;
    right: 10px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
    box-sizing: border-box;
}

.qp-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-height: 48px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--qp-border);
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--qp-bg);
}

.qp-animated-total {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    min-width: 280px;
    height: 34px;
    padding: 0 20px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
}

.qp-animated-total strong {
    color: var(--qp-primary);
    font-size: 16px;
}

.qp-tab {
    border: 0;
    background: transparent;
    color: var(--qp-muted);
    padding: 11px 16px;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.qp-tab.active {
    color: var(--qp-primary);
    border-bottom-color: var(--qp-primary);
    font-weight: 700;
}

.qp-panel {
    display: none;
    min-height: 0;
}

.qp-panel.active {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

#qpTabFind.active {
    display: block;
    overflow: hidden;
}

.qp-find-layout {
    display: grid;
    grid-template-columns: 216px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "knowledge questions";
    gap: 12px;
    height: 100%;
    min-height: 0;
    align-items: stretch;
}

.qp-filter,
.qp-list-wrap,
.qp-basket-box,
.qp-export-box,
.qp-record-list {
    background: var(--qp-panel);
    border: 1px solid var(--qp-border);
    border-radius: 8px;
}

.qp-filter {
    padding: 14px;
    height: fit-content;
    display: grid;
    gap: 12px;
}

.qp-filter label,
.qp-title-field {
    display: grid;
    gap: 6px;
}

.qp-filter span,
.qp-title-field span {
    font-size: 13px;
    color: var(--qp-muted);
}

.qp-filter select,
.qp-filter input,
.qp-title-field input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--qp-border);
    border-radius: 6px;
    padding: 0 10px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
    color: var(--qp-text);
}

.qp-list-wrap {
    grid-area: questions;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.qp-list-head {
    grid-row: 1;
}

.qp-active-filter {
    grid-row: 2;
}

.qp-question-list {
    grid-row: 3;
}

.qp-pagination {
    grid-row: 4;
}

.qp-list-head,
.qp-section-head {
    min-height: 42px;
    padding: 5px 12px;
    border-bottom: 1px solid var(--qp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-sizing: border-box;
}

.qp-list-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.qp-list-head strong,
.qp-section-head h2 {
    display: block;
    margin: 0;
    font-size: 15px;
}

.qp-list-summary span,
.qp-section-head p {
    margin: 0;
    color: var(--qp-muted);
    font-size: 12px;
}

.qp-searchbar {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
}

.qp-searchbar input {
    flex: 1 1 240px;
    min-width: 220px;
    height: 32px;
    border: 1px solid var(--qp-border);
    border-radius: 5px;
    padding: 0 9px;
    font-size: 12px;
}

.qp-type-chips {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    min-height: 30px;
    min-width: 0;
    max-width: 360px;
    overflow-x: auto;
    scrollbar-width: none;
}

.qp-type-chips::-webkit-scrollbar {
    display: none;
}

.qp-type-label {
    margin-right: 8px;
    color: var(--qp-muted);
    font-size: 12px;
}

.qp-type-chip {
    height: 24px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #1f2937;
    padding: 0 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    white-space: nowrap;
}

.qp-type-chip:hover {
    color: var(--qp-primary);
}

.qp-type-chip.active {
    background: transparent;
    color: var(--qp-primary);
    font-weight: 700;
}

.qp-type-chip[data-question-type=""].active {
    background: transparent;
    color: var(--qp-primary);
}

.qp-active-filter {
    margin: 10px 12px 0;
    padding: 8px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 13px;
}

.qp-question-list {
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 0;
    padding: 10px 12px 12px;
    overflow: auto;
    background: #f7f9fd;
}

.qp-question-card {
    position: relative;
    border: 1px solid #dfe7f2;
    border-radius: 4px;
    background: #fff;
    padding: 10px 12px;
    display: grid;
    gap: 5px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
    cursor: pointer;
}


.qp-title-actions,
.qp-ggb-expand,
.qp-answer-expand,
.qp-record-detail {
    cursor: default;
}

.qp-question-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.qp-title-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

.qp-question-title strong {
    font-size: 14px;
    line-height: 1.35;
}

.qp-title-tags {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.qp-question-id {
    flex: 0 0 auto;
    min-width: 42px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--qp-primary);
    font-weight: 700;
    white-space: nowrap;
}

.qp-question-text {
    color: #1f2937;
    font-size: 13px;
    line-height: 1.58;
    cursor: pointer;
    white-space: pre-wrap;
    word-break: break-word;
    border-top: 1px dashed #edf2f7;
    padding-top: 5px;
}

.qp-choice-stem {
    white-space: pre-wrap;
}

.qp-choice-block {
    display: grid;
    gap: 6px 18px;
    margin-top: 7px;
    align-items: start;
    white-space: normal;
}

.qp-choice-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.qp-choice-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qp-choice-cols-1 {
    grid-template-columns: minmax(0, 1fr);
}

.qp-choice-option {
    min-width: 0;
    line-height: 1.58;
    white-space: normal;
    word-break: break-word;
}

.qp-choice-label {
    font-weight: 700;
    margin-right: 4px;
    color: #0f172a;
}

.qp-card-images,
.qp-paper-images,
.qp-answer-images {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    margin-top: 5px;
}

.qp-question-image-slot {
    width: 112px;
    height: 82px;
    flex: 0 0 112px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.qp-card-images .qp-question-image-slot {
    width: 280px;
    height: auto;
    min-height: 0;
    flex: 0 1 280px;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: visible;
}

.qp-card-images .qp-question-image-slot img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    object-position: left top;
}

.qp-card-images .qp-image-wide {
    width: min(420px, 100%);
    flex-basis: min(420px, 100%);
}

.qp-card-images .qp-image-wide img {
    max-height: 240px;
}

.qp-card-images .qp-image-tall {
    width: 230px;
    flex-basis: 230px;
}

.qp-card-images .qp-image-tall img {
    max-height: 320px;
}

.qp-card-images .qp-image-compact,
.qp-card-images .qp-image-many {
    width: 240px;
    flex-basis: 240px;
}

.qp-card-images .qp-image-normal,
.qp-card-images .qp-image-auto {
    width: 280px;
    flex-basis: 280px;
}

.qp-question-image-slot img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: transparent;
}

.qp-card-images .qp-question-image-slot img {
    width: 100%;
    height: auto;
    max-height: 250px;
}

.qp-card-images .qp-image-wide img {
    max-height: 240px;
}

.qp-card-images .qp-image-tall img {
    max-height: 320px;
}


.qp-protected-content,
.qp-protected-content * {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.qp-protected-content img {
    -webkit-user-drag: none;
    user-drag: none;
}

.qp-watermark-layer {
    position: relative;
}

.qp-watermark-layer::after {
    content: attr(data-watermark);
    position: absolute;
    right: 10px;
    bottom: 6px;
    z-index: 2;
    max-width: min(70%, 360px);
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.62);
    color: rgba(37, 99, 235, 0.34);
    font-size: 11px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.qp-paper-question.qp-watermark-layer::after {
    right: 0;
    bottom: 10px;
}

.qp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qp-tag {
    font-size: 11px;
    line-height: 18px;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0 7px;
    background: #f8fafc;
}

.qp-tag.green {
    color: var(--qp-green);
    border-color: #b7ead6;
    background: #ecfdf5;
}

.qp-tag.knowledge-library.complete {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.qp-tag.knowledge-library.incomplete,
.qp-tag.knowledge-library.partial {
    color: #b45309;
    border-color: #fde68a;
    background: #fffbeb;
}

.qp-tag.knowledge-library.unselected {
    color: #b45309;
    border-color: #fde68a;
    background: #fffbeb;
}

.qp-card-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.qp-title-actions {
    flex: 0 0 auto;
    max-width: 100%;
    margin-left: auto;
    align-self: flex-start;
}

.qp-ggb-expand,
.qp-answer-expand {
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
}

.qp-answer-expand .qp-paper-answer {
    margin-top: 0;
    padding: 10px 12px;
    border: 1px dashed #d8e0ec;
    border-radius: 6px;
    background: #f8fafc;
}

.qp-answer-empty {
    color: var(--qp-muted);
    font-size: 13px;
}

.qp-ggb-ratio {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--qp-border);
    border-radius: 8px;
    background: #f1f5f9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--qp-muted);
}

.qp-knowledge-panel {
    grid-area: knowledge;
    background: var(--qp-panel);
    border: 1px solid var(--qp-border);
    border-radius: 8px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
}

.qp-knowledge-head {
    min-height: 40px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--qp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.qp-knowledge-title {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.qp-knowledge-title strong {
    line-height: 1.2;
}

.qp-knowledge-title span {
    color: var(--qp-muted);
    font-size: 11px;
    line-height: 1.2;
}

.qp-knowledge-subject {
    padding: 8px 10px;
    border-bottom: 1px solid var(--qp-border);
    display: grid;
    gap: 6px;
}

.qp-knowledge-subject span {
    font-size: 12px;
    color: var(--qp-muted);
}

.qp-knowledge-subject select {
    height: 32px;
    border: 1px solid var(--qp-border);
    border-radius: 6px;
    padding: 0 8px;
    background: #fff;
}

.qp-knowledge-list {
    padding: 6px;
    overflow: auto;
}

.qp-knowledge-subject-node {
    border-bottom: 1px solid #eef2f7;
    padding: 2px 0;
}

.qp-knowledge-subject-btn,
.qp-knowledge-main-btn,
.qp-knowledge-mid,
.qp-knowledge-detail {
    width: 100%;
    border: 0;
    background: transparent;
    color: #334155;
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 5px;
    cursor: pointer;
    text-align: left;
    line-height: 1.35;
}

.qp-knowledge-subject-btn {
    padding: 7px 6px;
    font-size: 13px;
    font-weight: 700;
}

.qp-knowledge-subject-btn::before,
.qp-knowledge-main-btn::before {
    content: "鈻?;
    width: 12px;
    color: #94a3b8;
    flex: 0 0 auto;
}

.qp-knowledge-subject-node.open > .qp-knowledge-subject-btn::before,
.qp-knowledge-main.open > .qp-knowledge-main-btn::before {
    content: "鈻?;
}

.qp-knowledge-subject-btn span,
.qp-knowledge-main-btn span,
.qp-knowledge-mid span,
.qp-knowledge-detail span {
    flex: 1;
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.qp-knowledge-subject-btn em,
.qp-knowledge-main-btn em,
.qp-knowledge-mid em,
.qp-knowledge-detail em {
    font-style: normal;
    color: var(--qp-muted);
    font-size: 12px;
}

.qp-knowledge-main-list {
    display: none;
    padding: 0 0 4px 8px;
}

.qp-knowledge-subject-node.open > .qp-knowledge-main-list {
    display: block;
}

.qp-knowledge-main {
    margin-top: 2px;
}

.qp-knowledge-main-btn {
    padding: 6px 6px;
    font-size: 12px;
}

.qp-knowledge-main-btn i {
    width: 12px;
    margin-right: 2px;
    color: #64748b;
}

.qp-knowledge-subject-btn::before,
.qp-knowledge-main-btn::before {
    content: none;
    display: none;
}

.qp-knowledge-arrow {
    display: inline-block;
    width: 10px;
    flex: 0 0 10px;
    margin-right: 0;
    margin-top: 3px;
    color: #94a3b8;
    font-size: 10px;
    text-align: center;
    transition: transform .16s ease, color .16s ease;
}

.qp-knowledge-subject-node.open > .qp-knowledge-subject-btn .qp-knowledge-arrow,
.qp-knowledge-main.open > .qp-knowledge-main-btn .qp-knowledge-arrow,
.qp-knowledge-mid-node.open > .qp-knowledge-mid .qp-knowledge-arrow {
    transform: rotate(90deg);
    color: #2563eb;
}

.qp-knowledge-main-btn .qp-knowledge-folder {
    width: 12px;
    margin-right: 2px;
    color: #64748b;
}

.qp-knowledge-main-btn.active,
.qp-knowledge-main-btn.has-active-child,
.qp-knowledge-mid.active,
.qp-knowledge-mid.has-active-child,
.qp-knowledge-detail.active {
    background: var(--qp-primary-soft);
    color: #1d4ed8;
    font-weight: 700;
}

.qp-knowledge-mid-list {
    display: none;
    padding: 2px 0 5px 14px;
}

.qp-knowledge-main.open > .qp-knowledge-mid-list {
    display: grid;
    gap: 2px;
}

.qp-knowledge-mid {
    padding: 5px 6px;
    font-size: 12px;
}

.qp-knowledge-mid-node.open > .qp-knowledge-detail-list {
    display: grid;
    gap: 2px;
}

.qp-knowledge-detail-list {
    display: none;
    padding: 2px 0 5px 12px;
}

.qp-knowledge-detail {
    padding: 4px 6px;
    font-size: 12px;
    color: #475569;
}

.qp-knowledge-subject-btn:hover,
.qp-knowledge-main-btn:hover,
.qp-knowledge-mid:hover,
.qp-knowledge-detail:hover {
    background: #f1f5f9;
}

.qp-knowledge-subject-btn.active {
    background: var(--qp-primary-soft);
    color: #1d4ed8;
}

.qp-knowledge-detail-node.open > .qp-knowledge-detail .qp-knowledge-arrow {
    transform: rotate(90deg);
    color: #2563eb;
}

.qp-knowledge-detail.has-active-child {
    background: var(--qp-primary-soft);
    color: #1d4ed8;
    font-weight: 700;
}

.qp-knowledge-detail-children {
    display: none;
    padding: 2px 0 4px 12px;
}

.qp-knowledge-detail-node.open > .qp-knowledge-detail-children {
    display: grid;
    gap: 2px;
}

.qp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 48px;
    padding: 7px 10px;
    border-top: 1px solid var(--qp-border);
    background: #fff;
}

#qpPageInfo {
    min-width: 150px;
    color: var(--qp-muted);
    font-size: 13px;
    text-align: center;
}

.qp-page-jump {
    height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--qp-muted);
    font-size: 12px;
    white-space: nowrap;
}

.qp-page-jump input {
    width: 66px;
    height: 30px;
    border: 1px solid var(--qp-border);
    border-radius: 5px;
    padding: 0 8px;
    color: var(--qp-text);
    font-size: 12px;
    text-align: center;
}

.qp-page-jump input:focus {
    outline: none;
    border-color: var(--qp-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.qp-pagination button,
.qp-primary,
.qp-secondary,
.qp-danger-ghost,
.qp-icon-btn,
.qp-small-btn {
    height: 32px;
    border-radius: 5px;
    border: 1px solid transparent;
    padding: 0 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    white-space: nowrap;
}

.qp-primary {
    background: var(--qp-primary);
    color: #fff;
}

.qp-primary i,
.qp-primary span {
    color: #fff;
}

.qp-secondary,
.qp-pagination button,
.qp-icon-btn,
.qp-small-btn {
    background: #fff;
    border-color: var(--qp-border);
    color: var(--qp-text);
}

.qp-danger-ghost {
    background: #fff;
    color: var(--qp-danger);
    border-color: #fecaca;
}

.qp-basket-toggle {
    min-width: 108px;
}

.qp-title-actions .qp-primary,
.qp-title-actions .qp-secondary,
.qp-title-actions .qp-danger-ghost,
.qp-title-actions .qp-basket-toggle {
    height: 30px;
    padding: 0 10px;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.qp-paper-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 12px;
    align-items: start;
}

.qp-paper-preview {
    background: var(--qp-panel);
    border: 1px solid var(--qp-border);
    border-radius: 8px;
    min-height: 620px;
}

.qp-paper-body {
    padding: 22px 28px 34px;
    display: grid;
    gap: 0;
    background: #fff;
}

.qp-paper-question {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0 0 18px;
    margin: 0 0 18px;
    border-bottom: 1px solid #edf1f7;
    line-height: 1.8;
}

.qp-paper-question:last-child {
    margin-bottom: 0;
    border-bottom: 0;
}

.qp-paper-question h3 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #0f172a;
}

.qp-paper-question-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
}

.qp-paper-answer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #d8e0ec;
    color: #1f2937;
}

.qp-paper-answer-title {
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.qp-paper-answer-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 13px;
}

.qp-paper-images,
.qp-answer-images {
    margin-top: 8px;
}

.qp-paper-images .qp-question-image-slot,
.qp-answer-images .qp-question-image-slot {
    width: 160px;
    height: 110px;
    flex-basis: 160px;
}

.qp-inline-title {
    display: grid;
    gap: 5px;
    min-width: 280px;
}

.qp-inline-title span {
    color: var(--qp-muted);
    font-size: 12px;
}

.qp-inline-title input {
    height: 36px;
    border: 1px solid var(--qp-border);
    border-radius: 6px;
    padding: 0 10px;
}

.qp-sort-window {
    background: var(--qp-panel);
    border: 1px solid var(--qp-border);
    border-radius: 8px;
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 108px);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(180px, 1fr) auto auto;
}

.qp-sort-head {
    padding: 10px 12px;
    border-bottom: 1px solid var(--qp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.qp-sort-list {
    padding: 10px;
    overflow: auto;
    display: grid;
    gap: 8px;
    align-content: start;
}

.qp-basket-empty,
.qp-loading,
.qp-error-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--qp-muted);
    border: 1px dashed var(--qp-border);
    border-radius: 8px;
    background: #fbfdff;
}

.qp-basket-item {
    border: 1px solid var(--qp-border);
    border-radius: 8px;
    background: #fff;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 8px;
}

.qp-basket-item.dragging {
    opacity: 0.45;
}

.qp-drag-handle {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #f1f5f9;
    display: grid;
    place-items: center;
    color: var(--qp-muted);
    cursor: grab;
}

.qp-basket-main strong {
    display: block;
    font-size: 13px;
    line-height: 1.35;
}

.qp-basket-main span {
    display: block;
    margin-top: 4px;
    color: var(--qp-muted);
    font-size: 12px;
}

.qp-basket-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.qp-export-actions {
    display: grid;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--qp-border);
}

.qp-export-actions button {
    width: 100%;
}

.qp-export-note {
    margin: 0 10px 10px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    border-radius: 8px;
    padding: 12px;
    display: grid;
    gap: 4px;
    font-size: 12px;
    line-height: 1.55;
}

.qp-record-list {
    padding: 12px;
    display: grid;
    gap: 10px;
}

.qp-record-item {
    border: 1px solid var(--qp-border);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.qp-record-item.is-expanded {
    align-items: start;
}

.qp-record-summary {
    min-width: 0;
    border: 0;
    font: inherit;
    background: transparent;
    padding: 0;
    color: inherit;
    text-align: left;
    display: grid;
    gap: 5px;
    cursor: pointer;
}

.qp-record-title {
    font-weight: 700;
    font-size: 14px;
}

.qp-record-meta {
    color: var(--qp-muted);
    font-size: 12px;
}

.qp-record-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.qp-record-detail {
    grid-column: 1 / -1;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
}

.qp-record-question-list {
    display: grid;
    gap: 10px;
}

.qp-record-question-list .qp-question-card {
    box-shadow: none;
    background: #fbfdff;
}

.qp-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
    background: #111827;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
    font-size: 13px;
}

@media (max-width: 980px) {
    .qp-shell {
        width: auto;
        max-width: none;
        height: calc(100vh - var(--site-nav-height, 54px));
        margin-top: var(--site-nav-height, 54px);
        padding: 4px 12px 0;
    }

    .qp-find-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(150px, 34vh) minmax(0, 1fr);
        grid-template-areas:
            "knowledge"
            "questions";
    }

    .qp-paper-layout {
        grid-template-columns: 1fr;
    }


    .qp-knowledge-panel {
        height: 100%;
        min-height: 0;
    }

    .qp-sort-window {
        position: static;
        max-height: none;
    }
}

@media (max-width: 640px) {
    .qp-basket-pill {
        right: 0;
        top: auto;
        bottom: 16px;
        transform: none;
        width: 58px;
        height: 72px;
        justify-content: center;
    }

    .qp-basket-pill:hover {
        transform: translateX(-2px);
    }

    .qp-tabs {
        overflow-x: auto;
        flex-wrap: wrap;
        padding-bottom: 8px;
    }

    .qp-animated-total {
        position: static;
        transform: none;
        order: 2;
        flex: 1 0 100%;
        min-width: 0;
        margin-bottom: 2px;
    }

    .qp-tab {
        flex: 0 0 auto;
    }

    .qp-pagination {
        justify-content: flex-start;
        gap: 8px;
        overflow-x: auto;
        padding: 10px;
    }

    #qpPageInfo {
        flex: 1 0 100%;
        min-width: 0;
        text-align: left;
    }

    .qp-page-jump input {
        width: 58px;
    }

    .qp-basket-item,
    .qp-record-item {
        grid-template-columns: 1fr;
    }

    .qp-list-head,
    .qp-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .qp-searchbar {
        min-width: 0;
        width: 100%;
        flex-wrap: wrap;
    }

    .qp-searchbar input,
    .qp-type-chips,
    .qp-inline-title {
        min-width: 0;
        width: 100%;
        flex-basis: 100%;
    }

    .qp-type-chips {
        justify-content: flex-start;
    }

    .qp-basket-actions,
    .qp-record-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
    }
}
