body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem;
    margin-top: 2rem;
}

.library-header {
    background: linear-gradient(90deg, #4a90e2, #5cb85c);
    color: white;
    padding: 3rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 3rem;
}

.library-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1), transparent 30%);
    transform: rotate(0deg);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.library-header h1 {
    margin: 0;
    font-size: 3rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.search-container {
    margin-bottom: 1rem;
    text-align: center;
}

#search-box {
    width: 50%;
    max-width: 400px;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    border-radius: 50px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

#search-box:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.library-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.bookshelf {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #8B4513 100%);
    border: 3px solid #654321;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
    height: fit-content;
}

.bookshelf::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(90deg, #654321, #8B4513, #654321);
    border-radius: 5px;
}

.bookshelf h2 {
    color: #FFD700;
    font-size: 1.5rem;
    margin: 0 0 20px 0;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    font-weight: bold;
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

.episodes-list::-webkit-scrollbar {
    width: 8px;
}

.episodes-list::-webkit-scrollbar-track {
    background: #8B4513;
    border-radius: 4px;
}

.episodes-list::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 4px;
}

.episodes-list::-webkit-scrollbar-thumb:hover {
    background: #FFA500;
}

.episode-card {
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 50%, #8B0000 100%);
    border: 2px solid #654321;
    border-radius: 5px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.episode-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

.episode-card.active {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
    color: #8B0000;
}

.episode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
}

