/* ==========================================
   生活物资管理系统 - 全局样式
   风格参考：华为/OPPO 简洁科技风
   ========================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.06);
  --shadow-md: 0 4px 12px 0 rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.04);
  --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.04);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar-width: 260px;
  --header-height: 68px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ==========================================
   工具类
   ========================================== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
  .grid-cols-2 { grid-template-columns: 1fr; }
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.w-full { width: 100%; }

/* ==========================================
   按钮
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgb(0 0 0 / 0.15);
}

.btn:hover::after { opacity: 1; }

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 12px -2px rgb(37 99 235 / 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 6px 20px -4px rgb(37 99 235 / 0.45);
}

.btn-secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

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

.btn-success {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  color: white;
  box-shadow: 0 4px 12px -2px rgb(16 185 129 / 0.35);
}

.btn-success:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-danger {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  color: white;
  box-shadow: 0 4px 12px -2px rgb(239 68 68 / 0.35);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(0,0,0,0.04);
  color: var(--text);
}

.btn-sm { padding: 6px 14px; font-size: 0.875rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
}

/* ==========================================
   表单
   ========================================== */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: white;
  transition: var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.form-input::placeholder { color: #94a3b8; }

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 6px;
}

/* ==========================================
   卡片
   ========================================== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  opacity: 0;
  transition: opacity 0.3s;
}

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

.card:hover::before { opacity: 1; }

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

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body { padding: 24px; }
.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

/* ==========================================
   统计卡片 - 全新渐变设计
   ========================================== */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
  transform: translate(30%, -30%);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.stat-card.success::after { background: radial-gradient(circle, rgba(16,185,129,0.08) 0%, transparent 70%); }
.stat-card.warning::after { background: radial-gradient(circle, rgba(245,158,11,0.08) 0%, transparent 70%); }
.stat-card.danger::after { background: radial-gradient(circle, rgba(239,68,68,0.08) 0%, transparent 70%); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.5rem;
  position: relative;
  z-index: 1;
}

.stat-icon.blue {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: var(--primary);
  box-shadow: 0 4px 12px -2px rgb(37 99 235 / 0.2);
}

.stat-icon.green {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: var(--success);
  box-shadow: 0 4px 12px -2px rgb(16 185 129 / 0.2);
}

.stat-icon.orange {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
  box-shadow: 0 4px 12px -2px rgb(245 158 11 / 0.2);
}

.stat-icon.red {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: var(--danger);
  box-shadow: 0 4px 12px -2px rgb(239 68 68 / 0.2);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* ==========================================
   欢迎横幅
   ========================================== */
.welcome-banner {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #3b82f6 100%);
  border-radius: var(--radius);
  padding: 28px 32px;
  color: white;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px -5px rgb(37 99 235 / 0.3);
}

.welcome-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
}

.welcome-banner::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 60%);
}

.welcome-banner h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.welcome-banner p {
  opacity: 0.85;
  font-size: 0.9375rem;
  position: relative;
  z-index: 1;
}

/* ==========================================
   表格
   ========================================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: white;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  font-size: 0.9375rem;
}

.data-table thead {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.data-table th {
  padding: 14px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}

.data-table th:first-child { border-radius: var(--radius) 0 0 0; }
.data-table th:last-child { border-radius: 0 var(--radius) 0 0; }

.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
}

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

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

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

.data-table tbody tr:last-child td:first-child { border-radius: 0 0 0 var(--radius); }
.data-table tbody tr:last-child td:last-child { border-radius: 0 0 var(--radius) 0; }

/* 状态标签 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-normal {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
}

.badge-low {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.badge-out {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

.badge-checking {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
}

/* ==========================================
   侧边栏导航
   ========================================== */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
  box-shadow: 4px 0 24px -4px rgb(0 0 0 / 0.04);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px -2px rgb(37 99 235 / 0.3);
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 0 12px;
  margin-bottom: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: #475569;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  margin-bottom: 4px;
}

.nav-item:hover {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: var(--text);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: var(--primary);
  box-shadow: 0 2px 8px -2px rgb(37 99 235 / 0.15);
}

.nav-item svg {
  flex-shrink: 0;
  stroke-width: 2.2px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px -2px rgb(37 99 235 / 0.3);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ==========================================
   主内容区
   ========================================== */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-height);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, var(--primary), #60a5fa);
  border-radius: 2px;
}

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

.content {
  flex: 1;
  padding: 28px 32px 40px;
}

