* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 30px;
}

/* Header */
.header {
    background: white;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
}

.logo-image {
    height: 80px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

.auth-links {
    display: flex;
    gap: 20px;
    position: absolute;
    right: 0;
}

.auth-links a {
    color: #888;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    padding: 5px 10px;
    border-radius: 5px;
}

.auth-links a:hover {
    color: #cd0e00;
    background: #f8f9fa;
}

/* 햄버거 메뉴 버튼 */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    position: absolute;
    right: 0;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Navigation */
.nav {
    background: transparent;
    padding: 15px 0;
}

.nav .container {
    background: #f5f5f5;
    border-radius: 50px;
    padding: 0 30px;
    max-width: 1440px;
}

.nav .close-btn {
    display: none;
}

.nav-menu {
    display: flex;
    justify-content: center;
    gap: 60px;
    list-style: none;
    padding: 15px 0;
}

.nav-item {
    position: relative;
}

.nav-menu a {
    color: #111;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    padding: 10px 15px;
    border-radius: 25px;
    position: relative;
    display: block;
}

.nav-menu > .nav-item > a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* 서브메뉴 스타일 */
.sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 8px;
    padding: 8px 0;
    min-width: 140px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
    margin-top: 5px;
    border: 1px solid #e9ecef;
}

.nav-item:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.sub-menu li {
    margin: 0;
}

.sub-menu a {
    color: #555 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    padding: 10px 16px !important;
    border-radius: 0 !important;
    transition: all 0.2s ease !important;
    display: block;
    border-bottom: 1px solid #f1f3f4;
}

.sub-menu li:last-child a {
    border-bottom: none;
}

.sub-menu a:hover {
    background: #f8f9fa !important;
    color: #333 !important;
    transform: none !important;
}

/* 서브페이지 전용 스타일 */
.sub-banner {
    height: 240px;
    background-image: url('./image/sub-topbanner.png');
    background-color: #111;
    border-radius: 40px;
    margin: 20px 0 70px;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sub-banner-content {
    text-align: center;
    color: white;
    position: relative;
    z-index: 2;
}

.sub-banner-title {
    padding-top: 50px;
    font-size: 48px;
    font-weight: bold;
    margin: 0;
    color: white;
    letter-spacing: -0.5px;
    text-shadow: 0 0px 8px rgba(0, 0, 0, 0.382);
}

/* 탭 메뉴를 배너 안으로 이동 */
.sub-banner .tab-menu {
    top: 23%;
    display: flex;
    background: white;
    border-radius: 40px;
    padding: 0;
    margin: 0;
    width: 500px;
    height: 60px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0px 8px rgba(0, 0, 0, 0.123);
}

.sub-banner .tab-item {
    flex: 1;
    text-align: center;
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 40px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.sub-banner .tab-item.active {
    background: #d63031;
    color: white;
    transform: none;
}

.sub-banner .tab-item:not(.active) {
    background: transparent;
    color: #666;
}

.sub-banner .tab-item:not(.active):hover {
    color: #333;
}

/* 교재 소개 콘텐츠 스타일 */
.textbook-content {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 30px;
}

/* 교재 그리드 - 반응형 개선 */
.textbook-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-bottom: 80px;
}

/* 교재 카드 - 반응형 개선 */
.textbook-card {
    background: white;
    border: 1px solid #c3c3c3;
    border-radius: 20px;
    padding: 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.textbook-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 10px rgba(0, 0, 0, 0.077);
}

/* 교재 이미지 - 반응형 개선 */
.textbook-image {
    width: 190px;
    height: 270px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.textbook-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.textbook-card:hover .textbook-image img {
    transform: scale(1.05);
}

.textbook-image.no-image {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    color: #999;
    font-size: 16px;
    font-weight: 500;
}

/* 교재 정보 - 반응형 개선 */
.textbook-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 270px;
}

.textbook-info-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 200px;
}

.textbook-title {
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #000000;
    line-height: 1.3;
}

