:root {
    --fr-bg: #f3efe7;
    --fr-ink: #1f2933;
    --fr-muted: #667085;
    --fr-card: #fffdf8;
    --fr-border: rgba(31, 41, 51, 0.12);
    --fr-shadow: 0 24px 80px rgba(31, 41, 51, 0.16);
    --fr-accent: #9a6a2f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at top, #fffaf0 0, var(--fr-bg) 44%, #e6dccd 100%);
    color: var(--fr-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.7;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

.fr-site-header,
.fr-site-footer {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.fr-site-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.fr-brand {
    font-weight: 800;
    font-size: 22px;
    text-decoration: none;
    letter-spacing: -0.03em;
}

.fr-brand img {
    max-height: 54px;
    width: auto;
}

.fr-menu ul {
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fr-menu a {
    text-decoration: none;
    color: var(--fr-muted);
    font-weight: 600;
    font-size: 14px;
}

.fr-app {
    width: min(1180px, calc(100% - 24px));
    margin: 20px auto 30px;
}

.fr-book-shell {
    position: relative;
    min-height: 680px;
    display: grid;
    place-items: center;
    perspective: 1800px;
}

.fr-page {
    position: relative;
    width: min(860px, 100%);
    min-height: 640px;
    max-height: calc(100vh - 180px);
    overflow: auto;
    background: linear-gradient(90deg, rgba(0,0,0,0.045), transparent 3.4%), var(--fr-card);
    border: 1px solid var(--fr-border);
    box-shadow: var(--fr-shadow);
    border-radius: 26px;
    padding: clamp(26px, 4vw, 58px);
    transform-origin: left center;
    transition: transform 360ms ease, opacity 280ms ease;
    scrollbar-width: thin;
    touch-action: pan-y;
}

.fr-page::before {
    content: "";
    position: sticky;
    top: -58px;
    display: block;
    height: 1px;
    background: transparent;
}

.fr-page.is-flipping-next {
    transform: rotateY(-16deg) translateX(16px);
    opacity: 0.45;
}

.fr-page.is-flipping-prev {
    transform: rotateY(16deg) translateX(-16px);
    opacity: 0.45;
}

.fr-post-cover {
    width: calc(100% + clamp(52px, 8vw, 116px));
    margin: calc(clamp(26px, 4vw, 58px) * -1) calc(clamp(26px, 4vw, 58px) * -1) 34px;
    max-height: 320px;
    overflow: hidden;
    border-radius: 26px 26px 0 0;
    background: #e2d7c8;
}

.fr-post-cover img {
    display: block;
    width: 100%;
    height: 320px;
    object-fit: cover;
}

.fr-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: var(--fr-muted);
    font-size: 14px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.fr-title {
    margin: 12px 0 22px;
    font-size: clamp(34px, 6vw, 64px);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.fr-content {
    font-size: clamp(17px, 2vw, 20px);
}

.fr-content p:first-child {
    font-size: 1.12em;
    color: #384250;
}

.fr-content blockquote {
    margin: 28px 0;
    padding: 8px 0 8px 24px;
    border-left: 4px solid var(--fr-accent);
    color: #384250;
    font-size: 1.05em;
}

.fr-read-original {
    display: inline-flex;
    margin-top: 26px;
    color: var(--fr-accent);
    font-weight: 800;
    text-decoration: none;
}

.fr-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.9);
    box-shadow: 0 12px 32px rgba(31, 41, 51, 0.16);
    font-size: 24px;
    cursor: pointer;
    transition: transform 180ms ease, opacity 180ms ease;
}

.fr-nav-button:hover {
    transform: translateY(-50%) scale(1.06);
}

.fr-nav-button:disabled,
.fr-control:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.fr-prev {
    left: 8px;
}

.fr-next {
    right: 8px;
}

.fr-controls {
    margin: 18px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.fr-control {
    border: 1px solid var(--fr-border);
    background: #fffdf8;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 800;
    cursor: pointer;
}

.fr-progress,
.fr-hint {
    color: var(--fr-muted);
    font-weight: 700;
    text-align: center;
}

.fr-hint {
    font-size: 14px;
}

.fr-loading,
.fr-empty,
.fr-error {
    min-height: 420px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    color: var(--fr-muted);
    text-align: center;
}

.fr-spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 4px solid rgba(154, 106, 47, 0.18);
    border-top-color: var(--fr-accent);
    animation: fr-spin 800ms linear infinite;
}

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

.fr-site-footer {
    color: var(--fr-muted);
    text-align: center;
    padding: 20px 0 34px;
    font-size: 14px;
}

@media (max-width: 760px) {
    .fr-site-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px 0 6px;
    }

    .fr-menu ul {
        flex-wrap: wrap;
    }

    .fr-book-shell {
        min-height: auto;
        display: block;
    }

    .fr-page {
        min-height: calc(100vh - 230px);
        max-height: none;
        border-radius: 20px;
    }

    .fr-post-cover,
    .fr-post-cover img {
        border-radius: 20px 20px 0 0;
        max-height: 230px;
    }

    .fr-post-cover img {
        height: 230px;
    }

    .fr-nav-button {
        display: none;
    }
}
