/* ==============================================================================
   一人公司 AI 网页工作台 - 核心视觉与全局设计规范
   (One-Person Company Cockpit - Global Styles & Design System)
   遵循 frontend-design 与 web-design-guidelines 规约
   支持：白天/夜晚双主题切换 (Light/Dark Mode) + 极致移动端触控优化
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* --------------------------------------------------------------------------
     暗黑主题 (Dark Mode - 赛博深空与霓虹电青 Cyber Deep Space)
     -------------------------------------------------------------------------- */
  --bg-primary: #050814;           /* 极黑曜石蓝深空底色 */
  --bg-secondary: #090e1f;         /* 控制台面板主底色 */
  --bg-tertiary: #0e172e;          /* 次级悬浮抬升底色 */
  --bg-sidebar: rgba(7, 11, 24, 0.90); /* HUD 全息侧边栏 */
  --bg-card: rgba(12, 19, 36, 0.75); /* 晶体悬浮卡片 */
  --bg-card-hover: rgba(18, 30, 56, 0.88);
  --bg-glass: rgba(9, 14, 28, 0.82);
  --bg-input: rgba(6, 9, 18, 0.92);
  --bg-drawer: #090e1f;

  /* 边框与发光投影 (Cyber Glow & Neon Edges) */
  --border-subtle: rgba(56, 189, 248, 0.12); /* 冷青微晶边缘 */
  --border-focus: rgba(0, 240, 255, 0.65);  /* 量子电青聚焦 */
  --border-glow: rgba(56, 189, 248, 0.35);   /* 激光环绕辉光 */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 1px rgba(56, 189, 248, 0.2);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 20px rgba(56, 189, 248, 0.15);
  --shadow-glow: 0 0 30px rgba(0, 240, 255, 0.25), 0 0 10px rgba(56, 189, 248, 0.45);

  /* 赛博高能光谱 (Cyber Neon Accents) */
  --accent-primary: #00f0ff;       /* 赛博电青 (Electric Cyan) */
  --accent-purple: #a855f7;        /* 量子霓虹紫 (Quantum Purple) */
  --accent-emerald: #00ff9d;       /* 矩阵荧光绿 (Matrix Emerald) */
  --accent-amber: #fbbf24;         /* 聚变高能橙 (Fusion Amber) */
  --accent-rose: #ff3366;          /* 脉冲激光红 (Pulse Rose) */
  --accent-indigo: #6366f1;        /* 等离子靛蓝 (Plasma Indigo) */

  /* 文字系统 (Optic Clarity) */
  --text-main: #f1f5f9;            /* 纯白极光字 */
  --text-muted: #94a3b8;           /* 亚光灰蓝 */
  --text-dim: #64748b;             /* 幽暗文字 */
  --text-accent: #00f0ff;          /* 电青亮字 */
  --code-bg: rgba(5, 8, 17, 0.95);

  /* 尺寸与网格 (8px Grid) */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 68px;
  --header-height: 56px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* 过渡曲线 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   明亮白天模式 (Light Mode - 太空舱陶瓷白与离子蓝 Solar Cleanroom)
   -------------------------------------------------------------------------- */
[data-theme="light"] {
  --bg-primary: #eef3f9;           /* 冷调太空纳米陶瓷底色 */
  --bg-secondary: #ffffff;         /* 纯净面板白 */
  --bg-tertiary: #e2ecf7;          /* 次级结构冷灰蓝 */
  --bg-sidebar: rgba(245, 248, 253, 0.92); /* 通透航天玻璃 */
  --bg-card: rgba(255, 255, 255, 0.85); /* 镜面晶体悬浮卡片 */
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-input: rgba(238, 244, 252, 0.95);
  --bg-drawer: #ffffff;

  /* 边框与发光投影 (Precision Blueprint Edges) */
  --border-subtle: rgba(37, 99, 235, 0.12); /* 精密工程蓝微描边 */
  --border-focus: rgba(2, 132, 199, 0.65);  /* 离子钴蓝聚焦 */
  --border-glow: rgba(37, 99, 235, 0.25);   /* 光子扩散微环 */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(37, 99, 235, 0.04);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.08), 0 0 1px rgba(37, 99, 235, 0.25);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.12), 0 0 24px rgba(2, 132, 199, 0.10);
  --shadow-glow: 0 0 28px rgba(2, 132, 199, 0.22), 0 0 6px rgba(37, 99, 235, 0.35);

  /* 离子科技光谱 (Solar Laser Accents) */
  --accent-primary: #0284c7;       /* 深空离子蓝 (Cobalt Ion) */
  --accent-purple: #7c3aed;        /* 质子紫 (Proton Violet) */
  --accent-emerald: #059669;       /* 活性翠绿 (Bio Emerald) */
  --accent-amber: #d97706;         /* 聚变高能黄 (Solar Amber) */
  --accent-rose: #e11d48;          /* 警报脉冲红 (Alert Rose) */
  --accent-indigo: #4f46e5;        /* 激光靛蓝 (Laser Indigo) */

  /* 文字系统 (Ultra Contrast) */
  --text-main: #091124;            /* 极深钛蓝黑 (字迹如激光雕刻) */
  --text-muted: #475569;           /* 稳健石板灰 */
  --text-dim: #94a3b8;             /* 次级弱化灰 */
  --text-accent: #0284c7;          /* 离子蓝焦点 */
  --code-bg: #e6f0fc;              /* 科技代码淡蓝底 */
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  /* 纳米科技微网格 (Nano Tech Blueprint Matrix) */
  background-image: 
    radial-gradient(circle at 50% 50%, transparent 0%, var(--bg-primary) 100%),
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 100% 100%, 36px 36px, 36px 36px;
  background-position: 0 0, -1px -1px, -1px -1px;
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* 顶部左侧：量子电青极光 (Quantum Cyan Nebula) */
body::before {
  content: '';
  position: fixed;
  top: -140px;
  left: 20%;
  width: 720px;
  height: 420px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.12) 0%, rgba(99, 102, 241, 0.05) 50%, transparent 70%);
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  transition: background var(--transition-normal);
}

