/* ============================================================
   喜途掘金 - 520.baby 甜蜜联盟 AI智能体协作平台
   XiTu JueJin - Distributed Skill Agent Task Marketplace
   Complete Stylesheet
   ============================================================ */

/* ============================================================
   1. CSS Variables
   ============================================================ */
:root {
  /* ---- 主色调 ---- */
  --color-xi-red:          #FF6B6B;
  --color-xi-red-light:    #FF8A8A;
  --color-xi-red-dark:     #E55555;
  --color-xi-red-glow:     rgba(255, 107, 107, 0.35);
  --color-xi-red-gradient: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 50%, #FFB7B7 100%);
  --color-xi-red-deep:     linear-gradient(135deg, #CC4444 0%, #FF6B6B 100%);

  /* ---- 背景色 ---- */
  --color-bg-primary:      #0a0e17;
  --color-bg-secondary:    #111827;
  --color-bg-tertiary:     #1a1f2e;
  --color-bg-card:         rgba(26, 31, 46, 0.6);
  --color-bg-card-hover:   rgba(26, 31, 46, 0.85);
  --color-bg-overlay:      rgba(10, 14, 23, 0.85);
  --color-bg-input:        rgba(17, 24, 39, 0.8);
  --color-bg-code:         #0d1117;

  /* ---- 辅助色 ---- */
  --color-success:         #10B981;
  --color-success-light:   #34D399;
  --color-success-glow:    rgba(16, 185, 129, 0.3);
  --color-warning:         #F59E0B;
  --color-warning-light:   #FBBF24;
  --color-warning-glow:    rgba(245, 158, 11, 0.3);
  --color-tech-purple:     #6366F1;
  --color-tech-purple-light:#818CF8;
  --color-tech-purple-glow:rgba(99, 102, 241, 0.3);
  --color-tech-blue:       #3B82F6;
  --color-tech-blue-light: #60A5FA;
  --color-tech-blue-glow:  rgba(59, 130, 246, 0.3);

  /* ---- 文字色 ---- */
  --color-text-primary:    #F1F5F9;
  --color-text-secondary:  #94A3B8;
  --color-text-tertiary:   #64748B;
  --color-text-muted:      #475569;
  --color-text-inverse:    #0F172A;
  --color-text-xi:         #FF6B6B;
  --color-text-link:       #60A5FA;
  --color-text-code:       #E2E8F0;

  /* ---- 边框色 ---- */
  --color-border-default:  rgba(148, 163, 184, 0.12);
  --color-border-light:    rgba(148, 163, 184, 0.06);
  --color-border-hover:    rgba(148, 163, 184, 0.25);
  --color-border-focus:    var(--color-tech-blue);
  --color-border-xi:       rgba(255, 107, 107, 0.4);

  /* ---- 玻璃态 ---- */
  --glass-bg:              rgba(26, 31, 46, 0.55);
  --glass-bg-strong:       rgba(26, 31, 46, 0.78);
  --glass-border:          rgba(148, 163, 184, 0.1);
  --glass-blur:            16px;
  --glass-blur-strong:     24px;

  /* ---- 间距 ---- */
  --space-xxs:   2px;
  --space-xs:    4px;
  --space-sm:    8px;
  --space-md:    12px;
  --space-base:  16px;
  --space-lg:    20px;
  --space-xl:    24px;
  --space-2xl:   32px;
  --space-3xl:   48px;
  --space-4xl:   64px;

  /* ---- 圆角 ---- */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  20px;
  --radius-full: 9999px;

  /* ---- 阴影 ---- */
  --shadow-xs:   0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm:   0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg:   0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-xl:   0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow-xi:    0 0 20px var(--color-xi-red-glow);
  --shadow-glow-blue:  0 0 20px var(--color-tech-blue-glow);
  --shadow-glow-purple:0 0 20px var(--color-tech-purple-glow);
  --shadow-glow-green: 0 0 20px var(--color-success-glow);
  --shadow-glow-gold:  0 0 20px var(--color-warning-glow);

  /* ---- 字体 ---- */
  --font-sans:  'Source Han Sans CN', 'Noto Sans SC', -apple-system, BlinkMacSystemFont,
                'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, 'Courier New', monospace;
  --font-display: 'Source Han Sans CN', 'Noto Sans SC', sans-serif;

  /* ---- 字号 ---- */
  --text-xs:    0.6875rem;   /* 11px */
  --text-sm:    0.75rem;     /* 12px */
  --text-base:  0.875rem;    /* 14px */
  --text-md:    1rem;        /* 16px */
  --text-lg:    1.125rem;    /* 18px */
  --text-xl:    1.25rem;     /* 20px */
  --text-2xl:   1.5rem;      /* 24px */
  --text-3xl:   1.875rem;    /* 30px */
  --text-4xl:   2.25rem;     /* 36px */
  --text-5xl:   3rem;        /* 48px */

  /* ---- 行高 ---- */
  --leading-tight:  1.25;
  --leading-normal: 1.5;
  --leading-relaxed:1.75;
  --leading-loose:  2;

  /* ---- 字重 ---- */
  --font-normal:    400;
  --font-medium:    500;
  --font-semibold:  600;
  --font-bold:      700;

  /* ---- 导航栏 ---- */
  --nav-height:     56px;
  --nav-bg:         rgba(10, 14, 23, 0.88);
  --nav-border:     var(--color-border-default);

  /* ---- 过渡 ---- */
  --transition-fast:    150ms ease;
  --transition-normal:  250ms ease;
  --transition-slow:    350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring:  500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ---- z-index层级 ---- */
  --z-base:       1;
  --z-dropdown:   100;
  --z-sticky:     200;
  --z-nav:        300;
  --z-drawer:     400;
  --z-modal:      500;
  --z-toast:      600;
  --z-tooltip:    700;

  /* ---- 状态色 ---- */
  --status-pending:    var(--color-warning);
  --status-processing: var(--color-tech-blue);
  --status-completed:  var(--color-success);
  --status-failed:     var(--color-xi-red);
  --status-deadletter: #8B5CF6;
  --status-online:     var(--color-success);
  --status-offline:    var(--color-text-muted);
}

/* ============================================================
   Light Theme Override (主题切换 - 浅色)
   ============================================================ */
[data-theme="light"] {
  --color-bg-primary:    #F8FAFC;
  --color-bg-secondary:  #F1F5F9;
  --color-bg-tertiary:   #E2E8F0;
  --color-bg-card:       rgba(255, 255, 255, 0.7);
  --color-bg-card-hover: rgba(255, 255, 255, 0.9);
  --color-bg-overlay:    rgba(241, 245, 249, 0.9);
  --color-bg-input:      rgba(241, 245, 249, 0.9);
  --color-bg-code:       #1E293B;

  --color-text-primary:  #0F172A;
  --color-text-secondary:#475569;
  --color-text-tertiary: #64748B;
  --color-text-muted:    #94A3B8;
  --color-text-inverse:  #F1F5F9;

  --color-border-default:rgba(15, 23, 42, 0.1);
  --color-border-light:  rgba(15, 23, 42, 0.05);
  --color-border-hover:  rgba(15, 23, 42, 0.2);

  --glass-bg:            rgba(255, 255, 255, 0.6);
  --glass-bg-strong:     rgba(255, 255, 255, 0.82);
  --glass-border:        rgba(15, 23, 42, 0.08);

  --nav-bg:              rgba(248, 250, 252, 0.88);

  --shadow-xs:  0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm:  0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg:  0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-xl:  0 16px 48px rgba(0, 0, 0, 0.12);
}


/* ============================================================
   2. Global Reset & Base Typography
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-slow),
              color var(--transition-slow);
}

/* 背景装饰层 - 科技感网格 + 喜文化元素 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 15% 20%, var(--color-xi-red-glow) 0%, transparent 50%),
    radial-gradient(circle at 85% 80%, var(--color-tech-purple-glow) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, var(--color-tech-blue-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(var(--color-border-light) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border-light) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

/* 基础排版 */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-secondary);
}

