/* 液态玻璃视觉层：只负责外观与响应式位置，不定义业务数据或页面跳转。 */
:root {
  --liquid-glass: rgba(255, 255, 255, .10);
  --liquid-border: rgba(255, 255, 255, .64);
  --liquid-shadow: 0 10px 32px rgba(39, 74, 108, .085),
    0 2px 5px rgba(39, 74, 108, .035),
    inset 0 0 0 1px rgba(255, 255, 255, .82),
    inset 0 3px 5px rgba(255, 255, 255, .22),
    inset 0 -2px 3px rgba(var(--theme-rgb-1, 89,139,253), .17);
  --liquid-ease: cubic-bezier(.22, .7, .2, 1);
  --glass-blur: blur(28px) saturate(170%);
  --glass-blur-strong: blur(28px) saturate(170%);
  --glass-blur-light: none;
  --header-blur: blur(28px) saturate(170%);
  --glass-bg: var(--liquid-glass);
  --glass-bg-light: var(--liquid-glass);
  --lens-body: var(--liquid-glass);
  --lens-surface: var(--liquid-glass);
  --header-bg: var(--liquid-glass);
  --glass-refraction: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='lens' x='-20%25' y='-20%25' width='140%25' height='140%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.018 .055' numOctaves='2' seed='7' result='waves'/%3E%3CfeGaussianBlur in='waves' stdDeviation='2.5' result='folds'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='folds' scale='52' xChannelSelector='R' yChannelSelector='G'/%3E%3C/filter%3E%3C/svg%3E%23lens");
  /* SVG 位移在独立图像内计算一次，浏览器缓存后复用；不再逐帧扭曲整块背景。 */
  --liquid-rim-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='960' height='32' viewBox='0 0 960 32' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='rim' x2='0' y2='1'%3E%3Cstop stop-color='%23ffffff' stop-opacity='.95'/%3E%3Cstop offset='.32' stop-color='%23ffffff' stop-opacity='.38'/%3E%3Cstop offset='.60' stop-color='%23578baa' stop-opacity='.24'/%3E%3Cstop offset='1' stop-color='%23d6f6ff' stop-opacity='0'/%3E%3C/linearGradient%3E%3Cfilter id='fold' x='-5%25' y='-100%25' width='110%25' height='300%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006 .025' numOctaves='1' seed='7' result='wave'/%3E%3CfeGaussianBlur in='wave' stdDeviation='3' result='soft'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='soft' scale='52' xChannelSelector='R' yChannelSelector='G'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M0 9Q240 0 480 9T960 9V32H0Z' fill='url(%23rim)' filter='url(%23fold)'/%3E%3C/svg%3E");
  --lens-edge-filter: none;
  --lens-depth: var(--liquid-shadow);
  --glass-sheen: rgba(255,255,255,.24);
  --glass-rim-light: rgba(255,255,255,.86);
  --glass-rim-shade: rgba(55,105,146,.12);
  --text-primary: #23394b;
  --text-secondary: #4c6172;
  --text-tertiary: #5c7183;
  --text-placeholder: #627a90;
  --radius-sm: 18px;
  --radius-md: 22px;
  --radius-lg: 26px;
  --radius-xl: 32px;
  --radius-2xl: 38px;
  --surface: #f5faff;
  --surface-2: #eaf3fb;
  --surface-3: #deedf8;
  --input-border: rgba(66, 117, 164, .20);
  --input-focus-ring: rgba(54, 137, 206, .15);
  /* 大面积色域在整个视口内融合；亮度适当压低，深色正文始终清晰。
     背景不做持续位移动画，也不在滚动中改写变量。 */
  --ui-page-background:
    linear-gradient(115deg, rgba(255,255,255,.22), transparent 58%),
    radial-gradient(ellipse 150% 125% at var(--theme-origin, 0% 78%), rgba(var(--theme-rgb-1, 89,139,253), .63), transparent 66%),
    radial-gradient(ellipse 130% 150% at 100% 105%, rgba(var(--theme-rgb-2, 154,212,203), .78), transparent 72%),
    linear-gradient(155deg, rgba(var(--theme-rgb-3, 53,179,201), .49),
      rgba(var(--theme-rgb-2, 154,212,203), .28) 54%, rgba(var(--theme-rgb-1, 89,139,253), .25)),
    #f1f6ff;
  --ui-hero-background:
    linear-gradient(115deg, rgba(255,255,255,.12), rgba(var(--theme-rgb-3, 53,179,201), .05) 46%, rgba(var(--theme-rgb-2, 154,212,203), .12));
}

/* 默认浅色蓝主题参照官网的蓝白基调：大片低浓度弥散，不再铺满蓝绿色。
   仅降低底层色彩浓度，玻璃的模糊、饱和度、透明白底和折光层保持原样。 */
:root:not([data-theme="dark"]):is(:not([data-theme-preset]), [data-theme-preset="blue"]) {
  --ui-page-background:
    radial-gradient(ellipse 100% 90% at 0% 22%, rgba(var(--theme-rgb-1), .18), transparent 72%),
    radial-gradient(ellipse 110% 100% at 100% 82%, rgba(var(--theme-rgb-3), .20), transparent 74%),
    linear-gradient(145deg, #f2f6fc, #eef5fc 52%, #f6f9fd);
  --ui-hero-background:
    radial-gradient(ellipse 90% 95% at 12% 36%, rgba(var(--theme-rgb-1), .16), transparent 74%),
    radial-gradient(ellipse 85% 95% at 92% 76%, rgba(var(--theme-rgb-3), .18), transparent 75%),
    linear-gradient(120deg, rgba(255,255,255,.26), rgba(255,255,255,.06));
}

[data-theme="dark"] {
  --text-primary: #edf6ff;
  --text-secondary: #c3d7e8;
  --text-tertiary: #afc7da;
  --text-placeholder: #a9bfd1;
  --surface: #182b3d;
  --surface-2: #182b3d;
  --surface-3: #22394d;
  --liquid-border: rgba(220, 239, 255, .30);
  --liquid-shadow: 0 8px 28px rgba(7, 19, 30, .20),
    inset 0 0 0 1px rgba(236, 248, 255, .18),
    inset 0 -1px 1px rgba(91, 159, 197, .10);
  --glass-sheen: rgba(235,246,255,.12);
  --glass-rim-light: rgba(235,246,255,.38);
  --glass-rim-shade: rgba(70,125,160,.18);
  --lens-depth: var(--liquid-shadow);
  --ui-page-background:
    radial-gradient(ellipse 150% 125% at var(--theme-origin, 0% 78%), rgba(var(--theme-rgb-1), .20), transparent 66%),
    radial-gradient(ellipse 130% 150% at 100% 105%, rgba(var(--theme-rgb-2), .16), transparent 72%),
    linear-gradient(155deg, rgba(var(--theme-rgb-3), .12), transparent), #15222d;
  --ui-hero-background: linear-gradient(115deg, rgba(var(--theme-rgb-1), .04), rgba(var(--theme-rgb-2), .06));
}

/* 只替换页面装饰背景；原页面 img 的 src 和自习室场景选择功能保持原样。 */
html { scroll-behavior: smooth; }
[data-student-only][hidden], .detail-nav-row[hidden], .related-section[hidden] {
  display: none !important;
}
body:not(:has(.room)) {
  background: var(--surface) !important;
}
/* 渐变由一张固定背景层承载，不使用 background-attachment:fixed。
   滚动时不用反复绘制整页渐变；主题切换仍即时作用于同一层。 */
body:not(:has(.room))::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--ui-page-background) !important;
  transform: translateZ(0);
  animation: none !important;
  pointer-events: none;
}
body:not(:has(.room))::after { display: none; animation: none !important; background-image: none !important; }
.floating-orbs, .cursor-glow { display: none !important; }
/* 滚动后出现的返回顶部按钮保留静态高光，避免旧主题的循环发光常驻绘制。 */
#backTop::after { animation: none !important; }
/* 官网是可直接阅读的静态内容，不用整屏转圈遮住已就绪的页面。 */
#loader { display: none !important; }

