/* ═══════════════════════════════════════════════
   诸葛智慧店助 — 设计系统
   基于「东风」UI规范：玻璃拟态 + 深邃星空 + 动力学动效
   适配诸葛品牌色: Indigo → Purple
   ═══════════════════════════════════════════════ */

/* ── CSS 变量 ── */
:root {
  /* 品牌色 */
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
  --gradient-primary-hover: linear-gradient(135deg, #818cf8, #a78bfa);

  /* 强调色 */
  --accent-400: #fbbf24;
  --accent-500: #f59e0b;
  --accent-600: #d97706;
  --gradient-accent: linear-gradient(135deg, #f59e0b, #f97316);

  /* 功能色 */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* 背景层级 */
  --bg-deep: #F5F0E8;
  --bg-surface: #EDE8DE;
  --bg-elevated: #E8E2D6;
  --bg-sidebar: #3D1F0E;

  /* 玻璃拟态层级（浅色模式） */
  --glass-wash: rgba(0, 0, 0, 0.02);
  --glass-quiet: rgba(0, 0, 0, 0.04);
  --glass-resting: rgba(255, 255, 255, 0.85);
  --glass-floating: rgba(255, 255, 255, 0.92);
  --glass-overlay: rgba(255, 255, 255, 0.96);

  /* 文字 */
  --text-primary: rgba(30, 30, 40, 0.92);
  --text-secondary: rgba(30, 30, 40, 0.65);
  --text-tertiary: rgba(30, 30, 40, 0.40);
  --text-inverse: #0a0a1a;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* 阴影 */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.4);
  --shadow-glow-primary: 0 0 20px rgba(99, 102, 241, 0.3);
  --shadow-glow-accent: 0 0 20px rgba(245, 158, 11, 0.3);

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* 布局 */
  --sidebar-width: 240px;
  --header-height: 56px;
  --footer-height: 48px;
}

/* ── 全局重置 ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-deep);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-400); text-decoration: none; }
a:hover { color: var(--primary-300); }

ul { list-style: none; }

/* ── 粒子背景 ── */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── 应用布局 ── */
.app-layout {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── 侧栏 ── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 10;
  transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              min-width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
  will-change: width;
}

.sidebar.collapsed {
  width: 72px;
  min-width: 72px;
}

.sidebar-header {
  padding: 20px 20px 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-header.logo-above {
  flex-direction: column;
  gap: 10px;
}

/* 金属铭牌 */
.brand-plate {
  background: linear-gradient(145deg, #2a2a4a, #1a1a3a);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3),
    0 4px 16px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 180px;
}

.brand-plate .brand-name-cn {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 8px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706, #b45309);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-plate .brand-name-en {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 3px;
  margin-top: 2px;
  font-weight: 400;
}

.sidebar.collapsed .brand-plate {
  padding: var(--space-sm);
  max-width: 56px;
}
.sidebar.collapsed .brand-name-cn { font-size: 14px; letter-spacing: 2px; }
.sidebar.collapsed .brand-name-en { display: none; }

/* 侧栏导航 */
.sidebar-nav {
  flex: 1;
  padding: 4px 8px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 3px 0;
  border-radius: 6px;
  cursor: pointer;
  color: #ffffff;
  transition: all 0.2s ease;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-item.active {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.nav-item .nav-icon { display:inline-flex; align-items:center; justify-content:center; width:22px; height:18px; flex-shrink:0; }
.nav-item .nav-label { overflow: hidden; }
.sidebar.collapsed .nav-label { display: none; }

/* 侧栏分组标签 */
.sidebar-group-label {
  padding: 20px 16px 6px 16px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  user-select: none;
}

/* 侧栏底部 */
.sidebar-footer {
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: breathe 3s ease-in-out infinite;
}

.sidebar-toggle {
  margin-top: 4px;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.3);
  transition: all 0.2s;
  text-align: center;
  font-size: 11px;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
}

/* ── 主内容区 ── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  position: relative;
}

/* 侧栏与内容区分隔线 */
.main-content::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0, 0, 0, 0.06);
}

/* 页面容器 */
.page-container {
  flex: 1;
  overflow-y: auto;
  padding: 32px 48px 32px 48px;
  width: 100%;
}

/* 顶部栏 */
.topbar {
  height: var(--header-height);
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(245, 240, 232, 0.85);
  backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-breadcrumb {
  font-size: 12px;
  color: var(--text-tertiary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.topbar-time {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.topbar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--glass-resting);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 16px;
}

.topbar-btn:hover {
  background: var(--glass-floating);
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════
   动效系统 — 基于 Google Stitch 理念
   ═══════════════════════════════════════════════ */

/* ── 页面入场（弹簧物理，仅transform/opacity） ── */
.page-enter {
  animation: springIn 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes springIn {
  0%   { opacity: 0; transform: translateY(16px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}



/* ── 永恒微交互（Perpetual Micro-interactions） ── */
@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.06); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(99, 102, 241, 0.08); }
  50%      { box-shadow: 0 0 24px rgba(99, 102, 241, 0.18); }
}



/* Float — 轻微浮动（卡片/徽章） */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

/* ── 级联展开（Staggered Reveal） ── */
.stagger-item {
  opacity: 0;
  transform: translateY(10px);
  animation: staggerIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.delay-1 { animation-delay: 0.04s; }
.delay-2 { animation-delay: 0.08s; }
.delay-3 { animation-delay: 0.12s; }
.delay-4 { animation-delay: 0.16s; }
.delay-5 { animation-delay: 0.2s; }
.delay-6 { animation-delay: 0.24s; }
.delay-7 { animation-delay: 0.28s; }
.delay-8 { animation-delay: 0.32s; }
.delay-9 { animation-delay: 0.36s; }
.delay-10 { animation-delay: 0.4s; }

/* ── 玻璃卡片（仅transform/opacity过渡，无layout抖动） ── */
.glass-card {
  background: var(--glass-resting);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 24px;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  will-change: transform;
}

.glass-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.glass-card.glow:hover {
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
}

.glass-card.wash   { background: var(--glass-wash);   backdrop-filter: blur(10px); }
.glass-card.quiet  { background: var(--glass-quiet);  backdrop-filter: blur(12px); }
.glass-card.resting { background: var(--glass-resting); backdrop-filter: blur(20px); }
.glass-card.floating { background: var(--glass-floating); backdrop-filter: blur(30px); }

.glass-card .card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.glass-card .card-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
}

/* ── 按钮系统（仅transform/opacity） ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.2s ease,
              background 0.2s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.btn:active { transform: scale(0.96); }

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  background: var(--gradient-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

.btn-accent {
  background: var(--gradient-accent);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}
.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(245, 158, 11, 0.4);
}

.btn-ghost {
  background: var(--glass-resting);
  color: var(--text-primary);
  backdrop-filter: blur(12px);
}
.btn-ghost:hover { background: var(--glass-floating); }

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ── 统计数字 ── */
.stat-value {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 28px;
  line-height: 1.2;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-value.accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-value.success { color: var(--success); -webkit-text-fill-color: var(--success); }
.stat-value.danger { color: var(--error); -webkit-text-fill-color: var(--error); }
.stat-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ── 状态徽章 ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-error { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.badge-urgent { background: rgba(239, 68, 68, 0.25); color: var(--error); animation: glowPulse 2s ease-in-out infinite; }

.badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.badge-success .badge-dot { background: var(--success); }
.badge-warning .badge-dot { background: var(--warning); }
.badge-error .badge-dot { background: var(--error); }

/* ── 进度条 ── */
.progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar .progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--gradient-primary);
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-bar .progress-fill.success { background: var(--success); }
.progress-bar .progress-fill.warning { background: var(--warning); }
.progress-bar .progress-fill.danger { background: var(--error); }

/* ── 表格 ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 12px var(--space-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.data-table td {
  padding: 12px var(--space-md);
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.data-table tr:hover td {
  background: var(--glass-wash);
}

.data-table .text-right { text-align: right; }
.data-table .text-center { text-align: center; }

/* ── Toast 通知 ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--glass-floating);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 420px;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  border-left: 4px solid var(--info);
}

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }
.toast.info    { border-left-color: var(--info); }

.toast .toast-icon { font-size: 18px; }
.toast .toast-msg  { flex: 1; font-size: 13px; color: var(--text-primary); }
.toast .toast-close { cursor: pointer; color: var(--text-tertiary); font-size: 14px; }

@keyframes toastIn {
  0%   { transform: translateX(100%) scale(0.9); opacity: 0; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes toastOut {
  0%   { transform: translateX(0) scale(1); opacity: 1; }
  100% { transform: translateX(100%) scale(0.8); opacity: 0; }
}

/* ── 空状态 ── */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-tertiary);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: var(--space-md); }
.empty-state .empty-text { font-size: 14px; }

/* ── 网格系统 ── */
.grid {
  display: grid;
  gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── 滚动条美化 ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.2); }

/* ── Flexbox 工具 ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.flex-1 { flex: 1; }

/* ── 加载动画 ── */
.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

/* ── 响应式 ── */
@media (max-width: 1024px) {
  .sidebar:not(.expanded) { width: 72px; min-width: 72px; }
  .sidebar:not(.expanded) .nav-label,
  .sidebar:not(.expanded) .brand-name-en { display: none; }
  .sidebar:not(.expanded) .brand-name-cn { font-size: 14px; letter-spacing: 2px; }
  .sidebar:not(.expanded) .brand-plate { padding: var(--space-sm); max-width: 56px; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-container { padding: var(--space-md); }
  .sidebar { position: fixed; left: -260px; z-index: 100; }
  .sidebar.open { left: 0; }
  .sidebar-overlay { display: block; }
}

/* ── 登录页面 ── */
.login-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: var(--bg-deep);
}

.login-card {
  width: 400px;
  padding: 48px 40px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(40px) saturate(1.4);
  -webkit-backdrop-filter: blur(40px) saturate(1.4);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
  animation: springIn 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.login-card .login-brand {
  text-align: center;
  margin-bottom: 36px;
}

.login-card .login-brand .brand-name-cn {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 12px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-card .login-brand .brand-name-en {
  font-size: 13px;
  color: var(--text-tertiary);
  letter-spacing: 6px;
  margin-top: 6px;
}

.login-card .login-brand .brand-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 12px;
  letter-spacing: 2px;
}

.login-card .form-group {
  margin-bottom: 20px;
}

.login-card .form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.login-card .form-group input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-sans);
  transition: all 0.2s;
  outline: none;
  box-sizing: border-box;
}

.login-card .form-group input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.login-card .form-group input::placeholder {
  color: var(--text-tertiary);
}

.login-card .btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  margin-top: 8px;
}

.login-card .login-error {
  text-align: center;
  color: var(--error);
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}

.login-card .login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ── 登录页粒子背景单独层级 ── */
.login-page #particle-canvas {
  z-index: -1;
}

/* ═══════════════════════════════════════════════
   AI 算力消耗条
   ═══════════════════════════════════════════════ */

.ai-cost-bar {
  background: linear-gradient(135deg, rgba(30,40,80,0.06), rgba(60,30,80,0.04));
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 3px 20px;
  font-size: 11px;
  font-family: var(--font-mono, 'SF Mono', Monaco, 'Cascadia Code', monospace);
  color: var(--text-tertiary);
  user-select: none;
}

.ai-cost-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-cost-icon {
  font-size: 12px;
  line-height: 1;
}

.ai-cost-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-cost-divider {
  color: rgba(0,0,0,0.12);
  font-size: 10px;
}

.ai-cost-item {
  color: var(--text-tertiary);
  font-size: 11px;
}

.ai-cost-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

.ai-cost-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 4px;
}

