/* GE 网关管理 — 大控件、清晰排版，无 CDN */
*, *::before, *::after { box-sizing: border-box; }
html {
  color-scheme: dark;
}
html, body {
  margin: 0;
  padding: 0;
  background: #0c1016;
  color: #e4eaf2;
  font: 15px/1.55 "Segoe UI", "Microsoft YaHei UI", sans-serif;
}
a { color: #6eb6ff; text-decoration: none; }
a:hover { color: #9eceff; }

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #151c28;
  border-right: 1px solid #2a3548;
  padding: 20px 14px;
}
.brand { font-size: 18px; font-weight: 700; color: #5ca8ff; margin-bottom: 24px; }
.nav-link {
  display: block;
  padding: 11px 14px;
  color: #a8b8cc;
  border-radius: 8px;
  margin: 3px 0;
  font-size: 15px;
}
.nav-link:hover { background: #1f2a3d; color: #fff; }
.nav-exit { color: #f0a070 !important; margin-top: 28px; }

.main { flex: 1; padding: 24px 32px; overflow: auto; max-width: 1400px; }
.main-standalone { max-width: 480px; margin: 0 auto; padding-top: 60px; }

.page-title { font-size: 22px; font-weight: 600; color: #f2f6fc; margin: 0 0 8px; }
.page-desc { color: #8fa3b8; margin: 0 0 20px; font-size: 14px; }

.flash-bar { margin-bottom: 16px; font-size: 15px; }

.status-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.status-pill {
  background: #121a26;
  border: 1px solid #2a3548;
  border-radius: 8px;
  padding: 14px 16px;
}
.status-pill .k { color: #8fa3b8; font-size: 13px; margin-bottom: 4px; }
.status-pill .v { color: #e8f2ff; font-size: 16px; font-weight: 600; }
.status-pill.ok .v { color: #7ddea0; }

.card {
  background: #151c28;
  border: 1px solid #2a3548;
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 20px;
}
.card-title { font-size: 16px; font-weight: 600; color: #dce8f8; margin: 0 0 14px; }

.help-box {
  background: #0f1622;
  border-left: 4px solid #4a9eff;
  padding: 14px 18px;
  margin-bottom: 20px;
  color: #b8c8dc;
  font-size: 14px;
  line-height: 1.65;
}
.help-box strong { color: #e8f0ff; }
.help-box .flow { font-family: Consolas, monospace; color: #7ec8ff; margin: 8px 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-label { color: #9eb2c8; font-size: 14px; margin-bottom: 6px; }
.stat-value { color: #f0f6ff; font-size: 30px; font-weight: 700; }

.log-table td { font-size: 14px; vertical-align: top; }
.log-time { color: #8fa3b8; white-space: nowrap; width: 150px; }
.log-cat { color: #7ec8ff; width: 90px; }
.log-msg { color: #dce6f2; }
.log-warn .log-msg { color: #f0c080; }

code, .mono {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 14px;
  color: #7ec8ff;
  background: #0a0e14;
  padding: 3px 8px;
  border-radius: 4px;
  word-break: break-all;
}

.table-wrap { overflow-x: auto; margin-top: 8px; }
table.data-table { width: 100%; border-collapse: collapse; color: #dce6f2; font-size: 15px; }
table.data-table th, table.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #243044;
  text-align: left;
}
table.data-table th { color: #9eb2c8; font-weight: 600; background: #121820; }

label, .field-label {
  display: block;
  color: #b8c8dc;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}
.field-hint { color: #7a8fa6; font-size: 13px; margin: -4px 0 10px; }

/* 统一编辑框（含无 type、WebView2 默认白底覆盖） */
.main input:not([type=checkbox]):not([type=hidden]):not([type=radio]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]),
.main textarea,
.main select,
.card input:not([type=checkbox]):not([type=hidden]):not([type=radio]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]),
.card textarea,
.card select,
.main-standalone input:not([type=checkbox]):not([type=hidden]):not([type=radio]):not([type=submit]):not([type=button]),
.main-standalone textarea,
.main-standalone select {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  margin-bottom: 0;
  background-color: #0a0e14;
  border: 1px solid #3a4d66;
  border-radius: 8px;
  color: #f0f4fa;
  font-size: 15px;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.field-grid > div > input,
.field-grid > div > select,
.field-grid > div > textarea,
.form-row > div > input,
.form-row > div > select,
.form-row > div > textarea {
  margin-bottom: 0;
}
.field-grid > div,
.form-row > div {
  margin-bottom: 16px;
}
textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
  margin-bottom: 0;
}
.card > form > textarea,
.main > form > textarea {
  margin-bottom: 16px;
}
.card > form > input:not([type=hidden]):not(:last-child),
.card > form > select:not(:last-child),
.main-standalone .card > form > input:not([type=hidden]),
.main-standalone .card > form > select {
  margin-bottom: 16px;
}
.login-wrap .card { max-width: 400px; }
select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%239eb2c8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
select option {
  background: #151c28;
  color: #f0f4fa;
}
.main input:not([type=checkbox]):not([type=hidden]):focus,
.main textarea:focus,
.main select:focus,
.card input:not([type=checkbox]):not([type=hidden]):focus,
.card textarea:focus,
.card select:focus {
  outline: none;
  border-color: #4a9eff;
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}
input[readonly] { opacity: 0.85; cursor: default; }
input::placeholder,
textarea::placeholder {
  color: #6a7f96;
  opacity: 1;
}
.form-inline { display: inline; }
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  margin-bottom: 8px;
}
.form-row .field-grow { flex: 1 1 200px; min-width: 160px; }
.form-row .field-sm { flex: 0 1 140px; min-width: 120px; }
.form-row .field-xs { flex: 0 0 auto; }

.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.field-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.field-grid .span-2 { grid-column: span 2; }
.field-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 960px) {
  .field-grid, .field-grid.cols-3 { grid-template-columns: 1fr; }
  .field-grid .span-2, .field-grid .span-all { grid-column: 1; }
}

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
button, .btn {
  min-height: 42px;
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  background: #2d6cdf;
  color: #fff;
}
button:hover, .btn:hover { background: #3a7cef; }
.btn-secondary { background: #2a3548; color: #dce6f2; }
.btn-danger { background: #9a3a3a; }
.btn-sm { min-height: 36px; padding: 8px 14px; font-size: 14px; }

.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 16px; font-size: 15px; }
.alert-ok { background: #1a3d2e; color: #8fdfb0; border: 1px solid #2d6b4a; }
.alert-err { background: #3d1a1a; color: #f0a8a8; border: 1px solid #6b2d2d; }
.alert-info { background: #1a2a3d; color: #9ec8ff; border: 1px solid #2d4a6b; }
.alert-warn { background: #3d3218; color: #f0d080; border: 1px solid #6b5a2d; }

.hint { color: #8fa3b8; font-size: 14px; }
.url-preview { font-size: 14px; color: #9ec8ff; word-break: break-all; }

.proxy-diagram {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 20px;
  font-size: 15px;
}
.proxy-box {
  background: #0f1622;
  border: 1px solid #3a4d66;
  border-radius: 8px;
  padding: 12px 18px;
  text-align: center;
}
.proxy-arrow { color: #5ca8ff; font-size: 20px; }

.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }

.nav-link.nav-live { color: #7ddea0; font-weight: 600; }
.nav-link.nav-live:hover { color: #a8f0c0; }

.monitor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  margin-bottom: 16px;
}
.live-badge { font-size: 14px; font-weight: 600; }
.live-on { color: #7ddea0; }
.live-off { color: #f0a080; }
.live-paused { color: #f0d080; }
.monitor-filter { color: #9eb2c8; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.monitor-filter input { width: auto; min-height: auto; margin: 0; }

.monitor-feed-card { padding-bottom: 12px; }
.monitor-feed {
  max-height: 520px;
  overflow-y: auto;
  background: #0a0e14;
  border: 1px solid #243044;
  border-radius: 8px;
  padding: 8px 0;
}
.monitor-empty { color: #7a8fa6; padding: 24px 18px; text-align: center; }
.monitor-row {
  display: grid;
  grid-template-columns: 150px 72px 88px 1fr;
  gap: 10px 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #1a2434;
  font-size: 14px;
  align-items: start;
}
@media (max-width: 900px) {
  .monitor-row { grid-template-columns: 1fr; gap: 4px; }
}
.evt-time { color: #8fa3b8; font-family: Consolas, monospace; }
.evt-level { font-weight: 600; text-transform: uppercase; font-size: 12px; }
.evt-cat { color: #7ec8ff; }
.evt-msg { color: #e8f0f8; word-break: break-word; }
.evt-ip { color: #8fa3b8; font-size: 12px; }
.evt-info .evt-level { color: #8fdfb0; }
.evt-warn .evt-level { color: #f0c080; }
.evt-warn .evt-msg { color: #f0d8b0; }
.evt-alert .evt-level { color: #ff9090; }
.evt-alert .evt-msg { color: #ffc8c8; }
.row-banned td { color: #f0a080; }
.monitor-promo .btn { display: inline-block; text-decoration: none; }
