:root {
    color-scheme: light;
    --page-bg: #f4f6f8;
    --surface: #ffffff;
    --text: #20242a;
    --muted: #68717d;
    --line: #dce1e7;
    --line-strong: #c2c9d1;
    --primary: #176b4d;
    --primary-hover: #10573e;
    --primary-soft: #eaf4ef;
    --focus: #2b7de9;
    --danger: #b42318;
    --danger-soft: #fff0ee;
    --tag-bg: #eef3f1;
    --warning-bg: #fff4d8;
    --warning-text: #795500;
}

* {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

[hidden] {
    display: none !important;
}

body {
    min-width: 320px;
    margin: 0;
    background: var(--page-bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.paper-view-mode {
    padding-top: 0;
}

.paper-view-mode.paper-submitted {
    padding-top: var(--top-navbar-height, 48px);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.page-shell {
    --sidebar-shell-width: calc(100% - 40px);
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0 40px;
}

.breadcrumb {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumb a {
    color: #424a54;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.breadcrumb a:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.breadcrumb [aria-current="page"] {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-weight: 600;
}

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 650;
    letter-spacing: 0;
}

.page-header p,
.editor-heading p {
    margin: 4px 0 0;
    color: var(--muted);
}

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

.primary-button,
.secondary-button,
.secondary-link,
.danger-button,
.icon-button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 5px;
    padding: 7px 14px;
    text-decoration: none;
}

.primary-button {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.primary-button:hover {
    background: var(--primary-hover);
}

.secondary-button,
.secondary-link {
    border: 1px solid var(--line-strong);
    background: #ffffff;
    color: var(--text);
}

.secondary-button:hover,
.secondary-link:hover {
    background: #f5f7f8;
}

.danger-button {
    border: 1px solid #e3a49e;
    background: #ffffff;
    color: var(--danger);
}

.danger-button:hover {
    background: var(--danger-soft);
}

.icon-button {
    width: 34px;
    min-height: 34px;
    border: 1px solid transparent;
    background: transparent;
    color: #4e5864;
    padding: 0;
    font-size: 18px;
}

.icon-button:hover {
    border-color: var(--line);
    background: #f3f5f7;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.workspace {
    display: grid;
    min-height: 680px;
    grid-template-columns: 300px minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
}

.paper-panel {
    min-width: 0;
    border-right: 1px solid var(--line);
}

.paper-edit-mode .workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
}

.paper-edit-mode .paper-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
}

.paper-view-mode .workspace {
    display: block;
    min-height: 0;
    border: 0;
    background: transparent;
}

.paper-view-mode .paper-panel {
    display: none;
}

.paper-view-mode .app-sidebar {
    display: none;
}

.paper-view-mode .sidebar-layout {
    display: block;
}

.paper-view-mode .sidebar-page-shell {
    width: min(1280px, calc(100% - 40px));
    margin-right: auto;
    margin-left: auto;
}

.paper-view-mode .sidebar-content {
    max-width: 100%;
}

.panel-heading,
.editor-heading {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding: 14px 18px;
}

.panel-heading h2,
.editor-heading h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 650;
    letter-spacing: 0;
}

#paper-form {
    padding: 18px;
}

.field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
    color: #424a54;
    font-size: 12px;
    font-weight: 600;
}

.field input,
.add-question-form input,
.question-score {
    width: 100%;
    height: 38px;
    min-width: 0;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: #ffffff;
    color: var(--text);
    outline: none;
    padding: 7px 9px;
}

.field input:focus,
.add-question-form input:focus,
.question-score:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 2px rgb(43 125 233 / 15%);
}

.paper-view-mode .field input[readonly] {
    border-color: transparent;
    background: transparent;
    padding-right: 0;
    padding-left: 0;
    font-size: 16px;
    font-weight: 650;
}

.paper-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.paper-stats div {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfd;
    padding: 12px;
}

.paper-stats strong {
    display: block;
    font-size: 24px;
    font-weight: 650;
}

.paper-stats span,
.meta-list span {
    color: var(--muted);
    font-size: 12px;
}