.ai-cost-dot.online {
  background: #22c55e;
  box-shadow: 0 0 4px rgba(34,197,94,0.4);
}

.ai-cost-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 4px rgba(239,68,68,0.4);
}

.ai-cost-status {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* 暗色主题适配 */
[data-theme="dark"] .ai-cost-bar {
  background: linear-gradient(135deg, rgba(30,40,80,0.15), rgba(60,30,80,0.1));
  border-bottom-color: rgba(255,255,255,0.06);
}

/* ═══════════════════════════════════════════════════════
   🎬 PHASE 1: 数字计数 + 卡片悬浮 + 点击波纹
   ═══════════════════════════════════════════════════════ */

/* ── 卡片悬浮抬升 ── */
.glass-card {
  position: relative;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease;
  will-change: transform;
}
.glass-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(99, 102, 241, 0.10);
}
.glass-card:active {
  transform: translateY(-1px);
}

/* ── 卡片光泽扫过（仅桌面 hover） ── */
@media (hover: hover) {
  .glass-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,0.25) 48%, transparent 58%);
    background-size: 200% 100%;
    background-position: 120% 0;
    transition: background-position 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    border-radius: inherit;
    z-index: 0;
  }
  .glass-card:hover::after {
    background-position: -60% 0;
  }
}

