/* ============================================
   UI/UX Pro Max - Design System
   销售盈利测算器 - 现代极简 + 玻璃拟态风格
   ============================================ */

/* ============================================
   1. CSS 变量系统
   ============================================ */
:root {
  /* 主色调 - 专业蓝 */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;

  /* 中性色 */
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;

  /* 功能色 */
  --success-50: #f0fdf4;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --error-50: #fef2f2;
  --error-500: #ef4444;
  --error-600: #dc2626;

  /* 玻璃拟态效果 */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-bg-hover: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-border-strong: rgba(255, 255, 255, 0.8);
  --blur-amount: blur(20px);
  --blur-amount-lg: blur(40px);

  /* 阴影系统 */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);

  /* 间距系统 */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */

  /* 圆角系统 */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.25rem;  /* 20px */
  --radius-full: 9999px;

  /* 字体系统 */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", Consolas, Monaco, monospace;

  /* 过渡动画 */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-bounce: 200ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   2. 基础样式重置
   ============================================ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--neutral-700);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* 选择文本颜色 */
::selection {
  background: var(--primary-200);
  color: var(--primary-900);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--neutral-100);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}

/* ============================================
   3. 玻璃拟态组件
   ============================================ */

/* 玻璃容器基础 */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--blur-amount);
  -webkit-backdrop-filter: var(--blur-amount);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}

.glass-hover:hover {
  background: var(--glass-bg-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* 玻璃导航栏 */
.glass-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-base);
}

.glass-nav.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 玻璃卡片 */
.glass-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  overflow: hidden;
}

.glass-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.8);
}

/* 玻璃弹窗 */
.glass-modal {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-2xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
}

/* ============================================
   4. 按钮组件
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--neutral-700);
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--neutral-200);
  border-color: var(--neutral-300);
  color: var(--neutral-800);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 主要按钮 */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2), 0 4px 8px rgba(37, 99, 235, 0.1);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25), 0 8px 16px rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

/* 次要按钮 */
.btn-secondary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
  color: var(--primary-700);
  border: 1px solid rgba(59, 130, 246, 0.3);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.9) 100%);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

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

.btn-ghost:hover:not(:disabled) {
  background: var(--neutral-100);
  color: var(--neutral-800);
}

/* 危险按钮 */
.btn-danger {
  background: linear-gradient(135deg, var(--error-500) 0%, var(--error-600) 100%);
  color: white;
  border: none;
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #f87171 0%, var(--error-500) 100%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

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

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: 16px;
  border-radius: var(--radius-xl);
}

/* 图标按钮 */
.btn-icon {
  padding: var(--space-2);
  border-radius: var(--radius-lg);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

/* ============================================
   5. 表单组件
   ============================================ */

/* 表单组 */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-700);
}

.form-label-required::after {
  content: "*";
  color: var(--error-500);
  margin-left: 4px;
}

.form-hint {
  margin-top: var(--space-1);
  font-size: 12px;
  color: var(--neutral-500);
}

.form-error {
  margin-top: var(--space-1);
  font-size: 12px;
  color: var(--error-600);
}

/* 输入框基础样式 */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--neutral-800);
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--neutral-400);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--neutral-300);
}

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

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: var(--neutral-100);
  color: var(--neutral-500);
  cursor: not-allowed;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error-500);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* 数字输入框 - 用于财务计算 */
.form-input-number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* 输入框尺寸 */
.form-input-sm,
.form-select-sm {
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
}

.form-input-lg,
.form-select-lg {
  padding: var(--space-4) var(--space-5);
  font-size: 16px;
}

/* 带图标的输入框 */
.form-input-icon-wrap {
  position: relative;
}

.form-input-icon-wrap .form-input {
  padding-left: 40px;
}

.form-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--neutral-400);
  pointer-events: none;
}

/* 输入框组 */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-input {
  border-radius: 0;
  flex: 1;
}

.input-group .form-input:first-child {
  border-top-left-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-lg);
}

.input-group .form-input:last-child {
  border-top-right-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.input-group-addon {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-600);
  background: var(--neutral-100);
  border: 1px solid var(--neutral-200);
}

