:root {
  --ink: #1a2421;
  --ink-soft: #3d4a45;
  --muted: #6b7a74;
  --line: #d5ddd8;
  --line-strong: #b8c4bd;
  --surface: #eef3f0;
  --surface-2: #ffffff;
  --brand: #0f5c45;
  --brand-soft: #e4f2ec;
  --accent: #c45c26;
  --danger: #b42318;
  --ok: #0f5c45;
  --shadow: 0 1px 0 rgba(26, 36, 33, 0.04);
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Fraunces", "Times New Roman", serif;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
}

button, input, textarea, select { font: inherit; color: inherit; }

/* —— Auth shell —— */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  position: relative;
  overflow: hidden;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 480px at 12% 8%, rgba(15, 92, 69, 0.18), transparent 60%),
    radial-gradient(700px 420px at 88% 92%, rgba(196, 92, 38, 0.12), transparent 55%),
    linear-gradient(160deg, #f4f8f5 0%, #e8efe9 45%, #dfe8e2 100%);
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  box-shadow: 0 18px 48px rgba(26, 36, 33, 0.1) !important;
  border-radius: 16px !important;
}

.auth-brand {
  font-family: var(--display) !important;
  color: var(--brand) !important;
  letter-spacing: -0.03em;
  margin-bottom: 4px !important;
}

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

/* —— Console shell (Ant Design Layout) —— */
.console-root {
  min-height: 100vh;
}

.console-sider {
  border-inline-end: 1px solid var(--line) !important;
  position: sticky !important;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.console-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 12px;
  min-height: 72px;
}

.console-brand.is-collapsed {
  justify-content: center;
  padding-inline: 12px;
}

.console-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #147a5a, #0f5c45);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.console-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.console-brand-text strong {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--brand);
  letter-spacing: -0.02em;
}