/* ── 按钮点击波纹 ── */
.btn {
  position: relative;
  overflow: hidden;
}
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out forwards;
  pointer-events: none;
  z-index: 1;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ── 数值出现动画 ── */
.stat-fade-in {
  opacity: 0;
  transform: translateY(8px);
  animation: statFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes statFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════
   🎬 PHASE 2: 骨架屏 + 页面过渡
   ═══════════════════════════════════════════════════════ */

/* ── 骨架屏 ── */
.skeleton {
  background: linear-gradient(90deg,
    var(--glass-quiet) 25%,
    rgba(255,255,255,0.5) 50%,
    var(--glass-quiet) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
}
.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
  width: 100%;
}
.skeleton-line:last-child { width: 60%; }
.skeleton-card {
  height: 120px;
  margin-bottom: 16px;
}
.skeleton-title {
  height: 22px;
  width: 40%;
  margin-bottom: 16px;
}
@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── 页面过渡 ── */
.page-container {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.page-container.page-enter {
  opacity: 1;
  transform: translateY(0);
}
.page-container.page-leave {
  opacity: 0;
  transform: translateY(-6px);
}

/* ═══════════════════════════════════════════════════════
   🎬 PHASE 3: 柱条弹入 + 逐项显现
   ═══════════════════════════════════════════════════════ */

/* ── 柱状条弹入 ── */
.bar-grow {
  animation: barGrow 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform-origin: left center;
}
@keyframes barGrow {
  from { transform: scaleX(0); }
}

/* ── 逐项显现（stagger） ── */
.stagger-item {
  opacity: 0;
  transform: translateY(10px);
  animation: staggerFadeIn 0.4s ease forwards;
}
.stagger-item:nth-child(1)  { animation-delay: 0.03s; }
.stagger-item:nth-child(2)  { animation-delay: 0.06s; }
.stagger-item:nth-child(3)  { animation-delay: 0.09s; }
.stagger-item:nth-child(4)  { animation-delay: 0.12s; }
.stagger-item:nth-child(5)  { animation-delay: 0.15s; }
.stagger-item:nth-child(6)  { animation-delay: 0.18s; }
.stagger-item:nth-child(7)  { animation-delay: 0.21s; }
.stagger-item:nth-child(8)  { animation-delay: 0.24s; }
.stagger-item:nth-child(9)  { animation-delay: 0.27s; }
.stagger-item:nth-child(10) { animation-delay: 0.30s; }
@keyframes staggerFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════
   🎬 PHASE 4: 粒子增强（由 particles.js 处理）
   ═══════════════════════════════════════════════════════ */

#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.login-page #particle-canvas {
  z-index: -1;
}

/* ── 内容层确保在粒子之上 ── */
.app-layout, .login-page .login-card {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════
   🔢 数字排版系统 — 醒目、美观、动效
   ═══════════════════════════════════════════════════════ */

/* ── 数字字体优化 ── */
:root {
  --font-num: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code',
              'Consolas', 'Liberation Mono', monospace;
  --font-num-display: 'JetBrains Mono', 'SF Mono', 'Fira Code',
                       'Cascadia Code', 'Consolas', monospace;
}

/* ── 数字基础样式（等宽 + 高级数字特性） ── */
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em;
}

/* ── 超大展示数字（主指标：36px） ── */
.num-hero {
  font-family: var(--font-num-display);
  font-size: 38px;
  font-weight: 800;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.25));
}

