/**
 * QiJing School OS 2.0 · Modern Education Workspace Foundation
 * Design Philosophy: WORKSPACE FIRST. FUNCTION FIRST. UI SECOND.
 * Notion & Linear Inspired Minimalist High-Density Design System
 */

/* ==========================================================================
   1. Design Tokens & Color Palettes
   ========================================================================== */

:root,
html[data-theme="light"] {
  --ws-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ws-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Surface Colors (Clean & High Contrast) */
  --ws-bg: #F8FAFC;
  --ws-surface: #FFFFFF;
  --ws-surface-subtle: #F1F5F9;
  --ws-surface-hover: #F8FAFC;
  --ws-surface-active: #E2E8F0;

  /* Border & Divider Colors (Subtle & Crisp) */
  --ws-border: #E2E8F0;
  --ws-border-subtle: #F1F5F9;
  --ws-border-strong: #CBD5E1;

  /* Typography Colors */
  --ws-text-primary: #0F172A;
  --ws-text-secondary: #475569;
  --ws-text-muted: #94A3B8;
  --ws-text-inverse: #FFFFFF;

  /* Primary Brand & Interactive Accent */
  --ws-accent: #0284C7;
  --ws-accent-hover: #0369A1;
  --ws-accent-light: #E0F2FE;
  --ws-accent-text: #0369A1;

  /* Status Tokens (Low Saturation, High Legibility) */
  --ws-success: #16A34A;
  --ws-success-bg: #DCFCE7;
  --ws-success-border: #BBF7D0;

  --ws-warning: #D97706;
  --ws-warning-bg: #FEF3C7;
  --ws-warning-border: #FDE68A;

  --ws-danger: #DC2626;
  --ws-danger-bg: #FEE2E2;
  --ws-danger-border: #FECACA;

  --ws-info: #2563EB;
  --ws-info-bg: #EFF6FF;
  --ws-info-border: #DBEAFE;

  --ws-purple: #7C3AED;
  --ws-purple-bg: rgba(124, 58, 237, 0.12);
  --ws-purple-border: rgba(124, 58, 237, 0.28);

  /* Neutral Badges */
  --ws-badge-bg: #F1F5F9;
  --ws-badge-text: #334155;
  --ws-badge-border: #E2E8F0;

  /* Elevation Shadows (Tight & Crisp, No Diffuse Blurs) */
  --ws-shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --ws-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --ws-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --ws-shadow-popover: 0 12px 24px -4px rgba(15, 23, 42, 0.12), 0 4px 6px -2px rgba(15, 23, 42, 0.05);

  /* Geometry */
  --ws-radius-sm: 4px;
  --ws-radius-md: 6px;
  --ws-radius-lg: 8px;
  --ws-radius-full: 9999px;
  --ws-sidebar-width: 68px;
  --ws-topbar-height: 52px;
}

html[data-theme="dark"] {
  /* Dark Surface Colors (方案 4 Flux / Apple VisionOS / macOS 26 深邃液态微光底座) */
  --ws-bg: #060A12;
  --ws-surface: #0F172A;
  --ws-surface-subtle: #1E293B;
  --ws-surface-hover: #1E293B;
  --ws-surface-active: #334155;

  /* Borders */
  --ws-border: #222F43;
  --ws-border-subtle: #182234;
  --ws-border-strong: #334155;

  /* Typography */
  --ws-text-primary: #F8FAFC;
  --ws-text-secondary: #94A3B8;
  --ws-text-muted: #64748B;
  --ws-text-inverse: #0F172A;

  /* Accent */
  --ws-accent: #38BDF8;
  --ws-accent-hover: #7DD3FC;
  --ws-accent-light: rgba(56, 189, 248, 0.14);
  --ws-accent-text: #38BDF8;

  /* Status */
  --ws-success: #34D399;
  --ws-success-bg: rgba(52, 211, 153, 0.15);
  --ws-success-border: rgba(52, 211, 153, 0.3);

  --ws-warning: #FBBF24;
  --ws-warning-bg: rgba(251, 191, 36, 0.15);
  --ws-warning-border: rgba(251, 191, 36, 0.3);

  --ws-danger: #F87171;
  --ws-danger-bg: rgba(248, 113, 113, 0.15);
  --ws-danger-border: rgba(248, 113, 113, 0.3);

  --ws-info: #60A5FA;
  --ws-info-bg: rgba(96, 165, 250, 0.15);
  --ws-info-border: rgba(96, 165, 250, 0.3);

  --ws-purple: #A78BFA;
  --ws-purple-bg: rgba(167, 139, 250, 0.16);
  --ws-purple-border: rgba(167, 139, 250, 0.32);

  --ws-badge-bg: #1E293B;
  --ws-badge-text: #CBD5E1;
  --ws-badge-border: #334155;

  /* Elevation Shadows */
  --ws-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --ws-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --ws-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
  --ws-shadow-popover: 0 16px 32px -4px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   2. Base Reset & Structure
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body,
#app,
.ws-shell-layout,
.ws-app-layout {
  font-family: var(--ws-font-family);
  background: radial-gradient(circle at 12% 16%, rgba(2, 132, 199, 0.06) 0%, transparent 40%),
              radial-gradient(circle at 88% 22%, rgba(245, 158, 11, 0.05) 0%, transparent 38%),
              #F8FAFC;
  background-attachment: fixed;
  color: var(--ws-text-primary);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

#app,
.ws-shell-layout,
.ws-app-layout {
  display: flex;
}

html[data-theme="dark"] body,
html[data-theme="dark"] #app,
html[data-theme="dark"] .ws-shell-layout,
html[data-theme="dark"] .ws-app-layout {
  background: radial-gradient(circle at 12% 16%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 88% 22%, rgba(245, 158, 11, 0.06) 0%, transparent 38%),
              #060A12;
  background-attachment: fixed;
}

/* ==========================================================================
   3. Sidebar Navigation (Zero-Overlap Push Layout · Minimalist Liquid Glass)
   ========================================================================== */

#ws-sidebar-host {
  position: relative;
  flex-shrink: 0;
  width: 68px !important; /* 桌面端宿主固定为 68px，Auto Minimum，保证右侧工作区拥有最大的高密度视野 */
  height: calc(100vh - 24px);
  margin: 12px 0 12px 14px;
  z-index: 60;
  transition: width 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.ws-sidebar {
  position: absolute;
  left: 0;
  top: 0;
  width: 68px !important; /* 默认全自动最小化为 68px 微型 Dock (Auto Minimum) */
  height: 100%;
  margin: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.08), 
              inset 0 1px 1px 0 rgba(255, 255, 255, 0.95);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 60;
  user-select: none;
  overflow: visible;
  transition: width 0.24s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.24s ease, 
              background 0.25s ease, 
              border-color 0.25s ease;
}

/* 自动全展开态 (Auto Hover Expand 280px)：当鼠标移入、焦点、具有 .is-hovered 或移动端打开时自动平滑展开 */
.ws-sidebar:hover,
.ws-sidebar:focus-within,
.ws-sidebar.is-hovered,
.ws-sidebar.is-pinned,
.ws-sidebar.mobile-open {
  width: 280px !important;
  box-shadow: 0 20px 48px -8px rgba(15, 23, 42, 0.16), 
              0 0 0 1px rgba(255, 255, 255, 0.85),
              inset 0 1px 1px 0 rgba(255, 255, 255, 0.95);
  z-index: 70;
}

/* 兼容宽屏工作台 280px 标准 */
@media (min-width: 1600px) {
  .ws-sidebar:hover,
  .ws-sidebar.is-hovered,
  .ws-sidebar.is-pinned {
    width: 280px !important;
  }
}

/* 触控安全桥规范 (展开态与固定态具备右侧 28px 触碰桥，折叠态严禁包含以防误触) */
.ws-sidebar.is-hovered::after,
.ws-sidebar.is-pinned::after {
  content: "";
  position: absolute;
  top: 0;
  right: -28px;
  width: 28px;
  height: 100%;
  pointer-events: auto;
}

/* 退出登录按钮 (Logout Button) */
.ws-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(226, 232, 240, 0.8);
  color: #64748B;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  flex-shrink: 0;
}

.ws-logout-btn:hover {
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #EF4444 !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12) !important;
}

.ws-logout-btn:active {
  transform: scale(0.94);
}

html[data-theme="dark"] .ws-logout-btn {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
  color: #94A3B8;
}

html[data-theme="dark"] .ws-logout-btn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #F87171 !important;
}

