/* ADR-0372 瑞士极简亮底规范与行业语义美学设计系统 (Skill 128 & Skill 84 精简架构) */
:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-active: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --primary: #4f46e5;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
}

body.theme-dark {
  --bg-main: #0a0e17;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(26, 36, 56, 0.95);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main); color: var(--text-main); min-height: 100vh;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.glow-bg {
  position: fixed; top: -10%; left: 20%; width: 60vw; height: 40vh;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.06) 0%, rgba(56, 189, 248, 0.04) 60%, transparent 80%);
  filter: blur(80px); z-index: 0; pointer-events: none;
}

.app-header {
  position: relative; z-index: 10; background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle); padding: 16px 32px; box-shadow: var(--shadow-sm);
}
.header-content {
  max-width: 1440px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  font-size: 22px; background: linear-gradient(135deg, #4f46e5, #0284c7);
  color: #fff; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.brand-title { font-size: 17px; font-weight: 800; letter-spacing: 0.5px; }
.brand-subtitle { font-size: 12px; color: var(--text-muted); }

.header-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat-badge {
  display: flex; align-items: center; gap: 6px; background: var(--bg-main);
  border: 1px solid var(--border-subtle); padding: 5px 12px; border-radius: 20px; font-size: 12px; color: var(--text-muted);
}
.stat-badge strong { color: var(--text-main); font-family: 'JetBrains Mono', monospace; }
.stat-green { border-color: #a7f3d0; background: #ecfdf5; }
.stat-green strong { color: #059669; }
.stat-blue { border-color: #bae6fd; background: #f0f9ff; }
.stat-blue strong { color: #0284c7; }
.stat-teal { border-color: #99f6e4; background: #f0fdfa; }
.stat-teal strong { color: #0d9488; }
.stat-gray { border-color: #cbd5e1; background: #f1f5f9; }
.stat-gray strong { color: #475569; }
.stat-amber { border-color: #fde68a; background: #fffbeb; }
.stat-amber strong { color: #d97706; }

.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 8px #10b981; animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(0.95); opacity: 0.8; } 50% { transform: scale(1.2); opacity: 1; } }

.theme-btn {
  background: var(--bg-main); border: 1px solid var(--border-subtle);
  border-radius: 8px; width: 34px; height: 34px; font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.theme-btn:hover { background: var(--border-subtle); }

.app-main { max-width: 1440px; margin: 0 auto; padding: 24px 32px 60px; position: relative; z-index: 5; }

.topology-banner { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 20px; }
.banner-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 14px 18px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-sm);
}
.card-icon { font-size: 26px; }
.card-text h4 { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.card-text p { font-size: 11.5px; color: var(--text-muted); }
.status-tag { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.status-active { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }

.control-toolbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 12px 18px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.search-box { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 480px; }
.search-box input {
  width: 100%; background: var(--bg-main); border: 1px solid var(--border-subtle);
  border-radius: 6px; padding: 7px 12px; font-size: 13px; color: var(--text-main); outline: none;
}
.search-box input:focus { border-color: var(--primary); }

.filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
  background: var(--bg-main); border: 1px solid var(--border-subtle);
  color: var(--text-muted); padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.filter-btn:hover { color: var(--text-main); border-color: var(--border-active); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.refresh-btn {
  background: var(--bg-main); border: 1px solid var(--border-subtle);
  color: var(--text-main); padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.refresh-btn:hover { background: var(--border-subtle); }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-title { font-size: 15px; font-weight: 800; }
.section-meta { font-size: 11.5px; color: var(--text-muted); }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.proj-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  box-shadow: var(--shadow-sm); transition: all 0.2s ease; position: relative; overflow: hidden;
}
.proj-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-active); }
.proj-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--card-brand-color, #4f46e5); }

.proj-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.proj-title-box { display: flex; align-items: center; gap: 8px; }
.proj-seq {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 800;
  background: var(--card-brand-bg, #e0e7ff); color: var(--card-brand-color, #4338ca);
  padding: 2px 7px; border-radius: 5px; border: 1px solid var(--card-brand-border, #c7d2fe);
}
.proj-name { font-size: 13.5px; font-weight: 700; color: var(--text-main); }
.domain-tag { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--card-brand-bg, #f1f5f9); color: var(--card-brand-color, #475569); font-weight: 600; }

.health-pill { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 12px; font-family: 'JetBrains Mono', monospace; }
.pill-up { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.pill-maint { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.pill-internal { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.pill-offline { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.pill-gateway-down { background: #fef2f2; color: #b91c1c; border: 1px solid #f87171; animation: pulse-border 2s infinite; }
@keyframes pulse-border {
  0%, 100% { border-color: #f87171; box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.2); }
  50% { border-color: #ef4444; box-shadow: 0 0 6px 1px rgba(220, 38, 38, 0.25); }
}

.proj-meta { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--text-muted); }
.meta-row { display: flex; justify-content: space-between; align-items: center; }
.meta-url { color: #0284c7; text-decoration: none; font-family: 'JetBrains Mono', monospace; font-size: 11px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-url:hover { text-decoration: underline; }

.proj-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border-subtle); }
.lifecycle-select { background: var(--bg-main); border: 1px solid var(--border-subtle); color: var(--text-main); padding: 4px 6px; border-radius: 5px; font-size: 11.5px; outline: none; cursor: pointer; }
.action-btn { font-size: 11px; padding: 4px 8px; border-radius: 5px; text-decoration: none; cursor: pointer; border: 1px solid #bae6fd; background: #f0f9ff; color: #0284c7; font-weight: 600; transition: all 0.2s; }
.action-btn:hover { background: #0284c7; color: #fff; }

.app-footer { text-align: center; padding: 20px; font-size: 11.5px; color: var(--text-dim); border-top: 1px solid var(--border-subtle); background: var(--bg-card); }

/* 用户状态与退出按钮 */
.user-control-group { display: flex; align-items: center; gap: 6px; }
.user-badge-pill {
  display: flex; align-items: center; gap: 6px; background: #f5f3ff; border: 1px solid #ddd6fe;
  padding: 5px 12px; border-radius: 20px; font-size: 12px; color: #6d28d9;
}
.user-badge-pill strong { color: #7c3aed; font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.user-avatar-dot { width: 7px; height: 7px; border-radius: 50%; background: #8b5cf6; box-shadow: 0 0 6px rgba(139, 92, 246, 0.6); }

.logout-btn-styled {
  background: #fff1f2; border: 1px solid #fecdd3; color: #e11d48;
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 4px; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: var(--shadow-sm);
}
.logout-btn-styled:hover { background: #ffe4e6; border-color: #fda4af; color: #be123c; transform: translateY(-1px); }
body.theme-dark .logout-btn-styled { background: rgba(225, 29, 72, 0.12); border-color: rgba(244, 63, 94, 0.3); color: #fda4af; }

/* 安全鉴权模态弹窗 (Auth Modal) — Skill 128 居中与现代美学 (默认 display: none 防闪烁误弹) */
.auth-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100vw; height: 100vh;
  background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  z-index: 99999; display: none; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.auth-card {
  background: var(--bg-card); border: 1px solid var(--border-active); border-radius: 20px;
  width: 100%; max-width: 440px; padding: 36px 32px 28px;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  position: relative; animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp { from { transform: translateY(24px) scale(0.96); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

.auth-header { text-align: center; margin-bottom: 24px; }
.auth-shield-icon, .auth-icon { font-size: 40px; margin-bottom: 10px; display: inline-block; filter: drop-shadow(0 4px 10px rgba(79, 70, 229, 0.25)); }
.auth-title { font-size: 20px; font-weight: 800; color: var(--text-main); margin-bottom: 6px; letter-spacing: -0.3px; }
.auth-subtitle { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-input-group, .form-group { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.auth-label, .form-group label { font-size: 13px; font-weight: 700; color: var(--text-main); }

.auth-input, .form-input {
  background: var(--bg-main); border: 1px solid var(--border-subtle); border-radius: 10px;
  padding: 12px 14px; font-size: 14px; color: var(--text-main); font-family: inherit; outline: none; width: 100%;
  box-sizing: border-box; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-input:focus, .form-input:focus { border-color: var(--primary); background: #ffffff; box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.15); }

.captcha-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.captcha-box, .captcha-question {
  flex: 1.3; background: #eff6ff; border: 1.5px dashed #93c5fd; padding: 10px 12px; border-radius: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 800; color: #1d4ed8; text-align: center; letter-spacing: 1px; user-select: none; box-sizing: border-box;
}
.captcha-btn {
  background: var(--bg-main); border: 1px solid var(--border-subtle); border-radius: 10px;
  width: 44px; height: 44px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.captcha-btn:hover { background: var(--border-subtle); transform: rotate(45deg); }
.captcha-input { flex: 1.1; text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 700; padding: 12px 10px; }
.captcha-input::-webkit-outer-spin-button, .captcha-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.captcha-input[type=number] { -moz-appearance: textfield; }

.auth-error, .auth-error-msg {
  background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; text-align: center; animation: shake 0.3s ease-in-out;
}
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.auth-submit-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #0284c7 100%); color: #ffffff; border: none; border-radius: 10px;
  padding: 13px 20px; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 8px; width: 100%; margin-top: 6px; box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3); transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-submit-btn:hover { opacity: 0.95; transform: translateY(-1.5px); box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4); }
.auth-submit-btn:active { transform: translateY(0); }

.auth-footer-note, .auth-footer { margin-top: 22px; text-align: center; font-size: 12px; color: var(--text-dim); border-top: 1px dashed var(--border-subtle); padding-top: 14px; font-weight: 500; }

body.theme-dark .auth-card { box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08) inset; }
body.theme-dark .captcha-box { background: rgba(30, 58, 138, 0.25); border-color: rgba(96, 165, 250, 0.4); color: #93c5fd; }
body.theme-dark .auth-input:focus { background: #111827; }

/* ─── 治理闸口防御纵深大盘专属样式 (ADR-0378 / Skill 128) ─── */
.stat-purple { background: #f5f3ff; border: 1px solid #ddd6fe; color: #7c3aed; }
.stat-purple:hover { background: #ede9fe; transform: translateY(-1px); }
.gate-tab-btn:hover { opacity: 0.9; transform: translateY(-1px); }
body.theme-dark .gate-stat-cell { background: #1e293b !important; border-color: #334155 !important; }
body.theme-dark #gate-svg-preview-card { background: #0f172a !important; border-color: #334155 !important; }
body.theme-dark .gate-tab-btn { background: #1e293b !important; border-color: #334155 !important; color: #94a3b8 !important; }
body.theme-dark .gate-tab-btn.active { background: #4c1d95 !important; color: #ddd6fe !important; border-color: #6d28d9 !important; }