/* ── 大号数字（次级指标：28px） ── */
.num-large {
  font-family: var(--font-num-display);
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* ── 中号数字（22px 卡片内） ── */
.num-mid {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ── 小号数字（表格/列表） ── */
.num-sm {
  font-family: var(--font-num);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ── 颜色变体 ── */
.num-primary { color: var(--primary-500); }
.num-success { color: var(--success); }
.num-warning { color: var(--warning); }
.num-danger  { color: var(--error); }
.num-muted   { color: var(--text-tertiary); }

.num-hero-success {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.25));
}

.num-hero-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.25));
}

/* ── 渐变背景卡片（用在顶部统计数据上） ── */
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background: radial-gradient(circle at 30% 20%, var(--primary-500), transparent 70%);
  pointer-events: none;
}
.stat-card-success::before {
  background: radial-gradient(circle at 30% 20%, #10b981, transparent 70%);
  opacity: 0.08;
}
.stat-card-warning::before {
  background: radial-gradient(circle at 30% 20%, #f59e0b, transparent 70%);
  opacity: 0.08;
}

/* ── 数字呼吸发光（用于最重要的指标） ── */
.num-glow {
  animation: numGlow 3s ease-in-out infinite;
}
@keyframes numGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.2)); }
  50%      { filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.4)); }
}
.num-glow-success {
  animation: numGlowSuccess 3s ease-in-out infinite;
}
@keyframes numGlowSuccess {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.2)); }
  50%      { filter: drop-shadow(0 0 16px rgba(16, 185, 129, 0.4)); }
}

