/**
 * 单词笔记 — 内联于学习页，仅本人可见
 */

.word-note-pen-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.375rem;
    border: 0;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.06);
    color: rgba(29, 29, 31, 0.72);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.dark .word-note-pen-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(245, 245, 247, 0.72);
}

.word-note-pen-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(29, 29, 31, 0.92);
}

.dark .word-note-pen-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(245, 245, 247, 0.92);
}

.word-note-pen-btn:active {
    transform: scale(0.95);
}

.word-note-pen-btn.is-active {
    background: rgba(249, 103, 30, 0.15) !important;
    color: #f9671e !important;
}

.dark .word-note-pen-btn.is-active {
    background: rgba(249, 103, 30, 0.22) !important;
    color: #fb923c !important;
}

.word-note-pen-btn.has-note::after {
    content: '';
    position: absolute;
    top: -0.15rem;
    right: -0.15rem;
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 9999px;
    background: #f9671e;
    box-shadow: 0 0 0 1.5px #fff;
    pointer-events: none;
}

.dark .word-note-pen-btn.has-note::after {
    box-shadow: 0 0 0 1.5px #000;
}

/* ── 内联笔记（选项下方，文档流） ── */
.word-note-inline-slot {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
}

.word-note-inline-slot.is-open {
    display: block;
}

.word-note-wrap--inline {
    position: relative;
    width: 100%;
}

.word-note-wrap--inline .word-note-pin {
    top: 0.45rem;
    left: 0.65rem;
    transform: none;
    z-index: 4;
}

.word-note--inline {
    position: relative;
    width: 100%;
    margin: 0.5rem 0 0;
    padding: 1rem 0.95rem 0.85rem;
    background: #f8f5ec;
    border: 1px solid rgba(29, 29, 31, 0.06);
    border-radius: 0.75rem;
    box-shadow:
        0 1px 2px rgba(29, 29, 31, 0.04),
        0 4px 12px rgba(29, 29, 31, 0.05);
    cursor: text;
    overflow: hidden;
}

