/**
 * 캐스영어 웹북 스타일시트 (신버전)
 *
 * 구버전: csbasic/stl/books.css
 * - 모든 클래스명을 .cas-books__* 형태로 변환
 * - 구버전과 완전히 독립적으로 동작
 */

/* ===== CSS Variables ===== */
:root {
    --cas-books-primary: #4a90d9;
    --cas-books-secondary: #667eea;
    --cas-books-accent: #e93737;
    --cas-books-dark: #333333;
    --cas-books-light: #f8f9fa;
    --cas-books-border: #e0e0e0;
    --cas-books-gray: #717171;
    --cas-books-width: 1200px;
    --cas-books-content-width: 1100px;
}

/* ===== Base Styles ===== */
.cas-books__content-whole-wrapper {
    background-color: #f2f3f3;
}

.cas-books__content-wrapper {
    display: grid;
    grid-template-columns: max-content 24px auto;
    max-width: var(--cas-books-width);
    text-align: center;
    margin: 0 auto 0 auto;
}

.cas-books__flex-margin {
    /* 그리드 레이아웃 간격 */
}

/* ===== Banner ===== */
.cas-books__view-title-wrapper {
    position: relative;
    background-color: #3b9388;
    width: 335px;
    height: 335px;
    border-radius: 20px;
}

.cas-books__view-title-box {
    padding: 56px 0 0 31px;
}

.cas-books__view-title {
    color: white;
    text-align: left;
}

.cas-books__view-title--small {
    font-size: 15px;
    display: block;
}

.cas-books__view-title--big {
    font-size: 30px;
    margin-top: 10px;
    display: block;
}

.cas-books__view-title-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
}

.cas-books__view-title-icon img {
    width: 100px;
    height: 100px;
}

/* ===== Upper Banner (Instruction) ===== */
.cas-books__view-upper-banner {
    padding: 30px 38px;
    background-color: white;
    border-radius: 15px;
    text-align: left;
    margin-bottom: 22px;
}

.cas-books__view-upper-banner-big-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.cas-books__view-upper-banner-small-text {
    font-weight: 500;
    color: var(--cas-books-gray);
}

/* ===== Search Box ===== */
.cas-books__view-contents-search-wrapper {
    box-sizing: border-box;
    display: block;
}

.cas-books__search-input-container {
    display: grid;
    align-items: center;
    margin-bottom: 0px;
    position: relative;
    grid-template-columns: auto max-content;
    box-sizing: border-box;
    margin: 12px auto 0 auto;
}

.cas-books__search-input-wrapper {
    padding: 15px;
}

.cas-books__search-input {
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px 0 10px 5px;
    width: 100%;
}

#cas-submitBookSearch {
    padding: 7px 8px;
    background-color: #d97e82;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: 5px;
}

#cas-submitBookSearch:hover {
    background-color: #c7686c;
}

.cas-books__search-dropdown-container {
    position: relative;
}

.cas-books__search-dropdown-menu-wrapper {
    display: none;
    position: absolute;
    z-index: 9999;
    top: 39px;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    border: 1px solid #ccc;
    border-radius: 4px;
}

.cas-books__search-dropdown-menu {
    background-color: #f9f9f9;
    max-height: 400px;
    overflow-y: auto;
}

.cas-books__search-dropdown-wrapper {
    padding: 12px 16px;
    cursor: pointer;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}

.cas-books__search-dropdown-wrapper:hover {
    background-color: #ddd;
}

.cas-books__search-dropdown-num {
    font-size: 14px;
    font-weight: 300;
    color: white;
    border: 1px solid #c97271;
    padding: 2px 6px;
    display: inline-block;
    border-radius: 8px;
    background-color: #c97271;
    margin-right: 8px;
}

.cas-books__search-dropdown-title {
    font-size: 15px;
    font-weight: 400;
}

.cas-books__search-dropdown-empty {
    padding: 16px;
    text-align: center;
    color: #666;
}

.cas-books__search-dropdown-closer {
    padding: 10px 16px;
    background-color: #ffffff;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    color: #666;
    border-top: 1px solid #e1e1e1;
}

.cas-books__search-dropdown-closer:hover {
    background-color: #f0f0f0;
}

.cas-books__search-highlight {
    background-color: #ffcfcc;
    padding: 1px 2px;
    border-radius: 2px;
}

/* ===== View Contents ===== */
.cas-books__view-content-wrapper {
    margin: 10px;
}

.cas-books__view-contents-inner-wrapper {
    margin-top: 22px;
    border-radius: 20px;
    overflow: hidden;
    background-color: white;
    box-sizing: border-box;
}

.cas-books__view-contents-inner-flex-wrapper {
    box-sizing: border-box;
    padding: 15px 40px;
}

/* ===== List Item Styles ===== */
.cas-books__subtitle-wrapper {
    cursor: pointer;
    padding: 20px 0;
    margin: 0 auto;
    width: 100%;
    max-width: var(--cas-books-width);
    background-color: #ffffff;
    vertical-align: top;
}

@media screen and (max-width: 480px) {
    .cas-books__subtitle-wrapper{
        padding: 0;
    }
}

/* hover 스타일은 원본에 없음 */

/* Picture List Style */
.cas-books__subtitle-wrapper.cas-books__picture-list {
    background-color: #ffffff;
    position: relative;
    display: inline-flex;
    box-sizing: border-box;
}

/* 인접 형제 선택자: 항목 사이에만 border (정렬 순서 무관) */
.cas-books__subtitle-wrapper.cas-books__picture-list + .cas-books__subtitle-wrapper.cas-books__picture-list,
.cas-books__subtitle-wrapper.cas-books__video-list + .cas-books__subtitle-wrapper.cas-books__video-list {
    border-top: 1px solid #b5b5b5;
}

.cas-books__subtitle-wrapper.cas-books__picture-list.cas-books__last-item,
.cas-books__subtitle-wrapper.cas-books__video-list.cas-books__last-item {
    padding: 20px 0 0 0;
}

.cas-books__subtitle-wrapper.cas-books__picture-list img {
    width: 120px;
    height: 100px;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    margin-right: 10px;
    align-self: center;
}

.cas-books__dl-steps-string {
    text-align: left;
    font-size: 16px;
    line-height: 24px;
    width: 90%;
    margin: 0 auto;
}

.cas-books__dl-steps-string.cas-books__picture-list {
    position: relative;
    bottom: 0px;
    z-index: 99;
    width: 100%;
    text-align: left;
    margin: 2px 0;
    box-sizing: border-box;
    background-color: white;
    padding-bottom: 50px;
}

.cas-books__dl-steps-string.cas-books__picture-list--left {
    text-align: left;
}

.cas-books__dl-steps-string img {
    width: 15px;
    margin-left: 10px;
}

.cas-books__dl-steps-string-p {
    font-weight: 600;
    margin: 0;
}

.cas-books__dl-steps-string-p--label {
    color: #de7069;
    font-weight: 600;
    padding-bottom: 15px;
}

.cas-books__dl-steps-string-p--main {
    padding-top: 2px;
    padding-bottom: 5px;
    font-size: 18px;
}

.cas-books__dl-steps-string-p--sub {
    padding-bottom: 2px;
    font-weight: 400;
}

/* Video List Style */
.cas-books__subtitle-wrapper.cas-books__video-list {
    background-color: #ffffff;
    position: relative;
    display: inline-flex;
    box-sizing: border-box;
    border-bottom: 1px solid #b5b5b5;
    flex-direction: column;
}

.cas-books__video-iframe {
    border-radius: 8px;
    max-width: 100%;
}

.cas-books__dl-steps-string.cas-books__video-list {
    position: relative !important;
}

.cas-books__dl-steps-string.cas-books__video-list:hover {
    background-color: #ffe9eb;
}

/* ===== Hitcount (Admin Only) ===== */
.cas-books__hitcount {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: var(--cas-books-gray);
    margin-top: 10px;
}

/* ===== Admin Tools ===== */
.cas-books__admin-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background-color: #fff9e6;
    border-bottom: 1px solid var(--cas-books-border);
}

.cas-books__edit-title-button {
    background: var(--cas-books-accent);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.cas-books__edit-title-button:hover {
    background: #c0392b;
}

/* Content Edit Button */
.cas-books__dl-emod-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 10px;
    transition: background 0.2s ease;
}

.cas-books__dl-emod-button:hover {
    background: #2980b9;
}

/* Content Edit Wrapper */
.cas-books__dl-emod-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-top: 10px;
}

.cas-books__dl-emod-wrapper textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
}

.cas-books__dl-emod-wrapper textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.cas-books__dl-emod-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.cas-books__dl-emod-confirm,
.cas-books__dl-emod-cancel {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cas-books__dl-emod-confirm {
    background: var(--cas-books-accent);
    color: white;
}

.cas-books__dl-emod-confirm:hover {
    background: #c0392b;
}

.cas-books__dl-emod-cancel {
    background: #6c757d;
    color: white;
}

.cas-books__dl-emod-cancel:hover {
    background: #5a6268;
}

/* Title Edit Wrapper */
.cas-books__edit-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: #fff9e6;
    border: 1px solid #ffc107;
    border-radius: 8px;
    margin: 10px 20px;
}

.cas-books__edit-title-wrapper input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.cas-books__edit-title-wrapper input:focus {
    outline: none;
    border-color: var(--cas-books-accent);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.cas-books__title-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.cas-books__title-edit-confirm,
.cas-books__title-edit-cancel {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cas-books__title-edit-confirm {
    background: var(--cas-books-accent);
    color: white;
}

.cas-books__title-edit-confirm:hover {
    background: #c0392b;
}

.cas-books__title-edit-cancel {
    background: #6c757d;
    color: white;
}

.cas-books__title-edit-cancel:hover {
    background: #5a6268;
}

/* ===== Pagination ===== */
.cas-books__pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 30px 20px;
}

.cas-books__pagination-num,
.cas-books__pagination-prev,
.cas-books__pagination-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--cas-books-dark);
    font-size: 14px;
    transition: all 0.2s ease;
}

.cas-books__pagination-num:hover,
.cas-books__pagination-prev:hover,
.cas-books__pagination-next:hover {
    background-color: #f0f0f0;
}

.cas-books__pagination-num--active {
    background-color: var(--cas-books-primary);
    color: white;
}

.cas-books__pagination-num--active:hover {
    background-color: var(--cas-books-primary);
}

.cas-books__pagination-ellipsis {
    color: var(--cas-books-gray);
}

.cas-books__pagination-prev img,
.cas-books__pagination-next img {
    width: 16px;
    height: 16px;
}

/* ===== Empty State ===== */
.cas-books__empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--cas-books-gray);
}

/* ===== Detail Page - Title Section ===== */
.cas-books__view-content-title-wrapper {
    max-width: var(--cas-books-content-width);
    margin: 0 auto;
    padding-top: 30px;
}

.cas-books__view-content-main-category-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cas-books__view-content-index {
    color: var(--cas-books-accent);
    font-weight: 600;
}

@media screen and (max-width: 780px) {
    .cas-books__view-content-index {
        font-size: 13px;
    }
}

.cas-books__view-content-print {
    cursor: pointer;
}

.cas-books__view-content-title-box {
    margin-top: 12px;
}

.cas-books__view-content-title-trans {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.4;
}

.cas-books__view-content-title {
    font-size: 15px;
    line-height: 1.8;
    color: var(--cas-books-gray);
}

/* ===== Detail Page - Category Tabs ===== */
.cas-books__dl-content-cover {
    background-color: #ffffff;
}

.cas-books__dl-category-box {
    max-width: var(--cas-books-width);
    margin: 0 auto;
    padding-top: 0px; /* 카테고리 탭 높이 보정 */
    background-color: white;
    border-bottom: 1px solid #dedede;
}

.cas-books__dl-category-wrapper-holder {
    position: fixed;
    top: calc(var(--cas-header-height, 50px)); /* 헤더 + 개발자 배너 */
    left: 0;
    width: 100%;
    background-color: white;
    border-bottom: 1px solid #dddddd;
    z-index: 998; /* 헤더(1000), 배너(999) 아래 */
}

.cas-books__dl-category-wrapper {
    display: flex;
    flex-wrap: wrap;
    max-width: var(--cas-books-content-width);
    background-color: white;
    margin: 0 auto;
    gap: 4px;
}

.cas-books__dl-category-tab {
    padding: 13px 16px;
    text-align: center;
    cursor: pointer;
    color: #b4b4b4;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.cas-books__dl-category-tab:hover {
    color: var(--cas-books-dark);
}

.cas-books__dl-category-tab--active {
    border-bottom-color: var(--cas-books-dark);
    color: var(--cas-books-dark);
}

/* ===== Detail Page - AI Study Button ===== */
.cas-books__dl-ai-study-button-wrapper {
    background-color: white;
    padding: 15px 0;
    text-align: right;
    max-width: var(--cas-books-content-width);
    margin: 0 auto;
}

.cas-books__dl-ai-study-button,
.cas-books__dl-print-mode-button,
.cas-books__dl-content-mode-button {
    display: inline-block;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 24px;
    box-shadow: 2px 2px 10px 0 rgba(0, 0, 0, 0.04);
    border: 1px solid #dedbdb;
    background-color: #ffffff;
    margin-left: 8px;
}

.cas-books__dl-ai-study-button-wrapper span {
    font-size: 14px;
}

.cas-books__dl-ai-study-button--inactive,
.cas-books__dl-content-mode-button--inactive {
    opacity: 0.4;
    cursor: default;
}

.cas-books__ai-title-icon {
    width: 20px;
    vertical-align: middle;
}

.cas-books__oval {
    width: 6px;
    height: 6px;
    margin: 0 0 8px 0;
    background-color: var(--cas-books-accent);
    border-radius: 50%;
    display: inline-block;
}

.cas-books__print-mode,
.cas-books__content-mode {
    display: none;
    vertical-align: middle;
    width: 24px;
    margin-left: 2px;
}

.cas-books__print-mode-active,
.cas-books__content-mode-active {
    display: inline-block !important;
}

/* ===== Detail Page - Steps (Content Tabs) ===== */
.cas-books__dl-steps-wrapper {
    max-width: var(--cas-books-content-width);
    margin: 0 auto;
}

.cas-books__dl-steps {
    display: none;
    min-height: 500px;
    padding-bottom: 30px;
}

.cas-books__dl-steps--active {
    display: block;
}