/* 底部右侧：深空等离子紫光 (Deep Plasma Violet Nebula) */
body::after {
  content: '';
  position: fixed;
  bottom: -160px;
  right: 10%;
  width: 680px;
  height: 380px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, rgba(0, 240, 255, 0.03) 50%, transparent 70%);
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  transition: background var(--transition-normal);
}

[data-theme="light"] body::before {
  background: radial-gradient(circle, rgba(2, 132, 199, 0.10) 0%, rgba(99, 102, 241, 0.04) 50%, transparent 70%);
}

[data-theme="light"] body::after {
  background: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, rgba(2, 132, 199, 0.03) 50%, transparent 70%);
}


/* 滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ==============================================================================
   主框架布局：左侧导航 + 右侧主内容视窗 (Master-Detail Shell)
   ============================================================================== */
#app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* ==============================================================================
   左侧侧边栏 (Left Sidebar Navigation)
   ============================================================================== */
.app-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-smooth), transform var(--transition-smooth);
  position: relative;
  z-index: 50;
  flex-shrink: 0;
}

/* 折叠收起状态 */
.app-sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

/* 侧边栏头部品牌区 (固定高度，不参与滚动) */
.sidebar-header {
  padding: 14px 12px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-indigo));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
  flex-shrink: 0;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity var(--transition-fast);
}

.app-sidebar.collapsed .brand-text-block {
  display: none;
}

.brand-info-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-info-sub {
  font-size: 10px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 侧边栏折叠触发按钮 */
.btn-toggle-sidebar {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.btn-toggle-sidebar:hover {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
  border-color: var(--border-glow);
  box-shadow: 0 0 10px var(--border-glow);
}

.app-sidebar.collapsed .btn-toggle-sidebar {
  margin: 0 auto;
  transform: rotate(180deg);
}

/* 侧边栏自适应独立滚动主容器 (Scroll Container) */
.sidebar-scroll-container {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

/* 专属半透明极简滚动条 */
.sidebar-scroll-container::-webkit-scrollbar {
  width: 4px;
}

.sidebar-scroll-container::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-full);
}

.sidebar-scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

/* 侧边栏主导航项 */
.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item-btn {
  width: 100%;
  height: 38px;
  min-height: 38px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 0 10px;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.sidebar-item-btn:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-main);
}

.sidebar-item-btn:active {
  transform: scale(0.98);
}

.sidebar-item-btn.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.35);
  color: var(--accent-primary);
  font-weight: 600;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.15);
}

[data-theme="light"] .sidebar-item-btn.active {
  background: rgba(2, 132, 199, 0.10);
  border-color: rgba(2, 132, 199, 0.3);
  color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12);
}

.sidebar-item-icon {
  font-size: 16px;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-item-label {
  margin-left: 8px;
  flex: 1;
  text-align: left;
  transition: opacity var(--transition-fast);
}

.app-sidebar.collapsed .sidebar-item-label {
  display: none;
}

.sidebar-badge {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-dim);
  transition: opacity var(--transition-fast);
}

.sidebar-item-btn.active .sidebar-badge {
  background: rgba(0, 240, 255, 0.2);
  color: var(--accent-primary);
}

[data-theme="light"] .sidebar-item-btn.active .sidebar-badge {
  background: rgba(2, 132, 199, 0.15);
  color: var(--accent-primary);
}

.app-sidebar.collapsed .sidebar-badge {
  display: none;
}

/* 侧边栏底部元数据与状态 (固定吸底) */
.sidebar-footer {
  padding: 10px 10px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.sidebar-status-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--accent-emerald);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 255, 157, 0.08);
  border: 1px solid rgba(0, 255, 157, 0.2);
  overflow: hidden;
  white-space: nowrap;
}

[data-theme="light"] .sidebar-status-box {
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.2);
  color: #047857;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-ring 2s infinite;
}


@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.app-sidebar.collapsed .sidebar-status-text {
  display: none;
}

/* 手机端侧边栏遮罩 */
.sidebar-mobile-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.sidebar-mobile-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ==============================================================================
   右侧主内容视窗区域 (Main Content Area)
   ============================================================================== */
.main-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-primary);
  transition: background-color var(--transition-normal);
}

