/* ==========================================================================
   ClueHub — Google Material Design 3 Expressive (MD3E) 设计系统
   目录：
   1. MD3E 核心设计令牌（色彩 / 形状 / 排版 / 动效 / 阴影高程）
   2. 基础重置、全局排版与焦点体系
   3. 栅格与布局骨架
   4. 顶栏（Top App Bar）/ 项目二级导航 / 移动端底部导航（Navigation Bar）
   5. 按钮系统（Filled / Tonal / Outlined / Text / Icon / Extended FAB / Segmented）
   6. 表单控件（Filled Text Field / Switch / Filter Chips / Radio Cards / Dropzone）
   7. 卡片、徽章与元数据系统（Project Card / Clue Card / Copyable Pills）
   8. 时间线 / 推理树（Interactive Theory Tree & Pulsing Highlights）
   9. 知识图谱 / 协作 Wiki / 差异比较 / 附件预览
   10. 模态对话框 / MD3E 进度条 Snackbar / 下拉菜单 / 空状态 / 变形加载器
   11. 工具类与响应式（桌面 / 平板 / 手机端完整适配）
   ========================================================================== */

/* ---------- 1. MD3E 核心设计令牌 ---------- */
:root {
  color-scheme: light;

  /* --- MD3 Expressive 浅色色板（以信号紫罗兰为主色，搭配品红与青绿） --- */
  --md-sys-color-primary: #5B4BE0;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-primary-container: #EADDFF;
  --md-sys-color-on-primary-container: #21005D;
  --md-sys-color-primary-fixed: #EADDFF;
  --md-sys-color-on-primary-fixed: #21005D;

  --md-sys-color-secondary: #9C27B0;
  --md-sys-color-on-secondary: #FFFFFF;
  --md-sys-color-secondary-container: #FFD8EC;
  --md-sys-color-on-secondary-container: #3E001D;

  --md-sys-color-tertiary: #00696E;
  --md-sys-color-on-tertiary: #FFFFFF;
  --md-sys-color-tertiary-container: #9EF0F6;
  --md-sys-color-on-tertiary-container: #002021;

  --md-sys-color-error: #BA1A1A;
  --md-sys-color-on-error: #FFFFFF;
  --md-sys-color-error-container: #FFDAD6;
  --md-sys-color-on-error-container: #410002;

  --md-sys-color-warning: #8A5100;
  --md-sys-color-on-warning: #FFFFFF;
  --md-sys-color-warning-container: #FFDCBE;
  --md-sys-color-on-warning-container: #2C1600;

  /* --- 表面与容器色阶（5 级 Tonal Surface Containers） --- */
  --md-sys-color-surface: #FAF8FD;
  --md-sys-color-on-surface: #1B1B21;
  --md-sys-color-surface-dim: #DED8E1;
  --md-sys-color-surface-bright: #FEF7FF;
  --md-sys-color-surface-container-lowest: #FFFFFF;
  --md-sys-color-surface-container-low: #F6F2FA;
  --md-sys-color-surface-container: #F0EBF5;
  --md-sys-color-surface-container-high: #EAE5EF;
  --md-sys-color-surface-container-highest: #E4DFEA;

  --md-sys-color-on-surface-variant: #49454F;
  --md-sys-color-on-surface-variant-faint: #79747E;
  --md-sys-color-outline: #79747E;
  --md-sys-color-outline-variant: #CAC4D0;
  --md-sys-color-outline-subtle: rgba(121, 116, 126, 0.2);

  --md-sys-color-inverse-surface: #313033;
  --md-sys-color-inverse-on-surface: #F4EFF4;
  --md-sys-color-inverse-primary: #D0BCFF;
  --md-sys-color-scrim: #000000;

  /* --- MD3 Expressive 形状体系 --- */
  --md-sys-shape-corner-none: 0px;
  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-extra-extra-large: 40px;
  --md-sys-shape-corner-full: 9999px;

  /* --- 高度（MD3 Elevation 双层自然漫反射光影） --- */
  --md-sys-elevation-0: none;
  --md-sys-elevation-1: 0 1px 3px 1px rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.12);
  --md-sys-elevation-2: 0 2px 6px 2px rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.14);
  --md-sys-elevation-3: 0 4px 12px 3px rgba(0, 0, 0, 0.10), 0 1px 3px 0 rgba(0, 0, 0, 0.18);
  --md-sys-elevation-4: 0 8px 24px 6px rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.18);

  /* --- 动效（Google MD3 Motion + Spring 缓动） --- */
  --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-standard-decelerate: cubic-bezier(0, 0, 0, 1);
  --md-sys-motion-easing-standard-accelerate: cubic-bezier(0.3, 0, 1, 1);
  --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-emphasized-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
  --md-sys-motion-easing-emphasized-accelerate: cubic-bezier(0.3, 0, 0.8, 0.15);
  --md-sys-motion-easing-spring: cubic-bezier(0.34, 1.36, 0.64, 1);
  --md-sys-motion-duration-short2: 120ms;
  --md-sys-motion-duration-short4: 200ms;
  --md-sys-motion-duration-medium2: 300ms;
  --md-sys-motion-duration-medium4: 400ms;
  --md-sys-motion-duration-long2: 500ms;

  /* --- 排版（Google Sans / Roboto Flex 风格表达性比例） --- */
  --md-sys-typescale-font: "Google Sans", "Roboto Flex", "Roboto", -apple-system,
    BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --md-sys-typescale-display-large: 800 3.25rem/3.75rem var(--md-sys-typescale-font);
  --md-sys-typescale-display-medium: 800 2.75rem/3.25rem var(--md-sys-typescale-font);
  --md-sys-typescale-headline-large: 750 2rem/2.5rem var(--md-sys-typescale-font);
  --md-sys-typescale-headline-medium: 700 1.75rem/2.25rem var(--md-sys-typescale-font);
  --md-sys-typescale-headline-small: 700 1.5rem/2rem var(--md-sys-typescale-font);
  --md-sys-typescale-title-large: 650 1.375rem/1.75rem var(--md-sys-typescale-font);
  --md-sys-typescale-title-medium: 600 1rem/1.5rem var(--md-sys-typescale-font);
  --md-sys-typescale-title-small: 600 0.875rem/1.25rem var(--md-sys-typescale-font);
  --md-sys-typescale-body-large: 400 1rem/1.6 var(--md-sys-typescale-font);
  --md-sys-typescale-body-medium: 400 0.875rem/1.55 var(--md-sys-typescale-font);
  --md-sys-typescale-body-small: 400 0.75rem/1.45 var(--md-sys-typescale-font);
  --md-sys-typescale-label-large: 600 0.875rem/1.25rem var(--md-sys-typescale-font);
  --md-sys-typescale-label-medium: 600 0.75rem/1rem var(--md-sys-typescale-font);
  --md-sys-typescale-label-small: 600 0.6875rem/1rem var(--md-sys-typescale-font);

  /* --- 实体与图谱语义色彩 --- */
  --graph-clue: #E0562B;
  --graph-person: #0B72D9;
  --graph-place: #00875A;
  --graph-item: #C77700;
  --graph-event: #D6277E;
  --graph-theory: #5B4BE0;
  --graph-appears: #6F6E79;
  --graph-points: #0B72D9;
  --graph-supports: #00875A;
  --graph-contradicts: #C0392B;
  --graph-related: #7B3FE4;
  --graph-belongs: #5B4BE0;
  --graph-happens: #D6277E;

  /* --- 历史类名别名映射（无缝兼容） --- */
  --bg: var(--md-sys-color-surface);
  --bg-elev: var(--md-sys-color-surface-container-low);
  --bg-elev-2: var(--md-sys-color-surface-container-high);
  --bg-soft: var(--md-sys-color-surface-container-low);
  --bg-inset: var(--md-sys-color-surface-container-highest);
  --border: var(--md-sys-color-outline-variant);
  --border-strong: var(--md-sys-color-outline);
  --border-soft: var(--md-sys-color-surface-container-high);
  --text: var(--md-sys-color-on-surface);
  --text-dim: var(--md-sys-color-on-surface-variant);
  --text-faint: var(--md-sys-color-on-surface-variant-faint);
  --accent: var(--md-sys-color-primary);
  --accent-2: var(--md-sys-color-tertiary);
  --accent-soft: var(--md-sys-color-primary-container);
  --accent-text: var(--md-sys-color-primary);
  --accent-text-hover: var(--md-sys-color-on-primary-container);
  --accent-border: var(--md-sys-color-outline-variant);
  --ok: var(--md-sys-color-tertiary);
  --ok-soft: var(--md-sys-color-tertiary-container);
  --ok-text: var(--md-sys-color-on-tertiary-container);
  --warn: var(--md-sys-color-warning);
  --warn-soft: var(--md-sys-color-warning-container);
  --warn-text: var(--md-sys-color-on-warning-container);
  --danger: var(--md-sys-color-error);
  --danger-soft: var(--md-sys-color-error-container);
  --danger-text: var(--md-sys-color-on-error-container);
  --info: var(--md-sys-color-tertiary);
  --info-soft: var(--md-sys-color-tertiary-container);
  --info-text: var(--md-sys-color-on-tertiary-container);
  --violet: var(--md-sys-color-secondary);
  --violet-soft: var(--md-sys-color-secondary-container);
  --violet-text: var(--md-sys-color-on-secondary-container);
  --radius-s: var(--md-sys-shape-corner-small);
  --radius: var(--md-sys-shape-corner-medium);
  --radius-l: var(--md-sys-shape-corner-large);
  --shadow-s: var(--md-sys-elevation-1);
  --shadow: var(--md-sys-elevation-2);
  --shadow-l: var(--md-sys-elevation-3);
  --header-h: 68px;
  --page-max: 1340px;
}