a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-xi-red-light);
}

strong {
  font-weight: var(--font-semibold);
}

small {
  font-size: var(--text-sm);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--color-bg-code);
  color: var(--color-text-code);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-mono);
  background-color: var(--color-bg-code);
  color: var(--color-text-code);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: var(--leading-relaxed);
  border: 1px solid var(--color-border-default);
  margin-bottom: var(--space-lg);
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: 1px solid var(--color-border-default);
  background-color: var(--color-bg-input);
  color: var(--color-text-primary);
  padding: var(--space-sm) var(--space-base);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-text-muted);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-tertiary);
}

/* 选中色 */
::selection {
  background-color: var(--color-xi-red);
  color: var(--color-text-inverse);
}

/* App容器 - 确保内容在装饰层之上 */
#app,
.app-container {
  position: relative;
  z-index: var(--z-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* ============================================================
   3. Top Navigation Bar
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(var(--glass-blur-strong));
  -webkit-backdrop-filter: blur(var(--glass-blur-strong));
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  z-index: var(--z-nav);
  transition: background-color var(--transition-slow);
}

/* Logo区域 */
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  gap: var(--space-base);
}
.navbar__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  flex-shrink: 0;
}
/* 未央 7/14 15:50 · 沐燊要求 logo 整合返回箭头：< + 喜途掘金 · 实验仓 */
.navbar__back-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--color-text-primary);
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.navbar__back-logo:hover {
  background: var(--glass-bg);
  border-color: var(--color-tech-blue);
}
.navbar__back-logo:active {
  transform: scale(0.97);
}
.navbar__back-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-xi-red-gradient);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

/* 未央 7/14 15:50 · 沐燊要求移除门眉 · navbar 直接 fixed top:0 */
.navbar {
  top: 0 !important;
}

.navbar__logo-icon {
  width: 32px;
  height: 32px;
  background: var(--color-xi-red-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: #fff;
  box-shadow: var(--shadow-glow-xi);
  position: relative;
  overflow: hidden;
}

/* Logo中的喜字装饰 */
.navbar__logo-icon::after {
  content: '喜';
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.navbar__logo-text {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  letter-spacing: 0.5px;
}

.navbar__logo-text span {
  background: var(--color-xi-red-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 导航Tab区域 */
.navbar__tabs {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  height: 100%;
}

.navbar__tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  height: 100%;
  color: var(--color-text-tertiary);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.navbar__tab:hover {
  color: var(--color-text-primary);
}

.navbar__tab--active {
  color: var(--color-text-primary);
}

/* Tab活跃状态 - 底部渐变指示线 */
.navbar__tab--active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 3px;
  background: var(--color-xi-red-gradient);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
  animation: tabIndicatorIn 0.3s var(--transition-spring) forwards;
}

@keyframes tabIndicatorIn {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 70%;
    opacity: 1;
  }
}

/* Tab图标 */
.navbar__tab-icon {
  font-size: var(--text-md);
  line-height: 1;
}

/* 右侧状态区域 */
.navbar__actions,
.navbar__tools {
  display: flex;
  align-items: center;
  gap: var(--space-base);
  flex-shrink: 0;
  height: 100%;
}

/* 飞书连接状态指示灯 */
.feishu-status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: default;
  transition: border-color var(--transition-fast);
}

.feishu-status:hover {
  border-color: var(--color-border-hover);
}

.feishu-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-text-muted);
  flex-shrink: 0;
}

.feishu-status--connected .feishu-status__dot {
  background-color: var(--color-status-online);
  box-shadow: 0 0 6px var(--color-success-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}

.feishu-status--connecting .feishu-status__dot {
  background-color: var(--color-warning);
  animation: pulse-dot 1s ease-in-out infinite;
}

.feishu-status--disconnected .feishu-status__dot {
  background-color: var(--color-xi-red);
}

.feishu-status__text {
  white-space: nowrap;
}

/* 主题切换按钮 */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  transition: color var(--transition-fast),
              background-color var(--transition-fast);
}

.theme-toggle:hover {
  color: var(--color-text-primary);
  background-color: var(--glass-bg);
}

/* 汉堡菜单按钮(移动端) */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  gap: 5px;
  cursor: pointer;
}

.navbar__hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--color-text-primary);
  border-radius: 1px;
  transition: transform var(--transition-fast),
              opacity var(--transition-fast);
}

.navbar__hamburger--open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar__hamburger--open span:nth-child(2) {
  opacity: 0;
}

.navbar__hamburger--open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 移动端导航遮罩 */
.navbar__mobile-overlay {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg-overlay);
  z-index: calc(var(--z-nav) - 1);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.navbar__mobile-overlay--visible {
  opacity: 1;
}

