.ideal-book-app {
  --ib-ink:#212121; --ib-muted:#898989; --ib-paper:#f6f6f6; --ib-card:#ffffff; --ib-line:rgba(39, 39, 39, .1); --ib-accent:#7b7b7b;
  position:fixed; inset:0; z-index:40; display:none; overflow:hidden; background:var(--ib-paper); color:var(--ib-ink);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Helvetica Neue",sans-serif;
  -webkit-font-smoothing:antialiased; isolation:isolate;
}
.ideal-book-app.is-open { display:block; }
.ideal-book-app * { box-sizing:border-box; }
.ideal-book-app button,.ideal-book-app input,.ideal-book-app textarea,.ideal-book-app select { font:inherit; }
.ideal-book-app button { color:inherit; cursor:pointer; }
.ideal-book-page { position:absolute; inset:0; overflow:auto; padding:calc(25px + env(safe-area-inset-top)) 24px calc(120px + env(safe-area-inset-bottom)); scrollbar-width:none; }
.ideal-book-page::-webkit-scrollbar,.ideal-book-reading-scroll::-webkit-scrollbar,.ideal-book-chat-messages::-webkit-scrollbar { display:none; }
.ideal-book-topbar { display:flex; align-items:center; justify-content:space-between; min-height:43px; margin-bottom:29px; }
.ideal-book-eyebrow,.ideal-book-section-heading > div > span,.ideal-book-toc-sheet > header > span,.ideal-book-chat-panel > header span { display:block; color:var(--ib-muted); font-size:9px; font-weight:700; letter-spacing:.16em; }
.ideal-book-topbar h1 { margin:4px 0 0; font-size:29px; font-weight:700; letter-spacing:-.055em; }
.ideal-book-icon { width:21px; height:21px; fill:none; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; stroke-width:2; }
.ideal-book-topbar > button,.ideal-book-top-actions > button { display:grid; flex:0 0 auto; place-items:center; width:36px; height:36px; padding:0; border:0; border-radius:50%; background:rgba(27, 27, 27, .055); }
.ideal-book-top-actions { display:flex; align-items:center; gap:10px; }
.ideal-book-import { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:36px; padding:0 12px; border:0; border-radius:999px; background:#eaeaea; color:#464646; font-size:11px; font-weight:650; cursor:pointer; white-space:nowrap; }
.ideal-book-import .ideal-book-icon { width:16px; height:16px; }
.ideal-book-import input { display:none; }
.ideal-book-section-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:13px; }
.ideal-book-section-heading h2 { margin:5px 0 0; font-size:20px; font-weight:680; letter-spacing:-.045em; }
.ideal-book-section-heading > button { display:flex; align-items:center; gap:2px; padding:5px 0 2px; border:0; background:transparent; color:var(--ib-muted); font-size:11px; }
.ideal-book-section-heading > button .ideal-book-icon { width:14px; height:14px; }
.ideal-book-continue { margin-top:5px; }
.ideal-book-feature { position:relative; display:flex; align-items:center; gap:19px; width:100%; min-height:190px; padding:22px; overflow:hidden; border:1px solid rgba(255, 255, 255, .68); border-radius:25px; background:linear-gradient(130deg,#e9e9e9,#f3f3f3 60%,#e4e4e4); text-align:left; box-shadow:0 15px 34px rgba(44, 44, 44, .06); }
.ideal-book-cover { position:relative; display:grid; flex:0 0 auto; place-items:center; width:90px; height:126px; overflow:hidden; border:1px solid rgba(255, 255, 255, .45); border-radius:6px 11px 11px 6px; background:linear-gradient(145deg,var(--ideal-book-cover-a),var(--ideal-book-cover-b)); color:#fafafa; box-shadow:5px 9px 18px rgba(23, 23, 23, .22),inset 5px 0 rgba(22, 22, 22, .13); }
.ideal-book-cover::after { position:absolute; top:0; bottom:0; left:8px; width:1px; background:rgba(255, 255, 255, .24); content:""; }
.ideal-book-cover > span { max-width:70px; padding:8px; overflow:hidden; font-family:Georgia,"Songti SC",serif; font-size:23px; line-height:1.25; text-align:center; overflow-wrap:anywhere; }
.ideal-book-cover img { width:100%; height:100%; object-fit:cover; }
.ideal-book-feature-copy { display:flex; flex:1; flex-direction:column; align-items:flex-start; min-width:0; }
.ideal-book-feature-copy > small { color:#838383; font-size:10px; }
.ideal-book-feature-copy > strong { display:-webkit-box; max-width:100%; margin-top:6px; overflow:hidden; color:#282828; font-family:Georgia,"Songti SC",serif; font-size:20px; font-weight:650; line-height:1.3; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.ideal-book-feature-copy > i { margin-top:4px; color:#848484; font-size:10px; font-style:normal; }
.ideal-book-feature-progress { display:block; width:100%; margin-top:15px; color:#6d6d6d; font-size:9px; }
.ideal-book-feature-progress b,.ideal-book-progress { display:block; height:3px; overflow:hidden; border-radius:99px; background:rgba(61, 61, 61, .12); }
.ideal-book-feature-progress b { margin-top:6px; }
.ideal-book-feature-progress em,.ideal-book-progress b { display:block; height:100%; border-radius:inherit; background:#7f7f7f; }
.ideal-book-resume { display:flex; align-items:center; gap:4px; margin-top:13px; color:#5e5e5e; font-size:10px; font-weight:680; }
.ideal-book-resume .ideal-book-icon { width:13px; height:13px; }
.ideal-book-home-shelf { margin-top:31px; }
.ideal-book-row { display:flex; gap:17px; overflow-x:auto; margin-right:-24px; padding:2px 24px 12px 0; scrollbar-width:none; }
.ideal-book-row::-webkit-scrollbar { display:none; }
.ideal-book-tile { position:relative; min-width:0; }
.ideal-book-tile > button:first-child { display:flex; flex-direction:column; align-items:flex-start; width:100%; padding:0; border:0; background:transparent; text-align:left; }
.ideal-book-row .ideal-book-tile { flex:0 0 105px; }
.ideal-book-row .ideal-book-cover { width:87px; height:120px; }
.ideal-book-tile-title { display:-webkit-box; width:100%; margin-top:9px; overflow:hidden; font-family:Georgia,"Songti SC",serif; font-size:11px; font-weight:620; line-height:1.35; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.ideal-book-tile small { display:block; width:100%; margin-top:4px; overflow:hidden; color:var(--ib-muted); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.ideal-book-progress { width:100%; height:2px; margin-top:8px; }
.ideal-book-tile .ideal-book-delete { position:absolute; top:-7px; right:0; display:grid; place-items:center; width:25px; height:25px; padding:0; border:1px solid rgba(0, 0, 0, .07); border-radius:50%; background:rgba(255, 255, 255, .93); color:#7d7d7d; opacity:0; }
.ideal-book-tile:hover .ideal-book-delete,.ideal-book-tile:focus-within .ideal-book-delete { opacity:1; }
.ideal-book-tile .ideal-book-delete .ideal-book-icon { width:13px; height:13px; }
.ideal-book-soft-empty { margin:0; padding:20px 0; color:var(--ib-muted); font-size:12px; }
.ideal-book-invite { display:flex; align-items:center; gap:13px; margin-top:25px; padding:16px 17px; border:1px solid rgba(72, 72, 72, .08); border-radius:19px; background:rgba(255, 255, 255, .72); }
.ideal-book-invite > span { display:grid; flex:0 0 36px; place-items:center; width:36px; height:36px; border-radius:13px; background:#e9e9e9; color:#6b6b6b; font-size:8px; font-weight:750; }
.ideal-book-invite > div { flex:1; min-width:0; }
.ideal-book-invite strong { font-size:12px; }
.ideal-book-invite p { margin:4px 0 0; color:var(--ib-muted); font-size:10px; line-height:1.45; }
.ideal-book-invite > .ideal-book-icon { width:16px; height:16px; color:#a4a4a4; }
.ideal-book-welcome { display:flex; flex-direction:column; align-items:flex-start; margin:40px 0 34px; padding:29px 26px; border-radius:25px; background:linear-gradient(140deg,#e4e4e4,#efefef 56%,#dfdfdf); }
.ideal-book-open-mark { display:grid; place-items:center; width:43px; height:43px; border-radius:15px; background:#fafafa; color:#727272; box-shadow:0 7px 18px rgba(50, 50, 50, .08); }
.ideal-book-open-mark .ideal-book-icon { width:23px; height:23px; }
.ideal-book-welcome > span { margin-top:22px; color:#7a7a7a; font-size:10px; font-weight:700; letter-spacing:.13em; }
.ideal-book-welcome h2 { margin:8px 0 0; font-family:Georgia,"Songti SC",serif; font-size:25px; font-weight:620; line-height:1.35; letter-spacing:-.04em; }
.ideal-book-welcome p { max-width:300px; margin:10px 0 18px; color:#797979; font-size:11px; line-height:1.65; }
.ideal-book-library-meta { display:flex; align-items:baseline; gap:5px; margin:-10px 0 20px; }
.ideal-book-library-meta strong { font-size:30px; font-weight:650; letter-spacing:-.06em; }
.ideal-book-library-meta span { font-size:11px; }
.ideal-book-library-meta small { margin-left:auto; color:var(--ib-muted); font-size:10px; }
.ideal-book-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(100px,1fr)); gap:26px 17px; max-width:800px; }
.ideal-book-grid .ideal-book-cover { width:100%; height:auto; aspect-ratio: .70; }
.ideal-book-grid .ideal-book-tile-title { font-size:12px; }
.ideal-book-grid .ideal-book-delete { opacity:.75; }
.ideal-book-empty-library { display:flex; flex-direction:column; align-items:center; margin:45px auto 0; padding:35px 20px; text-align:center; }
.ideal-book-empty-library > div { display:grid; place-items:center; width:56px; height:56px; border-radius:19px; background:#eaeaea; color:#7a7a7a; }
.ideal-book-empty-library h2 { margin:17px 0 0; font-family:Georgia,"Songti SC",serif; font-size:20px; }
.ideal-book-empty-library p { max-width:250px; margin:8px 0 17px; color:var(--ib-muted); font-size:11px; line-height:1.6; }
.ideal-book-dock { position:absolute; right:50%; bottom:calc(16px + env(safe-area-inset-bottom)); z-index:2; display:flex; align-items:center; gap:5px; min-height:66px; padding:7px; transform:translateX(50%); border:1px solid rgba(255, 255, 255, .72); border-radius:25px; background:rgba(255, 255, 255, .82); box-shadow:0 10px 35px rgba(40, 40, 40, .13); -webkit-backdrop-filter:blur(22px) saturate(150%); backdrop-filter:blur(22px) saturate(150%); }
.ideal-book-dock button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; width:76px; height:51px; padding:4px 8px; border:0; border-radius:18px; background:transparent; color:#888888; }
.ideal-book-dock button.is-active { background:#efefef; color:#6d6d6d; }
.ideal-book-dock img { display:block; width:21px; height:21px; object-fit:contain; }
.ideal-book-dock span { font-size:9px; font-weight:650; }
.ideal-book-reader { position:absolute; inset:0; display:flex; flex-direction:column; background:#f9f9f9; color:#262626; }
.ideal-book-reader.is-night { background:#1d1d1d; color:#e3e3e3; }
.ideal-book-reader-bar { display:flex; flex:0 0 auto; align-items:center; gap:12px; min-height:67px; padding:calc(12px + env(safe-area-inset-top)) 17px 10px; border-bottom:1px solid rgba(0, 0, 0, .07); background:rgba(255, 255, 255, .76); }
.ideal-book-reader.is-night .ideal-book-reader-bar { border-color:rgba(255, 255, 255, .08); background:rgba(29, 29, 29, .84); }
.ideal-book-reader-bar > button { display:grid; flex:0 0 35px; place-items:center; width:35px; height:35px; padding:0; border:0; border-radius:50%; background:rgba(0, 0, 0, .045); }
.ideal-book-reader.is-night .ideal-book-reader-bar > button { background:rgba(255, 255, 255, .08); }
.ideal-book-reader-bar .ideal-book-icon { width:19px; height:19px; }
.ideal-book-reader-title { display:flex; flex:1; flex-direction:column; min-width:0; gap:4px; }
.ideal-book-reader-title small { overflow:hidden; color:#8c8c8c; font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.ideal-book-reader-title strong { overflow:hidden; font-family:Georgia,"Songti SC",serif; font-size:14px; font-weight:620; text-overflow:ellipsis; white-space:nowrap; }
.ideal-book-reading-scroll { flex:1; overflow:auto; padding:clamp(28px,8vh,70px) 24px 30px; scroll-behavior:smooth; }
.ideal-book-reading-text { max-width:650px; min-height:70vh; margin:0 auto; color:#383838; font-family:Georgia,"Songti SC","Noto Serif CJK SC",serif; line-height:2.05; letter-spacing:.015em; user-select:text; -webkit-user-select:text; }
.ideal-book-app .ideal-book-reading-text,
.ideal-book-app .ideal-book-reading-text * { user-select:text !important; -webkit-user-select:text !important; -webkit-touch-callout:default !important; }
.ideal-book-reader.is-night .ideal-book-reading-text { color:#d3d3d3; }
.ideal-book-reading-text p { margin:0 0 1.45em; text-indent:2em; white-space:normal; overflow-wrap:anywhere; }
.ideal-book-reading-text .ideal-book-no-text { color:#999999; text-align:center; text-indent:0; }
.ideal-book-reading-chapter-nav { display:flex; align-items:center; justify-content:space-between; max-width:650px; margin:34px auto 15px; padding:12px 0; border-top:1px solid rgba(0, 0, 0, .08); color:#999999; font-size:10px; }
.ideal-book-reader.is-night .ideal-book-reading-chapter-nav { border-color:rgba(255, 255, 255, .1); }
.ideal-book-reading-chapter-nav button { padding:8px 12px; border:0; border-radius:999px; background:rgba(0, 0, 0, .05); font-size:10px; }
.ideal-book-reader.is-night .ideal-book-reading-chapter-nav button { background:rgba(255, 255, 255, .08); }
.ideal-book-reading-chapter-nav button:disabled { opacity:.38; }
.ideal-book-reading-toolbar { display:flex; flex:0 0 auto; align-items:center; justify-content:center; gap:10px; padding:10px 14px calc(10px + env(safe-area-inset-bottom)); border-top:1px solid rgba(0, 0, 0, .06); background:rgba(255, 255, 255, .84); -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px); }
.ideal-book-reader.is-night .ideal-book-reading-toolbar { border-color:rgba(255, 255, 255, .08); background:rgba(29, 29, 29, .9); }
.ideal-book-reading-toolbar button { display:flex; align-items:center; gap:6px; min-width:83px; height:39px; padding:0 11px; border:0; border-radius:999px; background:#eeeeee; color:#5e5e5e; font-size:10px; }
.ideal-book-reader.is-night .ideal-book-reading-toolbar button { background:#303030; color:#d0d0d0; }
.ideal-book-reading-toolbar .ideal-book-icon { width:17px; height:17px; }
.ideal-book-sheet-shade { position:absolute; inset:0; z-index:5; display:flex; align-items:flex-end; justify-content:center; background:rgba(22, 22, 22, .22); -webkit-backdrop-filter:blur(5px); backdrop-filter:blur(5px); }
.ideal-book-toc-sheet { width:min(650px,100%); max-height:78%; padding:20px 21px calc(21px + env(safe-area-inset-bottom)); overflow:hidden; border-radius:26px 26px 0 0; background:#fbfbfb; box-shadow:0 -12px 45px rgba(26, 26, 26, .17); }
.ideal-book-toc-sheet > header { display:flex; align-items:center; justify-content:space-between; }
.ideal-book-toc-sheet > header button,.ideal-book-chat-panel > header button { display:grid; place-items:center; width:32px; height:32px; padding:0; border:0; border-radius:50%; background:#ededed; }
.ideal-book-chat-panel > header [data-book-summarize] { width:auto; min-width:58px; height:32px; margin-left:auto; margin-right:7px; padding:0 13px; border:1px solid rgba(0,0,0,.08); border-radius:16px; background:#ededed; color:#333; font-size:12px; font-weight:700; white-space:nowrap; }
.ideal-book-chat-panel > header [data-book-summarize]:disabled { opacity:.62; }
.ideal-book-toc-sheet h2 { margin:12px 0 16px; font-family:Georgia,"Songti SC",serif; font-size:20px; }
.ideal-book-toc-sheet > div { max-height:calc(78vh - 120px); overflow:auto; }
.ideal-book-toc-sheet > div > button { display:flex; align-items:center; gap:13px; width:100%; padding:14px 2px; border:0; border-bottom:1px solid var(--ib-line); background:transparent; text-align:left; }
.ideal-book-toc-sheet > div > button > span { color:#a4a4a4; font-size:10px; font-variant-numeric:tabular-nums; }
.ideal-book-toc-sheet > div > button > b { flex:1; font-size:12px; font-weight:520; }
.ideal-book-toc-sheet > div > button.is-current > b { color:var(--ib-accent); }
.ideal-book-toc-sheet > div > button .ideal-book-icon { width:15px; height:15px; color:#a4a4a4; }
.ideal-book-chat-panel { position:fixed; z-index:8; display:flex; flex-direction:column; width:min(350px,calc(100vw - 24px)); min-height:min(320px,calc(100vh - 24px)); padding:14px 14px 12px; overflow:hidden; border:1px solid rgba(255,255,255,.84); border-radius:21px; background:rgba(250,250,250,.97); box-shadow:0 12px 38px rgba(26,26,26,.2); -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px); }
.ideal-book-chat-panel::after { position:absolute; top:var(--ideal-book-chat-arrow-y,50%); width:0; height:0; margin-top:-9px; border-top:9px solid transparent; border-bottom:9px solid transparent; content:""; }
.ideal-book-chat-panel.is-left::after { right:-9px; border-left:10px solid #fafafa; }
.ideal-book-chat-panel.is-right::after { left:-9px; border-right:10px solid #fafafa; }
.ideal-book-chat-panel > header { display:flex; align-items:center; justify-content:space-between; cursor:grab; touch-action:none; user-select:none; -webkit-user-select:none; }
.ideal-book-chat-panel > header:active { cursor:grabbing; }
.ideal-book-chat-panel h2 { margin:4px 0 0; font-family:Georgia,"Songti SC",serif; font-size:21px; }
.ideal-book-chat-context { display:flex; flex-direction:column; gap:4px; margin-top:15px; padding:12px 13px; border-radius:15px; background:#eeeeee; font-size:10px; }
.ideal-book-chat-context b { font-size:11px; }
.ideal-book-chat-context small { color:var(--ib-muted); }
.ideal-book-role-choice { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:12px; color:#727272; font-size:10px; }
.ideal-book-role-choice select { max-width:55%; padding:7px 10px; border:1px solid var(--ib-line); border-radius:12px; background:white; font-size:10px; }
.ideal-book-no-role,.ideal-book-chat-hint { color:var(--ib-muted); font-size:11px; line-height:1.6; }
.ideal-book-chat-messages { flex:1; min-height:90px; overflow:auto; padding:10px 2px; }
.ideal-book-chat-messages article { max-width:88%; margin:9px 0; }
.ideal-book-chat-messages article.is-user { margin-left:auto; text-align:right; }
.ideal-book-chat-messages article > span { color:#9b9b9b; font-size:9px; }
.ideal-book-chat-messages article > p { display:inline-block; margin:4px 0 0; padding:10px 12px; border-radius:15px 15px 15px 4px; background:#ececec; font-size:11px; line-height:1.55; text-align:left; white-space:pre-wrap; overflow-wrap:anywhere; }
.ideal-book-chat-messages article.is-user > p { border-radius:15px 15px 4px 15px; background:#d9d9d9; }
.ideal-book-chat-typing { display:flex; width:max-content; align-items:center; gap:7px; margin:8px 0; padding:8px 11px; border-radius:14px 14px 14px 4px; background:#ececec; color:#777; font-size:10px; }
.ideal-book-chat-typing b { letter-spacing:2px; animation:ideal-book-typing-pulse 1s ease-in-out infinite; }
@keyframes ideal-book-typing-pulse { 0%,100% { opacity:.35; } 50% { opacity:1; } }
.ideal-book-chat-compose { display:flex; align-items:center; gap:7px; padding-top:10px; border-top:1px solid var(--ib-line); }
.ideal-book-chat-compose input { flex:1; min-width:0; height:40px; padding:0 11px; border:1px solid var(--ib-line); border-radius:13px; outline:none; background:white; font-size:11px; line-height:1; }
.ideal-book-chat-compose button { display:grid; flex:0 0 40px; place-items:center; width:40px; height:40px; padding:0; border:0; border-radius:13px; background:#252525; color:white; }
.ideal-book-chat-compose button.ideal-book-chat-reroll { flex-basis:58px; width:58px; height:40px; background:#eeeeee; color:#333333; font-size:10px; font-weight:650; }
.ideal-book-chat-compose button.ideal-book-chat-send { display:flex; flex:0 0 58px; align-items:center; justify-content:center; gap:4px; width:58px; font-size:9px; font-weight:650; }
.ideal-book-chat-compose button.ideal-book-chat-send .ideal-book-icon { width:15px; height:15px; }
.ideal-book-chat-compose button .ideal-book-icon { width:18px; height:18px; }
.ideal-book-reader.is-night .ideal-book-chat-panel { border-color:rgba(255,255,255,.12); background:rgba(39,39,39,.97); color:#eee; }
.ideal-book-reader.is-night .ideal-book-chat-panel > header [data-book-summarize] { border-color:rgba(255,255,255,.12); background:#505050; color:#fff; }
.ideal-book-reader.is-night .ideal-book-chat-panel.is-left::after { border-left-color:#272727; }
.ideal-book-reader.is-night .ideal-book-chat-panel.is-right::after { border-right-color:#272727; }
.ideal-book-reader.is-night .ideal-book-annotations-panel,.ideal-book-reader.is-night .ideal-book-note-sheet { border-color:rgba(255,255,255,.1); background:rgba(39,39,39,.97); color:#eee; }
.ideal-book-reader.is-night .ideal-book-annotations-panel > header button,.ideal-book-reader.is-night .ideal-book-note-sheet > header button { background:#505050; color:#fff; }
.ideal-book-reader.is-night .ideal-book-annotations-tabs button,.ideal-book-reader.is-night .ideal-book-annotation-item,.ideal-book-reader.is-night .ideal-book-note-sheet textarea,.ideal-book-reader.is-night .ideal-book-note-sheet footer button { border-color:#555; background:#303030; color:#eee; }
.ideal-book-reader.is-night .ideal-book-annotations-tabs button.is-active,.ideal-book-reader.is-night .ideal-book-note-sheet footer button[data-book-note-save] { border-color:#eee; background:#eee; color:#222; }
.ideal-book-reader.is-night .ideal-book-annotations-sources button { border-color:#555; background:#303030; color:#ccc; }
.ideal-book-reader.is-night .ideal-book-annotations-sources button.is-active { border-color:#eee; background:#eee; color:#222; }
.ideal-book-reader.is-night .ideal-book-note-quote { background:#303030; color:#bbb; }
.ideal-book-selection { position:absolute; bottom:80px; left:50%; z-index:3; display:flex; align-items:center; gap:7px; max-width:calc(100% - 28px); padding:6px; transform:translateX(-50%); border:1px solid rgba(255,255,255,.18); border-radius:16px; background:rgba(35,35,35,.94); box-shadow:0 8px 24px rgba(0,0,0,.22); }
.ideal-book-selection[hidden] { display:none; }
.ideal-book-selection button { min-width:58px; padding:8px 12px; border:0; border-radius:10px; background:#fff; color:#222; font-size:11px; font-weight:600; }
.ideal-book-selection button:disabled { opacity:.56; }
.ideal-book-selection small { max-width:150px; color:#ddd; font-size:9px; line-height:1.35; }
.ideal-book-annotations-shade,.ideal-book-note-shade { position:fixed; inset:0; z-index:9; display:flex; align-items:flex-end; justify-content:center; padding:16px; background:rgba(22,22,22,.22); -webkit-backdrop-filter:blur(5px); backdrop-filter:blur(5px); }
.ideal-book-annotations-panel,.ideal-book-note-sheet { width:min(430px,100%); max-height:min(74vh,620px); overflow:auto; padding:18px; border:1px solid rgba(255,255,255,.85); border-radius:24px; background:rgba(250,250,250,.97); box-shadow:0 12px 38px rgba(25,25,25,.2); -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px); }
.ideal-book-annotations-panel { height:min(74vh,620px); max-height:none; overflow:hidden; display:flex; flex-direction:column; }
.ideal-book-annotations-panel > main { min-height:0; flex:1; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.ideal-book-annotations-panel > main::-webkit-scrollbar { display:none; }
.ideal-book-annotations-panel > header,.ideal-book-note-sheet > header { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.ideal-book-annotations-panel > header span { display:block; color:#999; font-size:9px; font-weight:700; letter-spacing:.16em; }
.ideal-book-annotations-panel h2 { margin:4px 0 0; font-size:22px; }
.ideal-book-annotations-panel > header button,.ideal-book-note-sheet > header button { display:grid; place-items:center; width:30px; height:30px; padding:0; border:0; border-radius:50%; background:#ededed; color:#333; font-size:20px; }
.ideal-book-annotations-tabs { display:flex; gap:7px; margin-bottom:12px; padding-bottom:2px; }
.ideal-book-annotations-tabs button { display:flex; align-items:center; gap:5px; padding:8px 12px; border:1px solid #e0e0e0; border-radius:999px; background:#fff; color:#888; font-size:11px; }
.ideal-book-annotations-tabs button small { color:#aaa; font-size:10px; }
.ideal-book-annotations-tabs button.is-active { border-color:#222; background:#222; color:#fff; }
.ideal-book-annotations-tabs button.is-active small { color:#ddd; }
.ideal-book-annotations-sources { display:flex; gap:7px; margin-bottom:10px; }
.ideal-book-annotations-sources button { flex:1; min-width:0; padding:8px 10px; overflow:hidden; border:1px solid #e0e0e0; border-radius:12px; background:#fff; color:#888; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.ideal-book-annotations-sources button.is-active { border-color:#222; background:#222; color:#fff; }
.ideal-book-annotations-sources button:disabled { opacity:.45; }
.ideal-book-annotation-item { display:flex; flex-direction:column; gap:7px; width:100%; margin-top:8px; padding:12px; border:1px solid #e4e4e4; border-radius:15px; background:#fff; color:#222; text-align:left; }
.ideal-book-annotation-item small { color:#999; font-size:10px; }
.ideal-book-annotation-quote,.ideal-book-annotation-note { display:-webkit-box; overflow:hidden; white-space:normal; word-break:break-word; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.ideal-book-annotation-quote { font-size:13px; line-height:1.55; }
.ideal-book-annotation-note { color:#777; font-size:12px; line-height:1.45; }
.ideal-book-annotations-empty { padding:28px 0; color:#999; font-size:12px; text-align:center; }
.ideal-book-annotation-find { display:block; margin-bottom:10px; }
.ideal-book-annotation-find span { display:block; margin-bottom:5px; color:#888; font-size:10px; }
.ideal-book-annotation-find input { width:100%; min-height:38px; padding:8px 12px; border:1px solid #ddd; border-radius:12px; outline:0; background:#fff; color:#222; font-size:12px; }
.ideal-book-annotation-find input:focus { border-color:#777; }
.ideal-book-annotation-group { position:sticky; top:0; z-index:1; margin:18px 3px 6px; padding:6px 3px; background:rgba(250,250,250,.96); color:#555; font-size:11px; font-weight:700; }
.ideal-book-annotation-chapter { margin:8px 0; }
.ideal-book-annotation-chapter[hidden] { display:none !important; }
.ideal-book-annotation-chapter-toggle { display:flex; align-items:center; gap:8px; width:100%; min-height:42px; padding:7px 8px; border:0; border-bottom:1px solid rgba(0,0,0,.08); background:transparent; color:#444; text-align:left; }
.ideal-book-annotation-chapter-toggle > span { flex:1; font-size:12px; font-weight:700; }
.ideal-book-annotation-chapter-toggle > small { color:#999; font-size:10px; }
.ideal-book-annotation-chapter-toggle > i { display:grid; flex:0 0 18px; width:18px; height:18px; place-items:center; color:#888; font-style:normal; }
.ideal-book-annotation-chapter-toggle > i::before { width:7px; height:7px; border-right:1.75px solid currentColor; border-bottom:1.75px solid currentColor; content:""; transform:translateY(-1.5px) rotate(45deg); transition:transform .16s ease; }
.ideal-book-annotation-chapter.is-expanded .ideal-book-annotation-chapter-toggle > i::before { transform:translateY(1.5px) rotate(225deg); }
.ideal-book-annotation-chapter-body { padding:0 0 4px; }
.ideal-book-annotation-chapter-body[hidden] { display:none !important; }
.ideal-book-annotation-group[hidden],.ideal-book-annotation-item[hidden],.ideal-book-annotations-empty[hidden] { display:none !important; }
.ideal-book-annotation-item { padding:0; overflow:hidden; }
.ideal-book-annotation-open { display:flex; flex-direction:column; gap:7px; width:100%; padding:12px; border:0; background:transparent; color:inherit; text-align:left; }
.ideal-book-annotation-open strong { font-size:13px; }
.ideal-book-annotation-actions { display:flex; flex-wrap:wrap; gap:6px; padding:0 10px 10px; }
.ideal-book-annotation-actions button { padding:6px 10px; border:1px solid #ddd; border-radius:9px; background:#f5f5f5; color:#555; font-size:10px; }
.ideal-book-annotation-actions button[data-book-annotation-view] { border-color:#222; background:#222; color:#fff; }
.ideal-book-bookmark-row { display:flex; align-items:center; width:100%; min-width:0; }
.ideal-book-bookmark-row .ideal-book-annotation-open { flex:1 1 auto; width:auto; min-width:0; }
.ideal-book-bookmark-row .ideal-book-annotation-actions { flex:0 0 auto; padding:0 10px 0 0; }
.ideal-book-note-sheet input[data-book-annotation-title] { display:block; width:100%; min-height:42px; padding:10px 12px; border:1px solid #dedee2; border-radius:12px; outline:0; background:#fff; color:#222; font:inherit; font-size:13px; }
.ideal-book-repair-sheet > p:not(.ideal-book-note-quote) { margin:0 0 12px; color:#777; font-size:12px; line-height:1.5; }
.ideal-book-repair-list { display:grid; gap:8px; max-height:38vh; overflow:auto; }
.ideal-book-repair-list button { display:grid; gap:5px; width:100%; padding:10px; border:1px solid #ddd; border-radius:12px; background:#fff; color:#222; text-align:left; }
.ideal-book-repair-list small { color:#888; font-size:10px; }
.ideal-book-repair-list span { display:-webkit-box; overflow:hidden; font-size:12px; line-height:1.5; -webkit-line-clamp:3; -webkit-box-orient:vertical; }
.ideal-book-undo { position:fixed; left:50%; bottom:calc(92px + env(safe-area-inset-bottom)); z-index:15; display:flex; align-items:center; gap:20px; padding:11px 14px; transform:translateX(-50%); border-radius:14px; background:#222; color:#fff; box-shadow:0 8px 24px rgba(0,0,0,.24); font-size:12px; white-space:nowrap; }
.ideal-book-undo button { padding:4px 0; border:0; background:transparent; color:#fff; font-size:12px; font-weight:700; }
.ideal-book-chat-messages article button[data-book-chat-source] { margin-top:5px; padding:3px 0; border:0; background:transparent; color:#777; font-size:10px; text-decoration:underline; }
.ideal-book-reader.is-night .ideal-book-annotation-find input,.ideal-book-reader.is-night .ideal-book-annotation-actions button,.ideal-book-reader.is-night .ideal-book-note-sheet input[data-book-annotation-title],.ideal-book-reader.is-night .ideal-book-repair-list button { border-color:#555; background:#303030; color:#eee; }
.ideal-book-reader.is-night .ideal-book-annotation-group { background:rgba(39,39,39,.97); color:#ddd; }
.ideal-book-reader.is-night .ideal-book-annotation-chapter-toggle { border-bottom-color:rgba(255,255,255,.12); color:#eee; }
.ideal-book-reader.is-night .ideal-book-annotation-actions button[data-book-annotation-view] { border-color:#111; background:#111; color:#fff; }
.ideal-book-reader.is-night .ideal-book-annotation-detail-note { color:#ccc; }
.ideal-book-note-sheet > header strong { font-size:18px; }
.ideal-book-note-quote { max-height:130px; margin:0 0 12px; overflow:auto; padding:11px 12px; border-radius:13px; background:#f1f1f3; color:#666; font-size:12px; line-height:1.5; white-space:pre-wrap; }
.ideal-book-annotation-detail > small { display:block; margin:0 0 10px; color:#999; font-size:10px; }
.ideal-book-annotation-detail .ideal-book-note-quote { max-height:min(46vh,360px); margin-bottom:10px; }
.ideal-book-annotation-detail-note { max-height:min(32vh,240px); overflow:auto; color:#555; font-size:13px; line-height:1.65; white-space:pre-wrap; word-break:break-word; }
.ideal-book-note-sheet textarea { display:block; width:100%; min-height:120px; resize:vertical; padding:12px; border:1px solid #dedee2; border-radius:14px; outline:0; background:#fff; color:#222; font:inherit; font-size:13px; }
.ideal-book-note-sheet footer { display:flex; gap:9px; margin-top:12px; }
.ideal-book-note-sheet footer button { flex:1; min-height:40px; border:1px solid #dedee2; border-radius:12px; background:#fff; color:#333; font-size:12px; font-weight:650; }
.ideal-book-note-sheet footer button[data-book-note-save] { border-color:#222; background:#222; color:#fff; }
.ideal-book-setting-checks { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:center; gap:7px; min-height:52px; border-top:1px solid rgba(0,0,0,.07); color:#777; font-size:11px; }
.ideal-book-setting-checks > span { grid-column:1 / -1; padding-top:8px; color:#222; font-size:12px; font-weight:600; }
.ideal-book-setting-checks label { display:flex; align-items:center; justify-content:center; gap:4px; min-width:0; padding-bottom:8px; color:#222; font-size:12px; font-weight:600; white-space:nowrap; }
.ideal-book-setting-checks input { accent-color:#222; }
.ideal-book-setting-switch:has(input[data-book-setting="proactiveAnnotation"]:not(:checked)) ~ .ideal-book-setting-chance,
.ideal-book-setting-switch:has(input[data-book-setting="proactiveAnnotation"]:not(:checked)) ~ .ideal-book-setting-checks { display:none; }
.ideal-book-setting-switch:has(input[data-book-setting="searchEnabled"]:not(:checked)) ~ .ideal-book-setting-select,
.ideal-book-setting-switch:has(input[data-book-setting="searchEnabled"]:not(:checked)) ~ .ideal-book-setting-number,
.ideal-book-setting-switch:has(input[data-book-setting="autoSummary"]:not(:checked)) ~ .ideal-book-setting-select { display:none; }
.ideal-book-reading-text [data-book-paragraph-index] { transition:background .2s ease,box-shadow .2s ease; }
.ideal-book-reading-text [data-book-paragraph-index].is-annotation-highlight { border-radius:9px; background:rgba(130,130,130,.24); box-shadow:0 0 0 6px rgba(130,130,130,.12); }
.ideal-book-goal-shade { position:absolute; inset:0; z-index:8; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(20,20,20,.24); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
.ideal-book-goal-sheet { width:min(100%,360px); padding:22px; border:1px solid rgba(255,255,255,.78); border-radius:24px; background:rgba(250,250,250,.96); box-shadow:0 18px 55px rgba(20,20,20,.22); }
.ideal-book-goal-sheet > header { display:flex; align-items:flex-start; justify-content:space-between; }
.ideal-book-goal-sheet > header span { color:#999; font-size:9px; font-weight:700; letter-spacing:.16em; }
.ideal-book-goal-sheet h2 { margin:5px 0 0; font-size:22px; letter-spacing:-.04em; }
.ideal-book-goal-sheet > header button { display:grid; place-items:center; width:30px; height:30px; padding:0; border:0; border-radius:50%; background:#ededed; color:#555; font-size:20px; line-height:1; }
.ideal-book-goal-sheet > label { display:grid; gap:8px; margin-top:24px; color:#777; font-size:11px; }
.ideal-book-goal-sheet input { width:100%; height:44px; padding:0 13px; border:1px solid rgba(0,0,0,.12); border-radius:13px; outline:none; background:#fff; color:#222; font-size:16px; }
.ideal-book-goal-sheet input:focus { border-color:#333; box-shadow:0 0 0 3px rgba(0,0,0,.08); }
.ideal-book-goal-sheet input.is-invalid { border-color:#a33; box-shadow:0 0 0 3px rgba(170,50,50,.1); }
.ideal-book-goal-sheet > p { min-height:17px; margin:9px 0 0; color:#999; font-size:10px; line-height:1.5; }
.ideal-book-goal-sheet > footer { display:flex; gap:9px; margin-top:20px; }
.ideal-book-goal-sheet > footer button { flex:1; height:40px; border:1px solid rgba(0,0,0,.11); border-radius:12px; background:#fff; color:#444; font-size:12px; }
.ideal-book-goal-sheet > footer button[data-book-goal-save] { border-color:#222; background:#222; color:#fff; }
.ideal-book-settings-page { padding-bottom:calc(112px + env(safe-area-inset-bottom)); }
.ideal-book-settings-header { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:22px; }
.ideal-book-settings-header > div > span,.ideal-book-settings-section header span { color:#999; font-size:9px; font-weight:700; letter-spacing:.16em; }
.ideal-book-settings-header h1 { margin:5px 0 0; font-size:29px; letter-spacing:-.055em; }
.ideal-book-settings-header p { margin:7px 0 0; color:#898989; font-size:11px; }
.ideal-book-settings-header > button { display:grid; place-items:center; width:35px; height:35px; border:0; border-radius:50%; background:#ededed; color:#444; font-size:21px; }
.ideal-book-settings-section { margin:0 auto 14px; padding:17px 16px 7px; border:1px solid rgba(0,0,0,.08); border-radius:18px; background:rgba(255,255,255,.58); }
.ideal-book-settings-section > header { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:10px; }
.ideal-book-settings-section > header h2 { margin:5px 0 0; font-size:17px; letter-spacing:-.035em; }
.ideal-book-settings-section > header small { color:#999; font-size:9px; text-align:right; }
.ideal-book-setting-switch,.ideal-book-setting-range,.ideal-book-setting-select,.ideal-book-setting-number { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:52px; border-top:1px solid rgba(0,0,0,.07); }
.ideal-book-setting-switch > span { display:grid; gap:4px; min-width:0; }
.ideal-book-setting-switch b { font-size:12px; font-weight:600; }
.ideal-book-setting-switch small { display:block; max-width:100%; overflow:hidden; color:#999; font-size:clamp(7px,calc((100vw - 88px) * .0294),10px); line-height:1.4; letter-spacing:-.035em; white-space:nowrap; text-overflow:clip; }
.ideal-book-setting-switch input { position:absolute; opacity:0; pointer-events:none; }
.ideal-book-setting-switch i { position:relative; flex:0 0 42px; width:42px; height:25px; border-radius:99px; background:#d3d3d3; transition:background .16s ease; }
.ideal-book-setting-switch i::after { position:absolute; top:3px; left:3px; width:19px; height:19px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.18); content:""; transition:transform .16s ease; }
.ideal-book-setting-switch input:checked + i { background:#222; }
.ideal-book-setting-switch input:checked + i::after { transform:translateX(17px); }
.ideal-book-setting-range { display:grid; gap:7px; padding:12px 0; }
.ideal-book-setting-range > span { display:flex; justify-content:space-between; color:#555; font-size:11px; }
.ideal-book-setting-range output { color:#888; font-variant-numeric:tabular-nums; }
.ideal-book-setting-range input { width:100%; accent-color:#222; }
.ideal-book-setting-chance { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:52px; border-top:1px solid rgba(0,0,0,.07); color:#222; font-size:12px; font-weight:600; }
.ideal-book-setting-chance > div { display:flex; align-items:center; gap:5px; }
.ideal-book-setting-chance input { width:76px; height:34px; padding:0 8px; border:1px solid rgba(0,0,0,.11); border-radius:10px; outline:none; background:#fff; color:#333; font-size:12px; text-align:center; }
.ideal-book-setting-chance input:focus { border-color:#333; box-shadow:0 0 0 3px rgba(0,0,0,.07); }
.ideal-book-setting-chance em { color:#999; font-style:normal; }
.ideal-book-setting-select,.ideal-book-setting-number { color:#555; font-size:11px; }
.ideal-book-setting-select select,.ideal-book-setting-number input { width:52%; min-height:34px; padding:0 10px; border:1px solid rgba(0,0,0,.11); border-radius:10px; outline:none; background:#fff; color:#333; font-size:11px; }
.ideal-book-setting-number { justify-content:flex-start; }
.ideal-book-setting-number span { flex:1; }
.ideal-book-setting-number input { width:76px; text-align:center; }
.ideal-book-setting-number em { color:#999; font-style:normal; }
.ideal-book-settings-note { display:none; }

/* 阅读工具在展开时使用与聊天阅读页一致的悬浮 Dock；收起后保留单个圆形入口。 */
.ideal-book-reading-dock { position:fixed; right:20px; bottom:calc(22px + env(safe-area-inset-bottom)); z-index:4; }
.ideal-book-reading-dock-toggle { display:grid; place-items:center; width:48px; height:48px; padding:0 0 4px; border:1px solid rgba(255, 255, 255, .22); border-radius:50%; background:#202020; color:#ffffff !important; font-size:22px !important; line-height:1; box-shadow:0 8px 24px rgba(0, 0, 0, .22); touch-action:none; cursor:grab; }
.ideal-book-reading-dock-toggle:active { cursor:grabbing; }
.ideal-book-reading-dock.is-open { right:50%; bottom:calc(14px + env(safe-area-inset-bottom)); width:min(560px,calc(100% - 28px)); height:66px; transform:translateX(50%); border:1px solid rgba(255, 255, 255, .76); border-radius:25px; background:rgba(250, 250, 250, .88); box-shadow:0 10px 35px rgba(30, 30, 30, .15); -webkit-backdrop-filter:blur(22px) saturate(145%); backdrop-filter:blur(22px) saturate(145%); }
.ideal-book-reading-dock-bar { display:flex; align-items:center; justify-content:space-around; width:100%; height:100%; padding:6px 9px; }
.ideal-book-reading-dock-bar button { display:flex; flex:1; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-width:0; height:52px; padding:3px 2px; border:0; border-radius:17px; background:transparent; color:#777777; }
.ideal-book-reading-dock-bar button:active { color:#171717; }
.ideal-book-reading-dock-bar .ideal-book-icon { width:22px; height:22px; }
.ideal-book-reading-dock-bar button span { font-size:9px; font-weight:600; line-height:1; }
.ideal-book-font-panel { position:fixed; right:50%; bottom:calc(92px + env(safe-area-inset-bottom)); z-index:6; width:min(370px,calc(100% - 32px)); padding:15px 16px 13px; transform:translateX(50%); border:1px solid rgba(255,255,255,.8); border-radius:21px; background:rgba(250,250,250,.96); box-shadow:0 12px 38px rgba(25,25,25,.17); -webkit-backdrop-filter:blur(20px); backdrop-filter:blur(20px); }
.ideal-book-font-panel > header { display:flex; align-items:center; justify-content:space-between; margin-bottom:13px; }
.ideal-book-font-panel > header strong { font-size:13px; }
.ideal-book-font-panel > header button { display:grid; place-items:center; width:28px; height:28px; border:0; border-radius:50%; background:#ededed; font-size:18px; }
.ideal-book-font-size { display:flex; align-items:center; gap:9px; }
.ideal-book-font-size > button { flex:0 0 auto; padding:4px; border:0; background:transparent; font-size:13px; font-weight:650; }
.ideal-book-font-size input { flex:1; min-width:60px; accent-color:#292929; }
.ideal-book-font-size output { min-width:35px; color:#777; font-size:10px; text-align:right; }
.ideal-book-font-family-label { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:13px; color:#555; font-size:11px; }
.ideal-book-font-family-label select { width:72%; padding:8px 10px; border:1px solid rgba(0,0,0,.1); border-radius:11px; background:#fff; color:#333; font-size:11px; }
.ideal-book-font-import { position:relative; display:flex; align-items:center; gap:8px; margin-top:11px; padding:10px 11px; border:1px solid rgba(0,0,0,.08); border-radius:12px; background:#f0f0f0; color:#333; font-size:11px; font-weight:600; cursor:pointer; }
.ideal-book-font-import .ideal-book-icon { width:16px; height:16px; }
.ideal-book-font-import input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.ideal-book-font-panel > small { display:block; margin-top:8px; color:#929292; font-size:9px; }
.ideal-book-role-chat-fab { position:fixed; z-index:6; display:grid; place-items:center; width:53px; height:53px; padding:0; transform:translate(-50%,-50%); border:2px solid rgba(255,255,255,.92); border-radius:50%; background:#e7e7e7; box-shadow:0 7px 22px rgba(0,0,0,.19); touch-action:none; cursor:grab; }
.ideal-book-role-chat-fab:active { cursor:grabbing; }
.ideal-book-role-chat-fab > img,.ideal-book-role-chat-fab > span { display:grid; place-items:center; width:100%; height:100%; overflow:hidden; border-radius:inherit; color:#454545; font-size:18px; font-weight:650; object-fit:cover; }
.ideal-book-role-chat-fab > i { position:absolute; right:-3px; bottom:-3px; display:grid; place-items:center; width:19px; height:19px; border:2px solid #fff; border-radius:50%; background:#272727; color:#fff; font-size:9px; font-style:normal; }
.ideal-book-reader.is-night .ideal-book-font-panel { border-color:rgba(255,255,255,.1); background:rgba(39,39,39,.97); color:#eee; }
.ideal-book-reader.is-night .ideal-book-font-family-label { color:#ccc; }
.ideal-book-reader.is-night .ideal-book-font-family-label select { border-color:rgba(255,255,255,.12); background:#303030; color:#eee; }
.ideal-book-reader.is-night .ideal-book-font-import { border-color:rgba(255,255,255,.1); background:#303030; color:#eee; }
.ideal-book-reader.is-night .ideal-book-font-size input { accent-color:#eee; }
.ideal-book-reader.is-night .ideal-book-reading-dock.is-open { border-color:rgba(255, 255, 255, .1); background:rgba(39, 39, 39, .9); }
.ideal-book-reader.is-night .ideal-book-reading-dock-bar button { color:#bdbdbd; }
.ideal-book-reader.is-night .ideal-book-reading-dock-toggle { border-color:rgba(255, 255, 255, .18); background:#eeeeee; color:#202020 !important; }
@media (min-width:760px) {
  .ideal-book-page { padding-right:max(36px,calc((100vw - 880px)/2)); padding-left:max(36px,calc((100vw - 880px)/2)); }
  .ideal-book-feature { max-width:750px; }
  .ideal-book-row { max-width:850px; }
  .ideal-book-welcome { max-width:750px; }
}
@media (max-width:420px) {
  .ideal-book-page { padding-right:19px; padding-left:19px; }
  .ideal-book-row { margin-right:-19px; padding-right:19px; }
  .ideal-book-feature { gap:14px; min-height:171px; padding:16px; }
  .ideal-book-feature .ideal-book-cover { width:78px; height:111px; }
  .ideal-book-feature-copy > strong { font-size:17px; }
  .ideal-book-dock { bottom:calc(12px + env(safe-area-inset-bottom)); }
}

/* 主页和书架采用阅读阶梯式的目标环、周历与留白书库布局；全部使用理想机自有组件名。 */
.ideal-book-page { padding:calc(24px + env(safe-area-inset-top)) 27px calc(114px + env(safe-area-inset-bottom)); }
.ideal-book-topbar { align-items:flex-start; min-height:48px; margin-bottom:17px; }
.ideal-book-topbar h1 { margin:0; font-size:26px; font-weight:680; letter-spacing:-.055em; }
.ideal-book-topbar p { max-width:min(70vw,430px); margin:5px 0 0; overflow:hidden; color:#7f7f7f; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.ideal-book-goal { display:flex; flex-direction:column; align-items:center; max-width:440px; margin:34px auto 0; text-align:center; }
.ideal-book-goal-heading { display:flex; align-items:center; justify-content:center; gap:15px; }
.ideal-book-goal-heading h2 { margin:0; font-size:17px; font-weight:660; letter-spacing:-.03em; }
.ideal-book-goal-heading small { display:block; margin-top:3px; color:#a5a5a5; font-size:9px; }
.ideal-book-goal-heading > button { padding:4px 8px; border:0; background:transparent; color:#959595; font-size:10px; }
.ideal-book-goal > p { margin:10px 0 14px; color:#868686; font-size:11px; }
.ideal-book-goal-ring { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; width:212px; height:212px; border:8px solid transparent; border-radius:50%; background:linear-gradient(#ffffff,#ffffff) padding-box,conic-gradient(#9c9c9c var(--im-goal-progress),#e4e4e4 0) border-box; box-shadow:0 7px 24px rgba(42, 42, 42, .06); }
.ideal-book-goal-ring strong { font-size:45px; font-weight:710; font-variant-numeric:tabular-nums; letter-spacing:-.075em; line-height:1; }
.ideal-book-goal-ring span { margin-top:8px; color:#737373; font-size:11px; }
.ideal-book-goal-ring small { margin-top:4px; color:#898989; font-size:9px; }
.ideal-book-explore { width:min(345px,100%); min-height:45px; margin-top:20px; border:0; border-radius:999px; background:#1a1a1a; color:#ffffff !important; font-size:12px; font-weight:650; box-shadow:0 6px 14px rgba(26, 26, 26, .12); }
.ideal-book-resume-link { display:flex; align-items:center; gap:3px; margin-top:9px; padding:3px 8px; border:0; background:transparent; color:#7e7e7e; font-size:10px; }
.ideal-book-resume-link .ideal-book-icon { width:13px; height:13px; }
.ideal-book-week { max-width:900px; margin:25px auto 0; }
.ideal-book-week-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:11px; color:#a4a4a4; font-size:10px; }
.ideal-book-week-heading small { font-size:9px; }
.ideal-book-week-strip { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); align-items:start; gap:6px; }
.ideal-book-week-day { display:flex; flex-direction:column; align-items:center; gap:5px; color:#9c9c9c; }
.ideal-book-week-day span { font-size:8px; }
.ideal-book-week-day b { display:grid; place-items:center; width:39px; height:39px; border:1px solid rgba(43, 43, 43, .08); border-radius:50%; background:#f2f2f2; color:#333333; font-size:11px; font-weight:550; }
.ideal-book-week-day.is-today b { border:2px solid rgba(151, 151, 151, .42); background:#ffffff; }
.ideal-book-week-day.has-reading b { box-shadow:inset 0 -3px #9a9a9a; }
.ideal-book-week-day i { min-height:7px; color:#929292; font-size:15px; font-style:normal; line-height:6px; }
.ideal-book-week > p { margin:5px 0 0; color:#a4a4a4; font-size:9px; text-align:center; }
.ideal-book-home-shelf { max-width:930px; margin:28px auto 0; }
.ideal-book-section-heading { align-items:center; margin-bottom:12px; }
.ideal-book-section-heading > div > span { display:none; }
.ideal-book-section-heading h2 { margin:0; font-size:15px; font-weight:650; }
.ideal-book-library-actions { display:flex; align-items:center; gap:9px; }
.ideal-book-library-actions > button { display:flex; align-items:center; gap:2px; padding:5px 0; border:0; background:transparent; color:#919191; font-size:10px; }
.ideal-book-library-actions > button .ideal-book-icon { width:13px; height:13px; }
.ideal-book-home-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(90px,1fr)); align-items:start; gap:18px 14px; }
.ideal-book-home-grid .ideal-book-tile { flex:initial; }
.ideal-book-home-grid .ideal-book-cover { width:100%; height:auto; aspect-ratio:.70; }
.ideal-book-home-grid .ideal-book-tile-title { font-size:10px; }
.ideal-book-home-grid .ideal-book-tile small { font-size:8px; }
.ideal-book-home-grid .ideal-book-progress { margin-top:6px; }
.ideal-book-add-card { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; min-height:145px; border:1px dashed rgba(80, 80, 80, .13); border-radius:18px; background:rgba(255, 255, 255, .54); color:#929292; }
.ideal-book-add-card > span { display:grid; place-items:center; width:39px; height:39px; border-radius:50%; background:#f3f3f3; color:#999999; }
.ideal-book-add-card > span .ideal-book-icon { width:21px; height:21px; }
.ideal-book-add-card > small { font-size:9px; }
.ideal-book-add-card.is-inline { width:100%; max-width:140px; min-height:118px; margin-top:21px; }
.ideal-book-add-card.is-empty { width:min(520px,100%); min-height:250px; border:1px solid rgba(50, 50, 50, .08); background:#ffffff; }
.ideal-book-invite { max-width:930px; margin:25px auto 0; background:rgba(255, 255, 255, .58); }
.ideal-book-invite > span { background:#eaeaea; color:#8c8c8c; }
.ideal-book-library .ideal-book-topbar { margin-bottom:18px; }
.ideal-book-library-meta { margin:-1px 0 20px; }
.ideal-book-grid { grid-template-columns:repeat(auto-fill,minmax(100px,1fr)); max-width:930px; gap:25px 16px; }
.ideal-book-grid .ideal-book-cover { border-radius:5px 10px 10px 5px; }
.ideal-book-empty-library { margin-top:8px; padding:8px 0; }
.ideal-book-empty-library > div { display:none; }
.ideal-book-empty-library h2 { margin-top:0; color:#313131; font-size:16px; }
.ideal-book-empty-library p { margin:7px 0 16px; }
.ideal-book-dock { min-height:64px; gap:5px; padding:6px; border-color:rgba(255, 255, 255, .84); background:rgba(255, 255, 255, .87); }
.ideal-book-dock button { width:76px; height:50px; gap:2px; }
.ideal-book-dock button.is-active { background:#ffffff; box-shadow:0 4px 13px rgba(32, 32, 32, .08); }
.ideal-book-dock img { width:20px; height:20px; }
.ideal-book-dock span { font-size:8px; }
@media (max-width:520px) {
  .ideal-book-page { padding-right:19px; padding-left:19px; }
  .ideal-book-goal { margin-top:27px; }
  .ideal-book-goal-ring { width:194px; height:194px; }
  .ideal-book-goal-ring strong { font-size:41px; }
  .ideal-book-week { margin-top:23px; }
  .ideal-book-week-strip { gap:2px; }
  .ideal-book-week-day b { width:35px; height:35px; }
  .ideal-book-home-shelf { margin-top:25px; }
  .ideal-book-home-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:17px 12px; }
  .ideal-book-home-grid .ideal-book-add-card { min-height:140px; }
  .ideal-book-dock { bottom:calc(13px + env(safe-area-inset-bottom)); }
}

/* 图书 Dock 沿用聊天首页的通透长胶囊与圆形图标布局。 */
.ideal-book-dock {
  right:12px; bottom:max(24px,env(safe-area-inset-bottom)); left:12px;
  justify-content:space-around; height:64px; min-height:64px; padding:7px 14px;
  transform:none; border-color:rgba(255,255,255,.58); border-radius:32px;
  background:rgba(255,255,255,.42); box-shadow:0 4px 14px rgba(25,25,25,.06),inset 0 1px 0 rgba(255,255,255,.58);
  -webkit-backdrop-filter:blur(20px) saturate(125%); backdrop-filter:blur(20px) saturate(125%);
}
.ideal-book-dock button,.ideal-book-dock button.is-active {
  display:grid; place-items:center; width:48px; min-width:48px; height:48px; padding:0;
  border-radius:50%; background:transparent; box-shadow:none; color:#777;
}
.ideal-book-dock button.is-active { color:#111; }
.ideal-book-dock img { width:30px; height:30px; filter:none; opacity:.48; }
.ideal-book-dock .ideal-book-icon { display:block; width:30px; height:30px; color:#888; opacity:1; fill:currentColor; stroke:none; }
.ideal-book-dock button.is-active img { filter:none; opacity:1; }
.ideal-book-dock button.is-active .ideal-book-icon { color:#000; opacity:1; }
.ideal-book-dock span { display:none; }
.ideal-book-summary-card p { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.75; }
.ideal-book-summary-card small { color:#888; }
.ideal-book-chat-summary-status { margin:0; padding:8px 14px; font-size:12px; color:#666; }
@media (max-width:520px) { .ideal-book-dock { bottom:max(24px,env(safe-area-inset-bottom)); } }

/* 首页按参考图的阅读顺序呈现：继续阅读、读过的书、目标和年度书单。 */
.ideal-book-home { padding-top:calc(25px + env(safe-area-inset-top)); }
.ideal-book-home .ideal-book-topbar { align-items:center; min-height:58px; margin-bottom:22px; }
.ideal-book-home .ideal-book-topbar h1 { font-size:31px; }
.ideal-book-home-actions { display:flex; align-items:center; gap:13px; }
.ideal-book-quick-goal { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; width:45px; height:48px; padding:0; border:0; background:transparent; color:#111; }
.ideal-book-quick-goal i { display:grid; place-items:center; width:31px; height:31px; border:3px solid transparent; border-radius:50%; background:linear-gradient(#fff,#fff) padding-box,conic-gradient(#111 var(--im-quick-progress),#e7e7eb 0) border-box; font-style:normal; }
.ideal-book-quick-goal i b { font-size:10px; font-weight:650; }
.ideal-book-quick-goal small { font-size:8px; font-weight:650; }
.ideal-book-home-close { width:34px; height:34px; padding:0; border:0; border-radius:50%; background:#f0f0f0; color:#333; font-size:22px; line-height:1; }
.ideal-book-home-section { max-width:930px; margin:0 auto 30px; }
.ideal-book-home-section > h2 { display:flex; align-items:center; gap:3px; margin:0 0 14px; font-size:20px; font-weight:680; letter-spacing:-.04em; }
.ideal-book-home-section > h2 .ideal-book-icon { width:17px; height:17px; color:#999; }
.ideal-book-feature-row,.ideal-book-previous-row,.ideal-book-year-row { display:flex; gap:16px; overflow-x:auto; margin-right:-19px; padding:2px 19px 11px 0; scrollbar-width:none; }
.ideal-book-feature-row::-webkit-scrollbar,.ideal-book-previous-row::-webkit-scrollbar,.ideal-book-year-row::-webkit-scrollbar { display:none; }
.ideal-book-feature-row .ideal-book-feature { flex:0 0 min(82vw,580px); min-height:160px; padding:17px; border:0; border-radius:19px; background:linear-gradient(130deg,#242424,#555 66%,#393939); color:#fff; box-shadow:0 9px 22px rgba(0,0,0,.10); }
.ideal-book-feature-row .ideal-book-cover { width:75px; height:108px; }
.ideal-book-feature-copy > small,.ideal-book-feature-copy > strong,.ideal-book-feature-copy > i,.ideal-book-feature-progress { color:#fff; }
.ideal-book-feature-copy > small,.ideal-book-feature-copy > i { opacity:.72; }
.ideal-book-feature-progress { margin-top:10px; }
.ideal-book-feature-progress b { background:rgba(255,255,255,.34); }
.ideal-book-feature-progress em { background:#fff; }
.ideal-book-feature-empty { justify-content:center; background:#262626; }
.ideal-book-previous-row { gap:13px; }
.ideal-book-previous-card { position:relative; display:flex; flex:0 0 min(74vw,430px); align-items:center; gap:14px; min-height:128px; padding:13px; border:1px solid #f0f0f0; border-radius:18px; background:#fff; text-align:left; box-shadow:0 4px 16px rgba(0,0,0,.055); }
.ideal-book-previous-card .ideal-book-cover { width:62px; height:94px; border-radius:4px 7px 7px 4px; }
.ideal-book-previous-card > span { display:flex; flex:1; flex-direction:column; min-width:0; gap:5px; }
.ideal-book-previous-card strong,.ideal-book-previous-card small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ideal-book-previous-card strong { font-size:13px; }
.ideal-book-previous-card small,.ideal-book-previous-card i { color:#888; font-size:10px; font-style:normal; }
.ideal-book-previous-card > b { align-self:center; color:#888; font-size:19px; letter-spacing:2px; }
.ideal-book-previous-empty { display:flex; align-items:center; gap:5px; min-height:80px; padding:0; border:0; background:transparent; color:#999; font-size:11px; }
.ideal-book-previous-empty .ideal-book-icon { width:14px; height:14px; }
.ideal-book-home .ideal-book-goal { max-width:600px; margin:44px auto 42px; }
.ideal-book-home .ideal-book-goal > h2 { margin:0; font-size:22px; font-weight:700; }
.ideal-book-home .ideal-book-goal > p { max-width:390px; margin:9px 0 12px; color:#929292; font-size:12px; line-height:1.55; }
.ideal-book-home .ideal-book-goal-ring { display:flex; width:min(100%,370px); height:220px; margin-top:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
.ideal-book-home .ideal-book-goal-ring > svg { position:absolute; inset:0; width:100%; height:200px; overflow:visible; }
.ideal-book-goal-track,.ideal-book-goal-progress { fill:none; stroke-width:9; stroke-linecap:round; }
.ideal-book-goal-track { stroke:#f0f0f4; }
.ideal-book-goal-progress { stroke:#222; }
.ideal-book-home .ideal-book-goal-ring strong { position:absolute; top:83px; font-size:62px; font-weight:450; letter-spacing:-.07em; }
.ideal-book-home .ideal-book-goal-ring > span { position:absolute; top:155px; display:flex; align-items:center; color:#222; font-size:13px; }
.ideal-book-home .ideal-book-goal-ring > span .ideal-book-icon { width:15px; height:15px; color:#aaa; }
.ideal-book-home .ideal-book-explore { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; width:min(100%,345px); min-height:64px; margin:10px 0 24px; border-radius:999px; background:#050505; font-size:16px; box-shadow:none; }
.ideal-book-home .ideal-book-explore small { color:#ccc; font-size:12px; font-weight:450; }
.ideal-book-home .ideal-book-week-strip { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); width:min(100%,520px); gap:10px; margin-top:9px; }
.ideal-book-home .ideal-book-week-day { justify-content:center; }
.ideal-book-home .ideal-book-week-day b { position:relative; width:46px; height:46px; border:2px solid transparent; border-radius:50%; background:#d0d0d0; color:#fff; font-size:12px; font-weight:600; }
.ideal-book-home .ideal-book-week-day.is-today b { border-color:#111; background:#fff; color:#111; }
.ideal-book-home .ideal-book-week-day.has-reading:not(.is-today) b { background:#a8a8a8; color:#fff; }
.ideal-book-home .ideal-book-week-day.is-complete b { background:#222; border-color:#222; color:#fff; box-shadow:none; }
.ideal-book-home .ideal-book-week-day.is-complete b::before { position:absolute; top:-8px; right:-8px; z-index:1; width:18px; height:18px; border:2px solid #fff; border-radius:50%; background:#222; content:''; }
.ideal-book-home .ideal-book-week-day.is-complete b::after { position:absolute; top:-3px; right:-2px; z-index:2; width:5px; height:8px; border:solid #fff; border-width:0 2px 2px 0; border-radius:1px; background:transparent; content:''; transform:rotate(45deg); }
.ideal-book-streak-link { display:flex; flex-direction:column; align-items:center; gap:3px; margin-top:20px; padding:0; border:0; background:transparent; color:#222; font-size:14px; }
.ideal-book-streak-link > .ideal-book-icon { display:none; }
.ideal-book-streak-link small { color:#999; font-size:12px; }
.ideal-book-year-section { margin-top:35px; padding-top:26px; border-top:1px solid #dedede; }
.ideal-book-year-section > h2 { justify-content:center; margin-bottom:20px; }
.ideal-book-year-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; overflow:visible; margin:0; padding:0; }
.ideal-book-year-card { position:relative; display:flex; flex-direction:column; align-items:center; min-width:0; padding:0; border:0; background:transparent; }
.ideal-book-year-card .ideal-book-cover { width:100%; aspect-ratio:.7; height:auto; border:0; border-radius:7px; background:linear-gradient(145deg,#f4f4f7,#e5e5e9); box-shadow:none; }
.ideal-book-year-card .ideal-book-cover::after { display:none; }
.ideal-book-year-card > span { position:absolute; top:48%; color:#aaa; font-size:50px; font-weight:300; }
.ideal-book-year-card > small { width:100%; margin-top:8px; overflow:hidden; color:#777; font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.ideal-book-year-empty { display:flex; grid-column:1/-1; align-items:center; justify-content:center; gap:7px; min-height:100px; border:1px dashed #ddd; border-radius:12px; background:#fafafa; color:#777; font-size:12px; }
.ideal-book-year-empty .ideal-book-icon { width:17px; height:17px; }
.ideal-book-home .ideal-book-invite { margin:20px auto 0; }
@media (max-width:520px) {
  .ideal-book-home-section { margin-bottom:24px; }
  .ideal-book-feature-row .ideal-book-feature { flex-basis:82vw; min-height:150px; }
  .ideal-book-home .ideal-book-goal { margin-top:38px; }
  .ideal-book-home .ideal-book-goal-ring { height:204px; }
  .ideal-book-home .ideal-book-goal-ring > svg { height:184px; }
  .ideal-book-home .ideal-book-goal-ring strong { top:76px; font-size:56px; }
  .ideal-book-home .ideal-book-goal-ring > span { top:144px; }
  .ideal-book-home .ideal-book-week-strip { gap:4px; }
  .ideal-book-home .ideal-book-week-day b { width:min(11vw,42px); height:min(11vw,42px); font-size:10px; }
  .ideal-book-home .ideal-book-year-row { gap:11px; }
}

/* 书库采用 iOS 图书式的分隔线列表与小幅封面。 */
.ideal-book-library { padding-top:env(safe-area-inset-top); }
.ideal-book-shelf-header { position:relative; display:flex; align-items:flex-end; min-height:91px; margin-bottom:0; border-bottom:1px solid #d8d8d8; }
.ideal-book-shelf-header h1 { margin:0 0 11px; font-size:34px; font-weight:720; letter-spacing:-.06em; }
.ideal-book-shelf-menu { position:absolute; top:0; right:-4px; display:grid; place-items:center; width:40px; height:40px; padding:0 0 8px; border:0; border-radius:50%; background:#ededed; color:#111; font-size:20px; font-weight:800; letter-spacing:1px; line-height:1; }
.ideal-book-collection-heading { display:flex; align-items:center; gap:15px; height:54px; border-bottom:1px solid #d8d8d8; }
.ideal-book-collection-select { display:grid; place-items:center; width:32px; height:32px; margin-left:0; padding:0; border:0; border-radius:50%; background:transparent; color:#8b8b8b; }
.ideal-book-collection-select svg { width:28px; height:28px; fill:none; stroke:currentColor; stroke-linecap:round; stroke-width:3; }
.ideal-book-collection-select.is-active { background:#ededed; color:#111; }
.ideal-book-collection-heading strong { flex:1; font-size:16px; font-weight:550; }
.ideal-book-collection-heading > span { padding-right:4px; color:#aaa; font-size:29px; font-weight:300; line-height:1; }
.ideal-book-shelf-row { position:relative; display:flex; align-items:center; min-height:106px; gap:12px; padding:13px 0; border-bottom:1px solid #d8d8d8; }
.ideal-book-shelf-open { display:flex; flex:1; align-items:center; min-width:0; gap:13px; padding:0; border:0; background:transparent; text-align:left; }
.ideal-book-shelf-open.is-selectable { position:relative; padding-right:34px; }
.ideal-book-shelf-row.is-selected { background:rgba(0,0,0,.035); }
.ideal-book-shelf-check { position:absolute; top:50%; right:0; display:grid; place-items:center; width:24px; height:24px; transform:translateY(-50%); border:1.5px solid #aaa; border-radius:50%; color:#fff; font-size:14px; font-weight:800; }
.ideal-book-shelf-row.is-selected .ideal-book-shelf-check { border-color:#111; background:#111; }
.ideal-book-shelf-open > .ideal-book-cover { flex:0 0 52px; width:52px; height:72px; border:0; border-radius:3px; box-shadow:2px 4px 8px rgba(0,0,0,.2); }
.ideal-book-shelf-open > .ideal-book-cover::after { left:4px; background:rgba(255,255,255,.24); }
.ideal-book-shelf-copy { display:flex; flex:1; flex-direction:column; min-width:0; align-items:flex-start; gap:3px; }
.ideal-book-shelf-copy strong { display:block; max-width:100%; overflow:hidden; color:#111; font-size:15px; font-weight:620; text-overflow:ellipsis; white-space:nowrap; }
.ideal-book-shelf-copy small { display:block; max-width:100%; overflow:hidden; color:#929292; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.ideal-book-shelf-copy i { color:#888; font-size:12px; font-style:normal; }
.ideal-book-shelf-copy > b { padding:2px 8px; border-radius:999px; background:#777; color:#fff; font-size:10px; font-weight:600; }
.ideal-book-shelf-more { flex:0 0 36px; width:36px; padding:0; border:0; background:transparent; color:#858585; font-size:21px; font-weight:700; letter-spacing:1px; }
.ideal-book-shelf-bulk { display:flex; align-items:center; gap:8px; margin-top:14px; padding:10px 0; color:#888; font-size:12px; }
.ideal-book-shelf-bulk span { flex:1; }
.ideal-book-shelf-bulk button { min-width:62px; padding:9px 12px; border:1px solid #d8d8d8; border-radius:999px; background:#fff; color:#333; font-size:12px; }
.ideal-book-shelf-bulk button[data-book-delete-selected] { border-color:#222; background:#222; color:#fff; }
.ideal-book-shelf-bulk button:disabled { opacity:.4; }
.ideal-book-shelf-empty { display:flex; flex-direction:column; align-items:center; gap:10px; padding:55px 15px; color:#888; text-align:center; }
.ideal-book-shelf-empty h2 { margin:0; color:#333; font-size:17px; }
.ideal-book-shelf-empty p { margin:0; font-size:12px; }
.ideal-book-shelf-empty button { margin-top:4px; padding:10px 18px; border:0; border-radius:999px; background:#111; color:#fff; font-size:12px; }
@media (max-width:520px) {
  .ideal-book-library { padding-right:26px; padding-left:26px; }
  .ideal-book-shelf-header { min-height:91px; }
  .ideal-book-shelf-row { min-height:106px; }
  .ideal-book-shelf-open > .ideal-book-cover { flex-basis:53px; width:53px; height:74px; }
}

/* 主页头像取自桌面资料与聊天角色，沿用桌面心电图和心跳连接。 */
.ideal-book-home-actions { gap:9px; }
.ideal-book-avatar-link { display:flex; align-items:center; gap:4px; }
.ideal-book-user-avatar,.ideal-book-role-avatar { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; width:37px; height:48px; padding:0; border:0; background:transparent; color:#333; }
.ideal-book-user-avatar > img,.ideal-book-role-avatar > img,.ideal-book-user-avatar > span,.ideal-book-role-avatar > span { display:grid; place-items:center; width:31px; height:31px; overflow:hidden; border:1px solid #e3e3e3; border-radius:50%; background:#eee; color:#555; font-size:12px; font-weight:650; object-fit:cover; }
.ideal-book-user-avatar > small,.ideal-book-role-avatar > small { display:block; max-width:54px; margin-top:2px; overflow:hidden; color:#777; font-size:7px; line-height:1; text-overflow:ellipsis; white-space:nowrap; }
.ideal-book-heart-link { position:relative; display:grid; flex:0 0 54px; place-items:center; width:54px; height:27px; color:#333; font-size:14px; line-height:1; animation:heart-beat 1.25s ease-in-out infinite; }
.ideal-book-heart-link svg { position:absolute; inset:0; width:54px; height:27px; overflow:visible; }
.ideal-book-heart-link .heartbeat-line { stroke:#666; stroke-width:1.5; }
.ideal-book-heart-link > span { position:relative; z-index:1; }
.ideal-book-home .ideal-book-goal-ring > .ideal-book-goal-target { position:absolute; top:155px; display:flex; align-items:center; padding:0; border:0; background:transparent; color:#222; font-size:13px; }
.ideal-book-goal-target { cursor:pointer; }
.ideal-book-role-shade { position:absolute; inset:0; z-index:6; display:flex; align-items:flex-end; justify-content:center; background:rgba(0,0,0,.2); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); }
.ideal-book-role-sheet { width:min(500px,100%); max-height:72%; padding:18px 18px calc(18px + env(safe-area-inset-bottom)); overflow:auto; border-radius:24px 24px 0 0; background:#fff; box-shadow:0 -10px 36px rgba(0,0,0,.15); }
.ideal-book-role-sheet > header { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.ideal-book-role-sheet > header strong { font-size:17px; }
.ideal-book-role-sheet > header button { width:32px; height:32px; border:0; border-radius:50%; background:#eee; color:#333; font-size:20px; }
.ideal-book-role-option { display:flex; align-items:center; gap:12px; width:100%; padding:10px 2px; border:0; border-bottom:1px solid #eee; background:transparent; text-align:left; }
.ideal-book-role-option-avatar { display:grid; flex:0 0 38px; place-items:center; width:38px; height:38px; overflow:hidden; border-radius:50%; background:#eee; color:#555; font-size:13px; }
.ideal-book-role-option-avatar img { width:100%; height:100%; object-fit:cover; }
.ideal-book-role-option > span:nth-child(2) { flex:1; font-size:13px; }
.ideal-book-role-option > b { color:#111; font-size:15px; }
.ideal-book-role-option.is-selected { color:#111; }
.ideal-book-role-sheet .ideal-book-no-role { padding:12px 0; color:#888; font-size:12px; }
@media (max-width:520px) { .ideal-book-home .ideal-book-goal-ring > .ideal-book-goal-target { top:144px; } }

/* 主页顶栏贴住安全区，头像成一条水平线，心电动画只在两头像之间活动。 */
.ideal-book-home .ideal-book-topbar {
  position:sticky; top:0; z-index:4;
  margin-top:calc(-25px - env(safe-area-inset-top)); margin-right:-27px; margin-bottom:22px; margin-left:-27px;
  padding:calc(10px + env(safe-area-inset-top)) 27px 8px;
  border-bottom:1px solid rgba(0,0,0,.06);
  background:rgba(255,255,255,.92);
  -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px);
}
.ideal-book-avatar-link { align-items:flex-start; gap:5px; }
.ideal-book-user-avatar,.ideal-book-role-avatar { flex:0 0 42px; width:42px; height:46px; justify-content:flex-start; }
.ideal-book-user-avatar > img,.ideal-book-role-avatar > img,.ideal-book-user-avatar > span,.ideal-book-role-avatar > span { flex:0 0 32px; width:32px; height:32px; }
.ideal-book-heart-link { align-self:flex-start; flex:0 0 48px; width:48px; height:32px; margin-top:2px; overflow:hidden; isolation:isolate; }
.ideal-book-heart-link svg { inset:3px 0 auto; width:48px; height:24px; overflow:hidden; }
.ideal-book-heart-link .heartbeat-line { stroke:#777; stroke-width:1.4; }
@media (max-width:520px) {
  .ideal-book-home .ideal-book-topbar { margin-right:-19px; margin-left:-19px; padding-right:19px; padding-left:19px; }
}

/* Eliminate the scroll-content top gap; keep the glass header itself flush to the viewport. */
.ideal-book-home { padding-top:0; }
.ideal-book-home .ideal-book-topbar { top:0; margin-top:0; }
.ideal-book-heart-link { animation:ideal-book-heart-pulse 1.25s ease-in-out infinite; transform-origin:center; }
@keyframes ideal-book-heart-pulse {
  0%,100% { transform:scale(1); }
  14% { transform:scale(1.12); }
  28%,56% { transform:scale(1); }
  42% { transform:scale(1.08); }
}

/* 书库页同样使用固定顶栏，右侧提供关闭与导入入口。 */
.ideal-book-library { padding-top:0; }
.ideal-book-shelf-header {
  position:sticky; top:0; z-index:4; align-items:flex-end; justify-content:space-between;
  min-height:calc(91px + env(safe-area-inset-top)); margin:0 -26px 0; padding:calc(10px + env(safe-area-inset-top)) 26px 0;
  border-bottom:1px solid #d8d8d8; background:rgba(255,255,255,.94);
  -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px);
}
.ideal-book-shelf-header h1 { margin:0 0 11px; }
.ideal-book-shelf-actions { display:flex; align-items:center; gap:9px; margin-bottom:11px; }
.ideal-book-shelf-close,.ideal-book-shelf-import { display:grid; place-items:center; width:36px; height:36px; padding:0; border:0; border-radius:50%; background:#ededed; color:#222; }
.ideal-book-shelf-close { font-size:22px; line-height:1; }
.ideal-book-shelf-import .ideal-book-icon { width:18px; height:18px; stroke-width:2.4; }
.ideal-book-collection-heading { margin-top:0; }
@media (max-width:520px) {
  .ideal-book-shelf-header { margin-right:-26px; margin-left:-26px; padding-right:26px; padding-left:26px; }
}

/* 书库顶栏与主页统一高度，导入入口独立放在标题栏下方右侧。 */
.ideal-book-shelf-header {
  align-items:center; justify-content:space-between;
  height:calc(66px + env(safe-area-inset-top)); min-height:0;
  padding:calc(10px + env(safe-area-inset-top)) 26px 8px;
}
.ideal-book-shelf-header h1 { margin:0; font-size:31px; line-height:1.2; }
.ideal-book-shelf-close { flex:0 0 36px; }
.ideal-book-shelf-tools { display:flex; align-items:center; justify-content:flex-end; height:48px; }
.ideal-book-shelf-import { flex:0 0 36px; }
@media (max-width:520px) {
  .ideal-book-shelf-header { padding-right:26px; padding-left:26px; }
}

/* 书库导入操作悬浮在底部 Dock 上方。 */
.ideal-book-shelf-import {
  position:absolute; right:24px; bottom:calc(max(24px,env(safe-area-inset-bottom)) + 80px); z-index:3;
  display:grid; place-items:center; width:56px; height:56px; padding:0;
  border:0; border-radius:50%; background:#111; color:#fff;
  box-shadow:0 5px 16px rgba(0,0,0,.2);
}
.ideal-book-shelf-import .ideal-book-icon { width:23px; height:23px; color:#fff; stroke-width:2.2; }

/* Keep reader position stable when reader controls or the plot chat re-render. */
.ideal-book-reading-scroll { scroll-behavior:auto; overflow-anchor:none; }
.ideal-book-chat-messages { overflow-anchor:none; }