/* --- MD3 Expressive 深色模式（深邃有层次的暗黑与高亮发光主色） --- */
[data-theme="dark"] {
  color-scheme: dark;

  --md-sys-color-primary: #D0BCFF;
  --md-sys-color-on-primary: #381E72;
  --md-sys-color-primary-container: #4F378B;
  --md-sys-color-on-primary-container: #EADDFF;
  --md-sys-color-primary-fixed: #EADDFF;
  --md-sys-color-on-primary-fixed: #21005D;

  --md-sys-color-secondary: #FFB0D5;
  --md-sys-color-on-secondary: #5E113F;
  --md-sys-color-secondary-container: #7E2657;
  --md-sys-color-on-secondary-container: #FFD8EC;

  --md-sys-color-tertiary: #81D4DA;
  --md-sys-color-on-tertiary: #00373A;
  --md-sys-color-tertiary-container: #004F53;
  --md-sys-color-on-tertiary-container: #9EF0F6;

  --md-sys-color-error: #FFB4AB;
  --md-sys-color-on-error: #690005;
  --md-sys-color-error-container: #93000A;
  --md-sys-color-on-error-container: #FFDAD6;

  --md-sys-color-warning: #FFB95C;
  --md-sys-color-on-warning: #4A2800;
  --md-sys-color-warning-container: #6A3C00;
  --md-sys-color-on-warning-container: #FFDCBE;

  --md-sys-color-surface: #141218;
  --md-sys-color-on-surface: #E6E1E5;
  --md-sys-color-surface-dim: #141218;
  --md-sys-color-surface-bright: #3B383E;
  --md-sys-color-surface-container-lowest: #0F0D13;
  --md-sys-color-surface-container-low: #1D1B20;
  --md-sys-color-surface-container: #211F26;
  --md-sys-color-surface-container-high: #2B2930;
  --md-sys-color-surface-container-highest: #36343B;

  --md-sys-color-on-surface-variant: #CAC4D0;
  --md-sys-color-on-surface-variant-faint: #938F99;
  --md-sys-color-outline: #938F99;
  --md-sys-color-outline-variant: #49454F;
  --md-sys-color-outline-subtle: rgba(147, 143, 153, 0.25);

  --md-sys-color-inverse-surface: #E6E1E5;
  --md-sys-color-inverse-on-surface: #313033;
  --md-sys-color-inverse-primary: #5B4BE0;

  --graph-clue: #FF9A72;
  --graph-person: #7FB8FF;
  --graph-place: #57D9A3;
  --graph-item: #FFB95C;
  --graph-event: #FF8FC0;
  --graph-theory: #D0BCFF;
  --graph-appears: #938F99;
  --graph-points: #7FB8FF;
  --graph-supports: #57D9A3;
  --graph-contradicts: #FFB4AB;
  --graph-related: #C4AEF5;
  --graph-belongs: #D0BCFF;
  --graph-happens: #FF8FC0;

  --md-sys-elevation-1: 0 1px 3px 1px rgba(0, 0, 0, 0.35), 0 1px 2px 0 rgba(0, 0, 0, 0.45);
  --md-sys-elevation-2: 0 2px 6px 2px rgba(0, 0, 0, 0.40), 0 1px 2px 0 rgba(0, 0, 0, 0.50);
  --md-sys-elevation-3: 0 4px 12px 3px rgba(0, 0, 0, 0.45), 0 1px 3px 0 rgba(0, 0, 0, 0.55);
  --md-sys-elevation-4: 0 8px 24px 6px rgba(0, 0, 0, 0.50), 0 2px 4px 0 rgba(0, 0, 0, 0.60);
}

/* ---------- 2. 基础重置与全局排版 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  font: 400 0.9375rem/1.6 var(--md-sys-typescale-font);
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard),
              color var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

h1, h2, h3, h4, h5 {
  margin: 0 0 0.45em;
  color: var(--md-sys-color-on-surface);
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.25;
}
h1 { font: var(--md-sys-typescale-headline-large); letter-spacing: -0.025em; }
h2 { font: var(--md-sys-typescale-headline-medium); }
h3 { font: var(--md-sys-typescale-title-large); }
h4 { font: var(--md-sys-typescale-title-medium); }
h5 { font: var(--md-sys-typescale-title-small); }
p  { margin: 0 0 1em; line-height: 1.65; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
  transition: color var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard),
              opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}
a:hover {
  color: var(--md-sys-color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

img { max-width: 100%; display: block; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
li { margin-bottom: 0.35em; }

code, pre, .mono {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.86em;
  font-variant-numeric: tabular-nums;
}
hr { border: 0; border-top: 1px solid var(--md-sys-color-outline-variant); margin: 20px 0; }

::selection {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

/* MD3E 聚焦与无障碍体系 */
:focus { outline: none; }
:focus-visible {
  outline: 2.5px solid var(--md-sys-color-primary);
  outline-offset: 2.5px;
  border-radius: var(--md-sys-shape-corner-small);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-full);
  border: 2px solid var(--md-sys-color-surface);
}
::-webkit-scrollbar-thumb:hover { background: var(--md-sys-color-outline); }

/* ---------- 3. 布局骨架 ---------- */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 24px 28px 84px;
  animation: page-in var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized-decelerate) both;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

body.has-fab .page { padding-bottom: 140px; }
.page-narrow { max-width: 760px; }
.page-mid { max-width: 1040px; }

.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-s { display: flex; flex-direction: column; gap: 12px; }
.stack-l { display: flex; flex-direction: column; gap: 32px; }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.row-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.grow { flex: 1 1 auto; min-width: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid-side-l { grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
.grid-main-side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }

.section { padding-top: 8px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.section-head h2, .section-head h3 { margin: 0; }
.section-sub {
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-body-medium);
  margin-top: 4px;
}

.divider { height: 1px; background: var(--md-sys-color-outline-variant); margin: 6px 0; }
.muted { color: var(--md-sys-color-on-surface-variant); }
.faint { color: var(--md-sys-color-on-surface-variant-faint); }
.small { font: var(--md-sys-typescale-body-medium); }
.tiny { font: var(--md-sys-typescale-body-small); }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.center { text-align: center; }

/* ---------- 4. 顶栏（Top App Bar）/ 子导航 / 移动端底部导航 ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: color-mix(in srgb, var(--md-sys-color-surface) 86%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
  transition: background var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard),
              box-shadow var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard),
              border-color var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}
.app-header.scrolled {
  background: color-mix(in srgb, var(--md-sys-color-surface-container) 92%, transparent);
  box-shadow: var(--md-sys-elevation-2);
}

.app-header-inner {
  height: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* MD3E 品牌标识 */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--md-sys-typescale-font);
  font-weight: 750;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  color: var(--md-sys-color-on-surface);
  flex: 0 0 auto;
  border-radius: var(--md-sys-shape-corner-full);
  padding: 4px 10px 4px 4px;
  transition: background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.brand:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
  text-decoration: none;
  color: var(--md-sys-color-on-surface);
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--md-sys-color-primary) 35%, transparent);
  transition: border-radius var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring),
              transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring);
}
.brand:hover .brand-mark {
  border-radius: var(--md-sys-shape-corner-large);
  transform: rotate(-8deg) scale(1.08);
}
.brand small {
  font-size: 0.65rem;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  line-height: 1.1;
  margin-top: 2px;
}

/* 顶栏导航项目：MD3E 胶囊 */
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a {
  position: relative;
  padding: 8px 16px;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-large);
  transition: color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring);
}
.topnav a:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  transform: translateY(-1px);
}
.topnav a.active {
  color: var(--md-sys-color-on-secondary-container);
  background: var(--md-sys-color-secondary-container);
  font-weight: 700;
}

/* 顶栏全局搜索栏（MD3 Docked Pill） */
.header-search {
  position: relative;
  flex: 1 1 240px;
  max-width: 380px;
  margin-left: auto;
}
.header-search input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 44px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-body-medium);
  transition: background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.header-search input:hover {
  background: var(--md-sys-color-surface-container-highest);
  border-color: var(--md-sys-color-outline);
}
.header-search input:focus {
  background: var(--md-sys-color-surface-container-lowest);
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) 20%, transparent);
}
.header-search input::placeholder { color: var(--md-sys-color-on-surface-variant); }
.header-search .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--md-sys-color-on-surface-variant); pointer-events: none; display: flex;
}
.header-search kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 0.6875rem; color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant); border-radius: var(--md-sys-shape-corner-extra-small);
  padding: 1px 7px; background: var(--md-sys-color-surface-container-low);
  font-family: inherit;
  font-weight: 600;
}

/* 顶栏快速角色切换胶囊（MD3E Role Switcher Pill） */
.role-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px 0 12px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-label-medium);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.role-pill-btn:hover {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
  transform: translateY(-1px);
}
.role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px var(--md-sys-color-surface);
}
.role-dot.creator { background: var(--md-sys-color-secondary); }
.role-dot.collaborator { background: var(--md-sys-color-tertiary); }
.role-dot.member { background: var(--md-sys-color-primary); }
.role-dot.visitor { background: var(--md-sys-color-outline); }
.role-pill-caret { font-size: 0.75rem; opacity: 0.7; }

