/* ZPB 阅读器样式 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #1a1a2e;
    --bg-light: #16213e;
    --text: #e0e0e0;
    --text-muted: #999;
    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-light: rgba(124, 58, 237, 0.2);
    --toolbar-bg: rgba(15, 15, 30, 0.95);
    --border: rgba(255, 255, 255, 0.08);
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --highlight-yellow: rgba(255, 235, 59, 0.35);
    --underline-color: #60a5fa;
    --panel-width: 320px;
    --toolbar-height: 52px;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    touch-action: pan-x pan-y pinch-zoom;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

input {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 10px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    width: 100%;
}

input:focus { border-color: var(--accent); }

svg.icon { width: 20px; height: 20px; fill: currentColor; }

.zpb-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--toolbar-height);
    background: var(--toolbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    z-index: 100;
}

.zpb-toolbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: #1a1a2e;
    pointer-events: none;
}

.zpb-toolbar .btn-back {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-muted);
    transition: all .15s;
    white-space: nowrap;
}

.zpb-toolbar .btn-back:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.zpb-toolbar .btn-back svg { width: 16px; height: 16px; }

.zpb-toolbar .book-title-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
}

.zpb-toolbar .book-title {
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.zpb-toolbar .book-subtitle {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.25;
    color: rgba(203, 213, 225, 0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.zpb-toolbar .toolbar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.zpb-export-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.zpb-toolbar .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--text-muted);
    transition: all .15s;
    font-size: 13px;
}

.zpb-toolbar .btn-icon .btn-label {
    display: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

.zpb-toolbar .btn-catalog-trigger {
    width: auto;
    padding: 0 12px;
    gap: 6px;
}

.zpb-toolbar .btn-toolbar-text .btn-label,
.zpb-toolbar .btn-catalog-trigger .btn-label {
    display: inline-block;
}

.zpb-toolbar .btn-toolbar-text {
    width: auto;
    padding: 0 12px;
    gap: 6px;
}

.zpb-toolbar .btn-icon:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.zpb-toolbar .btn-icon.active {
    color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 1px rgba(124,58,237,0.32), inset 0 1px 0 rgba(255,255,255,0.08);
}
.zpb-toolbar .btn-icon-emphasis {
    color: #ddd6fe;
    background: rgba(124,58,237,0.18);
    border: 1px solid rgba(124,58,237,0.32);
}

.zpb-toolbar .btn-icon-emphasis:hover,
.zpb-toolbar .btn-icon-emphasis.active {
    color: #fff;
    background: rgba(124,58,237,0.28);
    border-color: rgba(167,139,250,0.46);
}

.zpb-toolbar .btn-icon.is-disabled,
.zpb-toolbar .btn-icon:disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: auto;
}

.zpb-toolbar .btn-icon.is-disabled:hover,
.zpb-toolbar .btn-icon:disabled:hover {
    color: var(--text-muted);
    background: transparent;
}

.zpb-toolbar .btn-export-annotated.is-loading {
    color: #fde68a;
    background: rgba(245,158,11,0.14);
    border: 1px solid rgba(245,158,11,0.32);
}

.zpb-toolbar .btn-export-annotated.is-loading .icon {
    animation: zpb-export-spin 1s linear infinite;
}

.zpb-toolbar .btn-export-annotated.is-ready {
    color: #d1fae5;
    background: rgba(16,185,129,0.18);
    border: 1px solid rgba(16,185,129,0.34);
}

.zpb-toolbar .btn-export-annotated.is-ready:hover {
    color: #ecfdf5;
    background: rgba(16,185,129,0.24);
}

.zpb-toolbar .btn-export-list {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.22);
}

.zpb-toolbar .btn-export-list:hover,
.zpb-toolbar .btn-export-list.active {
    color: #eff6ff;
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(147, 197, 253, 0.36);
}

@keyframes zpb-export-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.zpb-toolbar .page-info {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
    margin: 0 4px;
}

.zpb-member-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    transition: transform .15s, border-color .15s, box-shadow .15s;
    flex-shrink: 0;
}

.zpb-member-avatar:hover {
    transform: translateY(-1px);
    border-color: rgba(124,58,237,0.45);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

.zpb-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.zpb-reader-seo-header {
    position: fixed;
    top: var(--toolbar-height);
    left: 0;
    right: 0;
    z-index: 97;
    padding: 8px 12px 0;
    pointer-events: none;
}

.zpb-reader-seo-header > * {
    pointer-events: auto;
}

.zpb-reader-breadcrumb {
    width: min(1200px, 100%);
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(226,232,240,0.82);
    font-size: 12px;
    line-height: 1.4;
}

.zpb-reader-breadcrumb a {
    color: #c4b5fd;
}

.zpb-reader-breadcrumb .sep {
    color: rgba(148,163,184,0.7);
}

.zpb-reader-intro {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(124,58,237,0.2);
    box-shadow: 0 12px 30px rgba(2,6,23,0.22);
    position: relative;
}

.zpb-reader-panel-dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(226,232,240,0.86);
    font-size: 14px;
    line-height: 1;
    transition: all .18s ease;
}

.zpb-reader-panel-dismiss:hover {
    background: rgba(124,58,237,0.18);
    border-color: rgba(167,139,250,0.28);
    color: #fff;
}

.zpb-reader-intro-toggle {
    position: fixed;
    top: calc(var(--toolbar-height) + 8px);
    right: 12px;
    z-index: 97;
    display: none;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(15,23,42,0.92);
    border: 1px solid rgba(124,58,237,0.3);
    color: #ddd6fe;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(2,6,23,0.28);
}

body.zpb-reader-intro-collapsed .zpb-reader-seo-header {
    display: none;
}

body.zpb-reader-intro-collapsed .zpb-reader-intro-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.zpb-reader-page-indexable.zpb-reader-intro-collapsed .zpb-reader-main {
    top: calc(var(--toolbar-height) + 8px);
}

body.zpb-reader-page-indexable.zpb-reader-intro-collapsed .zpb-cloud-mode-banner {
    top: calc(var(--toolbar-height) + 52px);
}

.zpb-reader-intro-title {
    font-size: 20px;
    line-height: 1.35;
    font-weight: 700;
    color: #f8fafc;
}

.zpb-reader-intro-desc {
    margin-top: 6px;
    color: rgba(226,232,240,0.88);
    font-size: 13px;
    line-height: 1.7;
}

.zpb-reader-intro-focus {
    margin-top: 6px;
    color: rgba(196,181,253,0.92);
    font-size: 12px;
    line-height: 1.7;
}

.zpb-reader-intro-meta {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.zpb-reader-meta-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
}

.zpb-reader-page-indexable .zpb-reader-main {
    top: calc(var(--toolbar-height) + 116px);
}

.zpb-reader-page-indexable .zpb-cloud-mode-banner {
    top: calc(var(--toolbar-height) + 108px);
}

.zpb-reader-main {
    position: fixed;
    top: var(--toolbar-height);
    left: 0;
    right: 0;
    bottom: var(--toolbar-height);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
    background: var(--bg);
    padding: 10px 12px 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(124,58,237,0.42) rgba(15,23,42,0.22);
}

.zpb-reader-main::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.zpb-reader-main::-webkit-scrollbar-track {
    background: rgba(15,23,42,0.22);
}

.zpb-reader-main::-webkit-scrollbar-thumb {
    background: rgba(124,58,237,0.42);
    border-radius: 999px;
    border: 2px solid rgba(15,23,42,0.22);
}

.zpb-reader-main::-webkit-scrollbar-thumb:hover {
    background: rgba(124,58,237,0.56);
}

.zpb-cloud-mode-banner {
    position: fixed;
    top: calc(var(--toolbar-height) + 10px);
    left: 12px;
    right: 12px;
    z-index: 96;
    display: none;
    pointer-events: none;
}

.zpb-cloud-mode-content {
    width: min(920px, 100%);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(15,23,42,0.94);
    border: 1px solid rgba(124,58,237,0.24);
    box-shadow: 0 12px 32px rgba(2,6,23,0.28);
    pointer-events: auto;
}

.zpb-cloud-mode-texts {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.zpb-cloud-mode-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(124,58,237,0.18);
    color: #ddd6fe;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.zpb-cloud-mode-text {
    color: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zpb-cloud-mode-exit-btn,
.zpb-share-restore-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    transition: background .18s ease, border-color .18s ease, transform .15s ease;
    white-space: nowrap;
}

.zpb-cloud-mode-exit-btn:hover,
.zpb-share-restore-btn:hover {
    background: rgba(124,58,237,0.18);
    border-color: rgba(167,139,250,0.28);
    transform: translateY(-1px);
}

.zpb-canvas-wrapper {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    transition: transform .08s ease-out;
    max-width: 100%;
}

.zpb-canvas-wrapper canvas {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    display: block;
    max-width: 100%;
    height: auto;
}

.zpb-annotations-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: auto;
    z-index: 10;
}

.zpb-annotations-overlay[data-tool="rect"],
.zpb-annotations-overlay[data-tool="ellipse"],
.zpb-annotations-overlay[data-tool="textbox"],
.zpb-annotations-overlay[data-tool="highlight"],
.zpb-annotations-overlay[data-tool="text"],
.zpb-annotations-overlay[data-tool="zoom_box"] {
    cursor: crosshair;
}

.zpb-annotations-overlay[data-tool="punctuation"] {
    cursor: cell;
}

.zpb-annotations-overlay[data-tool="freehand"] {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M4 16l7-7 4 4-7 7H4v-4zm11.7-8.3l1.6-1.6a1 1 0 0 1 1.4 0l1.3 1.3a1 1 0 0 1 0 1.4L18.4 10l-2.7-2.3z'/%3E%3C/svg%3E") 2 22, crosshair;
}

.zpb-annotations-overlay.is-annotation-disabled { cursor: not-allowed; }

.zpb-annotations-overlay .ann-highlight {
    position: absolute;
    background: var(--highlight-yellow);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 2px;
    pointer-events: auto;
    cursor: pointer;
    transition: background .15s, box-shadow .15s, border-color .15s;
}

.zpb-annotations-overlay .ann-highlight:hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22); }

.zpb-annotations-overlay .ann-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(127, 29, 29, 0.22);
    color: rgba(255, 255, 255, 0.52);
    font-size: 10px;
    line-height: 1.45;
    letter-spacing: .02em;
    pointer-events: none;
    z-index: 1;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.zpb-annotations-overlay .ann-highlight:hover .ann-badge,
.zpb-annotations-overlay .ann-text-box:hover .ann-badge {
    background: rgba(127, 29, 29, 0.52);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}

.zpb-annotations-overlay .ann-underline {
    position: absolute;
    border-bottom: 2px solid var(--underline-color);
    pointer-events: auto;
    cursor: pointer;
}

.zpb-annotations-overlay .ann-text-box {
    position: absolute;
    border-radius: 6px;
    pointer-events: auto;
    cursor: pointer;
    border: 1px solid rgba(239, 68, 68, 0.55);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.zpb-annotations-overlay .ann-text-box:hover {
    box-shadow: 0 0 0 1px rgba(248,113,113,0.28), inset 0 0 0 1px rgba(255,255,255,0.16);
}

.zpb-annotations-overlay .ann-text-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    color: inherit;
    font-size: 12px;
    line-height: 1.45;
    text-shadow: 0 1px 1px rgba(0,0,0,0.32);
    overflow: visible;
    pointer-events: none;
}

.zpb-annotations-overlay .ann-text-content.has-fade::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 20px;
    background: linear-gradient(180deg, rgba(127,29,29,0), rgba(127,29,29,0.85));
}

.zpb-annotations-overlay .ann-text-marker {
    position: absolute;
    width: 22px;
    height: 22px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #fff;
    font-weight: bold;
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.zpb-annotations-overlay .ann-rect,
.zpb-annotations-overlay .ann-ellipse {
    position: absolute;
    pointer-events: auto;
    cursor: move;
    border: 2px solid currentColor;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
}

.zpb-annotations-overlay .ann-highlight.is-selected,
.zpb-annotations-overlay .ann-rect.is-selected,
.zpb-annotations-overlay .ann-ellipse.is-selected {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.28), 0 0 0 5px rgba(124,58,237,0.26);
}

.zpb-annotations-overlay .ann-text-box.is-selected {
    text-shadow: 0 0 8px rgba(124,58,237,0.35);
}

.zpb-annotations-overlay .ann-ellipse {
    border-radius: 999px;
}

.zpb-annotations-overlay .ann-punctuation {
    position: absolute;
    min-width: 16px;
    min-height: 16px;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    pointer-events: auto;
    cursor: pointer;
    padding: 0;
    overflow: visible;
}

.zpb-annotations-overlay .ann-punctuation.is-selected {
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.32), 0 0 0 5px rgba(124,58,237,0.28);
    background: rgba(124,58,237,0.12);
}

.zpb-annotations-overlay .ann-punctuation-symbol {
    display: block;
    line-height: 0;
    pointer-events: none;
}

.zpb-punctuation-graphic {
    display: block;
    width: 1em;
    height: 1em;
    overflow: visible;
    color: currentColor;
    pointer-events: none;
}

.zpb-punctuation-graphic.is-annotation {
    width: 100%;
    height: 100%;
}

.zpb-freehand-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
    pointer-events: none;
}

.zpb-freehand-layer path {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: stroke;
    cursor: pointer;
    vector-effect: non-scaling-stroke;
}

.zpb-freehand-layer path.is-selected {
    filter: drop-shadow(0 0 3px rgba(255,255,255,0.55)) drop-shadow(0 0 6px rgba(124,58,237,0.4));
}

.zpb-inline-text-editor {
    position: absolute;
    min-width: 140px;
    min-height: 48px;
    padding: 6px 8px;
    border-radius: 0;
    border: 1px dashed rgba(167,139,250,0.8);
    background: rgba(15,23,42,0.12);
    color: #fff1f2;
    font-size: 32px;
    line-height: 1.5;
    resize: both;
    outline: none;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
    z-index: 35;
    overflow: auto;
}

.zpb-inline-text-editor::placeholder {
    color: rgba(255,255,255,0.48);
}

.zpb-inline-text-editor:focus {
    border-color: rgba(196,181,253,0.98);
    background: rgba(15,23,42,0.18);
    box-shadow: 0 0 0 2px rgba(124,58,237,0.2);
}

.zpb-inline-text-editor.is-artistic {
    min-width: 56px;
    min-height: 32px;
}

.zpb-inline-text-editor.is-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.zpb-inline-text-editor.has-stroke {
    -webkit-text-stroke: 1px rgba(15,23,42,0.88);
    text-shadow: 0 1px 2px rgba(15,23,42,0.35);
}

.zpb-inline-text-editor-actions {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 36;
    padding: 4px 6px;
    border-radius: 999px;
    background: rgba(15,23,42,0.92);
    border: 1px solid rgba(167,139,250,0.35);
    box-shadow: 0 8px 22px rgba(0,0,0,0.28);
}

.zpb-inline-text-editor-btn {
    min-width: 48px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
}

.zpb-annotations-overlay .ann-text-box {
    position: absolute;
    pointer-events: auto;
    cursor: move;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0;
    overflow: visible;
}

.zpb-annotations-overlay .ann-text-box.is-artistic {
    min-width: 0;
    min-height: 0;
}

.zpb-annotations-overlay .ann-text-box.is-vertical .ann-text-content {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.zpb-annotations-overlay .ann-text-content {
    display: block;
    white-space: pre;
    word-break: normal;
    line-height: 1.45;
    user-select: none;
}

.zpb-annotations-overlay .ann-text-content.has-stroke {
    -webkit-text-stroke: 1px rgba(15,23,42,0.88);
    text-shadow: 0 1px 2px rgba(15,23,42,0.35);
}

.ann-text-selection-frame {
    position: absolute;
    inset: -6px;
    border: 1px dashed rgba(167,139,250,0.95);
    border-radius: 6px;
    background: rgba(124,58,237,0.06);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.14);
    pointer-events: none;
}

.ann-text-selection-meta {
    position: absolute;
    left: -6px;
    top: -32px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(15,23,42,0.92);
    border: 1px solid rgba(167,139,250,0.45);
    color: #ddd6fe;
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 6px 18px rgba(0,0,0,0.28);
}

.ann-text-resize-handle {
    position: absolute;
    right: -11px;
    bottom: -11px;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background: #a78bfa;
    border: 1px solid rgba(255,255,255,0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
    cursor: nwse-resize;
    z-index: 3;
}

.ann-text-box.is-artistic .ann-text-resize-handle {
    width: 10px;
    height: 10px;
    right: auto;
    bottom: auto;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #8b5cf6;
    box-shadow: 0 1px 6px rgba(15,23,42,0.28);
    z-index: 4;
}

.ann-text-box.is-artistic .ann-text-selection-frame {
    inset: -8px;
    border: 1px solid rgba(139,92,246,0.95);
    border-radius: 4px;
    background: rgba(139,92,246,0.04);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.3);
}

.ann-text-box.is-artistic .ann-text-selection-meta {
    left: 50%;
    top: -38px;
    transform: translateX(-50%);
}

.ann-text-box.is-artistic .ann-text-resize-handle.handle-nw {
    left: -8px;
    top: -8px;
    right: auto;
    bottom: auto;
    transform: none;
}

.ann-text-box.is-artistic .ann-text-resize-handle.handle-n {
    left: 50%;
    top: -8px;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
}

.ann-text-box.is-artistic .ann-text-resize-handle.handle-ne {
    left: auto;
    top: -8px;
    right: -8px;
    bottom: auto;
    transform: none;
}

.ann-text-box.is-artistic .ann-text-resize-handle.handle-e {
    left: auto;
    top: 50%;
    right: -8px;
    bottom: auto;
    transform: translateY(-50%);
}

.ann-text-box.is-artistic .ann-text-resize-handle.handle-se {
    left: auto;
    top: auto;
    right: -8px;
    bottom: -8px;
    transform: none;
}

.ann-text-box.is-artistic .ann-text-resize-handle.handle-s {
    left: 50%;
    top: auto;
    right: auto;
    bottom: -8px;
    transform: translateX(-50%);
}

.ann-text-box.is-artistic .ann-text-resize-handle.handle-sw {
    left: -8px;
    top: auto;
    right: auto;
    bottom: -8px;
    transform: none;
}

.ann-text-box.is-artistic .ann-text-resize-handle.handle-w {
    left: -8px;
    top: 50%;
    right: auto;
    bottom: auto;
    transform: translateY(-50%);
}

.ann-shape-resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: #a78bfa;
    border: 1px solid rgba(255,255,255,0.92);
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
    z-index: 2;
}

.ann-text-resize-handle.handle-nw,
.ann-shape-resize-handle.handle-nw {
    left: -8px;
    top: -8px;
    cursor: nwse-resize;
}

.ann-text-resize-handle.handle-n,
.ann-shape-resize-handle.handle-n {
    left: 50%;
    top: -8px;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.ann-text-resize-handle.handle-ne,
.ann-shape-resize-handle.handle-ne {
    right: -8px;
    top: -8px;
    cursor: nesw-resize;
}

.ann-text-resize-handle.handle-e,
.ann-shape-resize-handle.handle-e {
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.ann-text-resize-handle.handle-se,
.ann-shape-resize-handle.handle-se {
    right: -8px;
    bottom: -8px;
    cursor: nwse-resize;
}

.ann-text-resize-handle.handle-s,
.ann-shape-resize-handle.handle-s {
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.ann-text-resize-handle.handle-sw,
.ann-shape-resize-handle.handle-sw {
    left: -8px;
    bottom: -8px;
    cursor: nesw-resize;
}

.ann-text-resize-handle.handle-w,
.ann-shape-resize-handle.handle-w {
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}

.zpb-selection-toolbar {
    position: absolute;
    background: rgba(30, 30, 50, 0.98);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px 10px;
    display: none;
    gap: 8px;
    z-index: 50;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.zpb-selection-toolbar.visible { display: flex; }

.zpb-selection-step {
    display: none;
    align-items: center;
    gap: 8px;
}

.zpb-selection-step.is-active { display: flex; }

.zpb-selection-toolbar button {
    white-space: nowrap;
    transition: all .15s;
    color: var(--text-muted);
}

.zpb-selection-toolbar .btn-select-type {
    min-width: 86px;
    padding: 8px 12px;
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}

.zpb-selection-toolbar .btn-select-type:hover {
    color: #fff;
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.16);
}

.zpb-selection-toolbar .btn-select-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zpb-selection-toolbar .btn-select-icon .icon {
    width: 18px;
    height: 18px;
}

.zpb-selection-toolbar .btn-select-text {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
}

.zpb-annotation-tools-panel {
    position: fixed;
    top: var(--toolbar-height);
    left: 0;
    bottom: var(--toolbar-height);
    width: 340px;
    background: rgba(15, 15, 30, 0.98);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: translateX(-100%);
    transition: transform .18s ease;
    z-index: 90;
    display: flex;
    flex-direction: column;
    box-shadow: 14px 0 40px rgba(2,6,23,0.38);
    overflow: hidden;
}

.zpb-annotation-tools-panel.open {
    transform: translateX(0);
}

.zpb-annotation-tools-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 11px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background:
        linear-gradient(180deg, rgba(79,70,229,0.10), rgba(79,70,229,0.02)),
        linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
    flex-shrink: 0;
}

.zpb-annotation-tools-panel .panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.zpb-panel-title-badge {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124,58,237,0.9), rgba(99,102,241,0.92));
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 8px 20px rgba(79,70,229,0.28);
    flex-shrink: 0;
}

.zpb-panel-title-texts {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.zpb-panel-title-main {
    color: #f5f3ff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.zpb-panel-title-sub {
    color: rgba(221,214,254,0.72);
    font-size: 10px;
    line-height: 1.2;
}

.zpb-annotation-tools-panel .btn-close-panel {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.04);
    color: rgba(221,214,254,0.72);
    transition: all .18s ease;
}

.zpb-annotation-tools-panel .btn-close-panel:hover {
    color: #fff;
    background: rgba(124,58,237,0.18);
    border-color: rgba(167,139,250,0.28);
    transform: translateY(-1px);
}

.zpb-tools-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 10px 14px;
    overflow-y: auto;
}

.zpb-tool-section {
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 13px;
    background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02));
    padding: 10px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.zpb-tool-section-title {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: #ddd6fe;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.03);
    border: 0;
    padding: 7px 9px;
    text-align: left;
    cursor: pointer;
    border-radius: 10px;
    transition: background .18s ease, color .18s ease;
}

.zpb-tool-section-title-main {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.zpb-tool-section-title:hover {
    background: rgba(124,58,237,0.12);
    color: #f5f3ff;
}

.zpb-tool-section-toggle {
    color: rgba(221,214,254,0.76);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
}

.zpb-tool-section-body {
    display: block;
    padding-top: 0;
}

.zpb-tool-section.is-collapsed .zpb-tool-section-title {
    margin-bottom: 0;
}

.zpb-tool-section.is-collapsed .zpb-tool-section-body {
    display: none;
}

.zpb-tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.zpb-tool-grid-graphic {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.zpb-tool-grid-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.zpb-tool-grid-text {
    margin-bottom: 8px;
}

.zpb-tool-btn,
.zpb-punctuation-btn {
    min-height: 34px;
    border-radius: 9px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    transition: all .15s ease;
}

.zpb-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
}

.zpb-tool-btn:hover,
.zpb-punctuation-btn:hover {
    background: rgba(124,58,237,0.14);
    border-color: rgba(124,58,237,0.36);
}

.zpb-ui-icon {
    position: relative;
    width: 14px;
    height: 14px;
    display: inline-block;
    flex-shrink: 0;
    color: currentColor;
    opacity: 0.9;
}

.zpb-ui-icon::before,
.zpb-ui-icon::after {
    content: "";
    position: absolute;
    box-sizing: border-box;
}

.zpb-ui-icon.icon-select::before,
.zpb-ui-icon.icon-annotate::before,
.zpb-ui-icon.icon-punctuation::before,
.zpb-ui-icon.icon-style::before,
.zpb-ui-icon.icon-action::before {
    inset: 1px;
    border: 1.5px solid currentColor;
    border-radius: 4px;
    opacity: 0.9;
}

.zpb-ui-icon.icon-zoom::before,
.zpb-ui-icon.icon-zoom-in::before,
.zpb-ui-icon.icon-zoom-out::before,
.zpb-ui-icon.icon-zoom-box::before {
    left: 1px;
    top: 1px;
    width: 8px;
    height: 8px;
    border: 1.5px solid currentColor;
    border-radius: 999px;
}

.zpb-ui-icon.icon-zoom::after,
.zpb-ui-icon.icon-zoom-in::after,
.zpb-ui-icon.icon-zoom-out::after,
.zpb-ui-icon.icon-zoom-box::after {
    right: 1px;
    bottom: 1px;
    width: 5px;
    height: 1.5px;
    background: currentColor;
    transform: rotate(45deg);
    border-radius: 2px;
}

.zpb-ui-icon.icon-pointer::before {
    left: 2px;
    top: 1px;
    width: 0;
    height: 0;
    border-top: 10px solid currentColor;
    border-right: 7px solid transparent;
}

.zpb-ui-icon.icon-pointer::after {
    left: 6px;
    top: 8px;
    width: 2px;
    height: 5px;
    background: currentColor;
    transform: rotate(-30deg);
    border-radius: 2px;
}

.zpb-ui-icon.icon-box-select::before {
    inset: 1px;
    border: 1.5px dashed currentColor;
    border-radius: 3px;
}

.zpb-ui-icon.icon-text::before {
    left: 3px;
    top: 1px;
    width: 8px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    box-shadow: 0 10px 0 currentColor;
}

.zpb-ui-icon.icon-text::after {
    left: 6px;
    top: 1px;
    width: 2px;
    height: 12px;
    background: currentColor;
    border-radius: 2px;
}

.zpb-ui-icon.icon-rect::before {
    inset: 2px 1px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
}

.zpb-ui-icon.icon-ellipse::before {
    inset: 2px 1px;
    border: 1.5px solid currentColor;
    border-radius: 999px;
}

.zpb-ui-icon.icon-freehand::before {
    left: 1px;
    top: 7px;
    width: 12px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transform: rotate(-18deg);
}

.zpb-ui-icon.icon-freehand::after {
    left: 2px;
    top: 3px;
    width: 10px;
    height: 6px;
    border: 1.5px solid currentColor;
    border-color: currentColor transparent transparent transparent;
    border-radius: 50%;
    transform: rotate(-10deg);
}

.zpb-ui-icon.icon-zoom-in {
    background:
        linear-gradient(currentColor, currentColor) center 5px / 5px 1.5px no-repeat,
        linear-gradient(currentColor, currentColor) center 5px / 1.5px 5px no-repeat;
}

.zpb-ui-icon.icon-zoom-out {
    background: linear-gradient(currentColor, currentColor) center 5px / 5px 1.5px no-repeat;
}

.zpb-ui-icon.icon-zoom-box {
    background:
        linear-gradient(currentColor, currentColor) 4px 5px / 4px 1.5px no-repeat,
        linear-gradient(currentColor, currentColor) 6px 3px / 1.5px 5px no-repeat;
}

.zpb-ui-icon.icon-undo::before,
.zpb-ui-icon.icon-redo::before {
    top: 3px;
    width: 7px;
    height: 7px;
    border: 1.5px solid currentColor;
    border-color: currentColor currentColor transparent transparent;
    border-radius: 999px;
}

.zpb-ui-icon.icon-undo::before {
    left: 4px;
    transform: rotate(-135deg);
}

.zpb-ui-icon.icon-undo::after {
    left: 1px;
    top: 5px;
    width: 0;
    height: 0;
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
    border-right: 4px solid currentColor;
}

.zpb-ui-icon.icon-redo::before {
    right: 4px;
    transform: rotate(45deg);
}

.zpb-ui-icon.icon-redo::after {
    right: 1px;
    top: 5px;
    width: 0;
    height: 0;
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
    border-left: 4px solid currentColor;
}

.zpb-ui-icon.icon-delete::before {
    left: 3px;
    top: 4px;
    width: 8px;
    height: 8px;
    border: 1.5px solid currentColor;
    border-top: 0;
    border-radius: 0 0 2px 2px;
}

.zpb-ui-icon.icon-delete::after {
    left: 2px;
    top: 2px;
    width: 10px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    box-shadow: 3px -2px 0 -0.5px currentColor;
}

.zpb-ui-icon.icon-done::before {
    left: 2px;
    top: 2px;
    width: 10px;
    height: 10px;
    border: 1.5px solid currentColor;
    border-radius: 999px;
}

.zpb-ui-icon.icon-done::after {
    left: 5px;
    top: 4px;
    width: 3px;
    height: 6px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.zpb-tool-btn.is-active,
.zpb-punctuation-btn.is-active {
    color: #fff;
    background: rgba(124,58,237,0.26);
    border-color: rgba(167,139,250,0.52);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.zpb-tool-btn.is-disabled,
.zpb-tool-btn:disabled {
    opacity: .42;
    cursor: not-allowed;
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.05);
}

.zpb-tool-btn-danger {
    color: #fecaca;
    border-color: rgba(239,68,68,0.2);
    background: rgba(127,29,29,0.18);
}

.zpb-tool-btn-danger:hover {
    color: #fff;
    background: rgba(185,28,28,0.35);
    border-color: rgba(248,113,113,0.42);
}

.zpb-tool-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.zpb-tool-palette .ann-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.zpb-tool-palette .ann-color-swatch[data-tool-color="#EF4444"] { background: #EF4444; }
.zpb-tool-palette .ann-color-swatch[data-tool-color="#FFEB3B"] { background: #FFEB3B; }
.zpb-tool-palette .ann-color-swatch[data-tool-color="#F97316"] { background: #F97316; }
.zpb-tool-palette .ann-color-swatch[data-tool-color="#22C55E"] { background: #22C55E; }
.zpb-tool-palette .ann-color-swatch[data-tool-color="#60A5FA"] { background: #60A5FA; }
.zpb-tool-palette .ann-color-swatch[data-tool-color="#A855F7"] { background: #A855F7; }

.zpb-tool-palette .ann-color-swatch.is-active {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.14), 0 0 0 5px rgba(124,58,237,0.3);
}

.zpb-punctuation-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.zpb-punctuation-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 18px;
}

.zpb-punctuation-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.zpb-tool-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.zpb-tool-hint {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.5;
}

body.zpb-reader-page {
    background: var(--bg) !important;
}

.zpb-tool-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.zpb-tool-field span {
    font-size: 11px;
    color: #cbd5e1;
    font-weight: 600;
}

.zpb-tool-field input[type="range"],
.zpb-tool-field select {
    width: 100%;
}

.zpb-tool-field select {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--text);
}

.zpb-tool-status {
    padding: 8px 10px;
    border-radius: 9px;
    background: rgba(124,58,237,0.12);
    color: #ddd6fe;
    font-size: 12px;
    line-height: 1.5;
}

.zpb-selection-toolbar .btn-select-highlight .btn-select-icon {
    background: rgba(239,68,68,0.18);
    color: #fca5a5;
}

.zpb-selection-toolbar .btn-select-highlight:hover {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.28);
}

.zpb-selection-toolbar .btn-select-note .btn-select-icon {
    background: rgba(250,204,21,0.2);
    color: #fde047;
}

.zpb-selection-toolbar .btn-select-note:hover {
    background: rgba(250,204,21,0.12);
    border-color: rgba(250,204,21,0.3);
}

.zpb-selection-toolbar .btn-back-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
}

.zpb-selection-toolbar .btn-back-step:hover {
    color: #fff;
    background: rgba(255,255,255,0.12);
}

.zpb-selection-toolbar .ann-color-title {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    padding-right: 2px;
}

.zpb-selection-toolbar .ann-color-palette {
    display: flex;
    align-items: center;
    gap: 6px;
}

.zpb-selection-toolbar .ann-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    padding: 0;
    border: 2px solid rgba(255,255,255,0.22);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}

.zpb-selection-toolbar .ann-color-swatch.is-active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(124,58,237,0.28);
}

.zpb-selection-toolbar .ann-color-swatch[data-color="#EF4444"] { background: #EF4444; }
.zpb-selection-toolbar .ann-color-swatch[data-color="#FFEB3B"] { background: #FFEB3B; }
.zpb-selection-toolbar .ann-color-swatch[data-color="#F97316"] { background: #F97316; }
.zpb-selection-toolbar .ann-color-swatch[data-color="#22C55E"] { background: #22C55E; }
.zpb-selection-toolbar .ann-color-swatch[data-color="#60A5FA"] { background: #60A5FA; }

.zpb-selection-toolbar button:disabled {
    opacity: .45;
    cursor: not-allowed;
    background: transparent !important;
    color: var(--text-muted) !important;
}

.zpb-selection-box {
    position: absolute;
    border: 2px dashed var(--accent);
    background: rgba(124, 58, 237, 0.15);
    border-radius: 4px;
    pointer-events: none;
    display: none;
}

.zpb-selection-box[data-preview="rect"] {
    border-style: solid;
    border-color: currentColor;
    background: rgba(239, 68, 68, 0.08);
}

.zpb-selection-box[data-preview="ellipse"] {
    border-style: solid;
    border-color: currentColor;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 999px;
}

.zpb-selection-box[data-preview="zoom_box"] {
    border-style: dashed;
    border-color: #a78bfa;
    background: rgba(124, 58, 237, 0.12);
    border-radius: 8px;
}

.zpb-annotation-login-hint {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(15, 15, 30, 0.88);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 1;
    transition: opacity .28s ease, transform .28s ease;
}

.zpb-annotation-login-hint.is-auto-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
}

.zpb-feature-gate {
    position: absolute;
    top: 58px;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 10, 22, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 20;
}

.zpb-feature-gate.is-visible {
    display: flex;
}

.zpb-feature-gate-card {
    width: min(100%, 320px);
    padding: 24px 22px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.1);
    background: linear-gradient(180deg, rgba(30,41,59,0.96), rgba(15,23,42,0.96));
    box-shadow: 0 18px 48px rgba(2,6,23,0.38);
    text-align: center;
}

.zpb-feature-gate-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(168,85,247,0.18);
    border: 1px solid rgba(168,85,247,0.32);
    color: #ddd6fe;
    font-size: 12px;
    font-weight: 700;
}

.zpb-feature-gate-title {
    margin-top: 14px;
    color: #f8fafc;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
}

.zpb-feature-gate-desc {
    margin-top: 10px;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.8;
}

.zpb-feature-gate-actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.zpb-feature-gate-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 132px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all .18s ease;
}

.zpb-feature-gate-btn.is-primary {
    background: #8b5cf6;
    color: #fff;
}

.zpb-feature-gate-btn.is-primary:hover {
    background: #7c3aed;
    color: #fff;
}

.zpb-feature-gate-btn.is-vip {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    color: #f8fafc;
}

.zpb-feature-gate-btn.is-vip:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

.zpb-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--toolbar-height);
    background: var(--toolbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 16px;
    z-index: 100;
}

.zpb-bottom-bar .btn-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    transition: all .15s;
}

.zpb-bottom-bar .btn-nav:hover { background: rgba(255,255,255,0.1); }
.zpb-bottom-bar .btn-nav:disabled { opacity: .35; cursor: default; }
.zpb-bottom-bar .btn-nav:disabled:hover { background: none; }

.zpb-bottom-bar .page-jump {
    display: flex;
    align-items: center;
    gap: 6px;
}

.zpb-bottom-bar .page-jump input {
    width: 60px;
    text-align: center;
    padding: 6px 4px;
    font-size: 15px;
    font-weight: 500;
}

.zpb-bottom-bar .btn-go {
    padding: 6px 12px;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all .15s;
}

.zpb-bottom-bar .btn-go:hover { background: var(--accent-hover); }

.zpb-bottom-bar .page-jump .total-pages {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
}

.zpb-upgrade-banner {
    position: fixed;
    bottom: 48px;
    left: 0;
    right: 0;
    z-index: 150;
    background: linear-gradient(135deg, rgba(30,41,59,.97), rgba(15,23,42,.97));
    border-top: 1px solid rgba(234,179,8,.3);
    padding: 0;
    display: flex;
    justify-content: center;
}

.zpb-upgrade-content {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 20px;
    max-width: 1080px;
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    position: relative;
}

.zpb-upgrade-collapse-btn {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.zpb-upgrade-toggle {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--toolbar-height) + 10px);
    z-index: 149;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(30,41,59,.97), rgba(15,23,42,.97));
    border: 1px solid rgba(234,179,8,.24);
    color: #f8fafc;
    box-shadow: 0 14px 32px rgba(2,6,23,.3);
}

.zpb-upgrade-toggle-label {
    font-size: 13px;
    font-weight: 700;
    color: #fef08a;
}

.zpb-upgrade-toggle-meta {
    font-size: 12px;
    color: #cbd5e1;
    white-space: nowrap;
}

body.zpb-upgrade-banner-collapsed .zpb-upgrade-banner {
    display: none;
}

body.zpb-upgrade-banner-collapsed .zpb-upgrade-toggle {
    display: inline-flex;
}

.zpb-upgrade-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
    min-width: 280px;
}

.zpb-upgrade-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
    padding-top: 2px;
}

.zpb-upgrade-texts {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.zpb-upgrade-text {
    color: #e2e8f0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
}

.zpb-upgrade-tip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.6;
}

.zpb-upgrade-tip strong { color: #fef08a; }
.zpb-upgrade-tip em { color: #facc15; font-style: normal; font-weight: 700; }

.zpb-upgrade-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.zpb-upgrade-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}

.zpb-upgrade-buy { background: #eab308; color: #1e293b; }
.zpb-upgrade-buy:hover { background: #facc15; color: #0f172a; }
.zpb-upgrade-vip {
    background: rgba(255,255,255,.1);
    color: #f1f5f9;
    border: 1px solid rgba(255,255,255,.2);
}

.zpb-upgrade-vip:hover { background: rgba(255,255,255,.18); color: #fff; }

.zpb-zoom-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s;
}

.zpb-zoom-indicator.show {
    opacity: 1;
    transition: opacity 0s;
}

.zpb-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 300;
}

.zpb-loading.hidden { display: none; }

.zpb-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255,255,255,0.12);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: zpb-spin .8s linear infinite;
}

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

.zpb-loading-text {
    font-size: 14px;
    color: var(--text-muted);
}

.zpb-bookmark-panel {
    position: fixed;
    top: var(--toolbar-height);
    right: 0;
    width: var(--panel-width);
    max-width: 85vw;
    bottom: var(--toolbar-height);
    background: var(--toolbar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--border);
    z-index: 90;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}

.zpb-bookmark-panel.open { transform: translateX(0); }

.zpb-catalog-panel {
    position: fixed;
    top: var(--toolbar-height);
    right: 0;
    width: min(360px, 88vw);
    max-width: 88vw;
    bottom: var(--toolbar-height);
    background: var(--toolbar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--border);
    z-index: 90;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}

.zpb-catalog-panel.open { transform: translateX(0); }

.zpb-catalog-panel .panel-header,
.zpb-bookmark-panel .panel-header,
.zpb-annotation-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.zpb-catalog-panel .panel-title,
.zpb-bookmark-panel .panel-title,
.zpb-annotation-panel .panel-title {
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.zpb-catalog-panel .btn-close-panel,
.zpb-bookmark-panel .btn-close-panel,
.zpb-annotation-panel .btn-close-panel {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all .15s;
}

.zpb-catalog-panel .btn-close-panel:hover,
.zpb-bookmark-panel .btn-close-panel:hover,
.zpb-annotation-panel .btn-close-panel:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text);
}

.zpb-catalog-panel .panel-body,
.zpb-bookmark-panel .panel-body,
.zpb-annotation-panel .panel-body {
    flex: 1;
    overflow-y: auto;
}

.zpb-catalog-panel .panel-body { padding: 8px 10px 14px; }
.zpb-bookmark-panel .panel-body { padding: 8px; }
.zpb-annotation-panel .panel-body { padding: 10px; }

.zpb-catalog-summary {
    padding: 12px 16px 8px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.zpb-catalog-actions {
    display: flex;
    gap: 8px;
    padding: 10px 16px 12px;
}

.btn-catalog-action {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    font-size: 13px;
    transition: all .15s;
}

.btn-catalog-action:hover {
    background: rgba(124,58,237,0.18);
    color: #fff;
}

.zpb-catalog-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.catalog-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid transparent;
    color: #e2e8f0;
    text-align: left;
    transition: all .15s;
}

.catalog-item:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.08);
}

.catalog-item.is-active {
    background: rgba(124,58,237,0.18);
    border-color: rgba(124,58,237,0.38);
    color: #fff;
}

.catalog-item.is-locked {
    background: rgba(255,255,255,0.02);
    color: rgba(226,232,240,0.56);
}

.catalog-item.is-locked:hover {
    background: rgba(234,179,8,0.1);
    border-color: rgba(234,179,8,0.24);
}

.catalog-item-page {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.catalog-item-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

.catalog-item.is-active .catalog-item-desc { color: rgba(255,255,255,0.82); }
.catalog-item.is-locked .catalog-item-desc { color: rgba(226,232,240,0.48); }

.zpb-bookmark-panel .bookmark-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
    margin-bottom: 2px;
}

.zpb-bookmark-panel .bookmark-item:hover { background: rgba(255,255,255,0.05); }
.zpb-bookmark-panel .bookmark-item .bm-icon { font-size: 17px; flex-shrink: 0; }
.zpb-bookmark-panel .bookmark-item .bm-info { flex: 1; min-width: 0; }
.zpb-bookmark-panel .bookmark-item .bm-label {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zpb-bookmark-panel .bookmark-item .bm-page { font-size: 12px; color: var(--text-muted); }

.zpb-bookmark-panel .bookmark-item .bm-delete {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 15px;
    opacity: 0;
    transition: all .15s;
    flex-shrink: 0;
}

.zpb-bookmark-panel .bookmark-item:hover .bm-delete { opacity: 1; }
.zpb-bookmark-panel .bookmark-item .bm-delete:hover { color: var(--danger); background: rgba(239,68,68,0.15); }

.zpb-bookmark-panel .panel-footer {
    position: sticky;
    bottom: 0;
    padding: 12px 88px 12px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(10, 11, 28, 0.92), rgba(10, 11, 28, 0.98));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 2;
}

.zpb-bookmark-panel .btn-add-bookmark {
    width: 100%;
    min-height: 40px;
    padding: 10px 14px;
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.28);
    transition: all .15s;
}

.zpb-bookmark-panel .btn-add-bookmark:hover { background: var(--accent-hover); }

.zpb-bookmark-panel .empty-state,
.zpb-annotation-panel .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.zpb-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 89;
    display: none;
    pointer-events: none;
}

.zpb-panel-overlay.visible { display: block; }

.zpb-reader-external-fixed-hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.btn-bookmark-badge,
.btn-annotation-badge { position: relative; }

.btn-bookmark-badge .badge-count,
.btn-annotation-badge .badge-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    color: #fff;
    border-radius: 8px;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    padding: 0 4px;
    display: none;
}

.btn-bookmark-badge.btn-toolbar-text .badge-count,
.btn-annotation-badge.btn-toolbar-text .badge-count {
    top: -2px;
    right: -2px;
}

.btn-bookmark-badge .badge-count { background: var(--accent); }
.btn-bookmark-badge.has-bookmarks .badge-count { display: block; }
.btn-annotation-badge .badge-count { background: #3b82f6; }
.btn-annotation-badge.has-annotations .badge-count { display: block; }

.zpb-annotation-panel {
    position: fixed;
    top: var(--toolbar-height);
    right: 0;
    width: min(360px, 88vw);
    bottom: var(--toolbar-height);
    background: var(--toolbar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid var(--border);
    z-index: 90;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}

.zpb-annotation-panel.open { transform: translateX(0); }

.zpb-export-list-panel .panel-body {
    padding: 12px;
}

.zpb-export-list-panel .empty-state {
    padding-top: 52px;
}

.annotation-item {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all .15s;
}

.annotation-item:hover { background: rgba(255,255,255,0.07); }

.annotation-item .ann-kind {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    background: rgba(124,58,237,0.18);
}

.annotation-item.type-highlight .ann-kind { background: rgba(255,235,59,0.16); color: #facc15; }
.annotation-item.type-underline .ann-kind { background: rgba(96,165,250,0.16); color: #60a5fa; }
.annotation-item.type-text .ann-kind { background: rgba(124,58,237,0.18); color: #c4b5fd; }
.annotation-item .ann-meta { flex: 1; min-width: 0; }
.annotation-item .ann-title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.annotation-item .ann-page { font-size: 12px; color: var(--text-muted); }
.annotation-item .ann-content {
    margin-top: 6px;
    font-size: 13px;
    color: #dbe4f3;
    line-height: 1.55;
    word-break: break-word;
}

.zpb-reader-message-modal .modal-dialog {
    max-width: 460px;
}

.zpb-reader-message-modal .modal-content {
    border-radius: 18px;
    border: 0;
    box-shadow: 0 18px 48px rgba(15,23,42,0.24);
    overflow: hidden;
}

.zpb-reader-modal {
    position: relative;
    padding: 24px 28px 22px;
    color: #1f2937;
    background: #fff;
    border-radius: 18px;
}

.zpb-reader-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin-bottom: 14px;
    position: relative;
}

.zpb-reader-modal-title-wrap {
    width: 100%;
    padding: 0 42px;
    text-align: center;
}

.zpb-reader-modal-title {
    display: block;
    width: 100%;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    text-indent: 0 !important;
    letter-spacing: normal !important;
}

.zpb-reader-modal-title.is-warning {
    color: #f97316;
}

.zpb-reader-modal-title.is-danger {
    color: #ef4444;
}

.zpb-reader-modal-title.is-success {
    color: #10b981;
}

.zpb-reader-modal-title.is-info {
    color: #2563eb;
}

.zpb-reader-modal-title.jb-yellow,
.zpb-reader-modal-title.jb-red,
.zpb-reader-modal-title.jb-green,
.zpb-reader-modal-title.jb-blue {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #111827 !important;
}

.zpb-reader-modal-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #94a3b8;
    background: rgba(148,163,184,0.12);
    transition: all .15s ease;
}

.zpb-reader-modal-close:hover {
    color: #475569;
    background: rgba(148,163,184,0.22);
}

.zpb-reader-modal-close .ic-close {
    width: 14px;
    height: 14px;
}

.zpb-reader-modal-body {
    padding: 4px 8px 8px;
}

.zpb-reader-notice-text {
    font-size: 15px;
    line-height: 1.95;
    color: #334155;
    text-align: center;
    word-break: break-word;
    max-width: 332px;
    margin: 0 auto;
}

.zpb-export-files {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.zpb-export-files-desc {
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    border: 1px solid rgba(96, 165, 250, 0.2);
    color: #334155;
    font-size: 14px;
    line-height: 1.8;
}

.zpb-export-files-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.zpb-export-files-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.zpb-export-files-subtitle {
    font-size: 12px;
    line-height: 1.6;
    color: #64748b;
}

.zpb-export-files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zpb-export-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #f8fafc;
}

.zpb-export-file-main {
    flex: 1;
    min-width: 0;
}

.zpb-export-file-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: #111827;
    word-break: break-word;
}

.zpb-export-file-meta {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.6;
    color: #64748b;
}

.zpb-export-file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 104px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
    flex-shrink: 0;
}

.zpb-export-file-btn:hover {
    color: #fff;
    background: linear-gradient(135deg, #93c5fd, #3b82f6);
    transform: translateY(-1px);
}

.zpb-reader-modal-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(148,163,184,0.16);
}

.zpb-reader-modal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 302px;
    margin: 0 auto;
}

.zpb-reader-modal-actions.is-single {
    grid-template-columns: minmax(0, 1fr);
    max-width: 220px;
}

.zpb-reader-modal-btn {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: none;
}

.zpb-reader-modal-btn:not(.c-yellow):not(.c-blue) {
    color: #64748b;
    background: #f8fafc;
    border: 1px solid rgba(148,163,184,0.18);
}

.zpb-reader-modal-btn:not(.c-yellow):not(.c-blue):hover {
    color: #334155;
    background: #f1f5f9;
}

.zpb-reader-modal-btn.c-yellow {
    color: #fff;
    background: linear-gradient(135deg, #fb923c, #f97316);
    border: 0;
}

.zpb-reader-modal-btn.c-yellow:hover {
    background: linear-gradient(135deg, #fdba74, #fb923c);
}

.zpb-reader-modal-btn.c-blue {
    color: #fff;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    border: 0;
}

.zpb-reader-modal-btn.c-blue:hover {
    background: linear-gradient(135deg, #93c5fd, #3b82f6);
}

.dark-theme .zpb-export-files-desc {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(15, 23, 42, 0.48));
    border-color: rgba(96, 165, 250, 0.18);
    color: #cbd5e1;
}

.dark-theme .zpb-export-files-title {
    color: #f8fafc;
}

.dark-theme .zpb-export-files-subtitle {
    color: #94a3b8;
}

.dark-theme .zpb-export-file-item {
    background: rgba(255,255,255,0.03);
    border-color: rgba(148,163,184,0.16);
}

.dark-theme .zpb-export-file-name {
    color: #f8fafc;
}

.dark-theme .zpb-export-file-meta {
    color: #94a3b8;
}

.annotation-item .ann-actions { display: flex; align-items: flex-start; }

.annotation-item .ann-delete {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all .15s;
    flex-shrink: 0;
}

.annotation-item .ann-delete:hover { color: var(--danger); background: rgba(239,68,68,0.15); }

.zpb-annotation-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 30, 55, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    z-index: 250;
    display: none;
    flex-direction: column;
    gap: 12px;
    min-width: 280px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.zpb-annotation-dialog.visible { display: flex; }
.zpb-annotation-dialog .dialog-title { font-size: 16px; font-weight: 600; }

.zpb-annotation-dialog textarea {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    outline: none;
    user-select: text;
    -webkit-user-select: text;
    pointer-events: auto;
}

.zpb-annotation-dialog textarea:focus { border-color: var(--accent); }

.zpb-annotation-dialog .dialog-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.zpb-annotation-dialog .dialog-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all .15s;
}

.zpb-annotation-dialog .btn-save { background: var(--accent); color: #fff; }
.zpb-annotation-dialog .btn-save:hover { background: var(--accent-hover); }
.zpb-annotation-dialog .btn-cancel { background: rgba(255,255,255,0.08); color: var(--text-muted); }
.zpb-annotation-dialog .btn-cancel:hover { background: rgba(255,255,255,0.15); }
.zpb-annotation-dialog .btn-delete-ann { background: rgba(239,68,68,0.15); color: var(--danger); }
.zpb-annotation-dialog .btn-delete-ann:hover { background: rgba(239,68,68,0.25); }

.zpb-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 249;
    display: none;
}

.zpb-dialog-overlay.visible { display: block; }

.zpb-action-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 339;
    display: none;
}

.zpb-action-dialog-overlay.visible { display: block; }

.zpb-action-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(460px, calc(100vw - 28px));
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 20px 56px rgba(2, 6, 23, 0.48);
    z-index: 340;
    display: none;
    overflow: hidden;
}

.zpb-action-dialog.visible { display: block; }

.zpb-action-dialog.is-confirm {
    width: min(392px, calc(100vw - 28px));
    border-radius: 14px;
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 18px 44px rgba(2, 6, 23, 0.4);
}

.zpb-action-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
}

.zpb-action-dialog-title {
    color: #f8fafc;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: .01em;
}

.zpb-action-dialog-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #94a3b8;
    background: rgba(255,255,255,0.04);
    transition: background .18s ease, color .18s ease, transform .15s ease;
    flex-shrink: 0;
}

.zpb-action-dialog-close:hover {
    background: rgba(255,255,255,0.1);
    color: #f8fafc;
    transform: translateY(-1px);
}

.zpb-action-dialog-body {
    padding: 0 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-header {
    padding: 18px 18px 10px;
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-body {
    padding: 0 18px 14px;
    gap: 0;
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-title {
    font-size: 15px;
    font-weight: 700;
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-close:hover {
    background: rgba(255,255,255,0.06);
    color: #cbd5e1;
    transform: none;
}

.zpb-action-dialog-message {
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-message {
    position: relative;
    padding-left: 14px;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.65;
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-message::before {
    content: '';
    position: absolute;
    left: 0;
    top: .42em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.68);
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.zpb-action-dialog.is-confirm.is-danger .zpb-action-dialog-message {
    color: #fecaca;
}

.zpb-action-dialog.is-confirm.is-danger .zpb-action-dialog-message::before {
    background: rgba(248, 113, 113, 0.95);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}

.zpb-action-dialog.is-confirm.is-primary .zpb-action-dialog-message::before {
    background: rgba(167, 139, 250, 0.95);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.14);
}

.zpb-action-dialog-input,
.zpb-action-dialog-textarea {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #f8fafc;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    user-select: text;
    -webkit-user-select: text;
}

.zpb-action-dialog-input:focus,
.zpb-action-dialog-textarea:focus {
    border-color: rgba(124,58,237,0.8);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.18);
}

.zpb-action-dialog-input::placeholder,
.zpb-action-dialog-textarea::placeholder {
    color: #64748b;
}

.zpb-action-dialog-textarea {
    min-height: 120px;
    resize: vertical;
}

.zpb-action-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 18px 18px;
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-actions {
    padding: 0 18px 18px;
    gap: 8px;
}

.zpb-action-dialog-btn {
    min-width: 92px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    transition: transform .15s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.zpb-action-dialog-btn:hover {
    transform: translateY(-1px);
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-btn {
    min-width: 84px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-btn:hover {
    transform: none;
}

.zpb-action-dialog-btn.is-muted {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #cbd5e1;
}

.zpb-action-dialog-btn.is-muted:hover {
    background: rgba(255,255,255,0.1);
    color: #f8fafc;
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-btn.is-muted {
    background: rgba(255,255,255,0.04);
    color: #94a3b8;
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-btn.is-muted:hover {
    background: rgba(255,255,255,0.07);
    color: #e2e8f0;
}

.zpb-action-dialog-btn.is-primary {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
    box-shadow: 0 10px 24px rgba(124,58,237,0.28);
}

.zpb-action-dialog-btn.is-primary:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-btn.is-primary {
    background: rgba(124,58,237,0.18);
    border: 1px solid rgba(167,139,250,0.22);
    color: #e9ddff;
    box-shadow: none;
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-btn.is-primary:hover {
    background: rgba(124,58,237,0.24);
}

.zpb-action-dialog-btn.is-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 10px 24px rgba(239,68,68,0.24);
}

.zpb-action-dialog-btn.is-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-btn.is-danger {
    background: rgba(239,68,68,0.16);
    border: 1px solid rgba(248,113,113,0.24);
    color: #fecaca;
    box-shadow: none;
}

.zpb-action-dialog.is-confirm .zpb-action-dialog-btn.is-danger:hover {
    background: rgba(239,68,68,0.22);
}

.zpb-annotation-popover {
    position: fixed;
    min-width: 220px;
    max-width: min(320px, calc(100vw - 24px));
    background: rgba(20, 20, 35, 0.97);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.45);
    z-index: 320;
    display: none;
}

.zpb-annotation-popover.visible { display: block; }

.zpb-annotation-popover .popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.zpb-annotation-popover .popover-type { font-size: 13px; font-weight: 600; color: #fff; }

.zpb-annotation-popover .popover-close {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: var(--text-muted);
}

.zpb-annotation-popover .popover-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }

.zpb-annotation-popover .popover-content {
    font-size: 13px;
    line-height: 1.65;
    color: #dbe4f3;
    white-space: pre-wrap;
    word-break: break-word;
}

.zpb-annotation-popover .popover-meta { margin-top: 8px; font-size: 12px; color: var(--text-muted); }

.zpb-annotation-popover .popover-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.zpb-annotation-popover .popover-actions button {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
}

.zpb-annotation-popover .btn-pop-edit { background: rgba(124,58,237,0.18); color: #ddd6fe; }
.zpb-annotation-popover .btn-pop-delete { background: rgba(239,68,68,0.14); color: #fca5a5; }

.zpb-context-menu {
    position: fixed;
    min-width: 180px;
    padding: 8px;
    border-radius: 14px;
    background: rgba(20,20,35,0.98);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
    display: none;
    z-index: 340;
}

.zpb-context-menu.visible { display: block; }

.zpb-context-menu .context-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #e2e8f0;
    text-align: left;
}

.zpb-context-menu .context-item:hover {
    background: rgba(124,58,237,0.16);
    color: #fff;
}

.zpb-context-menu .context-item i {
    width: 16px;
    text-align: center;
    color: #c4b5fd;
}

/* ========== 批注分享面板 ========== */
.zpb-share-section {
    padding: 2px 2px 12px;
}