/* 顶部精简工具栏 (Topbar) */
.topbar {
  height: var(--header-height);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.topbar-center {
  flex: 1;
  max-width: 420px;
  margin: 0 20px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 13px;
}

.search-input {
  width: 100%;
  height: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0 42px 0 34px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.search-shortcut {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(148, 163, 184, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-dim);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-main);
  border-color: rgba(148, 163, 184, 0.3);
}

.btn-icon:active {
  transform: scale(0.95);
}

/* 主题切换开关 */
.btn-theme-toggle {
  font-size: 16px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-theme-toggle:hover {
  transform: rotate(20deg);
}

.btn-auth {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-primary);
  padding: 6px 14px;
  height: 38px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-auth:hover {
  background: rgba(56, 189, 248, 0.22);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}

/* 主内容视图滚动区 */
.view-container {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
  overflow-x: hidden;
  max-width: 1560px;
  margin: 0 auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==============================================================================
   移动端与平板响应式适配 (Mobile & Tablet Optimization)
   ============================================================================== */
@media (max-width: 768px) {
  :root {
    --header-height: 52px;
  }

  /* 移动端隐藏超出视口的大模糊极光层，防止 GPU 边缘双线性滤波产生灰脏暗角 */
  body::before,
  body::after {
    display: none;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    box-shadow: none;
    z-index: 100;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  }

  /* 移动端展开侧边栏 */
  .app-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.6);
  }

  /* 移动端不收缩为小图标，要么全关要么全开 */
  .app-sidebar.collapsed {
    width: 280px;
    transform: translateX(-100%);
    box-shadow: none;
  }

  .topbar {
    padding: 0 12px;
  }

  .topbar-center {
    display: none; /* 移动端在顶部隐藏搜索框，由浮动或专属面板展开 */
  }

  .topbar-left {
    gap: 8px;
  }

  .topbar-title {
    font-size: 13px;
  }

  .view-container {
    padding: 16px 14px;
  }

  /* 触控目标尺寸保证 44px+ */
  .btn-icon {
    width: 42px;
    height: 42px;
  }

  .btn-auth {
    padding: 6px 10px;
    font-size: 12px;
  }

  .btn-auth span:last-child {
    display: none; /* 移动端仅保留钥匙图标 */
  }
}

/* ==============================================================================
   Tasks 行动调度控制台与阶梯归档 - Front-Design 高级暗黑拟物视觉系统
   ============================================================================== */

/* 1. 顶部调度控制舱 (Header Dock) */
.tasks-header-dock {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 8px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

[data-theme="light"] .tasks-header-dock {
  background: rgba(255, 255, 255, 0.90);
  border-color: rgba(37, 99, 235, 0.16);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* 灵动胶囊控制器 (Lively Cyber Segmented Control) */
.tasks-subtabs-control {
  display: flex;
  gap: 6px;
  background: rgba(8, 14, 28, 0.88);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 4px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  transition: all var(--transition-normal);
}

[data-theme="light"] .tasks-subtabs-control {
  background: #e2ecf9;
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: inset 0 2px 5px rgba(37, 99, 235, 0.08);
}

.tasks-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.tasks-subtab-btn:hover {
  color: var(--text-main);
  background: rgba(0, 240, 255, 0.08);
}

[data-theme="light"] .tasks-subtab-btn {
  color: #475569;
}

[data-theme="light"] .tasks-subtab-btn:hover {
  color: #0284c7;
  background: rgba(255, 255, 255, 0.70);
}

.tasks-subtab-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.22), rgba(168, 85, 247, 0.25));
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.3);
  font-weight: 700;
}

[data-theme="light"] .tasks-subtab-btn.active {
  background: #ffffff;
  color: #0284c7;
  border: 1px solid rgba(37, 99, 235, 0.25);
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.18), 0 1px 2px rgba(15, 23, 42, 0.06);
  font-weight: 700;
}

.subtab-counter {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0, 240, 255, 0.18);
  color: #00f0ff;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

[data-theme="light"] .subtab-counter {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

.tasks-sync-dock {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

[data-theme="light"] .sync-status-indicator {
  background: #eef3f9;
  border-color: rgba(37, 99, 235, 0.16);
  color: #475569;
}


.sync-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  transition: all 0.3s ease;
}

/* 未保存状态：红色加粗与微光红底 */
.sync-status-indicator.is-dirty,
.sync-status-indicator.dirty,
[data-theme="light"] .sync-status-indicator.is-dirty,
[data-theme="light"] .sync-status-indicator.dirty {
  color: #ef4444 !important;
  font-weight: 700 !important;
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.22);
}

[data-theme="light"] .sync-status-indicator.is-dirty,
[data-theme="light"] .sync-status-indicator.dirty {
  color: #dc2626 !important;
  background: #fee2e2 !important;
  border-color: rgba(220, 38, 38, 0.5) !important;
}

.sync-status-indicator.is-dirty .sync-status-text,
.sync-status-indicator.dirty .sync-status-text {
  font-weight: 700 !important;
  color: inherit !important;
}

.sync-status-indicator.is-dirty .sync-status-dot,
.sync-status-indicator.dirty .sync-status-dot,
[data-theme="light"] .sync-status-indicator.is-dirty .sync-status-dot,
[data-theme="light"] .sync-status-indicator.dirty .sync-status-dot {
  background: #ef4444 !important;
  box-shadow: 0 0 8px #ef4444 !important;
  animation: pulse-dot-red 1.2s infinite ease-in-out;
}

.sync-status-indicator.syncing .sync-status-dot {
  background: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-primary);
}