/* 图标按钮：MD3 Icon Button */
.icon-btn {
  width: 40px; height: 40px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 0;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  display: grid; place-items: center;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
  transition: background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring);
}
.icon-btn:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 9%, transparent);
  color: var(--md-sys-color-on-surface);
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn.filled { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.icon-btn.tonal { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.icon-btn.outlined { border: 1px solid var(--md-sys-color-outline-variant); }
.icon-btn.has-dot::after {
  content: ""; position: absolute; top: 7px; right: 8px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--md-sys-color-error);
  border: 2px solid var(--md-sys-color-surface);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* 头像：MD3 Avatar */
.avatar {
  width: 38px; height: 38px;
  border-radius: var(--md-sys-shape-corner-full);
  display: grid; place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap; overflow: hidden;
  color: #FFFFFF;
  background: var(--md-sys-color-primary);
  flex: 0 0 auto;
  user-select: none;
  cursor: pointer;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent);
  transition: transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring),
              box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.avatar:hover { transform: scale(1.08); box-shadow: var(--md-sys-elevation-2); }
.avatar.lg { width: 72px; height: 72px; font-size: 1.35rem; }
.avatar.sm { width: 28px; height: 28px; font-size: 0.65rem; cursor: default; box-shadow: none; }
.avatar.sm:hover { transform: none; box-shadow: none; }
.avatar.anon { background: var(--md-sys-color-surface-container-highest); color: var(--md-sys-color-on-surface-variant); }

/* 下拉菜单：MD3 Menu */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 240px;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  box-shadow: var(--md-sys-elevation-3);
  padding: 8px;
  z-index: 100;
  display: none;
  transform-origin: top right;
  animation: menu-in var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized-decelerate);
}
.dropdown.open .dropdown-menu { display: block; }
@keyframes menu-in {
  from { opacity: 0; transform: scale(0.92) translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 10px 14px;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-body-medium);
  background: none; border: 0; cursor: pointer;
  transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard),
              color var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}
.dropdown-menu a:hover, .dropdown-menu button:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 9%, transparent);
  text-decoration: none;
}
.dropdown-menu hr { margin: 6px 8px; border-top-color: var(--md-sys-color-outline-variant); }
.dropdown-head { padding: 10px 14px; border-bottom: 1px solid var(--md-sys-color-outline-variant); margin-bottom: 6px; }
.role-quick-dropdown { position: relative; }
.role-menu, .notif-menu { max-height: 480px; overflow-y: auto; }
.user-menu { min-width: 260px; }
.theme-toggle-btn { flex: 0 0 auto; }

/* 演示环境提示条 */
.demo-ribbon {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font: var(--md-sys-typescale-label-medium);
  text-align: center;
  padding: 8px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent);
}
.demo-ribbon a { color: inherit; font-weight: 700; text-decoration: underline; margin-left: 4px; }

/* 项目二级导航（MD3E Primary Pill Tabs） */
.project-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  background: color-mix(in srgb, var(--md-sys-color-surface) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  transition: background var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}
.project-nav.scrolled {
  background: color-mix(in srgb, var(--md-sys-color-surface-container) 95%, transparent);
  box-shadow: var(--md-sys-elevation-1);
}
.project-nav-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 58px;
  overflow-x: auto;
  scrollbar-width: none;
}
.project-nav-inner::-webkit-scrollbar { display: none; }
.pnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--md-sys-color-on-surface);
  flex: 0 0 auto;
}
.pnav-brand:hover { text-decoration: none; }
.pnav-emoji {
  width: 32px; height: 32px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-high);
  display: grid; place-items: center;
  font-size: 1.1rem;
}
.pnav-title {
  font: var(--md-sys-typescale-title-medium);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 200px;
}
.pnav-status { flex: 0 0 auto; }
.pnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
}
.pnav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-large);
  white-space: nowrap;
  transition: color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring);
}
.pnav-tab:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  transform: translateY(-1px);
}
.pnav-tab.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 700;
}
.pnav-count {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 0.6875rem;
  background: color-mix(in srgb, currentColor 18%, transparent);
}
.pnav-actions { flex: 0 0 auto; }

/* 移动端底部导航栏（Navigation Bar） */
.nav-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  height: 80px;
  display: none;
  align-items: stretch;
  background: var(--md-sys-color-surface-container);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: var(--md-sys-elevation-2);
}
.nav-bar a {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-medium);
  position: relative;
  transition: color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.nav-bar a .nav-icon {
  width: 64px; height: 32px;
  border-radius: var(--md-sys-shape-corner-full);
  display: grid; place-items: center;
  transition: background var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized),
              color var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized);
}
.nav-bar a.active { color: var(--md-sys-color-on-surface); font-weight: 700; }
.nav-bar a.active .nav-icon {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

/* ---------- 5. 按钮系统 ---------- */
button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  cursor: pointer;
}

/* 原生未指定 class 的 button 基础样式回退，避免任何浏览器默认灰底立体框 */
:where(button:not([class])) {
  height: 38px;
  padding: 0 18px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-label-large);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
:where(button:not([class])):hover {
  background: var(--md-sys-color-surface-container-highest);
  border-color: var(--md-sys-color-outline);
  transform: translateY(-1px);
}
:where(button:not([class])):active { transform: scale(0.97); }

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 22px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-label-large);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: border-radius var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring),
              transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  background: var(--md-sys-color-surface-container-highest);
  border-color: var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface);
}
.btn:active { transform: scale(0.96); }
.btn[disabled], .btn.disabled { opacity: 0.38; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 90%, #FFFFFF);
  color: var(--md-sys-color-on-primary);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--md-sys-color-primary) 40%, transparent);
}
.btn-tonal {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.btn-tonal:hover {
  background: color-mix(in srgb, var(--md-sys-color-secondary-container) 88%, var(--md-sys-color-secondary));
}
.btn-outline {
  border: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-primary);
  background: transparent;
}
.btn-outline:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 9%, transparent);
  border-color: var(--md-sys-color-primary);
}
.btn-elevated {
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-primary);
  box-shadow: var(--md-sys-elevation-1);
}
.btn-elevated:hover {
  background: var(--md-sys-color-surface-container-high);
  box-shadow: var(--md-sys-elevation-2);
}
.btn-ghost { border-color: transparent; background: transparent; color: var(--md-sys-color-on-surface-variant); }
.btn-ghost:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
  color: var(--md-sys-color-on-surface);
  border-color: transparent;
}
.btn-danger {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  border-color: transparent;
}
.btn-danger:hover {
  background: color-mix(in srgb, var(--md-sys-color-error-container) 85%, var(--md-sys-color-error));
  border-color: transparent;
}
.btn-ok {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  border-color: transparent;
}
.btn-ok:hover {
  background: color-mix(in srgb, var(--md-sys-color-tertiary-container) 85%, var(--md-sys-color-tertiary));
  border-color: transparent;
}
.btn-sm { height: 34px; padding: 0 16px; font: var(--md-sys-typescale-label-medium); }
.btn-xs { height: 28px; padding: 0 12px; font: var(--md-sys-typescale-label-medium); gap: 4px; }
.btn-lg { height: 48px; padding: 0 32px; font: var(--md-sys-typescale-label-large); font-size: 1rem; }
.btn-block { width: 100%; }

.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--md-sys-color-primary);
  cursor: pointer; font: inherit;
  border-radius: var(--md-sys-shape-corner-extra-small);
  display: inline-flex; align-items: center; gap: 4px;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn.danger { color: var(--md-sys-color-error); }

/* 分页 Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.pagination button {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-large);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring);
}
.pagination button:hover {
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface);
  transform: translateY(-1px);
}
.pagination button.active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-color: var(--md-sys-color-primary);
  font-weight: 700;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--md-sys-color-primary) 35%, transparent);
}
.pagination button[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

/* MD3E Extended FAB */
.fab {
  height: 56px;
  min-width: 56px;
  padding: 0 22px;
  border-radius: var(--md-sys-shape-corner-large);
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font: var(--md-sys-typescale-label-large);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--md-sys-elevation-3);
  transition: border-radius var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring),
              transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring),
              box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.fab:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--md-sys-elevation-4);
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: color-mix(in srgb, var(--md-sys-color-primary-container) 92%, var(--md-sys-color-primary));
}
.fab:active { transform: scale(0.95); }
.fab-menu-host { position: fixed; right: 28px; bottom: 28px; z-index: 56; }
.fab-menu-list {
  position: absolute;
  right: 0; bottom: calc(100% + 14px);
  display: flex; flex-direction: column; gap: 8px;
  min-width: 220px;
  padding: 10px;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  box-shadow: var(--md-sys-elevation-3);
  opacity: 0;
  transform: translateY(18px) scale(0.88);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring);
}
.fab-menu-list.open { opacity: 1; transform: none; pointer-events: auto; }
.fab-menu-list a, .fab-menu-list button {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 10px 14px;
  border: 0; background: none;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-body-medium);
  cursor: pointer;
  transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}
.fab-menu-list a:hover, .fab-menu-list button:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 9%, transparent);
  text-decoration: none;
}
.fab-scrim {
  position: fixed; inset: 0; z-index: 54;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}
.fab-scrim.open { opacity: 1; pointer-events: auto; }

