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

:root {
  --sidebar-width: 248px;
  --sidebar-rail-width: 72px;
  --sidebar-expand-duration: 480ms;
  --sidebar-expand-ease: cubic-bezier(0.32, 1.12, 0.52, 1);
  --sidebar-bg: #f5f5f6;
  --sidebar-hover: #ebebec;
  --sidebar-active: #e8e8ea;
  --sidebar-active-pill: #dedee3;
  --main-bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #e8e8e8;
  /* 中蓝：比原先深，避免深蓝 */
  --brand: #3b6feb;
  --brand-2: #5b8df5;
  --brand-soft: rgba(59, 111, 235, 0.12);
  --brand-border: rgba(59, 111, 235, 0.32);
  --brand-shadow: rgba(59, 111, 235, 0.16);
  --radius-sm: 8px;
  --radius-input: 24px;
  --shadow-input: 0 8px 36px var(--brand-shadow), 0 2px 10px rgba(15, 23, 42, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mode-slide-duration: 680ms;
  --mode-slide-ease: cubic-bezier(0.32, 1.28, 0.52, 1);
  --mode-fade-duration: 520ms;
  --mode-body-fade-duration: 860ms;
  --quiz-card-exit-duration: 320ms;
  --mode-slide-distance: 30%;
  --message-list-scroll-buffer: 120px;
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--main-bg);
  overflow: hidden;
  overscroll-behavior: none;
}

/* iframe 内嵌：占满父 iframe 高度 */
.page {
  display: flex;
  position: relative;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

/* 收起侧栏：缩为图标轨，保留导航与列表图标可点 */
.page.sidebar-collapsed .sidebar {
  width: var(--sidebar-rail-width);
  min-width: var(--sidebar-rail-width);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.page.sidebar-collapsed .sidebar-top,
.page.sidebar-collapsed .history-section {
  width: var(--sidebar-rail-width);
  min-width: var(--sidebar-rail-width);
}

.page.sidebar-collapsed .sidebar-top {
  padding: 12px 6px 0;
}

.page.sidebar-collapsed .history-section {
  padding: 16px 4px 0;
}

.page.sidebar-collapsed .search-box {
  justify-content: center;
  padding: 7px 0;
  margin-bottom: 8px;
  pointer-events: none;
  cursor: default;
}

.page.sidebar-collapsed .search-box-label,
.page.sidebar-collapsed .search-box .shortcut {
  display: none;
}

.page.sidebar-collapsed .search-box .icon {
  margin: 0;
}

.page.sidebar-collapsed .nav-mode-label {
  display: none;
}

.page.sidebar-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  padding: 9px 0;
}

.page.sidebar-collapsed .nav-mode-indicator {
  left: 50%;
  right: auto;
  width: 34px;
  margin-left: -17px;
  border-radius: var(--radius-sm);
}

.page.sidebar-collapsed .nav-item.active .brand-avatar {
  opacity: 0;
  transform: scale(0.55);
}

.page.sidebar-collapsed .nav-item.active .nav-mode-list-icon {
  opacity: 1;
  transform: scale(1);
  color: var(--text);
}

.page.sidebar-collapsed .history-label,
.page.sidebar-collapsed .history-group-label,
.page.sidebar-collapsed .history-title,
.page.sidebar-collapsed .history-subtitle {
  visibility: hidden;
}

.page.sidebar-collapsed .history-meta,
.page.sidebar-collapsed .history-item-actions,
.page.sidebar-collapsed .ws-cat-admin-note {
  display: none !important;
}

.page.sidebar-collapsed .history-item {
  gap: 10px;
  padding: 8px 10px;
}

.page.sidebar-collapsed .history-item.ws-cat-item {
  border-left: none;
}

.page.sidebar-collapsed .ws-sidebar-tab-icon {
  display: none;
}

.page.sidebar-collapsed .ws-sidebar-tab-count {
  visibility: hidden;
}

.page.sidebar-collapsed .ws-sidebar-tab-label {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.page.sidebar-collapsed .ws-sidebar-tabs {
  position: relative;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0 6px 10px;
}

.page.sidebar-collapsed .ws-sidebar-tab {
  flex: none;
  width: 100%;
  padding: 6px 4px;
  gap: 2px;
}

.page.sidebar-collapsed .ws-sidebar-tab:not(.active) {
  display: none;
}

.page.sidebar-collapsed .ws-tab-rail-hint {
  display: block;
}

.ws-tab-rail-hint {
  display: none;
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 30px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.07);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.page.sidebar-collapsed .ws-sidebar-tabs:hover .ws-tab-rail-hint {
  opacity: 1;
}

.ws-tab-rail-thumb {
  position: absolute;
  left: 0;
  width: 100%;
  height: 9px;
  border-radius: 2px;
  background: var(--text-muted);
  top: 0;
  transition: top 0.2s ease;
}

.page.sidebar-collapsed .ws-sidebar-tabs[data-ws-rail-index="1"] .ws-tab-rail-thumb {
  top: calc(50% - 4.5px);
}

.page.sidebar-collapsed .ws-sidebar-tabs[data-ws-rail-index="2"] .ws-tab-rail-thumb {
  top: calc(100% - 9px);
}

.ws-sidebar-tab-icon {
  display: none;
}

.icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.icon-sm { width: 15px; height: 15px; }
.icon-xs { width: 14px; height: 14px; }

button {
  font: inherit;
  color: inherit;
}

/* 侧栏 */
.sidebar {
  position: relative;
  z-index: 3;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  transition:
    width var(--sidebar-expand-duration) var(--sidebar-expand-ease),
    min-width var(--sidebar-expand-duration) var(--sidebar-expand-ease);
}

.sidebar-top,
.history-section {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  flex-shrink: 0;
}

.history-section {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 10px 0;
  min-height: 0;
}

.history-section-viewport {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.history-section-track {
  display: flex;
  height: 100%;
  width: 300%;
  transition: transform var(--mode-slide-duration) var(--mode-slide-ease);
  will-change: transform;
}

.history-section-pane {
  width: 33.333333%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.mode-assistant .history-section-track {
  transform: translate3d(0, 0, 0);
}

.mode-quiz .history-section-track {
  transform: translate3d(-33.333333%, 0, 0);
}

.mode-workspace .history-section-track {
  transform: translate3d(-66.666667%, 0, 0);
}

.page.is-mode-instant .history-section-track {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .history-section-track {
    transition: none !important;
  }
}

.history-label {
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 10px 8px;
}

.history-group-label {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 10px 4px;
  position: sticky;
  top: 0;
  background: var(--sidebar-bg);
  z-index: 1;
  list-style: none;
  cursor: default;
  user-select: none;
}

.history-list { list-style: none; overflow-y: auto; flex: 1; }

#history-list-quiz:not(.is-search-results) {
  overflow: hidden;
}

.history-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.history-item.active .history-meta { color: var(--brand); }

.history-item.is-resume {
  border: 1px dashed var(--brand-border);
  background: var(--brand-soft);
  margin-bottom: 6px;
}

.history-item.is-resume .history-leading .icon { color: var(--brand); }

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}

.history-item.pinned .history-leading .icon { color: var(--brand); }

.history-leading {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.history-item-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}

.history-pin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  flex-shrink: 0;
}

.history-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  flex-shrink: 0;
}

