:root {
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-soft: #eff6ff;
  --bg-page: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-dark-pane: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-light: #e2e8f0;
  --ok-text: #15803d;
  --ok-bg: #dcfce7;
  --warn-text: #b45309;
  --warn-bg: #fef3c7;
  --err-text: #b91c1c;
  --err-bg: #fee2e2;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Inter", sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.55;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f1f5f9;
  color: #0369a1;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}

.break-all { word-break: break-all; }
.block { display: block; }
.mt-6 { margin-top: 6px; }
.mt-12 { margin-top: 12px; }
.mb-12 { margin-bottom: 12px; }
.text-right { text-align: right; }
.align-end { display: flex; align-items: flex-end; }
.muted { color: var(--text-secondary); font-size: 13px; }

/* ================= 登录页（现代飞连/SaaS 双栏卡片） ================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #e0e7ff 0%, #f8fafc 50%, #dbeafe 100%);
}

.login-shell {
  width: 100%;
  max-width: 980px;
  background: var(--bg-surface);
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 0.95fr;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
}

.login-brand-pane {
  background: linear-gradient(155deg, #0f172a 0%, #1e3a8a 100%);
  color: #f8fafc;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-pill {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.login-brand-pane h1 {
  font-size: 32px;
  margin-bottom: 12px;
}

.brand-desc {
  color: #cbd5e1;
  font-size: 14px;
  margin-bottom: 26px;
}

.feature-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.f-tile {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px 14px;
}

.f-tile strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #fff;
}

.f-tile span {
  font-size: 12px;
  color: #cbd5e1;
}

.login-form-pane {
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.app-logo {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-logo.sm {
  width: 32px;
  height: 32px;
  font-size: 13px;
  border-radius: 8px;
}

.v-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.h-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
}

.form-item input, .form-item select, .input-search, .h-row input {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: #fff;
  transition: border-color 0.15s;
}

.form-item input:focus, .form-item select:focus, .input-search:focus, .h-row input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn-brand, .btn-outline, .btn-text, .btn-sm, .btn-sm-danger {
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-brand {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 9px 18px;
}

.btn-brand:hover { background: var(--brand-hover); }
.btn-lg { width: 100%; padding: 11px; font-size: 15px; }

.btn-outline {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 8px 14px;
}

.btn-outline:hover { border-color: var(--brand); color: var(--brand); }

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 10px;
}

.btn-sm {
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid #bfdbfe;
  padding: 4px 10px;
  font-size: 12px;
  margin-right: 6px;
}

.btn-sm-danger {
  background: var(--err-bg);
  color: var(--err-text);
  border: 1px solid #fecaca;
  padding: 4px 10px;
  font-size: 12px;
  margin-right: 6px;
}

.error-banner {
  background: var(--err-bg);
  color: var(--err-text);
  border: 1px solid #fecaca;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.login-footer-links {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.login-footer-links a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

/* ================= 顶部全局栏 ================= */
.global-header {
  height: 62px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title { font-size: 16px; }

.mode-switcher {
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  display: flex;
  gap: 4px;
}

.mode-btn {
  border: none;
  background: transparent;
  padding: 6px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.mode-btn.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.shield-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
}

.shield-ok { background: var(--ok-bg); color: var(--ok-text); }
.shield-warn { background: var(--warn-bg); color: var(--warn-text); }
.shield-err { background: var(--err-bg); color: var(--err-text); }

.tag-neutral, .tag-ok, .tag-warn, .tag-err {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.tag-neutral { background: #f1f5f9; color: #475569; }
.tag-ok { background: var(--ok-bg); color: var(--ok-text); }
.tag-warn { background: var(--warn-bg); color: var(--warn-text); }
.tag-err { background: var(--err-bg); color: var(--err-text); }

.header-user {
  display: flex;
  flex-direction: column;
  text-align: right;
  line-height: 1.25;
}

.global-toast {
  max-width: 1220px;
  margin: 14px auto 0;
  background: #1e293b;
  color: #fff;
  padding: 11px 18px;
  border-radius: 9px;
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

/* ================= 员工应用工作台 (Portal) ================= */
.portal-container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 24px;
}

.portal-hero-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.portal-search-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.input-search { min-width: 250px; }

.portal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 22px;
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.ptab-btn {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.ptab-btn.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.app-launchpad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.app-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.app-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.app-tile-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: var(--brand);
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-icon-box.l4 {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
}

.app-tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.client-banner-card {
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

/* ================= 管理后台 (Admin Console) ================= */
.admin-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: calc(100vh - 62px);
}

.admin-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.anav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
}

.anav-btn.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.count-dot {
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
}

.admin-main {
  padding: 24px 30px;
  overflow-x: auto;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card, .card-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 18px;
}

.kpi-title { font-size: 13px; color: var(--text-secondary); }
.kpi-num { display: block; font-size: 30px; color: var(--brand); margin: 6px 0; }

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.span-2 { grid-column: 1 / -1; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.info-well {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
}

.arch-flow {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.arch-step {
  flex: 1;
  min-width: 210px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
}

.arch-step strong { display: block; margin-bottom: 4px; }
.arch-step span { font-size: 12.5px; color: var(--text-secondary); }
.arch-arrow { font-size: 20px; color: var(--brand); font-weight: bold; }

.clean-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

.clean-table th, .clean-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
}

.clean-table th {
  color: var(--text-secondary);
  font-weight: 600;
  background: #f8fafc;
}