.input-group-addon:first-child {
  border-top-left-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-lg);
  border-right: none;
}

.input-group-addon:last-child {
  border-top-right-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  border-left: none;
}

/* ============================================
   6. 卡片组件
   ============================================ */

.card {
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--neutral-300);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: var(--neutral-50);
  border-bottom: 1px solid var(--neutral-200);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--neutral-800);
  margin: 0;
}

.card-subtitle {
  font-size: 13px;
  color: var(--neutral-500);
  margin-top: 2px;
}

.card-body {
  padding: var(--space-5);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--neutral-50);
  border-top: 1px solid var(--neutral-200);
}

/* 玻璃拟态卡片 */
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--blur-amount);
  -webkit-backdrop-filter: var(--blur-amount);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
  transition: all var(--transition-base);
}

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

/* 数据卡片 */
.card-stat {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--neutral-200);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.card-stat:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-200);
}

.card-stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}

.card-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--neutral-800);
  line-height: 1.2;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.card-stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  margin-top: var(--space-2);
}

.card-stat-change.positive {
  color: var(--success-600);
}

.card-stat-change.negative {
  color: var(--error-600);
}

/* ============================================
   7. 导航组件
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-base);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.navbar-logo {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  border-radius: var(--radius-lg);
  color: white;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.navbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--neutral-800);
  letter-spacing: -0.3px;
}

.navbar-subtitle {
  font-size: 12px;
  color: var(--neutral-500);
  font-weight: 500;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-600);
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--neutral-800);
  background: var(--neutral-100);
}

.nav-link.active {
  color: var(--primary-600);
  background: var(--primary-50);
}

.nav-link svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-800);
}

.user-role {
  font-size: 11px;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-100) 0%, var(--primary-200) 100%);
  border: 2px solid white;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  font-size: 16px;
  color: var(--primary-700);
}

/* ============================================
   8. 内容区域
   ============================================ */

.main-content {
  padding-top: 88px; /* navbar height + spacing */
  padding-bottom: var(--space-8);
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  max-width: 960px;
}

.container-wide {
  max-width: 1600px;
}

/* 页面头部 */
.page-header {
  margin-bottom: var(--space-6);
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--neutral-900);
  letter-spacing: -0.5px;
  margin-bottom: var(--space-2);
}

.page-subtitle {
  font-size: 15px;
  color: var(--neutral-500);
  font-weight: 400;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* ============================================
   9. 弹窗组件
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 80px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-2xl);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), inset 0 1px 0 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  opacity: 0;
  transition: all var(--transition-base);
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--neutral-100);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--neutral-900);
  margin: 0;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--neutral-400);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--neutral-100);
  color: var(--neutral-600);
}

.modal-body {
  padding: var(--space-4) var(--space-5);
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) var(--space-5);
  border-top: 1px solid var(--neutral-100);
  background: var(--neutral-50);
}

/* 大尺寸弹窗 */
.modal-lg {
  max-width: 720px;
}

/* 全屏弹窗 */
.modal-fullscreen {
  max-width: none;
  width: calc(100% - 80px);
  height: calc(100% - 80px);
  max-height: none;
}

.modal-fullscreen .modal-body {
  max-height: none;
  flex: 1;
}

/* ============================================
   10. 标签页组件
   ============================================ */

.tabs {
  display: flex;
  flex-direction: column;
}

.tabs-header {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 0 var(--space-5);
  border-bottom: 2px solid var(--neutral-200);
  background: var(--neutral-50);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-500);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.tab-btn:hover {
  color: var(--neutral-700);
  background: rgba(255, 255, 255, 0.6);
}

.tab-btn.active {
  color: var(--primary-600);
  font-weight: 600;
  border-bottom-color: var(--primary-600);
  background: white;
}

.tab-btn svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.tab-btn.active svg {
  opacity: 1;
}