.zpb-share-name-row {
    display: grid;
    gap: 10px;
}

.zpb-share-save-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.zpb-share-current {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.2);
}

.zpb-share-current-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(16,185,129,0.18);
    color: #d1fae5;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.zpb-share-current-name {
    flex: 1;
    min-width: 0;
    color: #ecfdf5;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zpb-share-current-actions {
    display: none;
    margin-top: 10px;
}

.zpb-share-name-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: #f8fafc;
    font-size: 13px;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.zpb-share-name-input:focus {
    border-color: rgba(167,139,250,0.72);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.14);
}

.zpb-share-name-input::placeholder {
    color: #64748b;
}

.zpb-share-note-input {
    width: 100%;
    min-height: 76px;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: #f8fafc;
    font-size: 13px;
    line-height: 1.6;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.zpb-share-note-input:focus {
    border-color: rgba(167,139,250,0.72);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.14);
}

.zpb-share-note-input::placeholder {
    color: #64748b;
}

.zpb-share-name-save-btn {
    width: 100%;
    padding: 10px 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    transition: transform .15s ease, filter .18s ease;
}

.zpb-share-name-save-btn-secondary {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #e2e8f0;
}

.zpb-share-name-save-btn:hover {
    filter: brightness(1.08);
}

.zpb-share-name-save-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: none;
}