@keyframes pulse-dot-red {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 0 4px #ef4444;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.7;
    box-shadow: 0 0 12px #ef4444;
  }
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.btn-save-tasks {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-save-tasks:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.btn-save-tasks.dirty {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #f59e0b;
  color: #fff;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}

/* 2. 结构化卡片式新建任务模态弹窗 (Task Creator Modal) */
.btn-open-creator-modal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-open-creator-modal:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.task-col-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-col-add-task {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-col-add-task:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

[data-theme="light"] .btn-col-add-task:hover {
  background: rgba(2, 132, 199, 0.12);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.25);
}

/* 模态弹窗对话框 (HUD Translucent Chamber) */
.task-creator-dialog {
  width: 760px;
  max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(8, 14, 28, 0.95);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

[data-theme="light"] .task-creator-dialog {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(37, 99, 235, 0.22);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12), 0 0 30px rgba(2, 132, 199, 0.15);
}

.creator-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.creator-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.creator-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 8px var(--accent-primary));
}

.creator-title {
  margin: 0 0 4px 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.creator-subtitle {
  font-size: 12px;
  color: var(--text-dim);
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.btn-modal-close:hover {
  color: var(--accent-rose);
  background: rgba(255, 51, 102, 0.12);
}

.creator-dialog-body {
  margin-bottom: 18px;
}

.creator-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.creator-field-group {
  margin-bottom: 14px;
}

.creator-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.required-star {
  color: var(--accent-rose);
  margin-left: 3px;
}

.creator-input-text {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.creator-input-text:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

/* 6 大维度下拉栅格 */
.creator-dropdowns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 900px) {
  .creator-dropdowns-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .creator-dropdowns-grid {
    grid-template-columns: 1fr;
  }
}

.creator-select {
  width: 100%;
  background-color: var(--bg-input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 12.5px;
  padding: 8px 32px 8px 12px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.creator-select:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.creator-select option {
  background-color: var(--bg-secondary);
  color: var(--text-main);
  padding: 6px;
}

.creator-date-wrapper {
  display: flex;
  gap: 6px;
}

.creator-date-picker {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
  box-sizing: border-box;
}

.creator-date-picker:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 8px var(--border-glow);
}

.creator-input-tags {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 12.5px;
  padding: 8px 12px;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.creator-input-tags:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

/* 底部操作与即时 Markdown 语法生成底栏 */
.creator-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.creator-markdown-preview {
  flex: 1;
  min-width: 280px;
  background: rgba(4, 7, 15, 0.65);
  border: 1px dashed var(--border-glow);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

[data-theme="light"] .creator-markdown-preview {
  background: #eaf1fb;
  border-color: rgba(37, 99, 235, 0.35);
}

.preview-badge {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  font-weight: 500;
}

.preview-code {
  font-family: 'SF Mono', Monaco, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--accent-primary);
  white-space: nowrap;
}

.creator-buttons-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-creator-reset {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-creator-reset:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-main);
  border-color: var(--border-glow);
}

.btn-creator-submit {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 未保存提示确认模态弹窗 (Unsaved Changes Warning Modal) */
.tasks-unsaved-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 15, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.tasks-unsaved-modal.open {
  display: flex;
}

.tasks-unsaved-dialog {
  width: 480px;
  max-width: 92vw;
  background: rgba(13, 20, 36, 0.96);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(244, 63, 94, 0.2);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

[data-theme="light"] .tasks-unsaved-dialog {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(220, 38, 38, 0.3);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15), 0 0 30px rgba(239, 68, 68, 0.15);
}

.unsaved-dialog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.unsaved-dialog-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 8px rgba(244, 63, 94, 0.6));
}

.unsaved-dialog-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.unsaved-dialog-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 0 20px 0;
}

.unsaved-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-unsaved-save {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-unsaved-save:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-unsaved-discard {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-unsaved-discard:hover {
  background: rgba(244, 63, 94, 0.22);
  border-color: #f43f5e;
}

.btn-unsaved-cancel {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-unsaved-cancel:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
}

/* 刚入池的新任务卡片弹簧微光动效 */
.task-card-item.just-added {
  animation: taskJustAdded 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes taskJustAdded {
  0% {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.7);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* 3. 动态预警横幅与归档就绪条 */
.tasks-alerts-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.task-alert-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid;
  backdrop-filter: blur(12px);
  animation: fadeIn 0.3s ease;
}

.task-alert-banner.due {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fecdd3;
}

.task-alert-banner.archive-ready {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}

.task-alert-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.task-alert-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* 3.1 粘性置顶 HUD 综合控制舱 (Tasks Filter & Search HUD) */
.tasks-filter-hud {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 8px 14px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

[data-theme="light"] .tasks-filter-hud {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(203, 213, 225, 0.8);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

/* 行 1：顶部状态与核心操作 */
.tasks-hud-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.tasks-hud-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.2px;
  white-space: nowrap;
  flex-shrink: 0;
}

[data-theme="light"] .tasks-hud-date-badge {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(203, 213, 225, 0.8);
}

.hud-date-icon {
  font-size: 13px;
}

.tasks-hud-actions-dock {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 行 2：控制器操作行 (搜索 + 过滤 + 排序) */
.tasks-hud-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.tasks-filters-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tasks-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}

.tasks-search-icon {
  position: absolute;
  left: 10px;
  font-size: 13px;
  color: var(--text-dim);
  pointer-events: none;
}

.tasks-search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 28px 7px 30px;
  color: var(--text-main);
  font-size: 12.5px;
  outline: none;
  transition: all 0.2s ease;
}

.tasks-search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
  background: var(--bg-card);
}

[data-theme="light"] .tasks-search-input:focus {
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.tasks-search-clear-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 50%;
  line-height: 1;
}

.tasks-search-clear-btn:hover {
  color: var(--text-main);
}

.tasks-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.filter-pill:hover {
  color: var(--text-main);
  border-color: var(--border-glow);
  transform: translateY(-1px);
}

.filter-pill.active {
  background: linear-gradient(135deg, var(--accent-primary), #6366f1);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(0, 240, 255, 0.35);
  font-weight: 600;
}

[data-theme="light"] .filter-pill.active {
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.tasks-filter-wrapper,
.tasks-sort-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tasks-filter-label,
.tasks-sort-label {
  font-size: 11.5px;
  color: var(--text-dim);
}

.tasks-filter-select,
.tasks-sort-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.tasks-filter-select:focus,
.tasks-sort-select:focus {
  border-color: var(--accent-primary);
}

/* 桌面端折叠指示器默认隐藏 */
.task-col-collapse-icon {
  display: none;
}

/* 4. 三大分类流网格 (Three Column Card Stream) */
.tasks-stream-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.tasks-category-column {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.tasks-category-column:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-md);
}

.task-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .task-col-header {
  background: rgba(15, 23, 42, 0.02);
}

.column-projects .task-col-header { border-top: 3px solid var(--accent-purple); }
.column-life .task-col-header { border-top: 3px solid var(--accent-emerald); }
.column-admin .task-col-header { border-top: 3px solid var(--accent-amber); }

.task-col-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-col-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.task-col-count {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text-dim);
}

.task-cards-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
  transition: background-color 0.2s ease;
}

/* 拖拽悬停受体容器高亮 */
.task-cards-list.drag-over {
  background: rgba(0, 240, 255, 0.05);
  outline: 2px dashed var(--accent-primary);
  outline-offset: -4px;
  border-radius: 8px;
}

[data-theme="light"] .task-cards-list.drag-over {
  background: rgba(2, 132, 199, 0.06);
  outline-color: #0284c7;
}

/* 列底极速行内添加输入条 (Quick Inline Add) */
.task-col-quick-add-wrap {
  padding: 0 12px 12px 12px;
}

.task-col-quick-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 12px;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.task-col-quick-input:focus {
  background: var(--bg-card);
  border-style: solid;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
  transform: translateY(-1px);
}

.column-projects .task-col-quick-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.column-life .task-col-quick-input:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(0, 255, 157, 0.15);
}

.column-admin .task-col-quick-input:focus {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15);
}

