/**
 * Glassmorphism UI 统一设计系统
 * 适用于所有ERP页面
 * 版本: v1.0
 * 日期: 2026-05-29
 */

/* ===== 基础样式 ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  color: #1a202c;
  -webkit-font-smoothing: antialiased;
}

[x-cloak] {
  display: none !important;
}

/* ===== 页面容器 ===== */
.page-container {
  max-width: 1400px;
  margin: 0 auto;
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 头部导航 ===== */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 20px 28px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.logo {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.logo-sub {
  color: #718096;
  font-size: 12px;
  margin-left: 12px;
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-link {
  padding: 10px 18px;
  border-radius: 12px;
  text-decoration: none;
  color: #4a5568;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

.nav-link:hover {
  color: #667eea;
  transform: translateY(-2px);
}

.nav-link:hover::before {
  opacity: 0.1;
}

.nav-link.active {
  color: #fff;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.nav-link.active::before {
  opacity: 1;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name {
  color: #4a5568;
  font-size: 13px;
  font-weight: 500;
}

.btn-logout {
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-logout:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* ===== 控制栏 ===== */
.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== 搜索框 ===== */
.search-box {
  flex: 1;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 2px solid rgba(102, 126, 234, 0.1);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.8);
}

.search-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: #fff;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
}

/* ===== 筛选器 ===== */
.filter-select {
  padding: 10px 36px 10px 14px;
  border: 2px solid rgba(102, 126, 234, 0.1);
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.8);
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M3 5l3 3 3-3" fill="none" stroke="%23667eea" stroke-width="2"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.filter-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===== 按钮 ===== */
.btn-primary {
  padding: 10px 20px;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  padding: 10px 20px;
  border: 2px solid rgba(102, 126, 234, 0.1);
  background: rgba(255, 255, 255, 0.8);
  color: #4a5568;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover {
  border-color: #667eea;
  color: #667eea;
  background: #fff;
}

/* ===== 卡片通用 ===== */
.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(.4, 0, .2, 1);
}

.card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* ===== 统计卡片 ===== */
.stats-bar {
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 16px 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.3);
  overflow-x: auto;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.stat-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.stat-dot.green {
  background: linear-gradient(135deg, #48bb78, #38a169);
}

.stat-dot.red {
  background: linear-gradient(135deg, #f56565, #e53e3e);
}

.stat-dot.amber {
  background: linear-gradient(135deg, #ed8936, #dd6b20);
}

.stat-dot.blue {
  background: linear-gradient(135deg, #4299e1, #3182ce);
}

.stat-label {
  color: #718096;
  font-size: 13px;
  font-weight: 500;
}

.stat-value {
  color: #1a202c;
  font-size: 18px;
  font-weight: 800;
}

.stat-divider {
  color: #cbd5e0;
  font-size: 16px;
}

/* ===== 表格 ===== */
.table-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  overflow-x: auto;
}

.table-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #718096;
  border-bottom: 2px solid rgba(102, 126, 234, 0.1);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(102, 126, 234, 0.05);
  transition: all 0.3s;
}

tbody tr:hover {
  background: rgba(102, 126, 234, 0.03);
}

tbody td {
  padding: 14px 16px;
  font-size: 13px;
  color: #1a202c;
}

/* ===== 标签 ===== */
.badge {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}

.badge.a, .badge.success {
  background: rgba(72, 187, 120, 0.1);
  color: #48bb78;
}

.badge.b, .badge.info {
  background: rgba(66, 153, 225, 0.1);
  color: #4299e1;
}

.badge.c, .badge.warning {
  background: rgba(237, 137, 54, 0.1);
  color: #ed8936;
}

.badge.d, .badge.danger {
  background: rgba(245, 101, 101, 0.1);
  color: #f56565;
}

.badge.default {
  background: rgba(160, 174, 192, 0.1);
  color: #a0aec0;
}

/* ===== 网格布局 ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #fff;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-text {
  font-size: 18px;
  font-weight: 600;
}

/* ===== 加载状态 ===== */
.loading-state {
  text-align: center;
  padding: 100px 20px;
  color: #fff;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  body {
    padding: 12px;
  }
  
  .header {
    padding: 16px 20px;
  }
  
  .logo {
    font-size: 24px;
  }
  
  .nav-links {
    flex-wrap: wrap;
  }
  
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ===== 工具类 ===== */
.text-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.shadow-lg {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.shadow-hover:hover {
  box-shadow: 0 16px 48px rgba(102, 126, 234, 0.2);
}

.transition-all {
  transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
}