.history-item:hover .history-pin-btn,
.history-item:hover .history-delete-btn,
.history-item.pinned .history-pin-btn {
  opacity: 1;
}

.history-pin-btn .icon { color: var(--text-muted); }

.history-pin-btn.is-pinned .icon,
.history-pin-btn:hover .icon { color: var(--brand); }

.history-pin-btn:hover { background: var(--sidebar-hover); }

.history-delete-btn .icon { color: var(--text-muted); }

.history-delete-btn:hover {
  background: rgba(229, 72, 77, 0.1);
}

.history-delete-btn:hover .icon { color: #e5484d; }

.history-item:hover { background: var(--sidebar-hover); }

.history-item.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.history-item.active .icon { color: var(--brand); }

.history-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-subtitle {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.35;
}

.history-item.active .history-subtitle { color: rgba(37, 99, 235, 0.75); }

.ws-sidebar-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 0 6px 10px;
  flex-shrink: 0;
}

.ws-sidebar-tabs[hidden] { display: none !important; }

.ws-sidebar-tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
}

.ws-sidebar-tab:hover { background: var(--sidebar-hover); }

.ws-sidebar-tab.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 500;
  box-shadow: none;
}

.ws-sidebar-tab-label {
  font-size: 11px;
  line-height: 1.2;
}

.ws-sidebar-tab-count {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.ws-sidebar-tab.active .ws-sidebar-tab-count {
  color: rgba(37, 99, 235, 0.7);
}

.history-item.ws-cat-item {
  border-left: 3px solid transparent;
}

.history-item.ws-cat-item.active[data-cat-tone="oa"] {
  background: rgba(37, 99, 235, 0.08);
  border-left-color: #2563eb;
}

.history-item.ws-cat-item.active[data-cat-tone="oa"] .history-title {
  color: #1d4ed8;
}

.history-item.ws-cat-item.active[data-cat-tone="oa"] .history-subtitle {
  color: rgba(37, 99, 235, 0.75);
}

.history-item.ws-cat-item.active[data-cat-tone="doc"] {
  background: rgba(16, 185, 129, 0.08);
  border-left-color: #059669;
}

.history-item.ws-cat-item.active[data-cat-tone="doc"] .history-title {
  color: #047857;
}

.history-item.ws-cat-item.active[data-cat-tone="doc"] .history-subtitle {
  color: rgba(5, 150, 105, 0.75);
}

.history-item.ws-cat-item.active[data-cat-tone="proc"] {
  background: rgba(245, 158, 11, 0.1);
  border-left-color: #d97706;
}

.history-item.ws-cat-item.active[data-cat-tone="proc"] .history-title {
  color: #b45309;
}

.history-item.ws-cat-item.active[data-cat-tone="proc"] .history-subtitle {
  color: rgba(217, 119, 6, 0.8);
}

.history-item.ws-cat-item.active[data-cat-tone="expense"] {
  background: rgba(124, 58, 237, 0.08);
  border-left-color: #7c3aed;
}

.history-item.ws-cat-item.active[data-cat-tone="expense"] .history-title {
  color: #6d28d9;
}

.history-item.ws-cat-item.active[data-cat-tone="expense"] .history-subtitle {
  color: rgba(124, 58, 237, 0.75);
}

.history-item.ws-cat-item.active[data-cat-tone="ticket"] {
  background: rgba(14, 165, 233, 0.08);
  border-left-color: #0ea5e9;
}

.history-item.ws-cat-item.active[data-cat-tone="ticket"] .history-title {
  color: #0284c7;
}

.history-item.ws-cat-item.active[data-cat-tone="ticket"] .history-subtitle {
  color: rgba(14, 165, 233, 0.75);
}

.ws-cat-admin-note {
  margin-left: 2px;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
}

.history-item.ws-cat-item.active .ws-cat-admin-note {
  color: rgba(37, 99, 235, 0.55);
}

.search-box.is-hidden { visibility: hidden; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .sidebar {
    transition: none;
  }
}

/* 侧栏右缘遮挡墙：横向切出内容滑到其下时被遮住 */
.sidebar-edge-mask {
  position: absolute;
  top: 0;
  right: -10px;
  width: 14px;
  height: 100%;
  background: var(--sidebar-bg);
  box-shadow: 4px 0 10px rgba(245, 245, 246, 0.92);
  pointer-events: none;
  z-index: 4;
}

.sidebar-top { padding: 12px 10px 0; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid transparent;
  cursor: pointer;
}

.search-box:focus,
.search-box:focus-within {
  background: var(--main-bg);
  border-color: var(--border);
}

.search-box .icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-box-label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-box .shortcut {
  flex-shrink: 0;
}

.shortcut {
  font-size: 11px;
  color: var(--text-muted);
  padding: 1px 5px;
  border-radius: 4px;
}

.nav-menu {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* 选中态椭圆指示器：在三项之间上下滑动 */
.nav-mode-indicator {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 42px;
  border-radius: 999px;
  background: var(--sidebar-active-pill, #dedee3);
  pointer-events: none;
  z-index: 0;
  transform: translate3d(0, 0, 0);
  transition:
    transform 680ms cubic-bezier(0.32, 1.28, 0.52, 1),
    height 680ms cubic-bezier(0.32, 1.28, 0.52, 1);
  will-change: transform, height;
}

.nav-mode-indicator.is-instant {
  transition: none !important;
}

.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  font-weight: 400;
  transition: color 520ms cubic-bezier(0.32, 1.1, 0.52, 1);
}

.nav-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: var(--sidebar-hover);
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: -1;
}

.nav-item:not(.active):hover::after { opacity: 1; }

.nav-item .shortcut { margin-left: auto; font-size: 11px; color: var(--text-muted); }

.nav-item.active {
  color: var(--text);
  font-weight: 500;
}

#nav-brand { cursor: pointer; }

.nav-mode-icon-slot {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.brand-avatar {
  position: absolute;
  inset: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.62);
  transition:
    opacity 520ms cubic-bezier(0.32, 1.15, 0.52, 1),
    transform 680ms cubic-bezier(0.32, 1.32, 0.52, 1);
  transition-delay: 0ms;
}

.brand-avatar .icon { color: #fff; stroke-width: 2; }

.brand-avatar.brand-avatar-logo {
  background: transparent;
  box-shadow: 0 2px 10px var(--brand-shadow);
  overflow: hidden;
}

.brand-avatar.brand-avatar-logo .avatar-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.nav-mode-list-icon {
  position: absolute;
  inset: 0;
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 420ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 680ms cubic-bezier(0.32, 1.28, 0.52, 1),
    color 480ms ease;
  transition-delay: 0ms;
}

.nav-item.active .brand-avatar {
  opacity: 1;
  transform: scale(1);
  transition-delay: 120ms;
}

.nav-item.active .nav-mode-list-icon {
  opacity: 0;
  transform: scale(0.55);
  transition-delay: 0ms;
}

.nav-item:not(.active) .brand-avatar {
  transition-delay: 0ms;
}

.nav-item:not(.active) .nav-mode-list-icon {
  transition-delay: 100ms;
}

@media (prefers-reduced-motion: reduce) {
  .nav-mode-indicator,
  .nav-item,
  .brand-avatar,
  .nav-mode-list-icon {
    transition: none !important;
    transition-delay: 0ms !important;
  }
}

.search-box.is-hidden { visibility: hidden; pointer-events: none; }

.pin { color: var(--text-muted); opacity: 0.5; }

/* 主区域：内容区铺满，底栏透明叠盖 */
.main {
  flex: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  position: relative;
  min-width: 0;
  min-height: 0;
  background: var(--main-bg);
}

.chat-header {
  grid-row: 1;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 8px;
  flex-shrink: 0;
}

.header-left,
.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  vertical-align: top;
}

.mode-quiz .chat-header {
  align-items: flex-start;
}

.mode-quiz #sidebar-toggle {
  align-self: flex-start;
  vertical-align: top;
}

