/* 学习抽屉 / 文章笔记 / 手机悬浮球 */

.study-drawer {
    height: min(88vh, 820px);
    max-height: min(88vh, 820px);
    height: min(88dvh, 820px);
    max-height: min(88dvh, 820px);
}

.study-head {
    align-items: flex-start;
    padding-bottom: 10px;
}

.study-title {
    max-height: 2em;
    font-size: 17px;
    line-height: 1.4;
}

.study-sub {
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--muted-2);
}

.study-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.study-collapse {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    background: transparent;
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 11.5px;
    cursor: pointer;
}

.study-collapse:hover {
    border-color: var(--line-strong);
    color: var(--ink);
}

.study-collapse svg {
    width: 14px;
    height: 14px;
}

.study-tabs {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 22px;
    border-bottom: 1px solid var(--line);
    flex: none;
}

.study-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 13px;
    cursor: pointer;
    transition: color var(--dur-2);
}

.study-tab:hover {
    color: var(--ink-2);
}

.study-tab.is-active {
    color: var(--ink);
    font-weight: var(--weight-semibold);
}

.study-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand);
}

.study-tab svg {
    width: 15px;
    height: 15px;
}

.study-pane {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.study-pane[hidden] {
    display: none !important;
}

.study-notes-pane {
    background:
        linear-gradient(90deg, transparent 22px, color-mix(in srgb, var(--accent) 16%, transparent) 22px, color-mix(in srgb, var(--accent) 16%, transparent) 23px, transparent 23px);
}

.study-note-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    padding: 14px 22px 8px 30px;
}

.study-note-input {
    flex: 1;
    width: 100%;
    min-height: 200px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.9;
    resize: none;
    outline: none;
}

.study-note-input::placeholder {
    color: var(--muted-2);
}

.study-note-input:disabled {
    opacity: 0.55;
}

.study-note-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 22px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    flex: none;
    font-size: 11.5px;
    color: var(--muted-2);
}

.study-save-state.is-saving {
    color: var(--muted);
}

.study-save-state.is-error {
    color: var(--danger);
}

.study-note-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.study-note-retry {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--danger);
    font-size: 11.5px;
    text-decoration: underline;
    cursor: pointer;
}

.study-note-count {
    font-variant-numeric: tabular-nums;
}

.study-tutor-pane .tutor-context {
    padding-top: 10px;
    padding-bottom: 10px;
}

.study-thread-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    color: var(--muted-2);
    font-size: 12px;
}

.study-thread-loading .spinner {
    width: 14px;
    height: 14px;
    border-width: 1.5px;
}

.study-tutor-empty {
    margin: 2px 0 10px 35px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted-2);
}

/* 笔记本浮窗 */

.notes-head {
    align-items: flex-start;
    padding-bottom: 12px;
}

.notes-head .tutor-title {
    max-height: 1.5em;
    overflow: hidden;
}

.notes-tools {
    flex: none;
    padding: 12px 22px;
    border-bottom: 1px solid var(--line);
}

.notes-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    background: var(--surface-2);
    color: var(--muted-2);
}

.notes-search svg {
    width: 15px;
    height: 15px;
    flex: none;
}

.notes-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 13px;
}

.notes-search input::placeholder {
    color: var(--muted-2);
}

.notes-list {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 22px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
}

.notes-list .accum-note-card {
    width: 100%;
    flex: none;
}

.notes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 14px;
    text-align: center;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--muted-2);
}

.notes-empty-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: var(--weight-semibold);
    color: var(--ink);
}

@media (min-width: 1024px) {
    .notes-head {
        padding: 20px 24px 12px;
    }

    .notes-tools {
        padding: 12px 24px;
    }

    .notes-list {
        padding: 12px 24px 20px;
    }
}

/* 可拖动的笔记本悬浮球 */