/* 主内容区域 - 只需要给导航栏留出空间 */
.main-content {
  flex: 1;
  margin-top: var(--nav-height);
  padding: var(--space-xl);
  width: 100%;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}


/* ============================================================
   4. SPA Page Transitions
   ============================================================ */
.page {
  animation: pageEnter 0.4s var(--transition-slow) forwards;
}

.page--leaving {
  animation: pageLeave 0.25s ease forwards;
}

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

@keyframes pageLeave {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}


/* ============================================================
   5. Common Components
   ============================================================ */

/* ---- 通用卡片 ---- */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              border-color var(--transition-fast),
              background-color var(--transition-fast);
}

.card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-lg);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.card__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  margin-bottom: 0;
}

.card__subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  margin-top: var(--space-xs);
}

/* ---- 通用按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  line-height: 1.5;
  white-space: nowrap;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn:active {
  transform: scale(0.96);
}

/* 主要按钮 - 喜红渐变 */
.btn--primary {
  background: var(--color-xi-red-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow-xi);
}

.btn--primary:hover {
  box-shadow: 0 0 28px var(--color-xi-red-glow);
  filter: brightness(1.1);
}

.btn--primary:active {
  filter: brightness(0.95);
  transform: scale(0.96);
}

/* 次要按钮 */
.btn--secondary {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  color: var(--color-text-primary);
}

.btn--secondary:hover {
  background: var(--glass-bg-strong);
  border-color: var(--color-border-hover);
}

/* 幽灵按钮 */
.btn--ghost {
  color: var(--color-text-secondary);
  background: transparent;
}

.btn--ghost:hover {
  color: var(--color-text-primary);
  background: var(--glass-bg);
}

/* 按钮尺寸 */
.btn--sm {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: var(--space-base) var(--space-2xl);
  font-size: var(--text-md);
  border-radius: var(--radius-lg);
}

/* ---- 状态标签 ---- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xxs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  line-height: 1.6;
  white-space: nowrap;
}

.tag--pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning-light);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.tag--processing {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-tech-blue-light);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.tag--completed {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success-light);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.tag--failed {
  background: rgba(255, 107, 107, 0.15);
  color: var(--color-xi-red-light);
  border: 1px solid rgba(255, 107, 107, 0.25);
}

.tag--deadletter {
  background: rgba(139, 92, 246, 0.15);
  color: #A78BFA;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.tag--xi {
  background: rgba(255, 107, 107, 0.15);
  color: var(--color-xi-red-light);
  border: 1px solid rgba(255, 107, 107, 0.2);
}

.tag--tech {
  background: rgba(99, 102, 241, 0.15);
  color: var(--color-tech-purple-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ---- 徽章(Badge) ---- */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-xs);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  background: var(--color-xi-red);
  color: #fff;
  line-height: 1;
}

/* ---- 空状态 ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl) var(--space-xl);
  text-align: center;
  color: var(--color-text-tertiary);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.empty-state__title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state__desc {
  font-size: var(--text-base);
  color: var(--color-text-tertiary);
  max-width: 360px;
}


/* ============================================================
   6. Dashboard Page
   ============================================================ */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* ---- Dashboard 页面标题 ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-base);
  margin-bottom: var(--space-sm);
}

.page-header__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* 标题中的喜文化装饰 */
.page-header__title::before {
  content: '囍';
  font-size: 0.7em;
  background: var(--color-xi-red-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.7;
}

.page-header__desc {
  font-size: var(--text-base);
  color: var(--color-text-tertiary);
  margin-bottom: 0;
}

/* ---- 统计卡片网格 ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              border-color var(--transition-fast);
  animation: cardEnter 0.5s ease forwards;
  opacity: 0;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.16s; }
.stat-card:nth-child(4) { animation-delay: 0.24s; }

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-lg);
}

/* 统计卡片顶部装饰条 */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.stat-card--agents::before {
  background: var(--color-xi-red-gradient);
}

.stat-card--pending::before {
  background: linear-gradient(90deg, var(--color-warning), var(--color-warning-light));
}

.stat-card--completed::before {
  background: linear-gradient(90deg, var(--color-success), var(--color-success-light));
}

.stat-card--throughput::before {
  background: linear-gradient(90deg, var(--color-tech-blue), var(--color-tech-blue-light));
}

/* 统计卡片光晕背景 */
.stat-card::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.08;
  pointer-events: none;
}

.stat-card--agents::after  { background: var(--color-xi-red); }
.stat-card--pending::after { background: var(--color-warning); }
.stat-card--completed::after { background: var(--color-success); }
.stat-card--throughput::after { background: var(--color-tech-blue); }

.stat-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.stat-card__label {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  font-weight: var(--font-medium);
}

.stat-card__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
}

.stat-card--agents .stat-card__icon  { background: rgba(255, 107, 107, 0.15); color: var(--color-xi-red-light); }
.stat-card--pending .stat-card__icon { background: rgba(245, 158, 11, 0.15); color: var(--color-warning-light); }
.stat-card--completed .stat-card__icon { background: rgba(16, 185, 129, 0.15); color: var(--color-success-light); }
.stat-card--throughput .stat-card__icon { background: rgba(59, 130, 246, 0.15); color: var(--color-tech-blue-light); }

.stat-card__value {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  line-height: 1;
  margin-bottom: var(--space-xs);
  font-variant-numeric: tabular-nums;
}

/* 数字滚动动画 */
.stat-card__value--animating {
  animation: numberScroll 0.6s ease-out;
}

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

.stat-card__trend {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.stat-card__trend--up {
  color: var(--color-success-light);
}

.stat-card__trend--down {
  color: var(--color-xi-red-light);
}

/* ---- Dashboard中间面板区域 ---- */
.dashboard__mid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

/* ---- 任务池状态分布环形图 (CSS简化版) ---- */
.ring-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

.ring-chart__visual {
  position: relative;
  width: 200px;
  height: 200px;
}

/* CSS绘制的环形图 */
.ring-chart__ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    var(--color-warning)    0deg 108deg,    /* 待处理 30% */
    var(--color-tech-blue)  108deg 216deg,  /* 处理中 30% */
    var(--color-success)    216deg 324deg,  /* 已完成 30% */
    var(--color-xi-red)     324deg 360deg   /* 失败 10% */
  );
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ringChartRotate 1s ease-out;
}

@keyframes ringChartRotate {
  from { transform: rotate(-90deg); opacity: 0; }
  to   { transform: rotate(0deg);   opacity: 1; }
}