.mode-quiz #new-chat-header,
.mode-workspace #new-chat-header {
  display: none;
}

.header-btn:hover { background: #f5f5f5; }

/* 主区模式切换：横向滑入滑出（内容区仍带淡出） */
.mode-panel {
  transition: transform var(--mode-slide-duration) var(--mode-slide-ease);
  will-change: transform;
}

.main-footer-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  flex-shrink: 0;
  background: transparent;
  pointer-events: none;
  overflow-x: hidden;
  overflow-y: visible;
}

.main-footer-slider {
  display: flex;
  width: 300%;
  align-items: flex-end;
  transition: transform var(--mode-slide-duration) var(--mode-slide-ease);
  will-change: transform;
}

.mode-quiz .main-footer-slider {
  transform: translate3d(-33.333333%, 0, 0);
}

.mode-workspace .main-footer-slider {
  transform: translate3d(-66.666667%, 0, 0);
}

.main-footer-pane {
  flex: 0 0 33.333333%;
  width: 33.333333%;
  box-sizing: border-box;
}

/* 仅当前模式底栏参与高度，避免滑轨被其它 pane 撑高留空带 */
.mode-assistant #quiz-start-input,
.mode-assistant #ws-tray-footer {
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  visibility: hidden;
  pointer-events: none;
}

.mode-quiz #assistant-input-area,
.mode-quiz #quiz-start-input,
.mode-quiz #ws-tray-footer {
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  visibility: hidden;
  pointer-events: none;
}

.mode-workspace #assistant-input-area,
.mode-workspace #quiz-start-input,
.mode-workspace #ws-tray-footer {
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  visibility: hidden;
  pointer-events: none;
}

.mode-workspace .main-footer-track {
  display: none !important;
}

.page.is-mode-instant .main-footer-slider {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .main-footer-slider {
    transition: none !important;
  }
}

#welcome-assistant,
#welcome-quiz,
#message-list {
  transition:
    opacity var(--mode-body-fade-duration) ease,
    visibility 0s linear var(--mode-body-fade-duration);
}

#welcome-quiz {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mode-assistant #welcome-assistant:not([hidden]) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity var(--mode-body-fade-duration) ease,
    visibility 0s linear 0s;
}

.mode-assistant #welcome-assistant[hidden] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mode-assistant #welcome-quiz {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mode-assistant #message-list:not([hidden]) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity var(--mode-body-fade-duration) ease,
    visibility 0s linear 0s;
}

.mode-assistant #message-list[hidden] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mode-quiz #welcome-assistant {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.mode-quiz #message-list {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mode-quiz:not(.view-quiz-card) #welcome-quiz {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity var(--mode-body-fade-duration) ease,
    visibility 0s linear 0s;
}

.mode-quiz.view-quiz-card #welcome-quiz {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mode-quiz.view-quiz-card #message-list:not([hidden]) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity var(--mode-body-fade-duration) ease,
    visibility 0s linear 0s;
}

.quiz-mode-exit #message-list:not([hidden]) {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity var(--quiz-card-exit-duration) ease !important;
}

.quiz-mode-exit #welcome-quiz {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity var(--quiz-card-exit-duration) ease !important;
}

.quiz-mode-enter #message-list:not([hidden]) {
  opacity: 0 !important;
  visibility: visible !important;
  pointer-events: none;
  transition: opacity var(--mode-body-fade-duration) ease !important;
}

.page.quiz-card-restore-pending.mode-quiz #welcome-quiz {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none;
}

.page.quiz-card-restore-pending.mode-quiz #welcome-assistant:not([hidden]) {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transition: opacity var(--quiz-card-exit-duration) ease !important;
}

.page.quiz-card-restore-pending.quiz-assistant-fading #welcome-assistant:not([hidden]) {
  opacity: 0 !important;
}

.page.quiz-card-restore-pending.mode-quiz #message-list:not([hidden]) {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transition: opacity var(--quiz-card-exit-duration) ease !important;
}

.page.quiz-card-restore-pending.quiz-assistant-fading #message-list:not([hidden]) {
  opacity: 0 !important;
}

.page.is-quiz-view-instant #welcome-quiz,
.page.is-quiz-view-instant #message-list {
  transition: none !important;
}