.zpb-share-name-save-btn:active {
    transform: translateY(1px);
}

.zpb-share-name-save-btn.is-saved {
    background: linear-gradient(135deg, #10b981, #059669);
}

.zpb-share-save-tip {
    display: none;
    margin-top: 8px;
    padding: 9px 11px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.6;
}

.zpb-share-save-tip.is-success {
    background: rgba(16,185,129,0.1);
    border-color: rgba(16,185,129,0.22);
    color: #d1fae5;
}

.zpb-share-save-tip.is-error {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.22);
    color: #fecaca;
}

.zpb-share-stats {
    display: flex;
    gap: 16px;
    padding: 10px 0 2px;
}

.zpb-share-stat {
    font-size: 13px;
    color: #cbd5e1;
}

.zpb-share-stat strong {
    color: #f8fafc;
}

.zpb-share-divider {
    height: 1px;
    margin: 12px 0 14px;
    background: rgba(255,255,255,0.08);
}

.zpb-share-lb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.zpb-share-lb-title {
    font-size: 14px;
    font-weight: 700;
    color: #f8fafc;
}

.zpb-share-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.zpb-share-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 10px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.025));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.zpb-share-item.is-applied-item {
    border-color: rgba(124,58,237,0.42);
    background: linear-gradient(180deg, rgba(124,58,237,0.16), rgba(99,102,241,0.08));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 24px rgba(76,29,149,0.22);
}