.study-ball {
    position: fixed;
    z-index: 90;
    width: 58px;
    height: 58px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--brand) 55%, transparent);
    border-radius: 50%;
    background: linear-gradient(145deg, var(--brand), var(--brand-strong));
    color: #fffdf7;
    box-shadow: 0 10px 26px rgba(23, 91, 76, 0.32), 0 3px 8px rgba(27, 26, 23, 0.18);
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition: left 280ms cubic-bezier(0.22, 0.61, 0.36, 1), top 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.study-ball.is-visible {
    display: flex;
}

.study-ball.is-placing {
    transition: none;
}

.study-ball.is-dragging {
    cursor: grabbing;
    transform: scale(1.06);
    box-shadow: 0 14px 32px rgba(23, 91, 76, 0.4), 0 4px 10px rgba(27, 26, 23, 0.24);
    transition: none;
}

.study-ball svg {
    width: 27px;
    height: 27px;
}

.study-ball-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--brand-strong);
}

[data-theme="dark"] .study-ball {
    background: linear-gradient(145deg, #1b4a3e, #0f2f27);
    border-color: var(--brand-line);
    color: var(--brand);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42), 0 3px 8px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .study-ball-dot {
    border-color: #0f2f27;
}

body.is-locked .study-ball {
    visibility: hidden;
    pointer-events: none;
}

/* 积累本中的文章笔记 */

.accum-notes-section {
    border-top: 0;
}

.accum-notes-export {
    margin-left: auto;
    flex: none;
}

.accum-notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    padding: 4px 0 2px;
}

.accum-note-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    text-align: left;
    color: inherit;
    cursor: pointer;
    transition: border-color var(--dur-2), background var(--dur-2);
}

.accum-note-card:hover {
    border-color: var(--brand-line);
    background: var(--surface-2);
}

.accum-note-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.accum-note-title {
    min-width: 0;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: var(--weight-semibold);
    line-height: 1.4;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.accum-note-time {
    flex: none;
    font-size: 11px;
    color: var(--muted-2);
}

.accum-note-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 11.5px;
    color: var(--muted-2);
}

.accum-note-chat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--brand-strong);
}

[data-theme="dark"] .accum-note-chat {
    color: var(--brand);
}

.accum-note-chat svg {
    width: 13px;
    height: 13px;
}

.accum-note-preview {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--muted);
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 900px) {
    .result-notes-btn {
        display: none;
    }
}

.float-resize {
    position: absolute;
    right: 3px;
    bottom: 3px;
    z-index: 8;
    display: none;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    touch-action: none;
    user-select: none;
}

.is-floating .float-resize {
    display: block;
}

.float-resize::before,
.float-resize::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    border-right: 2px solid var(--muted-2);
    border-bottom: 2px solid var(--muted-2);
    border-radius: 0 0 3px 0;
    opacity: 0.65;
}

.float-resize::before {
    width: 12px;
    height: 12px;
}

.float-resize::after {
    width: 6px;
    height: 6px;
}

.is-floating.is-dragging,
.is-floating.is-resizing {
    user-select: none;
}

.is-floating.is-dragging .study-head,
.is-floating.is-dragging .notes-head,
.is-floating.is-resizing .study-head,
.is-floating.is-resizing .notes-head {
    cursor: grabbing;
}