.page.is-mode-instant #welcome-assistant,
.page.is-mode-instant #welcome-quiz,
.page.is-mode-instant #message-list {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  #welcome-assistant,
  #welcome-quiz,
  #message-list {
    transition: none !important;
  }
}

.mode-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  min-height: 0;
}

.mode-placeholder[hidden] { display: none !important; }

.mode-placeholder-title {
  margin: 0;
  font-size: clamp(22px, 3.5vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.mode-placeholder-desc {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.chat-body {
  position: relative;
  flex: 1;
  overflow: clip;
  display: grid;
  grid-template-areas: "stage";
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  max-height: 100%;
  box-sizing: border-box;
}

.chat-body > #welcome-assistant,
.chat-body > #welcome-quiz,
.chat-body > #quiz-launch-buffer,
.chat-body > #message-list {
  grid-area: stage;
  box-sizing: border-box;
  min-height: 0;
  max-height: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

.chat-body[hidden] { display: none !important; }

.main-content-track {
  grid-row: 2;
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow: clip;
}

.main-content-track > #chat-body,
.main-content-track > #workspace-root {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  will-change: transform, opacity;
}

.main-content-track > #chat-body {
  transition:
    transform var(--mode-slide-duration) var(--mode-slide-ease),
    opacity calc(var(--mode-slide-duration) * 0.72) ease,
    visibility 0s linear calc(var(--mode-slide-duration) * 0.72);
}

.main-content-track > #workspace-root {
  z-index: 0;
  transition:
    transform var(--mode-slide-duration) var(--mode-slide-ease),
    opacity 0s linear 0s,
    visibility 0s linear 0s;
}

.main-content-track > #chat-body {
  z-index: 1;
}

.workspace-root.is-ws-leaving {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition:
    transform var(--mode-slide-duration) var(--mode-slide-ease),
    opacity 0s linear 0s,
    visibility 0s linear 0s !important;
}

.page.mode-workspace .main-content-track > #workspace-root {
  z-index: 2;
  opacity: 1;
  visibility: visible;
}

.page:not(.mode-workspace) .main-content-track > #workspace-root:not([hidden]) {
  transform: translate3d(100%, 0, 0);
  visibility: hidden;
  pointer-events: none;
}

.page.mode-workspace .main-content-track > #workspace-root {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  pointer-events: auto;
}

.mode-workspace #welcome-assistant,
.mode-workspace #welcome-quiz {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.page.mode-workspace .main-content-track > #chat-body {
  transform: translate3d(calc(-1 * var(--mode-slide-distance)), 0, 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page:not(.mode-workspace) .main-content-track > #chat-body {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.page.is-mode-instant .main-content-track > #chat-body,
.page.is-mode-instant .main-content-track > #workspace-root {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .main-content-track > #chat-body,
  .main-content-track > #workspace-root {
    transition: none !important;
  }
}

.welcome {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  box-sizing: border-box;
}

#welcome-assistant {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 20px 24px 12px;
  box-sizing: border-box;
}

#welcome-assistant .welcome-dialog {
  width: min(92%, 680px);
  max-width: min(92%, 680px);
  align-items: flex-start;
  margin-top: 0;
  padding: 0;
  animation: welcome-dialog-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#welcome-assistant .welcome-dialog .message-bubble {
  min-height: 160px;
  padding: 32px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: welcome-bubble-enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

#welcome-assistant.is-welcome-exiting {
  animation: welcome-exit-fade 0.68s ease forwards;
  pointer-events: none;
}

#welcome-assistant.is-welcome-exiting .welcome-dialog,
#welcome-assistant.is-welcome-exiting .message-bubble {
  animation: none;
}

#welcome-assistant.is-welcome-exiting .message-avatar {
  animation: welcome-exit-avatar-move 0.68s cubic-bezier(0.36, 0, 0.2, 1) forwards;
}

#welcome-assistant.is-welcome-exiting .welcome-dialog .message-bubble {
  animation: welcome-exit-bubble-move 0.68s cubic-bezier(0.34, 0, 0.18, 1) forwards;
}

@keyframes welcome-exit-fade {
  0%, 26% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

@keyframes welcome-exit-avatar-move {
  0% { transform: translate3d(0, 0, 0); }
  14% { transform: translate3d(0, 10px, 0); }
  100% { transform: translate3d(0, -42px, 0); }
}

@keyframes welcome-exit-bubble-move {
  0% { transform: translate3d(0, 0, 0); }
  11% { transform: translate3d(0, 14px, 0); }
  100% { transform: translate3d(0, -50px, 0); }
}

#welcome-assistant .welcome-dialog .message-answer {
  text-align: center;
}

#welcome-assistant .welcome-dialog .message-answer .welcome-text {
  margin: 0;
  font-size: clamp(22px, 3.2vw, 28px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.4;
  color: var(--text);
}

@keyframes welcome-dialog-enter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes welcome-bubble-enter {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  #welcome-assistant .welcome-dialog,
  #welcome-assistant .welcome-dialog .message-bubble {
    animation: none;
  }

  #welcome-assistant.is-welcome-exiting,
  #welcome-assistant.is-welcome-exiting .message-avatar,
  #welcome-assistant.is-welcome-exiting .welcome-dialog .message-bubble {
    animation: none !important;
  }
}

.welcome[hidden],
#welcome-assistant[hidden] {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* 测验/助手欢迎语互斥（动画由 opacity 控制，不用 display 硬切） */
#welcome-quiz {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  padding: 0;
  text-align: left;
  box-sizing: border-box;
}

#welcome-quiz .welcome-text,
#welcome-quiz .quiz-start-title {
  margin: 0;
  width: auto;
  text-align: left;
}

