@charset "utf-8";

.ebook-list {
    --ebook-bg: #ffffff;
    --ebook-panel: #ffffff;
    --ebook-line: #d1d5db;
    --ebook-ink: #111827;
    --ebook-accent: #2563eb;
    --ebook-shadow: none;
    color: var(--ebook-ink);
}

.ebook-write {
    --ebook-bg: #ffffff;
    --ebook-panel: #ffffff;
    --ebook-line: #d1d5db;
    --ebook-ink: #111827;
    --ebook-accent: #2563eb;
    width: auto;
    max-width: none;
    margin: 0 auto;
    box-sizing: border-box;
    background: #ffffff;
    color: var(--ebook-ink);
}

.ebook-write__header {
    margin-bottom: 18px;
}

.ebook-write__title {
    margin: 0 0 8px;
    font-size: 32px;
}

.ebook-write__desc {
    margin: 0;
    color: #6b7280;
}

.ebook-write__notice,
.ebook-write__panel {
    padding: 22px;
    border: 1px solid var(--ebook-line);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: none;
}

.ebook-write__notice {
    margin-bottom: 18px;
}

.ebook-write__notice strong {
    display: block;
    margin-bottom: 8px;
}

.ebook-write__notice p {
    margin: 0;
    line-height: 1.7;
    color: #6b7280;
}

.ebook-field + .ebook-field {
    margin-top: 18px;
}

.ebook-field label,
.ebook-field__label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.ebook-field select,
.ebook-field .frm_input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    background: #fff;
    box-sizing: border-box;
}

.ebook-field__tip {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
}

.ebook-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ebook-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #374151;
}

.ebook-check--delete {
    margin-top: 10px;
}

.ebook-file {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ebook-file__name {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    background: #fff;
    box-sizing: border-box;
}

.ebook-file__button,
.ebook-write__cancel,
.ebook-write__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid #d1d5db;
}

.ebook-file__button {
    background: #111827;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
}

.ebook-file__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.ebook-write__count-desc,
.ebook-write__count-wrap {
    color: #6b7280;
}

.ebook-write__count-wrap {
    margin-top: 8px;
    text-align: right;
}

.ebook-write__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.ebook-write__cancel {
    background: rgba(255, 255, 255, 0.74);
    color: var(--ebook-ink);
}

.ebook-write__submit {
    background: #111827;
    color: #fff;
    cursor: pointer;
}

.ebook-list__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.ebook-list__header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ebook-list__view-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    background: #ffffff;
}

.ebook-list__view-btn {
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ebook-ink);
    cursor: pointer;
}

.ebook-list__view-btn.is-active {
    background: #111827;
    color: #fff;
}

.ebook-list__title {
    margin: 0 0 8px;
    font-size: 32px;
    line-height: 1.2;
}

.ebook-list__desc {
    margin: 0;
    color: #6b7280;
}

.ebook-list__write,
.ebook-list-item__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    background: #ffffff;
    color: var(--ebook-ink);
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.ebook-list__write:hover,
.ebook-list-item__action:hover {
    background: #111827;
    color: #fff;
    transform: translateY(-1px);
}

.ebook-list__body {
    display: grid;
    gap: 16px;
}

.ebook-list__body[data-view-mode="gallery"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.ebook-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--ebook-line);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: var(--ebook-shadow);
}

.ebook-list-item.is-ebook {
    border-color: rgba(37, 99, 235, 0.18);
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.08);
}

.ebook-list-item__main {
    min-width: 0;
    flex: 1 1 auto;
}

.ebook-list-item__gallery-thumb {
    display: none;
    overflow: hidden;
    flex: 0 0 100%;
    aspect-ratio: 3 / 4;
    border-radius: 18px;
    background: #f3f4f6;
    text-decoration: none;
}

.ebook-list-item__gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ebook-list-item__gallery-thumb.is-empty {
    display: none;
}

.ebook-list-item__gallery-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #6b7280;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.ebook-list-item__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ebook-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.ebook-badge--notice {
    background: #111827;
    color: #fff;
}

.ebook-badge--category {
    background: rgba(37, 99, 235, 0.08);
    color: var(--ebook-accent);
}

.ebook-badge--pdf {
    background: #2563eb;
    color: #fff;
}

.ebook-list-item__subject {
    display: block;
    color: var(--ebook-ink);
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
}

.ebook-list-item__subject:hover {
    text-decoration: underline;
}

.ebook-list-item__meta {
    display: none;
}

.ebook-list-item__side {
    flex: 0 0 auto;
}

.ebook-list-item__action {
    min-width: 110px;
    background: #111827;
    color: #fff;
}

.ebook-list-item__action--plain {
    background: #ffffff;
    color: var(--ebook-ink);
}

.ebook-list-item__action--plain:hover {
    background: #111827;
    color: #fff;
}

.ebook-list__empty,
.ebook-list__pagination {
    margin-top: 18px;
    padding: 24px;
    border: 1px solid var(--ebook-line);
    border-radius: 20px;
    background: #ffffff;
}