@media (min-width: 1024px) {
    .tutor-root.study-root,
    .tutor-root.notes-root {
        pointer-events: none;
    }

    .tutor-root.study-root .tutor-backdrop,
    .tutor-root.notes-root .tutor-backdrop {
        display: none;
    }

    .study-drawer.is-floating,
    .notes-window.is-floating {
        right: auto;
        bottom: auto;
        transform: none;
        max-height: none;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: var(--r-lg);
        box-shadow: var(--shadow-lg);
        pointer-events: auto;
        animation: study-window-in 180ms var(--ease-out);
    }

    .study-drawer.is-floating.is-closing,
    .notes-window.is-floating.is-closing {
        animation: study-window-out 140ms var(--ease) forwards;
    }

    .study-drawer.is-floating .tutor-grip,
    .notes-window.is-floating .tutor-grip {
        display: none;
    }

    .study-drawer.is-floating .study-head,
    .notes-window.is-floating .notes-head {
        cursor: grab;
    }

    .study-head {
        padding: 22px 24px 12px;
    }

    .study-title {
        font-size: 19px;
    }

    .study-tabs {
        padding: 0 24px;
    }

    .study-note-wrap {
        padding: 16px 24px 10px 32px;
    }

    .study-note-foot {
        padding: 10px 24px 18px;
    }

    .study-tutor-pane .tutor-context {
        padding-left: 24px;
        padding-right: 24px;
    }

    .study-tutor-pane .tutor-thread {
        padding-left: 24px;
        padding-right: 24px;
    }

    .study-tutor-pane .tutor-inputbar {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@keyframes study-window-in {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes study-window-out {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.97); }
}

@media (max-width: 640px) {
    .study-drawer {
        height: min(90vh, 860px);
        max-height: min(90vh, 860px);
        height: min(90dvh, 860px);
        max-height: min(90dvh, 860px);
        border-radius: 20px 20px 0 0;
    }

    .study-head {
        padding: 10px 18px 8px;
    }

    .study-sub {
        display: none;
    }

    .study-tabs {
        gap: 16px;
        padding: 0 18px;
    }

    .study-note-wrap {
        padding: 12px 18px 6px 28px;
    }

    .study-note-input {
        font-size: 16px;
    }

    .study-note-foot {
        padding: 8px 18px calc(12px + env(safe-area-inset-bottom));
    }

    .accum-notes-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media print {
    .study-ball,
    .result-notes-btn,
    .study-root {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .study-ball,
    .study-drawer {
        transition: none !important;
        animation: none !important;
    }
}

/* 笔记自动编号提示 */

.study-note-hint {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 10.5px;
    color: var(--muted-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 720px) {
    .study-note-hint {
        display: none;
    }
}

/* ------------------------------ 文章笔记导出 ------------------------------ */

.notes-tools-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notes-tools-row .notes-search {
    flex: 1;
    min-width: 0;
}

.notes-export-open {
    flex: none;
    white-space: nowrap;
}

.notes-export-open svg {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

.notes-export-view {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 10px;
}

.notes-export-hero {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: var(--r-md);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--brand) 7%, transparent), transparent 60%),
        var(--surface-2);
}

.notes-export-hero-icon {
    width: 42px;
    height: 42px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--brand-line);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--brand-strong);
}

[data-theme="dark"] .notes-export-hero-icon {
    color: var(--brand);
}

.notes-export-hero-icon svg {
    width: 22px;
    height: 22px;
}

.notes-export-hero-title {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: var(--weight-semibold);
    line-height: 1.4;
    color: var(--ink);
}

.notes-export-hero-desc {
    margin: 5px 0 0;
    font-size: 12px;
    line-height: 1.75;
    color: var(--muted);
}

.notes-export-layout {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface-2);
}

.notes-export-layout-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: none;
    font-size: 12px;
    font-weight: var(--weight-semibold);
    color: var(--ink-2);
}

.notes-export-layout-label svg {
    width: 14px;
    height: 14px;
    color: var(--brand);
}

.notes-export-pages {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.notes-export-pages button {
    height: 28px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    background: var(--surface);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: var(--weight-medium);
    white-space: nowrap;
    transition: color var(--dur-2), border-color var(--dur-2), background var(--dur-2);
}

.notes-export-pages button:hover {
    border-color: var(--brand-line);
    color: var(--brand-strong);
}

.notes-export-pages button.is-active {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-weight: var(--weight-semibold);
}

.notes-export-pages button:disabled {
    opacity: 0.55;
    cursor: default;
}

[data-theme="dark"] .notes-export-pages button.is-active {
    color: var(--brand);
}

.notes-export-layout-hint {
    flex: 1;
    min-width: 160px;
    font-size: 11px;
    line-height: 1.55;
    color: var(--muted-2);
}

.notes-export-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
}