.console-brand-text span {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

.console-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px !important;
  height: 64px !important;
  line-height: 64px !important;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.console-user {
  font-weight: 600;
  color: var(--ink-soft);
}

.console-content {
  padding: 20px;
  min-height: calc(100vh - 64px);
}

.console-panel > .ant-card,
.console-panel > .ant-row {
  animation: console-fade 0.28s ease;
}

@keyframes console-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.mono-block,
.generate-log-body,
.json-editor {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  background: #f3f6f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.generate-log-body {
  max-height: 280px;
}

.json-editor {
  width: 100%;
  resize: vertical;
  background: #fafcfb !important;
}

/* legacy helpers still used by GeneratedApp / some pages */
.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 72px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.brand {
  font-family: var(--display);
  font-size: clamp(2.1rem, 4vw, 2.75rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.03em;
  color: var(--brand);
  line-height: 1.1;
}

.sub {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: 0.95rem;
}

.meta-chip {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.meta-chip span {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}

.tabs {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin: 22px 0 18px;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px 16px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
}

.tab:hover { color: var(--ink); }

.tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.panel {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.section-title {
  font-family: var(--display);
  font-size: 1.25rem;
  margin: 0 0 14px;
  color: var(--ink);
}

.row {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.row.compact {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.field-hint {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.85;
  letter-spacing: 0;
}

input, textarea, select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 92, 69, 0.12);
}

textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.45;
}

.file-field {
  position: relative;
}

.file-field input[type="file"] {
  padding: 9px;
  background: var(--brand-soft);
  border-style: dashed;
  cursor: pointer;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover { filter: brightness(1.05); }

.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.btn.secondary:hover { background: var(--brand-soft); }

.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }

.flash {
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 14px;
  font-size: 0.92rem;
}

.flash.err {
  background: #fef3f2;
  color: var(--danger);
  border: 1px solid #fecdca;
  white-space: pre-wrap;
}

.flash.ok {
  background: var(--brand-soft);
  color: var(--ok);
  border: 1px solid #b7d8c8;
}

.hint {
  color: var(--accent);
  font-size: 0.88rem;
  margin: 12px 0 0;
  padding: 0;
}

.hint li { margin: 4px 0; }

.generate-log {
  margin-top: 12px;
}

.generate-log-body {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f0f4f1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink-soft);
}

.mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.8rem;
  word-break: break-all;
  background: #f0f4f1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink-soft);
}

.grid2 {
  display: grid;
  gap: 18px;
}

@media (min-width: 900px) {
  .grid2 { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
}

.table-wrap {
  overflow-x: auto;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 720px;
}

thead th {
  position: sticky;
  top: 0;
  background: #eef4f0;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0.01em;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: top;
  max-width: 220px;
}

tbody tr:nth-child(even) { background: #fafcfb; }
tbody tr:hover { background: var(--brand-soft); }

td.cell-muted { color: var(--muted); font-variant-numeric: tabular-nums; }
td.cell-num { font-variant-numeric: tabular-nums; text-align: right; }
td.cell-status {
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  background: #eef2ff;
  color: #3730a3;
}

.badge.ok { background: #e4f2ec; color: var(--brand); }
.badge.warn { background: #fff4e5; color: #9a5b00; }
.badge.bad { background: #fef3f2; color: var(--danger); }

.grant-block {
  margin: 16px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line, #e5e7eb);
  background: linear-gradient(180deg, rgba(15, 92, 69, 0.03), transparent);
}

.agent-editor {
  margin-top: 8px;
  padding: 16px;
  border: 1px solid var(--line, #e5e7eb);
  background: #fff;
}

.agent-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

tr.row-editing td {
  background: #f3faf6;
}

.grant-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 650;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.role-card {
  text-align: left;
  border: 1px solid var(--line, #e5e7eb);
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.role-card strong { font-size: 0.92rem; }
.role-card span { font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.role-card.active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
  background: #f3faf6;
}

.perm-groups {
  display: grid;
  gap: 12px;
}

.perm-group-title {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.perm-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 12px;
}

.perm-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid transparent;
  cursor: pointer;
}

.perm-item:hover { background: rgba(0, 0, 0, 0.02); }
.perm-item input { margin-top: 3px; }
.perm-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.88rem;
}
.perm-item-main code {
  font-size: 0.72rem;
  color: var(--muted);
  background: transparent;
  padding: 0;
  border: 0;
}

.slug-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.slug-row input { flex: 1; }

.slug-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slug-chip {
  border: 1px solid var(--line, #e5e7eb);
  background: #fff;
  padding: 4px 10px;
  font-size: 0.84rem;
  cursor: pointer;
}
.slug-chip:hover { border-color: var(--danger, #b42318); color: var(--danger, #b42318); }

.pages-line {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 12px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 15% 10%, rgba(15, 92, 69, 0.14), transparent 60%),
    radial-gradient(700px 380px at 90% 80%, rgba(196, 92, 38, 0.1), transparent 55%),
    var(--surface);
}

.login-panel {
  width: min(420px, 100%);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 26px;
  box-shadow: var(--shadow);
}

.login-panel .brand { margin-bottom: 6px; }
.login-panel .sub { margin-bottom: 22px; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 12px;
  font-size: 0.95rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 8px 0 18px;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
}

.kpi-title { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.kpi-value {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 700;
  margin-top: 6px;
  color: var(--brand);
}

.chart-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 860px) {
  .chart-grid { grid-template-columns: 1fr 1fr; }
}

.chart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fff;
}

.chart-card h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 40px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.bar-label {
  color: var(--muted);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  background: #e8eee9;
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill { height: 100%; border-radius: 4px; }
.bar-num { text-align: right; font-size: 0.82rem; font-variant-numeric: tabular-nums; }

.pie-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pie {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.pie-legend { list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 0.88rem; }
.pie-legend li { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pie-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.line-chart { margin-top: 14px; }
.line-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.line-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.82rem;
  color: var(--muted);
}
.line-legend li { display: flex; align-items: center; gap: 6px; }
.line-legend i { width: 14px; height: 3px; border-radius: 1px; display: inline-block; }
.line-chart-scroll {
  overflow-x: auto;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  width: 100%;
}
.sf-line-wrap .line-chart-scroll {
  overflow-x: hidden;
  border-top: 0;
  padding-top: 0;
}
.sf-line-wrap .line-chart-scroll svg,
.sf-line-wrap .section-mark-chart svg {
  display: block;
  width: 100% !important;
  max-width: none;
  height: auto;
  min-height: 240px;
}
.line-grid { stroke: #e6ebf2; stroke-width: 1; }
.line-axis { fill: #7a8699; font-size: 11px; }

.status-strip { margin-top: 14px; }
.status-strip-row {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 6px;
  align-items: stretch;
  min-height: 88px;
}
.status-cell {
  flex: 0 0 52px;
  width: 52px;
  min-height: 80px;
  border-radius: 2px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 2px 6px;
  font-size: 0.65rem;
  line-height: 1.15;
  text-align: center;
}
.status-cell .status-top {
  writing-mode: horizontal-tb;
  font-size: 0.58rem;
  word-break: break-all;
  max-height: 2.4em;
  overflow: hidden;
  opacity: 0.95;
  margin-bottom: auto;
  padding-top: 2px;
}
.status-cell .status-val {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 4px;
}
.status-cell.tone-ok { background: #2f9e44; }
.status-cell.tone-warn { background: #868e96; }
.status-cell.tone-muted { background: #adb5bd; }

/* 双段监督条：上灰下绿 */
.status-strip-stacked .stacked-row {
  gap: 2px;
  min-height: 110px;
  height: 110px;
  align-items: stretch;
}
.status-stack {
  flex: 0 0 28px;
  width: 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid #fff;
  box-sizing: border-box;
  overflow: hidden;
}
.status-stack .stack-top {
  background: #9aa0a6;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  min-height: 14px;
}
.status-stack .stack-bot {
  background: #37b24d;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  min-height: 18px;
}
.status-stack.stop {
  background: #868e96;
  align-items: center;
  justify-content: center;
}
.status-stack .stack-stop {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}
.sf-strip-wrap .status-strip-stacked {
  margin-top: 0;
}
.sf-strip-wrap .status-strip-stacked .stacked-row {
  overflow: hidden;
}

.settle-dash .chart-card { margin-top: 12px; }

.json-editor {
  min-height: 420px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
}

.gen-app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 22px 64px;
}

.gen-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.gen-eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.gen-title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  margin: 0;
  color: var(--brand);
  letter-spacing: -0.02em;
}

.gen-desc {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.45;
}

.gen-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.gen-nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px 16px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 600;
}

.gen-nav-item.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.gen-panel { margin-top: 4px; }

.gen-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.gen-filters {
  background: var(--brand-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

/* Ops / screenshot-faithful chrome shell */
.gen-app-ops {
  max-width: 1280px;
}
.gen-header-ops {
  background: linear-gradient(90deg, #0b3a66 0%, #145a9e 55%, #1a6fbf 100%);
  color: #f4f8fc;
  border-radius: 8px;
  padding: 16px 18px;
  align-items: center;
}
.gen-header-ops .gen-eyebrow { color: rgba(244,248,252,0.75); }
.gen-header-ops .gen-title { color: #fff; font-family: var(--font); font-size: 1.35rem; }
.gen-header-ops .btn.secondary {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}
.gen-project-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: rgba(244,248,252,0.92);
}
.gen-project-stats { opacity: 0.85; }
.gen-nav-ops {
  background: #e8eef5;
  border: 1px solid #c5d3e3;
  border-radius: 6px;
  padding: 4px;
}
.gen-nav-ops .gen-nav-item.active {
  background: #0b3a66;
  color: #fff;
}
.ops-section-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: #eef3f8;
  border: 1px solid #c5d3e3;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.ops-radio-label { font-size: 0.85rem; color: var(--muted); margin-right: 4px; }
.ops-radio {
  border: 1px solid #9db2c9;
  background: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}
.ops-radio.active {
  background: #0b3a66;
  color: #fff;
  border-color: #0b3a66;
}
.ops-extra-filter { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; }
.ops-dashboard .ops-dash-hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: -6px 0 12px;
}
.ops-dashboard .kpi-grid { margin-bottom: 8px; }

/* ========== Screenshot faithful shell ========== */
.sf-shell-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, #0a2f55, #124a7c 50%, #0a2f55);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0;
  margin: -8px -8px 0;
}
.sf-shell-left { font-size: 0.92rem; opacity: 0.95; }
.sf-shell-center { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.02em; text-align: center; }
.sf-shell-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}
.sf-shell-user { font-size: 0.85rem; opacity: 0.9; }
.sf-shell-link {
  font-size: 0.82rem;
  opacity: 0.88;
  cursor: default;
  white-space: nowrap;
}
.sf-shell-back {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.45);
  color: #fff;
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
}
.gen-nav-ops .gen-nav-item.is-chrome {
  opacity: 0.75;
  cursor: default;
}
.gen-nav-ops .gen-nav-item.is-chrome:hover {
  background: transparent;
  color: inherit;
}
.sf-mini-context {
  background: #e7eef6;
  border: 1px solid #b9c9dc;
  padding: 8px 12px;
  font-size: 0.88rem;
  margin: 8px 0;
}
.gen-app-ops {
  max-width: none;
  width: 100%;
  background: #eef2f6;
  padding: 0;
  margin: 0;
}
.gen-app-ops .gen-nav-ops {
  background: #b8cfe6;
  border: 0;
  border-bottom: 1px solid #7a9abe;
  border-radius: 0;
  margin: 0;
  padding: 0 4px;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0;
}
.gen-app-ops .gen-nav-ops .gen-nav-item {
  border-radius: 0;
  padding: 9px 12px;
  font-size: 0.84rem;
  white-space: nowrap;
  background: transparent;
  border: 0;
  color: #123354;
  border-bottom: 3px solid transparent;
}
.gen-app-ops .gen-nav-ops .gen-nav-item.active {
  background: #0b3a66;
  color: #fff;
  border-bottom-color: #0b3a66;
}
.sf-shell-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  background: #003a6b;
  color: #fff;
  padding: 8px 18px;
  border-radius: 0;
  margin: 0;
}
.sf-shell-left {
  font-size: 0.95rem;
  line-height: 1.25;
}
.sf-shell-left .sf-shell-en {
  display: block;
  font-size: 0.68rem;
  opacity: 0.8;
  letter-spacing: 0.02em;
}
.sf-shell-center { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.04em; text-align: center; }
.sf-float-dock {
  position: fixed;
  right: 0;
  top: 42%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sf-float-dock button {
  writing-mode: horizontal-tb;
  background: #0b5cab;
  color: #fff;
  border: 0;
  border-radius: 4px 0 0 4px;
  padding: 8px 6px;
  font-size: 0.72rem;
  cursor: default;
  width: 44px;
  line-height: 1.2;
}

.sf-root { background: #fff; border: 0; min-height: calc(100vh - 96px); }
.sf-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #d5dee8;
}
.sf-context { font-size: 0.88rem; color: #243447; }
.sf-hint { color: #d32f2f; font-size: 0.85rem; margin-left: auto; }
.sf-legend {
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 8px 12px 4px;
  font-size: 0.82rem;
  border-bottom: 0;
}
.sf-leg-item::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  background: var(--leg, #1d4f91);
}
.sf-leg-item.leg-line::before {
  height: 3px;
  width: 18px;
  vertical-align: 2px;
  border-radius: 1px;
}
.sf-body {
  display: grid;
  grid-template-columns: 34px 1fr;
  min-height: 640px;
}
.sf-rail {
  background: #0b3a66;
  color: #fff;
  display: flex;
  flex-direction: column;
}
.sf-rail-seg {
  /* 竖排：字正向、自上而下读（勿再 rotate，否则会倒字） */
  writing-mode: vertical-rl;
  text-orientation: upright;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255,255,255,0.22);
  padding: 8px 2px;
  white-space: nowrap;
  overflow: hidden;
}
.sf-rail-seg.chart { flex: 2.2; }
.sf-rail-seg.strip { flex: 1.1; }
.sf-rail-seg.table { flex: 1.4; border-bottom: 0; }
.sf-main { display: flex; flex-direction: column; min-width: 0; }
.sf-line-wrap { min-height: 280px; padding: 4px 8px 0; }
.sf-line-wrap .chart-card { border: 0; box-shadow: none; margin: 0; padding: 0; }
.sf-scroll { width: 100%; margin: 2px 0 6px; }
.sf-strip-wrap {
  border-top: 1px solid #d0d7e2;
  padding: 0 6px 8px;
  min-height: 130px;
}
.sf-strip-cap {
  font-size: 0.8rem;
  color: #4a5a6a;
  padding: 4px 4px 2px;
}
.sf-table-panel { padding: 0 10px 16px; border-top: 1px solid #d0d7e2; }
.sf-table-title {
  text-align: center;
  color: #0b3a66;
  font-weight: 600;
  padding: 8px;
  font-size: 0.95rem;
}
.sf-table th { background: #eef2f6; }
.status-strip-stacked .stacked-row {
  gap: 1px;
  min-height: 118px;
  height: 118px;
  overflow: hidden;
}
.status-stack {
  flex: 1 1 0;
  min-width: 22px;
  max-width: 36px;
  width: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid #fff;
  box-sizing: border-box;
  overflow: hidden;
}
.status-stack .stack-top {
  background: #9aa0a6;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}
.status-stack .stack-bot {
  background: #37b24d;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
}
.status-stack.all-grey, .status-stack.stop {
  background: #868e96;
  align-items: center;
  justify-content: center;
}
.status-stack.all-green {
  background: #37b24d;
  align-items: center;
  justify-content: center;
}
.status-stack .stack-solo, .status-stack .stack-stop {
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.sf-root { background: #fff; border: 1px solid #c5d0de; }
.sf-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: #0b2f52;
  color: #fff;
  padding: 8px 14px;
}
.sf-top-left { font-size: 0.85rem; }
.sf-top-center { text-align: center; font-weight: 700; font-size: 1.05rem; }
.sf-top-right { text-align: right; font-size: 0.82rem; opacity: 0.9; }
.sf-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #f7f9fc;
  border-bottom: 1px solid #d5dee8;
}
.sf-context { display: flex; gap: 14px; align-items: center; font-size: 0.88rem; }
.sf-radios { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.sf-radio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.86rem;
  padding: 0;
  border-radius: 0;
  cursor: pointer;
  color: #243447;
  background: transparent;
  font-weight: 400;
}
.sf-radio.on { background: transparent; color: #0b3a66; font-weight: 500; }
.sf-radio input { accent-color: #0b3a66; margin: 0 2px 0 0; }
.sf-select { font-size: 0.86rem; display: inline-flex; gap: 4px; align-items: center; color: #243447; }
.sf-select select { min-width: 120px; padding: 2px 4px; }
.sf-hint { color: #d32f2f; font-size: 0.85rem; margin-left: auto; }
.sf-legend {
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 8px 12px 4px;
  font-size: 0.82rem;
  border-bottom: 0;
}
.sf-leg-item::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  background: var(--leg, #1d4f91);
}
.sf-chart-stack {
  display: grid;
  grid-template-columns: 36px 1fr;
  min-height: 420px;
  border-bottom: 1px solid #d5dee8;
}
.sf-side-labels {
  background: #0b3a66;
  color: #fff;
  display: flex;
  flex-direction: column;
}
.sf-side-label {
  flex: 1;
  writing-mode: vertical-rl;
  text-orientation: upright;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding: 8px 0;
}
.sf-table-block {
  display: grid;
  grid-template-columns: 36px 1fr;
  border-top: 1px solid #d5dee8;
}
.sf-side-labels-single { min-height: 160px; }
.sf-table-block .sf-table-panel { border: 0; }
.sf-chart-main { padding: 8px 10px 4px; background: #fff; min-height: 320px; }
.sf-line-wrap { min-height: 280px; }
.sf-line-wrap .line-chart-head { display: none; }
.sf-line-wrap .chart-card, .sf-strip-wrap .chart-card {
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
.sf-strip-wrap { margin-top: 8px; min-height: 88px; }
.sf-scroll { width: 100%; margin: 4px 0 8px; }
.sf-table-panel { padding: 10px 12px 16px; }
.sf-table-title {
  background: #e8eef5;
  border: 1px solid #c5d3e3;
  padding: 6px 10px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.sf-table th {
  background: #f3f6fa;
  font-weight: 600;
}

/* 机器标签：用户不可见，供 AI/脚本解析接口契约 */
.ajz-machine-tag {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  user-select: none !important;
}