.ebook-list__body[data-view-mode="gallery"] .ebook-list-item {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
}

.ebook-list__body[data-view-mode="gallery"] .ebook-list-item__gallery-thumb {
    display: block;
}

.ebook-list__body[data-view-mode="gallery"] .ebook-list-item__side {
    width: 100%;
}

.ebook-list__body[data-view-mode="gallery"] .ebook-list-item__action {
    width: 100%;
}

.ebook-board-view {
    --ebook-bg: #ffffff;
    --ebook-panel: #ffffff;
    --ebook-line: #d1d5db;
    --ebook-ink: #111827;
    --ebook-accent: #2563eb;
    --ebook-shadow: none;
    width: auto;
    max-width: none;
    margin: 0 auto;
    box-sizing: border-box;
    background: #ffffff;
    color: var(--ebook-ink);
}

.ebook-board-view__header {
    margin-bottom: 24px;
}

.ebook-board-view__title {
    margin: 0 0 10px;
    font-size: 32px;
    line-height: 1.25;
}

.ebook-board-view__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #6f6256;
    font-size: 14px;
}

.ebook-viewer {
    padding: 24px;
    border: 1px solid var(--ebook-line);
    border-radius: 28px;
    background: var(--ebook-bg);
    box-shadow: var(--ebook-shadow);
}

.ebook-viewer--empty {
    text-align: center;
    color: #6f6256;
}

.ebook-viewer__topbar,
.ebook-viewer__footer,
.ebook-board-view__files li,
.ebook-board-view__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ebook-viewer__topbar {
    justify-content: flex-end;
}

.ebook-viewer__tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ebook-viewer__zoom {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    background: #ffffff;
}

.ebook-viewer__zoom-value {
    min-width: 54px;
    text-align: center;
    font-size: 13px;
    color: var(--ebook-ink);
}

.ebook-viewer__tabs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    background: #ffffff;
}

.ebook-viewer__tab {
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ebook-ink);
    cursor: pointer;
}

.ebook-viewer__tab.is-active {
    background: #111827;
    color: #fff;
}

.ebook-viewer__eyebrow {
    margin: 0 0 4px;
    color: #6b7280;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.ebook-viewer__filename {
    font-size: 18px;
}

.ebook-viewer__download,
.ebook-viewer__tool,
.ebook-board-view__actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    background: #ffffff;
    color: var(--ebook-ink);
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.ebook-viewer__download:hover,
.ebook-viewer__tool:hover,
.ebook-board-view__actions .btn:hover {
    background: #fff;
    transform: translateY(-1px);
}

.ebook-viewer__tool {
    cursor: pointer;
}

.is-hidden {
    display: none !important;
}

.ebook-viewer__stage {
    display: grid;
    grid-template-columns: clamp(44px, 5vw, 64px) minmax(0, 1fr) clamp(44px, 5vw, 64px);
    position: relative;
    align-items: center;
    gap: 18px;
    margin: 22px 0 18px;
}

.ebook-viewer__book {
    position: relative;
    min-height: clamp(420px, 72vw, 880px);
    padding: clamp(10px, 2vw, 24px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    perspective: 2400px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.ebook-viewer__shadow {
    position: absolute;
    inset: clamp(12px, 2vw, 28px);
    border-radius: 18px;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.04), transparent 68%);
    pointer-events: none;
}

.ebook-viewer__pages {
    position: relative;
    width: 100%;
    min-height: clamp(400px, 68vw, 820px);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ebook-viewer__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: clamp(400px, 68vw, 820px);
    border: 1px dashed rgba(15, 23, 42, 0.16);
    border-radius: 18px;
    color: #6b7280;
    background: #f9fafb;
}

.ebook-viewer__loading--error {
    color: #8f3024;
}

.ebook-page {
    position: absolute;
    top: 0;
    left: 50%;
    max-width: 100%;
    pointer-events: none;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 0.6s ease, opacity 0.35s ease, filter 0.35s ease;
}

.ebook-viewer.is-transitioning .ebook-page {
    transition: none !important;
}

.ebook-viewer.is-transitioning .ebook-viewer__pages,
.ebook-viewer.is-transitioning .ebook-viewer__book {
    contain: layout paint;
}

.ebook-viewer.is-rendering .ebook-page {
    transition: none !important;
}

.ebook-viewer.is-zooming .ebook-page {
    transition: none !important;
}

.ebook-page__front,
.ebook-page__back {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: 14px;
    backface-visibility: hidden;
    box-shadow: 0 20px 35px rgba(66, 41, 24, 0.16);
}

.ebook-page__front {
    background: #fff;
}

.ebook-page__front canvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

.ebook-page__image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    background: #fff;
}

.ebook-viewer:fullscreen {
    padding: 12px;
    border-radius: 0;
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    overflow: auto;
}

