/* 以当前阅读精读为基准；只统一已接入导航，保留宿主菜单和正文。 */
.ep-topbar-desktop,.ep-topbar-compact { --ep-ui:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; --ep-cute:"Comic Sans MS","Marker Felt","Chalkboard SE","PingFang SC","Microsoft YaHei",sans-serif; box-sizing:border-box; }
/* 字体由导航自己管理，避免继承模块正文或被旧按钮字号覆盖。 */
:is(.ep-topbar-desktop,.ep-topbar-compact,.student-workbench-mobilebar) { --ep-nav-ui:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif; --ep-nav-cute:"Comic Sans MS","Marker Felt","Chalkboard SE","PingFang SC","Microsoft YaHei",sans-serif; --ep-nav-title-size:20px; --ep-nav-small-size:9px; --ep-nav-module-size:15px; }
body .ep-topbar-desktop > .capybara-workspace-topbar { font-family:var(--ep-nav-ui); }
body .ep-topbar-desktop .capybara-workspace-topbar :is(.capybara-workspace-module-all,.module-menu-trigger) { font:950 15px/1.15 var(--ep-nav-ui); }
body :is(.ep-topbar-desktop,.ep-topbar-compact) .locale-button { font:950 12px/1.1 var(--ep-nav-ui); }
body :is(.ep-topbar-desktop,.ep-topbar-compact) .desktop-account-brief strong { font:900 13px/1.15 var(--ep-nav-ui); }
body :is(.ep-topbar-desktop,.ep-topbar-compact) .desktop-account-brief span { font:760 12px/1.15 var(--ep-nav-ui); }
body .ep-topbar-compact .ep-topbar-brand strong { font:900 var(--ep-nav-title-size)/1.5 var(--ep-nav-cute); }
body .ep-topbar-compact .ep-topbar-brand small { font:800 var(--ep-nav-small-size)/1.3 var(--ep-ui); }
body .ep-topbar-compact .ep-topbar-modules { font:950 var(--ep-nav-module-size)/1.15 var(--ep-nav-cute); }
/* 学员任务页保留自己的手机栏，仅对齐公共导航文字。 */
body.student-workbench-shell header.student-workbench-mobilebar > strong { font:900 var(--ep-nav-title-size)/1.5 var(--ep-nav-cute); }
body.student-workbench-shell header.student-workbench-mobilebar > :is([data-student-workbench-open-modules],[data-student-workbench-open-account]) { font:950 var(--ep-nav-module-size)/1.15 var(--ep-nav-cute); }
@media(max-width:760px) {
  :is(.ep-topbar-compact,.student-workbench-mobilebar) { --ep-nav-title-size:16px; --ep-nav-small-size:8px; --ep-nav-module-size:12px; }
}
@media(max-width:360px) {
  :is(.ep-topbar-compact,.student-workbench-mobilebar) { --ep-nav-title-size:14px; --ep-nav-small-size:7px; }
}
.ep-topbar-desktop { display:none; }
.ep-topbar-desktop .capybara-workspace-module-menu { gap:5px; }
.ep-topbar-desktop .capybara-workspace-module-all,.ep-topbar-desktop .module-menu-trigger { flex:0 0 auto; padding-inline:8px; white-space:nowrap; }
.ep-topbar-compact.capybara-workspace-topbar {
  position:relative; top:auto; display:flex; flex-wrap:nowrap; align-items:center;
  gap:13px; min-height:64px; height:64px; width:100%; margin:0; padding:8px 16px;
  border:0; border-bottom:1px solid #b6deee; border-radius:0; box-shadow:none; background:#dff5ff;
}
.ep-topbar-compact .ep-topbar-home { flex:none; width:40px; min-width:40px; height:40px; min-height:40px; border-radius:14px; }
.ep-topbar-brand { min-width:0; flex:1; color:#493b33; }
.ep-topbar-brand small { display:block; font:800 9px/1.3 var(--ep-ui); letter-spacing:2px; color:#6896a9; }
.ep-topbar-brand strong { display:block; font:900 20px/1.5 var(--ep-cute); white-space:nowrap; }
.ep-topbar-compact .ep-topbar-account { display:flex; flex:none; width:auto; min-width:0; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px; }
.ep-topbar-account .user-area,.ep-topbar-account .desktop-user-toolbar { min-width:0; width:auto; }
.ep-topbar-account .desktop-user-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.ep-topbar-account .language-switcher,.ep-topbar-account .desktop-notification-trigger,.ep-topbar-account .desktop-account-trigger { border:2px solid rgba(224,211,181,.86); border-radius:15px; background:#fff; box-shadow:0 4px 0 rgba(219,203,166,.32); }
.ep-topbar-account .desktop-account-trigger { min-width:172px; border-color:#bde8b7; background:#f4fff1; }
.ep-topbar-account .desktop-account-brief span { color:#5f5042; font-weight:800; }
/* 账号入口位于顶栏右侧，覆盖旧窄屏的左对齐，避免面板撑出视口。 */
.ep-topbar-compact .desktop-account-popover { left:auto; right:0; }
.ep-topbar-compact .language-switcher { display:flex; }
.ep-topbar-notice,.ep-topbar-avatar { display:none; }
.ep-topbar-modules:not(.capybara-button) { flex:none; width:auto; min-height:40px; padding:8px 13px; border:2px solid rgba(224,211,181,.86); border-radius:15px; background:rgba(255,255,255,.94); color:#493b33; box-shadow:0 4px 0 rgba(219,203,166,.4); font:950 15px/1.15 var(--ep-cute); cursor:pointer; white-space:nowrap; }
.ep-topbar-compact a { text-decoration:none; }
.ep-topbar-compact :is(button,a):focus-visible { outline:3px solid #53b7dc; outline-offset:3px; }
.ep-module-dialog:not(.writing-module-menu) { width:min(520px,calc(100% - 28px)); padding:24px; border:3px solid #eadbb5; border-radius:24px; background:#fffdf4; color:#493b33; box-shadow:0 8px 0 #e3d6b8,0 24px 60px #493b3340; }
.ep-module-dialog:not(.writing-module-menu)::backdrop { background:#45483b66; backdrop-filter:blur(4px); }
.ep-module-dialog:not(.writing-module-menu)>header { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.ep-module-dialog:not(.writing-module-menu) h2 { margin:0; font-size:22px; }
.ep-module-dialog:not(.writing-module-menu) button { width:auto; border:2px solid #eadbb5; border-radius:13px; background:#fff; color:#493b33; padding:8px 14px; cursor:pointer; }
.ep-module-dialog [data-writing-modules-content] { padding:22px 0; text-align:center; }
@media(min-width:761px) and (max-width:1100px) {
  .ep-topbar-compact .desktop-account-trigger { min-width:0; }
  .ep-topbar-compact .desktop-account-brief { display:none; }
}
@media(max-width:1080px) { .ep-topbar-compact.capybara-workspace-topbar { display:flex !important; } }
@media(max-width:760px) {
  .ep-topbar-compact.capybara-workspace-topbar { height:64px; padding:8px 16px; gap:9px; }
  .ep-topbar-compact .ep-topbar-account,.ep-topbar-compact[data-bottom-module-entry] .ep-topbar-modules { display:none; }
  .ep-topbar-brand strong { font-size:16px; }
  .ep-topbar-brand small { font-size:8px; }
  .ep-topbar-compact .ep-topbar-home { width:35px; min-width:35px; height:35px; min-height:35px; }
  .ep-topbar-compact .ep-topbar-notice { display:grid; place-items:center; color:#d87d91; width:28px; flex:none; }
  .ep-topbar-compact .ep-topbar-avatar { display:grid; place-items:center; width:36px; height:36px; padding:4px; border:2px solid #bde6b8; border-radius:14px; background:#f1ffec; flex:none; color:#493b33; cursor:pointer; }
  .ep-topbar-compact .ep-topbar-avatar img { width:100%; }
  .ep-topbar-compact[data-guest] .ep-topbar-avatar { width:auto; min-width:36px; padding:4px 9px; font-size:12px; white-space:nowrap; }
  /* 没有底部模块入口的页面使用同款按钮；长标题自然增高，不遮挡操作。 */
  .ep-topbar-compact:not([data-bottom-module-entry]) { height:auto; min-height:64px; flex-wrap:wrap; }
  .ep-topbar-compact:not([data-bottom-module-entry]) .ep-topbar-brand { min-width:100px; }
  .ep-topbar-compact:not([data-bottom-module-entry]) .ep-topbar-brand strong { white-space:normal; overflow-wrap:normal; }
  .ep-topbar-compact:not([data-bottom-module-entry]) .ep-topbar-modules { padding:6px 9px; min-height:35px; font-size:12px; }
}
@media(max-width:360px) { .ep-topbar-brand strong { font-size:14px; }.ep-topbar-brand small { font-size:7px; } }
@media(max-height:520px) and (max-width:760px) { .ep-topbar-compact.capybara-workspace-topbar { height:48px; padding-block:5px; }.ep-topbar-brand small { display:none; }.ep-topbar-compact:not([data-bottom-module-entry]) { height:auto; } }
@media(min-width:1081px) {
  .ep-topbar-desktop { display:block; min-width:0; padding:18px 18px 0; font-size:15px; }
  .ep-topbar-compact.capybara-workspace-topbar { display:none; }
}

/* 已有工作台自带外层留白，不叠加作文外壳的第二层 padding。 */
[data-workspace-upgraded] .ep-topbar-desktop { padding:0; }
body :is([data-workspace-upgraded],.writing-app-shell) .ep-topbar-desktop > .capybara-workspace-topbar { position:static; top:auto; width:100%; max-width:none; min-height:80px; margin:0; padding:9px var(--workspace-content-x,22px); gap:10px; border:0; border-bottom:1px solid #b6deee; border-radius:0; background:#dff5ff; box-shadow:none; }
body :is([data-workspace-upgraded],.writing-app-shell) .ep-topbar-compact.capybara-workspace-topbar { position:static; top:auto; height:64px; min-height:64px; max-width:none; margin:0; padding:8px 16px; border:0; border-bottom:1px solid #b6deee; border-radius:0; background:#dff5ff; box-shadow:none; }
[data-workspace-upgraded] .ep-topbar-avatar { min-height:36px; line-height:1; }
@media(min-width:761px) {
  [data-workspace-upgraded] .ep-topbar-account .user-area { display:block!important; }
  [data-workspace-upgraded] .ep-topbar-account .desktop-user-toolbar { display:flex!important; }
}
@media(min-width:761px) and (max-width:1080px) {
  [data-workspace-upgraded] .ep-topbar-compact { height:auto; min-height:64px; flex-wrap:wrap; }
  [data-workspace-upgraded] .ep-topbar-brand { min-width:150px; }
  [data-workspace-upgraded] .ep-topbar-brand strong { white-space:normal; }
}
.ep-topbar-tools { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 14px; }
.ep-topbar-tools:empty { display:none; }
.ep-topbar-tools button,.ep-topbar-tools a { display:inline-flex; align-items:center; gap:6px; width:auto; min-height:36px; padding:6px 12px; border:2px solid #eadbb5; border-radius:13px; box-shadow:0 3px 0 #e8dec6; background:#fffdf6; color:#493b33; font-size:13px; font-weight:800; text-decoration:none; }
.ep-topbar-tools .ep-topbar-local-mobile { display:none; }
@media(max-width:1080px) {
  .ep-topbar-tools .ep-topbar-local-mobile { display:inline-flex; }
  .ep-topbar-tools .ep-topbar-local-desktop { display:none; }
}
@media print { [data-workspace-upgraded] :is(.ep-topbar-desktop,.ep-topbar-compact,.ep-topbar-tools) { display:none!important; } }

/* 仅隐藏本批已迁移页面的旧栏；旧标题引用和其他路由继续保留。 */
.app-shell > .main > .topbar.ep-topbar-legacy-hidden { display:none!important; }
[data-workspace-global] { min-width:0; width:100%; }
[data-workspace-global] .ep-topbar-tools #sidebar-toggle { display:inline-flex; width:auto; }
[data-workspace-global] .ep-topbar-tools #sidebar-toggle[hidden] { display:none; }
body [data-workspace-global] .ep-topbar-compact > #sidebar-toggle { display:inline-flex; flex:none; align-items:center; justify-content:center; width:36px; min-width:36px; height:36px; min-height:36px; padding:4px; border:2px solid rgba(224,211,181,.86); border-radius:14px; background:#fffefa; box-shadow:none; color:#493b33; }
body [data-workspace-global] .ep-topbar-compact > #sidebar-toggle[hidden] { display:none!important; }
body [data-workspace-global] [data-workspace-sidebar-label] { display:none; }
body .ep-topbar-compact > .ep-sidebar-open { flex:none; align-items:center; justify-content:center; width:36px; min-width:36px; height:36px; min-height:36px; margin:0; padding:4px; border-radius:14px; box-shadow:none; font-size:18px; }
@media(min-width:761px) {
  body .ep-sidebar-shell[data-ep-sidebar="global"] [data-workspace-global] .ep-topbar-compact > #sidebar-toggle { display:none; }
}

/* 账号及通知面板使用阅读页的可见区域边界；不改菜单内容和事件。 */
body .capybara-workspace-topbar :is(.desktop-account-popover,.desktop-notification-popover) { left:auto; right:0; width:min(390px,calc(100vw - 28px)); max-height:calc(100dvh - 110px); overflow:auto; }
body .capybara-workspace-topbar .module-menu-panel { max-width:calc(100vw - 28px); max-height:calc(100dvh - 150px); overflow:auto; }
@media(min-width:761px) and (max-width:1100px) {
  body .ep-topbar-compact .desktop-account-trigger { grid-template-columns:34px 14px; width:max-content; min-width:0; max-width:none; }
}
@media(max-width:900px) {
  body :is([data-workspace-upgraded],.writing-app-shell) .ep-topbar-desktop > .capybara-workspace-topbar { padding-inline:var(--workspace-content-x,14px); }
}
@media(max-width:560px) {
  body :is([data-workspace-upgraded],.writing-app-shell) .ep-topbar-compact.capybara-workspace-topbar { height:auto; min-height:60px; padding:6px 10px; gap:8px; }
}
/* 极窄屏先压缩品牌装饰和间距，保持账号、通知、模块入口可见。 */
@media(max-width:360px) {
  body :is([data-workspace-upgraded],.writing-app-shell) .ep-topbar-compact.capybara-workspace-topbar { gap:5px; }
  body :is([data-workspace-upgraded],.writing-app-shell) .ep-topbar-compact .ep-topbar-brand { min-width:0; }
  body .ep-topbar-compact .ep-topbar-brand small { display:none; }
  body [data-workspace-global][data-workspace-directory] .ep-topbar-compact .ep-topbar-brand { min-width:75px; }
}

/* 首屏入口样式随导航就绪，避免等待宠物资料时按钮无尺寸。 */
.ep-topbar-compact > .spc-mobile-entry { display:none; }
@media(max-width:760px) {
  body .ep-topbar-compact > .spc-mobile-entry { position:relative; display:grid; place-items:center; flex:none; width:36px; min-width:36px; height:36px; min-height:36px; padding:4px; border:1.25px solid #ded8cb; border-radius:13px; background:#fff5d7; box-shadow:none; cursor:pointer; }
  body .ep-topbar-compact > .spc-mobile-entry img { width:100%; height:100%; object-fit:contain; }
  body .ep-topbar-compact:has(> .spc-mobile-entry) { flex-wrap:nowrap; }
  body .ep-topbar-compact:has(> .spc-mobile-entry) .ep-topbar-brand { flex:1 1 0; min-width:0; }
  body .ep-topbar-compact:has(> .spc-mobile-entry) .ep-topbar-brand strong { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  body .ep-topbar-compact > .ep-topbar-local-mobile { display:inline-flex; align-items:center; justify-content:center; flex:none; width:36px; min-width:36px; height:36px; min-height:36px; padding:4px; border:1.5px solid #ded8cb; border-radius:14px; background:#fffefa; box-shadow:none; }
}
@media(max-width:360px) {
  body :is([data-workspace-upgraded],.writing-app-shell) .ep-topbar-compact:has(> .spc-mobile-entry) { gap:4px; padding-inline:8px; }
  body .ep-topbar-compact:has(> .spc-mobile-entry) > :is(.ep-sidebar-open,.ep-topbar-local-mobile,.ep-topbar-home,.spc-mobile-entry,.ep-topbar-avatar) { width:32px; min-width:32px; }
  body .ep-topbar-compact:has(> .spc-mobile-entry) > .ep-topbar-modules { padding-inline:5px; }
  body .ep-topbar-compact:has(> .spc-mobile-entry) > .ep-topbar-notice { width:24px; }
}
