/* 天宫资产管理后台 - 极简样式 */
:root {
  --primary: #2563eb;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  padding: 0;
}

/* 顶部导航 */
.nav {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
}
.nav-links { display: flex; gap: 16px; }
.nav-links a {
  text-decoration: none;
  color: var(--gray-600);
  font-size: 14px;
  padding: 4px 12px;
  border-radius: var(--radius);
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
  background: #eff6ff;
}

/* 容器 */
.container { max-width: 960px; margin: 24px auto; padding: 0 24px; }

/* 卡片 */
.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline {
  background: white;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}
.btn-outline:hover { background: var(--gray-100); }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 4px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-textarea { min-height: 100px; resize: vertical; font-family: monospace; }

/* 列表 */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: white;
  transition: box-shadow 0.2s;
}
.list-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.list-item-info { flex: 1; }
.list-item-title { font-weight: 500; font-size: 14px; }
.list-item-meta { font-size: 12px; color: var(--gray-600); margin-top: 2px; }
.list-item-actions { display: flex; gap: 8px; }

/* 状态标签 */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* JSON 预览 */
.json-preview {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  max-height: 400px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  display: none;
}
.json-preview.show { display: block; }

/* Toast 通知 */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 空状态 */
.empty {
  text-align: center;
  padding: 48px;
  color: var(--gray-600);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }

/* 模态框 */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* 登录页 */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 40px;
  width: 360px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.login-card h1 { font-size: 22px; margin-bottom: 8px; }
.login-card p { color: var(--gray-600); font-size: 14px; margin-bottom: 24px; }