/* 微Dock默认态 (Auto Minimum 68px)：精准隐藏扩展文字与次要内容 */
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-deck-meta,
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-deck-expanded-info,
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-deck-sub-row,
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-nav-label,
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-user-details,
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-version-pill-v101,
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-sidebar-search-input,
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-sidebar-search-kbd {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-sidebar-header {
  width: 100% !important;
  padding: 0 4px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  align-items: center !important;
  justify-content: center !important;
}

.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-school-deck {
  width: 46px !important;
  height: 46px !important;
  min-height: 46px !important;
  max-width: 46px !important;
  padding: 0 !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 0 auto !important;
  border-radius: 12px !important;
}

.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-deck-avatar {
  margin: 0 !important;
}

.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-nav-item {
  width: 46px !important;
  height: 46px !important;
  padding: 0 !important;
  justify-content: center !important;
  margin: 4px auto !important;
  border-radius: 12px !important;
}

.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-nav-icon {
  margin: 0 !important;
}

.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-sidebar-controls {
  flex-direction: column !important;
  gap: 8px !important;
  padding: 0 !important;
  align-items: center !important;
  justify-content: center !important;
}

.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-user-profile {
  width: 46px !important;
  height: 46px !important;
  padding: 0 !important;
  justify-content: center !important;
  border-radius: 12px !important;
}

.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-lang-segmented-pill {
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-lang-seg-btn:not(.active) {
  display: none !important;
}

.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-lang-seg-btn.active {
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-sidebar-search {
  width: 46px !important;
  height: 42px !important;
  padding: 0 !important;
  justify-content: center !important;
  border-radius: 12px !important;
}

/* 浮动提示气泡 (仅在微Dock模式悬停时显示) */
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-nav-item:hover .ws-nav-tooltip,
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-school-deck:hover .ws-school-deck-tooltip,
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-user-profile:hover .ws-user-tooltip,
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-sidebar-search:hover .ws-nav-tooltip,
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-theme-toggle:hover .ws-nav-tooltip,
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-logout-btn:hover .ws-nav-tooltip {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

html[data-theme="dark"] .ws-sidebar {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6), 
              inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Sidebar Expansion Specifics (Full 260px Liquid Glass & Collapsed Modes)
   ========================================================================== */

/* 自动全展开态 (Auto Hover Expand 260px) 头部呈现 */
.ws-sidebar:hover .ws-sidebar-header,
.ws-sidebar:focus-within .ws-sidebar-header,
.ws-sidebar.is-hovered .ws-sidebar-header,
.ws-sidebar.mobile-open .ws-sidebar-header {
  padding: 0 0 10px 0 !important;
  width: calc(100% - 16px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  min-height: 46px !important;
  flex-direction: row !important;
}

.ws-sidebar:hover .ws-school-deck,
.ws-sidebar:focus-within .ws-school-deck,
.ws-sidebar.is-hovered .ws-school-deck,
.ws-sidebar.mobile-open .ws-school-deck {
  flex: 1 1 auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 52px !important;
  height: auto !important;
  padding: 7px 10px 7px 10px !important;
  border-radius: 14px !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  transform: none !important;
  overflow: hidden !important;
  margin: 0 !important;
}

.ws-sidebar:hover .ws-deck-avatar,
.ws-sidebar:focus-within .ws-deck-avatar,
.ws-sidebar.is-hovered .ws-deck-avatar,
.ws-sidebar.mobile-open .ws-deck-avatar {
  margin: 0 !important;
}

.ws-sidebar:hover .ws-deck-meta,
.ws-sidebar:hover .ws-deck-expanded-info,
.ws-sidebar:focus-within .ws-deck-meta,
.ws-sidebar:focus-within .ws-deck-expanded-info,
.ws-sidebar.is-hovered .ws-deck-meta,
.ws-sidebar.is-hovered .ws-deck-expanded-info,
.ws-sidebar.mobile-open .ws-deck-meta,
.ws-sidebar.mobile-open .ws-deck-expanded-info {
  position: static !important;
  width: auto !important;
  height: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  flex: 1 !important;
  overflow: visible !important;
  text-align: left !important;
}

.ws-sidebar:hover .ws-deck-header-row,
.ws-sidebar:focus-within .ws-deck-header-row,
.ws-sidebar.is-hovered .ws-deck-header-row,
.ws-sidebar.mobile-open .ws-deck-header-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  width: 100% !important;
}

.ws-deck-name {
  flex: 1 !important;
  min-width: 0 !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  line-height: 1.28 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  word-break: break-word !important;
  white-space: normal !important;
  letter-spacing: -0.01em !important;
  color: var(--ws-text-primary, #0f172a) !important;
}

.ws-deck-tier-badge {
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  padding: 1px 5px !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  border-radius: 4px !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  line-height: 1.2 !important;
  margin-left: auto !important;
}

.ws-sidebar:hover .ws-deck-sub-row,
.ws-sidebar.is-hovered .ws-deck-sub-row,
.ws-sidebar.is-pinned .ws-deck-sub-row,
.ws-sidebar.mobile-open .ws-deck-sub-row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  width: 100% !important;
  margin-top: 3px !important;
}

.ws-deck-code {
  font-size: 11px !important;
  color: var(--ws-text-muted, #64748b) !important;
  font-family: var(--font-mono, "SF Mono", Menlo, Consolas, monospace) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.ws-switcher-chevron,
.ws-sidebar:hover .ws-switcher-chevron,
.ws-sidebar.is-hovered .ws-switcher-chevron,
.ws-sidebar.is-pinned .ws-switcher-chevron,
.ws-sidebar.mobile-open .ws-switcher-chevron,
.ws-school-deck:hover .ws-switcher-chevron,
.ws-school-deck.popover-open .ws-switcher-chevron {
  display: none !important;
}

.ws-nav-label {
  display: inline-block;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  font-size: 13.5px;
  color: inherit;
  transition: opacity 0.2s ease, max-width 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.ws-sidebar:hover .ws-nav-item,
.ws-sidebar:focus-within .ws-nav-item,
.ws-sidebar.is-hovered .ws-nav-item,
.ws-sidebar.mobile-open .ws-nav-item {
  width: calc(100% - 20px) !important;
  height: 44px !important;
  border-radius: 12px !important;
  padding: 0 16px !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  margin: 3px 10px !important;
  transform: none !important;
  font-size: 14px !important;
}

.ws-sidebar:hover .ws-nav-label,
.ws-sidebar:focus-within .ws-nav-label,
.ws-sidebar.is-hovered .ws-nav-label,
.ws-sidebar.mobile-open .ws-nav-label {
  position: static !important;
  width: auto !important;
  height: auto !important;
  opacity: 1 !important;
  max-width: 185px !important;
  pointer-events: auto !important;
  overflow: visible !important;
  font-size: 14px !important;
  flex: 1 !important;
  text-align: left !important;
}

.ws-sidebar:hover .ws-nav-count,
.ws-sidebar:focus-within .ws-nav-count,
.ws-sidebar.is-hovered .ws-nav-count,
.ws-sidebar.mobile-open .ws-nav-count {
  position: static !important;
  margin-left: auto !important;
  font-size: 11px !important;
  height: 18px !important;
  min-width: 18px !important;
  border-radius: 9px !important;
  padding: 0 6px !important;
}

.ws-sidebar:hover .ws-nav-item.active::before,
.ws-sidebar:focus-within .ws-nav-item.active::before,
.ws-sidebar.is-hovered .ws-nav-item.active::before,
.ws-sidebar.mobile-open .ws-nav-item.active::before {
  left: 0 !important;
  height: 18px !important;
  border-radius: 0 3px 3px 0 !important;
}

/* 展开态下隐藏 tooltip 气泡 */
.ws-sidebar:hover .ws-nav-tooltip,
.ws-sidebar:focus-within .ws-nav-tooltip,
.ws-sidebar.is-hovered .ws-nav-tooltip,
.ws-sidebar.mobile-open .ws-nav-tooltip,
.ws-sidebar:hover .ws-school-deck-tooltip,
.ws-sidebar:focus-within .ws-school-deck-tooltip,
.ws-sidebar.is-hovered .ws-school-deck-tooltip,
.ws-sidebar.mobile-open .ws-school-deck-tooltip,
.ws-sidebar:hover .ws-user-tooltip,
.ws-sidebar:focus-within .ws-user-tooltip,
.ws-sidebar.is-hovered .ws-user-tooltip,
.ws-sidebar.mobile-open .ws-user-tooltip,
.ws-sidebar:hover .ws-logout-btn .ws-nav-tooltip,
.ws-sidebar.is-hovered .ws-logout-btn .ws-nav-tooltip,
.ws-sidebar:hover .ws-theme-toggle .ws-nav-tooltip,
.ws-sidebar.is-hovered .ws-theme-toggle .ws-nav-tooltip {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* 底部用户信息展开 */
.ws-sidebar:hover .ws-user-profile,
.ws-sidebar:focus-within .ws-user-profile,
.ws-sidebar.is-hovered .ws-user-profile,
.ws-sidebar.mobile-open .ws-user-profile {
  width: calc(100% - 20px) !important;
  height: 48px !important;
  border-radius: 12px !important;
  padding: 0 8px !important;
  justify-content: flex-start !important;
  gap: 9px !important;
  background: rgba(255, 255, 255, 0.5) !important;
  border: 1px solid rgba(226, 232, 240, 0.6) !important;
  transform: none !important;
}

html[data-theme="dark"] .ws-sidebar:hover .ws-user-profile,
html[data-theme="dark"] .ws-sidebar:focus-within .ws-user-profile,
html[data-theme="dark"] .ws-sidebar.is-hovered .ws-user-profile,
html[data-theme="dark"] .ws-sidebar.mobile-open .ws-user-profile {
  background: rgba(30, 41, 59, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.ws-sidebar:hover .ws-user-details,
.ws-sidebar:focus-within .ws-user-details,
.ws-sidebar.is-hovered .ws-user-details,
.ws-sidebar.mobile-open .ws-user-details {
  position: static !important;
  width: auto !important;
  height: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  flex: 1 !important;
  overflow: hidden !important;
  text-align: left !important;
}

.ws-sidebar:hover .ws-sidebar-controls,
.ws-sidebar:focus-within .ws-sidebar-controls,
.ws-sidebar.is-hovered .ws-sidebar-controls,
.ws-sidebar.mobile-open .ws-sidebar-controls {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  width: 100% !important;
  padding: 0 10px !important;
}

/* 三语分段选择滑动胶囊 (Trilingual Segmented Pill Switcher like P2) */
.ws-sidebar:hover .ws-lang-segmented-pill,
.ws-sidebar:focus-within .ws-lang-segmented-pill,
.ws-sidebar.is-hovered .ws-lang-segmented-pill,
.ws-sidebar.mobile-open .ws-lang-segmented-pill {
  display: inline-flex !important;
  align-items: center !important;
  height: 38px !important;
  width: auto !important;
  padding: 3px !important;
  gap: 2px !important;
  border-radius: 9999px !important;
  background: rgba(15, 23, 42, 0.05) !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.ws-sidebar:hover .ws-lang-seg-btn,
.ws-sidebar.is-hovered .ws-lang-seg-btn,
.ws-sidebar.is-pinned .ws-lang-seg-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 30px !important;
  padding: 0 12px !important;
  border-radius: 9999px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #475569 !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.ws-sidebar:hover .ws-lang-seg-btn:hover,
.ws-sidebar.is-hovered .ws-lang-seg-btn:hover,
.ws-sidebar.is-pinned .ws-lang-seg-btn:hover {
  color: #0f172a !important;
}

.ws-sidebar:hover .ws-lang-seg-btn.active,
.ws-sidebar.is-hovered .ws-lang-seg-btn.active,
.ws-sidebar.is-pinned .ws-lang-seg-btn.active {
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12), 0 1px 2px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="dark"] .ws-lang-segmented-pill {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .ws-lang-seg-btn {
  color: #94A3B8 !important;
}

html[data-theme="dark"] .ws-lang-seg-btn:hover {
  color: #F8FAFC !important;
}

html[data-theme="dark"] .ws-lang-seg-btn.active {
  background: #1E293B !important;
  color: #F8FAFC !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

/* Sidebar Header / School Identity Deck (46px 居中微胶囊) */
.ws-sidebar-header {
  padding: 0 0 8px 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  position: relative;
  background: transparent;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

html[data-theme="dark"] .ws-sidebar-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ws-school-deck {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.ws-school-deck:hover,
.ws-school-deck.popover-open {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: 0 4px 14px -2px rgba(2, 132, 199, 0.18);
  transform: scale(1.04);
}

html[data-theme="dark"] .ws-school-deck {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .ws-school-deck:hover,
html[data-theme="dark"] .ws-school-deck.popover-open {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.5);
}

.ws-deck-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.ws-deck-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.ws-deck-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.14), rgba(2, 132, 199, 0.04));
  border: 1px solid rgba(2, 132, 199, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ws-accent, #0284C7);
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(2, 132, 199, 0.08);
  position: relative;
  margin: 0 auto;
}

.ws-deck-avatar .ws-pulse-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10B981;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
  z-index: 2;
  pointer-events: none;
}

html[data-theme="dark"] .ws-deck-avatar {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0.05));
  border-color: rgba(56, 189, 248, 0.3);
  color: #38BDF8;
}

html[data-theme="dark"] .ws-deck-avatar .ws-pulse-dot {
  border-color: #1E293B;
}

.ws-deck-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.ws-deck-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.ws-deck-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ws-text-primary);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.015em;
  flex: 1;
  min-width: 0;
}

.ws-deck-code,
.ws-switcher-sub {
  font-size: 11px !important;
  color: var(--ws-text-muted) !important;
  font-family: var(--ws-font-mono, monospace) !important;
  margin-top: 2px !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  letter-spacing: -0.01em !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  width: 100% !important;
  max-width: 100% !important;
}

.ws-deck-dot {
  opacity: 0.45;
}

.ws-deck-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.ws-deck-tier-badge {
  padding: 1.5px 6px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.ws-deck-tier-ultra {
  background: linear-gradient(135deg, #6D28D9 0%, #B45309 45%, #F59E0B 100%);
  color: #FFFFFF;
  box-shadow: 0 1px 4px rgba(109, 40, 217, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(251, 191, 36, 0.6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.ws-deck-tier-max,
.ws-deck-tier-titan {
  background: linear-gradient(135deg, #7C3AED 0%, #B45309 50%, #D97706 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.ws-deck-tier-pro {
  background: linear-gradient(135deg, #0284C7, #0369A1);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.ws-deck-tier-std {
  background: #64748B;
  color: #FFFFFF;
}

.ws-deck-tier-club {
  background: linear-gradient(135deg, #8B5CF6, #6D28D9);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(109, 40, 217, 0.25);
}

.ws-deck-telemetry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 5px;
  border-top: 1px dashed rgba(226, 232, 240, 0.85);
  font-size: 10px;
  color: var(--ws-text-muted);
  width: 100%;
}

html[data-theme="dark"] .ws-deck-telemetry {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.ws-pulse-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ws-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10B981;
  display: inline-block;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
  animation: wsPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  flex-shrink: 0;
}

@keyframes wsPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.ws-deck-status-text {
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.ws-deck-year-tag {
  background: rgba(148, 163, 184, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--ws-font-mono, monospace);
  font-size: 9.5px;
  font-weight: 600;
}

/* 兼容原有触发类名与元素 */
.ws-switcher-trigger {
  width: 100%;
}

.ws-switcher-chevron {
  color: var(--ws-text-muted);
  font-size: 12px;
  flex-shrink: 0;
  display: none !important;
  align-items: center;
  transition: transform 0.2s ease;
}

.ws-popover.open ~ .ws-school-deck .ws-switcher-chevron,
.ws-school-deck.popover-open .ws-switcher-chevron {
  transform: rotate(180deg);
}

/* ==========================================================================
   Lucide SVG Icon System Integration
   ========================================================================== */
.qj-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.125em;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}

.ws-switcher-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--ws-radius-sm);
  background-color: var(--ws-surface-subtle);
  border: 1px solid var(--ws-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ws-text-secondary);
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: none;
}

.ws-switcher-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ws-switcher-title {
  /* Class mapped directly to .ws-deck-name */
}

.ws-switcher-sub {
  /* Class mapped directly to .ws-deck-code */
}

/* Sidebar Context Hierarchy Tag (微 Dock 模式下隐藏) */
.ws-sidebar-scope {
  display: none;
}

/* Sidebar Navigation Items (微 Dock 纯图标居中胶囊) */
.ws-sidebar-nav {
  flex: 1;
  width: 100%;
  overflow: visible;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.ws-nav-group-title {
  display: none;
}

.ws-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  margin: 4px auto;
  box-sizing: border-box;
  color: var(--ws-text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  background: transparent;
}

.ws-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.7);
  color: var(--ws-text-primary);
  transform: scale(1.04);
}

html[data-theme="dark"] .ws-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.ws-nav-item.active {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
  font-weight: 600;
}

.ws-nav-item.active::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  border-radius: 4px;
  background: #0284c7;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.8);
}

html[data-theme="dark"] .ws-nav-item.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
}

html[data-theme="dark"] .ws-nav-item.active::before {
  background: #38BDF8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

.ws-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: inherit;
  transition: all 0.18s ease;
}

.ws-nav-item:hover .ws-nav-icon {
  color: var(--ws-text-primary);
}

.ws-nav-item.active .ws-nav-icon {
  color: var(--ws-accent, #0284C7);
}

html[data-theme="dark"] .ws-nav-item.active .ws-nav-icon {
  color: #38BDF8;
}

/* 导航微缩角标 (Micro Badge) 与静默计数器 */
.ws-nav-micro-badge,
.ws-nav-count {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
  font-family: var(--ws-font-mono, monospace);
  letter-spacing: -0.02em;
  pointer-events: none;
  transition: all 0.18s ease;
}

html[data-theme="dark"] .ws-nav-micro-badge,
html[data-theme="dark"] .ws-nav-count {
  background: #1E293B;
  color: #94A3B8;
  border-color: #334155;
}

/* 液态悬停气泡 (Liquid Glass Tooltip) */
.ws-nav-tooltip,
.ws-school-deck-tooltip,
.ws-user-tooltip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: rgba(15, 23, 42, 0.88);
  color: #FFFFFF;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
}

.ws-nav-item:hover .ws-nav-tooltip,
.ws-school-deck:hover .ws-school-deck-tooltip,
.ws-user-profile:hover .ws-user-tooltip,
.ws-btn-switch-account:hover .ws-nav-tooltip,
.ws-theme-toggle:hover .ws-nav-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

html[data-theme="dark"] .ws-nav-tooltip,
html[data-theme="dark"] .ws-school-deck-tooltip,
html[data-theme="dark"] .ws-user-tooltip {
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6);
}

/* Sidebar Footer (微 Dock 底部控制舱) */
.ws-sidebar-footer {
  padding: 10px 0 4px 0;
  border-top: 1px solid rgba(226, 232, 240, 0.7);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  position: relative;
}

html[data-theme="dark"] .ws-sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ws-user-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer !important;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.ws-user-profile:hover {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 12px -2px rgba(2, 132, 199, 0.15);
}

.ws-user-profile:active {
  transform: scale(0.97);
}

.ws-sidebar:hover .ws-user-profile:hover,
.ws-sidebar.is-hovered .ws-user-profile:hover,
.ws-sidebar.is-pinned .ws-user-profile:hover {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(2, 132, 199, 0.4) !important;
  box-shadow: 0 4px 14px -2px rgba(2, 132, 199, 0.2) !important;
}

html[data-theme="dark"] .ws-user-profile:hover {
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .ws-sidebar:hover .ws-user-profile:hover,
html[data-theme="dark"] .ws-sidebar.is-hovered .ws-user-profile:hover,
html[data-theme="dark"] .ws-sidebar.is-pinned .ws-user-profile:hover {
  background: rgba(30, 41, 59, 0.9) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.4) !important;
}

.ws-user-chevron {
  display: none;
  color: var(--ws-text-muted);
  font-size: 11px;
  opacity: 0.6;
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.2s ease, opacity 0.15s ease;
}

.ws-sidebar:hover .ws-user-chevron,
.ws-sidebar.is-hovered .ws-user-chevron,
.ws-sidebar.is-pinned .ws-user-chevron {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.ws-user-profile:hover .ws-user-chevron {
  opacity: 1;
  color: var(--ws-accent);
  transform: translateX(2px);
}

.ws-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(2, 132, 199, 0.04));
  border: 1px solid rgba(2, 132, 199, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ws-accent);
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8), 0 2px 4px rgba(15, 23, 42, 0.06);
  transition: transform 0.18s ease;
}

.ws-user-profile:hover .ws-user-avatar {
  transform: scale(1.05);
  border-color: var(--ws-accent);
}

html[data-theme="dark"] .ws-user-avatar {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0.05));
  border-color: rgba(56, 189, 248, 0.35);
  color: #38BDF8;
}

.ws-user-details {
  display: flex;
  opacity: 1;
  width: auto;
  height: auto;
  pointer-events: auto;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.ws-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ws-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-user-role-desc {
  font-size: 11px;
  color: var(--ws-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-sidebar-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.ws-btn-switch-account {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--ws-surface-subtle);
  border: 1px solid var(--ws-border);
  border-radius: 10px;
  color: var(--ws-text-secondary);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  position: relative;
}

.ws-btn-switch-account:hover {
  background-color: var(--ws-surface);
  border-color: var(--ws-accent);
  color: var(--ws-accent);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}

.ws-btn-switch-account:active {
  transform: scale(0.96);
}

.ws-dev-switcher-wrap {
  display: none;
}

.ws-role-select {
  display: none;
}

.ws-lang-segmented-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--ws-surface-subtle);
  border: 1px solid var(--ws-border);
  border-radius: 9999px;
  height: 38px;
  padding: 3px;
  position: relative;
  user-select: none;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-lang-segmented-pill {
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-lang-seg-btn:not(.active) {
  display: none !important;
}

.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered):not(.mobile-open) .ws-lang-seg-btn.active {
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.ws-lang-toggle-btn,
.ws-help-btn,
.ws-theme-toggle {
  background-color: var(--ws-surface-subtle);
  border: 1px solid var(--ws-border);
  color: var(--ws-text-secondary);
  border-radius: 11px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 14px;
  flex-shrink: 0;
  position: relative;
  user-select: none;
}

.ws-lang-label {
  display: none !important;
}

.ws-lang-toggle-btn:hover,
.ws-help-btn:hover,
.ws-theme-toggle:hover {
  background-color: var(--ws-surface);
  border-color: var(--ws-accent);
  color: var(--ws-accent);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}

.ws-lang-toggle-btn:active,
.ws-help-btn:active,
.ws-theme-toggle:active {
  transform: scale(0.96);
}

html[data-theme="dark"] .ws-lang-toggle-btn:hover,
html[data-theme="dark"] .ws-help-btn:hover,
html[data-theme="dark"] .ws-theme-toggle:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.ws-pin-toggle {
  background-color: var(--ws-surface-subtle);
  border: 1px solid var(--ws-border);
  color: var(--ws-text-secondary);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 14px;
  flex-shrink: 0;
  position: relative;
  user-select: none;
}

.ws-pin-toggle:hover {
  background-color: var(--ws-surface);
  border-color: var(--ws-accent);
  color: var(--ws-accent);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}

.ws-pin-toggle:active {
  transform: scale(0.96);
}

.ws-pin-toggle.active {
  background-color: var(--ws-accent-light, #E0F2FE);
  border-color: var(--ws-accent, #0284C7);
  color: var(--ws-accent, #0284C7);
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.25);
}

html[data-theme="dark"] .ws-pin-toggle.active {
  background-color: rgba(56, 189, 248, 0.2);
  border-color: #38BDF8;
  color: #38BDF8;
}

/* ==========================================================================
   4. Main Content Wrapper & Topbar
   ========================================================================== */

.ws-main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: var(--ws-bg);
  min-width: 0;
}

.ws-topbar,
#ws-topbar-host {
  display: none !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Breadcrumbs */
.ws-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  min-width: 0;
}

.ws-crumb-item {
  color: var(--ws-text-secondary);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.ws-crumb-item:hover {
  color: var(--ws-accent);
}

.ws-crumb-active {
  color: var(--ws-text-primary);
  font-weight: 600;
  cursor: default;
}

.ws-crumb-sep {
  color: var(--ws-border-strong);
  font-size: 12px;
}

/* Topbar Center Search (Mac Glass Capsule) */
.ws-topbar-search-wrap {
  position: relative;
  width: 360px;
  max-width: 40%;
}

.ws-search-input {
  width: 100%;
  height: 34px;
  padding: 0 46px 0 34px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 12px;
  color: var(--ws-text-primary);
  font-size: 12.5px;
  outline: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ws-search-input:focus {
  background: #FFFFFF;
  border-color: var(--ws-accent);
  box-shadow: 0 0 0 3px var(--ws-accent-light), 0 4px 12px rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] .ws-search-input {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .ws-search-input:focus {
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--ws-accent);
}

.ws-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--ws-text-muted);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
}

.ws-search-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-sm);
  padding: 1px 5px;
  font-size: 10.5px;
  font-family: var(--ws-font-mono);
  color: var(--ws-text-muted);
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] .ws-search-kbd {
  background-color: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Topbar Right Actions */
.ws-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 32px 24px;
}

.ws-container {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==========================================================================
   5. Buttons & Controls (Clean Minimalist, No Neon Gradients)
   ========================================================================== */

.ws-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.ws-btn-primary {
  background-color: var(--ws-text-primary);
  color: var(--ws-surface);
  border-color: var(--ws-text-primary);
}

.ws-btn-primary:hover {
  background-color: var(--ws-text-secondary);
  border-color: var(--ws-text-secondary);
}

.ws-btn-secondary {
  background-color: var(--ws-surface);
  color: var(--ws-text-primary);
  border-color: var(--ws-border);
  box-shadow: var(--ws-shadow-sm);
}

.ws-btn-secondary:hover {
  background-color: var(--ws-surface-subtle);
  border-color: var(--ws-border-strong);
}

.ws-btn-accent {
  background-color: var(--ws-accent);
  color: #FFFFFF;
}

.ws-btn-accent:hover {
  background-color: var(--ws-accent-hover);
}

.ws-btn-sm {
  padding: 5px 11px;
  font-size: 11.5px;
  border-radius: 10px;
}

.ws-btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background-color: var(--ws-surface);
  border: 1px solid var(--ws-border);
  color: var(--ws-text-secondary);
  cursor: pointer;
}

.ws-btn-icon:hover {
  background-color: var(--ws-surface-subtle);
  color: var(--ws-text-primary);
}

/* Mobile Toggle Hamburger (Strictly hidden on desktop, active on mobile) */
.ws-mobile-toggle {
  display: none !important;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--ws-text-primary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--ws-radius-sm);
  transition: background-color 0.15s ease;
}

.ws-mobile-toggle:hover {
  background-color: var(--ws-surface-subtle);
}

/* ==========================================================================
   6. Data Table Styling (High-Density Linear/Notion Style)
   ========================================================================== */

.ws-table-container {
  background-color: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-md);
  overflow: hidden;
  box-shadow: var(--ws-shadow-sm);
}

.ws-table-toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ws-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: var(--ws-surface);
  flex-wrap: wrap;
}

.ws-table-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ws-tab-pill {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--ws-radius-sm);
  background-color: transparent;
  border: 1px solid transparent;
  color: var(--ws-text-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
}

.ws-tab-pill:hover {
  background-color: var(--ws-surface-subtle);
  color: var(--ws-text-primary);
}

.ws-tab-pill.active {
  background-color: var(--ws-surface-subtle);
  border-color: var(--ws-border);
  color: var(--ws-text-primary);
  font-weight: 600;
}

.ws-tab-count,
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-family: var(--ws-font-mono, monospace);
  font-weight: 600;
  padding: 1px 6px;
  margin-left: 5px;
  border-radius: 9999px;
  background-color: var(--ws-border);
  color: var(--ws-text-secondary);
  line-height: 1.3;
}

