* {
    box-sizing: border-box
}

html,
body {
    margin: 0;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: #eef2f7;
    color: #1f2937
}

.topbar {
    height: 72px;
    background: #173b67;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 2px 10px #0002
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px
}

.logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #fff2;
    display: grid;
    place-items: center;
    font-size: 23px
}

.brand h1 {
    font-size: 20px;
    margin: 0 0 3px
}

.brand p {
    font-size: 12px;
    margin: 0;
    opacity: .85
}

.icon-btn,
.close-btn {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 25px;
    cursor: pointer
}

.icon-btn {
    display: none
}

.layout {
    display: flex;
    height: calc(100vh - 72px)
}

.sidebar {
    width: 285px;
    background: #fff;
    border-right: 1px solid #dce2e8;
    padding: 20px;
    overflow: auto;
    flex: none
}

.side-head {
    display: flex;
    align-items: center;
    justify-content: space-between
}

.side-head h2 {
    font-size: 18px;
    margin: 0 0 15px;
    color: #173b67
}

.close-btn {
    display: none;
    color: #173b67
}

.search {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d6dce3;
    border-radius: 8px;
    outline: 0;
    margin-bottom: 14px
}

.search:focus {
    border-color: #173b67
}

.chapter {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-radius: 8px;
    padding: 12px;
    margin: 6px 0;
    background: #f3f6fa;
    color: #243447;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.35
}

.chapter:hover,
.chapter.active {
    background: #173b67;
    color: #fff
}

.chapter small {
    display: block;
    opacity: .7;
    margin-top: 3px
}

.content {
    min-width: 0;
    flex: 1;
    padding: 18px;
    display: flex;
    flex-direction: column
}

.reader-head {
    background: #fff;
    border: 1px solid #dce2e8;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 14px
}

.label {
    font-size: 10px;
    font-weight: bold;
    color: #64748b;
    letter-spacing: 1px
}

.reader-head h2 {
    font-size: 19px;
    margin: 4px 0 0;
    color: #173b67
}

.actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end
}

.actions button {
    border: 0;
    background: #173b67;
    color: #fff;
    padding: 9px 12px;
    border-radius: 7px;
    cursor: pointer
}

.actions button:disabled {
    opacity: .45;
    cursor: not-allowed
}

.actions button:hover:not(:disabled) {
    filter: brightness(1.1)
}

.reader {
    position: relative;
    flex: 1;
    min-height: 0;
    background: #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px #0001
}

.reader iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: none
}

.empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    color: #64748b
}

.empty-icon {
    font-size: 48px
}

.empty h3 {
    margin: 8px 0;
    color: #334155
}

.empty p {
    margin: 0
}

.tip {
    font-size: 12px;
    color: #64748b;
    margin: 8px 2px 0
}

.overlay {
    display: none
}

@media(max-width:850px) {
    .icon-btn {
        display: block
    }

    .sidebar {
        position: fixed;
        z-index: 30;
        left: -310px;
        top: 72px;
        bottom: 0;
        height: calc(100vh - 72px);
        transition: left .25s;
        box-shadow: 4px 0 15px #0002
    }

    .sidebar.open {
        left: 0
    }

    .close-btn {
        display: block
    }

    .overlay.show {
        display: block;
        position: fixed;
        inset: 72px 0 0;
        background: #0006;
        z-index: 25
    }

    .reader-head {
        align-items: flex-start;
        flex-direction: column
    }

    .actions {
        width: 100%;
        justify-content: flex-start
    }

    .actions button {
        flex: 1;
        min-width: 105px
    }

    .content {
        padding: 10px
    }

    .reader {
        min-height: 500px
    }
}

@media(max-width:480px) {
    .brand h1 {
        font-size: 16px
    }

    .brand p {
        font-size: 11px
    }

    .topbar {
        height: 64px;
        padding: 0 13px
    }

    .layout {
        height: calc(100vh - 64px)
    }

    .sidebar {
        top: 64px;
        height: calc(100vh - 64px)
    }

    .overlay.show {
        inset: 64px 0 0
    }

    .reader {
        min-height: calc(100vh - 245px)
    }

    .actions button {
        font-size: 12px;
        padding: 8px 7px
    }
}