/* 按钮组（MD3E Segmented Button Group） */
.segmented {
  display: inline-flex;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-full);
  overflow: hidden;
  background: var(--md-sys-color-surface-container-low);
  padding: 2px;
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-large);
  padding: 0 16px;
  height: 34px;
  border-radius: var(--md-sys-shape-corner-full);
  cursor: pointer;
  position: relative;
  transition: background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-spring);
}
.segmented button:hover {
  color: var(--md-sys-color-on-surface);
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}
.segmented button.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 700;
  box-shadow: var(--md-sys-elevation-1);
}

/* ---------- 6. 表单控件 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 18px; }
.label { font: var(--md-sys-typescale-label-large); color: var(--md-sys-color-on-surface); }
.label .req { color: var(--md-sys-color-error); margin-left: 4px; }
.hint { font: var(--md-sys-typescale-body-small); color: var(--md-sys-color-on-surface-variant); line-height: 1.5; }
.hint.warn { color: var(--md-sys-color-on-warning-container); background: var(--md-sys-color-warning-container); padding: 6px 10px; border-radius: var(--md-sys-shape-corner-small); }
.hint.danger { color: var(--md-sys-color-error); }
.hint.ok { color: var(--md-sys-color-tertiary); }

/* Filled / Outlined Text Fields */
.input, .textarea, .select,
:where(select:not([class])),
:where(textarea:not([class])),
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([class])) {
  width: 100%;
  border-radius: var(--md-sys-shape-corner-medium) var(--md-sys-shape-corner-medium) var(--md-sys-shape-corner-extra-small) var(--md-sys-shape-corner-extra-small);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-bottom: 2px solid var(--md-sys-color-outline);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-body-large);
  padding: 12px 16px;
  transition: border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.input, :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([class])) { height: 50px; padding: 0 16px; }
.textarea, :where(textarea:not([class])) { min-height: 110px; resize: vertical; line-height: 1.6; }
.select, :where(select:not([class])) {
  height: 50px;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2379747E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}
.input:hover, .textarea:hover, .select:hover {
  background: var(--md-sys-color-surface-container-highest);
  border-bottom-color: var(--md-sys-color-on-surface);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-bottom: 2px solid var(--md-sys-color-primary);
  background: var(--md-sys-color-surface-container-lowest);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--md-sys-color-primary) 15%, transparent);
}
.input::placeholder, .textarea::placeholder { color: var(--md-sys-color-on-surface-variant); opacity: 0.75; }
.input.invalid, .textarea.invalid {
  border-bottom: 2px solid var(--md-sys-color-error);
  animation: shake 0.3s ease-in-out;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.input-group { position: relative; display: flex; align-items: center; }
.input-group .icon { position: absolute; left: 16px; color: var(--md-sys-color-on-surface-variant); display: flex; pointer-events: none; }
.input-group .input { padding-left: 44px; }
.input-group .suffix { position: absolute; right: 14px; color: var(--md-sys-color-on-surface-variant); font-size: 0.8rem; }

.checkbox, .radio {
  display: flex; align-items: flex-start; gap: 12px;
  cursor: pointer; font: var(--md-sys-typescale-body-medium);
  color: var(--md-sys-color-on-surface); padding: 6px 0;
}
.checkbox input, .radio input {
  margin: 2px 0 0; accent-color: var(--md-sys-color-primary);
  width: 18px; height: 18px; flex: 0 0 auto;
}

/* MD3 Switch */
.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 14px 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row .sw-text strong { display: block; font: var(--md-sys-typescale-body-large); font-weight: 600; }
.switch-row .sw-text span { font: var(--md-sys-typescale-body-small); color: var(--md-sys-color-on-surface-variant); }
.switch {
  position: relative; width: 52px; height: 32px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-highest);
  border: 2px solid var(--md-sys-color-outline);
  cursor: pointer; flex: 0 0 auto;
  transition: background var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized),
              border-color var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized);
  padding: 0;
}
.switch::after {
  content: "";
  position: absolute; top: 50%; left: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--md-sys-color-outline);
  transform: translateY(-50%);
  transition: transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring),
              width var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              height var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.switch:active::after { width: 22px; height: 22px; }
.switch[aria-checked="true"] { background: var(--md-sys-color-primary); border-color: var(--md-sys-color-primary); }
.switch[aria-checked="true"]::after { transform: translate(20px, -50%); background: var(--md-sys-color-on-primary); width: 20px; height: 20px; }

.radio-cards { display: grid; gap: 10px; }
.radio-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 18px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-low);
  cursor: pointer;
  transition: border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring);
}
.radio-card:hover {
  border-color: var(--md-sys-color-outline);
  background: var(--md-sys-color-surface-container);
  transform: translateY(-1px);
}
.radio-card input { margin-top: 4px; accent-color: var(--md-sys-color-primary); }
.radio-card strong { display: block; font: var(--md-sys-typescale-body-large); font-weight: 600; }
.radio-card span { font: var(--md-sys-typescale-body-small); color: var(--md-sys-color-on-surface-variant); }
.radio-card.selected {
  border-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.radio-card.selected strong { color: var(--md-sys-color-on-secondary-container); }
.radio-card.selected span { color: color-mix(in srgb, var(--md-sys-color-on-secondary-container) 80%, transparent); }

/* 文件拖拽区 Dropzone */
.dropzone {
  border: 2px dashed var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 32px 24px;
  text-align: center;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container-low);
  cursor: pointer;
  transition: border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  transform: scale(1.01);
}
.dropzone strong { display: block; color: var(--md-sys-color-on-surface); margin-bottom: 4px; font: var(--md-sys-typescale-title-small); }
.dropzone small { font: var(--md-sys-typescale-body-small); color: var(--md-sys-color-on-surface-variant); }

.file-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-low);
  font: var(--md-sys-typescale-body-medium);
}
.file-item .fi-name { flex: 1 1 auto; min-width: 0; }
.file-item .fi-meta { color: var(--md-sys-color-on-surface-variant); font: var(--md-sys-typescale-body-small); }

/* ---------- 7. 卡片、徽章与元数据系统 ---------- */
.card {
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  overflow: hidden;
  transition: border-radius var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring),
              background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring);
}
.card-pad { padding: 22px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 22px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  flex-wrap: wrap;
}
.card-head h3, .card-head h4 { margin: 0; font: var(--md-sys-typescale-title-medium); }
.card-body { padding: 22px; }
.card-body.tight { padding: 14px 16px; }
.card-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.card-hover:hover {
  background: var(--md-sys-color-surface-container);
  border-color: var(--md-sys-color-primary-container);
  box-shadow: var(--md-sys-elevation-2);
  transform: translateY(-4px);
  border-radius: 22px;
}
.card-outlined { background: transparent; border: 1px solid var(--md-sys-color-outline-variant); }
.card-filled { background: var(--md-sys-color-surface-container-high); border: 0; }

/* 徽章：MD3 Assist Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  font: var(--md-sys-typescale-label-medium);
  font-weight: 600;
  border: 0;
  white-space: nowrap;
  line-height: 1.5;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending { color: var(--md-sys-color-on-warning-container); background: var(--md-sys-color-warning-container); }
.badge-verified { color: var(--md-sys-color-on-tertiary-container); background: var(--md-sys-color-tertiary-container); }
.badge-key { color: var(--md-sys-color-on-secondary-container); background: var(--md-sys-color-secondary-container); }
.badge-redherring { color: var(--md-sys-color-on-error-container); background: var(--md-sys-color-error-container); }
.badge-withdrawn { color: var(--md-sys-color-on-surface-variant); background: var(--md-sys-color-surface-container-highest); }
.badge-info { color: var(--md-sys-color-on-tertiary-container); background: var(--md-sys-color-tertiary-container); }
.badge-neutral { color: var(--md-sys-color-on-surface-variant); background: var(--md-sys-color-surface-container-highest); }
.badge-accent { color: var(--md-sys-color-on-primary-container); background: var(--md-sys-color-primary-container); }
.badge-ok { color: var(--md-sys-color-on-tertiary-container); background: var(--md-sys-color-tertiary-container); }
.badge-violet { color: var(--md-sys-color-on-secondary-container); background: var(--md-sys-color-secondary-container); }
.badge-solid-pending { background: var(--md-sys-color-warning); color: var(--md-sys-color-on-warning); }
.badge-solid-verified { background: var(--md-sys-color-tertiary); color: var(--md-sys-color-on-tertiary); }
.badge-solid-key { background: var(--md-sys-color-secondary); color: var(--md-sys-color-on-secondary); }
.badge-status { padding: 4px 14px; }
.st-progress { color: var(--md-sys-color-on-tertiary-container); background: var(--md-sys-color-tertiary-container); }
.st-paused { color: var(--md-sys-color-on-warning-container); background: var(--md-sys-color-warning-container); }
.st-solved { color: var(--md-sys-color-on-secondary-container); background: var(--md-sys-color-secondary-container); }
.st-draft { color: var(--md-sys-color-on-surface-variant); background: var(--md-sys-color-surface-container-highest); }

/* 标签 Tags */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 12px;
  border-radius: var(--md-sys-shape-corner-small);
  font: var(--md-sys-typescale-label-medium);
  background: var(--md-sys-color-surface-container-highest);
  border: 1px solid var(--md-sys-color-outline-subtle);
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard),
              color var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-spring);
}
.tag:hover {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  text-decoration: none;
  transform: translateY(-1px);
}
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-accent {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 40%, transparent);
}
.tag-violet {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: color-mix(in srgb, var(--md-sys-color-secondary) 40%, transparent);
}
.tag-info {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  border-color: color-mix(in srgb, var(--md-sys-color-tertiary) 40%, transparent);
}
.tag-ok {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  border-color: color-mix(in srgb, var(--md-sys-color-tertiary) 40%, transparent);
}