/* 连续曲率由 corner-shape 提供；大半径 border-radius 是旧浏览器的降级轮廓。 */
:is(.banner, .header, .study-topbar, .workbench-topbar, .admin-sidebar, .teacher-nav,
  .student-portal-nav, .workbench-sidebar, .study-sidebar, .login-card,
  .card, .intro, .join-card, .news-card, .news-detail-card, .product-card,
  .account-card, .feature-card, .contact-form, .brand-info,
  .study-card, .practice-dialog, .portal-card, .achievement-item,
  .notice-item, .feedback-item, .membership-plan, .student-feature-center,
  .student-feature-links a, .workbench-panel, .workbench-stat-card,
  .workbench-study-entry, .workbench-profile-card, .workbench-account-grid a,
  .workbench-feature-grid a, .workbench-subject-grid a, .quick-card,
  .workbench-announcement, .workbench-focus-card, .admin-help, .study-notice,
  .modal-content, .settings-panel, .workbench-search-results, .theme-preset, .toast) {
  border: 1px solid var(--liquid-border) !important;
  border-radius: 34px !important;
  corner-shape: squircle;
  background: var(--liquid-glass) !important;
  box-shadow: var(--liquid-shadow) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
/* 连续弥散背景下，重复卡片无需再次模糊相同颜色。
   保留 10% 白底、内亮边与缓存折光；实时 28px/170% 采样只用于覆盖内容的浮层。 */
:root :is(.header, .study-topbar, .workbench-topbar, .admin-sidebar,
  .teacher-nav, .student-portal-nav, .workbench-sidebar, .login-card,
  .modal-content, .settings-panel, .practice-dialog, .workbench-search-results) {
  -webkit-backdrop-filter: var(--glass-blur) !important;
  backdrop-filter: var(--glass-blur) !important;
}
/* 三层材质：上面的单层实时模糊是底层；细窄 SVG 位移褶皱是折光层；
   此处的静态斜向反光是表面层。高光不再叠加一次背景采样。 */
:root :is(.header, .study-topbar, .workbench-topbar, .admin-sidebar, .teacher-nav,
  .student-portal-nav, .workbench-sidebar, .login-card, .card, .intro,
  .study-card, .portal-card, .workbench-panel, .workbench-announcement,
  .workbench-stat-card, .modal-content, .settings-panel, .practice-dialog) {
  background-image: linear-gradient(132deg, rgba(255,255,255,.16), transparent 35%,
    transparent 73%, rgba(255,255,255,.06)) !important;
}
/* 每个表面只保留一层实时模糊。遮罩将缓存的 SVG 褶皱与明暗偏移限定在轮廓，
   不给文字加滤镜，也不再用一条厚白带冒充玻璃厚度。 */
:is(.liquid-nav-floating, .header, .study-topbar, .workbench-topbar, .admin-sidebar, .teacher-nav,
  .student-portal-nav, .workbench-sidebar, .login-card, .study-card,
  .card, .intro, .brand-info, .news-card, .news-detail-card, .product-card,
  .account-card, .feature-card, .contact-form, .portal-card,
  .workbench-panel, .workbench-stat-card, .workbench-study-entry,
  .workbench-announcement, .quick-card, .modal-content, .settings-panel,
  .workbench-search-results, .practice-dialog)::before {
  content: "";
  display: block !important;
  position: absolute;
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 2px;
  z-index: 0;
  border: 0;
  border-radius: inherit !important;
  corner-shape: squircle;
  pointer-events: none;
  background: var(--liquid-rim-image) center top / 100% 18px no-repeat,
    var(--liquid-rim-image) center bottom / 100% 12px no-repeat,
    linear-gradient(137deg, rgba(255,255,255,.64), rgba(255,255,255,.08) 31%,
      rgba(var(--theme-rgb-1), .32) 58%, rgba(255,255,255,.65)) !important;
  box-shadow: none !important;
  opacity: .9;
  transform: none !important;
  filter: none !important;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
  -webkit-mask-composite: xor !important;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
  mask-composite: exclude !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  transition: opacity .36s ease;
}
/* 清除旧版第二道折射层和整块遮罩，避免双重高光与重复合成。 */
:is(.header, .study-topbar, .workbench-topbar, .admin-sidebar, .teacher-nav,
  .student-portal-nav, .workbench-sidebar, .study-sidebar, .login-card,
  .card, .intro, .brand-info, .news-card, .news-detail-card, .product-card,
  .account-card, .feature-card, .contact-form, .study-card, .portal-card,
  .workbench-panel, .workbench-stat-card, .workbench-study-entry,
  .workbench-profile-card, .workbench-account-grid a, .workbench-subject-grid a,
  .quick-card, .modal-content, .settings-panel, .workbench-search-results, .practice-dialog)::after {
  display: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
}
/* 静态子控件复用父层玻璃，不再在玻璃里面嵌套模糊玻璃。 */
:is(.header, .study-topbar, .workbench-topbar, .admin-sidebar, .teacher-nav,
  .student-portal-nav, .workbench-sidebar, .login-card, .study-card,
  .portal-card, .workbench-panel, .workbench-study-entry, .workbench-profile-card,
  .workbench-announcement, .card, .contact-form, .modal-content, .settings-panel)
  :is(button, input, select, textarea, .nav-links a, .site-nav-links a,
    .study-action-btn, .workbench-nav a, .admin-sidebar a, .teacher-nav a,
    .study-notice, .admin-help, .workbench-subject-grid a, .workbench-feature-grid a,
    .workbench-account-grid a, .login-tabs, .practice-mode-tabs) {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
:is(.login-tabs, .practice-mode-tabs)::before {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: rgba(255,255,255,.35) !important;
  box-shadow: inset 0 0 0 1px var(--liquid-border), 0 2px 7px rgba(30,70,110,.05) !important;
}
.study-page :is(.login-tabs, .practice-mode-tabs).ui-segments::before {
  width: var(--segment-width, 0px);
  border-radius: 18px !important;
  corner-shape: squircle;
  transform: translateX(calc(var(--segment-x, 0px) + var(--segment-drag-x, 0px)));
  transition: transform .36s var(--liquid-ease), width .36s var(--liquid-ease), opacity .24s ease;
}
.mobile-menu, .mobile-overlay { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.mobile-menu::after { display: none !important; }
/* 数据生成的提示和列表仍用玻璃轮廓，直接继承父面板的模糊采样结果。 */
:is(.study-card, .portal-card, .workbench-panel, .workbench-study-entry, .settings-panel)
  :is(.study-card, .portal-card, .membership-plan, .notice-item, .feedback-item,
    .achievement-item, .theme-preset, .workbench-subject-grid a, .workbench-feature-grid a) {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.workbench-app :is(.workbench-profile-card, .workbench-account-grid a,
  .workbench-feature-grid a, .workbench-subject-grid a, .stats-advice div)::before {
  display: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
}
/* 统一导航由独立 UI 模块控制，旧菜单壳及开关保持隐藏，避免出现重复入口。 */
.header .hamburger, .mobile-menu, .mobile-overlay { display: none !important; }

/* 官网阅读区域限制行长，保持原文字、顺序和链接，只调整字号、留白及容器宽度。 */
.container { max-width: 1180px; padding: 128px 24px 64px; z-index: auto; }
.container > .section-title:first-child { margin-top: 8px; }
.section-title { margin: 44px 0 28px; font-size: 26px; letter-spacing: 0; text-shadow: none; }
.section-title::before { display: none; animation: none !important; }
.section-title::after { height: 3px; width: 32px; margin-top: 12px; opacity: .64; animation: none; }
.intro, .brand-info { position: relative; padding: 30px 34px; }
.intro p, .brand-info p { line-height: 1.95; color: var(--text-secondary); }
.card-box { gap: 20px; }
.card { padding: 28px 24px; transition: transform .22s var(--liquid-ease) !important; }
.card h3 { font-size: 19px; }
.card p { font-size: 14px; line-height: 1.85; }
.avatar-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  corner-shape: squircle;
  border: 1px solid rgba(255,255,255,.72);
  background: var(--accent-light);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.80);
  font-size: 29px;
}
.card:hover .avatar-placeholder { transform: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.80); }
.workbench-app :is(.quick-card, .workbench-announcement) { color: var(--text-primary) !important; }
.workbench-app :is(.quick-card small, .workbench-announcement p) { color: var(--text-secondary) !important; }
.workbench-app .workbench-announcement .workbench-text-link { color: var(--accent) !important; }
.workbench-app .workbench-announcement .study-button-primary { color: var(--text-primary) !important; }
.workbench-app .workbench-announcement .announcement-orbit span { color: var(--text-primary); }
/* 工作台的专注卡只替换装饰底图，自习室本身仍保留原有场景功能。 */
.workbench-app .focus-scene { background: var(--ui-hero-background) !important; }
.workbench-app .focus-scene-shade { background: none; }
.workbench-app .focus-scene-copy { color: var(--text-primary); }
.workbench-app .focus-scene-copy strong { color: var(--accent); }
.workbench-app .focus-scene-copy small { color: var(--text-secondary); }
.workbench-app .focus-scene-copy .study-action-btn {
  color: var(--accent);
  border: 1px solid var(--liquid-border);
  background: var(--liquid-glass);
}

/* 首页延续原有品牌与入口位置，以通透浅蓝色带替代山景。首屏不套浮动卡片外框。 */
.home-page .container { padding-top: 88px; }
.home-page .banner {
  min-height: min(590px, calc(100svh - 140px));
  padding: 64px 24px 62px;
  margin-bottom: 36px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  color: var(--text-primary);
}
.home-page .banner-photo {
  background: var(--ui-hero-background) !important;
  animation: none;
}
.home-page .banner-logo {
  width: 76px;
  height: 76px;
  margin-bottom: 24px;
  border-radius: 24px !important;
  corner-shape: squircle;
  border: 1px solid var(--liquid-border);
  background: var(--liquid-glass);
  box-shadow: var(--liquid-shadow);
}
.home-page .banner h1 {
  display: block;
  font-size: 60px;
  color: var(--text-primary);
  text-shadow: none;
  letter-spacing: 0;
}
/* 品牌标题使用柔和浅蓝；正文仍保留深色，避免浅色背景上的阅读对比不足。 */
:root:not([data-theme="dark"]):is(:not([data-theme-preset]), [data-theme-preset="blue"]) .home-page .banner h1 {
  color: #4b91d2;
}
.home-page :is(.banner-subtitle, .banner-desc, .download-status) {
  color: var(--text-secondary);
  text-shadow: none;
}
.home-page .banner-subtitle { font-size: 22px; }
.home-page .banner-desc { margin-top: 6px; margin-bottom: 30px; }
.home-page .download-status { margin-top: 18px; font-size: 13px; }
.home-page .intro { max-width: 800px; margin-inline: auto; }
.home-page .card-box { gap: 22px; }
.home-page .card { padding: 32px 26px; }
.home-page .section-title { color: var(--text-primary); }
.home-page .section-title::after { width: 36px; height: 3px; opacity: .6; }

/* 表单与操作控件统一圆润轮廓；不改校验、disabled 或 submit 行为。 */
:is(button, input:not([type="checkbox"]):not([type="radio"]), select, textarea,
  .download-btn, .liquid-btn, .nav-links a, .site-nav-links a,
  .workbench-nav a, .admin-sidebar a, .teacher-nav a,
  .student-portal-nav button, .study-sidebar a, .mobile-menu-link,
  .study-action-btn, .study-icon-btn, .practice-category,
  .practice-option, .room-back, .room-header-action, .room-tabs,
  .focus-panel, .tasks-panel, .room-toolbar, .room-dialog,
  .scene-grid button, .sound-grid button, .room-toolbar button) {
  border-radius: 20px !important;
  corner-shape: squircle;
}
:is(.download-btn, .liquid-btn, .study-action-btn, .study-icon-btn,
  .nav-links a, .site-nav-links a, .workbench-nav a, .workbench-nav button,
  .admin-sidebar a, .teacher-nav a, .student-portal-nav button,
  .login-tab, .quick-card, .workbench-feature-grid a) {
  transition: transform .2s var(--liquid-ease), opacity .16s ease !important;
}
@media (hover: hover) {
  :is(.download-btn, .liquid-btn, .study-action-btn, .study-icon-btn,
    .nav-links a, .site-nav-links a, .workbench-nav a, .workbench-nav button,
    .admin-sidebar a, .teacher-nav a, .student-portal-nav button,
    .login-tab, .quick-card, .workbench-feature-grid a):hover {
    transform: translateY(-1px);
    filter: none !important;
  }
  :is(.header, .login-card, .card, .study-card, .portal-card, .quick-card):hover::before {
    opacity: 1;
  }
}
:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: inset 0 1px 0 #fff, 0 0 0 5px var(--accent-light) !important;
}
.home-page .download-btn, .study-page .login-card #submitButton {
  min-height: 50px;
  border: 1px solid var(--liquid-border) !important;
  color: var(--accent) !important;
  background: var(--liquid-glass) !important;
  box-shadow: var(--liquid-shadow), 0 8px 24px rgba(60, 136, 198, .10) !important;
  font-weight: 650;
}
.home-page .download-btn {
  -webkit-backdrop-filter: var(--glass-blur) !important;
  backdrop-filter: var(--glass-blur) !important;
}
/* 浅色玻璃上的主操作使用深蓝文字，避免旧样式的白字与背景融在一起。 */
.study-page .study-action-btn.study-button-primary {
  color: var(--accent) !important;
  border: 1px solid var(--liquid-border) !important;
  background: var(--liquid-glass) !important;
  box-shadow: var(--liquid-shadow) !important;
  font-weight: 650;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.study-action-btn { text-decoration: none; }
/* 输入框保留清晰层级；不再像立体按钮一样凸起。 */
:is(.study-form, .portal-form, .portal-actions, .contact-form, .modal-form)
  :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  border: 1px solid var(--input-border) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.70) !important;
}
:is(.study-action-btn, .study-icon-btn, .theme-toggle, .login-tab) {
  box-shadow: inset 0 0 0 1px var(--liquid-border), 0 2px 7px rgba(30,70,110,.045) !important;
}
.home-page .download-btn::before {
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.55), transparent 80%);
}
.login-brand h1 { color: var(--text-primary); }
.login-brand .study-icon-btn { margin-left: auto; flex-shrink: 0; }
.login-tabs { border-radius: 22px; corner-shape: squircle; }
.login-tab { font-weight: 600; }
.login-tab:not(.active) { box-shadow: none !important; }
.login-tab.active { color: var(--accent); }
body:not(:has(.room)) :is(input, textarea)::placeholder {
  color: var(--text-placeholder);
  opacity: 1;
}
.study-page .login-card :is(input:not([type="checkbox"]), select, textarea) {
  background: rgba(255, 255, 255, .10) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
/* 主按钮、输入框直接使用父面板已经模糊的背景，避免叠加第二次实时采样。 */
.study-page :is(.login-card, .study-card, .portal-card, .workbench-panel, .modal-content)
  .study-action-btn.study-button-primary,
.study-page .login-card #submitButton {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.login-card {
  animation: liquid-arrive .24s var(--liquid-ease) backwards;
}
@keyframes liquid-arrive {
  from { transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* 原链接和按钮保留在同一个导航节点内，仅调整可见布局。 */
:is(.nav-links, .site-nav-links, .admin-sidebar nav, .teacher-nav,
  .student-portal-nav, .workbench-sidebar) {
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
:is(.nav-links, .site-nav-links, .admin-sidebar nav, .teacher-nav,
  .student-portal-nav, .workbench-sidebar)::-webkit-scrollbar { display: none; }
.nav-links, .site-nav-links {
  justify-content: flex-start !important;
  justify-content: safe center !important;
  overflow-x: auto;
  white-space: nowrap;
}
/* 左右轨道等宽，菜单对齐整条导航的中心，不受两侧标志或按钮宽度影响。 */
.header {
  position: fixed !important;
  display: grid;
  grid-template-columns: minmax(48px, 1fr) minmax(0, auto) minmax(48px, 1fr);
  gap: 20px;
  max-width: 1180px;
  height: 64px;
  top: 16px;
  transition: none;
}
.header.scrolled {
  height: 64px;
  top: 16px;
  width: calc(100% - 32px);
  transform: translateX(-50%);
}
.header .logo { height: 34px; filter: none; }
.header.scrolled .logo { height: 34px; }
.header .nav-left { justify-self: start; }
.header .nav-right { justify-self: end; }
.header .nav-links { min-width: 0; padding-block: 8px; }
.header .nav-links a { min-height: 40px; display: inline-flex; align-items: center; }
.header .nav-links a.active::after { display: none; }
.study-mobile-menu-toggle { display: none !important; }
.study-topbar, .workbench-topbar { position: sticky !important; }
.study-topbar .study-top-actions { justify-content: flex-end; min-width: 0; }
/* 非当前菜单只保留清晰文字，避免每一项都像已选中；悬停再呈现玻璃浮层。 */
:is(.nav-links a, .site-nav-links a, .workbench-nav a, .workbench-nav button,
  .admin-sidebar a, .teacher-nav a, .student-portal-nav button):not(.active):not([aria-current="page"]):not(:hover) {
  box-shadow: none !important;
}
:is(.nav-links a, .site-nav-links a, .workbench-nav a, .workbench-nav button,
  .admin-sidebar a, .teacher-nav a, .student-portal-nav button):is(.active, [aria-current="page"]) {
  color: var(--accent) !important;
  font-weight: 650;
  border-color: var(--liquid-border) !important;
  background: var(--liquid-glass) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7),
    0 2px 6px rgba(61,123,178,.07) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.teacher-shell > .study-card, .admin-content, .student-portal-content { min-width: 0; }
.home-page .floating-orbs, .home-page .cursor-glow { display: none !important; }
@media (min-width: 1101px) {
  .admin-layout { grid-template-columns: 218px minmax(0, 1fr); }
  .admin-sidebar { top: 88px; }
  .admin-sidebar nav { display: grid; width: auto; }
  .teacher-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .student-portal-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .workbench-layout { display: grid; }
  .workbench-sidebar { position: sticky; top: 78px; height: calc(100vh - 94px); overflow-y: auto; }
}
.workbench-app .workbench-content { padding-top: 24px; }
.study-page :is(.study-topbar, .workbench-topbar) { -webkit-backdrop-filter: var(--glass-blur) !important; backdrop-filter: var(--glass-blur) !important; }
@media (min-width: 1101px) {
  .study-topbar:has(> .site-nav-links) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 540px) minmax(0, 1fr);
    gap: 12px;
    padding-inline: 20px;
  }
  .study-topbar:has(> .site-nav-links) .study-brand { min-width: 0; font-size: 14px; }
  .study-topbar:has(> .site-nav-links) .study-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .study-topbar:has(> .site-nav-links) > .site-nav-links { width: 100%; margin: 0; }
}

/* 背景滤镜和连续曲率缺失时仍有完整、可读的实体轮廓。 */
@supports not (mask-composite: exclude) {
  :is(.liquid-nav-floating, .header, .study-topbar, .workbench-topbar, .admin-sidebar,
    .teacher-nav, .student-portal-nav, .workbench-sidebar, .login-card, .study-card,
    .card, .intro, .brand-info, .news-card, .news-detail-card, .product-card,
    .account-card, .feature-card, .contact-form, .portal-card, .workbench-panel,
    .workbench-stat-card, .workbench-study-entry, .workbench-announcement,
    .quick-card, .modal-content, .settings-panel, .workbench-search-results,
    .practice-dialog)::before {
    inset: 0 12px auto !important;
    height: 6px !important;
    padding: 0;
    background: var(--liquid-rim-image) center top / 100% 100% no-repeat !important;
    -webkit-mask: none !important;
    mask: none !important;
  }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  /* 使用材质变量降级，底部导航及后续加载的模块也能自动获得实底。 */
  :root {
    --liquid-glass: var(--surface, #eef6fc);
    --glass-blur: none;
    --glass-blur-strong: none;
    --header-blur: none;
  }
  :is(.header, .study-topbar, .workbench-topbar, .admin-sidebar, .teacher-nav,
    .student-portal-nav, .workbench-sidebar, .login-card, .study-card,
    .portal-card, .workbench-panel, .workbench-stat-card, .quick-card,
    .card, .modal-content) {
    background: var(--surface, #eef6fc) !important;
  }
}
@media (prefers-reduced-transparency: reduce) {
  :root {
    --liquid-glass: var(--surface, #eaf3f3);
    --glass-blur: none;
    --glass-blur-strong: none;
    --header-blur: none;
  }
  :is(.header, .study-topbar, .workbench-topbar, .admin-sidebar, .teacher-nav,
    .student-portal-nav, .workbench-sidebar, .login-card, .study-card,
    .portal-card, .workbench-panel, .workbench-stat-card, .quick-card, .card) {
    background: var(--surface, #eaf3f3) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

/* 小屏导航使用原生 dialog：焦点、背景不可交互和 Escape 由浏览器保证。
   只动画轻量位移与透明度；折光纹理静态复用，不逐帧重算滤镜。 */
.liquid-menu-toggle { display: none; }
.liquid-drawer {
  position: fixed;
  inset: max(12px, env(safe-area-inset-top)) auto max(12px, env(safe-area-inset-bottom)) 12px;
  width: min(342px, calc(100vw - 40px));
  height: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom)));
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--text-primary);
  border: 1px solid var(--liquid-border);
  border-radius: 34px;
  corner-shape: squircle;
  background: var(--liquid-glass);
  background-image: linear-gradient(145deg, rgba(245,251,255,.78), rgba(235,247,255,.66));
  box-shadow: var(--liquid-shadow), 12px 12px 50px rgba(28,61,84,.12);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  opacity: 0;
  translate: -30px 0;
  transition: opacity .22s ease, translate .36s var(--liquid-ease),
    display .36s allow-discrete, overlay .36s allow-discrete;
}
.liquid-drawer[open] { display: flex; flex-direction: column; opacity: 1; translate: 0 0; }
.liquid-drawer::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  corner-shape: squircle;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
  background: var(--liquid-rim-image) center top / 100% 14px no-repeat;
}
.liquid-drawer::backdrop {
  background: rgba(23,46,65,.24);
  opacity: 0;
  transition: opacity .24s ease, display .36s allow-discrete, overlay .36s allow-discrete;
}
.liquid-drawer[open]::backdrop { opacity: 1; }
[data-theme="dark"] .liquid-drawer {
  background-image: linear-gradient(145deg, rgba(24,44,61,.92), rgba(24,44,61,.85));
}
body.liquid-drawer-open { overflow: hidden !important; }
.liquid-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--input-border);
}
.liquid-drawer-head > div { min-width: 0; }
.liquid-drawer-brand { color: var(--text-tertiary); font-size: 12px; }
.liquid-drawer-head h2 { margin: 4px 0 0; font-size: 20px; line-height: 1.4; overflow-wrap: anywhere; }
.liquid-menu-toggle, .liquid-drawer-close {
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 10px;
  color: var(--text-primary);
  border: 1px solid var(--liquid-border);
  border-radius: 18px !important;
  corner-shape: squircle;
  background: var(--liquid-glass);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.52);
  cursor: pointer;
}
.liquid-drawer-close { display: grid; }
:is(.liquid-menu-toggle, .liquid-drawer-close) svg { width: 22px; height: 22px; }
:is(.liquid-menu-toggle, .liquid-drawer-close):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.liquid-drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px 24px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--input-border) transparent;
}
.liquid-drawer-body > section + section { border-top: 1px solid var(--input-border); margin-top: 14px; padding-top: 14px; }
.liquid-drawer:not(.has-role) .liquid-drawer-site { border-top: 0; margin-top: 0; padding-top: 0; }
.liquid-drawer-label { margin: 6px 12px 10px; font-size: 12px; font-weight: 500; color: var(--text-tertiary); }
.liquid-drawer:not(.has-role) .liquid-drawer-site > .liquid-drawer-label,
.liquid-drawer-role > .liquid-drawer-label { display: none; }
.liquid-drawer .admin-nav-heading { display: none !important; }
.liquid-drawer [hidden] { display: none !important; }
@starting-style {
  .liquid-drawer[open] { opacity: 0; translate: -30px 0; }
  .liquid-drawer[open]::backdrop { opacity: 0; }
}