.cas-books__dl-step-hidden-title {
    text-align: left;
    max-width: var(--cas-books-content-width);
    margin: 0 auto;
    padding: 48px 0 20px 0;
}

.cas-books__dl-step-hidden-title span {
    font-size: 24px;
    font-weight: 700;
}

.cas-books__waterprint {
    /* 워터마크 영역 */
}

.cas-books__dl-steps-ai-info {
    max-width: var(--cas-books-content-width);
    padding-top: 30px;
    padding-bottom: 20px;
    margin: 0 auto;
    text-align: left;
}

.cas-books__dl-steps-ai-info span {
    color: var(--cas-books-gray);
}

.cas-books__dl-steps-ai-info img {
    width: 18px;
    vertical-align: middle;
    margin-bottom: 0 !important;
}

/* ===== Detail Page - Image ===== */
.cas-books__dl-steps-image {
    max-width: var(--cas-books-content-width);
    margin: 20px auto;
    text-align: center;
}

.cas-books__dl-steps-image img {
    max-width: 100%;
    border-radius: 8px;
}

/* ===== Content Styles ===== */
.cas-books__dl-sub-wrapper {
    border-radius: 10px;
    position: relative;
    text-align: left;
    margin: 0 auto;
    max-width: var(--cas-books-content-width);
    padding: 30px 30px 10px 30px;
}

.cas-books__dl-sub-wrapper--transparent-round {
    border: 1px solid #b1b1b1;
    background-color: transparent;
    border-radius: 25px;
    cursor: pointer;
    padding: 12px 10px !important;
    margin-top: 15px;
}

.cas-books__dl-sub-wrapper--transparent-round p {
    font-size: 16px;
    line-height: 30px;
}

.cas-books__dl-sub-wrapper--transparent-round:hover {
    background-color: #898989;
}

.cas-books__dl-sub-wrapper--transparent-round:hover p {
    color: white;
}

.cas-books__dl-sub-title {
    font-size: 14px;
    color: var(--cas-books-gray);
    margin-bottom: 10px;
}

.cas-books__dl-levels {
    text-align: left;
    font-size: 18px;
    line-height: 26px;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
}

.cas-books__dl-levels strong {
    font-family: Georgia;
}

.cas-books__dl-levels br {
    line-height: 40px;
}

.cas-books__dl-levels.hidden {
    display: none;
}

.cas-books__dl-levels-line {
    margin-bottom: 18px;
}

.cas-books__dl-levels-wrapper {
    background-color: white;
    border-radius: 10px;
}

.cas-books__dl-levels-wrapper--gray-box {
    margin-top: 15px;
    margin-bottom: 5px;
    padding-left: 0;
    background-color: #f8f8f8;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.cas-books__dl-levels-custom-content {
    display: block;
    background-color: #f8f8f8;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.cas-books__dl-levels-custom-content span {
    line-height: 22px;
}

.cas-books__dl-levels-custom-content--ai {
    background-color: #fef0f0;
}

.cas-books__fbold {
    font-weight: 500 !important;
}

.cas-books__fbolder {
    font-weight: 700 !important;
}

.cas-books__description-grey {
    display: inline-block;
    padding: 10px;
    width: 86%;
    margin: 30px auto 30px auto;
    font-size: 16px;
    color: #6c6c6c;
    border: 1px solid #9d9d9d;
    line-height: 23px;
}

/* ===== Vocabulary Styles ===== */
.cas-books__dl-levels.cas-books__dl-levels--defin {
    color: #6a6a6a;
}

.cas-books__dl-levels.cas-books__dl-levels--word {
    font-weight: 800;
    color: #cf5157;
}

.cas-books__dl-levels--word-kordef {
    color: #c35b59;
    font-family: 'Pretendard Variable';
    margin-left: 10px;
    font-weight: 500;
    vertical-align: middle;
    font-size: 18px;
}

/* AI 스터디용 한국어 정의 */
.cas-books__dl-activity-kordef {
    color: #c35b59;
    font-family: 'Pretendard Variable';
    font-weight: 500;
    font-size: 15px;
    margin: 5px 0 0 0;
}

.cas-books__really-strong {
    font-weight: 800;
    color: #cf5157;
}

.cas-books__dl-levels-wrapper--example-gray-box {
    margin-top: 13px;
    margin-bottom: 5px;
    padding: 8px 5px;
    background-color: #f8f8f8;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.cas-books__dl-levels-wrapper--example-gray-box .cas-books__dl-levels {
    font-size: 16px;
    font-style: italic;
}

.cas-books__dl-levels-defin {
    display: none;
    font-size: 14px;
}

.cas-books__dl-levels-defin--on {
    display: block;
}

.cas-books__dl-levels a {
    color: blue;
    text-decoration: underline;
}

.cas-books__example-icon {
    width: 38px;    
    margin-bottom: 0 !important;
    vertical-align: middle;
}

.cas-books__hr-voca-content {
    margin: 40px 0 25px 0;
    border: none;
    border-top: 1px dashed #ccc;
}

/* ===== Article/Reading Styles ===== */
.cas-books__prep-main-sentence {
    line-height: 34px;
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
}

.cas-books__prep-main-sentence.clicked {
    padding: 5px;
    background-color: #fce8e8;
    border-radius: 5px;
}

.cas-books__prep-main-sentence:hover {
    color: red;
    cursor: pointer;
}

.cas-books__small-source-text {
    font-size: 13px;
    font-weight: 300;
    color: gray;
}

.cas-books__translation-box {
    border: 1px solid #c2c2c2;
    border-radius: 10px;
    padding: 5px 10px;
    margin: 15px 0;
    font-size: 15px;
    color: black !important;
    line-height: 24px;
    word-break: keep-all;
}

/* ===== Dialogue Styles ===== */
.cas-books__kdi-dialogue-span {
    display: block;
    padding: 8px 0;
}

.cas-books__strong-underline {
    text-decoration: underline;
}

/* ===== Kids Dialogue Styles ===== */
.cas-books__dl-kids-dialogue-character img {
    height: 100px !important;
    width: 80px !important;
    margin-bottom: 1px !important;
}

.cas-books__dl-kids-dialogue-line-with-character {
    display: grid;
    margin: 20px 0;
}

.cas-books__dl-kids-dialogue-line-with-character--left {
    grid-template-columns: 1fr 2fr;
}

.cas-books__dl-kids-dialogue-line-with-character--right {
    grid-template-columns: 2fr 1fr;
}

.cas-books__dl-kids-dialogue-line-with-character--right .cas-books__dl-kids-dialogue-character {
    justify-content: right;
}

.cas-books__dl-kids-dialogue-line-with-character--left .cas-books__dl-kids-dialogue-character {
    justify-content: left;
}

.cas-books__dl-kids-dialogue-character {
    display: flex;
}

.cas-books__dl-kids-dialogue-line {
    display: grid;
    align-items: center;
}

.cas-books__dl-kids-dialogue-box {
    display: grid;
    text-align: center;
    margin: 0 auto 40px auto;
    max-width: 790px;
}

.cas-books__dl-kids-heading {
    margin-bottom: 45px;
    padding: 20px;
    background-color: #f1f1ef;
}

.cas-books__dl-kids-dialogue-question-and-answer {
    margin-bottom: 30px;
}

.cas-books__dl-kids-dialogue-questions,
.cas-books__dl-kids-dialogue-question,
.cas-books__dl-kids-dialogue-answer {
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
}

.cas-books__dl-kids-dialogue-video-iframe-title {
    margin: 30px 0;
}

.cas-books__dl-kids-dialogue-videos {
    margin-top: 20px;
}

.cas-books__dl-kids-dialogue-video-iframe {
    margin-bottom: 30px;
}

.cas-books__kids-speech-bubble-wrapper {
    flex: 1;
}

.cas-books__kids-speech-bubble {
    display: inline-block;
    padding: 16px 20px;
    border-radius: 20px;
    font-size: 16px;
    line-height: 1.5;
    max-width: 80%;
}

.cas-books__kids-speech-bubble--left {
    background-color: #e8f4fd;
    border-bottom-left-radius: 4px;
}

.cas-books__kids-speech-bubble--right {
    background-color: #fff3e0;
    border-bottom-right-radius: 4px;
}

/* ===== Business Dialogue Styles ===== */
.cas-books__dl-business-dialogue-text {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    margin-bottom: 14px;
    position: relative;
}

/* 음성 버튼 컨테이너 - 같은 위치에 겹쳐서 표시 */
.cas-books__dl-dialogue_voice_opener,
.cas-books__dl-dialogue_voice_pause,
.cas-books__dl-dialogue_voice_loading {
    grid-column: 3;
    grid-row: 1;
    justify-self: center;
    align-self: center;
}

.cas-books__dl-business-dialogue-character {
    font-weight: bold;
    text-align: left;
    margin-right: 10px;
    padding-top: 6px;
    color: #333;
    font-family: 'Segoe UI', sans-serif;
}