/* ── 百分比进度数字（达成率） ── */
.num-pct {
  font-family: var(--font-num-display);
  font-size: 40px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}

/* ── 货币符号对齐 ── */
.num-currency {
  font-size: 0.6em;
  font-weight: 400;
  opacity: 0.7;
  vertical-align: super;
  margin-right: 2px;
}

/* ── 变化箭头（升/降） ── */
.num-arrow-up {
  color: var(--success);
  font-weight: 700;
}
.num-arrow-down {
  color: var(--error);
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════
   📰 杂志风格排版 — 用于策论Agent AI报告
   ═══════════════════════════════════════════════════════ */

.magazine-report {
  font-size: 16px;
  line-height: 2;
  color: var(--text-primary);
  padding: 8px 4px;
}

.magazine-report h1,
.magazine-report h2,
.magazine-report h3 {
  font-weight: 700;
  margin: 24px 0 12px 0;
  line-height: 1.4;
  letter-spacing: 0.5px;
}

.magazine-report h1 { font-size: 22px; }
.magazine-report h2 {
  font-size: 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(99, 102, 241, 0.15);
}
.magazine-report h3 { font-size: 16px; color: var(--primary-500); }

.magazine-report p {
  margin: 10px 0;
  font-size: 15px;
  line-height: 1.9;
}

.magazine-report ul,
.magazine-report ol {
  padding-left: 24px;
  margin: 10px 0;
}

.magazine-report li {
  margin: 6px 0;
  font-size: 15px;
  line-height: 1.7;
}

.magazine-report strong {
  font-weight: 700;
  color: var(--primary-600);
}

.magazine-report blockquote {
  border-left: 3px solid var(--primary-400);
  padding: 10px 16px;
  margin: 16px 0;
  background: rgba(99, 102, 241, 0.04);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* ── 杂志风格卡片 ── */
.magazine-card {
  background: var(--glass-floating);
  border-radius: 12px;
  padding: 28px 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.04);
}

.magazine-card .magazine-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.magazine-card .magazine-subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: -10px;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

/* ── 杂志风格高亮框 ── */
.magazine-highlight {
  background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.02));
  border-radius: 10px;
  padding: 20px 24px;
  margin: 16px 0;
  border: 1px solid rgba(99,102,241,0.08);
}

.magazine-highlight .highlight-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--primary-500);
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════
   📕 小红书爆款风格 — AI报告展示
   ═══════════════════════════════════════════════════════ */

.xhs-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.03);
  max-width: 720px;
  margin: 0 auto;
}

.xhs-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}

.xhs-header .xhs-emoji {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}

.xhs-header .xhs-title {
  font-size: 20px;
  font-weight: 800;
  color: #1a1a2e;
  letter-spacing: 1px;
  line-height: 1.4;
}

.xhs-header .xhs-subtitle {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
  letter-spacing: 0.5px;
}

.xhs-body {
  font-size: 15px;
  line-height: 1.9;
  color: #2d2d3a;
}

.xhs-body h1,
.xhs-body h2,
.xhs-body h3 {
  font-weight: 700;
  margin: 24px 0 10px 0;
  line-height: 1.4;
  color: #1a1a2e;
}

.xhs-body h2 {
  font-size: 17px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(139,92,246,0.03));
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.xhs-body h3 {
  font-size: 15px;
  color: #6366f1;
}

.xhs-body p {
  margin: 10px 0;
  font-size: 15px;
  line-height: 1.9;
}

.xhs-body ul,
.xhs-body ol {
  padding-left: 20px;
  margin: 10px 0;
}

.xhs-body li {
  margin: 6px 0;
  font-size: 15px;
  line-height: 1.8;
}

.xhs-body strong {
  font-weight: 700;
  color: #1a1a2e;
  background: linear-gradient(180deg,transparent 60%,rgba(99,102,241,0.15) 60%);
  padding: 0 2px;
}

.xhs-body blockquote {
  border-left: none;
  padding: 14px 18px;
  margin: 16px 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.02));
  border-radius: 10px;
  font-style: normal;
  color: #2d2d3a;
  font-size: 14px;
  position: relative;
}

