/* MF SaaS 一键部署系统 - 样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #3d6ef7;
  --primary-dark: #2c53c4;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2733;
  --text-sub: #6b7688;
  --border: #e6eaf0;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 10px;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ===== 登录页 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e3a8a 0%, #3d6ef7 100%); }
.login-card { background: #fff; padding: 40px; border-radius: 16px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.login-logo { text-align: center; margin-bottom: 12px; }
.login-card h1 { text-align: center; font-size: 20px; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--text-sub); font-size: 13px; margin-bottom: 28px; }
.login-card label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text-sub); }
.login-card input { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.login-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(61,110,247,0.1); }
.error-msg { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 8px; }

/* ===== 布局 ===== */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #1e293b; color: #cbd5e1; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 20px; color: #fff; font-weight: 700; font-size: 16px; border-bottom: 1px solid #334155; }
.side-nav { flex: 1; padding: 12px 0; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: #cbd5e1; text-decoration: none; font-size: 14px; transition: all 0.15s; }
.nav-item:hover { background: #273449; color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-ico { width: 18px; text-align: center; }
.side-footer { padding: 16px; border-top: 1px solid #334155; }
.side-user { font-size: 13px; margin-bottom: 12px; color: #94a3b8; }

.main { flex: 1; margin-left: 220px; padding: 28px 32px; }
.page { display: none; }
.page.active { display: block; }
.page h2 { font-size: 22px; margin-bottom: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-head h2 { margin-bottom: 0; }

/* ===== 按钮 ===== */
.btn-primary { background: var(--primary); color: #fff; border: none; padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: background 0.15s; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { display: block; width: 100%; padding: 12px; font-size: 15px; }
.btn-ghost { background: transparent; color: #cbd5e1; border: 1px solid #475569; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-ghost:hover { background: #273449; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; border: none; cursor: pointer; }
.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: #fecaca; }
.btn-success { background: #dcfce7; color: #16a34a; }
.btn-success:hover { background: #bbf7d0; }

/* ===== 统计卡片 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.stat-num { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--text-sub); font-size: 13px; margin-top: 4px; }

/* ===== 面板 ===== */
.panel { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.panel-head { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

/* ===== 流程步骤 ===== */
.flow-steps { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.flow-step { display: flex; align-items: center; gap: 12px; }
.flow-num { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.flow-step b { font-size: 14px; }
.flow-step span { color: var(--text-sub); font-size: 12px; }
.flow-arrow { color: #cbd5e1; font-size: 20px; }

/* ===== 卡片网格 ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-title { font-size: 16px; font-weight: 600; }
.card-info { color: var(--text-sub); font-size: 13px; }
.card-info div { margin-bottom: 4px; }
.card-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ===== 表格 ===== */
.table-wrap { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: #f8fafc; font-weight: 600; color: var(--text-sub); }
tr:hover td { background: #f8fafc; }

/* ===== 徽章 ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-info { background: #dbeafe; color: #2563eb; }
.badge-gray { background: #f1f5f9; color: #64748b; }

/* ===== 弹窗 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 14px; padding: 28px; width: 480px; max-width: 90vw; max-height: 90vh; overflow-y: auto; }
.modal h3 { font-size: 18px; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.form-group input, .form-group select { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); }
.form-hint { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.btn-secondary { background: #f1f5f9; color: var(--text); border: 1px solid var(--border); padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.btn-secondary:hover { background: #e2e8f0; }

/* ===== 部署日志 ===== */
.log-box { background: #0f172a; color: #a5f3fc; border-radius: 8px; padding: 16px; font-family: "Courier New", monospace; font-size: 12px; max-height: 300px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; }
.log-step { color: #fbbf24; font-weight: 600; margin-top: 8px; }
.log-ok { color: #4ade80; }
.log-err { color: #f87171; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .side-logo span, .nav-item span:not(.nav-ico), .side-user { display: none; }
  .main { margin-left: 60px; padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
}
