/* ================= 阅读页解耦色彩及皮肤矩阵变量 ================= */
/* 1. 背景页面底盘变量 */
body.read-theme-default   { --read-bg: #1e1e22; --read-box-bg: #25252b; --read-title: #f0f0f5; --read-border: #33333a; }
body.read-theme-parchment { --read-bg: #e7f4ea; --read-box-bg: #f5fbf6; --read-title: #102016; --read-border: #cfe5d4; }
body.read-theme-soft      { --read-bg: #dfebd5; --read-box-bg: #e6f2dc; --read-title: #0d1805; --read-border: #cedcc2; }
body.read-theme-light     { --read-bg: #fdfdfd; --read-box-bg: #ffffff; --read-title: #000000; --read-border: #eeeeee; }

/* 2. 独立调节：字体颜色变量 */
body.read-color-normal    { --read-text: #b8b8bc; } 
body.read-color-light     { --read-text: #ffffff; } 
body.read-color-dim       { --read-text: #666666; } 
body.read-color-sepia     { --read-text: #456b51; } 

/* 核心基础绑定 */
body { background: var(--read-bg) !important; color: var(--read-text) !important; transition: background 0.2s, color 0.2s; }

/* ================= 动态字号及字型阶梯 ================= */
body.font-size-xs .read-article-body { font-size: 15px; }
body.font-size-sm .read-article-body { font-size: 17px; }
body.font-size-md .read-article-body { font-size: 19px; }
body.font-size-lg .read-article-body { font-size: 22px; }
body.font-size-xl .read-article-body { font-size: 25px; }

body.font-family-sans .read-article-body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
body.font-family-serif .read-article-body { font-family: "Noto Serif SC", "STKaiti", "KaiTi", serif; }

/* ================= 顶部面包屑 ================= */
.read-page-header { background: rgba(0,0,0,0.08); border-bottom: 1px solid var(--read-border); padding: 12px 15px; }
.read-nav-crumbs { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; opacity: 0.7; }
.read-nav-crumbs a:hover { color: var(--main); }
.read-nav-crumbs .split { margin: 0 5px; font-size: 10px; }
.book-name-link { color: var(--read-title); font-weight: 500; }
.btn-back-detail { color: var(--main); font-weight: 500; }

/* ================= 核心大框架布局 ================= */
.read-main-wrapper { display: flex; gap: 20px; margin: 20px auto 50px auto; align-items: flex-start; }
.read-content-box { flex: 1; min-width: 0; background: var(--read-box-bg); border-radius: 12px; padding: 35px 40px; box-shadow: 0 4px 25px rgba(0,0,0,0.1); border: 1px solid rgba(255,255,255,0.01); }
.read-sidebar-right { width: 280px; flex-shrink: 0; }

/* ================= 上下控制栏 ================= */
.read-control-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; max-width: 600px; margin: 0 auto; }
.bar-top { margin-bottom: 35px; }
.bar-bottom { margin-top: 45px; }

.ctrl-btn { height: 40px; border-radius: 6px; font-size: 14px; font-weight: 600; background: var(--read-bg); border: 1px solid var(--read-border); color: var(--read-title); display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; cursor: pointer; transition: all 0.2s; }
.ctrl-btn:hover { background: var(--main); color: #fff !important; border-color: var(--main); }
.ctrl-btn.disabled { opacity: 0.45; pointer-events: none; cursor: not-allowed; }

/* ================= 章节头部与正文排版 ================= */
.read-article-header { border-bottom: 1px solid var(--read-border); padding-bottom: 15px; margin-bottom: 30px; text-align: center; }
.chapter-title-main { font-size: 26px; color: var(--read-title); font-weight: 700; margin: 0 0 10px 0; }
.chapter-meta-bar { display: flex; justify-content: center; gap: 15px; font-size: 13px; opacity: 0.6; }
.chapter-meta-bar .highlight { color: var(--main); }

/* 正文核心交互区域 */
.read-article-body { line-height: 1.9; text-align: justify; word-break: break-all; cursor: pointer; user-select: text; }
.read-article-body p { margin-bottom: 22px; text-indent: 2em; }
.read-loading-text,
.read-error-text { text-align: center; text-indent: 0 !important; opacity: 0.7; }
.read-error-text { color: #8fe0aa; }

/* ================= 个性化设置弹窗：全端优雅居中展现 ================= */
.read-settings-modal-mask { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.55); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.read-settings-modal-mask.show-modal { opacity: 1; pointer-events: auto; }

.settings-modal-window { background: var(--read-box-bg); border: 1px solid var(--read-border); border-radius: 12px; width: 460px; max-width: 95%; box-shadow: 0 12px 40px rgba(0,0,0,0.45); padding: 22px; transform: scale(0.92); transition: transform 0.2s ease; }
.read-settings-modal-mask.show-modal .settings-modal-window { transform: scale(1); }

.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--read-border); padding-bottom: 12px; margin-bottom: 22px; }
.modal-header h3 { font-size: 15px; color: var(--read-title); margin: 0; display: flex; align-items: center; gap: 6px; }
.modal-close-x { background: none; border: none; font-size: 18px; color: var(--read-text); cursor: pointer; opacity: 0.6; }
.modal-close-x:hover { color: var(--main); opacity: 1; }

.modal-body-grid { display: flex; flex-direction: column; gap: 20px; }
.setting-row { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 10px; }
.row-label { font-size: 13px; font-weight: 600; color: var(--read-title); opacity: 0.8; }

/* 圆圈调色块选择器 */
.circle-options-wrap { display: flex; gap: 14px; align-items: center; }
.circle-dot-btn { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); cursor: pointer; position: relative; transition: all 0.15s ease; box-shadow: inset 0 2px 4px rgba(0,0,0,0.15); }
.circle-dot-btn:hover { transform: scale(1.08); }
.circle-dot-btn.active { border-color: var(--main); box-shadow: 0 0 0 2px var(--main); }
.circle-dot-btn.active::after { content: "\f00c"; font-family: "Line Awesome Free"; font-weight: 900; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 14px; color: #fff; }

.ts-default { background: #25252b; }
.ts-parchment { background: #f5fbf6; }
.ts-soft { background: #e6f2dc; }
.ts-light { background: #ffffff; }
.ts-parchment.active::after, .ts-soft.active::after, .ts-light.active::after { color: #111; }

.cs-normal { background: #b8b8bc; }
.cs-light { background: #ffffff; }
.cs-dim { background: #666666; }
.cs-sepia { background: #456b51; }
.cs-normal.active::after, .cs-light.active::after { color: #111; }

/* 文字扁平化按钮组 */
.text-options-wrap { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.txt-opt-btn { height: 34px; border-radius: 4px; border: 1px solid var(--read-border); background: var(--read-bg); color: var(--read-text); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all 0.15s; text-align: center; }
.txt-opt-btn:hover { border-color: var(--main); color: var(--read-title); }
.txt-opt-btn.active { background: var(--main) !important; color: #fff !important; border-color: var(--main) !important; }

/* ================= 右侧推荐位 ================= */
.read-sidebar-card { background: var(--read-box-bg); border-radius: 10px; padding: 18px; border: 1px solid var(--read-border); }
.read-sidebar-card .card-head { border-bottom: 1px solid var(--read-border); padding-bottom: 10px; margin-bottom: 12px; }
.read-sidebar-card h4 { font-size: 14.5px; color: var(--read-title); font-weight: 600; margin: 0; display: flex; align-items: center; gap: 6px; }
.read-sidebar-card h4 i { color: var(--main); }
.mini-book-list { display: flex; flex-direction: column; gap: 12px; }
.mini-book-item { display: flex; gap: 10px; text-decoration: none; align-items: center; }
.mini-book-item img { width: 45px; height: 60px; object-fit: cover; border-radius: 4px; }
.mini-info h5 { font-size: 13px; color: var(--read-title); margin-bottom: 4px; }
.mini-info p { font-size: 11px; color: var(--read-text); opacity: 0.6; margin: 0; }

/* ================= 移动端纯净自适应 ================= */
@media(max-width: 1200px) {
    .read-sidebar-right { display: none; }
}

@media(max-width: 768px) {
    .read-page-header { padding: 10px; }
    .read-nav-crumbs a, .read-nav-crumbs .split { display: none; }
    .read-nav-crumbs .book-name-link, .btn-back-detail { display: inline-flex; }

    .read-main-wrapper { margin: 10px auto; }
    .read-content-box { border-radius: 0; padding: 20px 15px; border: none; box-shadow: none; }

    .read-control-bar { gap: 6px; }
    .ctrl-btn { height: 34px; font-size: 12.5px; border-radius: 4px; }

    .chapter-title-main { font-size: 21px; }

    /* 移动端同样保持精致的居中高档弹窗样式，增加点击面积 */
    .settings-modal-window { padding: 20px 15px; }
    .setting-row { grid-template-columns: 1fr; gap: 8px; }
    .circle-options-wrap { gap: 16px; }
    .circle-dot-btn { width: 36px; height: 36px; } 
    .txt-opt-btn { height: 36px; }
}