/* Filter Chips（MD3E 核心） */
.chip-filter {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px;
  padding: 0 16px;
  border-radius: var(--md-sys-shape-corner-small);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-large);
  cursor: pointer;
  transition: background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring);
}
.chip-filter:hover {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border-color: var(--md-sys-color-outline);
}
.chip-filter:active { transform: scale(0.96); }
.chip-filter.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.chip-filter .count {
  font: var(--md-sys-typescale-label-medium);
  color: inherit;
  opacity: 0.75;
  background: color-mix(in srgb, currentColor 14%, transparent);
  padding: 0 6px;
  border-radius: 9999px;
}

.chip-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px dashed var(--md-sys-color-outline);
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-medium);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring);
}
.chip-more:hover {
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-primary);
  transform: translateY(-1px);
}
.chip-more:active { transform: scale(0.96); }

/* 移动端可折叠筛选面板 (Filter Fold & Bottom Sheet Mode) */
.filter-extra-head { display: none; align-items: center; justify-content: space-between; gap: 10px; }
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 12px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-label-large);
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring);
}
.filter-toggle:hover {
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-outline);
  transform: translateY(-1px);
}
.ft-count[hidden] { display: none; }
.ft-label { font-weight: 600; }
.ft-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font: var(--md-sys-typescale-label-small);
  font-weight: 700;
}
.ft-chev {
  display: inline-flex;
  transition: transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized);
}
.filter-toggle[aria-expanded="false"] .ft-chev { transform: rotate(-90deg); }
@media (max-width: 760px) {
  .filter-extra-head { display: flex; }
  .filter-extra { overflow: hidden; }
  .filter-extra.collapsed { display: none; }
}
@media (max-width: 640px) {
  .filter-card.is-sheet-mode .filter-extra-head { margin-top: 2px; }
  .filter-card.is-sheet-mode #filterExtra { display: none; }
  .sheet-body .filter-extra { display: flex; flex-direction: column; gap: 14px; overflow: visible; }
  .sheet-body .filter-extra .row { flex-wrap: wrap; }
  .sheet-body .filter-extra .row > .small { width: 100%; }
}

/* 项目卡片 Project Card */
.project-card {
  display: flex; flex-direction: column; height: 100%;
  cursor: pointer;
}
.project-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--md-sys-color-surface-container-highest);
  overflow: hidden;
}
.cover-fallback {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 2.4rem; font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.cover-badge { position: absolute; top: 12px; left: 12px; }
.cover-actions {
  position: absolute; top: 10px; right: 10px;
  display: flex; gap: 6px;
  transition: opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.cover-actions .icon-btn {
  width: 36px; height: 36px;
  background: rgba(12, 16, 21, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
}
.cover-actions .icon-btn:hover { background: rgba(12, 16, 21, 0.85); transform: scale(1.1); }
.project-card-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-card-title { font: var(--md-sys-typescale-title-large); margin: 0; }
.project-card-title a { color: var(--md-sys-color-on-surface); }
.project-card-title a:hover { color: var(--md-sys-color-primary); text-decoration: none; }
.project-card-meta {
  display: flex; align-items: center; gap: 14px;
  font: var(--md-sys-typescale-body-small);
  color: var(--md-sys-color-on-surface-variant);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  padding-top: 12px; margin-top: auto;
}

/* 线索卡片 Clue Card */
.clue-card {
  display: flex; flex-direction: column; gap: 12px; padding: 18px 20px;
  cursor: pointer;
}
.clue-card-top { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.clue-code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
  border-radius: var(--md-sys-shape-corner-full);
  padding: 3px 10px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}
.clue-code:hover {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  transform: translateY(-1px);
}
.clue-title { font: var(--md-sys-typescale-title-medium); margin: 0; }
.clue-title a { color: var(--md-sys-color-on-surface); }
.clue-title a:hover { color: var(--md-sys-color-primary); text-decoration: none; }
.clue-thumb {
  width: 100%; aspect-ratio: 16 / 7.5;
  border-radius: var(--md-sys-shape-corner-medium);
  overflow: hidden;
  background: var(--md-sys-color-surface-container-highest);
  position: relative;
  display: grid;
  place-items: center;
}
.clue-thumb img { width: 100%; height: 100%; object-fit: cover; }
.clue-thumb-icon { color: var(--md-sys-color-on-surface-variant); opacity: 0.45; }
.clue-thumb-name {
  position: absolute; right: 10px; bottom: 9px;
  font: var(--md-sys-typescale-label-small);
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container-low);
  padding: 2px 10px;
  border-radius: var(--md-sys-shape-corner-full);
  max-width: 60%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.media-tag {
  position: absolute; bottom: 8px; left: 8px;
  font: var(--md-sys-typescale-label-medium);
  padding: 3px 10px;
  border-radius: var(--md-sys-shape-corner-full);
  background: rgba(10, 13, 17, 0.75);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: inline-flex; gap: 6px; align-items: center;
}
.clue-meta { display: flex; align-items: center; gap: 12px; font: var(--md-sys-typescale-body-small); color: var(--md-sys-color-on-surface-variant); flex-wrap: wrap; }
.clue-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.clue-like-btn {
  background: none; border: 0;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-body-small);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px; border-radius: 9999px;
  transition: all var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}
.clue-like-btn:hover, .clue-like-btn.liked {
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
}

/* 表格视图 Table View */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--md-sys-shape-corner-large);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-low);
}
.table { width: 100%; border-collapse: collapse; font: var(--md-sys-typescale-body-medium); }
.table th {
  text-align: left; padding: 14px 18px;
  font: var(--md-sys-typescale-label-medium);
  color: var(--md-sys-color-on-surface-variant);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
  white-space: nowrap;
}
.table td { padding: 16px 18px; border-bottom: 1px solid var(--md-sys-color-outline-variant); vertical-align: middle; }
.table tbody tr { transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard); }
.table tbody tr:hover { background: var(--md-sys-color-surface-container); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { font-variant-numeric: tabular-nums; }

/* 统计卡片与指标网格 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stat {
  padding: 18px 20px;
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  transition: background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              border-radius var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring),
              transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring);
}
.stat:hover {
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-extra-large);
  transform: translateY(-2px);
}
.stat .stat-num { font-size: 1.85rem; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -0.025em; }
.stat .stat-label { font: var(--md-sys-typescale-body-small); color: var(--md-sys-color-on-surface-variant); margin-top: 4px; }
.stat.accent .stat-num { color: var(--md-sys-color-primary); }
.stat.ok .stat-num { color: var(--md-sys-color-tertiary); }
.stat.violet .stat-num { color: var(--md-sys-color-secondary); }
.stat.info .stat-num { color: var(--md-sys-color-tertiary); }

/* 元数据键值表 (Key-Value Metadata Table) */
.kv {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px 14px;
  margin: 0;
  font: var(--md-sys-typescale-body-medium);
}
.kv dt {
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
}
.kv dd {
  margin: 0;
  color: var(--md-sys-color-on-surface);
  word-break: break-word;
}

/* 列表行 List Row */
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--md-sys-shape-corner-medium);
  transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
  text-decoration: none;
  color: inherit;
}
.list-row:hover {
  background: var(--md-sys-color-surface-container);
  text-decoration: none;
}

/* 故事内设定说明 (In-World Lore Note) */
.in-world-note {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-high);
  border: 1px dashed var(--md-sys-color-outline-variant);
  font: var(--md-sys-typescale-body-medium);
  color: var(--md-sys-color-on-surface);
  align-items: flex-start;
}

/* 公告系统 Announcements */
.announcement {
  padding: 18px 20px;
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-left: 4px solid var(--md-sys-color-primary);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring),
              box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.announcement:hover {
  transform: translateY(-2px);
  box-shadow: var(--md-sys-elevation-2);
}
.announcement.pinned {
  background: color-mix(in srgb, var(--md-sys-color-secondary-container) 35%, var(--md-sys-color-surface-container-low));
  border-color: color-mix(in srgb, var(--md-sys-color-secondary) 50%, transparent);
  border-left: 4px solid var(--md-sys-color-secondary);
}
.a-title {
  font: var(--md-sys-typescale-title-medium);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--md-sys-color-on-surface);
}
.a-body {
  font: var(--md-sys-typescale-body-medium);
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.65;
}

/* 社区投票进度条 Vote Bar */
.vote-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.vote-track {
  flex: 1;
  height: 8px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-highest);
  overflow: hidden;
}
.vote-fill {
  height: 100%;
  border-radius: var(--md-sys-shape-corner-full);
  background: linear-gradient(90deg, var(--md-sys-color-primary), var(--md-sys-color-secondary));
  transition: width var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized);
}