/* 手机、平板撤掉底部固定菜单和留白；电脑导航保留原位。 */
@media (max-width: 1100px), (max-width: 1366px) and (pointer: coarse) {
  body:not(:has(.room)) { padding-bottom: 0 !important; }
  .header { display: flex; justify-content: space-between; gap: 12px; }
  .header .nav-right { display: flex; align-items: center; gap: 8px; }
  .header .nav-left { min-width: 0; }
  .liquid-menu-toggle { display: grid; }
  .home-page .hamburger, .home-page .mobile-menu, .home-page .mobile-overlay,
  .study-mobile-menu-toggle, .admin-nav-toggle, .admin-nav-backdrop,
  .workbench-menu-btn, .workbench-drawer-backdrop { display: none !important; }
  :root .liquid-drawer :is(.admin-sidebar, .teacher-nav, .student-portal-nav, .workbench-sidebar) {
    position: relative !important;
    inset: auto !important;
    z-index: auto;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-flow: column nowrap !important;
    align-items: stretch !important;
    gap: 4px !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    white-space: normal;
    transform: none !important;
  }
  :root .liquid-drawer :is(.admin-sidebar, .teacher-nav, .student-portal-nav, .workbench-sidebar)::before,
  :root .liquid-drawer :is(.admin-sidebar, .teacher-nav, .student-portal-nav, .workbench-sidebar)::after {
    display: none !important;
  }
  :root .liquid-drawer :is(.nav-links, .site-nav-links, .admin-sidebar nav, .workbench-nav) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 4px;
    overflow: visible;
    white-space: normal;
    justify-content: stretch !important;
  }
  .liquid-drawer.has-role .liquid-drawer-site :is(.nav-links, .site-nav-links) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  :root .liquid-drawer :is(.nav-links a, .site-nav-links a, .admin-sidebar a, .teacher-nav a,
    .student-portal-nav button, .workbench-nav a, .workbench-nav button, .liquid-drawer-actions > .study-action-btn) {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 46px;
    margin: 0;
    padding: 11px 14px !important;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 18px !important;
    background: transparent;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    color: var(--text-secondary);
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }
  :root .liquid-drawer .liquid-drawer-role .admin-sidebar a { flex-direction: column; align-items: flex-start; gap: 2px; }
  :root .liquid-drawer .admin-sidebar small { display: block !important; font-size: 11px; font-weight: 400; }
  .liquid-drawer .workbench-sidebar .workbench-profile,
  .liquid-drawer .student-portal-nav .portal-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 4px 12px;
    padding: 8px 8px 16px;
    border-bottom: 1px solid var(--input-border);
  }
  .liquid-drawer .student-portal-nav .portal-user { display: grid; gap: 4px; }
  .liquid-drawer :is(.workbench-profile strong, .portal-user strong) { font-size: 15px; overflow-wrap: anywhere; color: var(--text-primary); }
  .liquid-drawer .workbench-sidebar .workbench-nav-label { display: block; margin: 16px 12px 4px; padding: 0; }
  .liquid-drawer .workbench-sidebar .workbench-sidebar-foot,
  .liquid-drawer .study-mobile-nav-action { display: none !important; }
  .liquid-drawer :is(.nav-links a, .site-nav-links a)::after { display: none !important; }
  .liquid-drawer .workbench-nav span { flex: 0 0 24px; text-align: center; }
  .study-page .study-topbar .site-nav-links { display: none !important; }
  .header .nav-links { display: none !important; }
  :root .study-page :is(.study-topbar, .workbench-topbar) {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    min-height: 64px;
    height: auto;
    padding: 8px 12px;
    gap: 10px;
  }
  :root .study-page :is(.study-topbar, .workbench-topbar) .liquid-menu-toggle { order: 0; }
  :root .study-page :is(.study-topbar, .workbench-topbar) .study-brand {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
    font-size: 14px;
  }
  :root .study-page :is(.study-topbar, .workbench-topbar) .study-brand span {
    display: block;
    max-width: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  :root .study-page :is(.study-topbar, .workbench-topbar) :is(.study-top-actions, .workbench-top-actions) {
    display: flex;
    order: 3;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    width: auto;
    gap: 6px;
    margin-left: auto;
  }
  :root .study-page .workbench-top-search { order: 2; flex: 1 1 240px; min-width: 150px; max-width: 400px; }
  :root .study-page :is(.study-topbar, .workbench-topbar) :is(.study-icon-btn, .workbench-notice) { width: 44px; height: 44px; }
  :root .study-page .workbench-notice { display: grid; place-items: center; }
  :root .study-page .workbench-notice b { top: 1px; right: 1px; }
  .study-page .admin-layout, .teacher-shell, .student-portal-shell { grid-template-columns: 1fr !important; }
  .workbench-app .workbench-content { padding-bottom: 48px; }
  .liquid-drawer .liquid-scrollable > * { translate: none; }
  .liquid-drawer .liquid-scrollable { scroll-snap-type: none; touch-action: pan-y; }
}
@media (prefers-reduced-transparency: reduce) {
  .liquid-drawer { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (max-width: 767px) {
  .container { padding: 100px 18px 44px; }
  .section-title { font-size: 24px; margin: 34px 0 24px; }
  .intro, .brand-info { padding: 24px; }
  .header, .header.scrolled { top: 10px; height: 58px; width: calc(100% - 20px); padding-inline: 14px; }
  .header .logo, .header.scrolled .logo { height: 32px; }
  .home-page .container { padding-top: 76px; }
  .home-page .banner {
    min-height: min(510px, calc(100svh - 174px));
    padding: 42px 22px 44px;
    margin-bottom: 28px;
  }
  .home-page .banner h1 { font-size: 40px; }
  .home-page .banner-subtitle { font-size: 19px; }
  .home-page .banner-logo { width: 68px; height: 68px; margin-bottom: 22px; }
  .home-page .download-status { max-width: 290px; line-height: 1.7; }
  .home-page .card { padding: 26px 22px; }
  .home-page .card-box { gap: 16px; }
  :root .study-page .workbench-top-search { display: none; }
  .study-page .study-brand img { width: 30px; height: 30px; }
  .login-shell { padding: 24px 16px; }
  .study-page .login-card { padding: 28px 22px; }
}
@media (max-width: 360px) {
  .home-page .banner h1 { font-size: 36px; }
  .study-page .login-card { padding-inline: 16px; }
  .login-tab { font-size: 12px; }
}

/* 自习室保留场景图片、计时器和所有原操作，只统一控件材质。 */
body:has(.room) :is(.room-back, .room-header-action, .room-tabs, .focus-panel,
  .tasks-panel, .room-toolbar, .room-dialog) {
  border: 1px solid var(--liquid-border) !important;
  border-radius: 28px !important;
  corner-shape: squircle;
  background: rgba(255,255,255,.10) !important;
  box-shadow: 0 16px 38px rgba(0,0,0,.24), inset 0 1px 0 #fff !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  backdrop-filter: var(--glass-blur) !important;
}

/* 页面到达由 liquid-motion.js 分层处理标题和小控件；
   不拍整屏快照，也不拦截原链接、提交或重定向。 */
@view-transition { navigation: none; }
:is(.container, .study-main, .admin-shell, .workbench-content, .student-portal-shell) {
  /* 大容器不做透明度动画，避免连同后代的玻璃滤镜一起重新合成。 */
  animation: none;
}
/* 不再让正文滚进视口后等待交错动画；内容立即可读，滚动合成保持稳定。 */
.fade-in, .scroll-reveal {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition-delay: 0s !important;
}
.scroll-reveal { transition: none !important; }
.card-shine, .card-scan, .join-pulse, .banner-light-rays { display: none !important; }
.banner-logo, .banner h1, .scroll-progress, #backTop, .join-card::before,
.download-btn::after { animation: none !important; }
.liquid-scrollable {
  scroll-behavior: auto !important;
  scroll-snap-type: none !important;
  /* 触屏交给浏览器原生横向滚动与缩放，不继承旧分段控件的 pan-y 限制。 */
  touch-action: auto !important;
}
.liquid-scrollable > * { translate: var(--nav-elastic, 0px) 0; transition: translate .22s ease-out; }
.liquid-scrollable.liquid-dragging { cursor: grabbing; user-select: none; }
.liquid-scrollable.liquid-dragging > * { transition: none !important; }

/* 透明透镜导航：中心保留可辨认的背景文字，弧边对真实背景做平滑位移与放大。
   SVG 位移图由独立 UI 模块按尺寸生成；导航自己的文字和图标不经过滤镜。 */
.liquid-nav-filter-defs {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
:root .liquid-clear-nav {
  background: rgba(255,255,255,.10) !important;
  background-image: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.38) 42%,
    rgba(255,255,255,.32) 64%, rgba(255,255,255,.06)) !important;
  -webkit-backdrop-filter: blur(1px) saturate(170%) !important;
  backdrop-filter: blur(1px) saturate(170%) !important;
  box-shadow: 0 8px 26px rgba(39,74,108,.065), 0 2px 5px rgba(39,74,108,.025),
    inset 0 1px 0 rgba(255,255,255,.88), inset 0 -1px 0 rgba(255,255,255,.56),
    inset 1px 0 0 rgba(255,255,255,.48), inset -1px 0 0 rgba(106,163,207,.10) !important;
}
:root .liquid-clear-nav[data-liquid-lens] {
  -webkit-backdrop-filter: var(--nav-lens-filter) saturate(170%) !important;
  backdrop-filter: var(--nav-lens-filter) saturate(170%) !important;
}
:root .liquid-clear-nav::before {
  padding: 1px !important;
  background: linear-gradient(145deg, rgba(255,255,255,.88), rgba(255,255,255,.12) 32%,
    rgba(80,141,188,.16) 64%, rgba(255,255,255,.72)) !important;
  opacity: .82;
}
/* 阅读保护融入整个玻璃表面，避免菜单中间出现一条独立白色带。 */
:root .liquid-clear-nav :is(.nav-links, .site-nav-links, .workbench-nav) {
  background-image: none;
}
:root .liquid-clear-nav :is(.nav-links a, .site-nav-links a, .study-brand, .workbench-brand,
  .workbench-nav a, .workbench-nav button, .admin-sidebar a, .teacher-nav a,
  .student-portal-nav button) {
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255,255,255,.96), 0 0 5px rgba(255,255,255,.92);
}
:root .liquid-clear-nav :is(.nav-links a, .site-nav-links a, .workbench-nav a,
  .workbench-nav button, .admin-sidebar a, .teacher-nav a, .student-portal-nav button):not(.active):not([aria-current="page"]) {
  color: var(--text-primary) !important;
}
:root .liquid-clear-nav :is(.nav-links a, .site-nav-links a, .workbench-nav a,
  .workbench-nav button, .admin-sidebar a, .teacher-nav a, .student-portal-nav button):is(.active, [aria-current="page"]) {
  background: rgba(255,255,255,.58) !important;
}
[data-theme="dark"] .liquid-clear-nav {
  background-color: rgba(19,37,53,.18) !important;
  background-image: linear-gradient(180deg, rgba(255,255,255,.04), rgba(19,37,53,.24) 45%,
    rgba(19,37,53,.22) 64%, rgba(255,255,255,.03)) !important;
}
[data-theme="dark"] .liquid-clear-nav :is(.nav-links a, .site-nav-links a, .study-brand, .workbench-brand,
  .workbench-nav a, .workbench-nav button, .admin-sidebar a, .teacher-nav a,
  .student-portal-nav button) {
  text-shadow: 0 1px 3px rgba(9,23,36,.92), 0 0 8px rgba(9,23,36,.70);
}
[data-theme="dark"] .liquid-clear-nav :is(.nav-links a, .site-nav-links a, .workbench-nav a,
  .workbench-nav button, .admin-sidebar a, .teacher-nav a, .student-portal-nav button):is(.active, [aria-current="page"]) {
  background: rgba(24,46,64,.52) !important;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root .liquid-clear-nav { background: var(--surface) !important; }
}
@media (prefers-reduced-transparency: reduce) {
  :root .liquid-clear-nav {
    background: var(--surface) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

/* 自习室保留原有场景与手势，仅清理控件的重复背景滤镜。 */
.room :is(.focus-panel, .tasks-panel, .room-dialog)::before,
.room .room-toolbar::after {
  height: 9px;
  background: var(--liquid-rim-image) center top / 100% 100% no-repeat;
  box-shadow: none;
  filter: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.room :is(.room-tabs, .room-dialog, .room-toolbar) button,
.room .room-tabs.ui-segments::after {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* 操作节点动效：只改变合成属性，背景和 SVG 不逐帧重算。
   此层可与 liquid-motion.js 一起独立移除，不影响任何原业务操作。 */
:is(button, .download-btn, .study-action-btn, .quick-card, .theme-preset):active:not(:disabled) {
  scale: .975;
  transition-duration: .14s !important;
}
:is(button, .download-btn, .study-action-btn, .quick-card, .theme-preset) {
  transition-property: transform, opacity, scale !important;
}
:is(.card, .news-card, .product-card, .quick-card, .workbench-feature-grid a):hover::before {
  opacity: 1;
}
/* 折光纹理保持静态，只过渡高光透明度，不逐帧移动 SVG 背景。 */
.workbench-app .workbench-view.active {
  animation: none;
}
.workbench-view.active > .workbench-greeting h1 {
  animation: liquid-view-arrive .44s var(--liquid-ease);
}
.workbench-view.active > .workbench-greeting p { animation: liquid-view-arrive .48s .045s var(--liquid-ease) backwards; }
/* 排除旧主题残留的局部实时折射以及不可见的常驻装饰动效。 */
:root :is(.stat-card, .profile-header, .menu-item, .filter-tag, .detail-article,
  .related-card, .address, .announcement-orbit span, .workbench-feature-grid a,
  .workbench-account-grid a, .workbench-subject-grid a) {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
:root :is(.stat-card, .profile-header, .menu-item, .detail-article, .related-card)::before,
:root :is(.stat-card, .profile-header, .menu-item, .detail-article, .related-card)::after {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
}
.banner-photo, .banner-logo, .banner h1, .banner-subtitle, .banner-desc,
.download-status, .news-card-glow, .tag-glow { animation: none !important; }
.card-shine, .card-scan, .news-card-glow, .tag-glow { display: none !important; }
:root :is(.card, .news-card, .product-card, .quick-card, .menu-item, .stat-card) {
  transition-property: transform, opacity !important;
}
/* 仅主标题参与短暂切换，任何卡片、正文与按钮不等待动画才可操作。 */
@media (hover: hover) {
  :root :is(.card, .news-card, .product-card, .quick-card, .menu-item, .stat-card):hover {
    transform: translateY(-2px);
    filter: none !important;
  }
}
@keyframes liquid-view-arrive {
  from { opacity: .76; translate: 0 12px; }
  to { opacity: 1; translate: 0 0; }
}
.study-page #portalView { animation: none; }

/* 原生 dialog 的 display/overlay 离散过渡保留浏览器自己的开关和焦点管理。
   不支持 allow-discrete 的浏览器直接使用原有开关，不等待 JS 动画。 */
.study-page dialog.practice-dialog, .room dialog.room-dialog {
  opacity: 0;
  scale: .98;
  translate: 0 10px;
  transition: opacity .2s ease, scale .32s var(--liquid-ease), translate .32s var(--liquid-ease),
    display .32s allow-discrete, overlay .32s allow-discrete;
}
.study-page dialog.practice-dialog[open], .room dialog.room-dialog[open] { opacity: 1; scale: 1; translate: 0 0; }
.study-page dialog.practice-dialog.ui-sheet, .room dialog.room-dialog.ui-sheet {
  transition: transform .32s var(--liquid-ease), opacity .2s ease,
    scale .32s var(--liquid-ease), translate .32s var(--liquid-ease),
    display .32s allow-discrete, overlay .32s allow-discrete;
}
.study-page dialog.practice-dialog.ui-sheet-dragging, .room dialog.room-dialog.ui-sheet-dragging {
  transition: none;
}
dialog:is(.practice-dialog, .room-dialog)::backdrop {
  background: rgba(15, 35, 54, .34);
  opacity: 0;
  transition: opacity .16s ease, display .22s allow-discrete, overlay .22s allow-discrete;
}
dialog:is(.practice-dialog, .room-dialog)[open]::backdrop { opacity: 1; }
.modal {
  z-index: 2400;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: rgba(15, 35, 54, .3);
  /* 原弹窗函数已有 350ms 关闭等待，不再叠加 display 延迟。 */
  transition: opacity .28s ease;
}
.modal-content {
  scale: .985;
  transition: transform .34s var(--liquid-ease), opacity .24s ease, scale .34s var(--liquid-ease) !important;
}
.modal.show .modal-content { animation: none; scale: 1; }
:root .settings-panel {
  inset: 88px max(20px, calc((100vw - 760px) / 2)) 24px !important;
  max-width: 760px;
  z-index: 2201;
  overflow: hidden;
  box-shadow: var(--liquid-shadow) !important;
  translate: 0 14px;
  transition: opacity .24s ease, translate .36s var(--liquid-ease), display .36s allow-discrete;
}
/* 仅在原设置面板开启时拦住下层页面；原有关闭按钮与协议弹窗照常使用。 */
body:has(#settingsPanel.show) { overflow: hidden !important; }
body:has(#settingsPanel.show)::after {
  display: block !important;
  position: fixed;
  inset: 0;
  z-index: 2200 !important;
  opacity: 1 !important;
  background: rgba(15, 35, 54, .16) !important;
  pointer-events: auto;
}
.settings-panel.show { animation: none; translate: 0 0; }
.settings-panel .settings-body { padding: 16px 24px 32px; }
.settings-panel .settings-header {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: transparent;
}
.toast { animation: liquid-view-arrive .36s var(--liquid-ease); }
@starting-style {
  .study-page dialog.practice-dialog[open], .room dialog.room-dialog[open] {
    opacity: 0;
    scale: .98;
    translate: 0 10px;
    /* 覆盖旧场景弹窗的起始 transform，避免与新的 translate 叠加位移。 */
    transform: none;
  }
  dialog:is(.practice-dialog, .room-dialog)[open]::backdrop { opacity: 0; }
  .modal.show, .settings-panel.show { opacity: 0; }
  .settings-panel.show { translate: 0 14px; }
}
/* 临时玻璃光泽与按压波纹：装饰层在动画结束后由 UI 模块移除。
   只有局部透明度和位移变化，既不裁剪原文字，也不新增实时背景滤镜。 */
.liquid-feedback-host { position: relative; }
.liquid-feedback-layer {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2;
  display: block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  overflow: hidden;
  border-radius: inherit !important;
  corner-shape: inherit;
  pointer-events: none !important;
  contain: layout paint;
}
.liquid-feedback-layer > .liquid-feedback-glint {
  position: absolute;
  inset: 0 auto 0 0;
  width: 55%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.40), transparent);
  pointer-events: none;
}
.liquid-feedback-layer > .liquid-feedback-pulse {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.5) 0, rgba(var(--theme-rgb-3,53,179,201),.16) 40%, transparent 70%);
  pointer-events: none;
}
.quick-card .quick-icon, .card .avatar-placeholder, .theme-toggle svg, .liquid-menu-toggle svg,
.download-btn svg { transition: transform .44s var(--liquid-ease) !important; }
@media (hover: hover) and (pointer: fine) {
  .quick-card:hover .quick-icon { transform: translateY(-3px) rotate(-5deg) scale(1.05); }
  .card:hover .avatar-placeholder { transform: translateY(-2px) rotate(4deg); }
  .theme-toggle:hover svg { transform: rotate(18deg); }
  .liquid-menu-toggle:hover svg { transform: translateX(2px); }
  .download-btn:hover svg { transform: translateX(3px); }
}
/* 小型数据格复用父层玻璃；消除旧样式中残留的实时 SVG 边缘采样。 */
.student-portal-page :is(.checkin-day, .achievement-item, .notice-item, .feedback-item, .membership-plan) {
  border-radius: 22px;
  corner-shape: squircle;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.student-portal-page :is(.checkin-day, .achievement-item, .notice-item, .feedback-item, .membership-plan)::before {
  display: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
@media (max-width: 767px) {
  :root .settings-panel { inset: 78px 12px max(12px, env(safe-area-inset-bottom)) !important; }
  .settings-panel .settings-body { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .login-card, .container, .study-main, .admin-shell, .workbench-content,
  .student-portal-shell { animation: none !important; }
  :is(.nav-links, .site-nav-links, .admin-sidebar nav, .teacher-nav,
    .student-portal-nav, .workbench-sidebar) { scroll-behavior: auto; }
  .liquid-scrollable > * { transition: none !important; }
  .study-page :is(.login-tabs, .practice-mode-tabs).ui-segments::before { transition: none !important; }
  .workbench-app .workbench-view.active, .settings-panel.show,
  .workbench-view.active > .workbench-greeting h1,
  .workbench-view.active > .workbench-greeting p,
  .modal.show .modal-content, .toast { animation: none !important; }
  dialog:is(.practice-dialog, .room-dialog),
  .study-page dialog.practice-dialog.ui-sheet, .room dialog.room-dialog.ui-sheet,
  dialog:is(.practice-dialog, .room-dialog)::backdrop,
  .modal, .modal-content, .settings-panel { transition: none !important; }
  .liquid-drawer, .liquid-drawer::backdrop { transition: none !important; }
  .liquid-feedback-layer { display: none !important; }
  .quick-card .quick-icon, .card .avatar-placeholder, .theme-toggle svg, .liquid-menu-toggle svg,
  .download-btn svg { transition: none !important; transform: none !important; }
  :is(button, .download-btn, .study-action-btn, .quick-card, .theme-preset):active {
    scale: 1;
  }
  :is(.download-btn, .liquid-btn, .study-action-btn, .study-icon-btn, .nav-links a,
    .site-nav-links a, .workbench-nav a, .workbench-nav button, .admin-sidebar a,
    .teacher-nav a, .student-portal-nav button, .login-tab, .quick-card):hover {
    transform: none !important;
  }
}

/* 2026-11：统一视觉与动效层。仅作用于外观，可与 liquid-motion.js 一起移除。 */
:root {
  --ui-radius-panel: 32px;
  --ui-radius-control: 20px;
  --ui-radius-inset: 16px;
  --ui-duration: 360ms;
  --ui-spring: cubic-bezier(.22,.8,.22,1.12);
  --ui-reading-tint: rgba(255,255,255,.12);
  --ui-overlay-tint: rgba(248,252,255,.40);
}
[data-theme="dark"] {
  --ui-reading-tint: rgba(255,255,255,.035);
  --ui-overlay-tint: rgba(22,40,57,.64);
}
[data-ui-motion="gentle"] { --ui-duration: 180ms; --ui-spring: ease-out; }
[data-ui-motion="rich"] { --ui-duration: 460ms; }

/* 阅读、操作、浮层三个层级共用色彩和连续曲率；阅读区域不叠加实时模糊。 */
:root :is(.card, .intro, .brand-info, .study-card, .portal-card, .workbench-panel,
  .workbench-stat-card, .news-card, .account-card, .product-card) {
  border-radius: var(--ui-radius-panel) !important;
  background-color: var(--ui-reading-tint) !important;
  box-shadow: 0 8px 26px rgba(39,74,108,.055),
    inset 0 0 0 1px rgba(255,255,255,.48) !important;
}
:root :is(.modal-content, .settings-panel, .practice-dialog, .workbench-search-results) {
  background-color: var(--ui-overlay-tint) !important;
  border-radius: var(--ui-radius-panel) !important;
}
:root :is(.card, .intro, .brand-info, .study-card, .portal-card, .workbench-panel,
  .workbench-stat-card)::before { padding: 1px; opacity: .64; }
[data-theme="dark"] :is(.card, .intro, .study-card, .portal-card, .workbench-panel) {
  border-color: rgba(220,239,255,.19) !important;
}
:is(.study-card, .portal-card, .workbench-panel, .modal-content, .settings-panel)
  :is(.study-notice, .notice-item, .feedback-item, .membership-plan) {
  border-radius: var(--ui-radius-inset) !important;
}
:is(.study-card, .portal-card, .workbench-panel, .modal-content) :is(h2, h3) {
  line-height: 1.45;
  letter-spacing: 0;
}
:is(.section-title, .portal-page-head, .admin-page-head, .workbench-greeting, .study-title) {
  text-wrap: balance;
  letter-spacing: 0;
}
:is(.portal-form, .study-form, .contact-form) label { line-height: 1.6; }
:is(.portal-form, .study-form) :is(input, textarea, select) {
  min-width: 0;
  line-height: 1.5;
}

/* 滑块比原选中项宽 8px、高 6px。装饰层不接收点击，不改变任何选中态。 */
.liquid-selection-group { position: relative; isolation: isolate; }
:root :is(.nav-links, .site-nav-links).liquid-selection-group { padding-inline: 6px; }
.liquid-selection-group > :is(a, button) { position: relative; z-index: 1; }
:root .liquid-selection {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 24px !important;
  corner-shape: squircle;
  background: rgba(255,255,255,.10) !important;
  background-image: linear-gradient(148deg, rgba(255,255,255,.36), rgba(255,255,255,.04) 50%,
    rgba(var(--theme-rgb-3),.14)) !important;
  box-shadow: 0 3px 12px rgba(43,91,128,.10), inset 0 1px 2px rgba(255,255,255,.92),
    inset 0 -1px 2px rgba(71,135,183,.12) !important;
  -webkit-backdrop-filter: saturate(170%);
  backdrop-filter: saturate(170%);
  transform-origin: 0 0;
  pointer-events: none !important;
  translate: none !important;
  transition: none !important;
}
:root .liquid-selection[data-liquid-lens] {
  -webkit-backdrop-filter: var(--nav-lens-filter) saturate(170%) !important;
  backdrop-filter: var(--nav-lens-filter) saturate(170%) !important;
}
.liquid-selection::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  corner-shape: inherit;
  background: var(--liquid-rim-image) center top / 100% 7px no-repeat;
  pointer-events: none;
}
.liquid-selection-ready > .liquid-selection { display: block; }
:root .liquid-selection-ready > :is(a, button):is(.active, [aria-current="page"]) {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}
.liquid-selection-group[data-ui-selection="site"] > .liquid-selection { view-transition-name: site-selection; }
.liquid-selection-group[data-ui-selection="admin"] > .liquid-selection { view-transition-name: role-selection; }
:root .liquid-selection-group > :is(a, button):hover {
  background-color: rgba(255,255,255,.12);
  transform: translateY(-1px);
}
[data-theme="dark"] .liquid-selection {
  border-color: rgba(235,248,255,.40) !important;
  background-color: rgba(184,223,255,.08) !important;
  background-image: linear-gradient(145deg, rgba(234,248,255,.14), rgba(24,46,64,.12)) !important;
  box-shadow: 0 3px 12px rgba(4,14,25,.16), inset 0 1px 0 rgba(235,248,255,.5) !important;
}
.liquid-drawer .liquid-selection { display: none !important; }
.liquid-drawer .liquid-selection-group { isolation: auto; }
.liquid-drawer .liquid-selection-group > :is(a, button) { z-index: auto; }
.workbench-main-nav { padding: 4px; }
.admin-sidebar nav.liquid-selection-group { padding: 6px; }

/* 快照由浏览器在正常导航时管理；不支持的浏览器继续原来的页面跳转。 */
::view-transition-old(root) { animation: ui-page-out 150ms ease both; }
::view-transition-new(root) { animation: ui-page-in 230ms ease both; }
::view-transition-group(site-selection), ::view-transition-group(role-selection) {
  animation-duration: 500ms;
  animation-timing-function: cubic-bezier(.2,.75,.2,1);
}
::view-transition-old(site-selection), ::view-transition-new(site-selection),
::view-transition-old(role-selection), ::view-transition-new(role-selection) {
  height: 100%;
  mix-blend-mode: normal;
}
@keyframes ui-page-out { to { opacity: 0; } }
@keyframes ui-page-in { from { opacity: 0; } }
[data-ui-motion="rich"]::view-transition-group(site-selection),
[data-ui-motion="rich"]::view-transition-group(role-selection) { animation-duration: 620ms; }
[data-ui-motion="gentle"]::view-transition-group(*) { animation-duration: 140ms; }

/* 柔光是随鼠标移动的单个小表面，不是全屏追踪滤镜；静止时没有 JS 绘制循环。 */
.liquid-reflection {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  border-radius: inherit;
  corner-shape: inherit;
  pointer-events: none;
  contain: layout paint;
}
.liquid-reflection > span {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 180px;
  height: 90px;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.19) 48%, transparent 76%);
  pointer-events: none;
}
[data-theme="dark"] .liquid-reflection { opacity: .5; }
:root :is(button, .download-btn, .study-action-btn, .quick-card, .theme-preset) {
  transition-duration: var(--ui-duration) !important;
  transition-timing-function: var(--ui-spring) !important;
}
:root :is(button, .download-btn, .study-action-btn, .quick-card, .theme-preset):active:not(:disabled) {
  scale: .975 .96;
  transition-duration: 110ms !important;
}

/* 聚焦光影仅过渡局部边框，不移动输入文字，也不改原表单校验。 */
:root :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  transition: border-color 240ms ease, box-shadow 320ms ease !important;
  border-radius: var(--ui-radius-control) !important;
}
:root :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea):focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--input-focus-ring), inset 0 1px 0 rgba(255,255,255,.8) !important;
}
:root :is(button, a, input, select, textarea, summary, [tabindex="0"]):focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 3px;
  scroll-margin-block: 160px 28px;
}

