/**
 * Enterprise Intranet Design System - UI/UX Pro Max Edition
 * Built on Swiss Modernism & B2B Trust & Authority Architecture
 * Standards: WCAG 2.2 AA Contrast >= 4.5:1, 8dp Spacing, SVG Icons, Zero Emojis
 */

:root {
  /* 基础主色体系 (Trust Slate Blue & Security Emerald) */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-active: #1e40af;
  --color-primary-light: #eff6ff;
  --color-primary-border: #bfdbfe;

  --color-accent: #059669;
  --color-accent-light: #ecfdf5;
  --color-accent-border: #a7f3d0;

  --color-warning: #d97706;
  --color-warning-light: #fffbeb;
  --color-warning-border: #fde68a;

  --color-danger: #dc2626;
  --color-danger-light: #fef2f2;
  --color-danger-border: #fecaca;

  --color-audit: #7c3aed;
  --color-audit-light: #f5f3ff;
  --color-audit-border: #ddd6fe;

  /* 背景与表面层级 */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-secondary: #f1f5f9;
  --bg-surface-tertiary: #e2e8f0;

  /* 文字颜色体系 (确保 WCAG 4.5:1 文本对比度) */
  --text-main: #0f172a;       /* 900 */
  --text-secondary: #334155;  /* 700 */
  --text-muted: #64748b;      /* 500 - contrast ~ 4.6:1 */
  --text-inverse: #ffffff;

  /* 边框体系 */
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #2563eb;

  /* 阴影与微光 */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 0 3px rgba(37, 99, 235, 0.18);

  /* 间距与圆角 */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* 动效曲线 */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 220ms;
}

/* 基础重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* 统一矢量图标样式 (零 Emoji 依赖，专业矢量渲染) */
.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-xs { width: 14px; height: 14px; stroke-width: 2; }
.icon-sm { width: 16px; height: 16px; stroke-width: 2; }
.icon-md { width: 20px; height: 20px; stroke-width: 1.75; }
.icon-lg { width: 24px; height: 24px; stroke-width: 1.75; }

/* 键盘可访问性焦点状态 (WCAG 2.2 AAA Focus Ring) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* 顶部导航栏 */
.navbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(8px);
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-main);
  text-decoration: none;
}

.brand-icon-wrap {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #1e3a5f, #0f172a);
  color: #38bdf8;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.brand-badge {
  background: #0f172a;
  color: #38bdf8;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.75px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* 导航链接 */
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-secondary);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  background: transparent;
  border: none;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--duration-fast) var(--ease-spring);
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.7);
}

.nav-tab.active {
  color: var(--color-primary);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  font-weight: 700;
}

/* 用户状态胶囊 */
.user-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  box-shadow: var(--shadow-xs);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.role-admin {
  background: var(--color-danger-light);
  color: #991b1b;
  border: 1px solid var(--color-danger-border);
}
.role-lead {
  background: var(--color-warning-light);
  color: #92400e;
  border: 1px solid var(--color-warning-border);
}
.role-staff {
  background: var(--color-primary-light);
  color: #1e40af;
  border: 1px solid var(--color-primary-border);
}

/* 按钮规范 (带按压物理反馈，符合 Touch & Interaction 标准) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-spring);
  border: 1px solid transparent;
  user-select: none;
  min-height: 38px;
}

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

.btn-primary {
  background: var(--color-primary);
  color: var(--text-inverse);
  box-shadow: 0 1px 2px 0 rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 2px 6px 0 rgba(37, 99, 235, 0.35);
}

.btn-outline {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
  background: var(--bg-surface-secondary);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.btn-danger {
  background: var(--color-danger-light);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}
.btn-danger:hover {
  background: #fee2e2;
  color: #991b1b;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
  min-height: 30px;
  gap: 5px;
}

/* 主内容布局 */
.main-container {
  max-width: 1440px;
  margin: 32px auto;
  padding: 0 28px;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.section-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Bento 风格统计卡片网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-surface);
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-spring);
}

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

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin: 4px 0 6px 0;
  font-feature-settings: "tnum";
}

.stat-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 卡片容器 */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

/* 凭证列表网格 */
.cred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 22px;
}

.cred-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-spring);
  position: relative;
}

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

.cred-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 12px;
}

.cred-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}

.cred-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.type-shared {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid var(--color-primary-border);
}
.type-exclusive {
  background: var(--color-warning-light);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}
.type-pooled {
  background: var(--color-audit-light);
  color: var(--color-audit);
  border: 1px solid var(--color-audit-border);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.available { background: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent-border); }
.status-dot.occupied { background: var(--color-danger); }

.cred-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-surface-secondary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-label {
  color: var(--text-muted);
  min-width: 60px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
}

.cred-notes {
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  border-left: 3px solid var(--color-primary);
  line-height: 1.5;
}

.cred-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag-badge {
  background: var(--bg-surface-secondary);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
}

.cred-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  gap: 8px;
}

/* 看板布局 */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
  align-items: flex-start;
}

.kanban-col {
  background: #f1f5f9;
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 520px;
  border: 1px solid var(--border-subtle);
}

.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-subtle);
}

.col-badge {
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
}

.task-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--duration-fast) var(--ease-spring);
}

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

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.task-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text-main);
}

