/* filemanager.css - 文件管理器弹窗 */

/* ===== File Manager Modal ===== */
.fm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(40, 35, 25, 0.35);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.fm-modal-content {
    background: var(--bg-secondary);
    border: 2px solid var(--border-sketch);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 6px 0px rgba(60, 50, 30, 0.12);
    animation: sketchSlideUp 0.3s ease;
}

/* Header */
.fm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px dashed var(--border-color);
    flex-shrink: 0;
}

.fm-header h3 {
    margin: 0;
    font-family: var(--font-hand);
    font-size: 22px;
}

.fm-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fm-icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.fm-icon-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.fm-icon-btn svg {
    width: 18px;
    height: 18px;
}

/* Breadcrumb Bar */
.fm-breadcrumb-bar {
    padding: 8px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow: hidden;
}

.fm-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    scrollbar-width: none;
}

/* Toolbar */
.fm-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Search Box */
.fm-search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    transition: border-color var(--transition);
    min-width: 160px;
    flex: 1;
    max-width: 280px;
}

.fm-search-box:focus-within {
    border-color: var(--accent-primary);
}

.fm-search-box svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.fm-search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 12px;
    font-family: var(--font-body);
    color: var(--text-primary);
    width: 100%;
    padding: 2px 0;
}

.fm-search-box input::placeholder {
    color: var(--text-tertiary);
}

.fm-search-clear {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: var(--text-tertiary);
    transition: color var(--transition);
}

.fm-search-clear:hover {
    color: var(--text-primary);
}

.fm-search-clear svg {
    width: 14px;
    height: 14px;
}

.fm-search-clear.hidden {
    display: none;
}

.fm-breadcrumb::-webkit-scrollbar {
    display: none;
}

.fm-breadcrumb-item {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all var(--transition);
    color: var(--text-secondary);
    background: none;
    border: none;
    font-size: 13px;
    font-family: var(--font-body);
}

.fm-breadcrumb-item:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.fm-breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
    cursor: default;
}

.fm-breadcrumb-item.active:hover {
    background: transparent;
    color: var(--text-primary);
}

.fm-breadcrumb-sep {
    color: var(--text-tertiary);
    font-size: 12px;
    flex-shrink: 0;
}

.fm-toolbar-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.fm-action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-family: var(--font-body);
    color: var(--text-secondary);
    transition: all var(--transition);
    white-space: nowrap;
}

.fm-action-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.fm-action-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-sketch);
    color: var(--text-primary);
    box-shadow: var(--shadow-sketch);
}

