:root{--ink:#237881;--muted:#73868b;--line:#dce8e9;--soft:#edf7f7;--canvas:#f5f9fa;--paper:#fff;--text:#273b42;--title-color:#1e424b;--hero:#e9f5f7}
html[data-theme=mint]{--canvas:#eff8f5;--paper:#fcfffd;--soft:#e5f5ee;--line:#d5e9df;--hero:#e0f2e9;--ink:#27836f;--title-color:#264d43}
html[data-theme=inkwash]{--canvas:#e8f1ed;--paper:#fbfdfb;--soft:#e1ede8;--line:#aecac0;--hero:#d9e8e2;--ink:#0b6552;--title-color:#064c40;--muted:#607b73;--text:#243f39}
html[data-theme=blue]{--canvas:#f0f5fc;--paper:#fcfdff;--soft:#e8f1fd;--line:#d7e4f6;--hero:#e4eefd;--ink:#3b71b8;--title-color:#2c4669}
html[data-theme=gray]{--canvas:#f3f5f7;--paper:#fff;--soft:#edf0f4;--line:#dce1e8;--hero:#e9edf2;--ink:#556a86;--title-color:#34465a}
html[data-theme=fire]{--canvas:#f7e7e2;--paper:#fffafa;--soft:#fbe9e5;--line:#e2b9b5;--hero:#edc8c4;--ink:#b34f52;--title-color:#713b3c;--muted:#946867;--text:#453031}
html[data-theme=cream]{--canvas:#f7e5df;--paper:#fffdfb;--soft:#faeee9;--line:#e8cbc3;--hero:#f1d7cf;--ink:#a95f63;--title-color:#6f4345;--muted:#8d6865;--text:#493638}
html[data-theme=apricot]{--canvas:#f8efd2;--paper:#fffdf8;--soft:#cfe7f1;--line:#9fc8c0;--hero:#ffd8b8;--ink:#9a4f20;--title-color:#355d5b;--muted:#6f7e74;--text:#3f4d49}
html body.blind-school-page,html body{background:var(--canvas)!important;background-image:none!important;color:var(--text)}
.top .brand,.library-brand{border:none!important;box-shadow:none!important;background:transparent!important;border-radius:0!important;color:var(--title-color)!important;padding:0!important}.top .brand>span,.library-brand .brand-seal{background:var(--ink)!important;color:#fff!important}.desk{border-color:var(--line);background:var(--paper);box-shadow:0 4px 24px #28464d05}.desk button,.desk a,.top a,.top button,.manage,.tools button{color:var(--ink)}.desk-head,.reading-subhead,.page-footer,.chart-footer,.nav-bottom{border-color:var(--line)}.reading-pane article,.navigation,.chart-pane,.desk-head,.page-footer{background:var(--paper)}.reading-pane article{color:var(--text)}.reading-pane h1,.reading-pane h2,.book-heading strong,.chart-head strong{color:var(--title-color)}.layout-options,.blind-doc-directory-tabs,.blind-doc-case-summary,.chart-status,.case-passage{background:var(--soft)!important;border-color:var(--line)!important;color:var(--muted)}.blind-doc-directory-tabs button,.blind-doc-case-item strong{color:var(--text)!important}.blind-doc-directory-tabs button.active{background:var(--paper)!important;color:var(--ink)!important;box-shadow:0 2px 8px #2959620d!important}.blind-doc-case-item{background:var(--paper)!important;border-color:var(--line)!important;box-shadow:none!important}.blind-doc-case-item.is-active{background:var(--soft)!important;border-color:var(--ink)!important}.blind-doc-case-index{background:var(--ink)!important;color:#fff!important}.blind-doc-case-item small,.blind-doc-case-item em,.reading-subhead,.chart-eyebrow,.chart-status,.chart-footer,.page-footer,.nav-note,.nav-bottom,.preview-label,.brand small{color:var(--muted)!important}.blind-doc-case-item em{background:var(--soft)!important}.blind-doc-case-item em.is-saved{background:#e8f5f0!important;color:#32836e!important}.chart-head button,.tools button,.passage-head button,.manage,.layout-options{border-color:var(--line);background:var(--paper)}.chart-head button[aria-pressed=true]{background:var(--soft);border-color:var(--ink)}.resizer{background:var(--paper)}.resizer:after{background:var(--line)}.resizer:hover:after{background:var(--ink)}.outline-item{color:var(--text)}.outline-item.active{background:var(--soft);color:var(--ink)}.reading-subhead button{font-size:11px;border:0;background:none;color:var(--muted);padding:4px 8px;border-radius:5px}.reading-subhead button.active{background:var(--soft);color:var(--ink)}#theme-picker{border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);padding:8px 10px;font-size:12px;max-width:110px}.reading-pane article.source-reading{padding:18px 24px;position:relative}.original-page{position:relative;max-width:100%;margin:auto;background:white}.original-page>img{width:100%;height:auto;display:block}.source-marker{position:absolute;border:2px solid var(--ink)!important;border-radius:3px;background:#28a9bc12!important;min-height:10px;padding:0!important;cursor:pointer}.source-marker.active{background:#29a4b327!important;box-shadow:0 0 0 2px #fff9}.source-marker span{position:absolute;right:100%;top:-2px;margin-right:4px;background:var(--ink);border-radius:50%;color:white;font:10px/19px sans-serif;width:19px;height:19px}.source-page-note{font:11px/1.7 sans-serif;color:var(--muted);margin-bottom:12px}.text-original{white-space:pre-wrap;font:var(--reading-font)/1.95 SimSun,serif;color:var(--text)}.source-occurrences{display:flex;gap:5px;flex-wrap:wrap}.source-occurrences button{border:1px solid var(--line);background:var(--paper);padding:5px 8px;font-size:11px;border-radius:6px;color:var(--ink)}.case-read-heading{font-size:13px;color:var(--ink);display:flex;align-items:center;gap:8px;margin-bottom:10px}.reading-pane .source-reading h1{font-size:20px;margin-top:5px}.library-header nav{gap:14px}.library-intro{background:var(--hero)!important;color:var(--title-color)}.library-intro h1{color:var(--title-color)}.intro-mark{color:var(--ink)!important;opacity:.32}.eyebrow,.library-intro p,.library-footer,.book-meta,.library-brand small{color:var(--muted)!important}.search-box{background:var(--soft)!important}.search-box input{color:var(--text)}#categories button{color:var(--muted)!important}#categories button.active{color:var(--ink)!important;background:var(--soft)!important}.manage-entry{border-color:var(--line)!important;color:var(--ink)!important;background:var(--paper)!important}.manage-entry span{background:var(--soft)!important;color:var(--ink)!important}.book-cover{background:#356b79!important;color:#f3fbff!important}.book-card:nth-child(2n) .book-cover{background:#556c9d!important}body a:focus-visible,body button:focus-visible,body [role=separator]:focus-visible{outline-color:var(--ink)}
@media(max-width:980px){.top{flex-wrap:wrap;height:78px}.brand small{display:none}.top .brand{font-size:17px}.manage{font-size:10px;padding:7px}#theme-picker{max-width:87px;padding:6px;font-size:11px}.desk{height:calc(100dvh - 86px)}.book-heading{font-size:12px;gap:9px}.reading-subhead{padding:8px 12px}.reading-subhead #chapter-caption{max-width:40%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.reading-pane article.source-reading{padding:10px 15px}.library-header{flex-wrap:wrap;height:auto;min-height:100px;padding-top:14px;padding-bottom:14px;gap:10px}.library-header nav{gap:9px}.library-brand{font-size:20px}.book-grid{gap:20px 16px}}

/* Match the live database home .shell width, including its responsive gutters. */
html body .top,html body .desk,html body .library-header,html body #library-home{width:min(var(--site-content-max,1180px),calc(100% - clamp(24px,4vw,56px)));max-width:none;margin-left:auto;margin-right:auto}
html body .top,html body .library-header{padding-left:0;padding-right:0}
html body #library-home{padding-left:0;padding-right:0}
html body::before,html body::after{background:none!important;box-shadow:none!important;pointer-events:none}
.book-heading{min-width:0}.book-heading strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:440px}.reading-pane .text-original{white-space:pre-wrap}
@media(max-width:980px){.book-heading strong{max-width:calc(100% - 65px)}html body .top{gap:7px}.top .preview-label{display:none}}

.mobile-tabs button[aria-pressed=true]{border-bottom-color:var(--ink)!important;color:var(--ink)!important}
:root{--nav-width:220px;--chart-width:370px}
.chart-status .status-dot{background:var(--ink)}
/* Deliberately distinct backgrounds shared by the library and reader. */
:root{--canvas:#f4f7fb;--paper:#ffffff;--soft:#edf2f8;--line:#dce4ee;--ink:#365e89;--title-color:#20354e;--hero:#e6eef8}
html[data-theme=mint]{--canvas:#ccebe2;--paper:#f6fffb;--soft:#d9f2e8;--line:#b8ddcf;--hero:#bce5d5;--ink:#117b62;--title-color:#164e40;--muted:#527f70}
html[data-theme=inkwash]{--canvas:#e8f1ed;--paper:#fbfdfb;--soft:#e1ede8;--line:#aecac0;--hero:#d9e8e2;--ink:#0b6552;--title-color:#064c40;--muted:#607b73;--text:#243f39}
html[data-theme=blue]{--canvas:#d3e3fa;--paper:#f8faff;--soft:#e0eafd;--line:#bacfec;--hero:#bcd3f5;--ink:#315fbd;--title-color:#253f75;--muted:#637fa8}
html[data-theme=gray]{--canvas:#dfe0e6;--paper:#faf9fc;--soft:#ebE8f2;--line:#cdc9da;--hero:#d3cddd;--ink:#726184;--title-color:#483e55;--muted:#857b91}
html[data-theme=fire]{--canvas:#f7e7e2;--paper:#fffafa;--soft:#fbe9e5;--line:#e2b9b5;--hero:#edc8c4;--ink:#b34f52;--title-color:#713b3c;--muted:#946867;--text:#453031}
html[data-theme=cream]{--canvas:#f7e5df;--paper:#fffdfb;--soft:#faeee9;--line:#e8cbc3;--hero:#f1d7cf;--ink:#a95f63;--title-color:#6f4345;--muted:#8d6865;--text:#493638}
html[data-theme=apricot]{--canvas:#f8efd2;--paper:#fffdf8;--soft:#cfe7f1;--line:#9fc8c0;--hero:#ffd8b8;--ink:#9a4f20;--title-color:#355d5b;--muted:#6f7e74;--text:#3f4d49}
html[data-theme] body.blind-school-page{background:var(--canvas)!important;background-image:none!important}
/* Optional palette matching the original database's warm gold controls. */
html[data-theme=classic]{--canvas:#fbf7f0;--paper:#fffdf9;--soft:#fff1df;--line:#edcba7;--hero:#f4e5d0;--ink:#aa5a1c;--title-color:#774019;--muted:#a08469;--text:#443427}

/* Shared library header: brand left; theme/tools directly before the account on every viewport. */
.library-header,.top{position:relative!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;column-gap:10px;flex-wrap:nowrap!important}
.library-center-tools,.reader-center-tools{position:static;grid-column:2;display:flex;align-items:center;justify-content:flex-end;gap:10px;white-space:nowrap;transform:translateY(-6px)}
.library-header-account,.reader-header-account{grid-column:3;display:flex;align-items:center;justify-content:flex-end;margin-left:0;min-width:42px;transform:translateY(-6px)}
.library-header .library-userbar,.top .library-userbar{display:inline-flex;align-items:center;flex:0 0 auto}
.library-userbar .btn-login{border-color:var(--line)!important;background:var(--paper)!important;color:var(--ink)!important}
.library-userbar .user-menu-trigger.avatar-trigger{border-color:var(--line)!important;background:var(--soft)!important;color:var(--ink)!important;box-shadow:0 3px 12px color-mix(in srgb,var(--ink) 14%,transparent)!important}
.library-userbar .user-menu-trigger.avatar-trigger:before{background:var(--ink)!important}
.library-userbar .user-menu-trigger.avatar-trigger:after{border-color:var(--ink)!important}
.library-userbar .user-menu-panel{top:50%!important;right:calc(100% + 10px)!important;left:auto!important;transform:translateY(-50%)!important;display:none;flex-direction:row!important;align-items:center;flex-wrap:nowrap!important;gap:6px!important;border-color:var(--line)!important;background:var(--paper)!important;box-shadow:0 8px 24px color-mix(in srgb,var(--ink) 16%,transparent)!important;white-space:nowrap}
.library-userbar.is-open .user-menu-panel{display:inline-flex!important}
.library-userbar .user-menu-panel .btn-secondary,.library-userbar .user-menu-panel .btn-logout{border-color:var(--line)!important;background:var(--paper)!important;color:var(--ink)!important}
.library-userbar .user-menu-panel .btn-secondary:hover,.library-userbar .user-menu-panel .btn-logout:hover{background:var(--soft)!important}
.shelf-title-group{display:flex;align-items:center;gap:18px;min-width:0}
.library-return-link{display:inline-flex;align-items:center;gap:4px;padding:3px 0;border:0!important;border-radius:0;background:transparent!important;color:var(--ink)!important;font-size:13px;font-weight:600;line-height:1.3;white-space:nowrap;box-shadow:none!important;text-decoration:none}
.library-return-link:hover{text-decoration:underline;text-underline-offset:3px}
.library-return-link .return-icon{font-size:13px;font-weight:600;line-height:1}
.reader-center-tools .manage{background:var(--paper);color:var(--ink);border-color:var(--line)}

@media(max-width:700px){
  .library-header,.top{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto;grid-template-rows:auto;height:auto!important;min-height:82px!important;padding-top:10px!important;padding-bottom:10px!important;column-gap:7px!important;row-gap:0!important}
  .library-header{padding-left:20px!important;padding-right:20px!important}
  .top{padding-left:14px!important;padding-right:14px!important}
  .library-center-tools,.reader-center-tools{position:static;grid-column:2;grid-row:1;transform:none;justify-self:end;min-width:0}
  .library-header-account,.reader-header-account{grid-column:3;grid-row:1;margin-left:0;transform:none}
  .library-brand,.top .brand{grid-column:1;grid-row:1;min-width:0}
  .library-brand>span:last-child,.top .brand>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .library-userbar .user-menu-panel{position:fixed!important;top:92px!important;left:10px!important;right:10px!important;transform:none!important;justify-content:center;overflow-x:auto}
  .shelf-title-group{gap:11px;flex-wrap:wrap}
  .desk{height:calc(100dvh - 112px)!important}
  .book-heading{gap:8px!important}
  .book-heading strong{flex-basis:100%;max-width:100%!important}
  .library-return-link{padding:2px 0;font-size:11px;gap:3px}
  .library-return-link .return-icon{font-size:11px}
}
html[data-theme=classic] .desk .discourse-tabs button[aria-pressed=true]{background:#cf8a45;border-color:#cf8a45}
html[data-theme=classic] .book-cover{background:#a96c3c!important}html[data-theme=classic] .book-card:nth-child(2n) .book-cover{background:#8a715a!important}
html[data-theme=fire] .book-cover{background:#9b4f52!important}html[data-theme=fire] .book-card:nth-child(2n) .book-cover{background:#bd716d!important}
html[data-theme=cream] .book-cover{background:#f1d2cc!important;color:#65383e!important}html[data-theme=cream] .book-card:nth-child(2n) .book-cover{background:#e5bbb8!important;color:#65383e!important}
html[data-theme=apricot] .book-cover{background:#cfe7f1!important;color:#355d5b!important}html[data-theme=apricot] .book-card:nth-child(2n) .book-cover{background:#ffd8b8!important;color:#65442f!important}

/* Keep the compact reader header deterministic, including mobile browsers that
   expose a tablet-sized CSS viewport while rendering their phone layout. */
@media(max-width:980px){
  html body.blind-school-page>header.top{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto 42px!important;
    grid-template-rows:42px!important;
    grid-template-areas:"brand tools account"!important;
    align-items:center!important;
    align-content:center!important;
    column-gap:8px!important;
    row-gap:0!important;
    width:calc(100% - 24px)!important;
    height:58px!important;
    min-height:58px!important;
    padding:8px 0!important;
    margin:0 auto!important;
  }
  html body.blind-school-page>header.top>.brand{
    grid-area:brand!important;
    justify-self:start!important;
    align-self:center!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    transform:none!important;
  }
  html body.blind-school-page>header.top>.brand>div{
    min-width:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  html body.blind-school-page>header.top>.reader-header-account{
    grid-area:account!important;
    position:static!important;
    justify-self:end!important;
    align-self:center!important;
    min-width:38px!important;
    margin:0!important;
    transform:none!important;
  }
  html body.blind-school-page>header.top>.reader-center-tools{
    grid-area:tools!important;
    position:static!important;
    justify-self:center!important;
    align-self:center!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    transform:none!important;
  }
  html body.blind-school-page>header.top>.reader-center-tools #theme-picker{width:87px!important;max-width:87px!important}
  html body.blind-school-page>header.top>.reader-center-tools .manage{display:none!important}
  html body.blind-school-page>header.top .library-userbar{margin:0!important}
  html body.blind-school-page>header.top .library-userbar .user-menu-panel{top:58px!important}
  html body.blind-school-page>.desk{height:calc(100svh - 66px)!important}
  .desk .book-heading{display:flex!important;flex-wrap:nowrap!important;min-width:0!important;overflow:hidden!important}
  .desk .book-heading>a{flex:0 0 auto!important;white-space:nowrap!important;word-break:keep-all!important}
  .desk .book-heading>.divider{flex:0 0 1px!important}
  .desk .book-heading>strong{flex:1 1 auto!important;flex-basis:auto!important;min-width:0!important;max-width:none!important}
}

/* 杏雾蓝柑书苑对齐版（2026-09-20）：以首页杏雾蓝柑为唯一视觉标准，
   统一为暖白→奶杏渐变画布与首页四类入口卡组件语言；只调整颜色、渐变、
   描边、阴影等绘制属性，不改变布局、功能、结构或业务语义色。 */
html[data-theme=apricot] body,
html[data-theme=apricot] body.blind-school-page{
  background:linear-gradient(180deg,#fffdf8 0%,#f8efd2 100%)!important;
  background-image:linear-gradient(180deg,#fffdf8 0%,#f8efd2 100%)!important;
}
/* 顶部条带复制首页一级导航：暖白至雾蓝浅渐变、柔青描边。 */
html[data-theme=apricot] .library-header,
html[data-theme=apricot] body.blind-school-page>header.top{
  background:linear-gradient(180deg,rgba(255,253,248,.96),color-mix(in srgb,#fffdf8 88%,#cfe7f1))!important;
  border-bottom:1px solid #9fc8c0!important;
}
/* 书苑横幅对应首页 hero 的暖白→浅柑淡渐变，不再整块平涂浅柑。 */
html[data-theme=apricot] .library-intro{
  background:linear-gradient(160deg,#fffdf8 0%,#ffe8d2 100%)!important;
  border:1px solid rgba(71,92,86,.16);
  box-shadow:0 8px 20px rgba(72,91,84,.10);
}
/* 内容卡片阴影沿用首页入口卡轻阴影。 */
html[data-theme=apricot] .desk{box-shadow:0 8px 20px rgba(72,91,84,.10)!important}
/* 搜索框复制首页输入框：暖白纸面、柔青描边。 */
html[data-theme=apricot] .search-box{
  background:linear-gradient(180deg,#fffdf8,color-mix(in srgb,#fffdf8 88%,#cfe7f1))!important;
  border:1px solid #9fc8c0;
  color:var(--muted)!important;
}
html[data-theme=apricot] .search-box input{color:var(--text)}
/* 弱操作（主题选择、文档管理、登录）复制首页第三张雾蓝入口卡。 */
html[data-theme=apricot] :is(#theme-picker,.manage-entry,.reader-center-tools .manage,.library-userbar .btn-login){
  border-color:rgba(71,92,86,.16)!important;
  background:linear-gradient(135deg,#e8f5fa 0%,#cfe7f1 100%)!important;
  color:#294f4d!important;
  box-shadow:0 8px 20px rgba(72,91,84,.10)!important;
}
html[data-theme=apricot] .manage-entry span{background:#fffdf8!important;color:#294f4d!important}
/* 信息面（布局切换、排盘状态、案例摘要、原文引注条）复制首页第一张奶杏入口卡。 */
html[data-theme=apricot] :is(.layout-options,.chart-status,.blind-doc-case-summary,.case-passage){
  background:linear-gradient(135deg,#fff9e8 0%,#f8efd2 100%)!important;
  border-color:rgba(71,92,86,.16)!important;
}
/* 选中标签（分类、大纲选中项）复制首页第四张柔青入口卡。 */
html[data-theme=apricot] #categories button.active,
html[data-theme=apricot] .outline-item.active{
  background:linear-gradient(135deg,#cce3de 0%,#9fc8c0 100%)!important;
  color:#294f4d!important;
}
/* 侧栏案例／大纲页签统一为文字页签：默认深青，选中铜柑文字加底线。 */
html[data-theme=apricot] .blind-doc-directory-tabs{background:transparent!important;border-color:rgba(71,92,86,.16)!important}
html[data-theme=apricot] .blind-doc-directory-tabs button{color:var(--title-color)!important}
html[data-theme=apricot] .blind-doc-directory-tabs button.active{
  background:none!important;
  color:#9a4f20!important;
  box-shadow:inset 0 -2px 0 #9a4f20!important;
}
/* 书架封面改用首页雾蓝／浅柑入口卡渐变替代平涂。 */
html[data-theme=apricot] .book-cover{background:linear-gradient(135deg,#e8f5fa 0%,#cfe7f1 100%)!important;color:#294f4d!important}
html[data-theme=apricot] .book-card:nth-child(2n) .book-cover{background:linear-gradient(135deg,#ffe8d2 0%,#ffd8b8 100%)!important;color:#4a3b31!important}

/* 手机书苑页头最终对齐：覆盖主题层原有两行布局，品牌外观与桌面保持一致。 */
@media(max-width:600px){.library-header{display:grid!important;grid-template-columns:max-content minmax(0,1fr) max-content max-content!important;grid-template-rows:auto!important;height:82px!important;min-height:82px!important;padding:0!important;gap:6px!important}.library-brand{grid-column:1!important;grid-row:1!important;justify-self:start!important;font-size:20px!important;gap:8px!important;letter-spacing:1px!important}.library-brand .brand-seal{font-size:25px!important;padding:6px 8px!important}.library-brand small{display:block!important;font-size:8px!important;letter-spacing:1px!important;margin-top:4px!important}.library-center-tools{position:static!important;grid-column:3!important;grid-row:1!important;justify-self:end!important;min-width:0!important;transform:none!important}.library-center-tools #theme-picker{display:block!important;width:67px!important;max-width:67px!important;margin:0!important;padding-left:5px!important;padding-right:3px!important}.library-header-account{grid-column:4!important;grid-row:1!important;justify-self:end!important;margin-left:0!important;transform:none!important}.library-header .library-userbar{align-self:center!important;margin:0!important}}