/* 弹窗的收放中心由最后一次真实点击定位；原 dialog 和业务 show 状态仍负责开关。 */
:is(.modal-content, .settings-panel, .practice-dialog, .room-dialog, [popover], .workbench-search-results) {
  transform-origin: var(--ui-origin-x, 50%) var(--ui-origin-y, 25%);
}
:root .modal-content { scale: .95; }
:root .modal.show .modal-content { scale: 1; }
.toast { animation: none; }
.toast.show { animation: liquid-view-arrive .36s var(--liquid-ease); }
:is(.page-message, .portal-message):not(:empty) {
  border-radius: var(--ui-radius-inset);
  line-height: 1.65;
}
.liquid-theme-wash {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--surface);
}
:root .liquid-drawer {
  transition-timing-function: ease, var(--ui-spring), ease, ease;
  box-shadow: 8px 10px 38px rgba(26,55,80,.14), inset 0 0 0 1px rgba(255,255,255,.55);
}
.liquid-drawer-head { padding: 24px 22px 20px; }
.liquid-drawer-body > section { min-width: 0; }
.liquid-drawer :is(a, button) { -webkit-tap-highlight-color: transparent; }

/* 新外观设置都是 type=button，放在原业务表单外；它们只写浏览器偏好。 */
.ui-visual-settings {
  padding-block: 18px 24px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--input-border);
}
.ui-visual-settings > h2 { margin: 0 0 18px; font-size: 16px; line-height: 1.5; }
.ui-visual-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(0, 300px);
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}
.ui-visual-row > h3 { margin: 0; font-size: 14px; font-weight: 500; }
.ui-visual-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--input-border);
  border-radius: 22px;
  corner-shape: squircle;
  background: rgba(var(--theme-rgb-1),.08);
}
.ui-visual-options button {
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 17px !important;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}
.ui-visual-options button[aria-pressed="true"] {
  color: var(--accent);
  font-weight: 600;
  border-color: var(--liquid-border);
  background: rgba(255,255,255,.40);
  box-shadow: 0 2px 7px rgba(39,74,108,.06), inset 0 1px 0 rgba(255,255,255,.7);
}
[data-theme="dark"] .ui-visual-options button[aria-pressed="true"] { background: rgba(220,240,255,.1); }
.settings-panel .settings-item-left { min-width: 0; }
.settings-panel .settings-item:has(.font-size-selector) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.settings-panel .font-size-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  border-radius: 22px;
  corner-shape: squircle;
}
.settings-panel .font-size-option { min-width: 0; min-height: 40px; padding: 8px 10px; }
.settings-panel .settings-toggle { border-radius: 16px; corner-shape: squircle; }
.settings-panel .settings-toggle-thumb { border-radius: 12px; corner-shape: squircle; transition-timing-function: var(--ui-spring); }
@media (max-width: 520px) {
  .ui-visual-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

/* 设置开关保留原 checkbox 状态、name、事件和键盘操作；普通勾选框不变。 */
:root .setting-row > input[type="checkbox"] {
  appearance: none;
  display: inline-block;
  flex: 0 0 48px;
  width: 48px;
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--input-border);
  border-radius: 16px !important;
  corner-shape: squircle;
  background: rgba(var(--theme-rgb-1),.16);
  cursor: pointer;
  transition: background-color var(--ui-duration) ease, border-color var(--ui-duration) ease;
}
.setting-row > input[type="checkbox"]::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 12px;
  corner-shape: squircle;
  background: #fff;
  box-shadow: 0 1px 4px rgba(22,50,75,.18), inset 0 1px 0 rgba(255,255,255,.9);
  transition: transform var(--ui-duration) var(--ui-spring);
}
:root .setting-row > input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.setting-row > input[type="checkbox"]:checked::before { transform: translateX(20px); }
.setting-row > input[type="checkbox"]:active::before { transform: scaleX(1.12); }
.setting-row > input[type="checkbox"]:checked:active::before { transform: translateX(18px) scaleX(1.12); }