.ws-tab-pill.active .ws-tab-count,
.qj-category-tab-btn.active .badge-count {
  background-color: var(--ws-text-primary);
  color: var(--ws-surface);
}

.ws-table-search {
  height: 28px;
  padding: 0 10px 0 26px;
  background-color: var(--ws-surface-subtle);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-sm);
  font-size: 12px;
  color: var(--ws-text-primary);
  outline: none;
}

.ws-table-search:focus {
  border-color: var(--ws-accent);
}

.ws-table-wrapper {
  overflow-x: auto;
  width: 100%;
}

.ws-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}

.ws-table th {
  padding: 9px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ws-text-muted);
  background-color: var(--ws-surface-subtle);
  border-bottom: 1px solid var(--ws-border);
  white-space: nowrap;
}

.ws-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ws-border-subtle);
  color: var(--ws-text-primary);
  vertical-align: middle;
}

.ws-table tr:last-child td {
  border-bottom: none;
}

.ws-table tbody tr {
  transition: background-color 0.1s ease;
}

.ws-table tbody tr:hover {
  background-color: var(--ws-surface-hover);
}

/* Table Elements */
.ws-cell-title {
  font-weight: 600;
  color: var(--ws-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-cell-code {
  font-family: var(--ws-font-mono);
  font-size: 11px;
  color: var(--ws-text-muted);
  background-color: var(--ws-surface-subtle);
  padding: 1px 4px;
  border-radius: var(--ws-radius-sm);
}

/* Compact Attendance Progress Bar */
.ws-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 120px;
}

.ws-progress-track {
  flex: 1;
  height: 5px;
  background-color: var(--ws-surface-subtle);
  border-radius: var(--ws-radius-full);
  overflow: hidden;
  border: 1px solid var(--ws-border);
}

.ws-progress-fill {
  height: 100%;
  background-color: var(--ws-accent);
  border-radius: var(--ws-radius-full);
}

.ws-progress-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--ws-text-secondary);
  font-family: var(--ws-font-mono);
  white-space: nowrap;
}

/* ==========================================================================
   7. Badges & Status Pills (Color Restraint & Visual Hierarchy)
   ========================================================================== */

.ws-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 8px;
  background: rgba(241, 245, 249, 0.85);
  color: #475569;
  border: 1px solid rgba(203, 213, 225, 0.8);
  white-space: nowrap;
  line-height: 1.4;
}

html[data-theme="dark"] .ws-badge {
  background: rgba(30, 41, 59, 0.85);
  color: #CBD5E1;
  border: 1px solid rgba(51, 65, 85, 0.8);
}