.textbook-description {
    font-size: 17px;
    line-height: 1.4;
    color: #333;
    margin-bottom: 14px;
}

.textbook-features {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.textbook-features li {
    font-size: 14px;
    color: #888;
    margin-bottom: 0px;
    position: relative;
    padding-left: 10px;
}

.textbook-features li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: #d63031;
}

.textbook-button {
    border: 1px solid #d63031;
    color: #d63031;
    padding: 6px 30px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    width: fit-content;
    text-align: center;
}

.textbook-button:hover {
    background: #d63031;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(214, 48, 49, 0.3);
}

/* 섹션 제목 */
.section-title {
    text-align: center;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.section-subtitle {
    text-align: center;
    font-size: 18px;
    color: #666;
    margin-bottom: 60px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 탭 콘텐츠 섹션 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Footer */
.footer {
    background: #4a4a4a;
    color: #999;
    padding: 30px 0 40px;
    margin-top: 80px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #666;
}

.footer-left {
    flex: 1;
}

.footer-nav {
    display: flex;
    gap: 40px;
    align-items: center;
}

.footer-nav-link {
    color: #ccc;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    transition: color 0.3s ease;
}

.footer-nav-link:hover {
    color: white;
}

.footer-right {
    flex-shrink: 0;
}

.footer-social {
    display: flex;
    gap: 15px;
    align-items: center;
}

.footer-social-link {
    width: 32px;
    height: 32px;
    display: block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

.footer-social-link:hover {
    opacity: 0.7;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.footer-info {
    color: #999;
    font-size: 14px;
    line-height: 1.6;
}

.footer-info-row {
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.footer-info-row span {
    white-space: nowrap;
}

.divider {
    color: #666;
    margin: 0 4px;
}

.footer-copyright {
    margin-top: 15px;
    color: #777;
    font-size: 13px;
}

/* 반응형 디자인 - 카드형 디자인 유지 */
@media (max-width: 1200px) {
    .textbook-content {
        padding: 0 20px;
    }

    .textbook-grid {
        gap: 30px;
    }

    .textbook-card {
        padding: 25px;
        gap: 25px;
    }

    .textbook-image {
        width: 160px;
        height: 230px;
    }

    .textbook-info {
        height: 230px;
    }

    .textbook-title {
        font-size: 22px;
    }

    .textbook-description {
        font-size: 16px;
    }
}

@media (max-width: 1024px) {
    .textbook-grid {
        gap: 25px;
    }

    .textbook-card {
        padding: 20px;
        gap: 20px;
    }

    .textbook-image {
        width: 140px;
        height: 200px;
    }

    .textbook-info {
        height: 200px;
    }

    .textbook-title {
        font-size: 20px;
    }

    .textbook-description {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .textbook-features li {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .textbook-content {
        padding: 0 15px;
    }

    /* Header 모바일 */
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        flex: 0;
        margin-right: auto;
    }

    .logo-image {
        height: 60px;
    }

    .auth-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    /* Navigation 모바일 */
    .nav {
        position: fixed;
        top: 0;
        right: -350px;
        width: 350px;
        height: 100vh;
        background: white;
        z-index: 1000;
        transition: right 0.3s ease;
        padding: 0;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }

    .nav.active {
        right: 0;
    }

    .nav .container {
        background: white;
        border-radius: 0;
        padding: 80px 20px 20px;
        width: 100%;
        height: 100vh;
        margin: 0;
        position: relative;
        box-shadow: none;
    }

    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        padding: 0;
        align-items: stretch;
    }

    .nav-item {
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-menu > .nav-item > a {
        padding: 20px 0;
        font-size: 18px;
        color: #333;
        border-radius: 0;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
    }

    .nav-menu > .nav-item > a:hover {
        background: #f8f9fa;
        transform: none;
    }

    .nav-item.has-submenu > a::after {
        content: '▶';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        font-size: 12px;
        transition: transform 0.3s ease;
    }

    .nav-item.has-submenu.active > a::after {
        transform: translateY(-50%) rotate(90deg);
    }

    .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: #f8f9fa;
        box-shadow: none;
        border: none;
        border-radius: 0;
        margin-top: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-item.active .sub-menu {
        max-height: 200px;
    }

    .sub-menu a {
        padding: 15px 20px !important;
        font-size: 16px !important;
        color: #666 !important;
        border-bottom: 1px solid #e0e0e0 !important;
        margin-left: 20px !important;
    }

    .sub-menu a:hover {
        background: #f0f0f0 !important;
        color: #333 !important;
    }

    .nav .close-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        font-size: 24px;
        color: #333;
        cursor: pointer;
        padding: 10px;
        display: block;
    }

    /* 서브배너 모바일 */
    .sub-banner {
        height: 200px;
        border-radius: 20px;
        margin: 15px 0 40px;
    }

    .sub-banner-title {
        font-size: 28px;
        padding-top: 30px;
    }

    .sub-banner .tab-menu {
        width: 350px;
        height: 50px;
    }

    .sub-banner .tab-item {
        font-size: 14px;
    }

    /* 교재 그리드 모바일 - 카드형 유지하며 1열로 변경 */
    .textbook-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .textbook-card {
        padding: 20px;
        gap: 20px;
        /* 가로 레이아웃 유지 */
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }

    .textbook-image {
        width: 120px;
        height: 160px;
        flex-shrink: 0;
    }

    .textbook-info {
        height: auto;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 160px;
    }

    .textbook-info-text {
        flex: 1;
        margin-bottom: 15px;
    }

    .textbook-title {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .textbook-description {
        font-size: 14px;
        margin-bottom: 8px;
        line-height: 1.4;
    }

    .textbook-features {
        margin-bottom: 15px;
    }

    .textbook-features li {
        font-size: 12px;
        margin-bottom: 1px;
    }

    .textbook-button {
        padding: 12px 24px;
        font-size: 14px;
        width: fit-content;
        margin-top: auto;
        background: #d63031;
        color: white;
        border: 1px solid #d63031;
        font-weight: 600;
    }

    .textbook-button:hover {
        background: #b71c1c;
        color: white;
        border-color: #b71c1c;
    }

    .section-title {
        font-size: 28px;
    }

    .section-subtitle {
        font-size: 16px;
        margin-bottom: 40px;
    }

    /* Footer 모바일 */
    .footer {
        padding: 40px 0 30px;
        margin-top: 60px;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    .footer-nav {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }

    .footer-nav-link {
        font-size: 14px;
    }

    .footer-social {
        gap: 12px;
    }

    .footer-social-link {
        width: 28px;
        height: 28px;
    }

    .footer-info {
        font-size: 12px;
        text-align: center;
    }

    .footer-info-row {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .divider {
        display: none;
    }
}

/* 더 작은 모바일 화면 (480px 이하) - 카드형 유지 */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .textbook-content {
        padding: 0 10px;
    }

    .textbook-card {
        padding: 15px;
        gap: 15px;
    }

    .textbook-image {
        width: 100px;
        height: 140px;
    }

    .textbook-info {
        height: auto;
        min-height: 140px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .textbook-title {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .textbook-description {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .textbook-features li {
        font-size: 11px;
    }

    .textbook-button {
        padding: 10px 20px;
        font-size: 13px;
        margin-top: auto;
        background: #d63031;
        color: white;
        border: 1px solid #d63031;
        font-weight: 600;
    }

    .textbook-button:hover {
        background: #b71c1c;
        color: white;
        border-color: #b71c1c;
    }

    .sub-banner .tab-menu {
        width: 300px;
        height: 45px;
    }

    .sub-banner .tab-item {
        font-size: 13px;
    }

    .section-title {
        font-size: 24px;
    }

    .section-subtitle {
        font-size: 14px;
    }
}

/* 로딩 애니메이션 */
.loading {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* 스크롤 애니메이션 */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}