html,
body.lp-file-review {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #f3f5f8;
    color: #1f2937;
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

body.lp-file-review--preview {
    overflow: hidden !important;
    background: #525659 !important;
}

.lp-fr-main {
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    max-width: 1200px;
    min-height: 100vh;
}

.lp-fr-main--preview {
    max-width: none !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
}

.lp-fr-empty,
.lp-fr-gate {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 48px 28px;
    text-align: center;
    margin-top: 48px;
}

.lp-fr-empty h1,
.lp-fr-gate h1 {
    margin: 0 0 12px;
    font-size: 22px;
}

.lp-fr-empty p,
.lp-fr-gate p {
    margin: 0;
    color: #6b7280;
    line-height: 1.6;
}

.lp-fr-empty code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.lp-fr-gate-btn {
    margin-top: 24px;
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 28px;
    cursor: pointer;
}

.lp-fr-gate-btn:hover {
    background: #1d4ed8;
}

/* 预览层：强制贴满视口，不受站点布局影响 */
.lp-fr-viewer {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #525659 !important;
    border: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    z-index: 2147483000 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

.lp-fr-loading,
.lp-fr-error {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    color: #e5e7eb;
    background: #525659;
}

.lp-fr-loading[hidden],
.lp-fr-stage[hidden],
.lp-fr-error[hidden] {
    display: none !important;
}

.lp-fr-error {
    color: #b91c1c;
    background: #fff;
}

.lp-fr-stage {
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
}

.lp-fr-stage iframe,
.lp-fr-stage embed,
.lp-fr-stage object {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    flex: 1 1 auto !important;
    border: 0 !important;
    background: #525659 !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

.lp-fr-doc {
    position: absolute;
    inset: 0;
    padding: 28px 4vw 48px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    line-height: 1.7;
    color: #111827;
    background: #fff;
    overflow: auto;
}

.lp-fr-doc img {
    max-width: 100%;
    height: auto;
}

.lp-fr-sheet-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 12px 0;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.lp-fr-sheet-tab {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px 6px 0 0;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}

.lp-fr-sheet-tab.is-active {
    border-bottom-color: #fff;
    color: #2563eb;
    font-weight: 600;
}

.lp-fr-table-wrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 42px;
    overflow: auto;
    padding: 12px;
    background: #fff;
    box-sizing: border-box;
}

.lp-fr-table-wrap table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    font-size: 13px;
    background: #fff;
}

.lp-fr-table-wrap th,
.lp-fr-table-wrap td {
    border: 1px solid #e5e7eb;
    padding: 6px 10px;
    white-space: nowrap;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lp-fr-table-wrap th {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 1;
}

@media (max-width: 640px) {
    .lp-fr-main:not(.lp-fr-main--preview) {
        padding-left: 12px;
        padding-right: 12px;
    }

    .lp-fr-doc {
        padding: 16px;
    }
}