.zpb-share-item-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.zpb-share-item-rank {
    width: 30px;
    text-align: center;
    font-size: 18px;
    line-height: 1.2;
    flex-shrink: 0;
    padding-top: 2px;
}

.zpb-share-item-body {
    flex: 1;
    min-width: 0;
}

.zpb-share-item-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.zpb-share-item-filename {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zpb-share-item-name {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zpb-share-item-version,
.zpb-share-item-current {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.zpb-share-item-version {
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
}

.zpb-share-item-current {
    background: rgba(124,58,237,0.22);
    color: #ddd6fe;
}

.zpb-share-item-note {
    margin-top: 6px;
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.zpb-share-item-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

.zpb-share-item-author {
    font-size: 12px;
    color: #cbd5e1;
}

.zpb-share-item-author.is-link {
    color: #cbd5e1;
    text-decoration: none;
    transition: color .18s ease, opacity .18s ease;
}

.zpb-share-item-author.is-link:hover {
    color: #ddd6fe;
    text-decoration: underline;
}

.zpb-share-item-visibility {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: #c4b5fd;
    font-size: 11px;
    font-weight: 700;
}

.zpb-share-item-likes {
    font-size: 12px;
    color: #ef4444;
    font-weight: 700;
}

.zpb-share-item-count {
    font-size: 12px;
    color: #93c5fd;
    font-weight: 600;
}

.zpb-share-item-time {
    font-size: 11px;
    color: #94a3b8;
}

.zpb-share-item-created {
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.6;
}

.zpb-share-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
    min-width: 92px;
}

.zpb-share-like-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.92);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    transition: transform .15s ease, background .18s ease, border-color .18s ease;
}

.zpb-share-like-btn:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.16);
}