.ring-chart__ring-inner {
  width: 65%;
  height: 65%;
  border-radius: 50%;
  background: var(--color-bg-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.ring-chart__ring-total {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
}

.ring-chart__ring-label {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

/* 图例 */
.ring-chart__legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm) var(--space-xl);
  width: 100%;
}

.ring-chart__legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.ring-chart__legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ring-chart__legend-dot--pending    { background: var(--color-warning); }
.ring-chart__legend-dot--processing { background: var(--color-tech-blue); }
.ring-chart__legend-dot--completed  { background: var(--color-success); }
.ring-chart__legend-dot--failed     { background: var(--color-xi-red); }

.ring-chart__legend-value {
  margin-left: auto;
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
}

/* ---- 最近任务实时流 ---- */
.task-stream {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 400px;
  overflow: hidden;
}

.task-stream__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.task-stream__item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-base);
  border-bottom: 1px solid var(--color-border-light);
  transition: background-color var(--transition-fast);
  animation: streamItemIn 0.3s ease forwards;
}

.task-stream__item:last-child {
  border-bottom: none;
}

.task-stream__item:hover {
  background: var(--color-bg-card-hover);
}

@keyframes streamItemIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.task-stream__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-stream__status-dot--pending    { background: var(--color-warning); }
.task-stream__status-dot--processing { background: var(--color-tech-blue); animation: pulse-dot 2s ease-in-out infinite; }
.task-stream__status-dot--completed  { background: var(--color-success); }
.task-stream__status-dot--failed     { background: var(--color-xi-red); }

.task-stream__info {
  flex: 1;
  min-width: 0;
}

.task-stream__name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-stream__meta {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.task-stream__time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ---- Dashboard底部面板区域 ---- */
.dashboard__bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

/* ---- 在线Agent状态面板 ---- */
.agent-panel__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.agent-panel__item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast);
}

.agent-panel__item:hover {
  background: var(--color-bg-card-hover);
  border-color: var(--color-border-hover);
}

/* Agent心跳状态指示灯 */
.agent-panel__heartbeat {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.agent-panel__heartbeat--online {
  background: var(--color-status-online);
  box-shadow: 0 0 6px var(--color-success-glow);
}

.agent-panel__heartbeat--online::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--color-success);
  animation: pulse-ring 2s ease-out infinite;
}

.agent-panel__heartbeat--offline {
  background: var(--color-status-offline);
}

.agent-panel__info {
  flex: 1;
  min-width: 0;
}

.agent-panel__name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-panel__skills {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.agent-panel__status {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ---- 消息总线监控面板 ---- */
.message-bus {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* NATS/Kafka切换 */
.message-bus__switcher {
  display: flex;
  background: var(--color-bg-input);
  border-radius: var(--radius-full);
  padding: 3px;
  border: 1px solid var(--color-border-default);
}

.message-bus__switch-btn {
  flex: 1;
  padding: var(--space-sm) var(--space-base);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-tertiary);
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.message-bus__switch-btn--active {
  background: var(--color-tech-blue);
  color: #fff;
  box-shadow: var(--shadow-glow-blue);
}

.message-bus__switch-btn:hover:not(.message-bus__switch-btn--active) {
  color: var(--color-text-primary);
}

/* 消息总线指标 */
.message-bus__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.message-bus__metric {
  text-align: center;
  padding: var(--space-md);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}

.message-bus__metric-value {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-xs);
}

.message-bus__metric-label {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

/* 消息总线连接状态列表 */
.message-bus__connections {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.message-bus__connection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.message-bus__connection-name {
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.message-bus__connection-status {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  padding: var(--space-xxs) var(--space-sm);
  border-radius: var(--radius-full);
}

.message-bus__connection-status--active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success-light);
}

.message-bus__connection-status--idle {
  background: rgba(148, 163, 184, 0.1);
  color: var(--color-text-tertiary);
}

.message-bus__connection-status--error {
  background: rgba(255, 107, 107, 0.15);
  color: var(--color-xi-red-light);
}


/* ============================================================
   7. Task Center Page
   ============================================================ */
.task-center {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* ---- 筛选工具栏 ---- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding: var(--space-base) var(--space-lg);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
}

.filter-bar__group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.filter-bar__label {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  white-space: nowrap;
  font-weight: var(--font-medium);
}

.filter-bar select {
  padding: var(--space-sm) var(--space-md);
  padding-right: 28px;
  font-size: var(--text-sm);
  background-color: var(--color-bg-input);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2394A3B8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  min-width: 120px;
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast);
}

.filter-bar select:focus {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.filter-bar__search {
  flex: 1;
  min-width: 180px;
  position: relative;
}

.filter-bar__search input {
  width: 100%;
  padding-left: 36px;
  background-color: var(--color-bg-input);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
}

.filter-bar__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  pointer-events: none;
}

.filter-bar__spacer {
  flex: 1;
}

/* ---- 任务卡片列表 ---- */
.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* 任务卡片 - 左侧彩色边条 */
.task-card {
  display: flex;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              border-color var(--transition-fast);
  animation: cardEnter 0.4s ease forwards;
  opacity: 0;
}

.task-card:hover {
  transform: translateY(-1px);
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-md);
}

/* 左侧彩色边条 - 表示状态 */
.task-card__status-bar {
  width: 4px;
  flex-shrink: 0;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.task-card--pending    .task-card__status-bar { background: var(--color-warning); }
.task-card--processing .task-card__status-bar { background: var(--color-tech-blue); }
.task-card--completed  .task-card__status-bar { background: var(--color-success); }
.task-card--failed     .task-card__status-bar { background: var(--color-xi-red); }
.task-card--deadletter .task-card__status-bar { background: #8B5CF6; }

.task-card__body {
  flex: 1;
  padding: var(--space-lg);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.task-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.task-card__id {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.task-card__title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: auto;
}

.task-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.task-card__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.task-card__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* 处理中任务的进度条 */
.task-card__progress {
  width: 100%;
  height: 4px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-xs);
}

.task-card__progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-tech-blue);
  transition: width var(--transition-slow);
  animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

/* ---- 任务详情抽屉/弹窗 ---- */
.task-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-drawer);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal),
              visibility var(--transition-normal);
}

.task-drawer-overlay--open {
  opacity: 1;
  visibility: visible;
}