.ebook-viewer:fullscreen .ebook-viewer__stage {
    min-height: calc(100vh - 120px);
    align-items: center;
}

.ebook-viewer:fullscreen .ebook-viewer__book {
    min-height: calc(100vh - 170px);
    background: #ffffff;
}

.ebook-viewer:fullscreen .ebook-viewer__pages,
.ebook-viewer:fullscreen .ebook-viewer__loading {
    min-height: calc(100vh - 210px);
}

.ebook-page__back {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    transform: rotateY(180deg);
    color: rgba(15, 23, 42, 0.28);
    font-size: 32px;
    letter-spacing: 0.2em;
}

.ebook-page.is-active {
    z-index: 3;
    opacity: 1;
    filter: blur(0);
    transform: translateX(-50%) rotateY(0deg);
}

.ebook-page.is-next {
    z-index: 2;
    opacity: 0.9;
    filter: blur(0.4px);
    transform: translateX(-48%) scale(0.985);
}

.ebook-page.is-prev {
    z-index: 1;
    opacity: 0.15;
    filter: blur(1.5px);
    transform: translateX(-54%) rotateY(-168deg);
}

.ebook-page.is-hidden {
    z-index: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-48%) scale(0.96);
}

.ebook-viewer__nav {
    height: 64px;
    width: 64px;
    position: relative;
    z-index: 20;
    border: 0;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ebook-viewer__nav:hover:not(:disabled) {
    transform: translateY(-1px);
}

.ebook-viewer__nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.ebook-viewer__footer {
    color: #6b7280;
    font-size: 14px;
}

.ebook-viewer__page {
    font-weight: 700;
    color: var(--ebook-accent);
}

.ebook-board-view__content {
    margin-top: 28px;
    padding: 24px;
    border: 1px solid var(--ebook-line);
    border-radius: 20px;
    background: #ffffff;
    line-height: 1.8;
}

.ebook-board-view__files {
    margin-top: 20px;
    padding: 24px;
    border: 1px solid var(--ebook-line);
    border-radius: 20px;
    background: #ffffff;
}

.ebook-board-view__files h3 {
    margin: 0 0 14px;
    font-size: 18px;
}

.ebook-board-view__files ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ebook-board-view__files li + li {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(71, 41, 20, 0.08);
}

.ebook-board-view__files a {
    color: var(--ebook-ink);
    text-decoration: none;
}

.ebook-board-view__files a:hover {
    text-decoration: underline;
}

.ebook-board-view__actions {
    justify-content: flex-end;
    margin-top: 20px;
}

.ebook-viewer:fullscreen .ebook-viewer__stage {
    grid-template-columns: 1fr;
    position: relative;
}

.ebook-viewer:fullscreen .ebook-viewer__nav {
    position: fixed;
    top: 50%;
    z-index: 30;
    width: clamp(48px, 5vw, 64px);
    height: clamp(48px, 5vw, 64px);
    transform: translateY(-50%);
    box-shadow: 0 14px 28px rgba(66, 41, 24, 0.28);
}

.ebook-viewer:fullscreen .ebook-viewer__nav--prev {
    left: 14px;
}

.ebook-viewer:fullscreen .ebook-viewer__nav--next {
    right: 14px;
}

@media (max-width: 1024px) {
    .ebook-viewer__stage {
        grid-template-columns: 52px minmax(0, 1fr) 52px;
        gap: 12px;
    }

    .ebook-viewer__book {
        padding: 18px;
    }
}

@media (max-width: 767px) {
    .ebook-list__header,
    .ebook-list__header-actions,
    .ebook-list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .ebook-list__title {
        font-size: 26px;
    }

    .ebook-list-item__subject {
        font-size: 19px;
    }

    .ebook-list-item__side,
    .ebook-list-item__action {
        width: 100%;
    }

    .ebook-list__view-switch {
        width: 100%;
        justify-content: flex-start;
    }

    .ebook-list__body[data-view-mode="gallery"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ebook-board-view__title {
        font-size: 26px;
    }

    .ebook-write__title {
        font-size: 26px;
    }

    .ebook-file,
    .ebook-write__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ebook-viewer {
        padding: 16px;
        border-radius: 20px;
    }

    .ebook-viewer__topbar,
    .ebook-viewer__footer,
    .ebook-viewer__tools,
    .ebook-board-view__files li,
    .ebook-board-view__actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .ebook-viewer__zoom,
    .ebook-viewer__tabs {
        width: 100%;
        justify-content: flex-start;
    }

    .ebook-viewer__stage {
        grid-template-columns: 1fr;
    }

    .ebook-viewer__book {
        order: 1;
        width: 100%;
        padding: 12px;
    }

    .ebook-viewer__nav {
        order: 2;
        width: 100%;
        height: 48px;
        border-radius: 14px;
    }

    .ebook-viewer:fullscreen .ebook-viewer__nav {
        width: 52px;
        height: 52px;
        border-radius: 50%;
    }

    .ebook-page__back {
        font-size: 20px;
    }
}