.dark .word-note--inline {
    background: #222224;
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dark .word-note-wrap--inline .word-note-pin {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.word-note-floating-layer {
    position: fixed;
    inset: 0;
    z-index: 45;
    pointer-events: none;
}

.word-note-wrap--floating {
    --note-left: 0px;
    --note-top: 0px;
    position: fixed;
    left: var(--note-left);
    top: var(--note-top);
    width: min(calc(100vw - 2rem), 16rem);
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
}

.word-note-wrap--floating.is-dragging {
    transition: none;
}

.word-note-floating-layer.is-open .word-note-wrap--floating {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
}

.word-note-pin {
    position: absolute;
    top: -0.15rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    font-size: 1.125rem;
    line-height: 1;
    pointer-events: none;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}

.word-note__drag-handle {
    position: absolute;
    top: -0.35rem;
    left: 50%;
    transform: translateX(-50%);
    width: 3.5rem;
    height: 1.75rem;
    z-index: 6;
    cursor: grab;
    touch-action: none;
}

.word-note-wrap--floating.is-dragging .word-note__drag-handle {
    cursor: grabbing;
}

.word-note--draggable {
    position: relative;
    width: 100%;
    margin-top: 0.85rem;
    padding: 1rem 0.95rem 0.85rem;
    background: #f8f5ec;
    border: 1px solid rgba(29, 29, 31, 0.06);
    box-shadow:
        0 1px 2px rgba(29, 29, 31, 0.04),
        0 6px 18px rgba(29, 29, 31, 0.07);
    overflow: hidden;
    cursor: text;
}

.word-note--draggable.is-dragging {
    user-select: none;
}

.dark .word-note--draggable {
    background: #222224;
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.word-note__lines {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    z-index: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.word-note__lines span {
    display: block;
    height: 1px;
    background: rgba(29, 29, 31, 0.07);
}

.dark .word-note__lines span {
    background: rgba(255, 255, 255, 0.08);
}

.word-note__crease {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
    height: 3.5rem;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-50%);
    opacity: 0.18;
}

.word-note__crease--1 {
    top: 38%;
}

.word-note__crease--2 {
    top: 72%;
}

.word-note__crease-inner {
    position: absolute;
    top: 47%;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 160%;
    transform: translate(-50%, -50%) rotate(-11deg);
}

.word-note__crease-inner--alt {
    transform: translate(-50%, -50%) rotate(5deg);
}

.word-note__crease-dark {
    display: block;
    width: 100%;
    height: 1.5rem;
    box-shadow: inset 0 -16px 8px rgba(0, 0, 0, 0.05);
}

.word-note__crease-light {
    display: block;
    width: 100%;
    height: 1rem;
    transform: rotate(180deg);
    box-shadow: inset 0 16px 8px rgba(255, 255, 255, 0.11);
}

.word-note__input {
    position: relative;
    z-index: 3;
    display: block;
    width: 100%;
    min-height: 0;
    border: 0;
    background: transparent;
    resize: none;
    overflow-y: auto;
    padding: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    letter-spacing: -0.01em;
    color: rgba(29, 29, 31, 0.92);
    outline: none;
    cursor: text;
    user-select: text;
    -webkit-user-select: text;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-sizing: border-box;
}

.word-note__input::-webkit-scrollbar {
    display: none;
}

.dark .word-note__input {
    color: #e5e7eb;
}

.word-note__input::placeholder {
    color: rgba(29, 29, 31, 0.38);
}

.dark .word-note__input::placeholder {
    color: #9ca3af;
}

.word-note__footer {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 0.625rem;
    padding-top: 0.375rem;
    cursor: text;
}

.word-note__status {
    font-size: 0.6875rem;
    color: rgba(29, 29, 31, 0.45);
    white-space: nowrap;
}

.dark .word-note__status {
    color: #9ca3af;
}

.word-note__status.is-error {
    color: #dc2626;
}

.dark .word-note__status.is-error {
    color: #f87171;
}

/* ── 笔记 / 学习历史 全屏模态（共用 shell） ── */

.notes-modal,
.history-modal {
    position: fixed;
    inset: 0;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.dark .notes-modal,
.dark .history-modal {
    background: rgba(0, 0, 0, 0.92);
}

.notes-modal.is-open,
.history-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.notes-modal__panel,
.history-modal__panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    min-height: 0;
    max-width: none;
    margin: 0;
    padding: max(1rem, env(safe-area-inset-top, 0px)) 0 1.25rem;
    box-sizing: border-box;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.notes-modal__header,
.history-modal__header,
.notes-modal__search-bar,
.history-modal__toolbar,
.notes-modal__columns,
.notes-modal__body,
.history-modal__body,
.notes-modal__footer,
.history-modal__footer,
.notes-modal__guest,
.history-modal__guest {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: clamp(1rem, 3vw, 2.5rem);
    padding-right: clamp(1rem, 3vw, 2.5rem);
    box-sizing: border-box;
}

.notes-modal__header,
.history-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dark .notes-modal__header,
.dark .history-modal__header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.notes-modal__title,
.history-modal__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
}

.dark .notes-modal__title,
.dark .history-modal__title {
    color: #f9fafb;
}

.notes-modal__close,
.history-modal__close {
    flex-shrink: 0;
    padding: 0.375rem 0.75rem;
    border: 0;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.06);
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.dark .notes-modal__close,
.dark .history-modal__close {
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
}

.notes-modal__guest,
.history-modal__guest {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex: 1;
    min-height: 12rem;
    padding: 2rem 1rem 3rem;
    text-align: center;
    color: #6b7280;
}

.notes-modal__guest i,
.history-modal__guest i {
    font-size: 2rem;
    opacity: 0.5;
}

.notes-modal__guest p,
.history-modal__guest p {
    margin: 0;
    font-size: 0.9375rem;
    color: #374151;
}

.dark .notes-modal__guest p,
.dark .history-modal__guest p {
    color: #d1d5db;
}

.notes-modal__guest.hidden,
.history-modal__guest.hidden {
    display: none;
}

#notesModalContent,
#historyModalContent {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: visible;
}

#notesModalContent.hidden,
#historyModalContent.hidden {
    display: none;
}

.notes-modal__search-bar {
    flex-shrink: 0;
    margin-bottom: 0.625rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.notes-modal__search-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    width: 100%;
    padding: 0 0.875rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.dark .notes-modal__search-wrap {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.notes-modal__search-wrap:focus-within {
    border-color: rgba(249, 103, 30, 0.55);
    box-shadow: 0 0 0 3px rgba(249, 103, 30, 0.14);
}

.notes-modal__search-icon {
    flex-shrink: 0;
    font-size: 1.125rem;
    color: #9ca3af;
}

.notes-modal__search {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: #111827;
}

.dark .notes-modal__search {
    color: #f5f5f7;
}

.notes-modal__search::placeholder {
    color: #9ca3af;
}

.notes-modal__search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: #d1d5db;
    color: #6b7280;
    cursor: pointer;
    flex-shrink: 0;
}

.notes-modal__search-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    flex-shrink: 0;
    color: #9ca3af;
}

.notes-modal__search-status.hidden {
    display: none;
}

.notes-modal__search-spinner {
    font-size: 1.125rem;
    line-height: 1;
    animation: notes-modal-spin 0.75s linear infinite;
}

@keyframes notes-modal-spin {
    to { transform: rotate(360deg); }
}

.notes-modal__search-clear.hidden {
    display: none;
}

.notes-modal__columns {
    display: grid;
    grid-template-columns: minmax(5.5rem, 28%) 1fr;
    gap: 1rem;
    padding-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #9ca3af;
    text-transform: uppercase;
    flex-shrink: 0;
}

.notes-modal__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.notes-modal__body.is-refetching {
    pointer-events: none;
}

.notes-modal__body.is-refetching .notes-modal__list {
    opacity: 0.45;
    transition: opacity 0.15s ease;
}

.notes-modal__list {
    display: flex;
    flex-direction: column;
    transition: opacity 0.15s ease;
}

.notes-modal__loading,
.notes-modal__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 12rem;
    padding: 2rem 1rem;
    text-align: center;
    color: #9ca3af;
}