.zpb-share-like-btn.is-liked {
    background: rgba(239,68,68,0.14);
    border-color: rgba(239,68,68,0.3);
    color: #ef4444;
}

.zpb-share-apply-btn {
    min-width: 78px;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid rgba(124,58,237,0.4);
    background: rgba(124,58,237,0.12);
    color: #ddd6fe;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .15s ease;
}

.zpb-share-apply-btn:hover {
    background: rgba(124,58,237,0.24);
    border-color: rgba(167,139,250,0.5);
    color: #fff;
    transform: translateY(-1px);
}

.zpb-share-apply-btn.is-applied {
    background: linear-gradient(135deg, rgba(124,58,237,0.95), rgba(99,102,241,0.92));
    border-color: transparent;
    color: #fff;
}

.zpb-share-manage-btn,
.zpb-share-delete-btn {
    width: 100%;
    min-width: 0;
    padding: 6px 4px;
    border-radius: 9px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
    transition: background .18s ease, border-color .18s ease, transform .15s ease;
}

.zpb-share-manage-btn:hover,
.zpb-share-delete-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.14);
    transform: translateY(-1px);
}

.zpb-share-delete-btn {
    color: #fecaca;
    border-color: rgba(239,68,68,0.2);
    background: rgba(239,68,68,0.08);
}