.tabs-content {
  position: relative;
  background: white;
  border: 1px solid var(--neutral-200);
  border-top: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.tab-panel {
  display: none;
  padding: var(--space-6);
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

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

/* 玻璃拟态标签页 */
.tabs-glass .tabs-header {
  background: var(--glass-bg);
  backdrop-filter: var(--blur-amount);
  -webkit-backdrop-filter: var(--blur-amount);
  border-bottom-color: var(--glass-border);
}

.tabs-glass .tab-btn:hover {
  background: rgba(255, 255, 255, 0.8);
}

.tabs-glass .tab-btn.active {
  background: rgba(255, 255, 255, 0.95);
}

/* ============================================
   11. 数据展示组件
   ============================================ */

/* 数据表格 */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--neutral-200);
}

.data-table th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--neutral-500);
  background: var(--neutral-50);
  border-bottom-width: 2px;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--neutral-50);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* 数值列右对齐 */
.data-table .num-cell,
.data-table th.num-header {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* 紧凑型表格 */
.data-table-compact th,
.data-table-compact td {
  padding: var(--space-2) var(--space-3);
}

/* 卡片式表格 */
.data-table-cards tbody tr {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-2);
}

.data-table-cards tbody tr:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* 数据指标卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.stat-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--neutral-200);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

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

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--neutral-500);
  margin-bottom: var(--space-2);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--neutral-800);
  line-height: 1.2;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  margin-top: var(--space-2);
}

.stat-change.positive {
  color: var(--success-600);
}

.stat-change.negative {
  color: var(--error-600);
}

.stat-change svg {
  width: 14px;
  height: 14px;
}

/* 玻璃拟态数据卡片 */
.stat-card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--blur-amount);
  -webkit-backdrop-filter: var(--blur-amount);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}

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

/* ============================================
   12. 加载和空状态
   ============================================ */

/* 加载动画 */
.loading {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--neutral-500);
  font-size: 14px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--neutral-200);
  border-top-color: var(--primary-500);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

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

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 1.5px;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--neutral-200) 0%, var(--neutral-100) 50%, var(--neutral-200) 100%);
  background-size: 200% 100%;
  border-radius: var(--radius-md);
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

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

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-2);
}

.skeleton-text:last-child {
  width: 80%;
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: var(--space-3);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

.skeleton-card {
  padding: var(--space-5);
}

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

.empty-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neutral-100);
  border-radius: var(--radius-2xl);
  margin-bottom: var(--space-4);
  font-size: 36px;
  color: var(--neutral-400);
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--neutral-800);
  margin-bottom: var(--space-2);
}

.empty-description {
  font-size: 14px;
  color: var(--neutral-500);
  max-width: 400px;
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

/* 错误状态 */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.error-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--error-50);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-4);
  color: var(--error-500);
  font-size: 28px;
}

.error-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--neutral-900);
  margin-bottom: var(--space-2);
}

.error-message {
  font-size: 14px;
  color: var(--error-600);
  max-width: 400px;
  margin-bottom: var(--space-6);
}

/* ============================================
   13. 工具类
   ============================================ */

/* 显示/隐藏 */
.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
}

.visible {
  visibility: visible;
}

/* Flexbox */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.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;
}

.flex-1 {
  flex: 1 1 0%;
}

.flex-auto {
  flex: 1 1 auto;
}

.flex-none {
  flex: none;
}