.meta-list {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.meta-list div {
    display: flex;
    min-height: 32px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.meta-list strong {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.paper-edit-mode #paper-form {
    display: grid;
    align-items: end;
    grid-template-columns: minmax(280px, 2fr) repeat(4, minmax(112px, 1fr));
    gap: 12px;
}

.paper-edit-mode .paper-stats,
.paper-edit-mode .meta-list {
    display: contents;
}

.paper-edit-mode .paper-stats div,
.paper-edit-mode .meta-list div {
    display: flex;
    min-width: 0;
    min-height: 62px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfd;
    padding: 9px 12px;
}

.paper-edit-mode .paper-stats strong {
    font-size: 20px;
}

.paper-edit-mode .meta-list strong {
    width: 100%;
    font-size: 14px;
}

.editor-panel {
    min-width: 0;
    width: 100%;
}

.add-question-form {
    display: grid;
    width: min(440px, 100%);
    grid-template-columns: minmax(110px, 1fr) 76px auto;
    gap: 8px;
}

.add-question-form .score-input {
    text-align: center;
}

.question-list-wrap {
    position: relative;
    padding: 16px;
}

.table-region {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    contain: inline-size paint;
}

.paper-viewer {
    display: grid;
    gap: 18px;
}

.paper-viewer[hidden] {
    display: none;
}

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

.paper-practice-main {
    min-width: 0;
}

.paper-question-card-list {
    display: grid;
    gap: 20px;
}

#paper-question-stage:focus-visible {
    outline: none;
}

.paper-progress-panel {
    position: sticky;
    top: 20px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    padding: 14px;
}

.paper-submitted .paper-progress-panel {
    top: calc(var(--top-navbar-height, 48px) + 20px);
}

.paper-progress-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.paper-progress-heading h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: 0;
}

.paper-progress-heading span {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.paper-progress-grid {
    display: grid;
    grid-template-columns: repeat(4, 36px);
    gap: 8px;
}

.paper-progress-cell {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: #edf0f2;
    color: #65707c;
    padding: 0;
    font-weight: 650;
}

.paper-progress-cell:hover {
    border-color: #8f99a4;
    background: #e4e8eb;
}

.paper-progress-cell.is-answered {
    border-color: #75a8df;
    background: #e4f0ff;
    color: #185b9d;
}

.paper-progress-cell.is-wrong {
    border-color: #df8f87;
    background: #fde8e6;
    color: #9f241a;
}

.paper-progress-cell.is-correct {
    border-color: #67a98d;
    background: #dff1e8;
    color: #145b42;
}

.paper-submit-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 20px;
    border-top: 1px solid var(--line);
    padding-top: 20px;
}

.paper-submit-bar p {
    margin: 0;
    color: var(--muted);
}

.paper-submit-bar .primary-button {
    min-width: 112px;
}

.paper-question-card {
    overflow: hidden;
    border: 1px solid rgba(24, 32, 42, 0.08);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 12px 30px rgba(24, 32, 42, 0.06);
}

.paper-question-card.is-correct {
    border-color: #67a98d;
}

.paper-question-card.is-wrong {
    border-color: #df8f87;
}

.paper-question-card-header {
    display: flex;
    min-height: 72px;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding: 18px 24px;
}

.paper-question-index {
    display: inline-flex;
    min-width: 64px;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
}

.paper-question-card-header h3 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 650;
    letter-spacing: 0;
}

.paper-question-result {
    margin-left: auto;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 650;
}

.paper-question-result.is-correct {
    background: #dff1e8;
    color: #145b42;
}

.paper-question-result.is-wrong {
    background: #fde8e6;
    color: #9f241a;
}

.paper-question-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding: 14px 24px;
}

.paper-question-meta-pill {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fbfcfd;
    padding: 4px 8px;
    color: var(--muted);
    font-size: 12px;
}

.paper-question-meta-pill strong {
    color: #344054;
    font-weight: 650;
}

.paper-question-content,
.paper-question-answer {
    padding: 22px 24px;
}

.paper-question-content {
    border-bottom: 1px solid var(--line);
}

.paper-question-section-label {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
}

.paper-question-text {
    color: var(--text);
    font-size: 17px;
    line-height: 1.8;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.paper-question-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 14px;
    margin-top: 18px;
}

.paper-question-images.is-single {
    grid-template-columns: minmax(0, 420px);
}

.paper-question-image-item {
    min-width: 0;
    margin: 0;
}

.paper-question-image-preview {
    display: block;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8faf9;
    padding: 0;
}

.paper-question-image-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
}

.paper-question-image-item figcaption {
    overflow: hidden;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.paper-question-options {
    display: grid;
    margin: 0;
    padding: 0;
    gap: 10px;
}

.paper-question-option {
    display: grid;
    grid-template-columns: 20px 30px minmax(0, 1fr);
    min-height: 42px;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    padding: 9px 12px;
    cursor: pointer;
}

.paper-question-option:hover {
    border-color: #9aa5b1;
    background: #fafcfb;
}

.paper-question-option.is-selected {
    border-color: #75a8df;
    background: #f0f6ff;
}

.paper-question-option.is-correct-answer {
    border-color: #2d8665;
    background: #e6f5ed;
}

.paper-question-option.is-wrong-selected {
    border-color: #c84e43;
    background: #fff0ee;
}

.paper-question-option:has(input:disabled) {
    cursor: default;
}

.paper-question-option input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}

.paper-question-option.is-empty {
    display: block;
    color: var(--muted);
    cursor: default;
}