.zpb-share-delete-btn:hover {
    background: rgba(239,68,68,0.16);
    border-color: rgba(239,68,68,0.32);
}

.zpb-share-item-manage-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Public leaderboard only */
.zpb-share-list-public {
    gap: 10px;
}

.zpb-share-list-public .zpb-share-item {
    gap: 12px;
    padding: 14px 12px;
    border-color: rgba(124,58,237,0.22);
    background:
        radial-gradient(circle at top right, rgba(124,58,237,0.18), transparent 38%),
        linear-gradient(180deg, rgba(19,15,48,0.98), rgba(12,10,34,0.98));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 10px 26px rgba(8,7,28,0.28);
}

.zpb-share-list-public .zpb-share-item.is-applied-item {
    border-color: rgba(167,139,250,0.5);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 14px 30px rgba(76,29,149,0.24);
}

.zpb-share-list-public .zpb-share-item-rank {
    width: 34px;
    font-size: 20px;
    color: #f8fafc;
}

.zpb-share-list-public .zpb-share-item-filename {
    color: #a5b4fc;
}

.zpb-share-list-public .zpb-share-item-name {
    font-size: 15px;
}

.zpb-share-list-public .zpb-share-item-parent-row {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.zpb-share-list-public .zpb-share-item-parent-block {
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}

.zpb-share-list-public .zpb-share-item-parent-title {
    font-size: 12px;
    line-height: 1.4;
    color: #a5b4fc;
    font-weight: 700;
}

.zpb-share-list-public .zpb-share-item-parent-row {
    font-size: 12px;
    line-height: 1.6;
    color: #cbd5e1;
}

.zpb-share-list-public .zpb-share-item-parent-name,
.zpb-share-list-public .zpb-share-item-parent-author {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border: 1px solid rgba(99,102,241,0.28);
    border-radius: 999px;
    background: rgba(99,102,241,0.12);
    color: #c7d2fe;
    font-size: 12px;
    font-weight: 700;
}

.zpb-share-list-public .zpb-share-item-parent-author {
    border-color: rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: #cbd5e1;
}

.zpb-share-list-public .zpb-share-item-footer {
    gap: 10px;
    flex-wrap: wrap;
}

.zpb-share-list-public .zpb-share-item-created {
    color: #a5b4fc;
}

.zpb-share-list-public .zpb-share-item-actions {
    min-width: 104px;
}

.zpb-share-list-public .zpb-share-item-main-public {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.zpb-share-list-public .zpb-share-item-body {
    width: 100%;
}

.zpb-share-list-public .zpb-share-item-actions-public {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    justify-content: flex-start;
    min-width: 0;
}

.zpb-share-list-public .zpb-share-apply-btn {
    min-width: 86px;
    background: rgba(124,58,237,0.18);
}

.zpb-share-list-public .zpb-share-item-main {
    align-items: stretch;
}

.zpb-pulled-annotation {
    opacity: .72;
    filter: hue-rotate(220deg);
}

.zpb-ann-readonly {
    cursor: default !important;
}

.zpb-toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 40, 60, 0.95);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 500;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}