[data-theme="light"] .task-col-quick-input {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(203, 213, 225, 0.85);
}

[data-theme="light"] .task-col-quick-input:focus {
  background: #ffffff;
}

/* 格式提示与快速输入胶囊辅助栏 (Quick Format Helper Bar) */
.quick-format-helper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  padding: 0 2px;
}

.quick-format-label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-dim);
  user-select: none;
  margin-right: 2px;
}

.quick-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  outline: none;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  line-height: 1.4;
}

.quick-chip-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.quick-chip-btn.chip-date:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(0, 240, 255, 0.08);
}

.quick-chip-btn.chip-prio-1:hover {
  border-color: var(--accent-rose);
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.08);
}

.quick-chip-btn.chip-prio-2:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.08);
}

.quick-chip-btn.chip-tag:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.08);
}

.quick-chip-btn.chip-link:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.08);
}

.quick-chip-btn:active {
  transform: translateY(0) scale(0.96);
}

[data-theme="light"] .quick-chip-btn {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(203, 213, 225, 0.8);
  color: var(--text-muted);
}

[data-theme="light"] .quick-chip-btn:hover {
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 空状态卡片友好提示 */
.task-card-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 16px;
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
  gap: 8px;
}

.task-card-empty .empty-icon {
  font-size: 26px;
  opacity: 0.8;
}

.task-empty-reset-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--accent-primary);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 4px;
}

.task-empty-reset-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
}

/* 5. 任务卡片项 (Task Card Item - Modern GTD Tech Aesthetics) */
.task-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: auto;
}

/* 优先级左侧发光微色条 (GTD Visual Priority Accent) */
.task-card-item.priority-highest {
  border-left: 3px solid var(--accent-rose);
}

.task-card-item.priority-high {
  border-left: 3px solid var(--accent-amber);
}

.task-card-item.priority-medium {
  border-left: 3px solid #38bdf8;
}

.task-card-item.priority-low {
  border-left: 3px solid rgba(148, 163, 184, 0.35);
}

.task-card-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.task-card-item.is-completed,
.task-card-item.completed {
  opacity: 0.55;
  background: var(--bg-tertiary);
  border-left-color: var(--border-subtle);
}

.task-card-item.is-completed:hover,
.task-card-item.completed:hover {
  opacity: 0.85;
  transform: none;
}

/* 新建脉冲动画 */
.task-card-item.just-added {
  animation: task-just-added-pulse 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes task-just-added-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 255, 157, 0.6);
    border-color: var(--accent-emerald);
    transform: scale(0.98);
  }
  50% {
    box-shadow: 0 0 20px 4px rgba(0, 255, 157, 0.35);
    border-color: var(--accent-emerald);
    transform: scale(1.01);
  }
  100% {
    box-shadow: var(--shadow-sm);
    transform: scale(1);
  }
}