.paper-question-option-letter {
    display: inline-flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: #edf0f2;
    color: #46515c;
    font-size: 12px;
    font-weight: 700;
}

.paper-question-option-content {
    min-width: 0;
    padding-top: 1px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.paper-question-option-hint {
    grid-column: 3;
    color: #25664f;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.paper-correct-answer {
    margin: 16px 0 0;
    color: #145b42;
    font-weight: 650;
}

.paper-question-hint {
    margin: 14px 0 0;
    color: #25664f;
    line-height: 1.7;
}

.table-toolbar {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding: 8px 14px;
}

.answer-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3f4852;
    cursor: pointer;
    user-select: none;
}

.answer-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.toggle-track {
    display: inline-flex;
    width: 36px;
    height: 20px;
    flex: 0 0 36px;
    align-items: center;
    border-radius: 10px;
    background: #aeb6bf;
    padding: 2px;
    transition: background-color 0.15s ease;
}

.toggle-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
    transition: transform 0.15s ease;
}

.answer-toggle input:checked + .toggle-track {
    background: var(--primary);
}

.answer-toggle input:checked + .toggle-track .toggle-thumb {
    transform: translateX(16px);
}

.answer-toggle input:focus-visible + .toggle-track {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.table-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
}

.question-table {
    width: 100%;
    min-width: 1420px;
    border-collapse: collapse;
    table-layout: auto;
}

.question-table th,
.question-table td {
    border-bottom: 1px solid var(--line);
    padding: 11px 12px;
    text-align: left;
    vertical-align: top;
}

.question-table th {
    background: #f8f9fa;
    color: #444c56;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.question-table tbody .question-row:hover {
    background: #fafcfb;
}

.question-row.is-dragging {
    opacity: 0.65;
}

.question-row.is-drop-before {
    box-shadow: inset 0 3px 0 var(--primary);
}

.question-row.is-drop-after {
    box-shadow: inset 0 -3px 0 var(--primary);
}

.column-expand {
    width: 48px;
}

.column-order {
    width: 84px;
}

.column-id {
    width: 76px;
}

.column-version {
    width: 68px;
}

.column-question {
    width: 27%;
}

.column-type,
.column-difficulty {
    width: 86px;
}

.column-category {
    min-width: 210px;
}

.column-tags {
    width: 160px;
}

.column-creator {
    width: 120px;
}

.column-time {
    width: 142px;
}

.column-score {
    width: 88px;
}

.column-actions {
    width: 72px;
}

.expand-button {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #59636e;
    padding: 0;
    cursor: pointer;
}

.expand-button:hover {
    border-color: var(--line);
    background: #f0f3f4;
    color: var(--text);
}

.expand-button > span[aria-hidden="true"] {
    font-size: 24px;
    line-height: 1;
    transition: transform 0.15s ease;
}

.expand-button[aria-expanded="true"] > span[aria-hidden="true"] {
    transform: rotate(90deg);
}

.question-order-cell {
    white-space: nowrap;
}

.question-order-cell .drag-handle {
    margin-right: 8px;
    vertical-align: middle;
}

.drag-handle {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #59636f;
    padding: 0;
    cursor: grab;
    font-size: 16px;
    line-height: 1;
}

.drag-handle:hover {
    border-color: var(--line);
    background: #f0f3f4;
}

.drag-handle:active {
    cursor: grabbing;
}

.question-order-number,
.question-version {
    color: #59636e;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    white-space: nowrap;
}