.welcome-text {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.message-list {
  overflow-y: auto;
  padding: 20px 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: stretch;
}

.mode-assistant .message-list:not([hidden]) {
  padding-bottom: calc(var(--assistant-footer-reserve, 0px) + var(--message-list-scroll-buffer, 0px));
}

.message-list[hidden] {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.message {
  display: flex;
  flex-direction: row;
}

/* 亚克力对话卡片：助手消息（欢迎 + 普通对话共用，高度随内容伸缩） */
.message-assistant {
  --acrylic-avatar-size: 52px;
  --acrylic-gap: 10px;
  align-self: flex-start;
  width: min(92%, 680px);
  max-width: min(92%, 680px);
  align-items: flex-start;
  gap: var(--acrylic-gap);
}

.message-assistant .message-avatar {
  width: var(--acrylic-avatar-size);
  height: var(--acrylic-avatar-size);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.message-assistant:not(.quiz-message) .message-avatar {
  background: transparent;
  box-shadow: 0 2px 10px var(--brand-shadow);
}

.message-assistant:not(.quiz-message) .message-avatar .avatar-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.message-assistant.quiz-message .message-avatar {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.message-assistant.quiz-message .message-avatar .icon {
  width: 22px;
  height: 22px;
  color: #fff;
  stroke-width: 2;
}

.message-assistant .message-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.message-assistant .message-bubble {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  position: relative;
  padding: 20px 24px;
  border-radius: 20px;
  background: #f7f8fa;
  line-height: 1.65;
  overflow: hidden;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  --reveal: 0;
}

/* B：极淡线性底，垂直铺匀；整体左移 1/4 卡片宽 */
.message-assistant .message-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -25%;
  width: 125%;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.55s var(--gem-ease-out, ease);
  background: linear-gradient(
    90deg,
    rgba(59, 111, 235, 0.07) 0%,
    rgba(91, 141, 245, 0.035) calc(22% + var(--reveal) * 12%),
    transparent calc(48% + var(--reveal) * 26%)
  );
}

/* A：左缘径向光池 + 斑点副光斑；整体左移 1/4 */
.message-assistant .message-bubble::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -25%;
  width: 125%;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.55s var(--gem-ease-out, ease);
  background:
    radial-gradient(
      ellipse 42% 58% at 0% 32%,
      rgba(59, 111, 235, 0.16) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse calc(92% + var(--reveal) * 32%) 115% at 0% 50%,
      rgba(59, 111, 235, 0.3) 0%,
      rgba(91, 141, 245, 0.14) calc(36% + var(--reveal) * 16%),
      transparent calc(70% + var(--reveal) * 22%)
    );
}

.message-assistant .message-bubble > * {
  position: relative;
  z-index: 1;
}

.message-user {
  align-self: flex-end;
  max-width: min(92%, 680px);
}

.message-user .message-body {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 100%;
}

.message-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 0 4px;
  min-height: 24px;
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.message:hover .message-time,
.message:focus-within .message-time {
  opacity: 1;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
}

.message.is-editing .message-footer .message-actions {
  display: none;
}

.message-streaming .message-footer {
  display: none;
}

.message-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
}

.message-action-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.message-action-btn.is-feedback-up.is-active {
  color: var(--brand);
  background: var(--brand-soft);
}

.message-action-btn.is-feedback-down.is-active {
  color: #e5484d;
  background: rgba(229, 72, 77, 0.1);
}

.message-action-btn.is-feedback-anim {
  position: relative;
  z-index: 0;
}

.message-action-btn.is-feedback-anim-up {
  animation: feedbackUpPop 0.48s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.message-action-btn.is-feedback-anim-up::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 10px;
  border: 2px solid var(--brand);
  opacity: 0;
  animation: feedbackUpRing 0.52s ease-out;
  pointer-events: none;
}

.message-action-btn.is-feedback-anim-down {
  animation: feedbackDownPop 0.4s ease-out;
}

@keyframes feedbackUpPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.32); }
  70% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

@keyframes feedbackUpRing {
  0% { transform: scale(0.75); opacity: 0.7; }
  100% { transform: scale(1.55); opacity: 0; }
}

@keyframes feedbackDownPop {
  0% { transform: scale(1); }
  40% { transform: scale(0.88); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .message-action-btn.is-feedback-anim-up,
  .message-action-btn.is-feedback-anim-down {
    animation: none;
  }

  .message-action-btn.is-feedback-anim-up::after {
    animation: none;
    display: none;
  }
}

.message-edit-input {
  width: 100%;
  min-width: 200px;
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  background: var(--main-bg);
  color: var(--text);
}

.message-edit-input:focus {
  border-color: rgba(59, 111, 235, 0.48);
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.message-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: flex-end;
}

.message-user .message-bubble {
  padding: 16px 22px;
  border-radius: 20px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -0.01em;
  color: var(--text);
}

.message-bubble {
  white-space: pre-wrap;
  word-break: break-word;
}

.message-stream-text {
  display: inline;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-bubble-streaming {
  line-height: 1.6;
}

.message-bubble-streaming.is-awaiting-reply {
  min-height: 2.6em;
}

.is-awaiting-reply .stream-cursor {
  display: none;
}

.stream-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  border-radius: 1px;
  background: linear-gradient(180deg, #5b8df5 0%, #4a63d4 100%);
  animation: stream-cursor-pulse 1.4s ease-in-out infinite;
}

@keyframes stream-cursor-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .is-awaiting-reply .stream-cursor {
    display: inline-block;
    background: var(--text-muted);
    animation: stream-cursor-blink 1s step-end infinite;
  }

  .stream-cursor {
    background: var(--text-muted);
    animation: stream-cursor-blink 1s step-end infinite;
  }
}

@keyframes stream-cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.message-answer {
  white-space: normal;
  word-break: break-word;
  line-height: 1.65;
}

.message-answer .katex-display {
  margin: 0.6em 0;
  overflow-x: auto;
  overflow-y: hidden;
}

/* 通用助手：Markdown 富文本（仅 mode-assistant） */
.mode-assistant .message-answer .asst-md-h {
  margin: 1.1em 0 0.45em;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  letter-spacing: -0.01em;
}

.mode-assistant .message-answer .asst-md-h:first-child,
.mode-assistant .message-answer > .asst-md-h:first-child {
  margin-top: 0;
}

.mode-assistant .message-answer .asst-md-h1 { font-size: 1.25em; }
.mode-assistant .message-answer .asst-md-h2 { font-size: 1.15em; }
.mode-assistant .message-answer .asst-md-h3 { font-size: 1.05em; }
.mode-assistant .message-answer .asst-md-h4 { font-size: 1em; }

.mode-assistant .message-answer .asst-md-p {
  margin: 0.55em 0;
}

.mode-assistant .message-answer .asst-md-p:first-child {
  margin-top: 0;
}

.mode-assistant .message-answer .asst-md-strong {
  font-weight: 600;
  color: var(--text);
}

.mode-assistant .message-answer .asst-md-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(59, 111, 235, 0.1);
  color: #2f5fd4;
  word-break: break-word;
}

.mode-assistant .message-answer .asst-md-code-wrap {
  position: relative;
  margin: 10px 0;
}

.mode-assistant .message-answer .asst-md-code-lang {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: lowercase;
  pointer-events: none;
  z-index: 1;
}