/* Neutral Badges for metadata, categories and regular tags */
.ws-badge-neutral {
  background: rgba(241, 245, 249, 0.9);
  color: #475569;
  border: 1px solid rgba(203, 213, 225, 0.85);
}

html[data-theme="dark"] .ws-badge-neutral {
  background: rgba(30, 41, 59, 0.85);
  color: #CBD5E1;
  border: 1px solid rgba(51, 65, 85, 0.8);
}

/* Restrained Low-Saturation Badges */
.ws-badge-success {
  background-color: rgba(240, 253, 244, 0.7);
  color: #15803d;
  border: 1px solid rgba(187, 247, 208, 0.7);
}

html[data-theme="dark"] .ws-badge-success {
  background-color: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.ws-badge-info {
  background-color: rgba(239, 246, 255, 0.7);
  color: #2563eb;
  border: 1px solid rgba(191, 219, 254, 0.7);
}

html[data-theme="dark"] .ws-badge-info {
  background-color: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.25);
}

/* High Contrast Warning & Danger Badges (Reserved strictly for urgent actions/alarms) */
.ws-badge-warning {
  background-color: var(--ws-warning-bg);
  color: var(--ws-warning);
  border: 1px solid var(--ws-warning-border);
  font-weight: 600;
}

.ws-badge-danger {
  background-color: var(--ws-danger-bg);
  color: var(--ws-danger);
  border: 1px solid var(--ws-danger-border);
  font-weight: 600;
}

/* Dot indicator */
.ws-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

/* ==========================================================================
   8. Apple Vision / macOS 27 “全景统摄指挥中枢” (The Panoramic Stage)
   Design: 宽幅一体化巨幕中枢 · 占页面 60% 视觉重力 · 彻底打破 3 个孤立小白盒
   ========================================================================== */

.ws-panoramic-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

/* 1. 顶部宏观态势栏 (Panoramic Hero Header) */
.ws-panoramic-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 2px 2px 2px;
}

.ws-panoramic-hero-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-school-hero-title {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.025em;
  color: var(--ws-text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.25;
}

/* 宏观大字态势收敛为优雅状态行 (Subtle HUD State) */
.ws-panoramic-headline {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ws-text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.4;
}

.ws-headline-accent {
  color: var(--ws-accent);
  font-weight: 600;
}

.ws-headline-highlight {
  color: var(--ws-success);
  font-weight: 600;
}

.ws-headline-neutral {
  color: var(--ws-text-muted);
  font-weight: 500;
}

.ws-headline-sep {
  color: var(--ws-border-strong);
  opacity: 0.8;
}

.ws-school-hero-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.ws-panoramic-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* 2. 一体化全景巨幕画布 (.ws-panoramic-canvas) */
.ws-panoramic-canvas {
  display: grid;
  grid-template-columns: minmax(0, 64fr) minmax(0, 36fr);
  gap: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 249, 255, 0.88) 55%, rgba(243, 244, 254, 0.82) 100%);
  border: 1px solid rgba(2, 132, 199, 0.16);
  box-shadow: 0 16px 36px -10px rgba(2, 132, 199, 0.08), 0 2px 6px rgba(15, 23, 42, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  overflow: hidden;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

html[data-theme="dark"] .ws-panoramic-canvas {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.94) 0%, rgba(12, 30, 56, 0.88) 55%, rgba(20, 24, 48, 0.84) 100%);
  border: 1px solid rgba(56, 189, 248, 0.2);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@media (max-width: 1080px) {
  .ws-panoramic-canvas {
    grid-template-columns: 1fr;
  }
}

/* 左侧 65% 主视觉舞台 */
.ws-panoramic-stage-main {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* 嵌入式 HUD 抬头指标栏 (升级为方案 4 微型走势火花图卡片 Sparkline Metric Cards) */
.ws-panoramic-hud-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-bottom: 0;
  border-bottom: none;
}

@media (max-width: 900px) {
  .ws-panoramic-hud-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

.ws-hud-metric {
  border-radius: 14px;
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  padding: 14px 16px;
  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.ws-hud-metric:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 8px 20px -4px rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.3);
}

html[data-theme="dark"] .ws-hud-metric {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .ws-hud-metric:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6);
  border-color: rgba(56, 189, 248, 0.3);
}

.ws-hud-metric-top {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ws-hud-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ws-text-muted);
  letter-spacing: 0.02em;
}

.ws-metric-val {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ws-text-primary);
  line-height: 1.25;
}

.ws-hud-unit {
  font-size: 11.5px;
  font-weight: normal;
  color: var(--ws-text-muted);
}

.ws-hud-sub {
  font-size: 11px;
  color: var(--ws-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

.ws-hud-sparkline {
  margin-top: 8px;
  width: 100%;
  height: 26px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.ws-hud-sparkline-svg {
  display: block;
  width: 100%;
  height: 26px;
}

/* 巨幕核心波浪画幅 */
.ws-panoramic-wave-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ws-wave-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ws-wave-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ws-text-primary);
  letter-spacing: -0.01em;
}

.ws-wave-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--ws-accent);
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.6);
  animation: qj-pulse-glow 2s infinite ease-in-out;
}

@keyframes qj-pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.3); opacity: 1; }
}

.ws-panoramic-svg-holder {
  width: 100%;
  padding: 2px 0;
}

.ws-panoramic-svg {
  display: block;
  width: 100%;
  height: 136px;
  overflow: visible;
}

.ws-pulse-bar-group {
  transition: opacity 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

.ws-pulse-bar-group:hover rect {
  filter: brightness(1.15);
}

.ws-pulse-ring {
  animation: ws-ring-breathe 2.4s infinite ease-in-out;
}

@keyframes ws-ring-breathe {
  0%, 100% { opacity: 0.3; stroke-width: 1.2px; }
  50% { opacity: 0.8; stroke-width: 2px; }
}

.ws-wave-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(226, 232, 240, 0.65);
  font-size: 11.5px;
}

html[data-theme="dark"] .ws-wave-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ws-wave-meta {
  font-family: var(--ws-font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ws-text-secondary);
}

.ws-pulse-legend {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ws-pulse-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ws-text-muted);
}

.ws-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.ws-pulse-dot.active {
  background-color: var(--ws-accent);
  box-shadow: 0 0 6px rgba(2, 132, 199, 0.4);
}

.ws-pulse-dot.pending {
  background-color: var(--ws-text-muted);
  opacity: 0.5;
}

/* 右侧 35% 嵌入式合规中枢 (Integrated Compliance Radar) */
.ws-panoramic-stage-radar {
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.5);
  border-left: 1px solid rgba(226, 232, 240, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

html[data-theme="dark"] .ws-panoramic-stage-radar {
  background: rgba(15, 23, 42, 0.5);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 1080px) {
  .ws-panoramic-stage-radar {
    border-left: none;
    border-top: 1px solid rgba(226, 232, 240, 0.7);
  }
  html[data-theme="dark"] .ws-panoramic-stage-radar {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
}

.ws-radar-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ws-radar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ws-radar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ws-text-primary);
  letter-spacing: -0.01em;
}

/* 方案 4: 180度半圆环规制仪表盘 (Semi-Circle Gauge Layout) */
.ws-radar-gauge-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.ws-radar-gauge-chart {
  width: 100%;
  max-width: 220px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ws-semi-gauge-svg {
  display: block;
  width: 100%;
  height: 112px;
  overflow: visible;
}

.ws-gauge-legends-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  flex-wrap: wrap;
}

.ws-gauge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 9999px;
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  font-size: 11px;
  line-height: 1;
  transition: all 0.15s ease;
}

.ws-gauge-pill:hover {
  border-color: var(--ws-accent);
  transform: translateY(-0.5px);
}

html[data-theme="dark"] .ws-gauge-pill {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.ws-gauge-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ws-gauge-name {
  color: var(--ws-text-secondary);
  font-weight: 500;
  font-size: 11px;
}

.ws-gauge-badge {
  color: var(--ws-text-primary);
  font-weight: 600;
  font-size: 10.5px;
}

.ws-radar-donut-layout {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ws-radar-donut-chart {
  width: 98px;
  height: 98px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ws-radar-donut-chart svg {
  width: 98px;
  height: 98px;
}

.ws-radar-donut-legends {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ws-radar-divider {
  height: 1px;
  background: rgba(226, 232, 240, 0.65);
  width: 100%;
}

html[data-theme="dark"] .ws-radar-divider {
  background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Command Center Layout (方案 A: 70% 今日教务待办流 / 30% 极简辅助栏)
   ========================================================================== */

.ws-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 32px;
  align-items: start;
}

@media (max-width: 1024px) {
  .ws-command-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.ws-command-primary {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.ws-command-secondary {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* 待办流容器与头部 */
.ws-action-stream-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ws-stream-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ws-border-subtle);
}

.ws-stream-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ws-text-primary);
}

.ws-todo-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Linear 风格的行式条目列表 (Row Stream) */
.ws-stream-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ws-border-subtle);
  border-radius: 10px;
  transition: all 0.15s ease;
  background: transparent;
  user-select: none;
}

.ws-stream-row:hover {
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transform: translateX(2px);
}

html[data-theme="dark"] .ws-stream-row:hover {
  background: rgba(30, 41, 59, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ws-stream-row.completed {
  opacity: 0.5;
}

.ws-stream-row.completed .ws-stream-title-text,
.ws-stream-row.completed .ws-todo-text {
  text-decoration: line-through;
  color: var(--ws-text-muted);
}

.ws-stream-check,
.ws-todo-check {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  accent-color: var(--ws-accent);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.ws-stream-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ws-pill-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ws-pill-academic-year {
  font-size: 11px;
  color: var(--ws-text-muted);
  font-family: var(--ws-font-mono);
}

.ws-stream-title-text,
.ws-todo-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ws-text-primary);
}

.ws-stream-desc {
  font-size: 12px;
  color: var(--ws-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 360px;
}

.ws-stream-tag {
  flex-shrink: 0;
}

.ws-stream-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ws-stream-btn {
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 10px;
  color: var(--ws-accent);
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.15);
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ws-stream-btn:hover {
  background: var(--ws-accent);
  color: #FFFFFF;
}

/* 待办全清/空状态: Linear 风格 All Clear 极简审美 */
.ws-stream-all-clear {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  border: 1px dashed var(--ws-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.3);
  margin-top: 8px;
}

html[data-theme="dark"] .ws-stream-all-clear {
  background: rgba(15, 23, 42, 0.2);
  border-color: rgba(255, 255, 255, 0.08);
}

.ws-stream-all-clear-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  color: var(--ws-success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.ws-stream-all-clear-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ws-text-primary);
  margin-bottom: 4px;
}

.ws-stream-all-clear-desc {
  font-size: 12px;
  color: var(--ws-text-muted);
  max-width: 380px;
  line-height: 1.5;
}

/* 右侧 30% 辅助栏: 一体化沉静面板 (The Integrated Auxiliary Board) */
.ws-aux-integrated-board {
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--ws-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

html[data-theme="dark"] .ws-aux-integrated-board {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ws-aux-divider {
  height: 1px;
  background-color: var(--ws-border-subtle);
  width: 100%;
}

html[data-theme="dark"] .ws-aux-divider {
  background-color: rgba(255, 255, 255, 0.06);
}

/* 右侧 30% 辅助栏: 极简排版，无厚重白盒子外框 */
.ws-aux-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ws-aux-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ws-border-subtle);
}

.ws-aux-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ws-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ws-aux-link {
  font-size: 11.5px;
  color: var(--ws-text-muted);
  text-decoration: none;
  transition: color 0.12s ease;
}

.ws-aux-link:hover {
  color: var(--ws-accent);
}

/* 图形化垂直时间轴 (Visual Timeline) */
.ws-v-timeline {
  display: flex;
  flex-direction: column;
  padding: 4px 0 4px 6px;
}

.ws-v-timeline-item {
  display: flex;
  align-items: stretch;
  gap: 12px;
  position: relative;
  min-height: 52px;
}

.ws-v-timeline-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 14px;
  flex-shrink: 0;
  position: relative;
}

.ws-v-timeline-node {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ws-surface);
  border: 2px solid var(--ws-border-strong);
  margin-top: 5px;
  z-index: 2;
  transition: all 0.2s ease;
}

.ws-v-timeline-node.active {
  border-color: var(--ws-accent);
  background: var(--ws-accent);
  box-shadow: 0 0 0 3px var(--ws-accent-light);
}

.ws-v-timeline-line {
  flex: 1;
  width: 2px;
  background-color: var(--ws-border);
  margin: 4px 0;
}

.ws-v-timeline-item:last-child .ws-v-timeline-line {
  display: none;
}

.ws-v-timeline-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 12px;
}

.ws-v-timeline-time-badge {
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--ws-font-mono);
  color: var(--ws-accent);
}

.ws-v-timeline-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ws-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-v-timeline-venue {
  font-size: 11px;
  color: var(--ws-text-muted);
}