/* 引用胶囊 Quote Ref Pills */
.quote-ref {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--md-sys-shape-corner-small);
  font: var(--md-sys-typescale-label-medium);
  font-family: "JetBrains Mono", Consolas, monospace;
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  font-weight: 600;
  text-decoration: none;
}
.quote-ref:hover {
  text-decoration: none;
  background: var(--md-sys-color-tertiary);
  color: var(--md-sys-color-on-tertiary);
}
.quote-ref.theory {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.quote-ref.theory:hover {
  background: var(--md-sys-color-secondary);
  color: var(--md-sys-color-on-secondary);
}
.quote-ref.tip {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

/* ---------- 8. 时间线 / 推理树 / 标签页 ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a {
  position: relative;
  border: 0;
  background: none;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-large);
  padding: 14px 18px;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.tabs button::after, .tabs a::after {
  content: "";
  position: absolute;
  left: 18px; right: 18px; bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--md-sys-color-primary);
  transform: scaleX(0);
  transition: transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized);
}
.tabs button:hover, .tabs a:hover { color: var(--md-sys-color-on-surface); text-decoration: none; }
.tabs button.active, .tabs a.active { color: var(--md-sys-color-primary); font-weight: 700; }
.tabs button.active::after, .tabs a.active::after { transform: scaleX(1); }

/* 选项卡面板 Tab Panels */
.tab-panel { display: none; }
.tab-panel.active {
  display: block;
  animation: panel-in var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized-decelerate);
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* 时间线 Timeline */
.timeline { position: relative; padding-left: 36px; }
.timeline::before {
  content: ""; position: absolute; left: 12px; top: 10px; bottom: 10px;
  width: 2.5px; border-radius: 2px;
  background: linear-gradient(180deg, var(--md-sys-color-primary), var(--md-sys-color-outline-variant));
}
.tl-item { position: relative; margin-bottom: 24px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -31px; top: 22px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--md-sys-color-surface-container-low);
  border: 3px solid var(--md-sys-color-primary);
  box-shadow: 0 0 0 4px var(--md-sys-color-surface);
  transition: transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring);
}
.tl-item:hover::before { transform: scale(1.3); }
.tl-item.key::before { border-color: var(--md-sys-color-secondary); background: var(--md-sys-color-secondary); }
.tl-item.red::before { border-color: var(--md-sys-color-error); }
.tl-date {
  font: var(--md-sys-typescale-body-small);
  color: var(--md-sys-color-on-surface-variant);
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.tl-kind {
  font: var(--md-sys-typescale-label-medium);
  padding: 1px 8px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
}
.tl-item.dim { opacity: 0.6; }
.tl-item.dim::before { border-color: var(--md-sys-color-outline-variant); }

/* 推理分支树 Tree */
.tree { font: var(--md-sys-typescale-body-medium); }
.tree-node { margin-bottom: 6px; }
.tree-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px;
  border-radius: var(--md-sys-shape-corner-medium);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-low);
  cursor: pointer;
  transition: background var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              border-color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              border-radius var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring),
              transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring);
}
.tree-row:hover {
  background: var(--md-sys-color-surface-container);
  border-color: var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-large);
  transform: translateY(-1px);
}
.tree-row.active {
  background: var(--md-sys-color-secondary-container);
  border-color: transparent;
}
.tree-row.highlighted {
  animation: theory-pulse 2s var(--md-sys-motion-easing-standard) 3;
  background: var(--md-sys-color-primary-container) !important;
  border-color: var(--md-sys-color-primary) !important;
}
@keyframes theory-pulse {
  0%   { box-shadow: 0 0 0 0 var(--md-sys-color-primary); }
  50%  { box-shadow: 0 0 0 10px color-mix(in srgb, var(--md-sys-color-primary) 35%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.tree-toggle {
  width: 28px; height: 28px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  display: grid; place-items: center;
  font-size: 0.85rem; cursor: pointer; flex: 0 0 auto;
  margin-top: 2px; padding: 0;
  transition: all var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}
.tree-toggle:hover {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
}
.tree-toggle.leaf { visibility: hidden; }
.tree-title { font: var(--md-sys-typescale-title-medium); margin: 0; }
.tree-title a { color: var(--md-sys-color-on-surface); }
.tree-title a:hover { color: var(--md-sys-color-primary); text-decoration: none; }
.tree-sub { font: var(--md-sys-typescale-body-small); color: var(--md-sys-color-on-surface-variant); margin-top: 4px; }
.tree-children { margin-left: 22px; padding-left: 20px; border-left: 2px dashed var(--md-sys-color-outline-variant); margin-top: 6px; }
.tree-children.collapsed { display: none; }
.tree-meta { display: flex; align-items: center; gap: 14px; font: var(--md-sys-typescale-body-small); color: var(--md-sys-color-on-surface-variant); flex: 0 0 auto; }
.mini-vote {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font: var(--md-sys-typescale-label-medium);
  white-space: nowrap;
}
.tree-side { display: flex; align-items: flex-start; gap: 8px; flex: 0 0 auto; }
.st-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--md-sys-color-outline);
  background: var(--md-sys-color-surface-container-low);
  flex: 0 0 auto; margin-top: 3px; z-index: 1;
}
.st-dot.done { background: var(--md-sys-color-tertiary); border-color: var(--md-sys-color-tertiary); }
.st-dot.current {
  background: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 4px var(--md-sys-color-primary-container);
}

/* ---------- 9. 知识图谱 / 协作 Wiki / 差异比较 ---------- */
.graph-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.graph-stage {
  position: relative; height: 650px;
  border-radius: var(--md-sys-shape-corner-large);
  overflow: hidden;
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
}
.graph-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.graph-stage canvas.dragging { cursor: grabbing; }
.graph-toolbar {
  position: absolute; top: 14px; left: 14px; right: 14px;
  display: flex; gap: 10px; flex-wrap: wrap; z-index: 5; pointer-events: none;
}
.graph-toolbar > * { pointer-events: auto; }
.graph-legend {
  position: absolute; left: 14px; bottom: 14px;
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--md-sys-color-surface-container-high) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  font: var(--md-sys-typescale-body-small);
  z-index: 5;
}
.graph-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--md-sys-color-on-surface-variant); }
.graph-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.graph-controls { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 5; }
.graph-controls .icon-btn {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.zoom-readout {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-medium);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.graph-tip {
  position: absolute;
  padding: 8px 14px;
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  border-radius: var(--md-sys-shape-corner-small);
  font: var(--md-sys-typescale-body-small);
  pointer-events: none;
  z-index: 10;
  max-width: 260px;
  box-shadow: var(--md-sys-elevation-3);
}
.entity-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px 4px 10px;
  border-radius: var(--md-sys-shape-corner-full);
  font: var(--md-sys-typescale-label-medium);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
}
.entity-chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.wiki-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.wiki-layout > .wiki-right { grid-column: 1 / -1; }
#wikiTocCard.is-collapsed .wiki-tree { display: none; }
#wikiTocCard.is-collapsed .card-foot { display: none; }
#wikiTocCard.is-collapsed .card-head { border-bottom: 0; }
.wiki-tree a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-on-surface-variant);
  transition: all var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}
.wiki-tree a:hover {
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
}
.wiki-tree a.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 700;
}

/* 富文本与 Wiki 编辑器 Editor Shell */
.editor-shell {
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  overflow: hidden;
  background: var(--md-sys-color-surface-container-low);
  display: flex;
  flex-direction: column;
}
.editor-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--md-sys-color-surface-container);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: wrap;
}
.editor-bar::-webkit-scrollbar { display: none; }
.editor-bar .sep {
  width: 1px;
  height: 20px;
  background: var(--md-sys-color-outline-variant);
  margin: 0 4px;
  flex: 0 0 auto;
}
.tool-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--md-sys-shape-corner-small);
  border: 1px solid transparent;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  font: var(--md-sys-typescale-label-medium);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: all var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}
.tool-btn:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 9%, transparent);
  color: var(--md-sys-color-on-surface);
  border-color: var(--md-sys-color-outline-variant);
}
.tool-btn:active { transform: scale(0.95); }
.tool-btn.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
}
.editor-content {
  padding: 24px 28px;
  min-height: 440px;
  font: var(--md-sys-typescale-body-large);
  line-height: 1.75;
  outline: none;
  color: var(--md-sys-color-on-surface);
}
.editor-content:focus { outline: none; }
.editor-content h2 { margin-top: 24px; font: var(--md-sys-typescale-title-large); }
.editor-content table { border-collapse: collapse; width: 100%; margin: 16px 0; font: var(--md-sys-typescale-body-medium); }
.editor-content th, .editor-content td { border: 1px solid var(--md-sys-color-outline-variant); padding: 10px 14px; text-align: left; }
.editor-content th { background: var(--md-sys-color-surface-container-high); font-weight: 600; }
.editor-content pre {
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 14px 16px;
  overflow-x: auto;
}
.editor-content code { color: var(--md-sys-color-primary); font-family: "JetBrains Mono", Consolas, monospace; }
.editor-content blockquote {
  margin: 14px 0;
  padding: 8px 16px;
  border-left: 4px solid var(--md-sys-color-primary);
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container);
  border-radius: 0 var(--md-sys-shape-corner-medium) var(--md-sys-shape-corner-medium) 0;
}
.doc-ref {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--md-sys-shape-corner-small);
  font-size: 0.84em;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-weight: 600;
}

/* 自动保存状态指示器 Save State */
.save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: var(--md-sys-typescale-body-small);
  color: var(--md-sys-color-on-surface-variant);
}
.save-state .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--md-sys-color-outline);
  flex: 0 0 8px;
}
.save-state.saving .dot { background: var(--md-sys-color-primary); animation: dot-pulse 1s infinite; }
.save-state.saved .dot { background: var(--md-sys-color-tertiary); }
.save-state.error .dot { background: var(--md-sys-color-error); }
@keyframes dot-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }

/* 版本差异比对 Diff */
.diff {
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-lowest);
  overflow: hidden;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.6;
}
.diff-line {
  padding: 6px 14px;
  display: flex;
  gap: 10px;
  align-items: baseline;
  white-space: pre-wrap;
  word-break: break-all;
}
.diff-line .sign {
  width: 14px;
  flex: 0 0 14px;
  font-weight: bold;
  user-select: none;
  color: var(--md-sys-color-on-surface-variant);
}
.diff-add {
  background: color-mix(in srgb, var(--md-sys-color-tertiary-container) 40%, transparent);
  color: var(--md-sys-color-on-tertiary-container);
}
.diff-del {
  background: color-mix(in srgb, var(--md-sys-color-error-container) 40%, transparent);
  color: var(--md-sys-color-on-error-container);
}
.diff-ctx { color: var(--md-sys-color-on-surface-variant); }
.diff-head {
  background: var(--md-sys-color-surface-container-high);
  padding: 8px 14px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

/* 附件波形占位预览 */
.media-preview {
  position: relative;
  height: 140px;
  background: var(--md-sys-color-surface-container-high);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.waveform {
  position: absolute;
  inset: 20px 16px;
  display: flex;
  align-items: center;
  gap: 2.5px;
  opacity: 0.55;
}
.waveform i {
  flex: 1 1 auto;
  min-width: 1.5px;
  background: var(--md-sys-color-on-surface-variant);
  border-radius: 9999px;
  animation: wave-breathe 3.2s var(--md-sys-motion-easing-standard) infinite alternate;
}
.media-play {
  position: relative;
  width: 48px; height: 48px;
  border-radius: var(--md-sys-shape-corner-full);
  display: grid; place-items: center;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--md-sys-elevation-2);
  padding-left: 3px;
  cursor: pointer;
  transition: transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring),
              box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.media-preview:hover .media-play {
  transform: scale(1.12);
  box-shadow: var(--md-sys-elevation-3);
}
.media-duration {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font: var(--md-sys-typescale-label-small);
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container-low);
  padding: 2px 8px;
  border-radius: var(--md-sys-shape-corner-full);
}
.media-glyph { color: var(--md-sys-color-on-surface-variant); opacity: 0.55; }
.media-glyph-note {
  position: absolute;
  bottom: 10px;
  font: var(--md-sys-typescale-label-small);
  color: var(--md-sys-color-on-surface-variant);
}
.media-preview.is-video { background: var(--md-sys-color-surface-container-highest); }
.media-preview.is-doc { background: var(--md-sys-color-surface-container-high); }
.media-preview.is-audio { background: color-mix(in srgb, var(--md-sys-color-secondary-container) 45%, var(--md-sys-color-surface-container-high)); }
.media-preview.is-image { background: var(--md-sys-color-surface-container-lowest); }

/* ---------- 10. 模态对话框 / Snackbar / 变形加载器 ---------- */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop.open {
  display: flex;
  animation: scrim-in var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%; max-width: 580px;
  max-height: 88vh; overflow: auto;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: var(--md-sys-elevation-4);
  animation: modal-in var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized-decelerate);
}
.modal.wide { max-width: 900px; }
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.9) translateY(24px); }
  to   { opacity: 1; transform: none; }
}
.modal-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  margin: 24px 28px 0;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 24px 28px 0;
}
.modal-head h3 { margin: 0; font: var(--md-sys-typescale-headline-small); }
.modal-body { padding: 18px 28px 24px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 0 28px 24px;
  flex-wrap: wrap;
}
.modal .notice { margin-top: 14px; }

/* MD3E 带倒计时进度条的 Snackbar */
.toast-host {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%);
  z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
  width: min(540px, calc(100vw - 32px));
}
.toast {
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  box-shadow: var(--md-sys-elevation-3);
  font: var(--md-sys-typescale-body-medium);
  animation: snack-in var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-spring);
  pointer-events: auto;
}
.toast.out { animation: snack-out var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard-accelerate) forwards; }
@keyframes snack-in { from { opacity: 0; transform: translateY(24px) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes snack-out { to { opacity: 0; transform: translateY(16px); } }

.toast::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0; height: 3px;
  background: var(--md-sys-color-inverse-primary);
  width: 100%;
  animation: toast-timer var(--toast-dur, 3200ms) linear forwards;
  transform-origin: left;
}
.toast.paused::after { animation-play-state: paused; }
@keyframes toast-timer {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

.toast .t-icon { flex: 0 0 auto; display: flex; }
.toast.ok .t-icon { color: var(--md-sys-color-tertiary-container); }
.toast.err .t-icon { color: var(--md-sys-color-error); }
.toast.info .t-icon { color: var(--md-sys-color-primary); }
.toast.warn .t-icon { color: var(--md-sys-color-warning); }
.toast .t-action {
  margin-left: auto;
  background: none; border: 0;
  color: var(--md-sys-color-inverse-primary);
  font: var(--md-sys-typescale-label-large);
  cursor: pointer; padding: 4px 10px;
  border-radius: var(--md-sys-shape-corner-extra-small);
}
.toast .t-action:hover { background: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 12%, transparent); }

/* 空状态 */
.empty {
  text-align: center; padding: 56px 24px;
  color: var(--md-sys-color-on-surface-variant);
}
.empty .e-icon {
  font-size: 2.8rem; margin-bottom: 14px; opacity: 0.8;
  display: inline-grid; place-items: center;
  width: 72px; height: 72px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: var(--md-sys-color-surface-container-high);
}
.empty h4 { margin: 0 0 6px; color: var(--md-sys-color-on-surface); font: var(--md-sys-typescale-title-medium); }
.empty p { font: var(--md-sys-typescale-body-medium); max-width: 440px; margin: 0 auto 18px; }

/* 提示条 Notice */
.notice {
  display: flex; gap: 12px; padding: 14px 18px;
  border-radius: var(--md-sys-shape-corner-medium);
  border: 1px solid transparent;
  background: var(--md-sys-color-surface-container-high);
  font: var(--md-sys-typescale-body-medium);
  color: var(--md-sys-color-on-surface);
  align-items: flex-start;
}
.notice.info {
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-tertiary);
  color: var(--md-sys-color-on-surface);
}
.notice.info > span:first-child { color: var(--md-sys-color-tertiary); }
.notice.warn {
  background: color-mix(in srgb, var(--md-sys-color-warning-container) 30%, var(--md-sys-color-surface-container-high));
  border-color: var(--md-sys-color-warning);
  color: var(--md-sys-color-on-surface);
}
.notice.warn > span:first-child { color: var(--md-sys-color-warning); }
.notice.danger {
  background: color-mix(in srgb, var(--md-sys-color-error-container) 35%, var(--md-sys-color-surface-container-high));
  border-color: var(--md-sys-color-error);
  color: var(--md-sys-color-on-surface);
}
.notice.danger > span:first-child { color: var(--md-sys-color-error); }
.notice.ok {
  background: color-mix(in srgb, var(--md-sys-color-tertiary-container) 35%, var(--md-sys-color-surface-container-high));
  border-color: var(--md-sys-color-tertiary);
  color: var(--md-sys-color-on-surface);
}
.notice.ok > span:first-child { color: var(--md-sys-color-tertiary); }
.notice b { color: inherit; }

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--md-sys-color-outline-variant);
  border-top-color: var(--md-sys-color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 骨架屏 & MD3E 变形加载器 */
.skeleton {
  background: linear-gradient(90deg, var(--md-sys-color-surface-container) 25%, var(--md-sys-color-surface-container-highest) 37%, var(--md-sys-color-surface-container) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--md-sys-shape-corner-medium);
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-card { height: 190px; border-radius: var(--md-sys-shape-corner-large); }

.md-loader {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  position: relative;
}
.md-loader::before {
  content: "";
  width: 34px; height: 34px;
  background: var(--md-sys-color-primary);
  border-radius: 50%;
  animation: md-morph 1.6s var(--md-sys-motion-easing-standard) infinite;
}
@keyframes md-morph {
  0%   { border-radius: 50%; transform: scale(0.7) rotate(0deg); }
  25%  { border-radius: 40% 60% 55% 45%; transform: scale(1) rotate(45deg); }
  50%  { border-radius: 12px; transform: scale(0.85) rotate(90deg); }
  75%  { border-radius: 60% 40% 35% 65%; transform: scale(1.05) rotate(135deg); }
  100% { border-radius: 50%; transform: scale(0.7) rotate(180deg); }
}

/* 首页首屏与 Docked Search Bar */
.search-dock {
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  padding: 24px 26px;
  box-shadow: var(--md-sys-elevation-1);
}
.search-dock .input {
  border-radius: var(--md-sys-shape-corner-full);
  height: 54px;
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
}
.search-dock .input:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) 20%, transparent);
}
.hero-title {
  font: var(--md-sys-typescale-display-medium);
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0;
}
.hero-desc {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 660px;
  margin: 0;
  color: var(--md-sys-color-on-surface-variant);
}