.notes-export-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--ink-2);
    cursor: pointer;
    user-select: none;
}

.notes-export-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--brand);
    cursor: pointer;
}

.notes-export-count {
    font-size: 11.5px;
    color: var(--muted-2);
    font-variant-numeric: tabular-nums;
}

.notes-export-spacer {
    flex: 1;
    min-width: 12px;
}

.notes-export-toolbar .btn {
    height: 32px;
    padding: 0 11px;
    font-size: 12px;
}

.notes-export-toolbar .btn svg {
    width: 13px;
    height: 13px;
    margin-right: 4px;
}

.notes-export-progress {
    padding: 13px 15px;
    border: 1px solid var(--brand-line);
    border-radius: var(--r-md);
    background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}

.notes-export-progress-top {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--ink-2);
}

.notes-export-progress-top .spinner {
    width: 14px;
    height: 14px;
    border-width: 1.5px;
    flex: none;
}

.notes-export-progress-top span[data-export-progress-text] {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-export-progress-top strong {
    flex: none;
    font-size: 12px;
    color: var(--brand-strong);
    font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .notes-export-progress-top strong {
    color: var(--brand);
}

.notes-export-bar {
    height: 4px;
    margin-top: 10px;
    border-radius: 99px;
    background: var(--surface-3);
    overflow: hidden;
}

.notes-export-bar span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    transition: width 300ms var(--ease-out);
}

.notes-export-error {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 10px 12px;
    border: 1px solid var(--danger-line);
    border-radius: var(--r-md);
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 12px;
    line-height: 1.6;
}

.notes-export-error svg {
    width: 15px;
    height: 15px;
    flex: none;
    margin-top: 1px;
}

.notes-export-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.notes-export-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    cursor: pointer;
    transition: border-color var(--dur-2), background var(--dur-2);
}

.notes-export-item:hover {
    border-color: var(--brand-line);
    background: var(--surface-2);
}

.notes-export-item.is-selected {
    border-color: var(--brand-line);
    background: color-mix(in srgb, var(--brand) 5%, var(--surface));
}

.notes-export-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex: none;
    accent-color: var(--brand);
    cursor: pointer;
}

.notes-export-item-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notes-export-item-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.notes-export-item-title {
    min-width: 0;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: var(--weight-semibold);
    line-height: 1.4;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-export-item-meta,
.notes-export-item-counts {
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--muted-2);
}