.xhs-body blockquote::before {
  content: '💡';
  margin-right: 8px;
}

.xhs-divider {
  text-align: center;
  margin: 20px 0;
  color: #ddd;
  font-size: 12px;
  letter-spacing: 4px;
}

.xhs-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed rgba(0,0,0,0.06);
  text-align: center;
  font-size: 12px;
  color: #bbb;
  letter-spacing: 0.5px;
}

/* ── 数据卡片（小红书风格） ── */
.xhs-data-row {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}

.xhs-data-item {
  flex: 1;
  text-align: center;
  padding: 16px 8px;
  background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.02));
  border-radius: 12px;
  border: 1px solid rgba(99,102,241,0.06);
}

.xhs-data-item .xhs-data-label {
  font-size: 11px;
  color: #999;
  margin-bottom: 4px;
}

.xhs-data-item .xhs-data-value {
  font-size: 20px;
  font-weight: 800;
  color: #6366f1;
  font-family: var(--font-num);
}

.xhs-tag {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(99,102,241,0.06);
  border-radius: 20px;
  font-size: 12px;
  color: #6366f1;
  margin: 2px 4px;
}

/* ── 警告框（小红书风格） ── */
.xhs-alert {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(239,68,68,0.04), rgba(248,113,113,0.02));
  border-radius: 12px;
  border: 1px solid rgba(239,68,68,0.08);
  margin: 16px 0;
}

.xhs-alert .xhs-alert-title {
  font-size: 13px;
  font-weight: 700;
  color: #ef4444;
  margin-bottom: 6px;
}

/* ═══════════════════════════════════════════════════════
   🌙 暗黑模式
   ═══════════════════════════════════════════════════════ */

[data-theme="dark"] {
  --bg-deep: #0f0f1a;
  --bg-surface: #1a1a2e;
  --bg-elevated: #222240;
  --bg-sidebar: #1a1a2e;

  --glass-wash: rgba(255, 255, 255, 0.02);
  --glass-quiet: rgba(255, 255, 255, 0.04);
  --glass-resting: rgba(30, 30, 50, 0.85);
  --glass-floating: rgba(30, 30, 50, 0.92);
  --glass-overlay: rgba(20, 20, 40, 0.96);

  --text-primary: rgba(235, 235, 245, 0.92);
  --text-secondary: rgba(235, 235, 245, 0.65);
  --text-tertiary: rgba(235, 235, 245, 0.40);
  --text-inverse: #f0f0ff;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .glass-card {
  background: rgba(30, 30, 50, 0.6);
  border-color: rgba(255,255,255,0.06);
}

[data-theme="dark"] .glass-card::after {
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,0.05) 48%, transparent 58%);
}

[data-theme="dark"] .xhs-card {
  background: #1a1a2e;
  border-color: rgba(255,255,255,0.06);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

[data-theme="dark"] .xhs-header .xhs-title { color: #e8e8f0; }
[data-theme="dark"] .xhs-body { color: #c8c8d4; }
[data-theme="dark"] .xhs-body strong { color: #e8e8f0; background: linear-gradient(180deg,transparent 60%,rgba(99,102,241,0.2) 60%); }
[data-theme="dark"] .xhs-body h2 { color: #e8e8f0; }
[data-theme="dark"] .xhs-body blockquote { color: #c8c8d4; }
[data-theme="dark"] .xhs-footer { color: #555; }
[data-theme="dark"] .xhs-header .xhs-subtitle { color: #666; }

[data-theme="dark"] .data-table thead th { background: rgba(255,255,255,0.03); color: var(--text-secondary); }
[data-theme="dark"] .data-table tbody tr:hover { background: rgba(255,255,255,0.03); }

[data-theme="dark"] .btn-ghost { color: var(--text-secondary); }
[data-theme="dark"] .btn-ghost:hover { background: rgba(255,255,255,0.06); }

[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background: rgba(30,30,50,0.8) !important;
  color: var(--text-primary) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

[data-theme="dark"] .badge { background: rgba(255,255,255,0.06); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

[data-theme="dark"] .stat-card::before { opacity: 0.12; }
[data-theme="dark"] .num-hero { filter: drop-shadow(0 2px 12px rgba(99, 102, 241, 0.4)); }
[data-theme="dark"] .num-hero-success { filter: drop-shadow(0 2px 12px rgba(16, 185, 129, 0.4)); }

/* 暗黑模式切换按钮 */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}
.theme-toggle:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}