/* 兼容原有 activity stream */
.ws-activity-stream {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.ws-activity-item:hover {
  background-color: var(--ws-surface-subtle);
}

.ws-activity-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--ws-surface-subtle);
  border: 1px solid var(--ws-border-subtle);
  flex-shrink: 0;
}

.ws-activity-date-month {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ws-text-muted);
  line-height: 1;
}

.ws-activity-date-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--ws-text-primary);
  line-height: 1.1;
  font-family: var(--ws-font-mono);
}

.ws-activity-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ws-activity-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ws-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-activity-item-meta {
  font-size: 11px;
  color: var(--ws-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-memo-stream {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 极简备忘标牌 (Zero Text Clutter) */
.ws-memo-card-compact {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--ws-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s ease;
}

html[data-theme="dark"] .ws-memo-card-compact {
  background: rgba(15, 23, 42, 0.4);
  border-color: rgba(255, 255, 255, 0.08);
}

.ws-memo-card-compact:hover {
  border-color: var(--ws-border-strong);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.ws-memo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ws-memo-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ws-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-memo-foot {
  font-size: 10.5px;
  color: var(--ws-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 底部高频教务通道（已彻底移除，设为隐藏） */
.ws-bottom-bar {
  display: none !important;
}

.ws-bottom-bar-label {
  display: none !important;
}

/* 兼容原有卡片类名以防子组件依赖 */
.ws-card-block {
  background-color: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}
  justify-content: space-between;
  gap: 10px;
}

.ws-club-quick-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ws-club-quick-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ws-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-club-quick-sub {
  font-size: 11.5px;
  color: var(--ws-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ws-club-quick-teacher {
  font-size: 12px;
  color: var(--ws-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.ws-club-quick-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ws-club-quick-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.ws-club-quick-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--ws-border-subtle);
}

/* High-Quality Empty State Card */
.ws-empty-state-card {
  padding: 32px 20px;
  text-align: center;
  background: var(--ws-surface-subtle);
  border: 1px dashed var(--ws-border-strong);
  border-radius: var(--ws-radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ws-empty-state-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ws-text-primary);
}

.ws-empty-state-desc {
  font-size: 12px;
  color: var(--ws-text-muted);
  max-width: 420px;
  line-height: 1.5;
}

/* Split Columns (Schedule & Announcements) */
.ws-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .ws-split-grid {
    grid-template-columns: 1fr;
  }
}

.ws-activity-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ws-border-subtle);
}

.ws-activity-row:last-child {
  border-bottom: none;
}

.ws-activity-date {
  background-color: var(--ws-surface-subtle);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-sm);
  padding: 4px 8px;
  text-align: center;
  font-size: 11px;
  min-width: 60px;
  flex-shrink: 0;
}

.ws-activity-date-day {
  font-weight: 700;
  font-size: 14px;
  color: var(--ws-text-primary);
}

.ws-activity-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ws-activity-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ws-text-primary);
}

.ws-activity-meta {
  font-size: 11.5px;
  color: var(--ws-text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Announcement item */
.ws-anno-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--ws-border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-anno-item:last-child {
  border-bottom: none;
}

.ws-anno-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ws-anno-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ws-text-primary);
}

.ws-anno-desc {
  font-size: 12px;
  color: var(--ws-text-secondary);
  line-height: 1.45;
}

.ws-anno-foot {
  font-size: 11px;
  color: var(--ws-text-muted);
  display: flex;
  gap: 8px;
}

/* Quick Action Strip */
.ws-quick-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background-color: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-md);
  box-shadow: var(--ws-shadow-sm);
}

.ws-quick-actions-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ws-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 6px;
}

/* ==========================================================================
   9. Workspace Switcher Popover Panel (Apple Flux Minimalist Card Architecture)
   ========================================================================== */

.ws-popover {
  position: absolute;
  top: 12px;
  left: 80px;
  width: 320px;
  max-width: calc(100vw - 92px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 14px;
  box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.12),
              0 4px 12px -2px rgba(15, 23, 42, 0.04),
              0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden !important;
  overflow-x: hidden !important;
  box-sizing: border-box;
}

html[data-theme="dark"] .ws-popover {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(51, 65, 85, 0.65);
  box-shadow: 0 20px 40px -6px rgba(0, 0, 0, 0.7),
              0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.ws-popover.open {
  display: flex;
  animation: ws-popover-enter 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ws-popover-enter {
  from {
    opacity: 0;
    transform: translateX(-10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.ws-popover-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ws-border);
  box-sizing: border-box;
  width: 100%;
}

.ws-popover-search {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  background-color: var(--ws-surface-subtle);
  border: 1px solid var(--ws-border);
  border-radius: 8px;
  color: var(--ws-text-primary);
  font-size: 12px;
  box-sizing: border-box;
  outline: none;
  transition: all 0.15s ease;
}

.ws-popover-search:focus {
  border-color: var(--ws-accent);
  background-color: var(--ws-surface);
  box-shadow: 0 0 0 3px var(--ws-accent-light);
}

.ws-popover-body {
  max-height: 380px;
  overflow-y: auto;
  overflow-x: hidden !important;
  padding: 8px;
  box-sizing: border-box;
  width: 100%;
  overscroll-behavior: contain;
  /* 彻底隐藏任何系统级水平及垂直滚动条，实现优雅的固定视区自适应 */
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.ws-popover-body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.ws-popover-year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 2px 2px 8px 2px;
  width: 100%;
  box-sizing: border-box;
}

.ws-popover-year-grid .ws-btn {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 4px;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  justify-content: center;
  border-radius: 6px;
}

.ws-popover-section-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ws-text-muted);
  padding: 6px 8px 4px 8px;
  box-sizing: border-box;
  width: 100%;
}

.ws-popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  padding: 8px 10px;
  margin-bottom: 2px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.12s ease;
  user-select: none;
}

.ws-popover-item:last-child {
  margin-bottom: 0;
}

.ws-popover-item:hover {
  background-color: var(--ws-surface-subtle);
}

.ws-popover-item.active {
  background-color: var(--ws-accent-light);
}

.ws-popover-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.ws-popover-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ws-text-muted);
}

.ws-popover-item.active .ws-popover-item-icon {
  color: var(--ws-accent);
}

.ws-popover-item-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ws-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.ws-popover-item.active .ws-popover-item-name {
  font-weight: 600;
  color: var(--ws-accent-text);
}

.ws-popover-item .ws-badge {
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 6px;
  pointer-events: none;
}

.ws-popover-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ws-accent);
  margin-left: 2px;
}

.ws-popover-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--ws-border);
  background-color: rgba(248, 250, 252, 0.7);
  display: flex;
  justify-content: flex-end;
  box-sizing: border-box;
  width: 100%;
}

html[data-theme="dark"] .ws-popover-footer {
  background-color: rgba(15, 23, 42, 0.7);
}

/* ==========================================================================
   10. Mobile Responsiveness & Overlay
   ========================================================================== */

.ws-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 45;
}

@media (max-width: 768px) {
  #ws-sidebar-host {
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    position: static !important;
  }

  .ws-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    margin: 0;
    height: 100vh;
    border-radius: 0;
    transform: translateX(-100%);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.25);
  }

  .ws-sidebar.mobile-open {
    transform: translateX(0);
  }

  .ws-backdrop.active {
    display: block;
  }

  .ws-mobile-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    display: inline-flex !important;
    background: var(--ws-surface);
    border: 1px solid var(--ws-border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    box-shadow: var(--ws-shadow-sm);
    color: var(--ws-text-primary);
    cursor: pointer;
  }

  .ws-topbar,
  #ws-topbar-host {
    display: none !important;
  }

  .ws-viewport {
    padding: 16px;
  }

  .ws-popover {
    left: 10px;
    top: 58px;
    width: calc(100vw - 20px);
    max-width: 320px;
  }
}

/* ==========================================================================
   11. Enterprise Authentication Modal & Quick Persona Styles
   ========================================================================== */

.ws-auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: wsAuthFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes wsAuthFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ws-auth-card {
  width: 100%;
  max-width: 460px;
  background-color: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-lg, 14px);
  box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 24px;
  position: relative;
  animation: wsAuthCardZoom 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-sizing: border-box;
}

@keyframes wsAuthCardZoom {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.ws-auth-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.ws-auth-brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--ws-accent-light), rgba(2, 132, 199, 0.12));
  border: 1px solid rgba(2, 132, 199, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ws-accent);
  flex-shrink: 0;
}

.ws-auth-title-group {
  flex: 1;
  min-width: 0;
}

.ws-auth-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ws-text-primary);
  margin: 0 0 3px 0;
  letter-spacing: -0.3px;
}

.ws-auth-subtitle {
  font-size: 11.5px;
  color: var(--ws-text-muted);
  margin: 0;
  line-height: 1.45;
}

.ws-auth-close-btn {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: var(--ws-radius-sm, 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ws-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}

.ws-auth-close-btn:hover {
  background-color: var(--ws-surface-subtle);
  color: var(--ws-text-primary);
}

/* Alert Notifications inside Modal */
.ws-auth-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--ws-radius-sm, 6px);
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 14px;
}

.ws-auth-alert-error {
  background-color: var(--ws-danger-bg);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--ws-danger);
}

.ws-auth-alert-success {
  background-color: var(--ws-success-bg);
  border: 1px solid var(--ws-success-border);
  color: var(--ws-success);
}

.ws-auth-alert-icon {
  display: inline-flex;
  flex-shrink: 0;
}

/* Quick Demo Personas Section */
.ws-auth-section-block {
  background-color: var(--ws-surface-subtle);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-md, 10px);
  padding: 12px;
  margin-bottom: 14px;
}

.ws-auth-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ws-auth-section-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ws-text-primary);
}

.ws-auth-section-tip {
  font-size: 10.5px;
  color: var(--ws-text-muted);
}

.ws-auth-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.ws-auth-pill-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 10px;
  background-color: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-sm, 6px);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.ws-auth-pill-btn:hover {
  border-color: var(--ws-accent);
  background-color: var(--ws-accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12);
}

.ws-auth-pill-btn:active {
  transform: translateY(0);
}

.ws-auth-demo-card.is-active {
  border: 2px solid #0284C7 !important;
  background-color: rgba(2, 132, 199, 0.08) !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15) !important;
}

.ws-auth-demo-card-ultra:hover {
  background: #EDF3FC !important;
  border-color: #0284C7 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.12) !important;
}

[data-theme="dark"] .ws-auth-demo-card-ultra {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}

[data-theme="dark"] .ws-auth-demo-card-ultra:hover {
  background: rgba(2, 132, 199, 0.15) !important;
  border-color: #38BDF8 !important;
}

[data-theme="dark"] .ws-auth-profile-card {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15) 0%, rgba(30, 41, 59, 0.85) 100%) !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
}

[data-theme="dark"] .ws-auth-demo-card {
  background-color: #1E293B !important;
  border-color: #334155 !important;
}

[data-theme="dark"] .ws-auth-demo-card.is-active {
  background-color: rgba(2, 132, 199, 0.2) !important;
  border-color: #38BDF8 !important;
}

.ws-auth-pill-role {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ws-text-primary);
}

.ws-auth-pill-school {
  font-size: 10px;
  color: var(--ws-text-muted);
}

.ws-auth-pill-btn:hover .ws-auth-pill-role {
  color: var(--ws-accent-text);
}

/* Divider */
.ws-auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 14px 0;
  color: var(--ws-text-muted);
  font-size: 11px;
}

.ws-auth-divider::before,
.ws-auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--ws-border);
}

.ws-auth-divider span {
  padding: 0 10px;
  white-space: nowrap;
}

/* Form Styles */
.ws-auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ws-auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ws-auth-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ws-text-secondary);
  display: flex;
  align-items: center;
  gap: 3px;
}

.ws-auth-label-required {
  color: var(--ws-danger);
}

.ws-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.ws-auth-input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ws-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.ws-auth-input {
  width: 100%;
  height: 42px;
  padding-left: 40px !important;
  padding-right: 14px !important;
  background-color: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-sm, 8px);
  font-size: 13.5px;
  color: var(--ws-text-primary);
  outline: none;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.ws-auth-input-wrap .ws-auth-input {
  padding-left: 40px !important;
}

.ws-auth-input-wrap #qj-auth-password.ws-auth-input {
  padding-left: 40px !important;
  padding-right: 42px !important;
}

.ws-auth-input:focus {
  border-color: var(--ws-accent);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.ws-auth-pwd-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ws-text-muted);
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  z-index: 2;
}

.ws-auth-pwd-toggle:hover {
  color: var(--ws-accent, #0284C7);
  background-color: var(--ws-surface-subtle, #F1F5F9);
}

.ws-auth-pwd-toggle:hover {
  color: var(--ws-text-primary);
}

.ws-auth-row-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -2px;
}

.ws-auth-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ws-text-secondary);
  cursor: pointer;
  user-select: none;
}

.ws-auth-checkbox {
  width: 14px;
  height: 14px;
  accent-color: var(--ws-accent);
  cursor: pointer;
}

/* Submit Primary Button */
.ws-auth-submit-wrap {
  margin-top: 4px;
}