.fm-action-btn.primary {
    background: var(--accent-light);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.fm-action-btn.primary:hover {
    background: var(--accent-primary);
    color: white;
}

.fm-action-btn.danger {
    color: var(--error);
    border-color: var(--error);
}

.fm-action-btn.danger:hover {
    background: var(--error);
    color: white;
}

.fm-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.fm-action-btn:disabled:hover {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.fm-action-btn.danger:disabled:hover {
    background: transparent;
    border-color: var(--error);
    color: var(--error);
}

/* Select all */
.fm-select-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: var(--accent-light);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.fm-select-bar.hidden {
    display: none;
}

.fm-select-all-cb {
    accent-color: var(--accent-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.fm-select-count {
    flex: 1;
}

/* File List */
.fm-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 200px;
    position: relative;
}

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

.fm-empty,
.fm-loading {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-family: var(--font-hand);
    font-size: 18px;
}

.fm-search-result-path {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.fm-search-hint {
    padding: 6px 20px;
    font-size: 12px;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fm-search-hint a {
    color: var(--accent-primary);
    cursor: pointer;
    text-decoration: none;
}

.fm-search-hint a:hover {
    text-decoration: underline;
}

.fm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--bg-tertiary);
    transition: all var(--transition);
    cursor: pointer;
    user-select: none;
}

.fm-item:last-child {
    border-bottom: none;
}

.fm-item:hover {
    background: var(--bg-tertiary);
}

.fm-item.selected {
    background: var(--accent-light);
}

.fm-item-cb {
    accent-color: var(--accent-primary);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

.fm-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.fm-item-icon svg {
    width: 18px;
    height: 18px;
}

.fm-item-icon.folder {
    background: var(--warning-light);
    color: var(--warning);
}

.fm-item-icon.file {
    background: var(--info-light);
    color: var(--info);
}

.fm-item-info {
    flex: 1;
    min-width: 0;
}

.fm-item-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.fm-item-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.fm-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.fm-item:hover .fm-item-actions {
    opacity: 1;
}

.fm-item-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all var(--transition);
    padding: 0;
}

.fm-item-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.fm-item-action-btn.delete-action:hover {
    color: var(--error);
    background: var(--error-light);
}

.fm-item-action-btn svg {
    width: 15px;
    height: 15px;
}

/* Dropzone */
.fm-dropzone {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(107, 127, 198, 0.08);
    border: 3px dashed var(--accent-primary);
    border-radius: 12px;
    margin: 8px;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.fm-dropzone.active {
    display: flex;
}

.fm-dropzone-text {
    font-family: var(--font-hand);
    font-size: 22px;
    color: var(--accent-primary);
}

/* Upload progress */
.fm-upload-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-top: 2px dashed var(--border-color);
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.fm-upload-bar.active {
    display: flex;
}

.fm-upload-info {
    flex: 1;
    min-width: 0;
}

.fm-upload-text {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fm-upload-progress {
    width: 100%;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.fm-upload-progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 3px;
    transition: width 0.2s ease;
    width: 0;
}

.fm-upload-cancel {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all var(--transition);
    flex-shrink: 0;
}

.fm-upload-cancel:hover {
    background: var(--error-light);
    color: var(--error);
}

.fm-upload-cancel svg {
    width: 16px;
    height: 16px;
}

/* Preview modal (overlay on top of file manager) */
.fm-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(40, 35, 25, 0.5);
    backdrop-filter: blur(6px);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

.fm-preview-content {
    background: var(--bg-secondary);
    border: 2px solid var(--border-sketch);
    border-radius: 16px;
    width: 92%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 6px 0px rgba(60, 50, 30, 0.12);
    animation: sketchSlideUp 0.25s ease;
    transition: all 0.25s ease;
}

.fm-preview-content.fm-preview-fullscreen {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
}

.fm-preview-fullscreen .fm-preview-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.fm-preview-fullscreen .fm-preview-body pre {
    max-height: none;
    height: 100%;
    box-sizing: border-box;
    overflow: auto;
    margin: 0;
    border-radius: 0;
    border: none;
    padding: 20px;
}

.fm-preview-fullscreen .fm-preview-body iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
}

.fm-preview-fullscreen .fm-preview-body .fm-preview-rendered {
    height: 100%;
    overflow: auto;
    padding: 20px 24px 20px 40px;
    box-sizing: border-box;
}

.fm-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 2px dashed var(--border-color);
    flex-shrink: 0;
}

.fm-preview-header h4 {
    margin: 0;
    font-family: var(--font-hand);
    font-size: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.fm-preview-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.fm-preview-rendered {
    line-height: 1.7;
    font-size: 14px;
    color: var(--text-primary);
}

.fm-preview-rendered h1,
.fm-preview-rendered h2,
.fm-preview-rendered h3 {
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.fm-preview-rendered pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    overflow-x: auto;
}

.fm-preview-rendered code {
    background: var(--bg-tertiary);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 13px;
}

.fm-preview-rendered img {
    max-width: 100%;
    border-radius: 8px;
}

.fm-preview-rendered table {
    border-collapse: collapse;
    width: 100%;
}

.fm-preview-rendered th,
.fm-preview-rendered td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: left;
}

.fm-preview-body {
    flex: 1;
    overflow: auto;
    padding: 16px 20px;
    min-height: 200px;
}

.fm-preview-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.fm-preview-body video,
.fm-preview-body audio {
    max-width: 100%;
}

.fm-preview-body pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 60vh;
}

.fm-preview-unsupported {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-family: var(--font-hand);
    font-size: 18px;
}

/* ===== Confirm Modal ===== */
.fm-confirm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(40, 35, 25, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1200;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

.fm-confirm-content {
    background: var(--bg-secondary);
    border: 2px solid var(--border-sketch);
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 4px 6px 0px rgba(60, 50, 30, 0.12);
    animation: sketchSlideUp 0.25s ease;
}

.fm-confirm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px dashed var(--border-color);
}

.fm-confirm-header h3 {
    margin: 0;
    font-family: var(--font-hand);
    font-size: 22px;
    font-weight: 600;
    color: var(--error);
}

.fm-confirm-body {
    padding: 20px;
    text-align: center;
}

.fm-confirm-msg {
    font-size: 15px;
    margin: 0 0 8px 0;
    line-height: 1.5;
    word-break: break-all;
}

.fm-confirm-warn {
    font-size: 13px;
    color: var(--error);
    margin: 0;
    font-weight: 500;
}

.fm-confirm-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 2px dashed var(--border-color);
    justify-content: flex-end;
}

.fm-confirm-cancel-btn,
.fm-confirm-ok-btn {
    padding: 8px 18px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.fm-confirm-cancel-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.fm-confirm-cancel-btn:hover {
    background: var(--bg-hover);
    box-shadow: var(--shadow-sketch);
}

.fm-confirm-ok-btn {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.fm-confirm-ok-btn:hover {
    background: var(--error-light);
    color: var(--error);
    box-shadow: var(--shadow-sketch);
}

/* ===== Share Modal ===== */
.fm-share-modal,
.fm-share-list-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(40, 35, 25, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1200;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

.fm-share-content,
.fm-share-list-content {
    background: var(--bg-secondary);
    border: 2px solid var(--border-sketch);
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    box-shadow: 4px 6px 0px rgba(60, 50, 30, 0.12);
    animation: sketchSlideUp 0.25s ease;
}

.fm-share-header,
.fm-share-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px dashed var(--border-color);
}

.fm-share-header h3,
.fm-share-list-header h3 {
    margin: 0;
    font-family: var(--font-hand);
    font-size: 22px;
    font-weight: 600;
    color: var(--accent-primary);
}

.fm-share-body {
    padding: 20px;
}

.fm-share-field {
    margin-bottom: 14px;
}

.fm-share-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.fm-share-field input,
.fm-share-field select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-sizing: border-box;
    transition: border-color var(--transition);
}

.fm-share-field input:focus,
.fm-share-field select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.fm-share-filename {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
}

.fm-share-result {
    margin-top: 8px;
}

.fm-share-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.fm-share-link-row input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-sizing: border-box;
}

.fm-share-copy-btn {
    padding: 8px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-primary);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fm-share-copy-btn:hover {
    background: var(--bg-hover);
    box-shadow: var(--shadow-sketch);
}

.fm-share-copy-btn svg {
    width: 16px;
    height: 16px;
}

.fm-share-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 2px dashed var(--border-color);
    justify-content: flex-end;
    align-items: center;
}