/* 5.1 复选框组件系统 (Precision GTD Checkbox) */
.task-checkbox-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  user-select: none;
  position: relative;
}

.task-checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  margin: 0;
}

.task-custom-checkbox {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  border: 2px solid rgba(148, 163, 184, 0.45);
  border-radius: 5px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  overflow: hidden;
}

.task-checkbox-label:hover .task-custom-checkbox {
  border-color: var(--accent-primary);
  background: rgba(0, 240, 255, 0.08);
}

/* 彻底限制并修饰 SVG 勾选图案，消除黑色三角形 */
.check-svg {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
  min-height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
  fill: none !important;
  stroke: #ffffff;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  display: block;
}

.task-checkbox-input:checked + .task-custom-checkbox {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  box-shadow: 0 0 10px rgba(0, 255, 157, 0.4);
}

.task-checkbox-input:checked + .task-custom-checkbox .check-svg {
  opacity: 1;
  transform: scale(1);
}

/* 5.2 任务正文与编辑区 */
.task-content-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 28px;
}

.task-text-span {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.5;
  word-break: break-word;
  outline: none;
  transition: color 0.18s ease;
  cursor: text;
  border-radius: 4px;
}

.task-card-item.is-completed .task-text-span,
.task-card-item.completed .task-text-span {
  text-decoration: line-through;
  color: var(--text-dim);
}

.task-text-span[contenteditable="true"] {
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: var(--shadow-glow);
  border: 1px solid var(--accent-primary);
  min-height: 24px;
}

/* 5.3 元数据胶囊行 (Meta Pills Matrix) */
.task-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.task-pill,
.task-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7.5px;
  border-radius: 4px;
  font-size: 11px;
  font-family: 'JetBrains Mono', -apple-system, sans-serif;
  border: 1px solid transparent;
  line-height: 1.4;
  transition: all 0.18s ease;
  white-space: nowrap;
  user-select: none;
}

.pill-scheduled,
.task-badge-pill.scheduled {
  background: rgba(0, 240, 255, 0.10);
  color: var(--accent-primary);
  border-color: rgba(0, 240, 255, 0.22);
}

.pill-due,
.task-badge-pill.due {
  background: rgba(148, 163, 184, 0.10);
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.22);
}

.pill-due.is-overdue {
  background: rgba(255, 51, 102, 0.16);
  color: var(--accent-rose);
  border-color: rgba(255, 51, 102, 0.38);
  font-weight: 600;
  animation: pill-overdue-glow 2s infinite ease-in-out;
}

@keyframes pill-overdue-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 51, 102, 0);
  }
  50% {
    box-shadow: 0 0 8px rgba(255, 51, 102, 0.35);
  }
}

.pill-done-date {
  background: rgba(0, 255, 157, 0.12);
  color: var(--accent-emerald);
  border-color: rgba(0, 255, 157, 0.28);
}

.pill-priority.priority-highest,
.task-badge-pill.prio-highest {
  background: rgba(255, 51, 102, 0.18);
  color: var(--accent-rose);
  border-color: rgba(255, 51, 102, 0.35);
  font-weight: 600;
}

.pill-priority.priority-high,
.task-badge-pill.prio-high {
  background: rgba(251, 191, 36, 0.18);
  color: var(--accent-amber);
  border-color: rgba(251, 191, 36, 0.35);
  font-weight: 600;
}

.pill-priority.priority-medium {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.28);
}

.pill-priority.priority-low {
  background: rgba(148, 163, 184, 0.10);
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.20);
}

.pill-tag {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.25);
}

.pill-wikilink,
.task-wikilink-pill {
  background: rgba(168, 85, 247, 0.14);
  color: var(--accent-purple);
  border-color: rgba(168, 85, 247, 0.32);
  cursor: pointer;
}

.pill-wikilink:hover,
.task-wikilink-pill:hover {
  background: var(--accent-purple);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.pill-recurrence {
  background: rgba(20, 184, 166, 0.12);
  color: #14b8a6;
  border-color: rgba(20, 184, 166, 0.28);
}

/* 5.4 悬浮快捷工具坞 (Hover Actions Dock) */
.task-card-actions-dock,
.task-item-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transform: translateY(-3px) scale(0.96);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px 4px;
  box-shadow: var(--shadow-sm);
  z-index: 5;
  pointer-events: none;
}

.task-card-item:hover .task-card-actions-dock,
.task-card-item:hover .task-item-actions {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.task-action-btn,
.btn-task-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: inherit;
  user-select: none;
}

.task-action-btn:hover,
.btn-task-action:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
  transform: scale(1.04);
}

.task-action-btn.btn-action-del:hover,
.btn-task-action.delete:hover {
  background: rgba(255, 51, 102, 0.18);
  color: var(--accent-rose);
}

/* 5.5 白天主题针对优化 (Light Mode Enhancements) */
[data-theme="light"] .task-card-item {
  background: #ffffff;
  border-color: rgba(203, 213, 225, 0.85);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .task-card-item:hover {
  background: #ffffff;
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.08);
}