.zpb-toast.show { opacity: 1; }

@media (max-width: 768px) {
    :root {
        --toolbar-height: 44px;
        --panel-width: 280px;
    }

    .zpb-toolbar { padding: 0 8px; gap: 4px; }
    .zpb-toolbar .btn-back { padding: 4px 6px; font-size: 13px; }
    .zpb-toolbar .book-title { font-size: 15px; }
    .zpb-toolbar .btn-icon { width: 32px; height: 32px; border-radius: 6px; }
    .zpb-toolbar .btn-toolbar-text,
    .zpb-toolbar .btn-catalog-trigger { padding: 0 10px; }
    .zpb-toolbar .btn-toolbar-text .btn-label,
    .zpb-toolbar .btn-catalog-trigger .btn-label { font-size: 12px; }
    .zpb-toolbar .page-info { font-size: 12px; margin: 0 2px; }
    .zpb-cloud-mode-banner { left: 8px; right: 8px; top: calc(var(--toolbar-height) + 8px); }
    .zpb-reader-seo-header { padding: 6px 8px 0; }
    .zpb-reader-breadcrumb { margin-bottom: 5px; gap: 6px; font-size: 11px; }
    .zpb-reader-intro { padding: 10px 12px; border-radius: 12px; }
    .zpb-reader-intro-title { font-size: 16px; }
    .zpb-reader-intro-desc { margin-top: 4px; font-size: 12px; line-height: 1.6; }
    .zpb-reader-intro-focus { margin-top: 4px; font-size: 11px; line-height: 1.6; }
    .zpb-reader-intro-meta { margin-top: 8px; gap: 6px; }
    .zpb-reader-meta-chip { min-height: 24px; padding: 0 8px; font-size: 11px; }
    .zpb-reader-page-indexable .zpb-reader-main { top: calc(var(--toolbar-height) + 132px); }
    .zpb-reader-page-indexable .zpb-cloud-mode-banner { top: calc(var(--toolbar-height) + 124px); }
    .zpb-cloud-mode-content { padding: 10px 12px; gap: 10px; flex-wrap: wrap; justify-content: center; }
    .zpb-cloud-mode-texts { width: 100%; justify-content: center; }
    .zpb-cloud-mode-text { white-space: normal; text-align: center; }
    .zpb-member-avatar { width: 30px; height: 30px; border-radius: 50%; }
    .zpb-bottom-bar { padding: 0 8px; gap: 6px; }
    .zpb-bottom-bar .btn-nav { padding: 6px 10px; font-size: 14px; }
    .zpb-bottom-bar .page-jump input { width: 48px; font-size: 14px; padding: 5px 2px; }
    .zpb-bottom-bar .btn-go { padding: 5px 10px; font-size: 13px; }
    .zpb-upgrade-content { padding: 12px 14px; gap: 12px; justify-content: center; }
    .zpb-upgrade-main { min-width: 0; }
    .zpb-upgrade-text { font-size: 14px; text-align: left; }
    .zpb-upgrade-tip { font-size: 12px; }
    .zpb-upgrade-actions { width: 100%; justify-content: stretch; }
    .zpb-upgrade-btn { flex: 1; min-width: 0; padding: 8px 12px; }
    .zpb-catalog-panel { width: 100%; max-width: 100%; }
    .zpb-catalog-actions { padding: 10px 12px; gap: 6px; }
    .btn-catalog-action { padding: 7px 8px; font-size: 12px; }
    .zpb-catalog-list { grid-template-columns: 1fr; }
    .zpb-bookmark-panel { max-width: 80vw; }
    .zpb-bookmark-panel .panel-footer { padding-right: 76px; }
    .zpb-annotation-panel { width: 100%; max-width: 100%; }
    .zpb-selection-toolbar { padding: 8px; gap: 6px; }
    .zpb-selection-toolbar .btn-select-type { min-width: 74px; padding: 7px 9px; }
    .zpb-selection-toolbar .btn-select-icon { width: 32px; height: 32px; }
    .zpb-selection-toolbar .btn-select-text { font-size: 12px; }
    .zpb-selection-toolbar .ann-color-palette { gap: 4px; }
    .zpb-selection-toolbar .ann-color-swatch { width: 22px; height: 22px; }
    .zpb-annotation-dialog { min-width: 240px; padding: 14px; }
    .zpb-annotation-popover { min-width: 200px; }
    .zpb-context-menu { min-width: 160px; }
    .zpb-export-file-item { flex-direction: column; align-items: stretch; }
    .zpb-export-file-btn { width: 100%; }

}