.fm-share-links-btn {
    margin-right: auto;
    padding: 8px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.fm-share-links-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    box-shadow: var(--shadow-sketch);
}

.fm-share-cancel-btn,
.fm-share-ok-btn {
    padding: 8px 18px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.fm-share-cancel-btn {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.fm-share-cancel-btn:hover {
    background: var(--bg-hover);
    box-shadow: var(--shadow-sketch);
}

.fm-share-ok-btn {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.fm-share-ok-btn:hover {
    opacity: 0.85;
    box-shadow: var(--shadow-sketch);
}

/* Share List */
.fm-share-list-body {
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

.fm-share-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px dashed var(--border-color);
    gap: 12px;
}

.fm-share-list-item:last-child {
    border-bottom: none;
}

.fm-share-list-info {
    flex: 1;
    min-width: 0;
}

.fm-share-list-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
    line-height: 1.4;
}

.fm-share-list-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.fm-share-list-files {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.fm-share-file-tag {
    display: inline-block;
    font-size: 11px;
    padding: 1px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-share-list-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .fm-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        border: none;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .fm-header {
        padding: 12px 16px;
    }

    .fm-toolbar {
        padding: 10px 16px;
        gap: 6px;
    }

    .fm-breadcrumb-bar {
        padding: 6px 16px;
    }

    .fm-search-box {
        max-width: none;
        flex-basis: 100%;
        order: -1;
    }

    .fm-toolbar-actions {
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

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

    .fm-action-btn span {
        display: none;
    }

    .fm-action-btn {
        padding: 8px;
    }

    .fm-select-bar {
        padding: 8px 16px;
    }

    .fm-item {
        padding: 10px 16px;
    }

    .fm-item-actions {
        opacity: 1;
    }

    .fm-upload-bar {
        padding: 10px 16px;
    }

    .fm-preview-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        border: none;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .fm-preview-body {
        padding: 12px 16px;
        min-height: 0;
    }

    .fm-preview-body pre {
        max-height: none;
    }

    .fm-preview-body img {
        max-height: calc(100dvh - 80px);
        max-height: calc(100vh - 80px);
        object-fit: contain;
    }

    .fm-share-content,
    .fm-share-list-content {
        width: 95%;
        max-width: 95%;
    }

    .fm-share-list-body {
        max-height: 60vh;
    }
}