/* 全局基础样式 (Global Settings) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

a { text-decoration: none; color: inherit; }

/* 顶部导航栏 (Navbar - Index, Bookshelf) */
.top-bar {
    background-color: #2c3e50;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.nav-left { flex: 1; display: flex; align-items: center; gap: 15px; }
.search-box { position: relative; width: 250px; margin: 5px}
.search-input {
    width: 100%;
    padding: 6px 12px 6px 12px;
    padding-right: 30px;
    border-radius: 20px;
    border: 1px solid #ddd;
    font-size: 14px;
    background: rgba(255,255,255,0.9);
    transition: 0.3s;
}
.search-input:focus { background: white; outline: none; }
.search-btn {
    position: absolute; right: 8px; top: 50%; 
    transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: #666; font-weight: bold;
}

.nav-center { flex: 1; text-align: center; }
.site-title { color: white; font-size: 1.4em; font-weight: 700; letter-spacing: 1px; }

.nav-right { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 15px; font-size: 0.9em; color: rgba(255,255,255,0.9); }
.nav-link { color: white; transition: 0.2s; }
.nav-link:hover { color: #f1c40f; text-decoration: none;}

.btn-outline { 
    border: 1px solid rgba(255,255,255,0.6); 
    padding: 4px 10px; border-radius: 4px; 
    font-size: 12px; cursor: pointer; 
    background: transparent; color: white;
    width: auto;
}
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: white; text-decoration: none;}

/* 导航栏响应式 */
@media (max-width: 600px) {
    .top-bar { padding: 0 15px; height: auto; flex-wrap: wrap; padding-bottom: 10px; }
    .nav-left { order: 2; width: 100%; margin-top: 10px; justify-content: center; }
    .search-box { width: 100%; }
    .search-input:focus { width: 100%; }
    .nav-center { order: 1; flex: 0 0 auto; }
    .nav-right { order: 1; flex: 1; }
}

/* 弹窗组件 (Modal - Detail, Profile)*/
.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0;
    width: 100%; height: 100%; background-color: rgba(0,0,0,0.4); 
    backdrop-filter: blur(2px); justify-content: center; align-items: center;
}
.modal-content {
    background-color: #fff; padding: 30px; border-radius: 10px; 
    width: 90%; max-width: 400px; text-align: center; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.15); animation: fadeIn 0.3s;
}
.modal-actions {
    margin-top: 25px; display: flex; justify-content: center; gap: 15px;
}
.btn-close, .btn-confirm-delete, .btn-cancel, .btn-confirm { 
    padding: 10px 20px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; 
}
.btn-cancel { background-color: #f1f2f6; color: #666; }
.btn-confirm { background-color: #2c3e50; color: white; }
.btn-close { background-color: #2c3e50; color: white; }
.btn-confirm-delete { background-color: #e74c3c; color: white; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 章节顶部/底部导航 (Read, Gallery) */
.book-title { color: #333; text-decoration: none; font-weight: bold; font-size: 1.1em;}
.chapter-header {
    background-color: #f5f5f5; padding: 8px 30px; display: flex; 
    justify-content: space-between; align-items: center; 
    border-bottom: 1px solid #ddd; position: sticky; top: 0; z-index: 100;
}
.chapter-footer {
    position: fixed; bottom: 0; width: 100%; background: #f5f5f5; 
    padding: 10px 20px; text-align: center; border-top: 1px solid #ddd; 
    display: flex; justify-content: center; gap: 30px;
}

.footer-button {
    padding: 7px 20px;
    background: rgba(255,255,255,0.9);
    color: #2c3e50;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}
.footer-button:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .chapter-header { flex-direction: column; gap: 10px; position: relative; }
}