.task-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 90vw;
  background: var(--color-bg-secondary);
  border-left: 1px solid var(--color-border-default);
  z-index: var(--z-drawer);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.task-drawer--open {
  transform: translateX(0);
}

.task-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xl);
  border-bottom: 1px solid var(--color-border-default);
  flex-shrink: 0;
}

.task-drawer__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin-bottom: 0;
}

.task-drawer__close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.task-drawer__close:hover {
  background: var(--glass-bg);
  color: var(--color-text-primary);
}

.task-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
}

.task-drawer__section {
  margin-bottom: var(--space-2xl);
}

.task-drawer__section-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-md);
}

.task-drawer__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.task-drawer__field-label {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.task-drawer__field-value {
  font-size: var(--text-base);
  color: var(--color-text-primary);
  font-weight: var(--font-medium);
}

/* ---- 任务时间线 ---- */
.task-timeline {
  position: relative;
  padding-left: var(--space-2xl);
}

.task-timeline::before {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 11px;
  width: 2px;
  background: var(--color-border-default);
}

.task-timeline__item {
  position: relative;
  padding-bottom: var(--space-xl);
}

.task-timeline__item:last-child {
  padding-bottom: 0;
}

.task-timeline__dot {
  position: absolute;
  left: calc(-1 * var(--space-2xl) + 5px);
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--color-border-default);
  background: var(--color-bg-secondary);
  z-index: 1;
}

.task-timeline__item--active .task-timeline__dot {
  border-color: var(--color-tech-blue);
  background: var(--color-tech-blue);
  box-shadow: 0 0 8px var(--color-tech-blue-glow);
}

.task-timeline__item--success .task-timeline__dot {
  border-color: var(--color-success);
  background: var(--color-success);
}

.task-timeline__item--failed .task-timeline__dot {
  border-color: var(--color-xi-red);
  background: var(--color-xi-red);
}

.task-timeline__item--current .task-timeline__dot {
  border-color: var(--color-tech-blue);
  background: var(--color-bg-secondary);
  animation: pulse-dot 2s ease-in-out infinite;
}

.task-timeline__content {
  padding-left: var(--space-sm);
}

.task-timeline__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
}

.task-timeline__desc {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-bottom: 0;
}

.task-timeline__time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: var(--space-xs);
}


/* ============================================================
   8. Agent Center Page
   ============================================================ */
.agent-center {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* ---- Agent能力卡片网格 ---- */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.agent-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              border-color var(--transition-fast);
  animation: cardEnter 0.4s ease forwards;
  opacity: 0;
  position: relative;
  overflow: hidden;
}

.agent-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-lg);
}

/* Agent卡片顶部光晕 */
.agent-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--color-tech-purple);
  opacity: 0.05;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.agent-card:hover::before {
  opacity: 0.1;
}

.agent-card__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

/* Agent头像 */
.agent-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-tech-purple), var(--color-tech-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: #fff;
  flex-shrink: 0;
  position: relative;
}

/* Agent在线/离线心跳指示 */
.agent-card__avatar::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--color-bg-tertiary);
}

.agent-card--online .agent-card__avatar::after {
  background: var(--color-status-online);
  animation: pulse-dot 2s ease-in-out infinite;
}

.agent-card--offline .agent-card__avatar::after {
  background: var(--color-status-offline);
}

.agent-card__info {
  flex: 1;
  min-width: 0;
}

.agent-card__name {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.agent-card__status-text {
  font-size: var(--text-xs);
  font-weight: var(--font-normal);
  color: var(--color-text-muted);
}

.agent-card--online .agent-card__status-text {
  color: var(--color-success-light);
}

.agent-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  line-height: var(--leading-relaxed);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Agent能力标签 */
.agent-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.agent-card__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xxs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-tech-purple-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
  transition: all var(--transition-fast);
}

.agent-card__tag:hover {
  background: rgba(99, 102, 241, 0.2);
}

.agent-card__tag--xi {
  background: rgba(255, 107, 107, 0.1);
  color: var(--color-xi-red-light);
  border-color: rgba(255, 107, 107, 0.2);
}

.agent-card__tag--xi:hover {
  background: rgba(255, 107, 107, 0.2);
}

/* Agent卡片底部统计 */
.agent-card__stats {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
  margin-top: auto;
}

.agent-card__stat {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.agent-card__stat-value {
  color: var(--color-text-primary);
  font-weight: var(--font-semibold);
  font-variant-numeric: tabular-nums;
}

/* ---- 注册/接入引导 ---- */
.agent-onboarding {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-4xl) var(--space-2xl);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px dashed var(--color-border-hover);
  border-radius: var(--radius-2xl);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.agent-onboarding:hover {
  border-color: var(--color-xi-red);
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-glow-xi);
}

.agent-onboarding__icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-2xl);
  background: rgba(255, 107, 107, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--color-xi-red);
  margin-bottom: var(--space-lg);
  position: relative;
}

/* 喜文化装饰：引导卡片中的双喜 */
.agent-onboarding__icon::before {
  content: '囍';
  position: absolute;
  font-size: 1.5rem;
  top: -8px;
  right: -8px;
  background: var(--color-xi-red-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.agent-onboarding__title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-sm);
}

.agent-onboarding__desc {
  font-size: var(--text-base);
  color: var(--color-text-tertiary);
  max-width: 480px;
  margin-bottom: var(--space-xl);
}


/* ============================================================
   9. Protocol Spec Page
   ============================================================ */
.protocol-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  max-width: 960px;
}

/* 文档内容区 */
.protocol-page__content {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
}

/* 文档排版 */
.doc-content h2 {
  font-size: var(--text-2xl);
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-default);
}

.doc-content h2:first-child {
  margin-top: 0;
}

.doc-content h3 {
  font-size: var(--text-xl);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.doc-content p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}

.doc-content ul, .doc-content ol {
  padding-left: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.doc-content li {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-sm);
  list-style: disc;
}

.doc-content ol li {
  list-style: decimal;
}

/* ---- JSON代码块高亮 ---- */
.code-block {
  position: relative;
  margin: var(--space-lg) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-default);
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-base);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--color-border-light);
}