.ws-auth-submit-btn {
  width: 100%;
  height: 40px;
  background: linear-gradient(135deg, var(--ws-accent), var(--ws-accent-hover));
  color: var(--ws-text-inverse);
  border: none;
  border-radius: var(--ws-radius-sm, 6px);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.ws-auth-submit-btn:hover:not(:disabled) {
  opacity: 0.95;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
  transform: translateY(-1px);
}

.ws-auth-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.ws-auth-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ws-auth-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: wsAuthSpin 0.7s linear infinite;
  display: inline-block;
}

@keyframes wsAuthSpin {
  to { transform: rotate(360deg); }
}

/* Footer Compliance Note */
.ws-auth-footer-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--ws-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--ws-text-muted);
  text-align: center;
  line-height: 1.4;
}

.ws-auth-footer-icon {
  display: inline-flex;
  color: var(--ws-accent);
}

/* Global Lightweight Toast */
.ws-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.ws-toast-item {
  pointer-events: auto;
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 12px;
  box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  font-size: 13px;
  font-weight: 500;
  color: #0F172A;
  max-width: 420px;
  cursor: pointer;
  animation: wsToastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ws-toast-success {
  border-left: 4px solid #10B981;
}

.ws-toast-info {
  border-left: 4px solid #3B82F6;
}

.ws-toast-warning {
  border-left: 4px solid #F59E0B;
}

.ws-toast-error {
  border-left: 4px solid #EF4444;
}

.ws-toast-fade-out {
  opacity: 0;
  transform: translateY(8px);
}

/* Custom Dropdown Popover (现代微胶囊下拉菜单系统) */
.qj-custom-select-wrapper {
  position: relative;
  display: inline-block;
  user-select: none;
}

.qj-custom-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background-color: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  padding: 0 12px;
  height: 36px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.qj-custom-select-trigger:hover {
  background-color: #F8FAFC;
  border-color: #94A3B8;
  color: #0F172A;
}

.qj-custom-select-trigger.is-active,
.qj-custom-select-trigger:focus-visible {
  border-color: #2563EB;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background-color: #FFFFFF;
}

.qj-custom-select-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.qj-custom-select-trigger.is-active .qj-custom-select-arrow {
  transform: rotate(180deg);
  color: #2563EB;
}

.qj-custom-select-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 280px;
  max-height: 280px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  padding: 6px;
  z-index: 1050;
  display: none;
  animation: qjPopoverFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.qj-custom-select-popover.is-open {
  display: block;
}

.qj-custom-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.qj-custom-select-item:hover {
  background-color: #F1F5F9;
  color: #0F172A;
}

.qj-custom-select-item.is-selected {
  background-color: #EFF6FF;
  color: #1D4ED8;
  font-weight: 600;
}

.qj-custom-select-check {
  display: inline-flex;
  align-items: center;
  color: #2563EB;
  font-weight: 700;
}

@keyframes qjPopoverFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes wsToastSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   Apple Design System Extended Global Guidelines (R-end & Unified Chromatics)
   全面覆盖 12周考勤中枢、学生名册、学会管理、活动行事历、PAJSK 与专署工作台
   ========================================================================== */

/* 1. Legacy Variable Fallback & Semantic Color Normalization */
:root {
  --bg-card: var(--ws-surface);
  --bg-surface: var(--ws-surface);
  --bg-input: var(--ws-surface);
  --bg-glass: var(--ws-surface);
  --bg-elevated: var(--ws-surface-subtle);
  --border-glass: var(--ws-border);
  --border-subtle: var(--ws-border);
  --text-primary: var(--ws-text-primary);
  --text-secondary: var(--ws-text-secondary);
  --text-muted: var(--ws-text-muted);
  --text-dim: var(--ws-text-muted);

  /* Apple Harmonic Accent Palette */
  --brand-emerald: #059669;
  --brand-blue: #0284c7;
  --brand-gold: #d97706;
  --brand-rose: #dc2626;
  --brand-purple: #7c3aed;
  --border-gold: rgba(217, 119, 6, 0.25);
}

/* 2. Apple Unified Button System (R = 10px) */
.quick-action-btn,
.qj-btn-primary,
.qj-btn-secondary,
.ws-btn,
.filter-btn,
button.att-action-btn,
.qj-actions-group button,
.att-quick-actions button {
  border-radius: 10px !important;
  font-family: var(--ws-font-family);
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.2;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  min-height: 34px;
  padding: 7px 14px !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  -webkit-font-smoothing: antialiased;
  outline: none;
}

/* Default / Secondary Action: Frosted Apple Surface */
.quick-action-btn,
.qj-btn-secondary,
.ws-btn-secondary {
  background: var(--ws-surface) !important;
  color: var(--ws-text-primary) !important;
  border: 1px solid var(--ws-border) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.quick-action-btn:hover,
.qj-btn-secondary:hover,
.ws-btn-secondary:hover {
  background: var(--ws-surface-subtle) !important;
  border-color: var(--ws-border-strong) !important;
  color: var(--ws-text-primary) !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px -2px rgba(15, 23, 42, 0.08) !important;
}

.quick-action-btn:active,
.qj-btn-secondary:active,
.ws-btn-secondary:active {
  transform: translateY(0);
}

/* Primary Action: Apple Minimalist Dark / Light Contrast */
.qj-btn-primary,
.ws-btn-primary {
  background: #0F172A !important;
  color: #FFFFFF !important;
  border: 1px solid #0F172A !important;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.25) !important;
}

.qj-btn-primary:hover,
.ws-btn-primary:hover {
  background: #1E293B !important;
  border-color: #1E293B !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.35) !important;
}

html[data-theme="dark"] .qj-btn-primary,
html[data-theme="dark"] .ws-btn-primary {
  background: #F8FAFC !important;
  color: #0F172A !important;
  border: 1px solid #F8FAFC !important;
  box-shadow: 0 2px 10px -2px rgba(248, 250, 252, 0.2) !important;
}

html[data-theme="dark"] .qj-btn-primary:hover,
html[data-theme="dark"] .ws-btn-primary:hover {
  background: #E2E8F0 !important;
  border-color: #E2E8F0 !important;
  color: #0F172A !important;
}

/* Apple Semantic Action Buttons (R = 10px) */
.ws-btn-blue,
.quick-action-btn.ws-btn-blue {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  border: 1px solid #0369A1 !important;
  box-shadow: 0 2px 6px -1px rgba(2, 132, 199, 0.28) !important;
}
.ws-btn-blue:hover,
.quick-action-btn.ws-btn-blue:hover {
  background: #0369A1 !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

.ws-btn-purple,
.quick-action-btn.ws-btn-purple {
  background: #7C3AED !important;
  color: #FFFFFF !important;
  border: 1px solid #6D28D9 !important;
  box-shadow: 0 2px 6px -1px rgba(124, 58, 237, 0.28) !important;
}
.ws-btn-purple:hover,
.quick-action-btn.ws-btn-purple:hover {
  background: #6D28D9 !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

.ws-btn-amber,
.quick-action-btn.ws-btn-amber {
  background: #D97706 !important;
  color: #FFFFFF !important;
  border: 1px solid #B45309 !important;
  box-shadow: 0 2px 6px -1px rgba(217, 119, 6, 0.28) !important;
}
.ws-btn-amber:hover,
.quick-action-btn.ws-btn-amber:hover {
  background: #B45309 !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

/* Flux VisionOS Apple Micro-mimicry Action Buttons (Restyled to De-AI Sky Blue #0284C7) */
.att-btn-primary,
.quick-action-btn.att-btn-primary,
.att-btn-primary-emerald,
.quick-action-btn.att-btn-primary-emerald {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 16px !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.16) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.att-btn-primary:hover,
.quick-action-btn.att-btn-primary:hover,
.att-btn-primary-emerald:hover,
.quick-action-btn.att-btn-primary-emerald:hover {
  background: #0369A1 !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25) !important;
}

/* Secondary Action: White Card, Slate Gray Border */
.att-btn-secondary,
.quick-action-btn.att-btn-secondary {
  background: #FFFFFF !important;
  color: #475569 !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 16px !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.att-btn-secondary:hover,
.quick-action-btn.att-btn-secondary:hover {
  background: #F8FAFC !important;
  color: #0F172A !important;
  border-color: #CBD5E1 !important;
  transform: translateY(-1px);
}

.btn-emerald {
  background: #0284C7 !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.16) !important;
}

.btn-emerald:hover {
  background: #0369A1 !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

/* Destructive / Reset Action: De-AI Minimal Neutral Gray Wireframe */
.att-btn-destructive,
.quick-action-btn.att-btn-destructive {
  background: transparent !important;
  border: 1px solid #E2E8F0 !important;
  color: #94A3B8 !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 14px !important;
  font-weight: 400 !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.att-btn-destructive:hover,
.quick-action-btn.att-btn-destructive:hover {
  background: #FEF2F2 !important;
  color: #EF4444 !important;
  border-color: #FECACA !important;
  transform: translateY(-1px);
}

.btn-destructive {
  background: rgba(239, 68, 68, 0.08) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.2) !important;
  box-shadow: none !important;
}

.btn-destructive:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #b91c1c !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  transform: translateY(-1px);
}

/* 3. Apple Unified Cards & Containers (R = 16px / 20px) */
.glass-panel-card,
.qj-toolbar-card,
.overview-hero-card,
.qj-table-card,
.ws-card,
.att-container,
.att-card {
  border-radius: 16px !important;
  background: var(--ws-surface) !important;
  border: 1px solid var(--ws-border) !important;
  box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.05) !important;
  box-sizing: border-box;
}

.overview-hero-card {
  border-radius: 20px !important;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.glass-panel-card {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.specialized-card-highlight {
  background: var(--ws-surface) !important;
  border: 1px solid var(--ws-warning-border) !important;
}

/* Shared Hero, Metrics & Panel Layout Classes */
.hero-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-identity-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-crest-badge {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--ws-surface-subtle);
  border: 1.5px solid var(--ws-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-title-group h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ws-text-primary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.hero-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ws-text-muted);
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.metric-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.metric-icon-box.gold { background: rgba(217, 119, 6, 0.12); color: #D97706; }
.metric-icon-box.blue { background: rgba(2, 132, 199, 0.12); color: #0284C7; }
.metric-icon-box.emerald { background: rgba(5, 150, 105, 0.12); color: #059669; }
.metric-icon-box.purple { background: rgba(124, 58, 237, 0.12); color: #7C3AED; }

.metric-stat-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-num {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ws-text-primary);
}

.metric-desc {
  font-size: 11.5px;
  color: var(--ws-text-muted);
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ws-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--ws-surface-subtle);
  color: var(--ws-text-secondary);
  border: 1px solid var(--ws-border);
}

.dashboard-grid-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

@media (max-width: 1023px) {
  .dashboard-grid-layout {
    grid-template-columns: 1fr;
  }
}

.attendance-pills-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin: 4px 0;
}

.week-pill {
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--ws-border);
  background: var(--ws-surface-subtle);
  color: var(--ws-text-muted);
}

.week-pill.done {
  background: var(--ws-success-bg);
  border-color: var(--ws-success-border);
  color: var(--ws-success);
}

.btn-enter-workspace {
  border-radius: 10px !important;
  background: #0F172A !important;
  color: #FFFFFF !important;
  border: 1px solid #0F172A !important;
  padding: 7px 14px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
}

.btn-enter-workspace:hover {
  background: #1E293B !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.24);
}

html[data-theme="dark"] .btn-enter-workspace {
  background: var(--ws-accent) !important;
  color: #0F172A !important;
  border-color: var(--ws-accent) !important;
}

html[data-theme="dark"] .btn-enter-workspace:hover {
  background: var(--ws-accent-hover) !important;
}

/* Unified Apple Modals (R = 20px) */
.qj-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.qj-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.qj-modal-window {
  background: var(--ws-surface) !important;
  border: 1px solid var(--ws-border) !important;
  border-radius: 20px !important;
  box-shadow: var(--ws-shadow-popover) !important;
  color: var(--ws-text-primary) !important;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.97) translateY(8px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.qj-modal-overlay.open .qj-modal-window {
  transform: scale(1) translateY(0);
}

.qj-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--ws-border);
  background: var(--ws-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qj-modal-title-group h3 {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ws-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 3px 0;
}

.qj-modal-title-group p {
  font-size: 12px;
  color: var(--ws-text-muted);
  margin: 0;
}

.qj-modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px !important;
  border: 1px solid var(--ws-border) !important;
  background: var(--ws-surface) !important;
  color: var(--ws-text-secondary) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.qj-modal-close-btn:hover {
  background: var(--ws-danger-bg) !important;
  color: var(--ws-danger) !important;
  border-color: var(--ws-danger-border) !important;
}

.qj-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qj-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--ws-border);
  background: var(--ws-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.qj-helper-box {
  background: var(--ws-info-bg) !important;
  border: 1px solid var(--ws-info-border) !important;
  border-radius: 12px !important;
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--ws-text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* Large Hero & Master View Topcards (R = 18px / 20px) */
.qj-students-view,
.attendance-workspace-wrapper,
.pajsk-workspace-module,
.qj-clubs-view {
  box-sizing: border-box;
}

/* 4. Apple Unified Segmented Control (Filter tabs & pills, R = 10px container, R = 8px pills) */
.att-segmented-control,
.segmented-control,
.qj-filters-segmented,
.filter-tab-wrap {
  background: var(--ws-surface-subtle) !important;
  border: 1px solid var(--ws-border) !important;
  border-radius: 10px !important;
  padding: 3px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
  box-sizing: border-box;
}

.filter-tab-pill,
.segmented-item,
.att-seg-btn {
  border-radius: 8px !important;
  border: none !important;
  background: transparent !important;
  color: var(--ws-text-secondary) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  padding: 5px 12px !important;
  cursor: pointer !important;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-tab-pill:hover,
.segmented-item:hover,
.att-seg-btn:hover {
  color: var(--ws-text-primary) !important;
}

.filter-tab-pill.active,
.segmented-item.active,
.att-seg-btn.active {
  background: var(--ws-surface) !important;
  color: var(--ws-text-primary) !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  border-radius: 8px !important;
}

/* 5. Apple Unified Tables & Data Grids (R = 14px container) */
.table-container-card,
.qj-table-card,
.att-table-container {
  border-radius: 14px !important;
  overflow: hidden !important;
  border: 1px solid var(--ws-border) !important;
  background: var(--ws-surface) !important;
  box-shadow: 0 2px 10px -2px rgba(15, 23, 42, 0.04) !important;
}

.table-toolbar-bar,
.att-table-toolbar {
  background: var(--ws-surface-subtle) !important;
  border-bottom: 1px solid var(--ws-border) !important;
  padding: 12px 18px !important;
}

table thead th,
.qj-students-table thead th,
.att-table thead th {
  background: #F8FAFC !important;
  color: #475569 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0;
  border-bottom: 1px solid #E2E8F0 !important;
  padding: 12px 14px !important;
  white-space: nowrap;
}

table tbody tr,
.qj-students-table tbody tr {
  border-bottom: 1px solid var(--ws-border-subtle) !important;
  transition: background-color 0.15s ease !important;
}

table tbody tr:hover,
.qj-students-table tbody tr:hover {
  background: var(--ws-surface-hover) !important;
}

table tbody td,
.qj-students-table tbody td {
  padding: 12px 14px !important;
  color: var(--ws-text-primary);
  vertical-align: middle;
}

/* 6. Apple Unified Pills & Badges (R = 8px) */
.meta-pill,
.version-pill,
.qj-club-badge,
.role-pill,
.status-pill {
  border-radius: 8px !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px !important;
  font-size: 11.5px !important;
  font-weight: 500;
  line-height: 1.3;
  box-sizing: border-box;
  background: var(--ws-surface-subtle);
  border: 1px solid var(--ws-border);
  color: var(--ws-text-secondary);
}

/* Unified De-AI Slate Gray Pill for Roles (主席、副主席、文书、财政全部收敛为高雅中性灰) */
.role-pill,
.att-role-pill-neutral,
.qj-club-badge .role-tag,
.qj-club-badge .role-tag.emerald,
.qj-club-badge .role-tag.blue,
.qj-club-badge .role-tag.gold,
.qj-club-badge .role-tag.amber,
.qj-club-badge .role-tag.rose,
.qj-club-badge .role-tag.purple {
  background: #F1F5F9 !important;
  color: #475569 !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  padding: 2px 8px !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .role-pill,
html[data-theme="dark"] .att-role-pill-neutral,
html[data-theme="dark"] .qj-club-badge .role-tag,
html[data-theme="dark"] .qj-club-badge .role-tag.emerald,
html[data-theme="dark"] .qj-club-badge .role-tag.blue,
html[data-theme="dark"] .qj-club-badge .role-tag.gold,
html[data-theme="dark"] .qj-club-badge .role-tag.amber,
html[data-theme="dark"] .qj-club-badge .role-tag.rose,
html[data-theme="dark"] .qj-club-badge .role-tag.purple {
  background: #1E293B !important;
  color: #94A3B8 !important;
  border-color: #334155 !important;
}

/* 7. Input Controls, Unified Search & Modern Selects (R = 10px) */
.qj-search-box {
  display: inline-flex !important;
  align-items: center !important;
  position: relative !important;
  background: var(--ws-surface, #FFFFFF) !important;
  border: 1px solid var(--ws-border, #CBD5E1) !important;
  border-radius: 10px !important;
  padding: 0 12px !important;
  min-height: 36px !important;
  height: 36px !important;
  box-sizing: border-box !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.qj-search-box:focus-within {
  border-color: var(--ws-accent, #0284C7) !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

.qj-search-box .qj-search-icon {
  display: inline-flex !important;
  align-items: center !important;
  color: #94A3B8 !important;
  margin-right: 8px !important;
  flex-shrink: 0 !important;
  pointer-events: none !important;
}

.qj-search-box input {
  border: none !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  min-height: 100% !important;
  height: 100% !important;
  font-size: 13px !important;
  color: var(--ws-text-primary, #0F172A) !important;
  box-sizing: border-box !important;
}

.qj-select-filter,
.qj-role-select,
.att-search-input,
input.ws-input,
select.ws-select,
textarea.ws-textarea {
  border-radius: 10px !important;
  border: 1px solid var(--ws-border, #CBD5E1) !important;
  background: var(--ws-surface, #FFFFFF) !important;
  color: var(--ws-text-primary, #0F172A) !important;
  font-size: 13px !important;
  box-sizing: border-box;
  outline: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.qj-select-filter,
.att-search-input,
input.ws-input,
select.ws-select {
  min-height: 36px;
  height: 36px;
}

select.qj-select-filter {
  padding: 0 28px 0 12px !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  cursor: pointer !important;
}

input:not([type="checkbox"]):not([type="radio"]),
input[type="text"],
input[type="search"],
input[type="password"],
input[type="email"],
input[type="number"],
input.qj-select-filter,
input.ws-input,
input.qj-input-text {
  background-image: none !important;
  cursor: text !important;
  padding-right: 12px !important;
  padding-left: 12px !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* Modern Plugin Toggle Card (苹果级微拟态特化插件芯片) */
.qj-plugin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.qj-plugin-card:hover {
  border-color: #93C5FD;
  background: #F8FAFC;
  transform: translateY(-1px);
}

.qj-plugin-card.is-active {
  background: #EFF6FF !important;
  border-color: #3B82F6 !important;
  box-shadow: 0 0 0 1px #3B82F6, 0 3px 10px -2px rgba(59, 130, 246, 0.22) !important;
}

.qj-plugin-indicator {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid #CBD5E1;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.qj-plugin-card.is-active .qj-plugin-indicator {
  border-color: #2563EB !important;
  background: #2563EB !important;
}

.qj-plugin-check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.16s ease;
}

.qj-plugin-card.is-active .qj-plugin-check-icon {
  opacity: 1;
  transform: scale(1);
}

.qj-plugin-info {
  flex: 1;
  min-width: 0;
}

.qj-plugin-title {
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  transition: color 0.15s ease;
}

.qj-plugin-card.is-active .qj-plugin-title {
  color: #1D4ED8 !important;
  font-weight: 600 !important;
}

.qj-plugin-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  background: #F1F5F9;
  color: #94A3B8;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.qj-plugin-card.is-active .qj-plugin-badge {
  background: #DBEAFE !important;
  color: #1E40AF !important;
  font-weight: 600 !important;
}

[data-theme="dark"] .qj-plugin-card {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(51, 65, 85, 0.9);
}
[data-theme="dark"] .qj-plugin-card:hover {
  background: rgba(51, 65, 85, 0.7);
  border-color: #60A5FA;
}
[data-theme="dark"] .qj-plugin-card.is-active {
  background: rgba(37, 99, 235, 0.22) !important;
  border-color: #60A5FA !important;
  box-shadow: 0 0 0 1px #60A5FA, 0 3px 10px -2px rgba(96, 165, 250, 0.3) !important;
}
[data-theme="dark"] .qj-plugin-title {
  color: #E2E8F0;
}
[data-theme="dark"] .qj-plugin-card.is-active .qj-plugin-title {
  color: #93C5FD !important;
}
[data-theme="dark"] .qj-plugin-badge {
  background: #1E293B;
  color: #64748B;
}
[data-theme="dark"] .qj-plugin-card.is-active .qj-plugin-badge {
  background: rgba(96, 165, 250, 0.25) !important;
  color: #BFDBFE !important;
}

.qj-select-filter option,
.qj-role-select option,
select.ws-select option {
  background: var(--ws-surface, #FFFFFF);
  color: var(--ws-text-primary, #0F172A);
}

.qj-select-filter:focus,
.qj-role-select:focus,
.att-search-input:focus,
input.ws-input:focus,
select.ws-select:focus,
textarea.ws-textarea:focus {
  border-color: var(--ws-accent, #0284C7) !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

/* 8. 12-Week Attendance Central Workspace Specifics (De-AI Industrial Minimalist Design) */
.attendance-workspace-wrapper {
  min-width: 0;
  color: #0F172A;
}

.att-week-tab-btn {
  border-radius: 10px !important;
  border: 1px solid #E2E8F0 !important;
  background: #FFFFFF !important;
  color: #475569 !important;
  cursor: pointer;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  box-sizing: border-box;
}

.att-week-tab-btn:hover:not(.active) {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

.att-week-tab-btn.active {
  background: #F0F9FF !important;
  border-color: #0284C7 !important;
  color: #0284C7 !important;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.12) !important;
}

.att-status-toggle-pill {
  border-radius: 8px !important;
  height: 34px !important;
  width: 120px !important;
  box-sizing: border-box;
  font-size: 14px !important;
  font-weight: 500 !important;
  transition: all 0.15s ease !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.att-status-toggle-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}

.att-status-toggle-pill:active {
  transform: translateY(0);
}

.att-mini-picker-wrap {
  border-radius: 8px !important;
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
  padding: 2px !important;
  display: inline-flex !important;
  gap: 2px !important;
  align-items: center;
  box-sizing: border-box;
}

.att-mini-picker-btn {
  border-radius: 6px !important;
  width: 26px !important;
  height: 26px !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #475569 !important;
  cursor: pointer !important;
  transition: all 0.12s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  outline: none !important;
}

.att-mini-picker-btn:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}

.att-mini-picker-btn.active {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
  font-weight: 600 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

.metric-pill-card {
  border-radius: 14px !important;
  background: #FFFFFF !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  border-left: 1px solid rgba(226, 232, 240, 0.8) !important; /* 彻底去除彩色竖条 */
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
}

.overview-hero-card .metrics-strip {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  gap: 12px !important;
  margin-top: 18px !important;
}

.overview-hero-card .metric-pill-card {
  padding: 16px 20px !important;
  border-radius: 14px !important;
  background: #FFFFFF !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: stretch !important;
  gap: 8px !important;
}

.att-club-pill {
  background: #F1F5F9 !important;
  color: #475569 !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  padding: 2px 8px !important;
  display: inline-flex;
  align-items: center;
  line-height: 1.4;
}

.att-role-pill-neutral {
  background: #F1F5F9 !important;
  color: #475569 !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  padding: 2px 8px !important;
  display: inline-flex;
  align-items: center;
  line-height: 1.4;
}

/* Shared QJ Workspace Toolbar & Action Card Styles */
.qj-toolbar-card {
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: 16px;
  box-shadow: var(--ws-shadow-sm);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.qj-toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.qj-toolbar-title-group h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ws-text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.qj-toolbar-title-group p {
  font-size: 12.5px;
  color: var(--ws-text-muted);
  margin: 4px 0 0 0;
}
.qj-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qj-search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 420px;
}
.qj-search-box input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border-radius: 10px;
  border: 1px solid var(--ws-border);
  background: var(--ws-surface);
  color: var(--ws-text-primary);
  font-size: 13px;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  box-sizing: border-box;
}
.qj-search-box input:focus {
  border-color: var(--ws-accent);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
  background: var(--ws-surface);
}
.qj-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ws-text-muted);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
}
.qj-table-card {
  background: var(--ws-surface);
  border: 1px solid var(--ws-border);
  border-radius: 16px;
  box-shadow: var(--ws-shadow-sm);
  overflow: hidden;
}

/* ==========================================================================
   Desktop Mobile Toggle Default Hide
   ========================================================================== */
.ws-mobile-toggle {
  display: none !important;
}

/* ==========================================================================
   Sidebar Search Widget (融入左侧侧边栏的极简搜索中枢)
   ========================================================================== */
.ws-sidebar-search-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 6px 0;
  box-sizing: border-box;
}

.ws-sidebar-search {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  color: var(--ws-text-secondary);
  background: transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.ws-sidebar-search:hover {
  background: var(--ws-surface-subtle);
  color: var(--ws-text-primary);
}

.ws-sidebar-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ws-text-secondary);
  flex-shrink: 0;
}

.ws-sidebar-search:hover .ws-sidebar-search-icon {
  color: var(--ws-text-primary);
}

/* 折叠微 Dock 状态下默认隐藏 input 与 kbd */
.ws-sidebar-search-input,
.ws-sidebar-search-placeholder,
.ws-sidebar-search-kbd {
  display: none;
  opacity: 0;
  visibility: hidden;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* 折叠微 Dock 状态下悬停浮出 tooltip 气泡 */
.ws-sidebar:not(:hover):not(:focus-within):not(.is-hovered) .ws-sidebar-search:hover .ws-nav-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* 侧边栏展开态：平滑舒展为搜索胶囊 */
.ws-sidebar:hover .ws-sidebar-search-wrap,
.ws-sidebar.is-hovered .ws-sidebar-search-wrap,
.ws-sidebar.is-pinned .ws-sidebar-search-wrap {
  padding: 4px 10px 8px 10px;
}

.ws-sidebar:hover .ws-sidebar-search,
.ws-sidebar.is-hovered .ws-sidebar-search,
.ws-sidebar.is-pinned .ws-sidebar-search {
  width: 100% !important;
  height: 38px !important;
  border-radius: 10px !important;
  background: var(--ws-surface-subtle) !important;
  border: 1px solid var(--ws-border) !important;
  padding: 0 10px !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  cursor: text !important;
}

.ws-sidebar:hover .ws-sidebar-search-input,
.ws-sidebar.is-hovered .ws-sidebar-search-input,
.ws-sidebar.is-pinned .ws-sidebar-search-input {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  width: 100% !important;
  min-width: 0 !important;
  flex: 1 !important;
  height: 100% !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  font-size: 13px !important;
  color: var(--ws-text-primary) !important;
  font-family: inherit !important;
}

.ws-sidebar:hover .ws-sidebar-search-kbd,
.ws-sidebar.is-hovered .ws-sidebar-search-kbd,
.ws-sidebar.is-pinned .ws-sidebar-search-kbd {
  display: inline-flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  align-items: center !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  font-family: var(--ws-font-mono, monospace) !important;
  padding: 1.5px 5.5px !important;
  border-radius: 4px !important;
  background: var(--ws-surface) !important;
  border: 1px solid var(--ws-border) !important;
  color: var(--ws-text-muted) !important;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04) !important;
  flex-shrink: 0 !important;
  pointer-events: none !important;
}

.ws-sidebar-search:focus-within {
  border-color: var(--ws-accent) !important;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15) !important;
  background: var(--ws-surface) !important;
}

/* 展开态下隐藏 tooltip 气泡 */
.ws-sidebar:hover .ws-sidebar-search .ws-nav-tooltip,
.ws-sidebar.is-hovered .ws-sidebar-search .ws-nav-tooltip,
.ws-sidebar.is-pinned .ws-sidebar-search .ws-nav-tooltip {
  display: none !important;
}

html[data-theme="dark"] .ws-sidebar:hover .ws-sidebar-search,
html[data-theme="dark"] .ws-sidebar.is-hovered .ws-sidebar-search,
html[data-theme="dark"] .ws-sidebar.is-pinned .ws-sidebar-search {
  background: rgba(30, 41, 59, 0.6) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .ws-sidebar:hover .ws-sidebar-search-kbd,
html[data-theme="dark"] .ws-sidebar.is-hovered .ws-sidebar-search-kbd,
html[data-theme="dark"] .ws-sidebar.is-pinned .ws-sidebar-search-kbd {
  background: rgba(15, 23, 42, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #94A3B8 !important;
}

/* ==========================================================================
   7. Official A4 Print & PDF Export Stylesheet (KPM Standard Guidelines)
   ========================================================================== */
@media print {
  @page {
    size: A4 landscape;
    margin: 12mm 10mm 12mm 10mm;
  }

  /* 彻底隐藏所有非报表屏幕 UI 元素 */
  #ws-sidebar,
  #ws-sidebar-host,
  .ws-sidebar,
  .ws-sidebar-dock,
  .ws-sidebar-controls,
  .ws-sidebar-nav,
  .ws-school-deck,
  .ws-popover,
  .quick-action-btn,
  .qj-btn-secondary,
  .ws-btn,
  .ws-btn-csv-backup,
  #modal-root,
  #anno-modal-host,
  #act-modal-host,
  #qj-csv-modal-host,
  #qj-student-modal-host,
  #qj-club-modal-host,
  #qj-auth-modal-host,
  .qj-custom-select-wrapper,
  .qj-toast-container,
  button,
  nav,
  .ws-panoramic-actions,
  .qj-reports-actions,
  .panel-header-row button,
  .panel-header-row input,
  .hero-header-row button,
  .hero-header-row .qj-custom-select-wrapper {
    display: none !important;
  }

  body, html, #app, .ws-main, .ws-viewport, .pajsk-workspace-module {
    background: #FFFFFF !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .overview-hero-card,
  .glass-panel-card {
    box-shadow: none !important;
    border: 1px solid #D1D5DB !important;
    background: #FFFFFF !important;
    page-break-inside: avoid;
    padding: 12px !important;
    margin-bottom: 14px !important;
  }

  /* 打印专用官方公函抬头呈现 */
  .pajsk-print-only-header {
    display: block !important;
    text-align: center;
    margin-bottom: 14px;
  }

  /* 打印专用官方双级签名栏呈现 */
  .pajsk-print-signatures {
    display: flex !important;
    justify-content: center !important;
    margin-top: 32px !important;
    padding-top: 16px !important;
    border-top: 1.5px solid #000000 !important;
    page-break-inside: avoid !important;
  }

  table {
    border-collapse: collapse !important;
    width: 100% !important;
    font-size: 11px !important;
  }

  table th, table td {
    border: 1px solid #D1D5DB !important;
    padding: 6px 8px !important;
    color: #111827 !important;
  }

  table th {
    background: #F3F4F6 !important;
    font-weight: 700 !important;
  }

  .meta-pill, .version-pill {
    border: 1px solid #D1D5DB !important;
    background: #F9FAFB !important;
    color: #111827 !important;
  }
}






.attendance-workspace-wrapper .quick-action-btn[hidden] {
  display: none;
}

@media (max-width: 600px) {
  .att-table,
  .att-table tbody {
    display: block;
    width: 100%;
  }

  .att-table thead,
  .att-member-row > :is(td:nth-child(1), td:nth-child(4), td:nth-child(7)) {
    display: none;
  }

  .att-table .att-member-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 8px 12px;
  }

  .att-member-row > td {
    min-width: 0;
    padding: 4px !important;
    overflow-wrap: anywhere;
  }

  .att-member-row > td:nth-child(5) {
    grid-column: 1 / -1;
    text-align: left !important;
  }

  .att-member-row > td:nth-child(6) {
    grid-column: 1 / -1;
  }

  .att-member-row .att-mini-picker-wrap {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .att-member-row .att-mini-picker-btn {
    width: 100%;
    min-height: 40px;
  }
}

/* ============================================================================
 * Custom Scrollbar Tokens & Unified Track/Thumb Styling (UI Guidelines Rule 5)
 * ============================================================================ */
.ws-viewport,
.ws-sidebar-nav,
.qj-table-responsive,
.qj-modal-window,
.qj-drawer-body,
.qj-custom-select-popover,
.qj-picker-popover,
.qj-popover-body {
  scrollbar-width: thin;
  scrollbar-color: var(--ws-border-strong, #CBD5E1) transparent;
}

.ws-viewport::-webkit-scrollbar,
.ws-sidebar-nav::-webkit-scrollbar,
.qj-table-responsive::-webkit-scrollbar,
.qj-modal-window::-webkit-scrollbar,
.qj-drawer-body::-webkit-scrollbar,
.qj-custom-select-popover::-webkit-scrollbar,
.qj-picker-popover::-webkit-scrollbar,
.qj-popover-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.ws-viewport::-webkit-scrollbar-track,
.ws-sidebar-nav::-webkit-scrollbar-track,
.qj-table-responsive::-webkit-scrollbar-track,
.qj-modal-window::-webkit-scrollbar-track,
.qj-drawer-body::-webkit-scrollbar-track,
.qj-custom-select-popover::-webkit-scrollbar-track,
.qj-picker-popover::-webkit-scrollbar-track,
.qj-popover-body::-webkit-scrollbar-track {
  background: transparent;
}

.ws-viewport::-webkit-scrollbar-thumb,
.ws-sidebar-nav::-webkit-scrollbar-thumb,
.qj-table-responsive::-webkit-scrollbar-thumb,
.qj-modal-window::-webkit-scrollbar-thumb,
.qj-drawer-body::-webkit-scrollbar-thumb,
.qj-custom-select-popover::-webkit-scrollbar-thumb,
.qj-picker-popover::-webkit-scrollbar-thumb,
.qj-popover-body::-webkit-scrollbar-thumb {
  background: var(--ws-border-strong, rgba(148, 163, 184, 0.55));
  border-radius: 999px;
}

.ws-viewport::-webkit-scrollbar-thumb:hover,
.ws-sidebar-nav::-webkit-scrollbar-thumb:hover,
.qj-table-responsive::-webkit-scrollbar-thumb:hover,
.qj-modal-window::-webkit-scrollbar-thumb:hover,
.qj-drawer-body::-webkit-scrollbar-thumb:hover,
.qj-custom-select-popover::-webkit-scrollbar-thumb:hover,
.qj-picker-popover::-webkit-scrollbar-thumb:hover,
.qj-popover-body::-webkit-scrollbar-thumb:hover {
  background: var(--ws-text-muted, #64748B);
}

/* ============================================================================
 * Custom Date & Time Popover Pickers (Zero Native Date/Time Inputs)
 * ============================================================================ */
/* Allow interactive date/time pickers inside activity modal to render unclipped */
#act-modal-host .qj-modal-window {
  overflow: visible !important;
}

.qj-custom-picker-wrap {
  position: relative;
}

.qj-custom-picker-trigger {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--ws-border, #CBD5E1);
  background: var(--ws-surface, #FFFFFF);
  color: var(--ws-text-primary, #0F172A);
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.qj-custom-picker-trigger:hover {
  border-color: var(--ws-border-strong, #94A3B8);
}

.qj-custom-picker-trigger:focus-visible,
.qj-custom-picker-trigger.is-active {
  outline: none;
  border-color: var(--ws-accent, #0284C7);
  box-shadow: 0 0 0 3px var(--ws-accent-ring, rgba(2, 132, 199, 0.16));
}

.qj-picker-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 10050;
  background: var(--ws-surface, #FFFFFF);
  border: 1px solid var(--ws-border, #E2E8F0);
  border-radius: 14px;
  box-shadow: var(--ws-shadow-popover, 0 18px 36px -10px rgba(15, 23, 42, 0.22));
  padding: 12px;
}

.qj-picker-popover[hidden] {
  display: none;
}

.qj-date-popover {
  width: min(268px, calc(100vw - 48px));
  padding: 10px 12px;
}

.qj-time-popover {
  width: 210px;
  max-height: 220px;
  overflow-y: auto;
  right: 0;
  left: auto;
}

@media (max-width: 600px) {
  #new-act-form .qj-custom-picker-wrap {
    min-width: 0;
  }
}

.qj-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.qj-cal-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ws-text-primary, #0F172A);
}

.qj-cal-nav-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--ws-border-subtle, #E2E8F0);
  background: var(--ws-surface-subtle, #F8FAFC);
  color: var(--ws-text-primary, #0F172A);
  font-weight: 700;
  cursor: pointer;
}

.qj-cal-nav-btn:hover {
  border-color: var(--ws-accent, #0284C7);
}

.qj-cal-weekdays,
.qj-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  text-align: center;
}

.qj-cal-weekdays {
  font-size: 11px;
  font-weight: 600;
  color: var(--ws-text-muted, #64748B);
  margin-bottom: 4px;
}

.qj-cal-day {
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ws-text-primary, #0F172A);
  font-size: 12px;
  font-family: var(--ws-font-mono, monospace);
  cursor: pointer;
}

.qj-cal-day:hover {
  background: var(--ws-surface-subtle, #F1F5F9);
}

.qj-cal-day.is-today {
  border: 1px solid var(--ws-accent, #0284C7);
}

.qj-cal-day.is-selected {
  background: var(--ws-accent, #0284C7);
  color: #FFFFFF;
  font-weight: 700;
}

.qj-cal-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--ws-border-subtle, #F1F5F9);
  display: flex;
  justify-content: center;
}

.qj-cal-today-btn {
  border: none;
  background: transparent;
  color: var(--ws-accent, #0284C7);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.qj-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.qj-time-option {
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid var(--ws-border-subtle, #E2E8F0);
  background: var(--ws-surface-subtle, #F8FAFC);
  color: var(--ws-text-primary, #0F172A);
  font-size: 11.5px;
  font-family: var(--ws-font-mono, monospace);
  cursor: pointer;
}

.qj-time-option:hover {
  border-color: var(--ws-accent, #0284C7);
}

.qj-time-option.is-selected {
  background: var(--ws-accent, #0284C7);
  color: #FFFFFF;
  border-color: var(--ws-accent, #0284C7);
  font-weight: 700;
}