/* 评论 Comments */
.comment { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.comment:last-child { border-bottom: 0; }
.comment-main { flex: 1 1 auto; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; font: var(--md-sys-typescale-body-small); margin-bottom: 4px; }
.comment-body { font: var(--md-sys-typescale-body-large); line-height: 1.7; }
.comment-actions { display: flex; gap: 16px; margin-top: 8px; font: var(--md-sys-typescale-label-medium); color: var(--md-sys-color-on-surface-variant); }
.comment-actions button {
  background: none; border: 0; color: inherit; cursor: pointer;
  font: inherit; padding: 4px 8px; border-radius: var(--md-sys-shape-corner-full);
  display: inline-flex; gap: 5px; align-items: center;
  transition: all var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}
.comment-actions button:hover {
  color: var(--md-sys-color-primary);
  background: color-mix(in srgb, var(--md-sys-color-primary) 10%, transparent);
}
.comment-actions button.liked { color: var(--md-sys-color-primary); font-weight: 700; }
.comment.collapsed .collapse-note { display: block; }
.collapse-note {
  display: none;
  font: var(--md-sys-typescale-body-small);
  color: var(--md-sys-color-on-surface-variant);
  font-style: italic;
}
.comment-replies {
  margin-top: 12px;
  padding-left: 18px;
  border-left: 2px solid var(--md-sys-color-outline-variant);
}
.comment-form {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.comment-form .textarea { min-height: 80px; }
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.like-num { font-variant-numeric: tabular-nums; }

/* 涟漪 State Layer Ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.16;
  transform: scale(0);
  pointer-events: none;
  animation: ripple-grow 540ms var(--md-sys-motion-easing-standard) forwards;
}
@keyframes ripple-grow {
  to { transform: scale(1); opacity: 0; }
}

/* Tooltip */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-corner-small);
  font: var(--md-sys-typescale-label-medium);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 120;
  box-shadow: var(--md-sys-elevation-2);
  transition: opacity var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 11. 工具类与响应式布局 ---------- */
.hide { display: none !important; }
.show { display: block !important; }
.text-ok { color: var(--md-sys-color-tertiary); }
.text-warn { color: var(--md-sys-color-warning); }
.text-danger { color: var(--md-sys-color-error); }
.text-info { color: var(--md-sys-color-tertiary); }
.text-accent { color: var(--md-sys-color-primary); }
.bg-soft { background: var(--md-sys-color-surface-container); }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.gap-1 { gap: 6px !important; }
.gap-2 { gap: 12px !important; }
.gap-3 { gap: 20px !important; }
.w-full { width: 100%; }
.text-left { text-align: left !important; }
.sticky-side { position: sticky; top: calc(var(--header-h) + 72px); }
.drawer-toggle { display: none; }
.graph-mobile { display: none; }

.notif-item .grow {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-text {
  font: var(--md-sys-typescale-body-medium);
  line-height: 1.4;
  color: var(--md-sys-color-on-surface);
}
.notif-time {
  font: var(--md-sys-typescale-label-small);
  color: var(--md-sys-color-on-surface-variant);
}

/* 移动端导航抽屉 */
.drawer-scrim {
  position: fixed; inset: 0; z-index: 190;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}
.drawer-scrim.open { opacity: 1; }
body.drawer-open { overflow: hidden; }

.nav-drawer {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: min(340px, 88vw);
  z-index: 195;
  background: var(--md-sys-color-surface-container-low);
  border-radius: 0 var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large) 0;
  border-right: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-sys-elevation-4);
  transform: translateX(-102%);
  transition: transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized-decelerate);
  display: flex; flex-direction: column;
}
.nav-drawer.open { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.drawer-body {
  flex: 1 1 auto; overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 18px;
}
.drawer-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-body-medium);
  font-weight: 600;
  border: 0; background: none; width: 100%; text-align: left; cursor: pointer;
}
.drawer-item:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
  text-decoration: none;
}
.drawer-section { display: flex; flex-direction: column; gap: 4px; }
.drawer-label { font: var(--md-sys-typescale-label-medium); color: var(--md-sys-color-on-surface-variant); padding: 4px 12px; }
.drawer-account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}
.drawer-account:hover {
  text-decoration: none;
  background: var(--md-sys-color-surface-container-highest);
}
.drawer-account .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.drawer-role {
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font: var(--md-sys-typescale-label-small);
  font-weight: 600;
}
.drawer-badge {
  flex: 0 0 auto !important;
  padding: 2px 9px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-small);
}
.drawer-dot {
  flex: 0 0 auto !important;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--md-sys-color-outline);
}
.drawer-dot.on {
  background: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px var(--md-sys-color-primary-container);
}
.drawer-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* MD3 Expressive 步骤指示器 (Stepper) */
.steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring);
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: var(--md-sys-shape-corner-full);
  display: grid;
  place-items: center;
  font: var(--md-sys-typescale-label-large);
  font-weight: 700;
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant);
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring);
}
.step-label {
  font: var(--md-sys-typescale-body-medium);
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  transition: color var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}
.step.active .step-num {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 4px var(--md-sys-color-primary-container);
  transform: scale(1.08);
}
.step.active .step-label {
  color: var(--md-sys-color-on-surface);
  font-weight: 700;
}
.step.done .step-num {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: var(--md-sys-color-outline-variant);
}
.step.done .step-label {
  color: var(--md-sys-color-on-surface-variant);
}
.step-line {
  flex: 1;
  height: 2px;
  background: var(--md-sys-color-outline-variant);
  border-radius: 9999px;
  min-width: 16px;
}
@media (max-width: 640px) {
  .steps { gap: 6px; }
  .step-label { display: none; }
  .step-num { width: 28px; height: 28px; font-size: 0.8rem; }
}

/* 底部抽屉 Bottom Sheet */
body.sheet-open { overflow: hidden; }
.sheet-scrim {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
  pointer-events: none;
}
.sheet-scrim.open { opacity: 1; pointer-events: auto; }
.bottom-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 215;
  max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large) 0 0;
  box-shadow: var(--md-sys-elevation-4);
  transform: translateY(102%);
  transition: transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized-decelerate);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-sheet.open { transform: none; }
.sheet-handle {
  width: 36px; height: 4px; border-radius: 9999px;
  background: var(--md-sys-color-outline-variant);
  margin: 12px auto 6px;
  flex: 0 0 auto;
  cursor: grab;
  touch-action: none;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 16px 8px 24px;
  flex: 0 0 auto;
}
.sheet-head h3 { margin: 0; font: var(--md-sys-typescale-title-large); }
.sheet-body {
  flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 24px 20px;
}
.sheet-foot {
  flex: 0 0 auto; display: flex; gap: 10px; justify-content: flex-end;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

/* 移动端底部操作栏 Mobile Action Bar */
.mobile-action-bar {
  position: fixed; left: 0; right: 0;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  z-index: 68;
  display: none; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--md-sys-color-surface-container);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-sys-elevation-2);
}
.mobile-action-bar .mab-title { display: none; }
.mab-item {
  flex: 1 1 0; min-height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-label-large);
  cursor: pointer;
  position: relative; overflow: hidden;
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-spring);
}
.mab-item.primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-color: var(--md-sys-color-primary);
  font-weight: 700;
}
.mab-item.danger {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  border-color: transparent;
}
.mab-item:active { transform: scale(0.96); }

/* 横向滑动标签栏 Hot Row */
.hot-row {
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.hot-row::-webkit-scrollbar { display: none; }
.hot-row > * { flex: 0 0 auto; scroll-snap-align: start; }

/* 页脚 App Footer */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  padding: 28px 24px 36px;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-body-medium);
  background: var(--md-sys-color-surface-container-lowest);
}
.app-footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex; gap: 16px;
  align-items: center; justify-content: space-between;
  flex-wrap: wrap;
}
.app-footer a { color: var(--md-sys-color-on-surface-variant); }
.app-footer a:hover { color: var(--md-sys-color-primary); }

/* 响应式断点（平板 / 手机） */
@media (max-width: 900px) {
  .page { padding: 18px 16px 110px; }
  .app-header-inner, .project-nav-inner { padding: 0 16px; }
  .grid-side, .grid-main-side, .grid-side-l, .grid-3, .grid-2, .graph-layout, .wiki-layout { grid-template-columns: minmax(0, 1fr); }
  .sticky-side { position: static; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .header-search { display: none; }
  .drawer-toggle { display: inline-flex; }
  .topnav { display: none; }
  .nav-bar { display: flex; }
  .project-cover { aspect-ratio: 16 / 8; }
  .graph-stage { height: 460px; }
  .fab-menu-host { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); right: 16px; }
  .toast-host { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .app-footer { padding-bottom: 116px; }
}

@media (max-width: 640px) {
  :root { --header-h: 58px; }
  .hero-title { font-size: 1.85rem; }
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; }
  .role-pill-btn .role-pill-text { display: none; }
  .role-pill-btn { padding: 0 10px; }
  .stat-grid { grid-template-columns: 1fr; }
  .mobile-action-bar { display: flex; }
  body.has-action-bar .page { padding-bottom: calc(170px + env(safe-area-inset-bottom, 0px)); }
  body.has-action-bar .fab-menu-host { bottom: calc(158px + env(safe-area-inset-bottom, 0px)); }
  body.has-action-bar .toast-host { bottom: calc(158px + env(safe-area-inset-bottom, 0px)); }
  .modal-icon { display: none; }
  .editor-bar { position: sticky; top: var(--header-h); z-index: 6; }
  .table-wrap, .diff-view { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
