:root{--rc0:4,32,26;--rc1:11,59,46;--rc2:15,82,64;--rc3:22,112,88;--rc4:31,138,108;--rc5:201,162,74;--rc6:231,205,133;--rc7:169,131,47;--rc8:247,241,227;--rc9:255,250,240;--rc10:29,42,37;--rc11:93,107,100;--rc12:244,238,223;--rc13:255,253,247;--rc14:251,246,234;--rc15:5,23,15;--rc16:12,42,32;--rc17:15,51,38;--rc18:239,231,210;--rc19:169,184,174;--rc20:14,44,34;--rc21:247,236,205;--rc22:5,30,23;--rc23:207,216,207;--rc24:43,32,6;--rc25:29,21,3;--rc26:248,239,212;--rc27:6,42,32;--rc28:17,87,63;--rc29:255,248,227;--rc30:217,178,90;--rc31:160,122,38;--rc32:47,127,143;--rc33:23,79,90;--rc34:127,214,181;--rc35:184,138,46;--rc36:111,79,18;--rc37:255,193,69;--rc38:91,192,190;--rc39:255,154,107;--rc40:250,247,239;--rc41:243,236,216;--rc42:251,245,228;--rc43:36,27,5;--rc44:251,243,220;--rc45:18,53,40;--rc46:138,100,32;--rc47:79,58,16;--rc48:251,236,196;--rc49:143,211,182;--rc50:255,252,242;--rc51:29,26,20;--rc52:245,238,220;--rc53:255,252,243;--rc54:4,20,14;--rc55:11,38,29;--rc56:14,47,36;--rc57:12,39,30;--rc58:6,39,30;--rc59:10,51,40;--rc60:243,230,191;--rc61:222,230,221;--rc62:241,230,198;--rc63:22,97,75;--rc64:13,69,53;--rc65:7,40,32;--rc66:17,74,57;--rc67:11,53,41;--rc68:8,42,32;--rc69:5,29,22;--rc70:244,234,208;--rc71:227,199,126;--rc72:187,148,64;--rc73:216,185,104;--rc74:32,24,10;--rc75:233,208,140;--rc76:208,170,85;--rc77:193,154,70;--rc78:15,74,57;--rc79:255,248,230;--rc80:13,58,44;--rc81:10,44,34;--rc82:255,254,249;--rc83:248,240,220;--rc84:255,253,246;--rc85:17,56,43;--rc86:11,42,32;--rc87:13,47,36;--rc88:20,95,74;--rc89:110,80,20;--rc90:6,40,31;--rc91:13,74,57;--rc92:243,227,176;--rc93:243,232,201;--rc94:234,210,146;--rc95:255,246,221;--rc96:246,231,189;--rc97:20,97,75;--rc98:26,122,94;--rc99:244,230,189;--rc100:255,246,214;--rc101:6,40,30;--rc102:5,33,25;--rc103:7,45,34;--rc104:9,55,42;--rc105:255,240,200;--rc106:246,231,187;--rc107:184,145,58;--rc108:6,36,27;--rc109:138,106,34;--rc110:243,230,196;--rc111:20,64,47;--rc112:29,125,96;--rc113:17,96,74;--rc114:10,62,47;--rc115:31,122,94;--rc116:18,90,69;--rc117:11,58,44;--rc118:23,105,79;--rc119:13,76,58;--rc120:8,50,31;--rc121:243,220,156;--rc122:240,217,152;--rc123:255,243,204;--rc124:255,246,218;--rc125:255,241,201;--rc126:120,90,20;--rc127:20,83,63;--rc128:26,94,72;--rc129:15,68,52;--rc130:138,106,31;--rc131:107,122,114;--rc132:11,42,31;--rc133:255,246,220;--rc134:248,232,180;--rc135:226,194,122;--rc136:185,143,60;--rc137:125,94,24;--rc138:111,194,159;--ru0:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23e7cd85' stroke-width='1'%3E%3Cpath d='M48 6l12 30 30 12-30 12-12 30-12-30L6 48l30-12z'/%3E%3Ccircle cx='48' cy='48' r='14'/%3E%3Cpath d='M0 0l96 96M96 0L0 96' stroke-opacity='.4'/%3E%3C/g%3E%3C/svg%3E");--ru1:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23c9a24a' stroke-width='2'%3E%3Ccircle cx='20' cy='20' r='15'/%3E%3Cpath d='M20 2l4 6h-8zM20 38l4-6h-8zM2 20l6-4v8zM38 20l-6-4v8z' fill='%23c9a24a'/%3E%3C/g%3E%3C/svg%3E");--ru2:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23e7cd85' stroke-width='1'%3E%3Cpath d='M48 6l12 30 30 12-30 12-12 30-12-30L6 48l30-12z'/%3E%3Ccircle cx='48' cy='48' r='14'/%3E%3C/g%3E%3C/svg%3E");--ru3:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a9832f' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");--ru4:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='%23c9a24a' stroke-width='1.1'%3E%3Cpath d='M10 1.5l2.4 3.4 4.1-.8-.8 4.1 3.4 2.4-3.4 2.4.8 4.1-4.1-.8L10 19.7l-2.4-3.4-4.1.8.8-4.1L.9 10.6l3.4-2.4-.8-4.1 4.1.8z'/%3E%3Ccircle cx='10' cy='10.6' r='3'/%3E%3C/g%3E%3Ccircle cx='10' cy='10.6' r='1.2' fill='%23c9a24a'/%3E%3C/svg%3E");--ru5:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='%23c9a24a' stroke-width='1.1'%3E%3Cpath d='M10 1.5l2.4 3.4 4.1-.8-.8 4.1 3.4 2.4-3.4 2.4.8 4.1-4.1-.8L10 19.7l-2.4-3.4-4.1.8.8-4.1L.9 10.6l3.4-2.4-.8-4.1 4.1.8z'/%3E%3Ccircle cx='10' cy='10.6' r='3'/%3E%3C/g%3E%3Ccircle cx='10' cy='10.6' r='1.2' fill='%23c9a24a'/%3E%3C/svg%3E");--ru6:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='%23c9a24a' stroke-width='1.1'%3E%3Cpath d='M10 1.5l2.4 3.4 4.1-.8-.8 4.1 3.4 2.4-3.4 2.4.8 4.1-4.1-.8L10 19.7l-2.4-3.4-4.1.8.8-4.1L.9 10.6l3.4-2.4-.8-4.1 4.1.8z'/%3E%3Ccircle cx='10' cy='10.6' r='3'/%3E%3C/g%3E%3Ccircle cx='10' cy='10.6' r='1.2' fill='%23c9a24a'/%3E%3C/svg%3E");--ru7:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='%23c9a24a' stroke-width='1.1'%3E%3Cpath d='M10 1.5l2.4 3.4 4.1-.8-.8 4.1 3.4 2.4-3.4 2.4.8 4.1-4.1-.8L10 19.7l-2.4-3.4-4.1.8.8-4.1L.9 10.6l3.4-2.4-.8-4.1 4.1.8z'/%3E%3Ccircle cx='10' cy='10.6' r='3'/%3E%3C/g%3E%3Ccircle cx='10' cy='10.6' r='1.2' fill='%23c9a24a'/%3E%3C/svg%3E");--ru8:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10.00,1.00 L12.14,4.84 L16.36,3.64 L15.16,7.86 L19.00,10.00 L15.16,12.14 L16.36,16.36 L12.14,15.16 L10.00,19.00 L7.86,15.16 L3.64,16.36 L4.84,12.14 L1.00,10.00 L4.84,7.86 L3.64,3.64 L7.86,4.84Z' fill='none' stroke='%23c9a24a' stroke-width='1.4'/%3E%3Ccircle cx='10' cy='10' r='2.2' fill='%23c9a24a'/%3E%3C/svg%3E");--ru9:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10.00,1.00 L12.14,4.84 L16.36,3.64 L15.16,7.86 L19.00,10.00 L15.16,12.14 L16.36,16.36 L12.14,15.16 L10.00,19.00 L7.86,15.16 L3.64,16.36 L4.84,12.14 L1.00,10.00 L4.84,7.86 L3.64,3.64 L7.86,4.84Z' fill='none' stroke='%23e7cd85' stroke-width='1.4'/%3E%3Ccircle cx='10' cy='10' r='2.2' fill='%23e7cd85'/%3E%3C/svg%3E");--ru10:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10.00,1.00 L12.14,4.84 L16.36,3.64 L15.16,7.86 L19.00,10.00 L15.16,12.14 L16.36,16.36 L12.14,15.16 L10.00,19.00 L7.86,15.16 L3.64,16.36 L4.84,12.14 L1.00,10.00 L4.84,7.86 L3.64,3.64 L7.86,4.84Z' fill='none' stroke='%23c9a24a' stroke-width='1.4'/%3E%3Ccircle cx='10' cy='10' r='2.2' fill='%23c9a24a'/%3E%3C/svg%3E");--ru11:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10.00,1.00 L12.14,4.84 L16.36,3.64 L15.16,7.86 L19.00,10.00 L15.16,12.14 L16.36,16.36 L12.14,15.16 L10.00,19.00 L7.86,15.16 L3.64,16.36 L4.84,12.14 L1.00,10.00 L4.84,7.86 L3.64,3.64 L7.86,4.84Z' fill='none' stroke='%23e7cd85' stroke-width='1.4'/%3E%3Ccircle cx='10' cy='10' r='2.2' fill='%23e7cd85'/%3E%3C/svg%3E");--ru12:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='%23d9bb6e' stroke-width='1.1'%3E%3Cpath d='M10.00,1.00 L12.14,4.84 L16.36,3.64 L15.16,7.86 L19.00,10.00 L15.16,12.14 L16.36,16.36 L12.14,15.16 L10.00,19.00 L7.86,15.16 L3.64,16.36 L4.84,12.14 L1.00,10.00 L4.84,7.86 L3.64,3.64 L7.86,4.84Z'/%3E%3Ccircle cx='10' cy='10' r='3'/%3E%3C/g%3E%3Ccircle cx='10' cy='10' r='1.2' fill='%23d9bb6e'/%3E%3C/svg%3E");--ru13:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='%23d9bb6e' stroke-width='1.1'%3E%3Cpath d='M10.00,1.00 L12.14,4.84 L16.36,3.64 L15.16,7.86 L19.00,10.00 L15.16,12.14 L16.36,16.36 L12.14,15.16 L10.00,19.00 L7.86,15.16 L3.64,16.36 L4.84,12.14 L1.00,10.00 L4.84,7.86 L3.64,3.64 L7.86,4.84Z'/%3E%3Ccircle cx='10' cy='10' r='3'/%3E%3C/g%3E%3Ccircle cx='10' cy='10' r='1.2' fill='%23d9bb6e'/%3E%3C/svg%3E");--ru14:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='%23d9bb6e' stroke-width='1.1'%3E%3Cpath d='M10.00,1.00 L12.14,4.84 L16.36,3.64 L15.16,7.86 L19.00,10.00 L15.16,12.14 L16.36,16.36 L12.14,15.16 L10.00,19.00 L7.86,15.16 L3.64,16.36 L4.84,12.14 L1.00,10.00 L4.84,7.86 L3.64,3.64 L7.86,4.84Z'/%3E%3Ccircle cx='10' cy='10' r='3'/%3E%3C/g%3E%3Ccircle cx='10' cy='10' r='1.2' fill='%23d9bb6e'/%3E%3C/svg%3E");--ru15:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='%23d9bb6e' stroke-width='1.1'%3E%3Cpath d='M10.00,1.00 L12.14,4.84 L16.36,3.64 L15.16,7.86 L19.00,10.00 L15.16,12.14 L16.36,16.36 L12.14,15.16 L10.00,19.00 L7.86,15.16 L3.64,16.36 L4.84,12.14 L1.00,10.00 L4.84,7.86 L3.64,3.64 L7.86,4.84Z'/%3E%3Ccircle cx='10' cy='10' r='3'/%3E%3C/g%3E%3Ccircle cx='10' cy='10' r='1.2' fill='%23d9bb6e'/%3E%3C/svg%3E");--ru16:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23e7cd85' stroke-width='1' stroke-opacity='.16'%3E%3Crect x='18' y='18' width='20' height='20'/%3E%3Crect x='18' y='18' width='20' height='20' transform='rotate%2845 28 28%29'/%3E%3Cpath d='M0 0l13.9 13.9M56 0L42.1 13.9M0 56l13.9-13.9M56 56L42.1 42.1M28 0v13.9M28 56V42.1M0 28h13.9M56 28H42.1'/%3E%3C/g%3E%3C/svg%3E")}
/* v39 semantic tokens (all derived from the palette) */
:root{--primary-rgb:var(--rc1);--primary:rgb(var(--primary-rgb));--primary2:rgb(var(--rc3));--secondary-rgb:var(--rc5);--secondary:rgb(var(--secondary-rgb));--accent:rgb(var(--rc6));--surface:rgb(var(--rc52));--text:rgb(var(--rc10));--on-primary:rgb(var(--rc8));--accent-ink:rgb(var(--rc7))}
html[data-theme=dark]{--surface:rgb(var(--rc54));--text:rgb(var(--rc18));--accent-ink:rgb(var(--rc6))}
/* hero cards: subtle blend of the two palette colours + gentle shine */
.hx-hero,.hero{isolation:isolate}
.hx-hero::after,.hero::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:0;
 background:radial-gradient(85% 65% at 100% 0%,rgba(var(--secondary-rgb),.20),transparent 62%),radial-gradient(75% 70% at 0% 100%,rgba(var(--rc3),.45),transparent 70%)}