.notes-modal__empty i {
    font-size: 2rem;
    opacity: 0.5;
}

.notes-modal__empty p {
    margin: 0;
    font-size: 0.9375rem;
    color: #374151;
}

.dark .notes-modal__empty p {
    color: #d1d5db;
}

.notes-modal__empty span {
    font-size: 0.875rem;
}

.notes-modal__loading.hidden,
.notes-modal__empty.hidden,
.notes-modal__empty span.hidden,
.notes-modal__list.hidden,
.notes-modal__footer.hidden {
    display: none;
}

.notes-modal__time-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 0.625rem;
    padding: 0 0.25rem;
}

.notes-modal__time-divider:first-child {
    margin-top: 0.25rem;
}

.notes-modal__time-line {
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
}

.dark .notes-modal__time-line {
    background: rgba(255, 255, 255, 0.08);
}

.notes-modal__time {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    white-space: nowrap;
}

.notes-modal__row {
    display: grid;
    grid-template-columns: minmax(5.5rem, 28%) 1fr;
    gap: 1rem;
    width: 100%;
    padding: 0.875rem 0.25rem;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-radius: 0.625rem;
    transition: background-color 0.15s ease;
}

.notes-modal__row:hover {
    background: rgba(0, 0, 0, 0.03);
}

.dark .notes-modal__row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.notes-modal__word {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.5;
    color: #f9671e;
    word-break: break-word;
}

.notes-modal__content {
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
}

.dark .notes-modal__content {
    color: #d1d5db;
}

.notes-modal__footer,
.history-modal__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-top: 0.75rem;
    padding-top: 1rem;
    padding-bottom: 0.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.dark .notes-modal__footer,
.dark .history-modal__footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.notes-modal__page-btn,
.history-modal__page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.06);
    color: #374151;
    cursor: pointer;
}

.dark .notes-modal__page-btn,
.dark .history-modal__page-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
}

.notes-modal__page-btn:disabled,
.history-modal__page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.notes-modal__page-info,
.history-modal__page-info {
    font-size: 0.875rem;
    color: #6b7280;
    white-space: nowrap;
}

.dark .notes-modal__page-info,
.dark .history-modal__page-info {
    color: #9ca3af;
}

/* ── 学习历史模态（内容区） ── */

.history-modal__filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0;
}

.history-modal__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-bottom: 0.75rem;
}

.history-modal__review-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
    padding: 0.375rem 0.875rem;
    border: 0;
    border-radius: 9999px;
    background: rgba(249, 103, 30, 0.1);
    color: #ea580c;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.history-modal__review-btn:hover {
    background: rgba(249, 103, 30, 0.16);
}

.dark .history-modal__review-btn {
    background: rgba(249, 103, 30, 0.14);
    color: #fb923c;
}

.dark .history-modal__review-btn:hover {
    background: rgba(249, 103, 30, 0.22);
}

.history-modal__review-btn i {
    font-size: 1rem;
    line-height: 1;
}

.history-modal__filter {
    padding: 0.375rem 0.875rem;
    border: 0;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.05);
    color: #4b5563;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.dark .history-modal__filter {
    background: rgba(255, 255, 255, 0.06);
    color: #9ca3af;
}

.history-modal__filter.is-active {
    background: #111827;
    color: #fff;
}

.dark .history-modal__filter.is-active {
    background: #fff;
    color: #111827;
}

.history-modal__columns {
    display: none;
}

.history-modal__table-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.history-modal__table-shell.hidden {
    display: none;
}