.code-block__lang {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.code-block__copy {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.code-block__copy:hover {
  color: var(--color-text-primary);
  background: var(--glass-bg);
}

.code-block pre {
  margin: 0;
  border: none;
  border-radius: 0;
  font-size: var(--text-sm);
  line-height: 1.7;
}

/* JSON语法高亮（基础版） */
.json-key     { color: #7DD3FC; }   /* 浅蓝 - 键名 */
.json-string  { color: #86EFAC; }   /* 浅绿 - 字符串 */
.json-number  { color: #FDE68A; }   /* 浅黄 - 数字 */
.json-boolean { color: #C4B5FD; }   /* 浅紫 - 布尔 */
.json-null    { color: #FCA5A5; }   /* 浅红 - null */
.json-bracket { color: #94A3B8; }   /* 灰色 - 括号 */
.json-comment { color: #64748B; font-style: italic; }

/* ---- 流程图展示区域 ---- */
.flowchart-area {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  overflow-x: auto;
  margin: var(--space-lg) 0;
}

.flowchart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  min-width: 500px;
}

.flowchart__row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  justify-content: center;
}

.flowchart__node {
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-align: center;
  border: 1px solid var(--color-border-default);
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  min-width: 140px;
  transition: all var(--transition-fast);
}

.flowchart__node:hover {
  border-color: var(--color-tech-blue);
  box-shadow: var(--shadow-glow-blue);
}

.flowchart__node--start {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--color-success-light);
  border-radius: var(--radius-full);
}

.flowchart__node--end {
  background: rgba(255, 107, 107, 0.15);
  border-color: rgba(255, 107, 107, 0.3);
  color: var(--color-xi-red-light);
  border-radius: var(--radius-full);
}

.flowchart__node--process {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.25);
}

.flowchart__node--decision {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--color-warning-light);
  transform: rotate(0deg); /* 实际菱形可通过transform: rotate(45deg)实现 */
}

.flowchart__arrow {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  line-height: 1;
}

.flowchart__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}


/* ============================================================
   10. Plugin Center Page
   ============================================================ */
.plugin-center {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* ---- SDK下载卡片 ---- */
.sdk-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.sdk-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              border-color var(--transition-fast);
  animation: cardEnter 0.4s ease forwards;
  opacity: 0;
}

.sdk-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-md);
}

.sdk-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
}

.sdk-card__icon--python {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-tech-blue-light);
}

.sdk-card__icon--nodejs {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success-light);
}

.sdk-card__icon--go {
  background: rgba(99, 102, 241, 0.15);
  color: var(--color-tech-purple-light);
}

.sdk-card__icon--java {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning-light);
}

.sdk-card__name {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  margin-bottom: 0;
}

.sdk-card__version {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.sdk-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  line-height: var(--leading-relaxed);
  flex: 1;
}

.sdk-card__install {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-code);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-code);
  border: 1px solid var(--color-border-default);
  overflow: hidden;
}

.sdk-card__install code {
  background: none;
  padding: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sdk-card__install-copy {
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: var(--radius-xs);
  transition: color var(--transition-fast);
  flex-shrink: 0;
}

.sdk-card__install-copy:hover {
  color: var(--color-text-primary);
}

/* ---- 接入步骤引导 ---- */
.integration-steps {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
}

.integration-steps__title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2xl);
  text-align: center;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  position: relative;
}

/* 步骤之间的连接线 */
.steps-list::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 23px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--color-xi-red) 0%,
    var(--color-tech-purple) 50%,
    var(--color-tech-blue) 100%
  );
  opacity: 0.3;
}

.step-item {
  display: flex;
  gap: var(--space-xl);
  position: relative;
}

.step-item__number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-bg-tertiary);
  border: 2px solid var(--color-border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  flex-shrink: 0;
  z-index: 1;
  transition: all var(--transition-fast);
}

.step-item--active .step-item__number {
  border-color: var(--color-xi-red);
  background: rgba(255, 107, 107, 0.15);
  color: var(--color-xi-red-light);
  box-shadow: var(--shadow-glow-xi);
}

.step-item__content {
  flex: 1;
  padding-top: var(--space-sm);
}

.step-item__title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-sm);
}

.step-item__desc {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  line-height: var(--leading-relaxed);
}

.step-item__code {
  margin-top: var(--space-md);
}

/* ---- 兼容Agent类型展示 ---- */
.agent-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.agent-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--transition-fast);
  animation: cardEnter 0.4s ease forwards;
  opacity: 0;
}

.agent-type-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.agent-type-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.agent-type-card__name {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  margin-bottom: 0;
}

.agent-type-card__desc {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  line-height: var(--leading-relaxed);
}


/* ============================================================
   11. Footer
   ============================================================ */
.footer,
.site-footer {
  margin-top: auto;
  padding: var(--space-2xl) var(--space-xl);
  border-top: 1px solid var(--color-border-default);
  background: var(--nav-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  text-align: center;
}

.footer__brand,
.site-footer__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.footer__logo {
  width: 24px;
  height: 24px;
  background: var(--color-xi-red-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: #fff;
}

.footer__logo::after {
  content: '喜';
}

/* 未央 7/14 20:58 · site-footer__logo HTML 已有 "⛏️ 喜途掘金"，不应再加 ::after，不应用方形框 */
.site-footer__logo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  background: transparent;
  width: auto;
  height: auto;
}

.site-footer__logo::after {
  content: none;
}

.footer__brand-name,
.site-footer__brand-name {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
}

.footer__brand-name span,
.site-footer__brand-name span {
  background: var(--color-xi-red-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer__copyright,
.site-footer__copyright {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-sm);
}

/* 未央 7/14 20:55 · 沐燊要求底部小字统一居中，site-footer__desc 额外需要 */
.site-footer__desc {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
}

.footer__links,
.site-footer__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer__link,
.site-footer__link,
.site-footer__links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
  text-decoration: none;
}

.footer__link:hover,
.site-footer__link:hover,
.site-footer__links a:hover {
  color: var(--color-xi-red-light);
}

/* 未央 7/14 20:55 · 沐燊要求 meta 一行居中 */
.site-footer__meta {
  margin-top: var(--space-md);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.site-footer__divider {
  color: var(--color-border-default);
  user-select: none;
}

.site-footer__alliance {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.site-footer__alliance:hover {
  color: var(--color-xi-red-light);
}

/* 未央 2026-12-01 15:47 · 备案号必须清晰可辨（备案悬挂要求），比普通页脚链接提一档亮度 */
.site-footer__beian {
  color: var(--color-text-secondary);
}
.site-footer__beian:hover {
  color: var(--color-xi-red-light);
}

.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

/* 520.baby甜蜜联盟标识 */
.footer__alliance {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border-light);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.footer__alliance-xi {
  color: var(--color-xi-red);
  font-size: var(--text-sm);
}


/* ============================================================
   12. Animations
   ============================================================ */

/* ---- 脉冲动画(在线状态) ---- */
@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.3);
  }
}