/* 加载反馈不产生假进度，也不常驻闪烁；原提示消失即由业务自然移除。 */
.liquid-loading {
  border-radius: 18px;
  background-image: linear-gradient(110deg, transparent, rgba(var(--theme-rgb-1),.09), transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}
/* 原生折叠控件保留默认点击逻辑。旧浏览器不支持时直接正常展开。 */
details { interpolate-size: allow-keywords; }
details::details-content {
  block-size: 0;
  opacity: 0;
  overflow: clip;
  transition: block-size var(--ui-duration) var(--liquid-ease),
    opacity 220ms ease, content-visibility var(--ui-duration) allow-discrete;
}
details[open]::details-content { block-size: auto; opacity: 1; }
summary { cursor: pointer; border-radius: 16px; corner-shape: squircle; }
:is(.study-icon-btn, .theme-toggle, .liquid-menu-toggle, .liquid-drawer-close) > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  stroke-width: 1.8;
}
.workbench-nav > :is(a, button) > span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  line-height: 1;
}
@starting-style {
  .study-page dialog.practice-dialog[open], .room dialog.room-dialog[open] {
    scale: .95;
    translate: var(--ui-entry-x, 0px) 12px;
  }
  [popover]:popover-open { opacity: 0; scale: .96; }
}

/* 可读档减少透视干扰；均衡档保留柔和折射。系统透明度偏好优先于网页设置。 */
:root[data-ui-clarity="balanced"] :is(.liquid-clear-nav, .liquid-drawer) {
  background-color: rgba(247,252,255,.42) !important;
}
:root[data-ui-clarity="readable"] :is(.header, .study-topbar, .workbench-topbar, .workbench-sidebar,
  .admin-sidebar, .teacher-nav, .student-portal-nav, .liquid-drawer, .settings-panel,
  .modal-content, .practice-dialog, .room-dialog) {
  background: var(--surface) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
:root[data-ui-clarity="readable"] .liquid-selection {
  background: var(--accent-light) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
[data-theme="dark"][data-ui-clarity="balanced"] :is(.liquid-clear-nav, .liquid-drawer) {
  background-color: rgba(22,40,57,.62) !important;
}
:root[data-ui-motion="gentle"] :is(.liquid-reflection, .liquid-feedback-glint) { display: none; }
:root[data-ui-motion="gentle"] :is(button, .quick-card, .download-btn):active { scale: .99; }
:root[data-ui-motion="gentle"] :is(.card, .quick-card, .nav-links a, .site-nav-links a):hover { transform: none !important; }
@media (prefers-reduced-transparency: reduce) {
  :root :is(.liquid-selection, .liquid-drawer, .settings-panel, .modal-content, .practice-dialog) {
    background: var(--surface) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}
@media (forced-colors: active) {
  :root .setting-row > input[type="checkbox"] { appearance: auto; }
  .setting-row > input[type="checkbox"]::before { display: none; }
  .liquid-selection, .liquid-reflection { display: none !important; }
  :root .liquid-selection-ready > :is(a, button):is(.active, [aria-current="page"]) {
    outline: 2px solid Highlight;
  }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-group(*) { animation-duration: 1ms !important; }
  :root *, :root *::before, :root *::after {
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  :root :is(.liquid-reflection, .liquid-theme-wash) { display: none !important; }
  :root :is(button, a, input, select, textarea), details::details-content { transition: none !important; }
  :root :is(button, .download-btn, .quick-card):active { scale: 1; }
  .toast.show { animation: none; }
}

/* C 批次：只与 ui-experience.js 配套的前端体验，保留原文案、业务结构与提交事件。 */
:root {
  --ui-reading-width: 68ch;
  --ui-reading-line: 1.8;
  --ui-viewport-height: 100dvh;
  --ui-quick-duration: 160ms;
}
[data-ui-reading-width="narrow"] { --ui-reading-width: 52ch; }
[data-ui-reading-width="wide"] { --ui-reading-width: 86ch; }
[data-ui-reading-spacing="compact"] { --ui-reading-line: 1.55; }
[data-ui-reading-spacing="relaxed"] { --ui-reading-line: 2.1; }
:root .ui-icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--liquid-border);
  border-radius: 18px !important;
  corner-shape: squircle;
  color: var(--text-primary);
  background: rgba(255,255,255,.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
  cursor: pointer;
  touch-action: manipulation;
}
.ui-icon-button svg, .ui-reading-command svg { width: 20px; height: 20px; flex: 0 0 20px; pointer-events: none; }
.ui-icon-button:disabled { opacity: .4; cursor: default; }
.ui-icon-button[hidden], .ui-nav-controls[hidden] { display: none !important; }

/* C01：边缘按钮覆盖在导航上，不占菜单宽度，不挤动真实选中滑块。 */
.ui-nav-host { position: relative; }
.ui-nav-controls { position: fixed; z-index: 35; pointer-events: none; }
:root .ui-nav-controls > button {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 32px;
  min-width: 32px;
  height: 36px;
  min-height: 36px;
  padding: 6px;
  pointer-events: auto;
  background: var(--surface);
  box-shadow: 0 0 14px 8px var(--surface), inset 0 0 0 1px var(--liquid-border);
  transition: opacity 160ms ease !important;
}
.ui-nav-controls > button:first-child { left: 0; }
.ui-nav-controls > button:last-child { right: 0; }
.liquid-drawer .ui-nav-controls { display: none !important; }
/* clip 保留横向裁切，但不创建阻断 sticky 的滚动祖先；弹窗的原滚动锁仍优先。 */
@supports (overflow: clip) {
  :root, body { overflow-x: clip; }
}

/* C02/C03/C18：短程反馈只移动选中透镜，答案文字及业务状态不参与位移。 */
.practice-options { position: relative; isolation: isolate; }
:root .practice-option { transition-duration: var(--ui-quick-duration) !important; }
:root .practice-option:hover { transform: none !important; }
.practice-option-key { position: relative; z-index: 1; }
.practice-option.selected .practice-option-key {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8);
  background: rgba(var(--theme-rgb-1),.18);
}
.ui-answer-lens {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 2;
  border: 1px solid var(--liquid-border);
  border-radius: 18px;
  corner-shape: squircle;
  background: rgba(255,255,255,.08);
  background-image: var(--liquid-rim-image);
  background-size: 100% 7px;
  background-repeat: no-repeat;
  box-shadow: 0 2px 7px rgba(47,109,159,.12), inset 0 1px 2px rgba(255,255,255,.85);
}
#markQuestion.ui-state-active { box-shadow: inset 0 0 0 1px var(--accent); }
#favoriteQuestion.ui-state-active { color: var(--accent); }
details > summary { position: relative; padding-inline-end: 32px; }
details > summary::after {
  content: "";
  position: absolute;
  right: 12px;
  top: calc(50% - 4px);
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  rotate: 45deg;
  transition: rotate 200ms ease;
}
details[open] > summary::after { rotate: 225deg; }

/* C07/C08：阅读设置只影响正文和选项的行长、行距，不改变表单字体或全站比例。 */
.ui-reading-tools {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 12px 18px;
  scroll-margin-top: 105px;
}
:root .ui-reading-command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--liquid-border);
  border-radius: 20px !important;
  corner-shape: squircle;
  color: var(--text-secondary);
  background: rgba(255,255,255,.14);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  touch-action: manipulation;
}
.ui-reading-command[aria-pressed="true"] { color: var(--accent); background: var(--accent-light); }
.ui-reading-command:disabled { opacity: .5; cursor: default; }
:root .practice-question-card > :is(#questionStem, #questionOptions, #questionResult, .practice-media, .practice-tools, .practice-question-actions) {
  width: 100%;
  max-width: var(--ui-reading-width);
  margin-inline: auto;
  box-sizing: border-box;
}
:root #questionStem, .practice-option > span:last-child, :root #questionResult {
  line-height: var(--ui-reading-line);
  overflow-wrap: anywhere;
}
:root :is(.news-detail-content, .legal-article > section) {
  max-width: var(--ui-reading-width);
  margin-inline: auto;
  line-height: var(--ui-reading-line);
  overflow-wrap: anywhere;
}
:root :is(.news-detail-content, .legal-article > section) p { line-height: inherit; }
.ui-study-focus :is(.practice-hero, .practice-mode-tabs, .practice-sidebar) { display: none !important; }
.ui-study-focus .practice-layout { grid-template-columns: minmax(0,1fr); max-width: 1120px; margin-inline: auto; }
.ui-study-focus .ui-reading-tools {
  max-width: 1120px;
  margin: 0 auto 18px;
}
.ui-study-focus .practice-shell { padding-top: 24px; }

