/* 只作用于已接入的侧栏；选择器权重高于旧模块样式，避免按需加载顺序改变外观。 */
body .ep-sidebar-shell[data-ep-sidebar][data-ep-sidebar] { --ep-side:162px; grid-template-columns:var(--ep-side) minmax(0,1fr); }
body .ep-sidebar-shell.ep-sidebar-collapsed[data-ep-sidebar][data-ep-sidebar] { --ep-side:78px; }
body .ep-sidebar-shell[data-ep-sidebar][data-ep-sidebar]>.ep-sidebar,
body .ep-sidebar-dialog>.ep-sidebar { box-sizing:border-box; position:sticky; inset:auto; top:0; display:flex; flex-direction:column; align-items:center; width:var(--ep-side,162px); height:100dvh; min-height:0; gap:12px; padding:16px 12px; overflow:visible; border:0; border-right:4px dashed #a6daf0; background:linear-gradient(180deg,#dff6fffa,#cdeffcfa); font-family:'Comic Sans MS','Marker Felt','Chalkboard SE','PingFang SC','Microsoft YaHei',sans-serif; z-index:45; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar * { box-sizing:border-box; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-brand { flex:none; display:grid; justify-items:center; gap:12px; width:100%; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-avatar { display:grid; place-items:center; width:72px; height:72px; min-height:72px; flex:none; padding:0; border:0; border-radius:50%; overflow:hidden; background:#fff; box-shadow:0 8px 18px #604a2e29; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-avatar img { width:84%; height:84%; object-fit:contain; transform:none; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-title { margin:0; color:#1685c1; font-size:20px; font-weight:950; line-height:1.15; text-align:center; text-shadow:0 2px 0 white; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-scroll { flex:1; min-height:0; width:calc(100% + 12px); padding:8px 6px 12px; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#88cce2 transparent; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-nav { display:grid; gap:10px; width:100%; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-nav .ep-sidebar-item { position:relative; display:grid; place-items:center; align-content:center; gap:4px; min-height:72px; width:100%; padding:7px 6px; margin:0; border:2px solid #e8dbb8d9; border-radius:20px; background:#ffffffdb; box-shadow:0 7px 16px #3389b11c; color:#47382e; text-align:center; text-decoration:none; cursor:pointer; transform:none; font-family:inherit; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-nav .ep-sidebar-item::after { content:none; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-nav .ep-sidebar-item.active { border-color:#58cf67; background:linear-gradient(180deg,#f7fff5,#eaffea); box-shadow:inset 0 0 0 2px #58cf6747,0 9px 16px #36ae4926; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-item>.ep-sidebar-emoji { font-size:24px; line-height:1; color:inherit; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-item>:is(strong,.nav-link-label,.module-side-label) { margin:0; max-width:100%; white-space:normal; word-break:normal; font-size:12.5px; font-weight:950; line-height:1.35; color:#47382e; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-item>.ep-sidebar-count { position:absolute; top:-7px; right:-5px; display:grid; place-items:center; min-width:25px; height:25px; padding:0 5px; border:2px solid white; border-radius:999px; background:#ff8ea1; color:white; font:950 12px/1 system-ui; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-footer { flex:none; width:100%; display:grid; gap:8px; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar :is(.ep-sidebar-fold,.ep-sidebar-help) { display:flex; align-items:center; justify-content:center; width:100%; min-height:38px; margin:0; padding:6px 3px; border:2px solid #e8dbb8d9; border-radius:13px; background:#ffffffdb; color:#756b56; font-family:inherit; font-size:11px; line-height:1.5; text-decoration:none; cursor:pointer; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-help { border-color:#bfd7e4; color:#66738a; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-help { text-align:center; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-nav .ep-sidebar-item:not(.active):hover { background:#f1fbff; border-color:#96cfe3; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar :is(a,button):focus-visible { outline:3px solid #1685c1; outline-offset:2px; }
body .ep-sidebar-shell.ep-sidebar-collapsed[data-ep-sidebar]>.ep-sidebar { padding:10px 6px; gap:8px; border-right-width:3px; }
body .ep-sidebar-shell.ep-sidebar-collapsed[data-ep-sidebar] .ep-sidebar-brand { gap:8px; }
body .ep-sidebar-shell.ep-sidebar-collapsed[data-ep-sidebar] .ep-sidebar-avatar { width:48px; height:48px; min-height:48px; }
body .ep-sidebar-shell.ep-sidebar-collapsed[data-ep-sidebar] .ep-sidebar-title { font-size:13px; }
body .ep-sidebar-shell.ep-sidebar-collapsed[data-ep-sidebar] .ep-sidebar-help { font-size:10px; }
body .ep-sidebar-shell.ep-sidebar-collapsed[data-ep-sidebar] .ep-sidebar-nav .ep-sidebar-item { min-height:56px; border-radius:16px; padding:5px 3px; }
body .ep-sidebar-shell.ep-sidebar-collapsed[data-ep-sidebar] .ep-sidebar-item>.ep-sidebar-emoji { font-size:19px; }
body .ep-sidebar-shell.ep-sidebar-collapsed[data-ep-sidebar] .ep-sidebar-item>:is(strong,.nav-link-label,.module-side-label) { font-size:10.5px; }
body .ep-sidebar-shell.ep-sidebar-collapsed[data-ep-sidebar] .ep-sidebar-item>.ep-sidebar-count { top:-5px; right:-3px; min-width:22px; height:22px; font-size:10px; }
body .ep-sidebar-shell.ep-sidebar-collapsed[data-ep-sidebar] .ep-sidebar-nav .ep-sidebar-item:has(.ep-sidebar-count) { padding-top:17px; }
body .ep-sidebar-open,body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-close { display:none; }
body .ep-sidebar-dialog { padding:0; margin:0; inset:0 auto 0 0; width:min(264px,calc(100vw - 48px)); max-width:none; height:100dvh; max-height:none; border:0; border-radius:0; background:#dff6ff; overflow:visible; }
body .ep-sidebar-dialog::backdrop { background:#493b3359; }
/* 第二批只改变侧栏占位，不接管课表与任务主体布局。 */
body .ep-sidebar-shell[data-ep-sidebar="global"][data-ep-sidebar] { display:grid; }
/* 宠物旧断点仍保留给未接入外壳，已接入时统一为 162px / 78px。 */
body[data-active-module="study-pet"] .ep-sidebar-shell[data-ep-sidebar][data-ep-sidebar] { grid-template-columns:var(--ep-side) minmax(0,1fr); }
body .ep-sidebar-shell[data-ep-sidebar="global"]>.main { width:100%; min-width:0; }
body .ep-sidebar-shell[data-ep-sidebar="global"]>.ep-sidebar,
body .ep-sidebar-dialog>#app-sidebar.ep-sidebar { transform:none; visibility:visible; backdrop-filter:none; box-shadow:none; }
body .ep-sidebar-shell[data-ep-sidebar="student"] { --student-side-width:var(--ep-side); }
body .ep-sidebar-shell[data-ep-sidebar="student"]>.student-workbench-main { min-width:0; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar :is(.sidebar-head .ep-sidebar-brand,.nav-list,.nav-link,.module-side-section .ep-sidebar-item) { grid-template-columns:minmax(0,1fr); }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-brand::after,
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-emoji::before { content:none; display:none; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .sidebar-head { display:block; flex:none; width:100%; margin:0; padding:0; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .sidebar-head .brand { gap:12px; padding:0; margin:0; border:0; background:none; box-shadow:none; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .sidebar-head .brand>div:not(.brand-mark) { min-width:0; text-align:center; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .sidebar-head .brand>div>span,
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar #sidebar-close { display:none; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-title { display:block; white-space:normal; overflow:visible; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-emoji { display:block; width:auto; height:auto; background:none; border:0; padding:0; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .module-side-section { display:grid; gap:10px; padding:0; margin:0; border:0; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .module-side-section>strong { margin:6px 0 0; color:#648697; font-size:10px; border-bottom:2px dashed #a6daf0; padding-bottom:6px; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-item>.ep-sidebar-done { position:absolute; top:-7px; right:-5px; display:grid; place-items:center; width:25px; height:25px; border:2px solid white; border-radius:50%; background:#58cf67; color:white; font:950 13px/1 system-ui; }
body .ep-sidebar-shell.ep-sidebar-collapsed[data-ep-sidebar] .ep-sidebar-item:has(.ep-sidebar-done) { padding-top:17px; }
/* 第三批保留模块主体，只统一目录；清除旧伪元素图标和头像背景。 */
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-emoji::after { content:none; display:none; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-avatar { background-image:none; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-title { width:auto; max-width:100%; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ep-sidebar .ep-sidebar-label { margin:0; max-width:100%; white-space:normal; word-break:normal; font-size:12.5px; font-weight:950; line-height:1.35; }
body .ep-sidebar-shell.ep-sidebar-collapsed[data-ep-sidebar] .ep-sidebar .ep-sidebar-label { font-size:10.5px; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .grammar-rail .ep-sidebar-scroll { flex-shrink:1; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .grammar-rail .grammar-integrations { margin-top:12px; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .grammar-rail .ep-sidebar-avatar img { padding:0; border-radius:0; background:none; box-shadow:none; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .grammar-brand small { display:none; }
/* 写作外壳仍保留独立练习和范文阅读；仅接管内层目录占位。 */
body .ket-shell .ep-sidebar-shell[data-ep-sidebar="writing-practice"]>.ep-sidebar { grid-column:1; }
body :is(.ep-sidebar-shell[data-ep-sidebar],.ep-sidebar-dialog) .ket-sidebar-brand>.ep-sidebar-title { padding:0; border:0; background:none; box-shadow:none; }
/* 阅读页的中等屏幕侧栏尺寸统一为公共规则，保留收起与手机抽屉。 */
@media(min-width:901px) and (max-width:1279px) {
  body .ep-sidebar-shell[data-ep-sidebar][data-ep-sidebar]:not(.ep-sidebar-collapsed) { --ep-side:90px; }
  body .ep-sidebar-shell[data-ep-sidebar][data-ep-sidebar] > .ep-sidebar { padding:12px 6px; gap:10px; }
  body .ep-sidebar-shell[data-ep-sidebar] .ep-sidebar .ep-sidebar-avatar { width:52px; height:52px; min-height:52px; }
  body .ep-sidebar-shell[data-ep-sidebar] .ep-sidebar .ep-sidebar-title { font-size:14px; line-height:1.4; white-space:nowrap; }
  body .ep-sidebar-shell[data-ep-sidebar] .ep-sidebar-item { min-height:64px!important; }
  body .ep-sidebar-shell[data-ep-sidebar] .ep-sidebar .ep-sidebar-fold { font-size:10px; white-space:nowrap; padding-inline:0; }
}
@media print {
 body .ket-shell .ep-sidebar-shell[data-ep-sidebar="writing-practice"] { display:block; }
 body .ket-shell .ep-sidebar-shell[data-ep-sidebar="writing-practice"]>.ep-sidebar,
 body .ket-shell .ep-sidebar-open { display:none!important; }
}
/* 桌面已有侧栏收起入口；只移除重复目录及其独占工具行，手机仍保留。 */
@media(min-width:761px) {
 body .ep-sidebar-shell[data-ep-sidebar="global"] #sidebar-toggle { display:none; }
 body .ep-sidebar-shell[data-ep-sidebar="global"] [data-workspace-global]>.ep-topbar-tools:has(>#sidebar-toggle:only-child) { display:none; }
}
@media(max-width:760px) {
 body .ep-sidebar-shell[data-ep-sidebar][data-ep-sidebar] { display:block; }
 body .ep-sidebar-shell[data-ep-sidebar="student"] { background:none; }
 body .ep-sidebar-shell[data-ep-sidebar="student"]>.student-workbench-main { width:100%; margin:0; }
 body .ep-sidebar-shell[data-ep-sidebar][data-ep-sidebar]>.ep-sidebar { display:none !important; }
 body .ep-sidebar-open { display:inline-flex; align-items:center; width:auto; min-height:40px; padding:7px 12px; margin:0 0 14px; border:2px solid #e6d9b8; border-radius:14px; box-shadow:0 4px 0 #dfd2ac55; background:#fffefa; color:#493b33; font-size:13px; font-weight:800; cursor:pointer; }
 body .ep-sidebar-dialog.ep-sidebar-dialog>.ep-sidebar { position:relative; width:100%; height:100%; padding:16px 12px; }
 body .ep-sidebar-dialog.ep-sidebar-dialog .ep-sidebar .ep-sidebar-avatar { width:60px; height:60px; min-height:60px; }
 body .ep-sidebar-dialog.ep-sidebar-dialog .ep-sidebar .ep-sidebar-nav .ep-sidebar-item { display:flex; flex-direction:row; justify-content:flex-start; gap:12px; min-height:56px; padding:10px 14px; border-radius:17px; text-align:left; }
 body .ep-sidebar-dialog.ep-sidebar-dialog .ep-sidebar .ep-sidebar-item>:is(strong,.nav-link-label,.module-side-label) { flex:1; font-size:14px; }
 body .ep-sidebar-dialog.ep-sidebar-dialog .ep-sidebar .ep-sidebar-label { flex:1; font-size:14px; }
 body .ep-sidebar-dialog.ep-sidebar-dialog .ep-sidebar .ep-sidebar-fold { display:none; }
 body .ep-sidebar-dialog.ep-sidebar-dialog .ep-sidebar .ep-sidebar-close { display:grid; place-items:center; position:absolute; z-index:2; right:8px; top:8px; width:36px; height:36px; padding:0; border:2px solid #b8dcea; border-radius:13px; background:#fffefa; font-size:20px; cursor:pointer; }
}