.episode-number {
    color: #FFD700;
    font-size: 0.8rem;
    margin: 0 0 5px 0;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.episode-card h3 {
    color: #FFD700;
    font-size: 0.9rem;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    font-weight: bold;
}

.episode-card.active .episode-number,
.episode-card.active h3 {
    color: #8B0000;
    text-shadow: none;
}

.content-panel {
    background: linear-gradient(135deg, #F5F5DC 0%, #FDF5E6 50%, #F5F5DC 100%);
    border: 3px solid #8B4513;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 
        0 8px 25px rgba(0,0,0,0.15),
        inset 0 2px 8px rgba(255,255,255,0.3);
    min-height: 200px;
    position: relative;
}

.content-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
    border-radius: 12px 12px 0 0;
}

.content-panel h2 {
    color: #4a90e2;
    font-size: 2rem;
    margin: 0 0 1rem 0;
    font-weight: 600;
    text-align: center;
}

.title-image {
    display: block;
    margin: 0 auto 1rem auto;
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.content-panel h3 {
    color: #333;
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem 0;
    font-weight: 600;
}

.content-text {
    color: #333;
    font-size: 1rem;
    line-height: 1.8;
    white-space: pre-line;
    font-family: 'Times New Roman', serif;
    height: 450px;
    position: relative;
    display: flex;
    background: linear-gradient(135deg, #F8F8FF 0%, #F0F8FF 50%, #F8F8FF 100%);
    border: 2px solid #8B4513;
    border-radius: 8px;
    box-shadow: 
        0 6px 20px rgba(0,0,0,0.12),
        inset 0 1px 6px rgba(255,255,255,0.4);
    overflow: hidden;
}

.left-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    width: 250px;
    border-right: 4px solid #8B4513;
    background: linear-gradient(135deg, #F5F5DC 0%, #FDF5E6 50%, #F5F5DC 100%);
    position: relative;
    height: 100%;
}

.left-column::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #FFD700, #8B4513, #FFD700);
    border-radius: 0 8px 8px 0;
}

.right-column {
    position: relative;
    flex: 1;
    background: linear-gradient(135deg, #F8F8FF 0%, #F0F8FF 50%, #F8F8FF 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.episode-title {
    color: #4a90e2;
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
    text-align: center;
    padding: 0.5rem;
    background: linear-gradient(135deg, #F5F5DC 0%, #FDF5E6 50%, #F5F5DC 100%);
    border-bottom: 3px solid #8B4513;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.page-container {
    position: relative;
    flex: 1;
    background: transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-navigation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    z-index: 10;
    padding: 0 1rem;
    transform: translateY(-10px);
}

.nav-button {
    background: none;
    color: #4a90e2;
    border: none;
    width: 60px;
    height: 60px;
    cursor: pointer;
    font-size: 3rem;
    font-weight: bold;
    transition: all 0.3s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin: 0 0.5rem;
    padding: 0;
}

.nav-button:hover {
    color: #2c5aa0;
    transform: scale(1.2);
    text-shadow: 3px 3px 6px rgba(0,0,0,0.4);
}

.nav-button:disabled {
    color: #ccc;
    cursor: not-allowed;
    transform: none;
    text-shadow: none;
}

.auto-control {
    margin: 1rem 0;
    text-align: center;
}

.auto-button {
    background: linear-gradient(135deg, #4a90e2 0%, #5cb85c 50%, #4a90e2 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 auto;
}

.auto-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.auto-button.active {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 50%, #e74c3c 100%);
}

.auto-button.active .auto-icon {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.auto-icon {
    font-size: 0.8rem;
}

.auto-text {
    font-size: 0.9rem;
}

.auto-container {
    background: linear-gradient(135deg, #F5F5DC 0%, #FDF5E6 50%, #F5F5DC 100%);
    border: 2px solid #8B4513;
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.auto-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auto-input {
    width: 60px;
    padding: 0.3rem;
    border: 1px solid #8B4513;
    border-radius: 5px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: bold;
    color: #333;
    background: white;
}

.auto-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 5px rgba(74, 144, 226, 0.3);
}

.auto-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.auto-up, .auto-down {
    background: linear-gradient(135deg, #4a90e2 0%, #5cb85c 50%, #4a90e2 100%);
    color: white;
    border: none;
    width: 20px;
    height: 15px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 3px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.auto-up:hover, .auto-down:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.auto-unit {
    color: #666;
    font-size: 0.8rem;
    font-weight: bold;
}

.page-info {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 0;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem;
    opacity: 0;
    transform: none;
    transition: opacity 0.6s ease;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page.active {
    opacity: 1;
    transform: none;
}

.page.prev {
    opacity: 0;
    transform: none;
}

.page-content {
    font-size: 1.1rem;
    line-height: 2;
    color: #333;
    text-align: left;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
}

.page-image {
    text-align: center;
    margin-bottom: 1rem;
}

.page-image img {
    max-width: 100px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.no-content {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

.thumbnail-image {
    max-width: 400px;
    height: auto;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border: 3px solid #8B4513;
}

.novel-description {
    color: #4a90e2;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
    font-style: normal;
}

.episode-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0.8rem;
    background: linear-gradient(135deg, #F5F5DC 0%, #FDF5E6 50%, #F5F5DC 100%);
    border: 2px solid #8B4513;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.episode-nav-button {
    background: linear-gradient(135deg, #4a90e2 0%, #5cb85c 50%, #4a90e2 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.episode-nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.episode-nav-button:disabled {
    background: linear-gradient(135deg, #ccc 0%, #ddd 50%, #ccc 100%);
    color: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    text-shadow: none;
}

.episode-nav-info {
    color: #8B4513;
    font-weight: bold;
    font-size: 0.9rem;
}

.external-links-section {
    background: linear-gradient(135deg, #F5F5DC 0%, #FDF5E6 50%, #F5F5DC 100%);
    border: 3px solid #8B4513;
    border-radius: 12px;
    margin: 2rem auto;
    max-width: 1300px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.external-links-section h3 {
    color: #8B4513;
    font-size: 1.5rem;
    margin: 0 0 1.5rem 0;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    font-weight: bold;
}

.link-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.external-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #8B0000 0%, #DC143C 50%, #8B0000 100%);
    color: #FFD700;
    text-decoration: none;
    border-radius: 25px;
    border: 2px solid #654321;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.external-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
    background: linear-gradient(135deg, #DC143C 0%, #FF6347 50%, #DC143C 100%);
}

.link-icon {
    font-size: 1.2rem;
}

.link-text {
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

footer {
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    background-color: #333;
    color: white;
}

@media (max-width: 768px) {
    .library-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .library-header h1 {
        font-size: 2.5rem;
    }

    #search-box {
        width: 80%;
    }

    .bookshelf {
        order: 2;
    }

    .content-panel {
        order: 1;
    }
} 