/* 脉冲环(心跳) */
@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* ---- 卡片入场动画 ---- */
@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---- 进度条动画 ---- */
@keyframes progressFill {
  from {
    width: 0;
  }
}

/* ---- 淡入 ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- 上滑淡入 ---- */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- 缩放弹入 ---- */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---- 旋转 ---- */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---- 喜文化闪烁动画 ---- */
@keyframes xiGlow {
  0%, 100% {
    text-shadow: 0 0 4px var(--color-xi-red-glow);
  }
  50% {
    text-shadow: 0 0 12px var(--color-xi-red-glow),
                 0 0 24px rgba(255, 107, 107, 0.15);
  }
}

/* ---- 呼吸灯效果 ---- */
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* 通用动画工具类 */
.animate-fade-in    { animation: fadeIn 0.3s ease forwards; }
.animate-slide-up   { animation: slideUp 0.4s ease forwards; }
.animate-scale-in   { animation: scaleIn 0.3s ease forwards; }
.animate-pulse      { animation: pulse-dot 2s ease-in-out infinite; }
.animate-breathe    { animation: breathe 3s ease-in-out infinite; }
.animate-xi-glow    { animation: xiGlow 2s ease-in-out infinite; }
.animate-spin       { animation: spin 1s linear infinite; }

/* 延迟工具类 */
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.3s; }
.delay-7 { animation-delay: 0.35s; }
.delay-8 { animation-delay: 0.4s; }


/* ============================================================
   13. Responsive Design
   ============================================================ */

/* ---- 1440px+ (大屏) ---- */
@media (min-width: 1440px) {
  :root {
    --text-4xl: 2.5rem;
    --text-5xl: 3.25rem;
  }

  .main-content {
    padding: var(--space-2xl) var(--space-3xl);
  }

  .stats-grid {
    gap: var(--space-xl);
  }

  .agent-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  }
}

/* ---- 1024px ~ 1439px (标准桌面) ---- */
@media (max-width: 1439px) and (min-width: 1025px) {
  .main-content {
    padding: var(--space-xl) var(--space-2xl);
  }
}

/* ---- 768px ~ 1024px (平板) ---- */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard__mid-row,
  .dashboard__bottom-row {
    grid-template-columns: 1fr;
  }

  .agent-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }

  .page-header__title {
    font-size: var(--text-xl);
  }

  .filter-bar {
    padding: var(--space-md);
  }
}

