/**
 * OASystem 升级管理中心 - 现代UI样式
 */
:root {
  --color-primary: #3b82f6;
  --color-primary-dark: #2563eb;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-bg: #f8fafc;
  --color-card: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --sidebar-width: 240px;
  --header-height: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

/* ====== 登录页 ====== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
}
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}
.logo-large {
  margin-bottom: 1rem;
}
.login-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.subtitle {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}
.login-form .form-group {
  margin-bottom: 1.25rem;
}
.login-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
}

/* ====== 布局 ====== */
.app {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-width);
  background: #1e293b;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-text {
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
}
.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: #94a3b8;
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}
.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
}
.nav-item.active {
  background: var(--color-primary);
  color: #fff;
}
.nav-item svg { flex-shrink: 0; }
.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
}
.logout-btn:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main-header {
  height: var(--header-height);
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-title {
  font-size: 1.125rem;
  font-weight: 600;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.user-name {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
.main-content {
  flex: 1;
  padding: 1.5rem;
}

/* ====== 面板 ====== */
.panel {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: #fafafa;
}
.panel-title {
  font-size: 1rem;
  font-weight: 600;
}
.panel-body {
  padding: 1.25rem;
}

/* ====== 仪表盘统计 ====== */
.dashboard { max-width: 1200px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-info { flex: 1; }
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}
.section-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}
.sub-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
}

/* ====== 表格 ====== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table thead th {
  background: #f8fafc;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}
.data-table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ====== 表单 ====== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 1.25rem;
}
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
}
.input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--color-card);
}
.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.375rem;
  display: block;
}
.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-top: 0.5rem;
}
.form-actions.full { grid-column: 1 / -1; }
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}
.checkbox-item:hover { border-color: var(--color-primary); background: rgba(59,130,246,0.03); }
.checkbox-item input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ====== 按钮 ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s;
}
.btn:hover { background: #f1f5f9; }
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8125rem; }

/* ====== 徽章 ====== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }

/* ====== 链接 ====== */
.link {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.875rem;
}
.link:hover { text-decoration: underline; }
.link.danger { color: var(--color-danger); }

/* ====== 提示 ====== */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alert-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }

/* ====== 详情 ====== */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.detail-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}
.detail-value {
  font-size: 0.875rem;
  font-weight: 500;
}
.font-mono {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 0.8125rem;
}
.empty-text {
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem;
  font-size: 0.875rem;
}

/* ====== 弹窗 ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--color-surface, #fff);
  border-radius: 12px;
  padding: 1.5rem;
  width: 380px;
  max-width: calc(100vw - 2rem);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

/* ====== 响应式 ====== */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .brand-text { display: none; }
  .nav-item span { display: none; }
  .main { margin-left: 60px; }
  .form-grid { grid-template-columns: 1fr; }
  .section-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}
