:root {
    --bg-color: #fcfcfc;
    --text-color: #2c2c2c;
    --link-color: #0066cc;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 夜间模式 */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #d1d1d1;
    --link-color: #4da6ff;
}

/* 羊皮纸/护眼模式 */
[data-theme="sepia"] {
    --bg-color: #f4ecd8;
    --text-color: #5b4636;
    --link-color: #0066cc;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    line-height: 1.8;
    font-size: 18px;
    margin: 0;
    padding: 20px; /* 改为统一 20px，不再给底部留空间 */
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 650px; /* 控制版心，避免视线疲劳 */
    margin: 0 auto;
}

/* 书架网格 */
.bookshelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.book-card { cursor: pointer; text-align: center; }
.book-card img { width: 100%; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.book-card h3 { font-size: 15px; margin: 12px 0 4px; }
.book-card p { font-size: 13px; color: gray; margin: 0; }

/* 目录列表 */
.toc-list { list-style: none; padding: 0; }
.toc-list li { margin-bottom: 12px; border-bottom: 1px solid rgba(128,128,128,0.2); padding-bottom: 8px;}
.toc-list a { text-decoration: none; color: var(--text-color); display: block; }

/* 阅读器内部图片自适应 */
.reader-content img { max-width: 100%; height: auto; }

/* 底部极简工具栏 */
/* 顶部极简工具栏（不再吸顶/吸底，随页面滚动走） */
.toolbar {
    display: flex;
    justify-content: space-between; /* 按钮均匀散开 */
    padding: 10px 0 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

button {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}

/* 强制约束阅读区内的标题大小 */
.reader-content h1 {
    font-size: 1.5em; /* 相当于 27px 左右 */
    margin-top: 0;
    margin-bottom: 0.8em;
    line-height: 1.3;
}
.reader-content h2 {
    font-size: 1.3em;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    line-height: 1.3;
}