.gap-1 {
  gap: var(--space-1);
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-5 {
  gap: var(--space-5);
}

.gap-6 {
  gap: var(--space-6);
}

/* Grid */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* 间距 */
.m-0 {
  margin: 0;
}

.mt-1 {
  margin-top: var(--space-1);
}

.mt-2 {
  margin-top: var(--space-2);
}

.mt-3 {
  margin-top: var(--space-3);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-5 {
  margin-top: var(--space-5);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mb-1 {
  margin-bottom: var(--space-1);
}

.mb-2 {
  margin-bottom: var(--space-2);
}

.mb-3 {
  margin-bottom: var(--space-3);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-5 {
  margin-bottom: var(--space-5);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

.p-0 {
  padding: 0;
}

.p-4 {
  padding: var(--space-4);
}

.p-5 {
  padding: var(--space-5);
}

.p-6 {
  padding: var(--space-6);
}

/* 文字对齐 */
.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* 文字颜色 */
.text-neutral-500 {
  color: var(--neutral-500);
}

.text-neutral-600 {
  color: var(--neutral-600);
}

.text-neutral-700 {
  color: var(--neutral-700);
}

.text-neutral-800 {
  color: var(--neutral-800);
}

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

.text-success-600 {
  color: var(--success-600);
}

.text-error-600 {
  color: var(--error-600);
}

/* 字体 */
.font-mono {
  font-family: var(--font-mono);
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

/* 圆角 */
.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);
}

/* 边框 */
.border {
  border: 1px solid var(--neutral-200);
}

.border-b {
  border-bottom: 1px solid var(--neutral-200);
}

.border-primary-200 {
  border-color: var(--primary-200);
}

/* 背景 */
.bg-white {
  background: white;
}

.bg-neutral-50 {
  background: var(--neutral-50);
}

.bg-neutral-100 {
  background: var(--neutral-100);
}

.bg-primary-50 {
  background: var(--primary-50);
}

.bg-primary-600 {
  background: var(--primary-600);
}

/* 阴影 */
.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

/* 溢出 */
.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

.overflow-x-auto {
  overflow-x: auto;
}

.overflow-y-auto {
  overflow-y: auto;
}

/* 截断文本 */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 光标 */
.cursor-pointer {
  cursor: pointer;
}

.cursor-not-allowed {
  cursor: not-allowed;
}

/* 选择 */
.select-none {
  user-select: none;
}

/* 透明度 */
.opacity-0 {
  opacity: 0;
}

.opacity-50 {
  opacity: 0.5;
}

.opacity-75 {
  opacity: 0.75;
}

/* 变换 */
.transform {
  transform: translateX(0);
}

.transition {
  transition: all var(--transition-base);
}

.transition-fast {
  transition: all var(--transition-fast);
}

/* ============================================
   14. 响应式工具
   ============================================ */

@media (max-width: 768px) {
  /* 容器 */
  .container {
    padding: 0 var(--space-4);
  }

  /* 导航 */
  .navbar {
    height: 56px;
    padding: 0 var(--space-4);
  }

  .navbar-title {
    font-size: 16px;
  }

  .navbar-nav {
    display: none;
  }

  /* 内容区域 */
  .main-content {
    padding-top: 72px;
  }

  /* 网格 */
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }

  /* 弹窗 */
  .modal {
    margin: var(--space-4);
    max-height: calc(100vh - 32px);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  /* 标签页 */
  .tabs-header {
    padding: 0 var(--space-4);
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs-header::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex-shrink: 0;
    padding: var(--space-2) var(--space-3);
    font-size: 13px;
  }

  .tab-panel {
    padding: var(--space-4);
  }

  /* 表格 */
  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: var(--space-2) var(--space-3);
  }

  /* 隐藏元素 */
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ============================================
   15. 动画
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* 动画工具类 */
.animate-fadeIn {
  animation: fadeIn 0.3s ease;
}

.animate-fadeInUp {
  animation: fadeInUp 0.4s ease;
}

.animate-fadeInDown {
  animation: fadeInDown 0.4s ease;
}

.animate-slideInLeft {
  animation: slideInLeft 0.4s ease;
}

.animate-slideInRight {
  animation: slideInRight 0.4s ease;
}

.animate-scaleIn {
  animation: scaleIn 0.3s ease;
}

.animate-bounce {
  animation: bounce 0.6s ease;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-shake {
  animation: shake 0.5s ease;
}

/* 延迟动画 */
.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

.delay-400 {
  animation-delay: 0.4s;
}

.delay-500 {
  animation-delay: 0.5s;
}

/* 动画持续时间 */
.duration-fast {
  animation-duration: 0.15s;
}

.duration-normal {
  animation-duration: 0.3s;
}

.duration-slow {
  animation-duration: 0.5s;
}

/* 填充模式 */
.fill-forwards {
  animation-fill-mode: forwards;
}

/* ============================================
   16. 打印样式
   ============================================ */

@media print {
  .navbar,
  .btn,
  .modal,
  .tabs-header {
    display: none !important;
  }

  .main-content {
    padding-top: 0;
  }

  .card,
  .glass-card {
    box-shadow: none;
    border: 1px solid var(--neutral-300);
    break-inside: avoid;
  }

  body {
    background: white;
    color: black;
  }
}

