/* --- 基础阅读器样式 (严格还原 image_0.png 和 image_3.png) --- */
body {
    background-color: #1a1a1a;
    color: #d0d0d0;
    font-family: 'Georgia', serif; /* Georgia serif for story text */
    margin: 0;
    padding: 0;
    line-height: 1.8;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.reader-container {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 25px;
    box-sizing: border-box;
    padding-bottom: 80px; /* Space for bottom bar */
}

/* Top Meta (image_0.png) */
.top-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    font-family: sans-serif; /* sans-serif for UI elements */
    margin-bottom: 35px;
}

.text-content {
    font-size: 19px;
    margin-bottom: 60px;
}

.text-content p {
    margin-bottom: 25px;
}

/* Nav Controls (image_0.png / image_3.png) */
.nav-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
}

.nav-btn {
    flex: 1;
    background: white;
    color: black;
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    font-family: sans-serif;
    font-size: 14px;
    cursor: pointer;
}

/* Fixed Bottom Bar with Menu Icon (image_0.png / image_3.png) */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer; /* Hint it's clickable */
    z-index: 1000;
}

.menu-icon {
    width: 22px;
    height: 2px;
    background: #555;
    position: relative;
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background: #555;
}

.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }


/* --- 目录侧滑面板样式 (严格还原 image_5.png) --- */

/* 1. 半透明背景遮罩 */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    z-index: 2000; /* Above everything */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

/* 2. 侧滑目录面板 */
.chapter-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 85%; /* 占用大部分宽度 */
    max-width: 400px; /* 但不无限拉伸 */
    height: 100%;
    background-color: #222; /* Dark panel background */
    z-index: 2001; /* Above overlay */
    transform: translateX(-100%); /* Initial state: hidden to the left */
    transition: transform 0.3s ease-out;
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    font-family: sans-serif; /* UI elements use sans-serif */
}

/* 当目录打开时的状态类 */
.chapter-drawer.open {
    transform: translateX(0);
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* --- 目录面板内部结构 (image_5.png) --- */

/* Header section (Cover, Title, Author) */
.drawer-header {
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    gap: 15px;
    align-items: center;
}

.drawer-cover {
    width: 60px;
    height: 85px;
    object-fit: cover;
    border-radius: 4px;
}

.drawer-book-info {
    flex: 1;
}

.drawer-book-title {
    color: #d0d0d0;
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.drawer-book-author {
    color: #777;
    font-size: 12px;
    margin: 0;
}

/* Chapter count and Chapter list */
.drawer-content {
    flex: 1;
    overflow-y: auto; /* Scrollable chapter list */
    padding: 10px 0;
}

.chapter-count {
    padding: 15px 20px;
    color: #777;
    font-size: 13px;
}

.chapter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.chapter-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

.chapter-item:hover {
    background-color: #333;
}

.chapter-item .chapter-name {
    color: #fff;
    font-size: 15px;
    text-decoration: none;
}

/* Current Selected Chapter (image_5.png) */
.chapter-item.selected {
    background-color: rgba(255, 51, 153, 0.1); /* Faint primary pink bg */
}

.chapter-item.selected .chapter-name {
    color: #ff3399; /* Primary pink for current chapter */
    font-weight: bold;
}
.back-link {
    display: inline-block;
    text-decoration: none;
    color: #fff;
    font-size: 35px;
}