.hx-hero>*,.hero>*{position:relative;z-index:1}
html[data-shine=on] .hx-hero::after,html[data-shine=on] .hero::after{
 background:linear-gradient(115deg,transparent 38%,rgba(255,255,255,.07) 46%,rgba(255,255,255,.13) 50%,rgba(255,255,255,.07) 54%,transparent 62%),radial-gradient(85% 65% at 100% 0%,rgba(var(--secondary-rgb),.20),transparent 62%),radial-gradient(75% 70% at 0% 100%,rgba(var(--rc3),.45),transparent 70%);
 background-size:260% 100%,100% 100%,100% 100%;background-repeat:no-repeat;animation:rshine 9s ease-in-out infinite}
@keyframes rshine{0%,12%{background-position:120% 0,0 0,0 0}55%,100%{background-position:-20% 0,0 0,0 0}}
@media (prefers-reduced-motion:reduce){html[data-shine=on] .hx-hero::after,html[data-shine=on] .hero::after{animation:none;background-position:50% 0,0 0,0 0}}
/* palette picker */
.pal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px}
@media (min-width:700px){.pal-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
.pal-opt{display:flex;flex-direction:column;align-items:stretch;gap:4px;text-align:start;font:inherit;color:var(--ink);background:var(--card2);border:1.5px solid var(--line);border-radius:16px;padding:8px 8px 10px;cursor:pointer;min-height:44px;transition:border-color .2s,transform .2s}
.pal-opt b{font-size:14.5px;line-height:1.3}.pal-opt small{color:var(--muted);font-size:12px;line-height:1.4}
.pal-opt.on{border-color:var(--secondary);box-shadow:0 0 0 3px rgba(var(--secondary-rgb),.22)}
.pal-opt:active{transform:scale(.98)}
.pal-sw{position:relative;display:block;height:54px;border-radius:12px;overflow:hidden;background:linear-gradient(135deg,var(--sp) 0%,var(--sp) 45%,var(--sp2) 100%);border:1px solid rgba(127,127,127,.18)}
.pal-sw i{position:absolute;inset-inline-end:10px;top:10px;width:20px;height:20px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff8 0,transparent 45%),var(--sa);box-shadow:0 0 0 2px rgba(255,255,255,.18)}
.pal-sw b{position:absolute;inset-inline-start:0;bottom:0;width:44%;height:16px;border-start-end-radius:10px;background:var(--ss)}
.pal-custom{margin-top:14px;padding:12px;border-radius:16px;border:1.5px dashed var(--line);background:var(--card2)}
.pal-custom.on{border-style:solid;border-color:var(--secondary)}
.pal-ch{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline}
.pal-pick{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:10px}
.pal-pick label{display:flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;min-height:44px}
.pal-pick input[type=color]{width:44px;height:44px;padding:0;border:1.5px solid var(--line);border-radius:12px;background:none;cursor:pointer}
.pal-pick input[type=color]::-webkit-color-swatch-wrapper{padding:3px}.pal-pick input[type=color]::-webkit-color-swatch{border:0;border-radius:8px}
.pal-live{flex:1 1 90px;min-width:90px}.pal-live .pal-sw{height:44px}
.pal-mix{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.pal-m{width:44px;height:44px;border-radius:50%;border:1.5px solid var(--line);cursor:pointer;background:linear-gradient(135deg,var(--m1) 0 50%,var(--m2) 50% 100%)}
.pal-note{margin:8px 0 0;color:var(--muted);min-height:0}.pal-note:empty{display:none}
.pal-shine{margin-top:8px}
.icon-btn.pal-btn .ico{width:20px;height:20px}

/* v39 contrast: green link text in dark, small gold text in light (≥4.5) */
:root{--gt:rgb(var(--rc3))}html[data-theme=dark]{--gt:rgb(var(--rc138))}
html:not([data-theme=dark]) :is(.r8-tag:not(.light),.badge:not(.new):not(.green):not(.part),.ded-lbl){color:rgb(var(--rc137))}
.badge.part{background:rgba(200,80,60,.14);color:#a8452f}html[data-theme=dark] .badge.part{color:#f2a48f}

/* kids letters follow the palette (large text, white ≥3.5:1) */
.kids{--k1:rgb(var(--rc130));--k2:rgb(var(--rc2));--k3:rgb(var(--rc7));--k4:rgb(var(--rc118));--k5:rgb(var(--rc1))}

/* v40 scroll performance — same look, cheaper frames */
/* 1) shine: the v39 sweep animated background-position (full repaint of the hero every frame, forever). Static blend stays on ::after; the sweep is now a composited stripe moved with transform only, and only while the hero is on screen */
html[data-shine=on] .hx-hero::after,html[data-shine=on] .hero::after{animation:none;background:radial-gradient(85% 65% at 100% 0%,rgba(var(--secondary-rgb),.20),transparent 62%),radial-gradient(75% 70% at 0% 100%,rgba(var(--rc3),.45),transparent 70%)}
.hx-hero>.r-shn,.hero>.r-shn{position:absolute;inset:0;z-index:3;border-radius:inherit;overflow:hidden;pointer-events:none;contain:strict}
.r-shn::before{content:'';position:absolute;top:-10%;bottom:-10%;left:0;width:50%;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.06) 30%,rgba(255,255,255,.13) 50%,rgba(255,255,255,.06) 70%,transparent 100%);transform:translate3d(-130%,0,0) skewX(-22deg)}
html[data-shine=on] .r-shn.on::before{will-change:transform;animation:rshn 9s ease-in-out infinite}
.r-shn.p::before{animation-play-state:paused!important}
html:not([data-shine=on]) .r-shn{display:none}
@keyframes rshn{0%,12%{transform:translate3d(260%,0,0) skewX(-22deg)}55%,100%{transform:translate3d(-130%,0,0) skewX(-22deg)}}
@media (prefers-reduced-motion:reduce){.r-shn{display:none}}
/* 2) no live blur over scrolling content (backgrounds are already ~95% opaque, so the look is unchanged) */
.tabbar,.player,.reader-bar,.sx-band .sx-m,.hx-ph .ph-b{-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
.tabbar{background:rgba(var(--rc22),.985)}
.hx-ph .ph-b{background:rgba(var(--rc108),.8)}
.reader-bar{background:color-mix(in srgb,var(--card) 97%,transparent)}
/* 3) one static GPU layer for the page pattern; no per-icon filters in long lists */
.bgpat{will-change:transform;transform:translateZ(0);contain:strict}
.medal{filter:none}
