:root{--paper:#f8f7f3;--surface:#fff;--ink:#292e2a;--muted:#7e847d;--line:#e9e8e1;--accent:#466654;--tint:#eff3ee;--font:17px}*{box-sizing:border-box}html{height:100%;background:var(--paper)}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Noto Sans CJK SC",sans-serif;color:var(--ink);-webkit-text-size-adjust:100%}button,input,select,textarea{font:inherit}button{cursor:pointer;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid #86a28e;outline-offset:2px}.app-header{height:calc(63px + env(safe-area-inset-top));padding:calc(8px + env(safe-area-inset-top)) 16px 9px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);background:rgba(248,247,243,.97);position:sticky;top:0;z-index:15;backdrop-filter:blur(18px)}.brand{display:flex;gap:9px;align-items:center}.brand-mark{background:var(--accent);color:white;border-radius:10px;display:grid;place-items:center;font-family:serif;font-size:20px;width:34px;height:34px}.brand strong{display:block;font-size:16px;letter-spacing:.6px}.brand small{display:block;color:var(--muted);font-size:8px;letter-spacing:1.3px;margin-top:1px}.header-actions{display:flex;align-items:center;gap:8px}.btn{background:white;border:1px solid #d9ded7;color:var(--ink);border-radius:11px;padding:10px 13px;font-size:13px;font-weight:550}.btn.primary{background:var(--accent);color:white;border-color:var(--accent)}.btn.soft{background:var(--tint);color:#446251;border-color:var(--tint)}.btn.compact{padding:9px 12px}.icon-button{border:0;background:transparent;font-size:21px;width:36px;height:36px;color:#576a5e}.small-btn{border:none;background:transparent;color:var(--accent);font-size:12px;padding:7px}.bottom-nav{position:fixed;z-index:18;left:0;right:0;bottom:0;background:#fff;border-top:1px solid var(--line);display:flex;padding:7px 7px calc(7px + env(safe-area-inset-bottom));box-shadow:0 -4px 18px #1f332309}.bottom-nav button{flex:1;border:0;background:transparent;color:#89928b;display:flex;align-items:center;flex-direction:column;gap:2px;font-size:10px;min-height:45px}.bottom-nav .active{color:var(--accent);font-weight:700}.nav-icon{font-size:22px;line-height:27px}main{max-width:760px;margin:0 auto;padding:18px 16px calc(95px + env(safe-area-inset-bottom));min-height:calc(100dvh - 70px)}.page-top{display:flex;align-items:start;justify-content:space-between;gap:10px;margin-bottom:14px}.eyebrow{color:var(--muted);font-size:11px;letter-spacing:.3px}.page-title{font-family:Georgia,"Noto Serif CJK SC",serif;font-size:25px;font-weight:600;line-height:1.28;margin:5px 0 0}.subtle{font-size:12px;color:var(--muted);line-height:1.6}.library{display:grid;grid-template-columns:repeat(auto-fit,minmax(158px,1fr));gap:12px}.book{border:1px solid var(--line);border-radius:15px;padding:18px 15px;background:var(--surface);text-align:left;min-height:163px;display:flex;flex-direction:column;justify-content:space-between}.book-cover{height:58px;max-width:45px;background:linear-gradient(130deg,#bdcabb,#7a9683);border-radius:4px 7px 7px 4px;box-shadow:inset 4px 0 #0001;color:white;display:flex;align-items:center;justify-content:center;font-family:Georgia,serif;font-size:24px}.book h3{font-family:Georgia,"Noto Serif CJK SC",serif;font-size:16px;margin:10px 0 5px;line-height:1.4}.book small{color:var(--muted);font-size:11px}.intro{border:1px dashed #d6dfd5;border-radius:15px;padding:16px;background:#f2f6f1;margin-bottom:16px;font-size:13px;color:#57685b}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.row.between{justify-content:space-between}.select{appearance:none;-webkit-appearance:none;min-width:0;max-width:100%;background:#fff;border:1px solid #dfe4db;border-radius:10px;padding:9px 10px;font-size:12px;color:var(--ink)}.toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin:14px 0 8px}.toolbar .select{flex:1;min-width:108px}.seg{display:inline-flex;border:1px solid #dce2d9;border-radius:10px;background:white;overflow:hidden;flex-shrink:0}.seg button{border:none;background:transparent;padding:9px 10px;font-size:11px;color:#70786f}.seg button.active{background:var(--accent);color:white}.chip{font-size:10px;color:#607366;background:#edf3eb;border-radius:100px;padding:4px 8px}.reading-status{display:flex;justify-content:space-between;align-items:center;color:var(--muted);font-size:11px;gap:8px;border-bottom:1px solid var(--line);padding-bottom:9px;margin-bottom:3px}.notice{background:#f4f5ef;border:1px solid #e3e7dc;padding:10px 12px;border-radius:9px;color:#61695d;font-size:11px;line-height:1.6;margin:11px 0}.passage{padding:11px 0 12px;border-bottom:1px solid #e8e9e3}.original{font-family:Georgia,"Noto Serif CJK SC",serif;font-size:var(--font);line-height:1.72;word-break:normal;overflow-wrap:anywhere;margin:0 0 5px;white-space:pre-wrap;color:#222c27}.tok{cursor:pointer;border-radius:3px;touch-action:manipulation}.tok:active{background:#d5e5d7}.translation{font-size:calc(var(--font) - 2px);line-height:1.67;color:#66726a;margin:0;white-space:pre-wrap}.translation.wait{color:#a1aaa1;font-size:12px;font-style:normal}.translation.error{color:#ae6f53}.reading-actions{display:flex;justify-content:space-between;gap:10px;margin-top:18px}.reading-actions button{flex:1}.secondary-tool{display:flex;gap:8px;align-items:center;justify-content:space-between;margin-top:5px}.empty{color:var(--muted);background:white;text-align:center;padding:27px 15px;border:1px dashed #dce2d8;border-radius:12px;font-size:13px;line-height:1.7}.word-list{display:flex;flex-direction:column;gap:9px}.word-row{background:white;border:1px solid var(--line);border-radius:12px;padding:14px}.word-row h3{font-size:16px;margin:0 0 5px;color:#35533f}.word-row p{margin:0 0 6px;color:#5d6c61;font-size:12px}.muted{color:var(--muted)!important}.divider{height:1px;background:var(--line);margin:12px 0}.flash{background:#fff;border:1px solid var(--line);min-height:280px;border-radius:18px;text-align:center;display:flex;flex-direction:column;justify-content:center;padding:25px 20px;box-shadow:0 12px 22px #576e560b}.flash .term{font-family:Georgia,serif;color:#375a42;font-size:28px;margin:15px 0}.flash p{font-size:14px;line-height:1.7;color:#5b7061}.flash .hint{color:var(--muted);font-size:12px}.review-actions{display:flex;gap:9px;margin-top:15px}.review-actions .btn{flex:1}.sheet-overlay{z-index:25;position:fixed;inset:0;background:#18231b79;display:flex;align-items:flex-end;justify-content:center}.sheet{background:#fff;width:100%;max-width:650px;border-radius:18px 18px 0 0;padding:17px 19px calc(24px + env(safe-area-inset-bottom));max-height:90dvh;overflow-y:auto;box-shadow:0 -12px 55px #18231b22}.sheet h2{font-size:19px;margin:5px 0 10px}.sheet .handle{width:38px;height:4px;border-radius:10px;background:#cfd7cf;margin:0 auto 12px}.sheet .context{color:#818b81;line-height:1.6;font-size:13px;border-left:2px solid #dae5d9;padding-left:9px;margin:12px 0}.sheet .definition{font-size:16px;color:#385b43;line-height:1.7;margin:8px 0}.sheet .usage{font-size:13px;color:#5e6f60;line-height:1.75;white-space:pre-wrap}.sheet-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:16px}.sheet-actions button{flex:1}.form-label{display:block;font-size:12px;font-weight:600;color:#586b5d;margin:14px 0 6px}.form-input{width:100%;border:1px solid #dbe4da;border-radius:9px;background:#fff;padding:11px;color:var(--ink);font-size:14px}.settings-hint{font-size:12px;color:#7a847c;line-height:1.7;margin:8px 0}.settings-block{padding-bottom:13px;border-bottom:1px solid var(--line)}.hidden{display:none!important}#toast{position:fixed;z-index:40;bottom:calc(78px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);max-width:calc(100% - 40px);background:#303d33;color:white;border-radius:10px;padding:10px 15px;font-size:12px;box-shadow:0 6px 20px #0002;display:none;text-align:center}#toast.on{display:block}@media(min-width:770px){main{padding-top:25px}.bottom-nav{max-width:760px;margin:auto}.sheet-overlay{align-items:center}.sheet{border-radius:18px;padding-bottom:24px}.library{grid-template-columns:repeat(3,1fr)}}

.book-wrap{position:relative;min-width:0}.book-wrap .book{width:100%;height:100%}.book-remove{position:absolute;right:9px;top:6px;color:#9a8e85;font-size:10px}.page-top .eyebrow .small-btn{font-size:10px;padding:2px 5px;color:#76907b}

/* v1.1 reading interaction: only verified multiword expressions are tappable */
.original{-webkit-user-select:text;user-select:text;touch-action:pan-y;cursor:text}
.idiom-hit{border-bottom:1.5px dashed #729f7d;background:#ecf3e9;border-radius:2px;cursor:pointer;-webkit-tap-highlight-color:#b7d5b9;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.idiom-hit:active{background:#dce9d7}
.reader-hl{padding:0 1px;border-radius:2px;color:inherit}
.hl-yellow{background:#f1e39f}.hl-green{background:#cce9ce}.hl-pink{background:#f2d8e2}
.original::selection,.original *::selection{background:#cde9ce;color:#243528}
.selection-tools{position:fixed;z-index:24;left:12px;right:12px;bottom:calc(72px + env(safe-area-inset-bottom));display:flex;align-items:center;gap:5px;padding:8px;border-radius:12px;background:#fff;border:1px solid #dfe5dc;box-shadow:0 8px 28px #18231b33;max-width:540px;margin:auto}
.selection-tools .picked{font-size:11px;color:#66776a;white-space:nowrap;max-width:24%;text-overflow:ellipsis;overflow:hidden;flex:1}
.selection-tools button{border:none;background:#eef4ed;color:#365b44;border-radius:8px;padding:9px 7px;font-size:12px;white-space:nowrap}
.selection-tools button:last-child{background:transparent;font-size:15px}
@media (max-width:360px){.selection-tools .picked{max-width:17%}.selection-tools button{font-size:11px;padding:8px 5px}}

/* v1.9: a single full-width chapter selector replaces duplicated translation-style controls. */
.toolbar .select{flex:1;width:100%;}