.mode-assistant .message-answer .asst-md-pre {
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  overflow-x: auto;
  border: 1px solid rgba(232, 232, 232, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 1px 10px rgba(15, 23, 42, 0.05);
}

.mode-assistant .message-answer .asst-md-block {
  display: block;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre;
}

.mode-assistant .message-answer .asst-md-list {
  margin: 0.5em 0 0.65em;
  padding-left: 1.35em;
}

.mode-assistant .message-answer .asst-md-list li {
  margin: 0.25em 0;
  line-height: 1.6;
}

.mode-assistant .message-answer .asst-md-list li::marker {
  color: var(--brand);
}

.quiz-card .explain-text .katex-display {
  margin: 0.6em 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.answer-figure {
  margin: 4px 0;
}

.answer-fig {
  display: block;
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.answer-fig-url {
  display: none;
  margin-top: 4px;
  font-size: 12px;
  color: var(--brand);
  word-break: break-all;
  line-height: 1.4;
}

.answer-figure--broken .answer-fig {
  display: none;
}

.answer-figure--broken .answer-fig-url {
  display: block;
}

.answer-fig-caption {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

/* Markdown 表格：灰白半透明磨砂亚克力 */
.md-table {
  width: 100%;
  margin: 10px 0;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(247, 248, 250, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 1px 10px rgba(15, 23, 42, 0.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.12);
  backdrop-filter: blur(14px) saturate(1.12);
}

.md-table th,
.md-table td {
  border: 1px solid rgba(232, 232, 232, 0.5);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.md-table th {
  background: rgba(250, 251, 252, 0.72);
  font-weight: 600;
  color: var(--text-secondary);
}

.md-table td {
  background: rgba(255, 255, 255, 0.32);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .md-table {
    background: #f7f8fa;
  }

  .md-table th {
    background: #fafbfc;
  }

  .md-table td {
    background: rgba(255, 255, 255, 0.94);
  }
}

.sources-wrap {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.sources-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  border: none;
  background: none;
  color: var(--brand);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.sources-toggle:hover {
  color: var(--brand-2);
}

.sources-chevron {
  color: var(--brand);
  transition: transform 0.15s ease;
}

.sources-wrap:not(.is-collapsed) .sources-chevron {
  transform: rotate(180deg);
}

.sources-wrap.is-collapsed .sources-panel {
  display: none;
}

.sources-panel {
  margin-top: 10px;
  padding: 10px;
  background: #f9fafb;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sources-panel .symbol-citation-list,
.sources-panel .citation-list,
.sources-panel .web-source-list {
  margin-top: 0;
}

.citation-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.citation-list-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.symbol-citation-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.symbol-citation-card {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.symbol-char {
  font-weight: 700;
  color: var(--brand);
  flex-shrink: 0;
}

.symbol-meaning {
  color: var(--text-secondary);
}

.citation-card {
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.citation-page {
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 2px;
}

.citation-heading {
  color: var(--text-secondary);
}

.web-source-list {
  margin-top: 12px;
  font-size: 12px;
}

.web-source-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.web-source-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.web-source-list li {
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.web-source-list a {
  color: var(--brand);
  text-decoration: none;
}

.web-source-list a:hover { text-decoration: underline; }

.message-loading .message-bubble {
  padding: 14px 18px;
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: dot-pulse 1.2s infinite ease-in-out;
}

.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

/* Gemini 流式：蓝环等待 + 四色亚克力背景 + 过渡动效 */
:root {
  --gem-blue: #4285f4;
  --gem-red: #ea4335;
  --gem-yellow: #fbbc05;
  --gem-green: #34a853;
  --gem-blue-deep: #2b6de8;
  --gem-blue-light: #8eb8ff;
  --gem-blue-glow: rgba(66, 133, 244, 0.35);
  --gem-ease-spring: cubic-bezier(0.34, 1.45, 0.48, 1);
  --gem-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --gem-reveal: 780ms;
}

.message-assistant .message-bubble.gemini-bubble {
  min-height: 6.8em;
  background: #f8f9fc !important;
  isolation: isolate;
  transition:
    min-height 0.65s var(--gem-ease-spring),
    box-shadow 0.5s ease,
    background 0.55s ease;
}

.message-assistant .message-bubble.gemini-bubble.is-gemini-awaiting {
  box-shadow:
    0 0 0 1px rgba(66, 133, 244, 0.08),
    0 8px 28px rgba(66, 133, 244, 0.1);
}

.message-assistant .message-bubble.gemini-bubble.is-gemini-revealing {
  box-shadow:
    0 0 0 1px rgba(66, 133, 244, 0.14),
    0 12px 36px rgba(66, 133, 244, 0.16);
}

.message-assistant .message-bubble.gemini-bubble.is-gemini-streaming {
  min-height: 0;
  box-shadow: none;
  background: #f7f8fa !important;
}

.message-assistant .message-bubble.gemini-bubble::before,
.message-assistant .message-bubble.gemini-bubble::after {
  opacity: 0;
  transition: opacity 0.55s ease, transform 0.65s var(--gem-ease-out);
}

.message-assistant .message-bubble.gemini-bubble.is-gemini-awaiting::before,
.message-assistant .message-bubble.gemini-bubble.is-gemini-awaiting::after {
  opacity: 1;
}

.message-assistant .message-bubble.gemini-bubble.is-gemini-revealing::before,
.message-assistant .message-bubble.gemini-bubble.is-gemini-revealing::after {
  opacity: 0;
  transform: scale(1.04);
}

.message-assistant .message-bubble.gemini-bubble.is-gemini-awaiting::before {
  background: linear-gradient(
    125deg,
    rgba(66, 133, 244, 0.16) 0%,
    rgba(234, 67, 53, 0.1) 28%,
    rgba(251, 188, 5, 0.1) 58%,
    rgba(52, 168, 83, 0.1) 100%
  );
  animation: gemini-bg-shift 1.5s ease-in-out infinite;
}

.message-assistant .message-bubble.gemini-bubble.is-gemini-awaiting::after {
  background:
    radial-gradient(ellipse 80% 90% at 12% 50%, var(--gem-blue-glow), transparent 68%),
    radial-gradient(ellipse 70% 80% at 88% 40%, rgba(234, 67, 53, 0.2), transparent 65%),
    radial-gradient(ellipse 60% 70% at 50% 100%, rgba(251, 188, 5, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 60% at 28% 88%, rgba(52, 168, 83, 0.16), transparent 55%);
  animation: gemini-glow-pulse 1.1s ease-in-out infinite;
}

/* 过渡前 ms 级停四色背景动画，避免与圆环退出同帧争抢 */
.message-assistant .message-bubble.gemini-bubble.is-gemini-awaiting.is-gemini-bg-settling::before,
.message-assistant .message-bubble.gemini-bubble.is-gemini-awaiting.is-gemini-bg-settling::after {
  animation-play-state: paused;
  opacity: 0;
  transition: opacity 80ms ease, transform 80ms var(--gem-ease-out);
  transform: scale(1);
}

@keyframes gemini-bg-shift {
  0%, 100% { opacity: 0.85; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(2%); }
}

@keyframes gemini-glow-pulse {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

.gemini-bubble-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template: 1fr / 1fr;
  align-items: start;
}

.gemini-think-stage,
.gemini-stream-stage {
  grid-area: 1 / 1;
}

.gemini-think-stage {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 4.5em;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.55s ease,
    transform 0.55s var(--gem-ease-out),
    filter 0.5s ease;
}

.gemini-think-stage.is-exiting {
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  filter: blur(3px);
  pointer-events: none;
}

.gemini-think-stage.is-exiting .gemini-think-copy {
  opacity: 0;
  transform: translateX(-14px);
}

.gemini-orb-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  transform-origin: center center;
}

.gemini-orb-wrap.is-charging {
  animation: gemini-orb-charge 0.32s var(--gem-ease-out) forwards;
}

.gemini-think-stage.is-exiting .gemini-orb-wrap {
  animation: gemini-orb-bloom 0.62s var(--gem-ease-spring) forwards;
}

@keyframes gemini-orb-charge {
  0% { transform: scale(1); }
  55% { transform: scale(1.12); }
  100% { transform: scale(1.06); }
}

@keyframes gemini-orb-bloom {
  0% { transform: scale(1.06); opacity: 1; filter: blur(0); }
  28% { transform: scale(2.4); opacity: 0.72; filter: blur(3px); }
  55% { transform: scale(4.2); opacity: 0.38; filter: blur(10px); }
  100% { transform: scale(5.5); opacity: 0; filter: blur(16px); }
}

.gemini-orb-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #2b6de8,
    var(--gem-blue),
    #a8c7fb,
    #5b93f6,
    #2b6de8
  );
  animation: gemini-ring-spin 2.8s linear infinite;
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
}

.gemini-think-stage.is-exiting .gemini-orb-ring {
  animation: gemini-ring-flare 0.62s ease-out forwards;
}

@keyframes gemini-ring-spin {
  to { transform: rotate(360deg); }
}

@keyframes gemini-ring-flare {
  0% { transform: rotate(0deg) scale(1); opacity: 1; filter: blur(0); }
  30% { transform: rotate(80deg) scale(2.8); opacity: 0.78; filter: blur(1px); }
  62% { transform: rotate(165deg) scale(5.2); opacity: 0.34; filter: blur(7px); }
  100% { transform: rotate(230deg) scale(7); opacity: 0; filter: blur(14px); }
}

.gemini-orb-core {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #e8edf8 55%, #d4dcf0 100%);
  box-shadow: inset 0 1px 4px rgba(66, 133, 244, 0.15);
  animation: gemini-core-breathe 2s ease-in-out infinite;
}

@keyframes gemini-core-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.gemini-think-stage.is-exiting .gemini-orb-core {
  animation: gemini-core-bloom-out 0.62s ease-out forwards;
}

@keyframes gemini-core-bloom-out {
  0% { opacity: 1; transform: scale(1); filter: blur(0); }
  35% { opacity: 0.55; transform: scale(2); filter: blur(3px); }
  100% { opacity: 0; transform: scale(3.6); filter: blur(12px); }
}

.gemini-think-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: opacity 0.38s ease, transform 0.42s var(--gem-ease-out);
}

.gemini-think-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}

.gemini-think-sub {
  font-size: 13px;
  color: var(--text-secondary);
  min-height: 1.3em;
  transition: opacity 0.25s ease;
}

.gemini-think-sub.is-fading {
  opacity: 0;
}

.gemini-ellipsis::after {
  content: "";
  animation: gemini-dot-cycle 1.5s steps(1, end) infinite;
}

@keyframes gemini-dot-cycle {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75%, 100% { content: "..."; }
}

.gemini-reveal-fx {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.gemini-reveal-pulse {
  position: absolute;
  left: 28px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(142, 184, 255, 0.45) 32%, transparent 72%);
  opacity: 0;
  transform: scale(0.4);
}

.gemini-reveal-pulse.is-active {
  animation: gemini-pulse-burst 0.72s var(--gem-ease-out) forwards;
}

@keyframes gemini-pulse-burst {
  0% { opacity: 0; transform: scale(0.3); }
  14% { opacity: 0.5; transform: scale(1.4); }
  100% { opacity: 0; transform: scale(18); }
}

.gemini-reveal-bridge {
  position: absolute;
  left: 28px;
  top: 50%;
  width: 0;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gem-blue), rgba(142, 184, 255, 0.2));
  box-shadow: 0 0 12px rgba(66, 133, 244, 0.55);
  opacity: 0;
  transform-origin: left center;
}

.gemini-reveal-bridge.is-active {
  opacity: 1;
  animation: gemini-bridge-grow 0.52s var(--gem-ease-out) 0.12s forwards;
}

@keyframes gemini-bridge-grow {
  from { width: 0; opacity: 0.2; }
  to { width: var(--bridge-w, 180px); opacity: 1; }
}

.gemini-reveal-sweep {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 42%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 58%
  );
  transform: translateX(-120%);
  opacity: 0;
}

.gemini-reveal-sweep.is-active {
  opacity: 1;
  animation: gemini-sweep 0.75s var(--gem-ease-out) 0.18s forwards;
}

@keyframes gemini-sweep {
  to { transform: translateX(120%); opacity: 0; }
}

.gemini-stream-stage {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(4px);
  clip-path: inset(0 100% 0 0 round 4px);
  pointer-events: none;
}

.gemini-stream-stage.is-entering {
  animation: gemini-stream-in var(--gem-reveal) var(--gem-ease-spring) forwards;
  pointer-events: auto;
}

@keyframes gemini-stream-in {
  0% {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(4px);
    clip-path: inset(0 100% 0 0 round 4px);
  }
  35% {
    opacity: 0.55;
    filter: blur(2px);
    clip-path: inset(0 72% 0 0 round 4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    clip-path: inset(0 0 0 0 round 4px);
  }
}

.gemini-bubble .gemini-stream-text {
  display: inline;
  white-space: pre-wrap;
  word-break: break-word;
}

.gemini-bubble .gemini-cursor {
  display: inline-block;
  width: 2px;
  height: 1.08em;
  margin-left: 2px;
  vertical-align: text-bottom;
  border-radius: 1px;
  background: linear-gradient(180deg, var(--gem-blue-deep), var(--gem-blue-light));
  box-shadow: 0 0 8px rgba(66, 133, 244, 0.45);
  animation: gemini-cursor-glow 0.85s ease-in-out infinite;
}

.gemini-bubble .gemini-cursor.is-fading {
  animation: gemini-cursor-out 0.35s ease forwards;
}

@keyframes gemini-cursor-glow {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(66, 133, 244, 0.45); }
  50% { opacity: 0.35; box-shadow: 0 0 4px rgba(66, 133, 244, 0.2); }
}

@keyframes gemini-cursor-out {
  to { opacity: 0; transform: scaleY(0.4); }
}

@media (prefers-reduced-motion: reduce) {
  .message-assistant .message-bubble.gemini-bubble,
  .gemini-think-stage,
  .gemini-orb-wrap,
  .gemini-orb-ring,
  .gemini-orb-core,
  .gemini-stream-stage,
  .gemini-reveal-pulse,
  .gemini-reveal-bridge,
  .gemini-reveal-sweep,
  .gemini-bubble .gemini-cursor {
    animation: none !important;
    transition: opacity 0.2s ease !important;
  }

  .gemini-stream-stage.is-entering {
    opacity: 1;
    transform: none;
    filter: none;
    clip-path: none;
  }
}

.input-box.is-sending {
  opacity: 0.85;
  pointer-events: none;
}

.input-box.is-sending .send-btn {
  pointer-events: auto;
}

.mode-assistant #assistant-input-area > .input-box.is-sending {
  pointer-events: none;
}

.mode-assistant #assistant-input-area > .input-box.is-sending .send-btn {
  pointer-events: auto;
}

/* 输入区 */
.input-area {
  padding: 0 24px 24px;
  flex-shrink: 0;
  background: transparent;
}

.mode-assistant #assistant-input-area > .spring-presets.is-visible,
.mode-assistant #assistant-input-area > .general-presets.is-visible,
.mode-assistant #assistant-input-area > .input-box {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.mode-quiz #quiz-start-input {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.spring-presets,
.general-presets {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  max-width: min(94%, 980px);
  margin: 0 auto 12px;
}

.spring-presets.is-visible,
.general-presets.is-visible {
  display: flex;
}

.preset-chip {
  padding: 8px 16px;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-secondary);
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(59, 111, 235, 0.07);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.preset-chip:hover {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: rgba(59, 111, 235, 0.45);
  box-shadow: 0 4px 14px var(--brand-shadow);
  transform: translateY(-1px);
}

.preset-chip:active {
  transform: translateY(0);
}

.input-box {
  max-width: min(94%, 980px);
  margin: 0 auto;
  background: var(--main-bg);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-input);
  box-shadow: var(--shadow-input);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-box:focus-within {
  border-color: rgba(59, 111, 235, 0.48);
  box-shadow: 0 10px 40px var(--brand-shadow), 0 2px 12px rgba(15, 23, 42, 0.06);
}

.input-field { padding: 18px 20px 4px; }

.message-input {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  min-height: 24px;
  max-height: 160px;
}

.message-input::placeholder { color: #b0b0b0; }

.input-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 14px 14px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-divider {
  width: 1px;
  height: 18px;
  background: #e5e5e5;
  margin: 0 4px;
}

.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.tool-btn .icon { color: var(--text); stroke-width: 2; }

.tool-dropdown { position: relative; }

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 4px;
  border: none;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.tool-chip .icon { color: var(--text); stroke-width: 2; }

.tool-dropdown.has-selection .tool-chip-label { color: var(--brand); }

.web-search-chip {
  border-radius: 999px;
  padding: 0 6px;
  transition: background 0.15s ease, padding 0.15s ease;
}

.web-search-chip.active {
  background: #ebebec;
  padding: 0 12px;
  color: var(--brand);
}

.web-search-chip.active .icon { color: var(--brand); }

.kb-badge {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  font-size: 12px;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  padding: 2px 10px;
  border-radius: 999px;
  text-align: center;
}

.kb-badge.is-visible {
  display: inline-flex;
}

.kb-badge[hidden] {
  display: none !important;
}

.kb-badge-label {
  line-height: 1.4;
  text-align: center;
}

.kb-badge-close {
  position: absolute;
  top: -5px;
  right: -5px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.kb-badge:hover .kb-badge-close {
  opacity: 1;
  visibility: visible;
}

.kb-badge-close .icon {
  width: 10px;
  height: 10px;
  color: #b0b0b0;
  stroke-width: 2.5;
}

.kb-badge-close:hover .icon { color: #e53935; }

.chip-chevron {
  color: #b0b0b0;
  transition: transform 0.15s ease;
}

.tool-dropdown.open .chip-chevron { transform: rotate(90deg); }

.tool-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  min-width: 148px;
  padding: 6px;
  background: var(--main-bg);
  border: 1px solid var(--brand-border);
  border-radius: 14px;
  box-shadow: var(--shadow-input);
  z-index: 10;
}

.tool-menu-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: none;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.tool-menu-item:hover,
.tool-menu-item.selected {
  background: var(--brand-soft);
  color: var(--brand);
}

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f3f3f3;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.send-btn .icon { color: var(--text); stroke-width: 2; }

.send-btn-text {
  background: var(--brand);
}

.send-btn-text .icon { color: #fff; }

.send-btn-text:hover { background: var(--brand-2); }

.send-btn .send-btn-icon-pause {
  display: none;
}

.send-btn.is-pause .send-btn-icon-send {
  display: none;
}

.send-btn.is-pause .send-btn-icon-pause {
  display: block;
}

/* 占位提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 16px;
  background: rgba(26, 26, 26, 0.88);
  color: #fff;
  font-size: 13px;
  border-radius: 10px;
  z-index: 100;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.is-enter {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.is-success {
  background: linear-gradient(135deg, rgba(22, 119, 255, 0.94), rgba(64, 150, 255, 0.92));
  box-shadow: 0 8px 24px rgba(22, 119, 255, 0.28);
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
    opacity: 1;
    transform: translateX(-50%);
  }
}

@media (max-width: 640px) {
  .page:not(.sidebar-collapsed) .sidebar {
    position: absolute;
    z-index: 20;
    height: 100%;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
  }
}