[data-theme="light"] .task-checkbox-label:hover .task-custom-checkbox {
  background: rgba(2, 132, 199, 0.08);
}

[data-theme="light"] .pill-scheduled,
[data-theme="light"] .task-badge-pill.scheduled {
  background: rgba(2, 132, 199, 0.08);
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.22);
}

[data-theme="light"] .pill-due,
[data-theme="light"] .task-badge-pill.due {
  background: rgba(100, 116, 139, 0.08);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.20);
}

[data-theme="light"] .pill-due.is-overdue {
  background: rgba(225, 29, 72, 0.10);
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.30);
}

[data-theme="light"] .pill-priority.priority-highest,
[data-theme="light"] .task-badge-pill.prio-highest {
  background: rgba(225, 29, 72, 0.12);
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.28);
}

[data-theme="light"] .pill-priority.priority-high,
[data-theme="light"] .task-badge-pill.prio-high {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.28);
}

[data-theme="light"] .pill-priority.priority-medium {
  background: rgba(2, 132, 199, 0.10);
  color: #0369a1;
  border-color: rgba(2, 132, 199, 0.25);
}

[data-theme="light"] .pill-wikilink,
[data-theme="light"] .task-wikilink-pill {
  background: rgba(124, 58, 237, 0.08);
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.22);
}

[data-theme="light"] .task-card-actions-dock,
[data-theme="light"] .task-item-actions {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(203, 213, 225, 0.9);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* 5.6 跨列拖拽物理视觉反馈 (Drag & Drop Physics Visuals) */
.task-card-item[draggable="true"] {
  cursor: grab;
}

.task-card-item.is-dragging {
  opacity: 0.45;
  transform: rotate(1.5deg) scale(0.98);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
  cursor: grabbing;
}

.drag-placeholder-slot {
  border: 2px dashed var(--accent-primary);
  border-radius: var(--radius-md);
  min-height: 52px;
  background: rgba(0, 240, 255, 0.06);
  animation: placeholder-pulse 1.2s infinite ease-in-out;
  margin: 4px 0;
}

@keyframes placeholder-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* 5.7 微型日历快速弹出气泡 (Task Datepicker Popover) */
.task-datepicker-popover {
  position: absolute;
  z-index: 1000;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: popover-slide-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .task-datepicker-popover {
  background: #ffffff;
  border-color: rgba(2, 132, 199, 0.35);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

@keyframes popover-slide-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.datepicker-popover-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.datepicker-presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.btn-date-preset {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.btn-date-preset:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-glow);
}

.datepicker-custom-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 11.5px;
  padding: 5px 8px;
  border-radius: 4px;
  box-sizing: border-box;
}

/* ==============================================================================
   三阶梯归档调度控制舱 (Archive Dispatch Hub - Front-Design Matrix)
   ============================================================================== */
.archive-dispatch-wrapper {
  margin-bottom: 24px;
}

.archive-dispatch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  background: rgba(13, 20, 36, 0.82);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), var(--shadow-glow);
  transition: all var(--transition-normal);
  flex-wrap: wrap;
}

[data-theme="light"] .archive-dispatch-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(37, 99, 235, 0.18);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08), 0 0 20px rgba(2, 132, 199, 0.08);
}

.archive-dispatch-card.is-active {
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow: 0 12px 36px rgba(0, 240, 255, 0.12), 0 0 24px rgba(0, 240, 255, 0.15);
}

.archive-dispatch-info {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 280px;
}

.archive-dispatch-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.3);
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}

.archive-dispatch-texts {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.archive-dispatch-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.archive-dispatch-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.archive-buffer-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(0, 240, 255, 0.35);
}

.archive-buffer-badge.is-zero {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-dim);
  border-color: var(--border-subtle);
}

.archive-dispatch-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.archive-dispatch-desc strong {
  color: var(--accent-primary);
  font-weight: 700;
}

[data-theme="light"] .archive-dispatch-desc strong {
  color: #0284c7;
}

/* 按钮组 */
.archive-dispatch-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 阶梯按钮统一基类 */
.btn-archive-slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
  outline: none;
  user-select: none;
}

.btn-archive-slot:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

.btn-archive-slot:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn-archive-slot:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.5);
  transform: none;
  box-shadow: none !important;
}

/* 1. 周归档：赛博电青阶 */
.btn-slot-weekly {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  border: 1px solid rgba(14, 165, 233, 0.4);
}