.question-link {
    display: -webkit-box;
    overflow: hidden;
    color: #185c47;
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.question-link:hover {
    text-decoration: underline;
}

.cell-muted {
    color: var(--muted);
}

.category-value {
    display: block;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 12px;
    white-space: nowrap;
}

.badge-type {
    background: #e9f1fa;
    color: #245b91;
}

.badge-easy {
    background: #e7f5ed;
    color: #216a43;
}

.badge-normal {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge-hard {
    background: var(--danger-soft);
    color: var(--danger);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag {
    max-width: 100%;
    overflow: hidden;
    border-radius: 4px;
    background: var(--tag-bg);
    color: #44534e;
    padding: 2px 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.question-score {
    width: 64px;
    height: 34px;
    text-align: center;
}

.question-score-value {
    display: inline-flex;
    min-width: 40px;
    min-height: 30px;
    align-items: center;
    color: #3f4852;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.table-actions {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.paper-question-action-menu {
    position: relative;
    display: inline-block;
}

.paper-question-action-trigger {
    display: inline-flex;
    width: 32px;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    padding: 0;
    font: inherit;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    list-style: none;
}

.paper-question-action-trigger::-webkit-details-marker {
    display: none;
}

.paper-question-action-trigger::marker {
    content: "";
}

.paper-question-action-trigger:hover {
    border-color: var(--line);
    background: #f5f7f6;
    color: #344054;
}

.paper-question-action-menu[open] .paper-question-action-trigger {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

.paper-question-action-menu-list {
    position: fixed;
    inset: auto;
    z-index: 80;
    display: none;
    min-width: 96px;
    max-width: calc(100vw - 16px);
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(28, 36, 44, 0.14);
    margin: 0;
    padding: 4px;
    overscroll-behavior: contain;
}

.paper-question-action-menu-list.is-visible {
    display: grid;
}

.paper-question-action-item {
    display: inline-flex;
    width: 100%;
    min-height: 30px;
    align-items: center;
    justify-content: flex-start;
    border: 0;
    border-radius: 4px;
    background: transparent;
    padding: 5px 10px;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}

.edit-question-link {
    color: var(--primary);
}

.edit-question-link:hover {
    background: var(--primary-soft);
}

.delete-question-button {
    color: var(--danger);
}

.delete-question-button:hover {
    background: var(--danger-soft);
}

.paper-question-action-trigger:focus-visible,
.edit-question-link:focus-visible,
.delete-question-button:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.paper-view-mode .column-actions,
.paper-view-mode .table-actions {
    display: none;
}

.option-detail-row td {
    background: #f8faf9;
    padding: 0;
}

.option-detail {
    padding: 16px 20px 18px 60px;
}

.option-detail-title {
    margin-bottom: 8px;
    color: #505963;
    font-size: 12px;
    font-weight: 650;
}

.option-list {
    display: grid;
    max-width: 920px;
    margin: 0;
    padding: 0;
    gap: 7px;
    list-style: none;
}

.option-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    min-height: 36px;
    align-items: start;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #ffffff;
    padding: 7px 10px;
}

.option-letter {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: #edf0f2;
    color: #46515c;
    font-size: 12px;
    font-weight: 700;
}

.option-content {
    min-width: 0;
    padding-top: 1px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.correct-option-mark {
    display: none;
    border-radius: 4px;
    background: #dff2e7;
    color: #17613e;
    padding: 2px 7px;
    font-size: 12px;
    white-space: nowrap;
}

.show-correct-options .option-item.is-correct {
    border-color: #7fbea0;
    background: #f2faf5;
}

.show-correct-options .option-item.is-correct .option-letter {
    background: #dff2e7;
    color: #17613e;
}

.show-correct-options .correct-option-mark {
    display: inline-block;
}

.empty-state {
    display: flex;
    min-height: 320px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--line-strong);
    border-radius: 7px;
    background: #fbfcfd;
    color: var(--muted);
    padding: 32px;
    text-align: center;
}

.empty-state h3 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 17px;
    font-weight: 650;
}

.empty-state p {
    max-width: 520px;
    margin: 0;
}

.paper-question-table .empty-state {
    width: min(860px, calc(100vw - 390px));
    min-width: 520px;
}

.paper-question-table .column-id {
    width: 110px;
    min-width: 110px;
}

.paper-question-table .column-question {
    width: 38%;
    min-width: 520px;
}

.paper-question-table .column-category {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
}

.paper-question-table .column-tags,
.paper-question-table .question-tags-cell {
    width: 240px;
    min-width: 240px;
}

.paper-question-table .category-value {
    display: block;
    max-width: 296px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.column-heading-with-help {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.column-heading-with-help .multi-select-help {
    vertical-align: middle;
}

.toast {
    position: fixed;
    z-index: 100;
    top: 18px;
    left: 50%;
    max-width: min(520px, calc(100% - 32px));
    transform: translateX(-50%);
    border: 1px solid #bad8cc;
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    box-shadow: 0 8px 20px rgba(28, 36, 44, 0.14);
    padding: 10px 14px;
    user-select: text;
    cursor: text;
}

.toast.is-error {
    border-color: #efc2bd;
    color: var(--danger);
}

.toast.is-warning {
    border-color: #eed58b;
    background: var(--warning-bg);
    color: var(--warning-text);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .paper-edit-mode #paper-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .page-shell {
        width: min(100% - 24px, 680px);
        padding-top: 18px;
    }

    .page-header,
    .editor-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .header-actions {
        justify-content: stretch;
    }

    .header-actions > * {
        flex: 1;
    }

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

    .paper-edit-mode #paper-form {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .paper-progress-panel {
        position: static;
        grid-row: 1;
    }

    .paper-progress-grid {
        grid-template-columns: repeat(auto-fill, 36px);
    }

    .paper-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .add-question-form {
        width: 100%;
        grid-template-columns: minmax(0, 1fr) 72px;
    }

    .add-question-form button {
        grid-column: 1 / -1;
    }

    .table-toolbar {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .paper-question-table .empty-state {
        width: calc(100vw - 56px);
        min-width: 0;
    }

    .option-detail {
        padding-left: 16px;
    }

    .option-item {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .correct-option-mark {
        grid-column: 2;
        justify-self: start;
    }
}