/* ==========================================
   搜索和过滤
   ========================================== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

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

.search-box input {
  width: 100%;
  padding: 11px 16px 11px 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  outline: none;
  transition: var(--transition);
  background: white;
  font-family: inherit;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

/* ==========================================
   模态框
   ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.modal {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.92) translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--border);
}

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

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 1.125rem;
}

.modal-close:hover {
  background: var(--border);
  color: var(--text);
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

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

/* ==========================================
   登录/注册页面
   ========================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 50%, #d1dce8 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgb(59 130 246 / 0.1) 0%, transparent 65%);
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgb(16 185 129 / 0.08) 0%, transparent 65%);
  pointer-events: none;
}

.auth-container {
  display: flex;
  width: 100%;
  max-width: 1040px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.15);
  overflow: hidden;
  position: relative;
  z-index: 1;
  min-height: 620px;
  border: 1px solid var(--border);
}

.auth-visual {
  flex: 1;
  background: linear-gradient(160deg, #1e3a5f 0%, #2563eb 40%, #3b82f6 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  color: white;
  position: relative;
  overflow: hidden;
}

.auth-visual::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-visual::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
}

.auth-visual-content {
  position: relative;
  z-index: 1;
}

.auth-visual h2 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.auth-visual p {
  font-size: 1rem;
  opacity: 0.85;
  line-height: 1.8;
  margin-bottom: 40px;
  font-weight: 400;
}

.visual-features {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.visual-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9375rem;
  font-weight: 500;
}

.visual-feature svg {
  flex-shrink: 0;
  stroke-width: 2.5px;
}

.auth-form-wrapper {
  flex: 1;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 480px;
}

.auth-header {
  margin-bottom: 32px;
}

.auth-header h1 {
  font-size: 1.875rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  background: var(--bg);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.auth-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 8px -2px rgb(0 0 0 / 0.1);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ==========================================
   空状态 - 更精致
   ========================================== */
.empty-state {
  text-align: center;
  padding: 72px 24px;
}

.empty-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: inset 0 2px 8px rgb(0 0 0 / 0.04);
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-desc {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 0.9375rem;
}

/* ==========================================
   Toast 提示
   ========================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 320px;
  max-width: 440px;
  border-left: 4px solid var(--primary);
  animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--border);
  border-left-width: 4px;
}

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

.toast-message {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition);
}

.toast-close:hover {
  background: var(--bg);
  color: var(--text);
}

@keyframes slideIn {
  from { transform: translateX(120%) scale(0.9); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); }
}

/* ==========================================
   盘点进度条
   ========================================== */
.progress-ring {
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
}

.progress-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
  font-size: 1.5rem;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  fill: var(--text);
}

/* ==========================================
   盘点项
   ========================================== */
.check-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: white;
  transition: var(--transition);
  position: relative;
}

.check-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.check-item-info {
  flex: 1;
}

.check-item-name {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 1rem;
}

.check-item-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.check-item-actions {
  display: flex;
  gap: 10px;
}

.check-btn {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: white;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.check-btn:hover {
  background: var(--bg);
  transform: translateY(-1px);
}

.check-btn.match {
  border-color: var(--success);
  color: var(--success);
}

.check-btn.match:hover,
.check-btn.match.active {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px -2px rgb(16 185 129 / 0.3);
}

.check-btn.mismatch {
  border-color: var(--danger);
  color: var(--danger);
}

.check-btn.mismatch:hover,
.check-btn.mismatch.active {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px -2px rgb(239 68 68 / 0.3);
}

.check-item.checked {
  opacity: 0.6;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

/* ==========================================
   盘点结果统计
   ========================================== */
.check-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.check-summary-item {
  text-align: center;
  padding: 24px;
  border-radius: var(--radius);
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.check-summary-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.check-summary-value {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.check-summary-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ==========================================
   分页
   ========================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.page-btn.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px -2px rgb(37 99 235 / 0.35);
}

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

/* ==========================================
   响应式
   ========================================== */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .sidebar-toggle { display: flex !important; }
}

@media (max-width: 768px) {
  .auth-container { flex-direction: column; max-width: 420px; }
  .auth-visual { display: none; }
  .auth-form-wrapper { padding: 32px 24px; }
  .content { padding: 20px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { width: 100%; }
  .check-summary { grid-template-columns: 1fr; }
  .modal { max-width: 100%; margin: 16px; }
  .welcome-banner h2 { font-size: 1.25rem; }
}

/* 移动端菜单按钮 */
.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.sidebar-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 遮罩层 */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 0.35);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================
   动画
   ========================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 盘点历史时间线 */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--border));
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  padding-bottom: 28px;
}

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--primary);
  z-index: 1;
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-dot.success { border-color: var(--success); }
.timeline-dot.warning { border-color: var(--warning); }
.timeline-dot.danger { border-color: var(--danger); }

.timeline-content {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.timeline-content:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.timeline-date {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.timeline-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 1rem;
}

.timeline-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* 数量输入 */
.qty-input {
  width: 90px;
  text-align: center;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  outline: none;
  font-weight: 600;
  transition: var(--transition);
}

.qty-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

/* 盘点记录差异样式 */
.diff-normal { color: var(--success); font-weight: 700; }
.diff-warning { color: var(--warning); font-weight: 700; }
.diff-danger { color: var(--danger); font-weight: 700; }

/* 快捷操作卡片 */
.quick-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  background: white;
  border: 1.5px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.quick-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  opacity: 0;
  transition: opacity 0.3s;
}

.quick-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.quick-card:hover::before { opacity: 1; }

/* 分类筛选 */
.category-filter { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-chip {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}
.filter-chip.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px -2px rgb(37 99 235 / 0.35);
}

/* Tab 切换 */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  width: fit-content;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 8px -2px rgb(0 0 0 / 0.1);
}

/* 仪表盘头部装饰 */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 1024px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr; }
}
