/* =========================================
   阿鹿小站 v2.0 - 漫畫閱讀器專屬樣式 (read.css) - 翻頁模式
   ========================================= */
/* 🌟 補上色彩變數，讓按鈕和轉圈圈能抓到顏色 */
:root {
    --primary-color: #007bff; /* 科技藍 */
    --accent-color: #ff4081;  /* 動漫粉 */
}
body {
    margin: 0;
    padding: 0;
    font-family: "Microsoft JhengHei", "Noto Sans TC", sans-serif;
    background-color: #0d0d12; /* 超深色背景 */
    color: #ffffff;
}

a { text-decoration: none; }

/* --- 頂部浮動導覽列 --- */
.reader-header {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 50px;
    background-color: rgba(13, 13, 18, 0.95);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-left, .header-right { flex: 1; }
.header-right { text-align: right; }

.back-btn {
    color: #ffffff; /* 🌟 改成純白，確保清晰可見 */
    font-size: 0.95rem;
    font-weight: bold;
    display: inline-block;
    transition: all 0.3s ease;
}
.back-btn:hover { 
    color: var(--accent-color); 
    transform: translateX(-5px); /* 🌟 滑鼠碰到時微微向左移，有「返回」的動態暗示 */
}

.header-title {
    flex: 2;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unit-name { color: #00bcd4; font-size: 0.9rem; margin-left: 5px; }

.page-indicator {
    background-color: rgba(255,255,255,0.1);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #00bcd4;
}

/* --- 漫畫主要閱讀區 --- */
.reader-container {
    max-width: 1000px; /* 寬度稍微放寬 */
    margin: 50px auto 0 auto; 
    background-color: #0d0d12;
    min-height: 100vh;
}

.manga-viewer {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}

.manga-viewer img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    user-select: none; /* 防止使用者不小心把圖片反白 */
}

/* 🌟 隱藏的點擊熱區 */
.click-zone {
    position: absolute;
    top: 0; bottom: 0;
    width: 50%;
    cursor: pointer;
    z-index: 10;
}
.zone-prev { left: 0; }
.zone-next { right: 0; }

/* --- 底部控制列 --- */
.reader-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    margin-top: 20px;
    background-color: #1a1a2e;
    border-radius: 8px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
}

.page-counter {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
}
#bottom-current-page { color: #00bcd4; font-size: 1.5rem; }

/* --- 按鈕樣式 --- */
.acg-btn {
    display: inline-block;
    padding: 10px 25px;
    background-color: transparent;
    color: #fff;
    border: 2px solid var(--accent-color);
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-nav {
    background-color: rgba(255, 64, 129, 0.1);
}

.acg-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 64, 129, 0.4);
}

/* --- 底部結束區域 --- */
.reader-footer {
    padding: 60px 20px;
    text-align: center;
    background-color: #0d0d12;
}

.end-text {
    color: #666;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.btn-finish {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-finish:hover {
    background-color: #0056b3;
}

.error-msg { text-align: center; padding: 100px 20px; }
/* --- 頂部右上角的按鈕排版 --- */
.header-right { 
    display: flex; 
    gap: 10px; 
    justify-content: flex-end; 
}

.btn-sm {
    padding: 6px 15px;
    font-size: 0.85rem;
    border-radius: 20px;
    background-color: rgba(255, 64, 129, 0.2);
    border: 1px solid var(--accent-color);
}
.btn-sm:hover {
    background-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(255, 64, 129, 0.5);
}

/* --- 下拉選單樣式 --- */
#page-select {
    background-color: #1a1a2e;
    color: #00bcd4;
    border: 1px solid #00bcd4;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
}

#page-select:hover {
    background-color: rgba(0, 188, 212, 0.1);
}

/* --- 底部章節切換按鈕區 --- */
.chapter-nav-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-secondary {
    background-color: transparent;
    color: #a0aab2;
    border: 2px solid #a0aab2;
}

.btn-secondary:hover {
    background-color: #a0aab2;
    color: #111;
}
/* --- 廣告區塊佔位符 --- */
.adsense-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.adsense-placeholder {
    width: 100%;
    max-width: 728px; /* 經典橫幅廣告尺寸 */
    height: 90px;
    background-color: #1a1a2e;
    border: 1px dashed #444;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.8rem;
    text-align: center;
}
/* =========================================
   圖片載入 Loading 特效 (高質感雷達掃描 + 呼吸波紋)
   ========================================= */
.manga-viewer {
    min-height: 600px; 
}

#manga-image {
    opacity: 0; 
    transition: opacity 0.4s ease-in-out; 
    position: relative;
    z-index: 1;
}

/* 🌟 基礎容器：加上內發光，增加儀表板的玻璃精密感 */
.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); 
    width: 60px;
    height: 60px;
    z-index: 5;
    border: 2px solid rgba(255, 255, 255, 0.05); 
    box-shadow: inset 0 0 15px rgba(0, 123, 255, 0.2); /* 內部微微發出藍光 */
    border-radius: 50%;
}

/* 🌟 升級版時針：雷達掃描光束 (取代單調直線) */
.spinner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    /* 使用圓錐漸層，做出前方明亮、後方帶有半透明拖尾的光束效果 */
    background: conic-gradient(
        from 0deg, 
        transparent 65%, 
        rgba(0, 123, 255, 0.4) 98%, 
        var(--primary-color) 100%
    );
    animation: spinClock 1.2s linear infinite;
    z-index: 2;
}

/* 🌟 中心發射核心與呼吸波紋 (動漫粉) */
.spinner::after {
    content: '';
    position: absolute;
    /* 將波紋起點縮小到正中心 */
    top: 25px; left: 25px; right: 25px; bottom: 25px;
    border-radius: 50%;
    background-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color); /* 中心點自帶發光 */
    animation: pulseRipple 1.5s infinite ease-out;
    z-index: 1;
}

/* 旋轉與波紋動畫 */
@keyframes spinClock {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseRipple {
    0% { 
        transform: scale(1); 
        opacity: 1; 
    }
    100% { 
        /* 讓粉紅波紋剛好擴散到外框邊緣就完美消散 */
        transform: scale(6); 
        opacity: 0; 
    }
}