.prio-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.prio-urgent { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.prio-high { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.prio-normal { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.prio-low { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

.task-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.task-link-cred {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-primary-light);
  border: 1px dashed var(--color-primary-border);
  color: var(--color-primary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.task-link-cred:hover {
  background: #dbeafe;
}

.task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

/* 审计日志表格 */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: #f8fafc;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.data-table tr:hover {
  background: #f8fafc;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 800;
}

.level-AUDIT { background: var(--color-audit-light); color: var(--color-audit); border: 1px solid var(--color-audit-border); }
.level-WARN { background: var(--color-warning-light); color: var(--color-warning); border: 1px solid var(--color-warning-border); }
.level-INFO { background: var(--color-primary-light); color: var(--color-primary); border: 1px solid var(--color-primary-border); }
.level-ERROR { background: var(--color-danger-light); color: var(--color-danger); border: 1px solid var(--color-danger-border); }

/* 模态框 Modal (Swiss Clarity + High Isolation) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-spring);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 92%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform var(--duration-normal) var(--ease-spring);
  border: 1px solid var(--border-subtle);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.modal-close:hover {
  background: var(--bg-surface-secondary);
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* 核心查密高科技保险箱呈现盒 (Trust & High Security Vault Box) */
.secret-vault-box {
  background: #090d16;
  color: #38bdf8;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  word-break: break-all;
  border: 1px solid #1e293b;
  margin: 6px 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* 批量自取卡密/Token 列表展示盒 */
.reveal-batch-items-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
  margin: 6px 0;
}

.reveal-batch-item-row {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s, background 0.15s;
}

.reveal-batch-item-row:hover {
  border-color: #38bdf8;
  background: #0c1220;
}

.reveal-item-index {
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  color: #64748b;
  background: #1e293b;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.reveal-item-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #38bdf8;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  word-break: break-all;
  flex: 1;
  transition: filter 0.2s;
}

.quick-count-chip {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-count-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.quick-count-chip.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #ffffff;
}

.audit-warning-box {
  background: var(--color-warning-light);
  border: 1px solid var(--color-warning-border);
  color: #92400e;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.83rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

/* 表单输入控件规范 */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-control {
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--duration-fast);
  width: 100%;
  background: var(--bg-surface);
  color: var(--text-main);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow);
}

/* 吐司通知 Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--color-primary);
  animation: slideIn var(--duration-normal) var(--ease-spring) forwards;
}

.toast-success { border-left-color: var(--color-accent); }
.toast-error { border-left-color: var(--color-danger); }
.toast-warning { border-left-color: var(--color-warning); }
.toast-audit { border-left-color: var(--color-audit); }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 过滤组件 Pills */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.filter-pill:hover {
  background: var(--bg-surface-secondary);
  color: var(--text-main);
}

.filter-pill.active {
  background: var(--color-primary);
  color: var(--text-inverse);
  border-color: var(--color-primary);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

/* 登录全屏界面 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0f172a 100%);
}

.login-card {
  background: var(--bg-surface);
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-xl);
  padding: 38px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-demo-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.demo-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
  color: var(--text-secondary);
}

.demo-pill:hover {
  background: var(--bg-surface-tertiary);
  color: var(--text-main);
  border-color: var(--border-strong);
}

/* 空状态设计规范 (Empty States) */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  stroke: var(--border-strong);
  margin-bottom: 14px;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 320px;
}

/* 计件任务专属组件规范 (Piecework Task & Proof Submission) */
.type-badge-piecework {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.piecework-progress-box {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #06b6d4);
  border-radius: var(--radius-full);
  transition: width 0.35s var(--ease-spring);
}

.progress-fill.complete {
  background: linear-gradient(90deg, #10b981, #059669);
}

.submission-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.submission-item {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--duration-fast);
}

.submission-item:hover {
  border-color: var(--border-strong);
  background: #f8fafc;
}

.submission-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.submission-qty-badge {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid var(--color-primary-border);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.78rem;
}

/* ================= 产出资产交付仓库 (Digital Asset Depot) ================= */
.warehouse-stat-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.warehouse-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.warehouse-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-primary);
}

.warehouse-stat-card.stat-warning::before {
  background: var(--color-warning);
}

.warehouse-stat-card.stat-accent::before {
  background: var(--color-accent);
}

.warehouse-stat-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.warehouse-stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.warehouse-stat-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.warehouse-view-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.depot-zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.depot-rack-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast), box-shadow var(--duration-fast), border-color var(--duration-fast);
  cursor: pointer;
  position: relative;
}

.depot-rack-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.depot-rack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.zone-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: var(--color-primary);
  border: 1px solid #cbd5e1;
  letter-spacing: 0.5px;
}

.zone-keeper {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.depot-rack-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.depot-rack-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.depot-rack-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.depot-capacity-track {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  display: flex;
  margin-bottom: 14px;
}

.depot-capacity-active {
  height: 100%;
  background: var(--color-accent);
}

.depot-capacity-pending {
  height: 100%;
  background: var(--color-warning);
}

.depot-stats-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 14px;
  text-align: center;
}

.depot-stat-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.depot-stat-cell-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.depot-stat-cell-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.depot-latest-preview {
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: #fff;
  border: 1px dashed var(--border-subtle);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.depot-rack-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  gap: 8px;
}

.depot-drilldown-header {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 16px;
}

.zone-code-pill {
  font-family: var(--font-mono);
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid var(--color-primary-border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 800;
}