/* ---- 移动端基准: max-width 768px ---- */
@media (max-width: 768px) {
  :root {
    --nav-height: 48px;
    --space-xl: 16px;
    --space-2xl: 24px;
    --space-3xl: 32px;
    --space-4xl: 48px;
  }

  /* 移动端导航 - 隐藏桌面Tab，显示汉堡菜单 */
  .navbar__tabs {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg-primary);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-xs);
    z-index: calc(var(--z-nav) - 1);
    animation: slideUp 0.3s ease forwards;
  }

  .navbar__tabs--mobile-open {
    display: flex;
  }

  .navbar__tab {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--text-md);
  }

  .navbar__tab:hover,
  .navbar__tab--active {
    background: var(--glass-bg);
  }

  .navbar__tab--active::after {
    display: none;
  }

  .navbar__hamburger {
    display: flex;
  }

  .navbar__mobile-overlay--visible {
    display: block;
  }

  /* 飞书状态文字隐藏 */
  .feishu-status__text {
    display: none;
  }

  /* 主内容 */
  .main-content {
    padding: var(--space-base);
    margin-top: var(--nav-height);
  }

  /* 统计卡片 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .stat-card {
    padding: var(--space-lg);
  }

  .stat-card__value {
    font-size: var(--text-2xl);
  }

  /* Dashboard面板 */
  .dashboard__mid-row,
  .dashboard__bottom-row {
    grid-template-columns: 1fr;
    gap: var(--space-base);
  }

  /* 环形图缩小 */
  .ring-chart__visual {
    width: 160px;
    height: 160px;
  }

  /* 筛选栏 */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar__group {
    width: 100%;
  }

  .filter-bar select {
    flex: 1;
    min-width: 0;
  }

  .filter-bar__search {
    min-width: 0;
    width: 100%;
  }

  .filter-bar__spacer {
    display: none;
  }

  /* 任务卡片 */
  .task-card__body {
    padding: var(--space-md);
  }

  /* 抽屉全屏 */
  .task-drawer {
    width: 100%;
    max-width: 100vw;
  }

  /* Agent网格 */
  .agent-grid {
    grid-template-columns: 1fr;
  }

  /* SDK卡片 */
  .sdk-cards {
    grid-template-columns: 1fr;
  }

  /* Agent类型卡片 */
  .agent-types {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 步骤引导 */
  .step-item {
    gap: var(--space-md);
  }

  /* 协议页 */
  .protocol-page__content {
    padding: var(--space-lg);
  }

  .flowchart {
    min-width: 300px;
    font-size: var(--text-sm);
  }

  /* 页脚 */
  .footer__links {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
}

/* ---- 375px (标准手机) ---- */
@media (max-width: 375px) {
  :root {
    --space-base: 12px;
    --space-lg: 16px;
    --space-xl: 12px;
    --space-2xl: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .stat-card {
    padding: var(--space-md);
  }

  .stat-card__value {
    font-size: var(--text-xl);
  }

  .stat-card__label {
    font-size: var(--text-xs);
  }

  .stat-card__icon {
    width: 28px;
    height: 28px;
    font-size: var(--text-base);
  }

  .page-header__title {
    font-size: var(--text-lg);
  }

  .page-header__desc {
    font-size: var(--text-sm);
  }

  .card {
    padding: var(--space-md);
    border-radius: var(--radius-lg);
  }

  .agent-types {
    grid-template-columns: 1fr;
  }

  .navbar__logo-text {
    font-size: var(--text-base);
  }

  .navbar__logo-icon {
    width: 28px;
    height: 28px;
    font-size: var(--text-base);
  }

  .navbar__logo-icon::after {
    font-size: var(--text-base);
  }
}

/* ---- 320px (小屏手机) ---- */
@media (max-width: 320px) {
  :root {
    --text-xs:   0.625rem;
    --text-sm:   0.6875rem;
    --text-base: 0.75rem;
    --text-md:   0.875rem;
    --text-lg:   1rem;
  }

  .main-content {
    padding: var(--space-sm);
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .stat-card__value {
    font-size: var(--text-2xl);
  }

  .filter-bar {
    padding: var(--space-sm);
  }

  .filter-bar__group {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-xs);
  }

  .h1, h1 { font-size: var(--text-xl); }
  .h2, h2 { font-size: var(--text-lg); }
  .h3, h3 { font-size: var(--text-md); }

  .task-card__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .step-item__number {
    width: 36px;
    height: 36px;
    font-size: var(--text-sm);
  }
}


/* ============================================================
   14. Utility Classes
   ============================================================ */

/* Flexbox */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.flex-1        { flex: 1; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center   { justify-content: center; }
.justify-between  { justify-content: space-between; }
.justify-end      { justify-content: flex-end; }
.gap-xs  { gap: var(--space-xs); }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-base{ gap: var(--space-base); }
.gap-lg  { gap: var(--space-lg); }
.gap-xl  { gap: var(--space-xl); }

/* Grid */
.grid         { display: grid; }
.grid-cols-2  { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3  { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4  { grid-template-columns: repeat(4, 1fr); }

/* Spacing */
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-base{ margin-top: var(--space-base); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-base{ margin-bottom: var(--space-base); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.p-sm   { padding: var(--space-sm); }
.p-md   { padding: var(--space-md); }
.p-base { padding: var(--space-base); }
.p-lg   { padding: var(--space-lg); }
.p-xl   { padding: var(--space-xl); }

/* Text */
.text-center   { text-align: center; }
.text-left     { text-align: left; }
.text-right    { text-align: right; }
.text-xs       { font-size: var(--text-xs); }
.text-sm       { font-size: var(--text-sm); }
.text-base     { font-size: var(--text-base); }
.text-md       { font-size: var(--text-md); }
.text-lg       { font-size: var(--text-lg); }
.text-xl       { font-size: var(--text-xl); }
.text-xi       { color: var(--color-text-xi); }
.text-muted    { color: var(--color-text-muted); }
.text-secondary{ color: var(--color-text-secondary); }
.font-mono     { font-family: var(--font-mono); }
.font-bold     { font-weight: var(--font-bold); }
.font-semibold { font-weight: var(--font-semibold); }
.font-medium   { font-weight: var(--font-medium); }
.truncate      { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Display */
.hidden   { display: none; }
.block    { display: block; }
.inline   { display: inline; }
.w-full   { width: 100%; }

/* Border & Radius */
.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-xl   { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }

/* Opacity */
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }

/* Tabular nums for data */
.tabular-nums { font-variant-numeric: tabular-nums; }


/* ============================================================
   15. Xi-Culture Decorative Elements (喜文化装饰元素)
   ============================================================ */

/* 喜红渐变文字 */
.xi-text {
  background: var(--color-xi-red-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 喜字装饰 */
.xi-decor {
  position: relative;
}

.xi-decor::before {
  content: '囍';
  position: absolute;
  top: -8px;
  right: -12px;
  font-size: 0.6em;
  color: var(--color-xi-red);
  opacity: 0.6;
  animation: xiGlow 3s ease-in-out infinite;
}

/* 喜红分隔线 */
.xi-divider {
  height: 2px;
  background: var(--color-xi-red-gradient);
  border: none;
  border-radius: var(--radius-full);
  margin: var(--space-xl) 0;
  opacity: 0.3;
}

/* 喜红边框卡片 */
.xi-card {
  border-color: var(--color-border-xi);
  box-shadow: var(--shadow-glow-xi);
}

/* 喜文化背景装饰 - 用于特殊区域 */
.xi-pattern-bg {
  position: relative;
}

.xi-pattern-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 0% 0%, rgba(255, 107, 107, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(255, 107, 107, 0.05) 0%, transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}

/* 喜文化Logo组合(用于页头装饰) */
.xi-logo-group {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.xi-logo-group__char {
  font-size: 1.2em;
  font-weight: var(--font-bold);
  color: var(--color-xi-red);
  text-shadow: 0 0 8px var(--color-xi-red-glow);
}

.xi-logo-group__sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 2px;
}


/* ============================================================
   16. Scrollbar & Page-level Specifics
   ============================================================ */

/* 自定义页面滚动容器 */
.scroll-container {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* 列表虚拟滚动占位 */
.virtual-list {
  position: relative;
  overflow: hidden;
}

/* Tab内容区域 */
.tab-content {
  animation: fadeIn 0.3s ease;
}

/* 底部Tab栏(移动端) */
.bottom-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--nav-bg);
  backdrop-filter: blur(var(--glass-blur-strong));
  -webkit-backdrop-filter: blur(var(--glass-blur-strong));
  border-top: 1px solid var(--nav-border);
  z-index: var(--z-nav);
  padding: 0;
}

.bottom-tab-bar__items {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
}

.bottom-tab-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  height: 100%;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-xs);
  transition: color var(--transition-fast);
  cursor: pointer;
}

.bottom-tab-bar__item--active {
  color: var(--color-xi-red);
}

.bottom-tab-bar__item-icon {
  font-size: var(--text-xl);
  line-height: 1;
}

.bottom-tab-bar__item-label {
  font-size: 10px;
  font-weight: var(--font-medium);
}

/* 移动端启用底部Tab栏 */
@media (max-width: 768px) {
  .bottom-tab-bar {
    display: block;
  }

  .main-content {
    padding-bottom: calc(56px + var(--space-base));
  }
}

/* Loading状态 */
.loading-skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-tertiary) 25%,
    rgba(148, 163, 184, 0.08) 50%,
    var(--color-bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast通知 */
.toast {
  position: fixed;
  top: calc(var(--nav-height) + var(--space-base));
  right: var(--space-base);
  padding: var(--space-md) var(--space-lg);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  z-index: var(--z-toast);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease forwards;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.toast--leaving {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

.toast--success { border-left: 3px solid var(--color-success); }
.toast--error   { border-left: 3px solid var(--color-xi-red); }
.toast--warning { border-left: 3px solid var(--color-warning); }
.toast--info    { border-left: 3px solid var(--color-tech-blue); }


/* ============================================================
   END - 喜途掘金 Stylesheet
   ============================================================ */