/* 原生 dialog 提供焦点归还、Escape、背景不可交互；不使用业务弹窗开关。 */
:root .ui-experience-dialog {
  box-sizing: border-box;
  width: min(600px, calc(100vw - 24px));
  max-height: calc(var(--ui-viewport-height) - 32px);
  margin: auto;
  padding: 22px;
  border: 1px solid var(--liquid-border);
  border-radius: 32px !important;
  corner-shape: squircle;
  color: var(--text-primary);
  background: var(--surface);
  box-shadow: 0 16px 64px rgba(19,53,82,.18), inset 0 0 0 1px rgba(255,255,255,.55);
  overflow: auto;
}
.ui-experience-dialog:not([open]) { display: none; }
.ui-experience-dialog::backdrop { background: rgba(15,33,50,.32); }
.ui-dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ui-dialog-heading h2 { margin: 0; font-size: 18px; line-height: 1.5; letter-spacing: 0; }
.ui-reading-dialog .ui-visual-row { grid-template-columns: minmax(80px,1fr) minmax(0,300px); margin-block: 22px 4px; }
@supports (backdrop-filter: blur(28px)) {
  :root .ui-reading-dialog {
    background: rgba(245,250,255,.68);
    backdrop-filter: blur(28px) saturate(170%);
  }
  [data-theme="dark"] .ui-reading-dialog { background: rgba(24,43,61,.82); }
}