[data-theme="light"] .btn-slot-weekly {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

/* 2. 月归档：等离子紫阶 */
.btn-slot-monthly {
  background: linear-gradient(135deg, #7c3aed, #9333ea);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
  border: 1px solid rgba(147, 51, 234, 0.4);
}

[data-theme="light"] .btn-slot-monthly {
  background: linear-gradient(135deg, #7c3aed, #6b21a8);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

/* 3. 年归档：聚变金阶 */
.btn-slot-yearly {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

[data-theme="light"] .btn-slot-yearly {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

/* 6. 阶梯归档时间轴树与容量水位板 (Archive Timeline Axis & Ladder Meter) */
.ladder-capacity-meter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.ladder-meter-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.ladder-meter-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.ladder-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ladder-meter-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.ladder-meter-badge {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-tertiary);
  padding: 2px 7px;
  border-radius: 10px;
  color: var(--accent-primary);
}

.ladder-progress-track {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.ladder-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), #6366f1);
  border-radius: 3px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ladder-meter-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* 归档折叠文件卡片 (Archive File Accordion Cards) */
.archive-file-group {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  margin-bottom: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.archive-file-group[open] {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .archive-file-group[open] {
  border-color: rgba(2, 132, 199, 0.35);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.archive-file-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.archive-file-summary:hover {
  background: var(--bg-card-hover);
}

.archive-file-name {
  display: flex;
  align-items: center;
  gap: 4px;
}

.archive-file-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

[data-theme="light"] .archive-file-badge {
  background: rgba(15, 23, 42, 0.05);
}

.archive-tasks-container {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border-subtle);
}

.archive-empty-hint {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding: 12px 0;
  font-style: italic;
}

/* 归档单项恢复按钮 (Restore to Active) */
.archive-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  gap: 10px;
  transition: background 0.15s ease;
}

.archive-task-item:hover {
  background: var(--bg-card-hover);
}

.archive-task-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.archive-task-text {
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: line-through;
  word-break: break-word;
}

.archive-task-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-restore-task {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--accent-primary);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.18s ease;
}

.btn-restore-task:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 240, 255, 0.35);
}

[data-theme="light"] .btn-restore-task:hover {
  background: #0284c7;
  border-color: #0284c7;
}

.archive-search-bar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.archive-meta-summary {
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.archive-timeline-tree {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  padding-left: 20px;
}

.archive-timeline-tree::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-primary), rgba(99, 102, 241, 0.2));
  border-radius: 2px;
}

.archive-tree-card {
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.archive-tree-header {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background 0.15s ease;
}

[data-theme="light"] .archive-tree-header {
  background: rgba(15, 23, 42, 0.02);
}

.archive-tree-header:hover {
  background: var(--bg-card-hover);
}

.archive-tree-content {
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.archive-file-range-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(0, 240, 255, 0.08);
  color: var(--accent-primary);
  border: 1px solid rgba(0, 240, 255, 0.2);
  vertical-align: middle;
}

[data-theme="light"] .archive-file-range-badge {
  background: rgba(2, 132, 199, 0.08);
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.2);
}

/* 7. 移动端响应式布局适配 */
@media (max-width: 1024px) {
  .tasks-stream-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .tasks-stream-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .tasks-header-dock {
    flex-direction: column;
    align-items: stretch;
  }

  .tasks-sync-dock {
    justify-content: space-between;
  }

  .task-item-actions {
    opacity: 1;
    transform: none;
    position: static;
    margin-top: 8px;
    align-self: flex-end;
  }

  /* 移动端三列折叠与展开 */
  .task-col-header {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
  }

  .task-col-collapse-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-dim);
    transition: transform 0.2s ease, color 0.2s ease;
    user-select: none;
  }

  .tasks-category-column.is-collapsed .task-cards-list,
  .tasks-category-column.is-collapsed .task-col-quick-add-wrap {
    display: none !important;
  }

  .tasks-category-column.is-collapsed .task-col-collapse-icon {
    transform: rotate(-90deg);
  }

  .tasks-category-column.is-collapsed {
    box-shadow: none;
  }

  /* 移动端 HUD 极致紧凑双行微控舱 (总高度约 80px) */
  .tasks-filter-hud {
    padding: 7px 10px;
    gap: 7px;
    margin-bottom: 14px;
  }

  .tasks-hud-top-bar {
    gap: 6px;
  }

  .tasks-hud-date-badge {
    padding: 2px 6px;
    font-size: 11px;
    letter-spacing: 0;
  }

  .tasks-hud-actions-dock {
    gap: 5px;
  }

  .sync-status-indicator {
    padding: 2px 7px;
    font-size: 10.5px;
    gap: 4px;
  }

  .btn-save-tasks,
  .btn-open-creator-modal {
    padding: 4px 7px;
    font-size: 11px;
    border-radius: 6px;
    gap: 3px;
  }

  .tasks-hud-controls-row {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    width: 100%;
    flex-wrap: nowrap;
  }

  .tasks-search-wrapper {
    flex: 1;
    min-width: 0;
    max-width: none;
  }

  .tasks-search-input {
    padding: 5px 18px 5px 24px;
    font-size: 11.5px;
    border-radius: 6px;
  }

  .tasks-search-icon {
    left: 7px;
    font-size: 11px;
  }

  .tasks-filters-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }

  /* 移动端隐藏冗余的“过滤:”、“排序:”文本前缀，释放空间 */
  .tasks-filter-label,
  .tasks-sort-label {
    display: none;
  }

  .tasks-filter-select,
  .tasks-sort-select {
    padding: 4px 6px;
    font-size: 11px;
    border-radius: 6px;
    max-width: 108px;
  }

  /* 超窄屏手机 (< 480px) 释放宽度：同步状态保留绿点，隐藏长文字 */
  @media (max-width: 480px) {
    .sync-status-text {
      display: none;
    }
    
    .sync-status-indicator {
      padding: 3px 6px;
    }
  }

  /* 极窄屏 (< 390px) 按钮保留图标，避免溢出 */
  @media (max-width: 390px) {
    .btn-save-tasks .btn-text-label,
    .btn-open-creator-modal .btn-text-label {
      display: none;
    }
    
    .btn-save-tasks,
    .btn-open-creator-modal {
      padding: 4px 8px;
    }
  }
}