.cas-books__dl-dialogue_voice_opener {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cas-books__dl-dialogue_voice_pause {
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cas-books__dl-dialogue_voice_pause--active {
    display: flex;
}

.cas-books__dl-dialogue_voice_opener--inactive {
    display: none;
}

.cas-books__dl-dialogue_voice_loading {
    display: none;
    width: 40px !important;
}

.cas-books__dl-dialogue_voice_loading--active {
    display: inline-block;
}

.cas-books__dl-dialogue_voice_player {
    display: none;
}

.cas-books__dl-dialogue_voice_player--active {
    display: inline-block;
}

.cas-books__dl-business-dialogue-line {
    position: relative;
    padding: 10px 14px;
    background-color: #eef6ff;
    border: 1px solid #cde0f3;
    border-radius: 16px;
    max-width: 85%;
    font-size: 16px;
    line-height: 1.5;
    color: #222;
    text-align: left;
    white-space: normal;
    width: fit-content;
}

.cas-books__dl-business-dialogue-heading {
    background-color: #e3f2fd;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.cas-books__bubble-color-1 { background-color: #e3f2fd; }
.cas-books__bubble-color-2 { background-color: #fff3e0; }
.cas-books__bubble-color-3 { background-color: #e8f5e9; }
.cas-books__bubble-color-4 { background-color: #fce4ec; }
.cas-books__bubble-color-5 { background-color: #f3e5f5; }

.cas-books__dl-line-en {
    font-size: 16px;
    margin-bottom: 8px;
}

.cas-books__dl-line-ko {
    font-size: 14px;
    color: var(--cas-books-gray);
}

.cas-books__dl-dialogue_voice_opener img,
.cas-books__dl-dialogue_voice_pause img {
    width: 24px;
}

/* ===== Business Alternatives Styles ===== */
.cas-books__alt-section-heading {
    font-size: 18px;
    font-weight: bold;
    color: #2a4d77;
    margin-bottom: 25px;
    text-align: center;
    padding: 18px 20px;
    background: linear-gradient(135deg, #eef4fb, #d9e8f5);
    border-radius: 12px;
}

.cas-books__alt-box {
    background: #f8fafd;
    border: 1px solid #dce6f2;
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease;
}

.cas-books__alt-box:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.cas-books__alt-quote {
    font-size: 16px;
    text-align: center;
    color: #333;
    padding: 15px;
    background-color: #ffffff;
    border-radius: 8px;
    margin-bottom: 18px;
    border: 1px solid #e8eff7;
}

.cas-books__alt-kor-trans {
    font-size: 13.5px;
    color: #777;
    margin-top: 6px;
}

.cas-books__alt-btn {
    display: block;
    margin: 0 auto;
    padding: 8px 16px;
    background-color: #0077cc;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.cas-books__alt-btn:hover {
    background-color: #005fa3;
}

.cas-books__alt-answer {
    margin-top: 18px;
    animation: fadeIn 0.3s ease-in-out;
}

.cas-books__alt-answer-inner {
    background-color: #ffffff;
    border: 1px solid #e4eaf0;
    padding: 20px;
    border-radius: 10px;
}

.cas-books__alt-new {
    font-size: 16px;
    font-weight: 600;
    color: #0077cc;
    text-align: center;
    margin-bottom: 14px;
}

.cas-books__alt-word {
    font-size: 14.5px;
    color: #444;
    margin-bottom: 6px;
}

.cas-books__alt-note {
    font-size: 13.5px;
    color: #666;
    background-color: #fef9e8;
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 3px solid #f3c347;
}

/* ===== Roleplay Styles ===== */
.cas-books__dl-levels--roleplay {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 24px 0;
}

.cas-books__dl-roleplay-card {
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 35px 20px 19px;
    position: relative;
    transition: box-shadow 0.2s ease;
    white-space: normal;
}

.cas-books__dl-roleplay-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.cas-books__dl-roleplay-card--situation {
    background-color: #f4f8fb;
    border: 1px solid #d3e1ed;
}

.cas-books__dl-roleplay-card--situation .cas-books__dl-situation-label {
    background-color: #6ba5db;
}

.cas-books__dl-roleplay-card--instruction {
    background-color: #fffbea;
    border: 1px solid #f1e5a9;
}

.cas-books__dl-roleplay-card--instruction .cas-books__dl-situation-label {
    background-color: #f3c347;
    color: #222;
}

.cas-books__dl-roleplay-card--hint {
    background-color: #fffbea;
    border: 1px solid #f1e5a9;
}

.cas-books__dl-roleplay-card--hint .cas-books__dl-situation-label {
    background-color: #f3c347;
    color: #222;
}

.cas-books__dl-situation-label {
    position: absolute;
    top: -12px;
    left: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
}

.cas-books__dl-roleplay-situation,
.cas-books__dl-roleplay-instruction,
.cas-books__dl-roleplay-hint {
    line-height: 1.7;
}

.cas-books__dl-roleplay-situation--en,
.cas-books__dl-roleplay-instruction--en,
.cas-books__dl-roleplay-hint--en {
    font-size: 16px;
    margin-bottom: 8px;
}

.cas-books__dl-roleplay-situation--ko,
.cas-books__dl-roleplay-instruction--ko,
.cas-books__dl-roleplay-hint--ko {
    font-size: 14px;
    line-height: 18px;
    margin-top: 10px;
    color: #666;
}

/* 롤플레이 영역 br 태그 간격 조정 (기본 40px → 정상) */
.cas-books__dl-levels--roleplay br {
    line-height: normal;
}

.cas-books__dl-example-wrapper {
    margin-top: 16px;
    text-align: center;
}

.cas-books__dl-example-toggle {
    background-color: var(--cas-books-primary, #4a90c2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.cas-books__dl-example-toggle:hover {
    background-color: #3a7fc9;
}

.cas-books__dl-example-content {
    margin-top: 16px;
    padding: 16px;
    background-color: #f5f5f5;
    border-radius: 8px;
    line-height: 1.7;
    text-align: left;
}

/* ===== Video Styles ===== */
.cas-books__dl-videos {
    margin-top: 50px;
}

.cas-books__dl-youtube-summary {
    margin-top: 20px;
    padding: 16px;
    background-color: #f8f8f8;
    border-radius: 8px;
    line-height: 1.7;
}

/* ===== Content Holder ===== */
.cas-books__content-holder {
    position: relative;
    margin-bottom: 30px;
}

.cas-books__content-holder-ai-button {
    position: relative;
    display: inline-block;
    width: 14px;
    margin-left: 15px;
    cursor: pointer;
    vertical-align: sub;
}

.cas-books__content-holder-ai-button img {
    width: 18px;
    height: 18px;
    margin-bottom: unset !important;
}

/* ===== IELTS/OPIc Specific Styles ===== */
.cas-books__opic-instruction {
    background-color: #f5f5f5;
    padding: 24px;
    border-radius: 12px;
    line-height: 1.8;
}

.cas-books__opic-part-title {
    font-size: 18px;
    font-weight: 600;
    margin: 30px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--cas-books-primary);
}

/* ===== Business Email Table ===== */
.cas-books__business-email-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.cas-books__business-email-table th {
    text-align: left;
    padding: 12px 16px;
    background-color: #f5f5f5;
    border-bottom: 1px solid var(--cas-books-border);
}

.cas-books__e-mail-open-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--cas-books-primary);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    margin: 16px 0;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.cas-books__e-mail-open-button:hover {
    background-color: var(--cas-books-primary-dark, #357abd);
    transform: translateY(-1px);
}

.cas-books__table-hidden {
    display: none;
    margin-top: 16px;
}

/* ===== Error State ===== */
.cas-books__error {
    text-align: center;
    padding: 60px 20px;
    color: var(--cas-books-gray);
}

.cas-books__error h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--cas-books-dark);
}

.cas-books__error a {
    color: var(--cas-books-primary);
    text-decoration: none;
}

/* ===== Responsive Styles ===== */
@media screen and (max-width: 960px) {
    .cas-books__view-title-wrapper {
        width: 260px;
        height: 260px;
        border-radius: 15px;
    }

    .cas-books__view-content-wrapper {
        margin: 10px;
    }

    .cas-books__view-contents-inner-wrapper {
        margin-top: 20px;
    }

    .cas-books__view-contents-inner-flex-wrapper {
        padding: 0 20px;
    }

    .cas-books__dl-steps-string.cas-books__picture-list {
        padding-bottom: 14px !important;
    }

    .cas-books__view-upper-banner {
        padding-left: 20px;
    }

    .cas-books__search-input-container {
        margin: 25px 4px 0 4px;
    }

    .cas-books__dl-sub-wrapper {
        padding: 27px 9px 58px 9px;
    }
}

@media screen and (max-width: 870px) {
    .cas-books__view-title-icon img {
        width: 90px;
        height: 90px;
    }

    .cas-books__view-title-box {
        padding: 30px 95px 0 20px;
    }
}

@media screen and (max-width: 840px) {
    .cas-books__content-wrapper {
        grid-template-columns: unset;
        grid-template-rows: auto 10px auto;
    }

    .cas-books__view-title-wrapper {
        width: auto;
        height: 150px;
        margin: 10px 10px 0 10px;
    }
}

@media screen and (max-width: 768px) {
    .cas-books__view-upper-banner {
        padding: 20px;
    }

    .cas-books__dl-category-box {
        padding-top: 5px;
    }

    .cas-books__dl-category-wrapper {
        gap: 0;
    }

    .cas-books__dl-category-tab {
        padding: 10px 12px;
        font-size: 13px;
    }

    .cas-books__dl-step-hidden-title span {
        font-size: 20px;
    }

    .cas-books__view-content-title-trans {
        font-size: 20px;
    }

    .cas-books__view-content-title {
        line-height: 1.2;
    }


    .cas-books__dl-ai-study-button-wrapper {
        padding: 15px 10px;
    }

    .cas-books__dl-ai-study-button,
    .cas-books__dl-print-mode-button,
    .cas-books__dl-content-mode-button,
    .cas-books__dl-my-writings-button {
        display: inline-block;
        padding: 5px 10px;
        font-size: 13px;
        margin: 3px 2px;
    }

    .cas-books__kids-speech-bubble {
        max-width: 100%;
    }

    .cas-books__dl-business-dialogue-text {
        flex-direction: column;
    }

    .cas-books__dl-business-dialogue-character {
        min-width: auto;
    }
}

@media screen and (max-width: 480px) {
    .cas-books__content-whole-wrapper {
        padding: 0px;
    }

    .cas-books__view-contents-inner-flex-wrapper {
        padding: 0 5px;
    }

        .cas-books__dl-category-box {
        padding-top: 14px;
    }


    /* 버튼들 - 더 작은 화면 (구버전 스타일) */
    .cas-books__dl-ai-study-button,
    .cas-books__dl-print-mode-button,
    .cas-books__dl-content-mode-button,
    .cas-books__dl-my-writings-button {
        padding: 4px 6px;
        font-size: 12px;
        margin: 2px 1px;
    }

    .cas-books__dl-ai-study-button span,
    .cas-books__dl-print-mode-button span,
    .cas-books__dl-content-mode-button span,
    .cas-books__dl-my-writings-button span {
        font-size: 12px !important;
        font-weight: 500;
    }

    .cas-books__pagination {
        gap: 4px;
    }

    .cas-books__pagination-num,
    .cas-books__pagination-prev,
    .cas-books__pagination-next {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    .cas-books__view-title-box {
        padding: 20px 88px 0 20px;
    }
    .cas-books__view-title--big {
        font-size: 24px;
    }
    .cas-books__view-title-icon img {
        width: 70px;
        height: 70px;
    }
    .cas-books__dl-levels--word-kordef {
        font-size: 14px;
    }
    .books__view-upper-banner-small-text-header {
        font-size: 14px;
    }
    .books__view-upper-banner-small-text-content {
        font-size: 14px;
    }
    /*플레인리스트 간격 조정*/
    .cas-books__subtitle-wrapper.cas-books__plain-list {
        padding: 12px 0;
    }


    /* 모바일: 이미지 배경 + 하단 텍스트 오버레이 */
    .cas-books__subtitle-wrapper.cas-books__picture-list {
        width: calc(100% - 8px);
        margin: 8px 4px;
        display: block;
        position: relative;
        height: 180px;
        border-radius: 12px;
        overflow: hidden;
        border-bottom: none;
    }

    .cas-books__subtitle-wrapper.cas-books__picture-list > img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        margin: 0;
        border: none;
        border-radius: 0;
    }

    .cas-books__subtitle-wrapper.cas-books__picture-list .cas-books__dl-steps-string {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        height: auto;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
        padding: 50px 15px 15px 15px;
        z-index: 1;
    }

    .cas-books__subtitle-wrapper.cas-books__picture-list .cas-books__dl-steps-string-p {
        color: white !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
        line-height: 1;
    }

    /* 기존 label 숨기고 wrapper 기준 ::before로 표시 */
    .cas-books__subtitle-wrapper.cas-books__picture-list .cas-books__dl-steps-string-p--label {
        display: none;
    }

    .cas-books__subtitle-wrapper.cas-books__picture-list::before {
        content: "Lesson " attr(data-lesson);
        position: absolute;
        top: 10px;
        left: 10px;
        font-size: 11px;
        color: white;
        background-color: rgba(0, 0, 0, 0.5);
        padding: 3px 8px;
        border-radius: 4px;
        z-index: 2;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }

    .cas-books__subtitle-wrapper.cas-books__picture-list .cas-books__dl-steps-string-p--main {
        font-size: 16px;
        font-weight: 600;
        margin-top: 3px;
    }

    .cas-books__subtitle-wrapper.cas-books__picture-list .cas-books__dl-steps-string-p--sub {
        font-size: 13px;
        opacity: 0.85;
        margin-top: 2px;
    }

    .cas-books__prep-main-sentence {
        line-height: 22px;
        font-size: 16px;
    }

    .cas-books__dl-levels {
        font-size: 15px;
        line-height: 20px;
    }

    .cas-books__dl-levels.cas-books__dl-levels--defin {
        display: block;
        line-height: 18px !important;
        font-size: 14px;
        margin-top: 0px;
    }

    .cas-books__strong-underline {
        font-size: 16px;
        line-height: 24px;
    }

    .cas-books__dl-sub-wrapper {
        padding: 20px 5px 20px 5px;
        width: auto;
    }

    .cas-books__dl-levels-wrapper p {
        font-size: 16px;
        line-height: 20px;
    }

    .cas-books__dl-levels-wrapper span {
        font-size: 13px;
        line-height: 22px;
    }

    .cas-books__dl-levels-wrapper--example-gray-box {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .cas-books__dl-levels-wrapper--example-gray-box .cas-books__dl-levels {
        font-size: 13px;
    }

    .cas-books__dl-steps-string {
        font-size: 14px;
    }

    .cas-books__dl-business-dialogue-text {
        grid-template-columns: 53px 1fr 40px;
    }

    .cas-books__dl-business-dialogue-character {
        font-size: 12px;
    }

    .cas-books__dl-line-en {
        font-size: 14px;
    }

    .cas-books__dl-line-ko {
        font-size: 12px;
    }

    .cas-books__dl-business-dialogue-line {
        padding: 8px 8px;
    }
    .cas-books__view-title-wrapper {
        margin: 5px 5px 0 5px;
    }
    .cas-books__view-content-wrapper {
        margin: 5px 5px 0 5px;
    }
    .cas-books__view-upper-banner {
        margin-bottom: 10px;
    }
    .cas-books__view-contents-inner-wrapper {
        margin-top: 10px;
    }
}

/* ===== Translation Box ===== */
.cas-books__prep-main-sentence {
    cursor: pointer;
    transition: color 0.2s;
}

.cas-books__prep-main-sentence:hover {
    color: #cf5157;
}

.cas-books__prep-main-sentence.clicked {
    color: #cf5157;
}

.cas-books__translation-box {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 5px 9px;
    margin: 10px 0;
    font-size: 15px;
    line-height: 1.6;
    color: #856404;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cas-books__translation-text {
    flex: 1;
}

.cas-books__translation-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.cas-books__translation-edit-btn,
.cas-books__translation-save-btn,
.cas-books__translation-cancel-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 14px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.cas-books__translation-edit-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.cas-books__translation-save-btn:hover {
    background-color: rgba(0, 128, 0, 0.1);
}

.cas-books__translation-cancel-btn:hover {
    background-color: rgba(255, 0, 0, 0.1);
}

.cas-books__translation-box--editing {
    background-color: #e8f4fd;
    border-color: #4a90d9;
}

.cas-books__translation-box--editing .cas-books__translation-text {
    width: 100%;
}

.cas-books__translation-edit-input {
    width: 100%;
    min-height: 60px;
    padding: 8px;
    font-size: 15px;
    line-height: 1.6;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
}

.cas-books__translation-edit-input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

/* ===== My Writing Modal ===== */
.cas-books__my-writing-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cas-books__my-writing-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.cas-books__my-writing-modal {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.cas-books__my-writing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.cas-books__my-writing-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.cas-books__my-writing-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.cas-books__my-writing-close:hover {
    color: #333;
}

.cas-books__my-writing-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cas-books__my-writing-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.cas-books__my-writing-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    border-top: 1px solid #eee;
}

.cas-books__pagination-btn {
    background: #f0f0f0;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.cas-books__pagination-btn:hover {
    background: #667eea;
    color: white;
}

.cas-books__pagination-current {
    background: #667eea;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
}

/* ===== Overlay (구버전과 동일) ===== */
.cas-books__overlay {
    display: none;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    position: fixed;
    z-index: 999999;
}

.cas-books__overlay__outer {
    height: 100%;
    background: #222;
    opacity: 0.4;
}

.cas-books__overlay__inner {
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    position: absolute;
}

.cas-books__overlay__content {
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
}

.cas-books__overlay__logo {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 50%;
    background-image: url(/wp-content/imgloc/cas_icon.svg);
    width: 40px;
    height: 40px;
    background-repeat: no-repeat;
    background-position: center;
}

.cas-books__spinner {
    width: 75px;
    height: 75px;
    display: inline-block;
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.05);
    border-top-color: #ef556f;
    animation: cas-books-spin 1s infinite linear;
    border-radius: 100%;
    border-style: solid;
}

@keyframes cas-books-spin {
    100% {
        transform: rotate(360deg);
    }
}

/* ===== Char Counter ===== */
.cas-books__char-counter {
    font-size: 12px;
    color: #888;
    text-align: right;
    margin-top: 5px;
}

/* ===== AI Study Cover (스터디 실행 화면) ===== */
.cas-books__content-ai-mask {
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.38);
    z-index: 99998;
}

.cas-books__content-ai-cover {
    display: none;
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    margin: auto;
    max-width: 780px;
    max-height: 962px;
    right: 0;
    bottom: 0;
    background-color: white;
    overflow: auto;
    height: 100%;
    border: 1px solid transparent;
    border-radius: 16px;
    padding-bottom: 80px;
    box-sizing: border-box;
}

.cas-books__content-ai-inner-cover {
    position: relative;
}

.cas-books__content-ai-close {
    position: sticky;
    top: 23px;
    margin-left: calc(100% - 52px);
    width: max-content;
    padding: 5px;
    cursor: pointer;
    z-index: 9999;
}

.cas-books__content-ai-close img {
    width: 20px;
}

.cas-books__content-ai-title {
    text-align: center;
}

.cas-books__content-ai-title span {
    font-size: 24px;
    font-weight: 600;
    padding-left: 4px;
}

.cas-books__content-ai-title img {
    vertical-align: top;
}

.cas-books__content-ai-whole-wrapper {
    padding: 0 20px;
}

.cas-books__content-ai-policy-button-wrapper {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: #666;
}

.cas-books__content-ai-policy-button,
.cas-books__content-ai-guide-button {
    cursor: pointer;
    color: #666;
    text-decoration: none;
    font-size: 13px;
}

.cas-books__content-ai-guide-button:hover {
    text-decoration: none;
}

/* ===== AI Study Steps ===== */
.cas-books__dl-ai-steps-wrapper {
    padding: 20px 0;
}

.cas-books__dl-ai-steps {
    display: none;
}

.cas-books__dl-ai-steps--active {
    display: block;
}

/* ===== AI Study Category Tabs ===== */
.cas-books__dl-category-box--game {
    border-bottom: 1px solid #dedede;
    padding: 0 10px;
}

.cas-books__dl-ai-category-tab {
    display: inline-block;
    padding: 18px 15px;
    text-align: center;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    color: #b5b5b5;
    font-weight: 600;
    font-size: 14px;
}

.cas-books__dl-ai-category-tab:hover {
    color: #333;
}

.cas-books__dl-ai-category-tab--active {
    border-bottom-color: black;
    color: black;
}

/* ===== AI Study Content Box ===== */
.cas-books__dl-content-box {
    display: none;
    padding: 10px;
    position: relative;
}

.cas-books__dl-content-box.active-content {
    display: block;
}

.cas-books__dl-content-numbering {   
    background-color: #cf5157;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
}

.cas-books__dl-activity-wrapper {
    display: block;    
}

.cas-books__dl-activity-word-and-def-wrapper {
    padding-top: 8px;
}

.cas-books__dl-activity-word {
    font-size: 20px;
    font-weight: 600;
}

.cas-books__dl-activity-form {
    font-size: 18px;
    font-weight: 500;
    padding: 0 4px;
    color: #666;
}

.cas-books__dl-activity-def {
    padding-top: 7px;
    font-size: 16px;
    font-weight: 400;
    color: #333;
}

/* 질문 번역 (구버전 .books__translated_sentence와 동일) */
.cas-books__translated-sentence {
    font-size: 13px;
    color: gray;
    padding-left: 3px;
    margin-top: 5px;
}

.cas-books__dl-activity-lower {
    margin-top: 15px;
}

/* ===== AI Study Input Area ===== */
.cas-books__dl-levels-wrapper--ai-input {
    display: flex;
    flex-direction: column;
}

.cas-books__content-holder {
    margin-bottom: 15px;
}

.cas-books__dl-original-content {
    cursor: pointer;
}

/* ===== AI Input Wrapper (구버전과 동일한 flexbox 순서) ===== */
.cas-books__dl-levels-wrapper.cas-books__dl-levels-wrapper--ai-input {
    display: flex;
    flex-direction: column;
}

.cas-books__dl-levels-wrapper--ai-input .cas-books__dl-original-content {
    order: 1;
}

.cas-books__dl-levels-wrapper--ai-input .cas-books__dl-textarea-outer-box {
    order: 1;
}

.cas-books__dl-levels-wrapper--ai-input .cas-books__dl-ai-label {
    order: 3;
}

.cas-books__dl-levels-wrapper--ai-input .cas-books__dl-ai_content {
    order: 4;
}

.cas-books__dl-levels-wrapper--ai-input .cas-books__dl-ai-confirm {
    order: 2;
}

/* ===== Textarea & Original Content (구버전과 동일) ===== */
.cas-books__dl-textarea-outer-box {
    text-align: right;
    display: none;
}

.cas-books__dl-textarea--game {
    background-color: #f4f4f4;
    height: 60px;
    border: none;
    font-size: 14px;
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    box-sizing: border-box;
    resize: vertical;
}

.cas-books__dl-textarea--game::placeholder {
    font-size: 13px;
}

.cas-books__dl-original-content {
    cursor: pointer;
}

.cas-books__dl-original-content,
.cas-books__dl-ai_content {
    padding: 14px !important;
    background-color: #f8f8f8;
    font-size: 18px;
    border: 1px solid #f8f8f8;
    border-radius: 10px;
    overflow: hidden;
    min-height: 55px;
    height: auto;
}

.cas-books__dl-ai_content {
    padding: 10px;
    background-color: #fef0f0;
    font-size: 18px;
    margin-top: 10px;
}

.cas-books__dl-ai_content.content-hidden {
    display: none;
}

.cas-books__dl-original-content-pre-text {
    color: gray;
    font-size: 14px;
}

.cas-books__dl-content-write-again {
    display: inline-block;
    font-size: 11px;
    border: 1px solid #919191;
    border-radius: 5px;
    background-color: #ffffff63;
    float: right;
    padding: 3px;
    color: #474747;
    cursor: pointer;
}

.cas-books__dl-textarea {
    width: 100%;
    min-height: 60px;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    resize: vertical;
    box-sizing: border-box;
}

.cas-books__dl-ai-label {
    margin-top: 30px;
    margin-bottom: 10px;
}

.cas-books__dl-ai-label.content-hidden {
    display: none;
}

.cas-books__dl-ai-label img {
    vertical-align: middle;
}

.cas-books__dl-ai-label span {
    margin-left: 5px;
}

.cas-books__dl-ai-confirm {
    border-radius: 6px;
    background-color: silver;
    margin: 20px auto;
    width: max-content;
    text-align: center;
    border: 1px solid #d7d7d7;
    padding: 15px 60px;
    color: white;
    display: none;
    cursor: default;
}

.cas-books__dl-ai-confirm--visible {
    display: block;
}

.cas-books__dl-ai-confirm--no-content {
    display: block;
    background-color: #eb6665;
    cursor: pointer;
}

.cas-books__dl-ai-confirm--active {
    display: block;
    background-color: #eb6665;
    cursor: pointer;
}

.cas-books__dl-ai-confirm--inactive {
    display: block;
    background-color: silver !important;
}

/* ===== AI Study Pagination (구버전과 동일) ===== */
.cas-books__dl-levels-content-pagination-wrapper {
    position: relative;
    margin-top: 20px;
}

.cas-books__dl-levels-content-pagination {
    position: relative;
    display: grid;
    width: 100%;
    height: 50px;
    grid-auto-flow: column;
}

.cas-books__dl-levels-content-pagination-block {
    text-align: center;
    border-bottom: 1px solid #b3b3b3;
}

.cas-books__dl-levels-content-pagination-block--last {
    text-align: right;
}

.content-pagination-active {
    border-bottom: 2px solid #ff9a9a;
}

.cas-books__dl-levels-content-pagination-block-logo {
    display: none;
    width: 46px;
    margin-bottom: 0 !important;
}

.cas-books__dl-levels-content-pagination-block-logo--active {
    display: inline-block;
}

.cas-books__dl-levels-progress {
    text-align: center;
    margin-top: 9px;
}

.cas-books__dl-levels-buttons-wrapper {
    width: 100%;
    display: grid;
    grid-auto-flow: column;
    margin-top: 36px;
}

.cas-books__dl-levels-next-button-wrapper {
    display: inline-block;
    text-align: right;
    margin: 0 3px;
}

.cas-books__dl-levels-next-button-wrapper--right {
    text-align: left;
}

.cas-books__dl-levels-next-button,
.cas-books__dl-levels-prev-button,
.cas-books__dl-levels-finish-button {
    cursor: pointer;
    display: inline-block;
    background-color: white;
    max-width: 164px;
    width: 100%;
    height: 50px;
    padding: 16px 30px;
    border: 1px solid #dddddd;
    border-radius: 4px;
}

.cas-books__dl-levels-next-button,
.cas-books__dl-levels-finish-button {
    background-color: #eb6665;
    color: white;
}

.cas-books__dl-levels-next-button--invisible {
    display: none;
}

.cas-books__dl-levels-prev-button--invisible {
    opacity: 0.5;
}

.cas-books__dl-levels-finish-button--invisible {
    display: none;
}

.cas-books__dl-levels-finish-button--visible {
    display: block;
}

/* ===== AI Study Games Arrow (구버전과 동일) ===== */
.cas-books__dl-games-arrow-wrapper {
    background-color: white;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* ===== AI Study Mobile ===== */
@media screen and (max-width: 780px) {    
    .cas-books__content-ai-cover {
        border-radius: 0;
        max-height: 100%;
    }

    .cas-books__dl-ai-category-tab {
        padding: 6px 8px;
        font-size: 14px;
    }

    .cas-books__content-ai-title span {
        font-size: 18px;
    }

    .cas-books__content-ai-close {
        position: fixed;
        top: 6px;
        right: 15px;
        margin-left: 0;
    }

    .cas-books__content-ai-inner-cover {
        margin-top: 10px;
    }

    .cas-books__dl-ai-steps-wrapper {
        padding: 4px 0;
    }

    .cas-books__dl-content-box {
        min-height: 270px;
        padding: 5px;
    }

    .cas-books__content-ai-whole-wrapper {
        margin-top: 0;
        padding: 0 10px;
    }

    .cas-books__dl-content-numbering {
        margin-bottom: 6px;
    }

    .cas-books__dl-ai-steps .cas-books__dl-sub-wrapper {
        padding: 15px 8px 0px 8px;
    }

    .cas-books__dl-levels-content-pagination {
        height: 41px;
    }

    .cas-books__dl-levels-content-pagination-block-logo {
        width: 37px;
    }

    .cas-books__dl-activity-word,
    .cas-books__dl-activity-form {
        font-size: 16px;
    }

    .cas-books__dl-activity-def {
        padding-top: 3px;
        font-size: 14px;
        font-weight: 300;
    }

    .cas-books__dl-ai-label {
        margin-top: 12px;
    }

    .cas-books__dl-ai-confirm {
        font-size: 13px;
        padding: 15px 38px;
    }

    .cas-books__dl-levels-next-button,
    .cas-books__dl-levels-prev-button,
    .cas-books__dl-levels-finish-button {
        padding: 12px 20px;
        height: auto;
        font-size: 14px;
    }
}

/* ===== AI Study Sticky Navigation (스크롤 시 하단 고정) ===== */
.cas-books__dl-levels-content-pagination-wrapper {
    position: sticky;
    bottom: -65px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px 10px;
    margin-top: 10px;
    z-index: 10;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* 모바일에서 네비게이션 컴팩트하게 */
@media screen and (max-width: 780px) {
    .cas-books__dl-levels-content-pagination-wrapper {
        padding: 8px 5px;
        /*box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);*/
        bottom: -33px;
    }

    .cas-books__dl-levels-content-pagination-wrapper .cas-books__dl-levels-content-pagination {
        height: 30px;
    }

    .cas-books__dl-levels-content-pagination-wrapper .cas-books__dl-levels-content-pagination-block-logo {
        width: 28px;
    }

    .cas-books__dl-levels-content-pagination-wrapper .cas-books__dl-levels-progress {
        margin-top: 10px;
        font-size: 12px;
    }

    .cas-books__dl-levels-content-pagination-wrapper .cas-books__dl-levels-buttons-wrapper {
        margin-top: 10px;
    }

    .cas-books__dl-levels-content-pagination-wrapper .cas-books__dl-levels-next-button,
    .cas-books__dl-levels-content-pagination-wrapper .cas-books__dl-levels-prev-button,
    .cas-books__dl-levels-content-pagination-wrapper .cas-books__dl-levels-finish-button {
        height: 32px !important;
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
    .cas-books__dl-levels-next-button,
    .cas-books__dl-levels-prev-button,
    .cas-books__dl-levels-finish-button {
        max-width: 124px !important;
    }

}

/* ===== Content Mode (내 작문 보기) ===== */
.cas-books__dl-content-box--hidden {
    display: none;
}

.cas-books__dl-user-content {
    display: block;
}

.cas-books__dl-user-content--hidden {
    display: none;
}

/* ===== AI Study Policy Modal (구버전 개선 - fixed position) ===== */
.cas-books__dl-ai-modal-box-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 10000;
}

.cas-books__dl-ai-modal-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    width: 307px;
    height: 218px;
    max-height: 480px;
    border-radius: 7px;
    display: none;
    align-items: center;
    padding: 0 10px;
    grid-template-rows: 1fr 1.5fr 2fr;
    z-index: 10001;
}

.cas-books__dl-ai-modal-box--policy {
    height: 470px;
}

.cas-books__dl-ai-modal-box--policy .cas-books__dl-ai-modal-lower-text div {
    max-height: 285px;
    overflow: auto;
    text-align: left;
    padding: 7px;
    border: 1px solid #ddd;
}

.cas-books__dl-ai-modal-box--policy .cas-books__dl-ai-modal-closer {
    margin-top: 10px;
}

.cas-books__dl-ai-modal-box--policy .cas-books__dl-ai-modal-upper {
    margin-top: 10px;
}

.game-policy-forceblock {
    display: grid !important;
}

.cas-books__dl-ai-modal-closer {
    text-align: right;
}

.cas-books__dl-ai-modal-closer img {
    cursor: pointer;
    width: 20px;
}

.cas-books__dl-ai-modal-upper {
    text-align: center;
    padding: 0 10px;
}

.cas-books__dl-ai-modal-upper-text {
    display: block;
    padding-bottom: 6px;
    font-size: 17px;
    font-weight: 600;
}

.cas-books__dl-ai-modal-lower-text {
    display: block;
    margin-top: 12px;
    font-size: 13px;
}

.cas-books__dl-ai-modal-lower {
    text-align: center;
}

.cas-books__dl-ai-modal-confirm {
    width: 235px;
    height: 42px;
    margin: 0 auto;
    vertical-align: middle;
    line-height: 42px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.cas-books__dl-ai-modal-confirm--disabled {
    background-color: #e5e5e5;
    color: gray;
    cursor: default;
}

.cas-books__dl-ai-modal-confirm a {
    display: block;
    width: 100%;
}

/* ===== AI Study Modal ===== */
.cas-books__ai-study-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cas-books__ai-study-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.cas-books__ai-study-modal {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.cas-books__ai-study-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background-color: #fef0f0;
    border-radius: 12px 12px 0 0;
}

.cas-books__ai-study-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #cf5157;
}

.cas-books__ai-study-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.cas-books__ai-study-close:hover {
    color: #333;
}

.cas-books__ai-study-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.cas-books__ai-study-original {
    margin-bottom: 24px;
}

.cas-books__ai-study-original h4,
.cas-books__ai-study-input h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.cas-books__ai-study-text {
    background-color: #f8f8f8;
    padding: 16px;
    border-radius: 8px;
    line-height: 1.8;
    font-size: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.cas-books__ai-study-input {
    margin-bottom: 16px;
}

.cas-books__ai-study-textarea {
    width: 100%;
    min-height: 150px;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
}

.cas-books__ai-study-textarea:focus {
    outline: none;
    border-color: #cf5157;
    box-shadow: 0 0 0 2px rgba(207, 81, 87, 0.1);
}

.cas-books__ai-study-char-counter {
    font-size: 12px;
    color: #888;
    text-align: right;
    margin-top: 5px;
}

.cas-books__ai-study-actions {
    text-align: right;
}

.cas-books__ai-study-save {
    background-color: #cf5157;
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cas-books__ai-study-save:hover {
    background-color: #b84449;
}

/* ===== Mobile Sticky Bottom Menu ===== */
.cas-books__sticky-menu-wrapper {
    display: none; /* 기본적으로 숨김, 모바일에서만 표시 */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    background: #fff;
    opacity: 0.95;
    padding: 6px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.cas-books__sticky-menu {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    align-items: center;
    grid-template-columns: 65px 1fr 65px;
    padding: 0 16px;
    height: 36px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.cas-books__sticky-item {
    flex: 0 0 auto;
}

.cas-books__sticky-title {
    flex: 1 1 auto;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cas-books__sticky-title-num {
    color: #d46b70;
}

.cas-books__sticky-title-text {
    color: #333;
}

.cas-books__sticky-prev {
    text-align: left;
}

.cas-books__sticky-next {
    text-align: right;
}

.cas-books__sticky-item-link {
    color: #d46b70;
    cursor: pointer;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.cas-books__sticky-prev .cas-books__sticky-item-link {
    justify-content: flex-start;
}

.cas-books__sticky-next .cas-books__sticky-item-link {
    justify-content: flex-end;
}

.cas-books__sticky-item-link:hover {
    color: #b84449;
}

/* 모바일에서만 스티키 메뉴 표시 */
@media screen and (max-width: 1180px) {
    .cas-books__sticky-menu-wrapper {
        display: block;
    }

    /* 스티키 메뉴 공간 확보를 위한 하단 여백 */
    .cas-books__dl-steps-wrapper {
        padding-bottom: 60px;
    }
}

/* ===== Print Mode Styles ===== */
.cas-books__dl-steps--print-mode {
    display: block !important;
    border-bottom: 1px solid #eee;
    padding-bottom: 40px;
    margin-bottom: 20px;
}

/* ===== My Writing Item ===== */
.cas-books__my-writing-item {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.cas-books__my-writing-item:last-child {
    border-bottom: none;
}

.cas-books__my-writing-item-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
}

.cas-books__my-writing-item-content {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.cas-books__my-writing-item-date {
    font-size: 12px;
    color: #999;
}

.cas-books__my-writing-empty {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* ===== Mobile responsive for AI Study Modal ===== */
@media screen and (max-width: 768px) {
    .cas-books__ai-study-modal {
        width: 95%;
        max-height: 90vh;
    }

    .cas-books__ai-study-content {
        padding: 16px;
    }

    .cas-books__ai-study-text {
        max-height: 150px;
    }

    .cas-books__ai-study-textarea {
        min-height: 120px;
    }

}

/* ===== Print Styles ===== */
@media print {
    .cas-books__dl-levels {
        font-size: 11pt;
    }

    .cas-books__waterprint {
        display: block;
    }

    .cas-books-header,
    .cas-books-dev-banner,
    .cas-books__dl-ai-study-button-wrapper,
    .cas-books__search-input-container,
    .cas-books__sticky-menu-wrapper {
        display: none !important;
    }

    .cas-books__dl-steps {
        display: block !important;
        page-break-inside: avoid;
    }

    .cas-books__dl-category-wrapper-holder {
        position: static;
    }

    .cas-books__dl-category-box {
        padding-top: 0;
    }

    .cas-books-content-main {
        margin-top: 0;
    }
}

/* ========================================
   AI 교정 해설 스타일 (구버전과 동일)
   ======================================== */
.cas-books__explanation-wrapper {
    margin-top: 10px;
}

.cas-books__explanation-text {
    font-size: 13px;
    font-weight: 500;
    background-color: white;
    padding: 10px;
    display: none;
}

.cas-books__explanation-text--opened {
    display: block;
}

.cas-books__explanation-opener {
    text-align: center;
    padding: 5px 10px;
    background-color: white;
    margin-top: 10px;
    font-size: 13px;
    cursor: pointer;
}

.cas-books__explanation-text span {
    font-size: 13px;
}

.cas-books__explanation-text-span--red {
    color: red;
}

.cas-books__explanation-text-span--bold {
    font-weight: 500;
    line-height: 20px;
}

/* ========================================
   내 작문 보기 스타일 (구버전과 동일)
   ======================================== */
.cas-books__dl-normal-cc-wrapper {
    border-bottom: 2px solid #b3b3b3;
    padding-right: 10px;
    margin-top: 14px;
}

.cas-books__dl-levels-custom-content {
    display: block;
    background-color: #f8f8f8;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

.cas-books__dl-levels-custom-content span {
    line-height: 22px;
}

.cas-books__dl-levels-custom-content--ai {
    background-color: #fef0f0;
}

.cas-books__dl-custom-content-ai-label {
    margin-bottom: 8px;
}

.cas-books__dl-custom-content-ai-label span {
    font-weight: 600;
}

.cas-books__dl-custom-content-ai-label img {
    width: 20px;
    margin-bottom: unset !important;
    vertical-align: middle;
}

.cas-books__custom-content-correct {
    color: #28a745;
    font-weight: 500;
}

/* ===== Games Tooltip (구버전과 동일) ===== */
.cas-books__dl-games-tooltip {
    display: inline-block;
    font-size: 13px;
    color: gray;
    padding: 3px;
}

.cas-books__dl-games-tooltip:hover .cas-books__dl-games-tooltip-content {
    display: block;
}

.cas-books__dl-games-tooltip:hover .cas-books__dl-games-tooltip-content-opener {
    border-bottom: unset;
    user-select: none;
}

.cas-books__dl-games-tooltip-content-opener {
    display: block;
    text-align: right;
    cursor: pointer;
    color: #5b5b5b;
    border-bottom: 1px solid #9f9f9f;
    font-size: 14px;
}

.cas-books__dl-games-tooltip--needhelp {
    float: right;
}

.cas-books__dl-games-tooltip-content {
    border: 1px solid #ababab;
    padding: 7px;
    border-radius: 10px;
    position: absolute;
    width: 270px;
    right: 10px;
    text-align: left;
    background-color: white;
    z-index: 99;
    display: none;
}

.cas-books__dl-games-tooltip-content p,
.cas-books__dl-games-tooltip-content span {
    font-size: 13px !important;
    color: #5b5b5b;
}

/* ===== Comment Footer Bar (구버전과 동일) ===== */
.cas-books__comment-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    position: relative;
}

.cas-books__comment-char-counter {
    font-size: 12px;
    color: #888;
}

.cas-books__comment-tooltip {
    position: relative;
}

/* ===== Save Button (구버전과 동일) ===== */
.cas-books__dl-save-user-data {
    display: inline-block;
    padding: 8px 16px;
    background-color: #eb6665;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.cas-books__dl-save-user-data:hover {
    background-color: #d45a59;
}

/* ===== Translated Sentence (구버전과 동일) ===== */
.cas-books__translated_sentence {
    font-size: 13px;
    color: #666;    
    margin: 3px 0 18px 0;
}

/* ===== AI Study - Textarea & Original Content (구버전 books_games.css와 동일) ===== */
.cas-books__dl-textarea-outer-box {
    text-align: right;
    display: none;
}

.cas-books__dl-original-content {
    cursor: pointer;
}

.cas-books__dl-original-content,
.cas-books__dl-ai_content {
    padding: 14px !important;
    background-color: #f8f8f8;
    font-size: 18px;
    border: 1px solid #f8f8f8;
    border-radius: 10px;
    overflow: hidden;
    min-height: 55px;
    height: auto;
}

.cas-books__dl-ai_content {
    padding: 10px;
    background-color: #fef0f0;
    font-size: 18px;
    margin-top: 10px;
}

.cas-books__dl-ai_content.content-hidden {
    display: none;
}

.cas-books__dl-content-write-again {
    display: inline-block;
    font-size: 11px;
    border: 1px solid #919191;
    border-radius: 5px;
    background-color: #ffffff63;
    float: right;
    padding: 3px;
    color: #474747;
}

.cas-books__dl-original-content-pre-text {
    color: gray;
    font-size: 14px;
}

.cas-books__dl-textarea--game {
    background-color: #f4f4f4;
    height: 60px;
    border: none;
    font-size: 14px;
}

.cas-books__dl-textarea--game::placeholder {
    font-size: 13px;
}

/* ===== AI Study - Confirm Button (구버전과 동일) ===== */
.cas-books__dl-ai-confirm {
    border-radius: 6px;
    background-color: silver;
    margin: 20px auto;    
    line-height: 9px;
    text-align: center;
    border: 1px solid #d7d7d7;
    padding: 20px 93px;
    color: white;
    display: none;
}

.cas-books__dl-ai-confirm--visible {
    display: block;
}

.cas-books__dl-ai-confirm--no-content {
    display: block;
}

.cas-books__dl-ai-confirm--active {
    background-color: #eb6665;
    cursor: pointer;
}

.cas-books__dl-ai-confirm--inactive {
    background-color: silver !important;
}

/* ===== AI Study - Hint (구버전과 동일) ===== */
.cas-books__dl-ai-givemehint {
    order: 1;
    margin: 10px auto 0 auto;
    border-bottom: 1px solid #9f9f9f;
    color: #5b5b5b;
    font-size: 13px;
    cursor: pointer;
}

.cas-books__dl-ai-givemehint.cas-books__dl-ai-givemehint--hidden {
    display: none;
}

.cas-books__dl-ai-givemehint--hintopen {
    border-bottom: none;
}

.cas-books__dl-ai-hint {
    order: 1;
    font-size: 13px;
    margin-top: 10px;
    padding: 5px 10px 10px 10px;
    border: 1px solid #dfdfdf;
    font-weight: 400;
    border-radius: 7px;
}

.cas-books__dl-ai-hint span {
    font-size: 13px;
}

.cas-books__dl-ai-hint.cas-books__dl-ai-hint--hidden {
    display: none;
}

.cas-books__dl-ai-hint-disclaimer {
    font-size: 12px;
    padding: 1px;
    color: #949494;
    margin: 0 auto;
    display: block;
    text-align: center;
    cursor: pointer;
    margin-bottom: 3px;
}

.cas-books__dl-ai-hint-disclaimer--report-submitted {
    color: #28a745;
}

/* ===== AI Study - Content Box (구버전과 동일) ===== */
.cas-books__dl-content-box {
    display: none;
    min-height: 400px;
}

.cas-books__dl-content-box.active-content {
    display: block;
}

/* ===== AI Study - Navigation Buttons (구버전과 동일) ===== */
.cas-books__dl-levels-next-button-wrapper {
    display: inline-block;
    text-align: right;
    margin: 0 3px;
}

.cas-books__dl-levels-progress {
    text-align: center;
    margin-top: 9px;
}

.cas-books__dl-levels-next-button-wrapper--right {
    text-align: left;
}

.cas-books__dl-levels-next-button,
.cas-books__dl-levels-prev-button,
.cas-books__dl-levels-finish-button {
    cursor: pointer;
    display: inline-block;
    background-color: white;
    max-width: 164px;
    width: 100%;
    height: 50px;
    padding: 16px 30px;
    border: 1px solid #dddddd;
    border-radius: 4px;
}

.cas-books__dl-levels-next-button,
.cas-books__dl-levels-finish-button {
    background-color: #eb6665;
    color: white;
}

.cas-books__dl-levels-next-button--invisible {
    display: none;
}

.cas-books__dl-levels-prev-button--invisible {
    opacity: 0.5;
}

.cas-books__dl-levels-finish-button--invisible {
    display: none;
}

.cas-books__dl-levels-finish-button--visible {
    display: block;
}

.cas-books__dl-levels-buttons-wrapper {
    width: 100%;
}

/* ===== AI Study - Levels Wrapper with AI Input (구버전과 동일) ===== */
.cas-books__dl-levels-wrapper.cas-books__dl-levels-wrapper--ai-input {
    display: flex;
    flex-direction: column;
}

.cas-books__dl-levels-wrapper--ai-input .cas-books__dl-original-content {
    order: 1;
}

.cas-books__dl-levels-wrapper--ai-input .cas-books__dl-textarea-outer-box {
    order: 1;
}

.cas-books__dl-levels-wrapper--ai-input .cas-books__dl-ai-label {
    order: 3;
}

.cas-books__dl-levels-wrapper--ai-input .cas-books__dl-ai_content {
    order: 4;
}

.cas-books__dl-levels-wrapper--ai-input .cas-books__dl-ai-confirm {
    order: 2;
}

/* ===== PDF Download Loading ===== */
.cas-books__pdf-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cas-books__pdf-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: cas-books-pdf-spin 0.8s linear infinite;
}

@keyframes cas-books-pdf-spin {
    to {
        transform: rotate(360deg);
    }
}

.cas-books__view-content-print--loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}

/* ===== Voice Player (음성 듣기) - 구버전과 동일한 디자인 ===== */
.cas-books__play-button-speaker span {
    color: #fff;
}
.cas-books__play-button-speaker,
.cas-books__play-button-speaker-dialogue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    background-color: #d46b70;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 400;
    font-family: 'Pretendard Variable', sans-serif;
    line-height: 36px;
    transition: background-color 0.2s, opacity 0.2s;
}
.cas-books__play-button-speaker-dialogue span {
    color: white;
        font-size: 15px;
    font-weight: 400;
}

.cas-books__play-button-speaker:hover,
.cas-books__play-button-speaker-dialogue:hover {
    background-color: #c45a5f;
}

.cas-books__play-button-speaker--loading,
.cas-books__play-button-speaker-dialogue--loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}

.cas-books__play-button-speaker--loading::after,
.cas-books__play-button-speaker-dialogue--loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: cas-books-voice-spin 0.8s linear infinite;
    margin-left: 5px;
}

@keyframes cas-books-voice-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 음성 버튼 아이콘 (구버전과 동일) */
.cas-books__play-button-speaker img,
.cas-books__play-button-speaker-dialogue img {
    width: 18px;
    height: 18px;
    margin-bottom: 0;
    vertical-align: middle;
}

/* 대화문 정지 버튼 (구버전과 동일) */
.cas-books__dl-audio-player-playing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    background-color: #d46b70;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 400;
    font-family: 'Pretendard Variable', sans-serif;
    line-height: 36px;
    transition: background-color 0.2s;
}

.cas-books__dl-audio-player-playing:hover {
    background-color: #c45a5f;
}

.cas-books__dl-audio-player-playing img {
    width: 18px;
    height: 18px;
    margin-bottom: 0;
    vertical-align: middle;
    filter: brightness(0) invert(1);
}

.cas-books__dl-audio-player-playing span {
    color: #fff;
}

/* 오디오 플레이어 래퍼 - 순수 오디오 컨트롤러만 표시 */
.cas-books__dl-audio-player-wrapper {
    display: none;
    margin: 0;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
    border: none;
}

.cas-books__dl-audio-player-wrapper-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.cas-books__dl-audio-player-wrapper audio {
    width: 100%;
    max-width: 450px;
    height: 40px;
}

/* 대화문 개별 음성 버튼 */
.cas-books__dl-dialogue-voice-opener {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 8px;
    transition: background-color 0.2s, border-color 0.2s;
}

.cas-books__dl-dialogue-voice-opener:hover {
    background-color: #e0e0e0;
    border-color: #ccc;
}

.cas-books__dl-dialogue-voice-opener--loading {
    opacity: 0.6;
    pointer-events: none;
}

.cas-books__dl-dialogue-voice-opener img {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

/* 음성 듣기 버튼 래퍼 */
.cas-books__dl-audio-player-wrapper-outer {
    margin-top: 35px;
}

.cas-books__dl-voice-button-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.cas-books__voice-loading {
    width: 40px;
    margin-left: 10px;
    display: none;
}

/* 번역 토글 버튼 (구버전과 동일) */
.cas-books__translate-toggle-button {
    padding: 3px;
    margin-left: 20px;
    border-bottom: 1px solid #c97271;
    cursor: pointer;
    color: #c97271;
    font-weight: 500;
    font-size: 16px;
    transition: color 0.2s, border-color 0.2s;
}

.cas-books__translate-toggle-button:hover {
    color: #a85555;
    border-color: #a85555;
}

.cas-books__translate-toggle-button--active {
    color: #5a9e5a;
    border-color: #5a9e5a;
}

/* =====================================================
   공통 헤더 스타일 (CasBooksHeader)
   ===================================================== */

/* 헤더 변수 */
:root {
    --cas-primary: #4a90d9;
    --cas-secondary: #667eea;
    --cas-dark: #333;
    --cas-light: #f8f9fa;
    --cas-border: #e0e0e0;
    --cas-header-height: 50px;
}

/* 헤더 */
.cas-books-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--cas-header-height);
    background: #fff;
    border-bottom: 1px solid var(--cas-border);
    z-index: 1000;
}

.cas-books-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cas-books-header__logo img {
    height: 28px;
    width: 100px;
}

.cas-books-header__nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 메인 메뉴 섹션 (캐스영어 홈, 수강신청, 나의 글, 교재 바로가기) */
.cas-books-header__main-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cas-books-header__main-menu a,
.cas-books-header__main-menu .cas-books-header__dropdown-toggle {
    color: var(--cas-dark);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}

.cas-books-header__main-menu a:hover,
.cas-books-header__main-menu .cas-books-header__dropdown-toggle:hover {
    color: var(--cas-primary);
}

/* 로그인 메뉴 섹션 (xxx님, 마이페이지, 로그아웃) */
.cas-books-header__user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cas-books-header__user-menu a,
.cas-books-header__user {
    color: #888;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.cas-books-header__user-menu a:hover {
    color: var(--cas-primary);
}

/* 교재 바로가기 드롭다운 - 데스크톱 */
.cas-books-header__dropdown {
    position: relative;
    display: inline-block;
}

.cas-books-header__dropdown-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cas-books-header__dropdown-icon {
    width: 10px;
    height: 10px;
    transition: transform 0.3s ease;
}

.cas-books-header__dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 10px 0;
    z-index: 1000;
    margin-top: 10px;
}

.cas-books-header__dropdown-content--active {
    display: block;
}

.cas-books-header__dropdown-content a {
    display: block;
    padding: 8px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.cas-books-header__dropdown-content a:hover {
    background: #f5f5f5;
    color: var(--cas-primary);
}

/* 나의 글 버튼 */
.cas-books-header__mywriting {
    cursor: pointer;
}

.cas-books-mobile-menu__mywriting {
    cursor: pointer;
}

.cas-books-header__mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.cas-books-header__mobile-menu-btn span {
    width: 20px;
    height: 2px;
    background: var(--cas-dark);
}

/* 개발자 배너 */
.cas-books-dev-banner {
    position: fixed;
    top: var(--cas-header-height);
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    font-size: 12px;
    text-align: center;
    z-index: 999;
}

/* ===== 모바일 슬라이드 메뉴 (구버전과 동일) ===== */
.cas-books-mobile-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: #fff;
    z-index: 100001;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.cas-books-mobile-menu--active {
    right: 0;
}

.cas-books-mobile-menu__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: none;
}

.cas-books-mobile-menu__overlay--active {
    display: block;
}

.cas-books-mobile-menu__close {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
}

.cas-books-mobile-menu__close img {
    width: 20px;
    height: 20px;
}

.cas-books-mobile-menu__logo {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.cas-books-mobile-menu__logo img {
    width: 120px;
}

.cas-books-mobile-menu__content {
    padding: 20px;
}

.cas-books-mobile-menu__profile {
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.cas-books-mobile-menu__profile-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.cas-books-mobile-menu__profile-link {
    font-size: 14px;
    color: #666;
}

.cas-books-mobile-menu__profile-text {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.cas-books-mobile-menu__profile-login {
    display: inline-block;
    background: #e93737;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
}

.cas-books-mobile-menu__links {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cas-books-mobile-menu__link {
    display: block;
    padding: 12px 0;
    font-size: 16px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}

.cas-books-mobile-menu__link:hover {
    color: #e93737;
}

.cas-books-mobile-menu__logout {
    display: block;
    margin-top: 30px;
    padding: 12px 0;
    text-align: center;
    font-size: 14px;
    color: #999;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.cas-books-mobile-menu__logout:hover {
    background: #f5f5f5;
}

/* 교재 바로가기 아코디언 */
.cas-books-mobile-menu__accordion {
    border-bottom: 1px solid #f0f0f0;
}

.cas-books-mobile-menu__accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 16px;
    color: #333;
    cursor: pointer;
}

.cas-books-mobile-menu__accordion-icon {
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease;
}

.cas-books-mobile-menu__accordion-icon--active {
    transform: rotate(180deg);
}

.cas-books-mobile-menu__accordion-content {
    display: none;
    padding-left: 15px;
    padding-bottom: 10px;
}

.cas-books-mobile-menu__accordion-content--active {
    display: block;
}

.cas-books-mobile-menu__accordion-item {
    display: block;
    padding: 10px 0;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
}

.cas-books-mobile-menu__accordion-item:last-child {
    border-bottom: none;
}

.cas-books-mobile-menu__accordion-item:hover {
    color: #e93737;
}

/* 반응형 - 헤더 */
@media screen and (max-width: 768px) {
    .cas-books-header {
        --cas-header-height: 40px;
    }

    .cas-books-header__inner {
        padding: 0 12px;
    }

    .cas-books-header__logo img {
        height: 22px;
        width: 80px;
    }

    .cas-books-header__nav {
        display: none;
    }

    .cas-books-header__mobile-menu-btn {
        display: flex;
    }
}

/* =====================================================
   홈페이지 스타일 (CasBooksHomePage)
   ===================================================== */

/* 기본 리셋 */
.cas-books-page {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
    background: #fff;
}

/* 메인 컨텐츠 래퍼 */
.cas-books-main {        
}

/* 히어로 배너 */
.cas-books-hero {
    max-height: 260px;
    background-color: #F6CB3F;
    padding-top: 70px;
}

.cas-books-hero__inner {
    max-width: 1200px;
    text-align: left;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    vertical-align: top;
}

.cas-books-hero__text {
    margin-top: 60px;
    max-width: 480px;
    vertical-align: top;
    display: inline-block;
    text-align: left;
    margin-left: 10px;
}

.cas-books-hero__subtitle {
    display: block;
    margin-bottom: 20px;
    font-weight: bold;
    color: white;
}

.cas-books-hero__title {
    font-weight: bold;
    color: white;
    font-size: 28px;
    line-height: 1.4;
}

.cas-books-hero__image {
    display: inline-block;
}

.cas-books-hero__image img {
    max-width: 501px;
    width: 100%;
    padding-top: 17px;
    vertical-align: bottom;
    align-self: flex-start;
}

/* 섹션 공통 */
.cas-books-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.cas-books-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cas-books-section__title {
    font-size: 22px;
    font-weight: bold;
    color: var(--cas-dark);
}

.cas-books-section__subtitle {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.cas-books-section__more {
    color: var(--cas-dark);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 16px;
    border: 1px solid #333;
    border-radius: 6px;
    transition: all 0.2s;
    background: transparent;
}

.cas-books-section__more:hover {
    background: var(--cas-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 모바일용 하단 더보기 버튼 */
.cas-books-section__more-mobile {
    display: none;
    text-align: center;
    margin-top: 20px;
}

/* AI 스터디 배너 */
.cas-books-ai-banner {
    background-color: #4A4D58;
    border-radius: 12px;
    padding: 20px 40px;
    margin-top: 30px;
    margin-bottom: 0;
    cursor: pointer;
}

.cas-books-ai-banner__text {
    font-size: 16px;
    font-weight: 500;
    color: white;
    display: block;
}

.cas-books-ai-banner__link {
    color: #bebebe;
    font-size: 15px;
    font-weight: 400;
}

.cas-books-ai-banner + .cas-books-section__header {
    padding-top: 32px;
}

/* 캐스웹북 카테고리 그리드 */
.cas-books-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
    overflow: hidden;
}

.cas-books-category-anchor {
    display: inline-block;
    text-decoration: none;
}

.cas-books-category {
    width: 104px;
    height: 104px;
    border-radius: 14px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 7px 12px 7px 0;
}

.cas-books-category__title {
    padding: 10px 7px 0 7px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    word-break: break-word;
}

.cas-books-category__icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-self: flex-end;
    padding: 0 4px 4px 0;
}

.cas-books-category__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cas-books-category-short-title {
    display: none;
    max-width: 68px;
    font-size: 12px;
    text-align: center;
    word-break: break-all;
}

/* 업데이트 캐러셀 */
.cas-books-updates {
    position: relative;
}

.cas-books-updates__wrapper {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.cas-books-updates__wrapper::-webkit-scrollbar {
    display: none;
}

.cas-books-update-item {
    flex: 0 0 220px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cas-books-update-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* 오늘의 컨텐츠 호버 툴팁 */
.cas-books-update-item__content {
    position: relative;
}

.cas-books-update-item:hover .cas-books-update-item__content::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    white-space: normal;
    max-width: 280px;
    min-width: 200px;
    text-align: center;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease-out forwards;
    animation-delay: 0.3s;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.cas-books-update-item__image {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.cas-books-update-item__content {
    padding: 15px;
}

.cas-books-update-item__category {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.cas-books-update-item__title-kr {
    font-size: 14px;
    font-weight: 600;
    color: var(--cas-dark);
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cas-books-update-item__title-en {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cas-books-updates__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid var(--cas-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.cas-books-updates__nav:hover {
    background: var(--cas-light);
}

.cas-books-updates__nav--prev {
    left: -20px;
}

.cas-books-updates__nav--next {
    right: -20px;
}

/* 그리드 업데이트 (프리토킹/뉴스) */
.cas-books-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.cas-books-grid-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16/10;
}

.cas-books-grid-item__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.cas-books-grid-item:hover .cas-books-grid-item__image {
    transform: scale(1.05);
}

.cas-books-grid-item__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 30px 15px 15px;
}

.cas-books-grid-item__title-kr {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 3px;
}

.cas-books-grid-item__title-en {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* PDF 아카이브 */
.cas-books-pdf {
    background: var(--cas-light);
    padding: 40px 0;
}

.cas-books-pdf__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.cas-books-pdf__tab {
    padding: 10px 20px;
    background: white;
    border: 1px solid var(--cas-border);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.cas-books-pdf__tab:hover,
.cas-books-pdf__tab--active {
    background: var(--cas-dark);
    color: white;
    border-color: var(--cas-dark);
}

.cas-books-pdf__content {
    display: none;
}

.cas-books-pdf__content--active {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 20px;
}

.cas-books-pdf__item {
    cursor: pointer;
    transition: transform 0.2s;
}

.cas-books-pdf__item:hover {
    transform: translateY(-5px);
}

.cas-books-pdf__item img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 푸터 */
.cas-books-footer {
    background: #f5f5f5;
    padding: 20px;
    text-align: center;
}

.cas-books-footer__links {
    margin-bottom: 20px;
}

.cas-books-footer__links a {
    color: #666;
    text-decoration: none;
    font-size: 13px;    
}

.cas-books-footer__info p {
    font-size: 13px;
    color: #453737;
}
.cas-books-footer-innerholder {
    max-width: 1200px;
    text-align: left;
    display: inline-block;
    width: 100%;
}
/* 미리보기 모달 */
.cas-books-modal__mask {
    opacity: 0.4;
    height: 100%;
    width: 100%;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9999;
    background-color: #000;
    display: none;
}

.cas-books-modal__window {
    width: 100%;
    top: 80px;
    bottom: 0px;
    left: 0px;
    right: 0px;
    margin: 50px auto;
    position: fixed;
    padding: 0px;
    opacity: 0.9;
    display: none;
    text-align: left;
    background-color: #505050;
    max-width: 630px;
    height: auto;
    max-height: 660px;
    z-index: 99999;
    overflow-y: auto;
    border-radius: 12px;
}

.cas-books-modal__intro {
    display: block;
}

.cas-books-modal__header {
    display: flex;
}

.cas-books-modal__header-left {
    background-color: #545454;
    display: block;
    width: 88%;
    height: 50px;
}

.cas-books-modal__title {
    color: white;
    font-size: 22px;
    margin: 10px 0 5px 18px;
    text-transform: capitalize;
    display: block;
}

.cas-books-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    height: 50px;
    width: 12%;
    background-color: #545454;
    border: none;
}

.cas-books-modal__close img {
    margin-top: 0;
}

.cas-books-modal__preview {
    display: inline-block;
    margin-left: 13px;
}

.cas-books-modal__preview-image {
    max-height: 600px;
    height: auto;
    max-width: 100%;
}

.cas-books-modal__preview-right {
    display: inline-block;
    vertical-align: top;
}

.cas-books-modal__direction {
    display: inline-block;
    width: 170px;
    text-align: center;
}

.cas-books-modal__direction span {
    color: white;
    padding: 0px 5px 0px 5px;
    cursor: pointer;
}

.cas-books-modal__checkin {
    margin-top: 20px;
    text-align: center;
    width: 170px;
}

.cas-books-modal__checkin button {
    border: none;
    width: 150px;
    height: 50px;
    background-color: #cf2728;
    border-radius: 15px;
    cursor: pointer;
}

.cas-books-modal__checkin button p {
    font-size: 16px;
    line-height: 17px;
    font-weight: 600;
    color: white;
}

.cas-books-modal__caption {
    width: 150px;
    font-size: 13px;
    margin-top: 20px;
    padding: 10px;
    color: white;
}

/* =====================================================
   콘텐츠 페이지 스타일 (CasBooksContentPage)
   ===================================================== */

.cas-books-content-page {
    margin: 0;
    padding: 0;
    font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
}

.cas-books-content-page--list {
    background: #f2f3f3;
}

.cas-books-content-page--detail {
    background: #fff;
}

.cas-books-content-main {
    margin-top: calc(var(--cas-header-height));
    padding: 30px 20px 60px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* =====================================================
   홈페이지 반응형
   ===================================================== */

@media screen and (max-width: 1280px) {
    .cas-books-hero__inner {
        padding-left: 25px;
        padding-right: 25px;
    }
}

@media screen and (max-width: 1200px) {
    .cas-books-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 900px) {
    .cas-books-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 870px) {
    .cas-books-hero {
        max-height: unset;
    }
    .cas-books-hero__subtitle {
        font-weight: 400 !important;
    }
    .cas-books-hero__title {
        font-size: 20px !important;
    }
}

@media screen and (max-width: 840px) {
    .cas-books-hero__inner {
        display: block !important;
        text-align: center;
    }
    .cas-books-hero__text {
        text-align: center;
        margin-top: 0;
        padding-top: 30px;
    }
    .cas-books-hero__image img {
        max-width: 400px;
    }

    /* 카테고리 */
    .cas-books-categories {
        grid-template-columns: repeat(auto-fit, minmax(71px, 1fr));
    }
    .cas-books-category-short-title {
        display: block;
        text-align: center;
        word-break: break-all;
    }
    .cas-books-category {
        width: 59px;
        height: 62px;
        justify-content: center;
        margin: 4px;
    }
    .cas-books-category__title {
        display: none;
    }
    .cas-books-category__icon {
        padding: 0;
        align-self: center;
    }
}

@media screen and (max-width: 768px) {
    /* 섹션 */
    .cas-books-section__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .cas-books-section__more--desktop {
        display: none;
    }
    .cas-books-section__more-mobile {
        display: block;
    }
    .cas-books-section__more-mobile .cas-books-section__more {
        font-size: 16px;
        padding: 8px 16px;
        border-radius: 10px;
        background: #f8f9fa;
        border: 1px solid #c0c0c0;
        color: #000000;
        font-weight: 400;
    }
    .cas-books-section__more-mobile .cas-books-section__more:hover {
        background: #e9ecef;
        color: #212529;
        transform: none;
        box-shadow: none;
    }

    /* 업데이트 네비게이션 */
    .cas-books-updates__nav {
        display: none;
    }

    /* 콘텐츠 페이지 */
    .cas-books-content-main {
        padding: 20px 15px 40px;
    }
}

@media screen and (min-width: 769px) {
    .cas-books-section__more--desktop {
        display: inline-block;
    }
    .cas-books-section__more-mobile {
        display: none;
    }
}

@media screen and (max-width: 640px) {
    .cas-books-modal__preview {
        display: block;
        text-align: center;
        margin-left: 0;
    }
    .cas-books-modal__preview-right {
        margin: 0 auto;
        display: table;
    }
    .cas-books-modal__window {
        top: 25px;
        height: fit-content;
        max-height: 800px;
    }
    .cas-books-modal__close img {
        margin-left: 0;
    }
    .cas-books-modal__direction {
        margin-top: 15px;
    }
    .cas-books-modal__title {
        margin: 12px 0 5px 18px;
        font-size: 18px;
    }
    .cas-books-modal__preview-image {
        max-height: 400px;
    }
}

@media screen and (max-width: 480px) {
        .cas-books-content-main {
        padding: 5px 5px 10px;
    }
    .cas-books-hero__image img {
        max-width: 300px;
    }
    .cas-books-grid {
        grid-template-columns: 1fr;
    }

    /* 카테고리 */
    .cas-books-categories {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }
    .cas-books-category {
        width: 55px;
        height: 58px;
        background-color: #f6f6f6 !important;
    }
    .cas-books-category__icon {
        width: 35px;
        height: 35px;
    }
    .cas-books-category-anchor {
        margin-bottom: 10px;
    }
    .cas-books-category-short-title {
        max-width: 63px;
    }
    .cas-books-section {
        padding: 20px 18px;
    }
    .cas-books-ai-banner {
        padding: 15px 20px;
    }
    .cas-books-ai-banner__text {
        font-size: 14px;
    }
    .cas-books-ai-banner__link {
        font-size: 14px;
    }
}

/* ===== Fill in the Blanks Feature ===== */

/* 버튼 래퍼 */
.cas-books__fillblank-button-wrapper {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 버튼 기본 스타일 */
.cas-books__fillblank-practice-btn,
.cas-books__fillblank-clear-cache-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cas-books__fillblank-practice-btn {
    background-color: var(--cas-books-primary, #4a90d9);
    color: white;
}

.cas-books__fillblank-practice-btn:hover {
    background-color: #3a7bc8;
}

.cas-books__fillblank-practice-btn:disabled {
    background-color: #a0c4e8;
    cursor: not-allowed;
}

.cas-books__fillblank-clear-cache-btn {
    background-color: #6c757d;
    color: white;
}

.cas-books__fillblank-clear-cache-btn:hover {
    background-color: #5a6268;
}

/* 모달 마스크 */
.cas-books__fillblank-modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

/* 모달 */
.cas-books__fillblank-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 모달 헤더 */
.cas-books__fillblank-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background-color: var(--cas-books-primary, #4a90d9);
    color: white;
}

.cas-books__fillblank-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.cas-books__fillblank-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.cas-books__fillblank-modal-close:hover {
    opacity: 0.8;
}

/* 모달 콘텐츠 */
.cas-books__fillblank-modal-content {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

/* 빈칸 적용된 텍스트 영역 */
.cas-books__fillblank-text {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.8;
    font-size: 15px;
    margin-bottom: 25px;
    border-left: 4px solid var(--cas-books-primary, #4a90d9);
}

/* 빈칸 표시 */
.cas-books__fillblank-blank {
    display: inline-block;
    background-color: #ffe0b2;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    color: #e65100;
    margin: 0 2px;
}

/* 빈칸 입력 영역 */
.cas-books__fillblank-inputs {
    margin-top: 20px;
}

.cas-books__fillblank-inputs h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: var(--cas-books-dark, #333);
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

/* 인라인 빈칸 아이템 (구버전 방식) */
.cas-books__fillblank-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 2px 0;
    vertical-align: middle;
}

/* 인라인 입력 필드 */
.cas-books__fillblank-input {
    border: none;
    border-bottom: 2px solid #4CAF50;
    padding: 2px 8px;
    font-size: 16px;
    text-align: center;
    transition: border-color 0.3s;
    background: transparent;
    outline: none;
}

.cas-books__fillblank-input:focus {
    border-bottom-color: var(--cas-books-primary, #4a90d9);
}

.cas-books__fillblank-input--correct {
    border-bottom-color: #4caf50 !important;
    background-color: #e8f5e9;
}

.cas-books__fillblank-input--wrong {
    border-bottom-color: #f44336 !important;
    background-color: #ffebee;
}

/* 인라인 확인 버튼 */
.cas-books__fillblank-check-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: none;
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cas-books__fillblank-check-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 정답 보기 버튼 */
.cas-books__fillblank-show-answer-btn {
    background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
    border: none;
    color: white;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    line-height: 1;
}

.cas-books__fillblank-show-answer-btn:hover {
    background: linear-gradient(135deg, #757575 0%, #616161 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 점진적 글자 힌트 텍스트 */
.cas-books__fillblank-letter-hint {
    display: inline-block;
    margin-left: 3px;
    color: #e65100;
    font-size: 14px;
    font-weight: 600;
    font-family: monospace;
    background-color: #fff3e0;
    padding: 2px 6px;
    border-radius: 4px;
}

/* 한국어 뜻 */
.cas-books__fillblank-meaning {
    display: inline-block;
    margin-left: 5px;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* 정답/오답 결과 표시 */
.cas-books__fillblank-result {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

.cas-books__fillblank-result--correct {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.cas-books__fillblank-result--wrong {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

.cas-books__fillblank-result--wrong strong {
    color: #1565c0;
    font-weight: 700;
}

.cas-books__fillblank-result--retry {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ff9800;
}

.cas-books__fillblank-result--revealed {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #2196f3;
}

.cas-books__fillblank-result--revealed strong {
    color: #0d47a1;
    font-weight: 700;
}

/* 정답 공개 상태 입력 필드 */
.cas-books__fillblank-input--revealed {
    border-bottom-color: #2196f3 !important;
    background-color: #e3f2fd;
    color: #1565c0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 출처 */
.cas-books__fillblank-source {
    margin-top: 20px;
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
}

/* 하단 버튼 영역 */
.cas-books__fillblank-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.cas-books__fillblank-check-all-btn,
.cas-books__fillblank-show-all-btn,
.cas-books__fillblank-reset-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cas-books__fillblank-check-all-btn {
    background-color: var(--cas-books-primary, #4a90d9);
    color: white;
}

.cas-books__fillblank-check-all-btn:hover {
    background-color: #3a7bc8;
}

.cas-books__fillblank-show-all-btn {
    background-color: #ff9800;
    color: white;
}

.cas-books__fillblank-show-all-btn:hover {
    background-color: #f57c00;
}

.cas-books__fillblank-reset-btn {
    background-color: #6c757d;
    color: white;
}

.cas-books__fillblank-reset-btn:hover {
    background-color: #5a6268;
}

/* 모바일 반응형 */
@media (max-width: 600px) {
    .cas-books__fillblank-modal {
        width: 95%;
        max-height: 95vh;
    }

    .cas-books__fillblank-modal-header {
        padding: 15px 20px;
    }

    .cas-books__fillblank-modal-content {
        padding: 15px;
    }

    .cas-books__fillblank-item {
        display: inline-flex;
        flex-wrap: wrap;
        gap: 3px;
        margin: 2px 0;
    }

    .cas-books__fillblank-input {
        font-size: 14px;
        padding: 3px 5px;
    }

    .cas-books__fillblank-check-btn {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }

    .cas-books__fillblank-show-answer-btn {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .cas-books__fillblank-letter-hint {
        font-size: 12px;
        padding: 1px 4px;
    }

    .cas-books__fillblank-meaning {
        font-size: 12px;
    }

    .cas-books__fillblank-result {
        font-size: 11px;
        padding: 1px 6px;
        margin-left: 5px;
    }

    .cas-books__fillblank-footer {
        flex-direction: column;
    }

    .cas-books__fillblank-check-all-btn,
    .cas-books__fillblank-show-all-btn,
    .cas-books__fillblank-reset-btn {
        width: 100%;
    }

    .cas-books__fillblank-practice-btn,
    .cas-books__fillblank-clear-cache-btn {
        flex: 1;
    }
}

/* ===== AI Study Tutorial (구버전과 동일) ===== */
.cas-books__tutorial-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999995;
    display: none;
}

.cas-books__tutorial-bubble {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #c97271;
    border: 2px solid #c97271;
    border-radius: 12px;
    padding: 10px;
    z-index: 999996;
    width: 140px;
    text-align: center;
    cursor: pointer;
    text-align: left;
}

.cas-books__tutorial-bubble span {
    color: white;
    font-size: 14px;
    line-height: 20px;
}

.cas-books__tutorial-bubble::before,
.cas-books__tutorial-bubble::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    z-index: 1;
}

.cas-books__tutorial-bubble::before {
    border-top: 10px solid #c97271;
}

.cas-books__tutorial-bubble::after {
    border-top: 10px solid #c97271;
    margin-top: -1.5px;
    z-index: 2;
}

/* 아래로 화살표 버블 */
.cas-books__tutorial-bubble--down {
    bottom: unset;
    top: 100%;
}

.cas-books__tutorial-bubble--down::before,
.cas-books__tutorial-bubble--down::after {
    bottom: 100%;
    top: unset;
    border-top: unset;
}

.cas-books__tutorial-bubble--down::before {
    border-bottom: 10px solid #c97271;
}

.cas-books__tutorial-bubble--down::after {
    border-bottom: 10px solid #c97271;
    margin-bottom: -1.5px;
    margin-top: unset;
}

/* 버블 3: 입력 영역 아래 (cas-books__dl-original-content 아래) */
.cas-books__tutorial-bubble--three {
    bottom: unset;
    top: 10%;
    margin-top: 10px;
}

/* 튜토리얼 활성화된 요소 */
.cas-books__tutorial-active {
    position: relative;
    z-index: 999996 !important;
}

/* =====================================================
   나의 글 팝업 (구버전 books_games.css와 동일)
   ===================================================== */

.cas-books__mywriting-wrapper {
    display: none;
}

.cas-books__mywriting-background {
    background-color: grey;
    z-index: 99999;
    opacity: 0.5;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
}

.cas-books__mywriting-popup {
    box-sizing: border-box;
    width: 85%;
    height: 85%;
    max-width: 1024px;
    background-color: white;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999999;
    border-radius: 10px;
    overflow: hidden;
}

.cas-books__mywriting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    background-color: #fafafa;
    border-radius: 10px 10px 0 0;
}

.cas-books__mywriting-header-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.cas-books__mywriting-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cas-books__mywriting-header-actions a {
    display: flex;
    align-items: center;
}

.cas-books__mywriting-content {
    width: 100%;
    height: calc(100% - 120px);
    overflow-y: auto;
    background-color: #f5f5f5;
}

.cas-books__mywriting-close {
    position: absolute;
    top: 10px;
    right: 22px;
    cursor: pointer;
    z-index: 9999;
}

.cas-books__mywriting-close img {
    width: 22px;
}

.cas-books__mywriting-download {
    margin-right: 10px;
}

.cas-books__mywriting-close-btn {
    cursor: pointer;
}

.cas-books__mywriting-list {
    padding: 24px;
}

/* 나의 글 아이템 스타일 (구버전 cas-my-comment-* 와 동일) */
.cas-books__mywriting-item {
    background-color: #ffffff;
    margin-bottom: 5px;
    padding: 15px;
}

.cas-books__mywriting-date {
    display: inline-block;
}

.cas-books__mywriting-date span {
    font-size: 13px;
    color: #858585;
}

.cas-books__mywriting-table {
    display: block;
}

.cas-books__mywriting-tbody {
    background-color: #e9e9e9;
    display: block;
    padding-top: 44px;
}

.cas-books__mywriting-row {
    grid-template-columns: 1fr 1fr;
    margin: 10px 0;
    display: inline-grid;
    vertical-align: middle;
    width: 100%;
}

.cas-books__mywriting-row-single {
    grid-template-columns: 1fr;
    margin: 10px 0;
    display: block;
    vertical-align: middle;
    width: 100%;
}

.cas-books__mywriting-cell {
    padding: 7px 10px;
    margin: 0 0 8px 0;
    border-radius: 7px;
}

.cas-books__mywriting-row-single .cas-books__mywriting-cell {
    border: none;
    line-height: 24px;
    font-weight: 600;
    overflow: hidden;
    font-size: 15px;
    padding-left: 0;
}

.cas-books__mywriting-row-single a {
    vertical-align: super;
}

/* 나의 글 헤딩 row */
.cas-books__mywriting-row--heading {
    border: none;
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 0;
}

.cas-books__mywriting-cell--heading {
    height: 19px;
    overflow: hidden;
    padding: 0;
    border: 0;
    display: block;
}

.cas-books__mywriting-cell--heading span {
    color: #e0626f;
}

/* 나의 글 모바일 헤딩 */
.cas-books__mywriting-cell-mobile-heading {
    margin-bottom: 5px;
    display: none;
}

.cas-books__mywriting-cell-mobile-heading span {
    font-size: 14px;
    color: #e0626f;
    margin-bottom: 5px;
}

/* 나의 글 단어 카운트 */
.cas-books__mywriting-counts {
    padding: 10px 15px;
    background-color: #fff;
}

.cas-books__mywriting-counts span {
    font-size: 14px;
    color: #666;
}

/* 나의 글 아이템 */
.cas-books__mywriting-item {
    background-color: #ffffff;
    margin-bottom: 5px;
    padding: 15px;
}

/* 나의 글 날짜 */
.cas-books__mywriting-date {
    display: inline-block;
}

.cas-books__mywriting-date span {
    font-size: 13px;
    color: #858585;
}

/* 나의 글 빈 상태 */
.cas-books__mywriting-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 15px;
}

/* 나의 글 AI 교정 설명 */
.cas-books__mywriting-explanations {
    margin-top: 10px;
    padding: 8px;
    border: 1px solid #ee959f;
    border-radius: 5px;
    background-color: #fff9f9;
}

.cas-books__mywriting-explanation-item {
    margin-bottom: 8px;
}

.cas-books__mywriting-explanation-item:last-child {
    margin-bottom: 0;
}

.cas-books__mywriting-original {
    color: #d9534f;
    text-decoration: line-through;
}

.cas-books__mywriting-revised {
    color: #5cb85c;
    font-weight: 600;
}

/* 나의 글 페이지네이션 */
.cas-books__mywriting-pagination {
    padding: 16px 20px;
    text-align: center;
    background-color: #fff;
    border-top: 1px solid #eee;
    border-radius: 0 0 10px 10px;
}

.cas-books__mywriting-pages {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 6px;
}

.cas-books__mywriting-pages li {
    display: inline-block;
}

.cas-books__mywriting-pages li a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #555;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.cas-books__mywriting-pages li a:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.cas-books__mywriting-page-number--active a {
    background-color: var(--cas-primary, #4a90d9) !important;
    color: white !important;
    border-color: var(--cas-primary, #4a90d9) !important;
}

.cas-books__mywriting-prev a,
.cas-books__mywriting-next a {
    font-weight: bold;
}

/* 나의 글 삭제 버튼 */
.cas-books__mywriting-delete {
    display: inline-block;
    vertical-align: middle;
    margin-left: 7px;
    cursor: pointer;
}

/* 나의 글 AI 아이콘 */
.cas-books__mywriting-ai-icon {
    width: 18px;
    margin-right: 3px;
}

@media screen and (max-width: 768px) {
    .cas-books__mywriting-popup {
        width: 92%;
        height: 90%;
    }

    .cas-books__mywriting-row {
        grid-template-columns: 1fr;
    }

    .cas-books__mywriting-row--heading {
        display: none;
    }

    .cas-books__mywriting-cell-mobile-heading {
        display: block;
    }

    .cas-books__mywriting-cell {
        padding: 7px 10px;
        margin: 0 0 8px 0;
        border-radius: 7px;
    }

    .cas-books__mywriting-row-single .cas-books__mywriting-cell {
        line-height: 24px;
        margin: 0;
    }
}

/* =====================================================
   나의 글 - 서버에서 반환되는 HTML 클래스 스타일
   (구버전 cas-my-comment-* 클래스 지원)
   ===================================================== */

.cas-my-comment-wrapper {
    background-color: #ffffff;
    margin-bottom: 5px;
    padding: 15px;
}

.cas-my-comment-date {
    display: inline-block;
}

.cas-my-comment-date span {
    font-size: 13px;
    color: #858585;
}

.cas-my-comment-table {
    display: block;
}

.cas-my-comment-tbody {
    background-color: #e9e9e9;
    display: block;
    
}

.cas-my-comment-tr-single {
    grid-template-columns: 1fr;
    margin: 10px 0;
    display: block;
    width: 100%;
}
.cas-my-comment-tr-single a {
    vertical-align:super;
}

.cas-my-comment-tr-single .cas-my-comment-td {
    border: none;
    line-height: 24px;
    font-weight: 600;
    overflow: hidden;
    font-size: 15px;
    padding-left: 0;
}

.cas-my-comment-tr {
    grid-template-columns: 1fr 1fr;
    margin: 10px 0;
    display: inline-grid;
    width: 100%;
}

.cas-my-comment-tr--heading {
    border: none;
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 0;
}

.cas-my-comment-td {
    display: inline-block;
    padding: 9px;
    border: 1px solid #d0d0d0;
    margin: 0 10px 0 10px;
    font-size: 14px;
    overflow: auto;
    border-radius: 7px;
}

.cas-my-comment-td img {
    display: inline-block;
}

.cas-my-comment-td-mobile-heading {
    margin-bottom: 5px;
    display: none;
}

.cas-my-comment-td-mobile-heading span {
    font-size: 14px;
    color: #e0626f;
    margin-bottom: 5px;
}

.cas-my-comment-td--heading {
    height: 19px;
    overflow: hidden;
    padding: 0;
    border: 0;
    display: block;
}

.cas-my-comment-td--heading span {
    color: #e0626f;
}

.cas-my-comment-td span {
    font-size: 14px;
    font-weight: 300;
}

.cas-my-comment-th {
    display: inline-block;
    padding: 15px;
    border: 1px solid #ededed;
    margin: 0 10px 0 10px;
    height: 20px;
}

.cas-my-comment-list-ai {
    width: 18px;
    margin-right: 3px;
}

.cas-my-comment-delete {
    display: inline-block;
    margin-left: 7px;
    cursor: pointer;
}

.cas-my-comment-explanations {
    margin-top: 10px;
    padding: 8px;
    border: 1px solid #ee959f;
}

.cas-my-content-counts {
    padding: 10px 15px;
    background-color: #fff;    
}

.cas-my-content-counts span {
    font-size: 14px;
    color: #666;
}

/* 나의 글 모바일 반응형 */
@media screen and (max-width: 768px) {
    .cas-my-comment-td {
        padding: 7px 10px;
        margin: 0 0 8px 0;
        border-radius: 7px;
    }

    .cas-my-comment-tr-single .cas-my-comment-td {
        line-height: 24px;
        margin: 0;
    }

    .cas-my-comment-tr {
        grid-template-columns: 1fr;
    }

    .cas-my-comment-tr--heading {
        display: none;
    }

    .cas-my-comment-td-mobile-heading {
        display: block;
    }
}

/* =====================================================
   나의 글 - 신규 카드형 디자인
   (cas-books__my-writing-* 클래스 - PHP에서 생성)
   ===================================================== */

/* 빈 상태 메시지 */
.cas-books__my-writing-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 15px;
}

/* 개별 작문 카드 아이템 */
.cas-books__my-writing-item {
    background-color: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cas-books__my-writing-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.cas-books__my-writing-item:last-child {
    margin-bottom: 0;
}

/* 제목 스타일 */
.cas-books__my-writing-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 내용 미리보기 */
.cas-books__my-writing-item-content {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 날짜 표시 */
.cas-books__my-writing-item-date {
    font-size: 13px;
    color: #999;
    display: flex;
    align-items: center;
}

.cas-books__my-writing-item-date::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    background-color: #ccc;
    border-radius: 50%;
    margin-right: 8px;
}

/* 나의 글 모바일 반응형 (신규 카드 스타일) */
@media screen and (max-width: 768px) {
    .cas-books__my-writing-item {
        padding: 16px;
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .cas-books__my-writing-item-title {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .cas-books__my-writing-item-content {
        font-size: 13px;
        margin-bottom: 10px;
        -webkit-line-clamp: 2;
    }

    .cas-books__my-writing-item-date {
        font-size: 12px;
    }

    .cas-books__mywriting-list {
        padding: 16px;
    }

    .cas-books__mywriting-pages li a {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

/* ===== Sticky Sidebar (카카오톡 상담) ===== */
/* 구버전: csbasic/style.css */
.sticky-sidebar {
    border-radius: 10px;
    width: 130px;
    right: 9px;
    bottom: 90px;
    position: fixed;
    z-index: 999999;
    color: white;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.sticky-sidebar__text {
    color: black;
    font-size: 15px;
    right: 7px;
    bottom: 5px;
    position: absolute;
    cursor: pointer;
}

.sticky-sidebar__icon {
    position: absolute;
    top: 0px;
    left: 59px;
    cursor: pointer;
}

.sticky-sidebar__icon img {
    width: 60px;
}

.sticky-sidebar__menu {
    cursor: pointer;
}

/* Sticky Sidebar 반응형 */
@media screen and (max-width: 1180px) {
    .sticky-sidebar__icon {
        top: -48px;
    }
}

@media screen and (max-width: 665px) {
    .sticky-sidebar__icon {
        left: 82px;
        top: -20px;
    }
    .sticky-sidebar__icon img {
        width: 45px;
        opacity: 1;
    }
}

@media screen and (max-width: 480px) {
    .sticky-sidebar {
        bottom: 110px;
        opacity: 0.8;
    }
    .sticky-sidebar__icon {
        left: 82px;
        top: 0px;
    }
    .sticky-sidebar__icon img {
        width: 45px;
        opacity: 1;
    }
}

/* ===== Quiz Styles (printBookTypeListWithNumberWithSublistWithAlphabet) ===== */
.cas-books__quiz-wrapper {
    padding: 20px 0;
}

.cas-books__quiz-item {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}


.cas-books__quiz-question {
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
}

.cas-books__quiz-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--cas-books-primary) 0%, var(--cas-books-secondary) 100%);
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.cas-books__quiz-options {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cas-books__quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    text-align: left;
    font-size: 15px;
    color: #444;
    line-height: 1.5;
}

.cas-books__quiz-alphabet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.cas-books__quiz-option-text {
    flex: 1;
    padding-top: 4px;
}

/* Quiz Mobile Responsive */
@media (max-width: 768px) {
    .cas-books__quiz-item {
        padding: 18px;
        border-radius: 12px;
    }

    .cas-books__quiz-question {
        font-size: 15px;
        margin-bottom: 14px;
        padding-bottom: 12px;
    }

    .cas-books__quiz-num {
        min-width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .cas-books__quiz-option {
        padding: 12px 14px;
        font-size: 14px;
        gap: 10px;
    }

    .cas-books__quiz-alphabet {
        min-width: 28px;
        height: 28px;
        font-size: 13px;
    }
}

/* ===== Random Question Page ===== */
.cas-books__random-wrapper {
    max-width: var(--cas-books-content-width);
    margin: 0 auto;
    padding: 40px 20px;
}

.cas-books__random-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.cas-books__random-banner-title {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.cas-books__random-banner-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    font-weight: 400;
    margin: 0;
}

.cas-books__random-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    min-height: 200px;
}

.cas-books__random-loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 16px;
}

.cas-books__random-loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: cas-books-random-spin 1s linear infinite;
}

@keyframes cas-books-random-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cas-books__random-loading-text {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.cas-books__random-question-box {
    transition: opacity 0.3s ease;
}

.cas-books__random-question-box--loading {
    opacity: 0.3;
}

.cas-books__random-question {
    font-size: 22px;
    line-height: 1.6;
    color: #333;
    text-align: center;
    padding: 30px 20px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cas-books__random-btn-wrapper {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.cas-books__random-btn {
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid #667eea;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    color: #667eea;
}

.cas-books__random-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.cas-books__random-btn--active {
    background: #667eea;
    color: white;
}

/* Random Question Mobile Responsive */
@media (max-width: 768px) {
    .cas-books__random-wrapper {
        padding: 20px 15px;
    }

    .cas-books__random-banner {
        padding: 30px 20px;
        border-radius: 12px;
    }

    .cas-books__random-banner-title {
        font-size: 24px;
    }

    .cas-books__random-banner-subtitle {
        font-size: 16px;
    }

    .cas-books__random-content {
        padding: 25px 20px;
        border-radius: 12px;
    }

    .cas-books__random-question {
        font-size: 18px;
        padding: 20px 10px;
    }

    .cas-books__random-btn-wrapper {
        flex-direction: column;
        gap: 12px;
    }

    .cas-books__random-btn {
        width: 100%;
        padding: 14px 30px;
    }
}