/* C13/C19：校验提示沿原字段自然排版，不用绝对定位压住相邻输入框。 */
.ui-field-hint { display: block; margin-top: 4px; color: #ac3543; font-size: 13px; line-height: 1.6; }
:root .ui-field-invalid { border-color: #ac3543 !important; box-shadow: 0 0 0 3px rgba(172,53,67,.1) !important; }
[data-theme="dark"] .ui-field-hint { color: #ffadb6; }
:is(input, textarea, select, .page-message, .portal-message) { scroll-margin-block: 170px 28px; }

/* C15：表格内部滚动，表头保持可见；列宽只在真实拖动或键盘调整后固定。 */
:root .ui-table-viewport {
  position: relative;
  max-height: min(65vh, 640px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.ui-table-viewport .study-table { border-collapse: separate; border-spacing: 0; }
.ui-table-viewport thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-right: 22px;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--input-border);
}
.ui-table-viewport tbody tr:is(:hover, :focus-within) > td { background: rgba(var(--theme-rgb-1),.09); }
.ui-table-fixed { table-layout: fixed; }
.ui-table-fixed :is(th, td) { overflow: hidden; overflow-wrap: anywhere; white-space: normal; }
.ui-column-handle {
  position: absolute;
  right: 0;
  top: 5px;
  bottom: 5px;
  width: 14px;
  border-radius: 8px;
  cursor: col-resize;
  touch-action: none;
}
.ui-column-handle::before {
  content: "";
  position: absolute;
  width: 2px;
  inset: 6px auto 6px 6px;
  border-radius: 2px;
  background: var(--input-border);
}
.ui-column-handle:is(:hover, :focus-visible)::before { background: var(--accent); }
.ui-column-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ui-column-resizing { user-select: none; cursor: col-resize; }
/* 原危险操作的浅色玻璃底需配深红文字，避免沿用实色按钮的白字。 */
:root .study-action-btn.study-button-danger { color: #a93443 !important; }
[data-theme="dark"] .study-action-btn.study-button-danger { color: #ffadb6 !important; }

/* C16/C17：配图使用固定展示窗口保留空间，完整适配原图；查看器只缩放独立副本。 */
.practice-media:has(img) { min-height: 180px; }
.practice-media.ui-media-reserved { min-height: max(180px, min(32vh, 300px)); }
:root .practice-media img {
  display: block;
  width: min(100%,520px);
  height: min(32vh,300px);
  min-height: 180px;
  object-fit: contain;
}
.ui-zoomable { cursor: zoom-in; }
.ui-zoomable:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
:root .ui-image-dialog {
  width: min(1280px, calc(100vw - 32px));
  height: min(880px, calc(var(--ui-viewport-height) - 32px));
  padding: 16px;
  overflow: hidden;
}
.ui-image-dialog[open] { display: flex; flex-direction: column; gap: 12px; }
.ui-image-dialog .ui-dialog-heading { flex: 0 0 auto; }
.ui-image-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ui-image-actions output { width: 52px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.ui-image-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border-radius: 22px;
  corner-shape: squircle;
  background: var(--surface-2);
  touch-action: none;
}
.ui-image-viewport > img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform-origin: center;
  user-select: none;
  pointer-events: none;
}
.ui-image-pannable { cursor: grab; }
.ui-image-pannable:active { cursor: grabbing; }
body.ui-image-open { overflow: hidden !important; }
#portalView { min-height: 320px; }
.study-table-wrap:has(tbody:empty) { min-height: 112px; }
:is(.practice-stats strong, .workbench-stat-value, .portal-stat > strong) { font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .ui-reading-dialog .ui-visual-row { grid-template-columns: minmax(0,1fr); }
  .ui-image-dialog .ui-dialog-heading { align-items: flex-start; flex-wrap: wrap; }
  .ui-image-dialog .ui-image-actions { width: 100%; justify-content: flex-end; }
  :root .ui-image-dialog { width: calc(100vw - 16px); padding: 12px; }
}
/* C20：触屏扩大实际点击范围，保留网页导航形态，避免小按钮挤在一起。 */
@media (pointer: coarse) {
  :root :is(.ui-icon-button, .study-icon-btn, .liquid-menu-toggle, .liquid-drawer-close) {
    min-width: 44px;
    min-height: 44px;
  }
  :root .ui-nav-controls > button { min-width: 44px; min-height: 44px; }
  :root :is(.practice-tools button, .practice-question-actions button, .ui-reading-command,
    .practice-dialog-head button, .ui-visual-options button, .answer-card-grid button) { min-height: 44px; }
  .practice-dialog-head button { min-width: 44px; }
  .practice-tools, .practice-question-actions { gap: 10px; }
  .ui-column-handle { width: 24px; }
  .ui-column-handle::before { left: 12px; }
}
@media (prefers-reduced-transparency: reduce) {
  :root .ui-reading-dialog { background: var(--surface); backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ui-answer-lens, .ui-reading-command, details > summary::after { transition: none !important; }
}
@media print {
  .ui-reading-tools, .ui-nav-controls, .ui-column-handle, .ui-experience-dialog { display: none !important; }
  .ui-table-viewport { max-height: none !important; overflow: visible !important; }
}
/* Work surfaces use solid layers so scrolling and long data lists stay inexpensive. */
.study-page {
  --lens-body: var(--surface);
  --lens-surface: var(--surface);
  --glass-blur: none;
  --glass-blur-strong: none;
}
body.study-page:not(.room-page) { background: var(--surface-2) !important; }
.study-page :is(.study-card, .study-sidebar, .admin-sidebar, .login-card,
  .student-feature-center, .student-feature-links a) {
  background: var(--surface);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 1px 3px rgba(24, 46, 63, .09);
  border-radius: 8px;
}
.study-page :is(.study-card, .study-sidebar, .admin-sidebar, .login-card)::before { display: none; }
.study-page .study-topbar {
  background: var(--surface);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 1px 3px rgba(24, 46, 63, .09);
}
:root .study-page .study-topbar.liquid-clear-nav,
:root .study-page .workbench-topbar.liquid-clear-nav {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.study-page :is(.study-action-btn, .study-icon-btn, .study-mobile-menu-toggle) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.study-page .study-action-btn.study-button-primary { background: var(--accent); color: var(--text-on-accent, #fff); }
.study-page :is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.student-admin-layout { display: grid; grid-template-columns: minmax(245px, .75fr) minmax(0, 1.7fr); gap: 20px; align-items: start; }
.student-search { margin: 16px 0 4px; }
.student-search label { font-size: 13px; color: var(--text-secondary); }
.student-search input { min-width: 180px; flex: 1 1 180px; }
.student-admin-layout > section { min-width: 0; }
.student-admin-rows { display: grid; border-top: 1px solid var(--glass-border); }
.student-admin-person {
  width: 100%; min-height: 68px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px; border: 0; border-bottom: 1px solid var(--glass-border);
  background: transparent; color: var(--text-primary); text-align: left; cursor: pointer;
}
.student-admin-person:hover, .student-admin-person.selected { background: var(--accent-light); }
.student-admin-person strong, .student-admin-person small { display: block; overflow-wrap: anywhere; }
.student-admin-person small { margin-top: 4px; color: var(--text-secondary); font-size: 12px; }
.student-admin-person .study-badge { flex: 0 0 auto; }
.student-admin-detail { min-height: 340px; padding: 22px; background: var(--surface); border: 1px solid var(--glass-border); border-radius: 8px; }
.student-admin-detail { scroll-margin-top: 78px; }
.student-admin-detail:has(> .study-empty) { min-height: 170px; }
.student-admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.student-admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.student-admin-actions .study-action-btn { white-space: normal; min-height: 40px; }
.student-admin-head h2 { margin: 4px 0; font-size: 23px; }
.student-admin-head p, .student-admin-muted { color: var(--text-secondary); overflow-wrap: anywhere; }
.student-admin-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 18px 0; }
.student-admin-metric { padding: 12px; border: 1px solid var(--glass-border); border-radius: 6px; }
.student-admin-metric span, .student-admin-metric strong { display: block; }
.student-admin-metric span { color: var(--text-secondary); font-size: 12px; }
.student-admin-metric strong { margin-top: 5px; font-size: 19px; overflow-wrap: anywhere; }
.student-admin-detail section { padding: 14px 0; border-top: 1px solid var(--glass-border); }
.student-admin-detail h3 { margin: 0 0 10px; font-size: 16px; }
.student-admin-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.student-admin-days > div { min-width: 0; padding: 8px 5px; background: var(--surface-2); text-align: center; border-radius: 5px; }
.student-admin-days :is(span, strong, small) { display: block; font-size: 11px; }
.student-admin-days strong { margin: 4px 0; font-size: 15px; }
.student-admin-entry { margin: 5px 0; padding: 7px 0; overflow-wrap: anywhere; }
.student-admin-links { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 12px; border-top: 1px solid var(--glass-border); }
@media (max-width: 1150px) { .student-admin-layout { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .student-search { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .student-search label, .student-search input { grid-column: 1 / -1; }
  .student-search input, .student-search select, .student-search button { width: 100%; min-width: 0; }
  .student-admin-head { flex-wrap: wrap; }
  .student-admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-admin-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .student-admin-detail { padding: 14px; }
}
.student-portal-page .student-portal-nav > a {
  flex: 0 0 auto;
  white-space: nowrap;
}