.notes-export-item-counts {
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.notes-export-status {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    font-size: 10.5px;
    white-space: nowrap;
}

.notes-export-status.is-new {
    border-color: var(--line-strong);
    color: var(--muted);
}

.notes-export-status.is-update {
    border-color: var(--accent-line);
    background: var(--accent-soft);
    color: var(--accent);
}

.notes-export-status.is-ready {
    border-color: var(--success-line);
    background: var(--success-soft);
    color: var(--success);
}

@media (max-width: 640px) {
    .notes-export-hero {
        padding: 15px;
    }

    .notes-export-hero-icon {
        display: none;
    }

    .notes-export-hero-title {
        font-size: 17px;
    }

    .notes-export-layout {
        align-items: stretch;
    }

    .notes-export-layout-hint {
        flex-basis: 100%;
    }

    .notes-export-pages {
        flex: 1;
    }

    .notes-export-pages button {
        flex: 1;
    }

    .notes-export-toolbar {
        align-items: stretch;
    }

    .notes-export-spacer {
        display: none;
    }

    .notes-export-toolbar .btn {
        flex: 1;
        min-width: calc(50% - 5px);
    }

    .notes-export-item-top {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}

/* ------------------------------ 背诵提纲预览 ------------------------------ */

.outline-preview {
    max-height: 66vh;
    overflow-y: auto;
    padding-right: 2px;
}

.outline-preview-head {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.outline-preview-title {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: var(--weight-semibold);
    color: var(--ink);
}

.outline-preview-articles {
    margin-top: 5px;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--muted-2);
    word-break: break-word;
}

.outline-tabs {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    padding: 12px 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.outline-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    background: transparent;
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 11.5px;
    cursor: pointer;
    transition: color var(--dur-2), border-color var(--dur-2), background var(--dur-2);
}

.outline-tab span {
    min-width: 17px;
    padding: 0 4px;
    border-radius: var(--r-full);
    background: var(--surface-3);
    color: var(--muted-2);
    font-size: 10px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.outline-tab:hover {
    border-color: var(--brand-line);
    color: var(--ink-2);
}

.outline-tab.is-active {
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 8%, transparent);
    color: var(--brand-strong);
    font-weight: var(--weight-semibold);
}

[data-theme="dark"] .outline-tab.is-active {
    color: var(--brand);
}

.outline-tab.is-active span {
    background: var(--brand);
    color: #fffdf7;
}

.outline-panel {
    padding-top: 4px;
}

.outline-list {
    display: flex;
    flex-direction: column;
}

.outline-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.outline-item:last-child {
    border-bottom: 0;
}

.outline-item-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.outline-item-title {
    font-family: var(--font-en);
    font-size: 16px;
    font-weight: var(--weight-semibold);
    color: var(--ink);
    word-break: break-word;
}

.outline-item-title.is-sentence {
    font-size: 14px;
    line-height: 1.6;
    color: var(--brand-strong);
}

[data-theme="dark"] .outline-item-title.is-sentence {
    color: var(--brand);
}

.outline-pos {
    padding: 1px 7px;
    border: 1px solid var(--brand-line);
    border-radius: var(--r-full);
    background: color-mix(in srgb, var(--brand) 7%, transparent);
    color: var(--brand-strong);
    font-size: 10.5px;
}

[data-theme="dark"] .outline-pos {
    color: var(--brand);
}

.outline-source {
    margin-left: auto;
    font-size: 10px;
    color: var(--muted-2);
    white-space: nowrap;
}

.outline-main {
    margin-top: 5px;
    font-size: 12.5px;
    line-height: 1.75;
    color: var(--ink-2);
}

.outline-forms {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    margin-top: 7px;
}

.outline-form {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-family: var(--font-en);
    font-size: 11.5px;
    color: var(--ink-2);
}

.outline-form i {
    font-family: var(--font-ui);
    font-size: 10px;
    font-style: normal;
    color: var(--muted-2);
}

.outline-note {
    margin-top: 6px;
    padding-left: 10px;
    border-left: 2px solid var(--line-strong);
    font-size: 11.5px;
    line-height: 1.65;
    color: var(--muted);
}

.outline-example {
    margin-top: 7px;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
}

.outline-example p {
    margin: 0;
    font-family: var(--font-en);
    font-size: 12px;
    line-height: 1.7;
    color: var(--ink-2);
}

.outline-example p + p {
    margin-top: 3px;
    font-family: var(--font-ui);
    font-size: 11.5px;
    color: var(--muted-2);
}

.outline-structure {
    margin-top: 7px;
    padding: 8px 11px;
    border-left: 2px solid var(--accent);
    background: var(--accent-soft);
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--ink-2);
}

.outline-empty {
    padding: 30px 10px;
    text-align: center;
    font-size: 12px;
    color: var(--muted-2);
}

.outline-preview-foot {
    font-size: 11px;
    line-height: 1.6;
    color: var(--muted-2);
}

@media (max-width: 640px) {
    .outline-preview {
        max-height: 62vh;
    }

    .outline-preview-title {
        font-size: 17px;
    }

    .outline-source {
        margin-left: 0;
    }

    .outline-tabs {
        gap: 6px;
    }

    .outline-tab {
        height: 28px;
        padding: 0 8px;
        font-size: 11px;
    }

    .outline-preview-foot {
        display: none;
    }
}