@media (max-width: 768px) {
    body.zpb-reader-page .footer-tabbar-placeholder,
    body.zpb-reader-page .footer-tabbar {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }

    .zpb-toolbar {
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
        gap: 6px;
        justify-content: space-between;
        overflow-x: auto;
        overflow-y: hidden;
        -ms-overflow-style: none;
        scrollbar-width: none;
        border-bottom: 0 !important;
        box-shadow: none !important;
        background: #0f0f1e !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .zpb-toolbar::-webkit-scrollbar,
    .zpb-toolbar .toolbar-actions::-webkit-scrollbar {
        display: none;
    }

    .zpb-toolbar .book-title-group {
        display: none;
    }

    .zpb-toolbar .btn-back {
        width: 32px;
        min-width: 32px;
        height: 32px;
        padding: 0;
        justify-content: center;
        border-radius: 8px;
        font-size: 0;
        gap: 0;
        background: rgba(255,255,255,0.04);
    }

    .zpb-toolbar .book-subtitle,
    .zpb-toolbar .page-info,
    .zpb-toolbar .btn-toolbar-text .btn-label,
    .zpb-toolbar .btn-catalog-trigger .btn-label {
        display: none;
    }

    .zpb-toolbar .toolbar-actions {
        flex: 1;
        min-width: max-content;
        gap: 4px;
        justify-content: flex-end;
        overflow-x: auto;
        overflow-y: hidden;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .zpb-toolbar .btn-toolbar-text,
    .zpb-toolbar .btn-catalog-trigger {
        width: 32px;
        min-width: 32px;
        padding: 0;
        gap: 0;
    }

    .zpb-reader-breadcrumb,
    .zpb-reader-intro-focus {
        display: none;
    }

    .zpb-reader-intro {
        padding: 10px 12px;
    }

    .zpb-reader-panel-dismiss {
        display: inline-flex;
    }

    .zpb-reader-intro-toggle {
        top: calc(var(--toolbar-height) + 6px);
        right: 8px;
        min-height: 28px;
        padding: 0 10px;
        font-size: 11px;
        border-radius: 999px;
    }

    .zpb-reader-page-indexable .zpb-reader-main {
        top: calc(var(--toolbar-height) + 88px);
    }

    .zpb-reader-page-indexable .zpb-cloud-mode-banner {
        top: calc(var(--toolbar-height) + 80px);
    }

    .zpb-reader-main {
        top: var(--toolbar-height);
        bottom: calc(92px + env(safe-area-inset-bottom));
        padding: 8px 6px 12px;
        align-items: center;
        overscroll-behavior: contain;
    }

    .zpb-reader-main::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: #1a1a2e;
        pointer-events: none;
        z-index: 1;
    }

    .zpb-canvas-wrapper {
        width: max-content;
        min-width: 100%;
        padding-bottom: 16px;
        align-items: center;
    }

    .zpb-canvas-wrapper canvas {
        max-width: calc(100vw - 12px);
    }

    .zpb-cloud-mode-content {
        flex-direction: column;
        align-items: stretch;
    }

    .zpb-cloud-mode-texts {
        width: 100%;
        justify-content: flex-start;
    }

    .zpb-cloud-mode-exit-btn,
    .zpb-share-restore-btn {
        width: 100%;
    }

    .zpb-annotation-login-hint {
        top: 10px;
        max-width: calc(100vw - 28px);
        padding: 8px 12px;
        white-space: normal;
        text-align: center;
        line-height: 1.5;
    }

    .zpb-selection-toolbar {
        width: min(320px, calc(100vw - 20px));
        max-width: calc(100vw - 20px);
        padding: 8px;
        gap: 8px;
        flex-direction: column;
        align-items: stretch;
    }

    .zpb-selection-step,
    .zpb-selection-step.is-active {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .zpb-selection-toolbar .btn-select-type {
        flex: 1 1 0;
        min-width: 0;
    }

    .zpb-selection-toolbar .ann-color-title {
        width: 100%;
        padding-right: 0;
        text-align: center;
    }

    .zpb-selection-toolbar .ann-color-palette {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .zpb-annotation-tools-panel,
    .zpb-catalog-panel,
    .zpb-bookmark-panel,
    .zpb-annotation-panel {
        top: var(--toolbar-height);
        bottom: calc(92px + env(safe-area-inset-bottom));
        width: 50vw;
        max-width: 50vw;
        min-width: 220px;
        border-left: 1px solid var(--border);
        border-right: 0;
    }

    .zpb-annotation-tools-panel {
        width: 100vw;
        max-width: 100vw;
        min-width: 0;
        border-left: 0;
        box-shadow: 0 12px 36px rgba(2, 6, 23, 0.36);
    }

    .zpb-tools-body,
    .zpb-catalog-panel .panel-body,
    .zpb-bookmark-panel .panel-body,
    .zpb-annotation-panel .panel-body {
        padding-bottom: 18px;
    }

    .zpb-bookmark-panel .panel-footer {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    }

    .zpb-panel-overlay.visible {
        background: rgba(2, 6, 23, 0.12);
        pointer-events: auto;
    }

    .zpb-bottom-bar {
        position: fixed;
        height: 48px;
        min-height: 48px;
        padding: 4px max(8px, env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
        gap: 6px;
        display: grid;
        grid-template-columns: minmax(72px, 1fr) auto minmax(72px, 1fr);
        align-items: center;
        justify-content: stretch;
        border-top: 1px solid rgba(255,255,255,0.08);
        background: rgba(15,23,42,0.96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        overflow: hidden;
    }

    .zpb-bottom-bar #btnPrev,
    .zpb-bottom-bar #btnNext {
        min-width: 0;
        justify-content: center;
        min-height: 32px;
        padding: 0 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    .zpb-bottom-bar #btnPrev {
        grid-column: 1;
        justify-self: start;
    }

    .zpb-bottom-bar #btnNext {
        grid-column: 3;
        justify-self: end;
    }

    .zpb-bottom-bar .page-jump {
        grid-column: 2;
        justify-content: center;
        gap: 3px;
        flex-wrap: nowrap;
    }

    .zpb-bottom-bar .btn-go {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 28px;
        padding: 0 7px;
        font-size: 11px;
        border-radius: 6px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .zpb-bottom-bar .page-jump .total-pages {
        position: static;
        transform: none;
        width: auto;
        text-align: left;
        font-size: 10px;
        line-height: 1;
        color: rgba(226,232,240,0.72);
        white-space: nowrap;
    }

    .zpb-upgrade-banner {
        bottom: calc(82px + env(safe-area-inset-bottom));
    }

    .zpb-upgrade-content {
        flex-direction: column;
        align-items: stretch;
        position: relative;
        padding-top: 44px;
    }

    .zpb-upgrade-collapse-btn {
        display: inline-flex;
        position: absolute;
        top: 12px;
        right: 14px;
    }

    .zpb-upgrade-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .zpb-annotation-dialog {
        width: calc(100vw - 20px);
        min-width: 0;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 24px);
    }

    .zpb-annotation-dialog .dialog-actions {
        flex-wrap: wrap;
    }

    .zpb-annotation-dialog .dialog-actions button {
        flex: 1 1 calc(50% - 8px);
    }

    .zpb-action-dialog,
    .zpb-action-dialog.is-confirm {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
    }

    .zpb-annotation-popover,
    .zpb-context-menu {
        max-width: calc(100vw - 20px);
    }

    body.zpb-reader-page-indexable.zpb-reader-intro-collapsed .zpb-reader-main {
        top: calc(var(--toolbar-height) + 8px);
    }

    body.zpb-reader-page-indexable.zpb-reader-intro-collapsed .zpb-cloud-mode-banner {
        top: calc(var(--toolbar-height) + 48px);
    }

    body.zpb-upgrade-banner-collapsed .zpb-reader-main {
        bottom: calc(112px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 520px) {
    .zpb-toolbar {
        padding-left: max(6px, env(safe-area-inset-left));
        padding-right: max(6px, env(safe-area-inset-right));
    }

    .zpb-toolbar .btn-back {
        width: 30px;
        min-width: 30px;
        height: 30px;
        padding: 0;
        justify-content: center;
        font-size: 0;
    }

    .zpb-reader-intro {
        padding: 9px 10px;
    }

    .zpb-reader-intro-title {
        font-size: 15px;
    }

    .zpb-reader-intro-desc {
        display: none;
    }

    .zpb-reader-meta-chip {
        min-height: 22px;
        padding: 0 7px;
        font-size: 10px;
    }

    .zpb-reader-page-indexable .zpb-reader-main {
        top: calc(var(--toolbar-height) + 66px);
    }

    .zpb-reader-page-indexable .zpb-cloud-mode-banner {
        top: calc(var(--toolbar-height) + 58px);
    }

    .zpb-reader-intro-toggle {
        top: calc(var(--toolbar-height) + 6px);
        right: 8px;
        min-height: 26px;
        padding: 0 9px;
        font-size: 10px;
    }

    .zpb-selection-toolbar .btn-select-type {
        flex-basis: 100%;
    }

    .zpb-bottom-bar .btn-nav {
        padding: 5px 8px;
        font-size: 12px;
    }

    .zpb-bottom-bar {
        gap: 4px;
        height: 46px;
        min-height: 46px;
        padding: 4px max(6px, env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-right));
        grid-template-columns: minmax(64px, 1fr) auto minmax(64px, 1fr);
    }

    .zpb-bottom-bar .page-jump input {
        width: 42px;
        height: 28px;
        font-size: 12px;
        padding: 4px 2px;
    }

    .zpb-bottom-bar .btn-go {
        min-height: 28px;
        padding: 0 6px;
        font-size: 10px;
    }

    .zpb-bottom-bar .page-jump .total-pages {
        font-size: 10px;
        line-height: 1;
    }

    .zpb-catalog-actions {
        flex-wrap: wrap;
    }

    .btn-catalog-action {
        flex: 1 1 calc(33.333% - 6px);
    }

    .zpb-upgrade-actions {
        grid-template-columns: 1fr;
    }

    .zpb-upgrade-toggle {
        left: 8px;
        right: auto;
        width: calc(100vw - 16px);
        bottom: calc(64px + env(safe-area-inset-bottom));
        min-height: 36px;
        padding: 0 12px;
    }

    .zpb-catalog-panel,
    .zpb-bookmark-panel,
    .zpb-annotation-panel {
        width: 50vw;
        max-width: 50vw;
        min-width: 200px;
    }
}

@supports (-moz-appearance: none) {
    @media (max-width: 768px) {
        .zpb-toolbar {
            border-bottom: 0;
            box-shadow: none;
        }

        .zpb-toolbar::after {
            bottom: -2px;
            height: 5px;
            background: #1a1a2e;
        }

        .zpb-reader-main {
            background: #1a1a2e;
        }

        .zpb-reader-main::before {
            height: 6px;
            background: #1a1a2e;
        }
    }
}