.history-modal__table-head {
    flex-shrink: 0;
    width: 100%;
    overflow: visible;
    position: relative;
    z-index: 3;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(249, 250, 251, 0.96);
}

.dark .history-modal__table-head {
    border-top-color: rgba(255, 255, 255, 0.08);
    background: rgba(17, 17, 17, 0.96);
}

.history-modal__table-wrap {
    width: 100%;
    overflow: visible;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dark .history-modal__table-wrap {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.history-modal__table-wrap.hidden {
    display: none;
}

.history-modal__table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.history-modal__table--head thead {
    background: transparent;
}

.history-modal__table th {
    padding: 0.75rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
    color: #9ca3af;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    white-space: nowrap;
    overflow: visible;
    position: relative;
    vertical-align: middle;
}

.dark .history-modal__table th {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.history-modal__table th:nth-child(1) { width: 20%; }
.history-modal__table th:nth-child(2) { width: 12%; }
.history-modal__table th:nth-child(3) { width: 15%; }
.history-modal__table th:nth-child(4) { width: 13%; }
.history-modal__table th:nth-child(5) { width: 14%; }
.history-modal__table th:nth-child(6) { width: 26%; }

.history-modal__table td {
    padding: 0.875rem 0.25rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
}

.dark .history-modal__table td {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.history-modal__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.history-modal__col-head {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.history-modal__tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: #9ca3af;
    cursor: help;
    vertical-align: middle;
    text-transform: none;
    letter-spacing: normal;
    z-index: 3;
}

.history-modal__tip i {
    font-size: 0.875rem;
    line-height: 1;
}

.history-modal__tip:hover,
.history-modal__tip:focus {
    color: #f9671e;
    outline: none;
}

.history-modal__tip-text {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-50%);
    z-index: 10010;
    width: max-content;
    max-width: min(16rem, calc(100vw - 1.5rem));
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    background: #111827;
    color: #f9fafb;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: normal;
    text-transform: none;
    white-space: normal;
    text-align: left;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.history-modal__tip-text::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #111827;
}

.history-modal__tip:hover .history-modal__tip-text,
.history-modal__tip:focus .history-modal__tip-text {
    opacity: 1;
    visibility: visible;
}

.history-modal__loading,
.history-modal__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 10rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

.history-modal__empty i {
    font-size: 1.75rem;
    opacity: 0.45;
}

.history-modal__loading.hidden,
.history-modal__empty.hidden,
.history-modal__table-shell.hidden,
.history-modal__footer.hidden,
.history-modal__guest.hidden {
    display: none;
}

.history-modal__row:last-child td {
    border-bottom: 0;
}

.history-modal__word-cell {
    min-width: 0;
}

.history-modal__word {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    max-width: 100%;
}

.dark .history-modal__word {
    color: #f9fafb;
}

.history-modal__rating {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

.history-modal__rating--1,
.history-modal__rating--2,
.history-modal__rating--quiz-wrong {
    color: #dc2626;
}

.dark .history-modal__rating--1,
.dark .history-modal__rating--2,
.dark .history-modal__rating--quiz-wrong {
    color: #f87171;
}

.history-modal__metric {
    font-size: 0.75rem;
    color: #4b5563;
    white-space: nowrap;
}

.dark .history-modal__metric {
    color: #9ca3af;
}

.history-modal__review-in--overdue {
    color: #ef4444;
    font-weight: 500;
}

.dark .history-modal__review-in--overdue {
    color: #f87171;
}

.history-modal__time {
    font-size: 0.6875rem;
    color: #9ca3af;
    white-space: nowrap;
}

.word-note__input.is-guest-readonly {
    cursor: default;
    color: #9ca3af;
}

.dark .word-note__input.is-guest-readonly {
    color: #6b7280;
}

@media (max-width: 639px) {
    .history-modal__table th:nth-child(3),
    .history-modal__table th:nth-child(4),
    .history-modal__table td:nth-child(3),
    .history-modal__table td:nth-child(4) {
        display: none;
    }

    .history-modal__table th:nth-child(1) { width: 30%; }
    .history-modal__table th:nth-child(2) { width: 18%; }
    .history-modal__table th:nth-child(5) { width: 22%; }
    .history-modal__table th:nth-child(6) { width: 30%; }

    .history-modal__tip-text {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        max-width: 14rem;
    }

    .history-modal__tip-text::after {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

@media (min-width: 640px) {
    .notes-modal__header,
    .history-modal__header,
    .notes-modal__search-bar,
    .history-modal__toolbar,
    .notes-modal__columns,
    .notes-modal__body,
    .history-modal__body,
    .notes-modal__footer,
    .history-modal__footer,
    .notes-modal__guest,
    .history-modal__guest {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* ── 历年真题弹窗（全屏） ── */
.exam-examples-modal {
    position: fixed;
    inset: 0;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.exam-examples-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.exam-examples-modal__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.dark .exam-examples-modal__panel {
    background: #000;
    border: none;
    box-shadow: none;
}

.exam-examples-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.exam-examples-modal__heading {
    min-width: 0;
    flex: 1;
}

.exam-examples-modal__def-section {
    flex-shrink: 0;
    padding: 0.75rem 1.25rem 0.875rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.exam-examples-modal__def-section.hidden {
    display: none;
}

.exam-examples-modal__def-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.125rem;
}

.exam-examples-modal__def-tabs::-webkit-scrollbar {
    display: none;
}

.exam-examples-modal__def-tab {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.375rem;
    flex-shrink: 1;
    max-width: 100%;
    padding: 0.5rem 0.875rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.03);
    color: #374151;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
    white-space: normal;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dark .exam-examples-modal__def-tab {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #d1d5db;
}

.exam-examples-modal__def-tab.is-active {
    border-color: transparent;
    background: #0071e3;
    color: #fff;
}

.dark .exam-examples-modal__def-tab.is-active {
    border-color: transparent;
    background: #0071e3;
    color: #fff;
}

.exam-examples-modal__def-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3125rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
}

.exam-examples-modal__def-tab.is-active .exam-examples-modal__def-tab-count {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.dark .exam-examples-modal__def-tab-count {
    background: rgba(255, 255, 255, 0.12);
}

.exam-examples-modal__def-count {
    margin: 0.625rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #9ca3af;
}

.exam-examples-modal__def-count.hidden {
    display: none;
}

.dark .exam-examples-modal__def-count {
    color: #6b7280;
}

.dark .exam-examples-modal__header,
.dark .exam-examples-modal__def-section {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.exam-examples-modal__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.dark .exam-examples-modal__title {
    color: #f9fafb;
}

.exam-examples-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.05);
    color: #6b7280;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.exam-examples-modal__close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #111827;
}

.dark .exam-examples-modal__close {
    background: rgba(255, 255, 255, 0.08);
    color: #a1a1aa;
}

.dark .exam-examples-modal__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #f9fafb;
}

.exam-examples-modal__close i {
    font-size: 1.125rem;
    line-height: 1;
}

.exam-examples-modal__content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.875rem 1.25rem 1rem;
}

.exam-examples-modal__loading,
.exam-examples-modal__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    font-size: 0.875rem;
    color: #9ca3af;
    text-align: center;
}

.exam-examples-modal__empty i {
    font-size: 1.75rem;
    opacity: 0.5;
}

.exam-examples-modal__loading.hidden,
.exam-examples-modal__empty.hidden,
.exam-examples-modal__list.hidden,
.exam-examples-modal__footer.hidden {
    display: none;
}

.exam-examples-modal__list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.exam-examples-modal__item {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dark .exam-examples-modal__item {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.exam-examples-modal__item:last-child {
    border-bottom: none;
}

.exam-examples-modal__source {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #0071e3;
}

.dark .exam-examples-modal__source {
    color: #4da3ff;
}

.exam-examples-modal__sentence {
    margin: 0;
    font-size: clamp(1.125rem, 2.4vw, 1.375rem);
    line-height: 1.5;
    color: #111827;
}

.dark .exam-examples-modal__sentence {
    color: #f3f4f6;
}

.exam-examples-modal__translation {
    margin: 0.625rem 0 0;
    font-size: clamp(1.0625rem, 2.3vw, 1.25rem);
    line-height: 1.55;
    color: #6b7280;
}

.dark .exam-examples-modal__translation {
    color: #9ca3af;
}

.exam-examples-modal__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.75rem;
    padding: 0.75rem 0 0.25rem;
    border-top: none;
    flex-shrink: 0;
}

.dark .exam-examples-modal__footer {
    border-top: none;
}

.exam-examples-modal__page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: #eff6ff;
    color: #0071e3;
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.exam-examples-modal__page-btn:hover:not(:disabled) {
    background: #dbeafe;
}

.exam-examples-modal__page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.dark .exam-examples-modal__page-btn {
    background: rgba(0, 113, 227, 0.15);
    color: #4da3ff;
}

.dark .exam-examples-modal__page-btn:hover:not(:disabled) {
    background: rgba(0, 113, 227, 0.25);
}

.exam-examples-modal__page-info {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
}

.dark .exam-examples-modal__page-info {
    color: #9ca3af;
}

.vk-exam-count-btn {
    vertical-align: baseline;
}