/* 私有控制台设计令牌：颜色严格对应深海军蓝概念稿，不加载任何外部字体或资源。 */
:root {
  --bg: #04111f;
  --bg-deep: #020b14;
  --sidebar: #031526;
  --surface: #071c2e;
  --surface-strong: #0a2338;
  --surface-soft: #0d293f;
  --surface-hover: #103149;
  --border: #1d3a4f;
  --border-strong: #2a5067;
  --text: #ecf6fb;
  --text-soft: #b5c6d2;
  --muted: #7590a2;
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --blue: #38bdf8;
  --blue-soft: rgba(56, 189, 248, 0.12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #fb5a65;
  --danger-soft: rgba(251, 90, 101, 0.12);
  --success: #5ee28a;
  --success-soft: rgba(94, 226, 138, 0.12);
  --purple: #a78bfa;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --sidebar-width: 248px;
  --topbar-height: 66px;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg-deep);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 72% -20%, rgba(20, 184, 166, 0.06), transparent 34rem),
    var(--bg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: #001815;
  background: var(--accent);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.screen-reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mono,
.metric-value,
.fact-value,
.table-mono,
.code-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* 两阶段登录和商户注册共用独立、克制的认证画布。 */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(390px, 520px) minmax(500px, 1fr);
  background: var(--bg-deep);
}

.auth-panel {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px clamp(32px, 5vw, 76px);
  border-right: 1px solid var(--border);
  background: rgba(4, 17, 31, 0.97);
}

.auth-brand {
  position: absolute;
  top: 30px;
  left: clamp(32px, 5vw, 76px);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(45, 212, 191, 0.5);
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.environment-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 22px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

.environment-label::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.1);
  content: "";
}

.auth-title {
  margin: 0 0 10px;
  font-size: clamp(27px, 3vw, 36px);
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.auth-description {
  max-width: 420px;
  margin: 0 0 30px;
  color: var(--text-soft);
  font-size: 14px;
}

.auth-switcher {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 26px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}

.auth-switcher button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
}

.auth-switcher button[aria-selected="true"] {
  color: var(--text);
  background: var(--surface-soft);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.auth-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span,
.field > label,
.fieldset-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #041726;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: #587084;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #3b637b;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--blue);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-hint,
.form-note {
  color: var(--muted);
  font-size: 12px;
}

.field-error,
.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #ff8790;
  font-size: 12px;
}

.auth-error {
  padding: 10px 12px;
  border: 1px solid rgba(251, 90, 101, 0.35);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 3px;
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 23px;
  padding: 13px 14px;
  border: 1px dashed #3f6175;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  background: rgba(7, 28, 46, 0.48);
  font-size: 12px;
}

.auth-visual {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 7vw, 100px);
  overflow: hidden;
  background:
    linear-gradient(rgba(29, 58, 79, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 58, 79, 0.18) 1px, transparent 1px),
    radial-gradient(circle at 50% 30%, rgba(45, 212, 191, 0.13), transparent 26rem),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto, auto;
}

.auth-status-board {
  width: min(680px, 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: rgba(7, 28, 46, 0.88);
  box-shadow: var(--shadow);
}

.auth-board-header,
.auth-board-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 19px 22px;
  border-bottom: 1px solid var(--border);
}

.auth-board-header {
  min-height: 68px;
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-board-row:last-child {
  border-bottom: 0;
}

.auth-board-primary {
  display: flex;
  align-items: center;
  gap: 13px;
}

.channel-glyph {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  color: var(--accent);
  background: var(--surface-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.auth-board-title {
  display: block;
  font-weight: 650;
}

.auth-board-subtitle {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* 控制台外壳使用固定侧栏、单层工作区和有边界的高密度列表。 */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: var(--topbar-height) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, #04182a, var(--sidebar) 65%, #03111e);
}

.sidebar-head {
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.sidebar-nav {
  display: grid;
  gap: 3px;
  padding: 14px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-button {
  position: relative;
  min-height: 43px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 0;
  border-radius: 7px;
  color: #b5c8d5;
  background: transparent;
  text-align: left;
}

.nav-button:hover {
  color: var(--text);
  background: rgba(16, 49, 73, 0.75);
}

.nav-button[aria-current="page"] {
  color: var(--accent);
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.14), rgba(45, 212, 191, 0.04));
}

.nav-button[aria-current="page"]::before {
  position: absolute;
  inset: 5px auto 5px -10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  content: "";
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: currentColor;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 750;
}

.nav-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 10px;
  color: #231600;
  background: var(--warning);
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
}

.sidebar-security {
  margin: auto 12px 13px;
  padding: 13px;
  border: 1px dashed #486b80;
  border-radius: 8px;
  color: var(--text-soft);
  background: rgba(7, 28, 46, 0.6);
  font-size: 11px;
  line-height: 1.55;
}

.sidebar-security strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 650;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  grid-column: 2;
  min-width: 0;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(4, 17, 31, 0.94);
  backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-right,
.identity-block {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.mobile-menu-button {
  display: none;
}

.environment-switch {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid rgba(45, 212, 191, 0.23);
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 11px;
}

.breadcrumbs {
  min-width: 0;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-copy {
  min-width: 0;
  display: grid;
  line-height: 1.25;
}

.identity-copy strong {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 650;
}

.identity-copy span {
  color: var(--muted);
  font-size: 10px;
}

.workspace {
  min-width: 0;
  grid-column: 2;
  padding: 22px;
}

.page-head {
  min-height: 58px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 17px;
}

.page-head h1 {
  margin: 0 0 4px;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.page-actions,
.inline-actions,
.drawer-actions,
.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  background: var(--surface);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.button:hover {
  color: var(--text);
  border-color: #477187;
  background: var(--surface-hover);
}

.button-primary {
  border-color: var(--accent-strong);
  color: #001b18;
  background: var(--accent);
}

.button-primary:hover {
  color: #001b18;
  border-color: #5eead4;
  background: #5eead4;
}

.button-danger {
  border-color: rgba(251, 90, 101, 0.55);
  color: #ff9ba2;
  background: var(--danger-soft);
}

.button-quiet {
  border-color: transparent;
  background: transparent;
}

.button-small {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 11px;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  background: transparent;
  font-size: 17px;
}

.icon-button:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.mobile-menu-button {
  display: none;
}

.panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(7, 28, 46, 0.9);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

.panel-head {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--border);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.panel-head-meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.panel-body {
  padding: 15px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(286px, 0.75fr);
  gap: 12px;
}

.status-strip {
  grid-column: 1 / -1;
  min-height: 94px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(10, 35, 56, 0.92), rgba(7, 28, 46, 0.92));
}

.status-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 16px;
  border-right: 1px solid var(--border);
}

.status-item:last-child {
  border-right: 0;
}

.status-rail {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 750;
}

.status-item.warning .status-rail {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-label {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-detail {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 0.74fr 1.38fr 1.12fr;
  gap: 12px;
}

.metric-list {
  display: grid;
}

.metric-row,
.health-row,
.audit-row,
.approval-row,
.channel-row,
.fixture-row {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(29, 58, 79, 0.85);
}

.metric-row {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 38px;
  padding: 7px 12px;
}

.metric-row:last-child,
.health-row:last-child,
.audit-row:last-child,
.approval-row:last-child,
.channel-row:last-child,
.fixture-row:last-child {
  border-bottom: 0;
}

.metric-label {
  color: var(--text-soft);
  font-size: 11px;
}

.metric-value {
  color: var(--text);
  font-size: 11px;
}

.channel-list,
.health-list,
.audit-list,
.approval-list,
.fixture-list {
  padding: 5px 7px;
}

.channel-row {
  grid-template-columns: 36px minmax(130px, 1.1fr) minmax(82px, 0.65fr) minmax(90px, 0.75fr) auto;
  min-height: 60px;
  padding: 8px 7px;
}

.channel-name {
  min-width: 0;
}

.channel-name strong,
.row-primary {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-name span,
.row-secondary {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.availability {
  display: grid;
  gap: 5px;
}

.availability-bar {
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: #173247;
}

.availability-bar > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}

.availability-bar.active > span {
  width: 98%;
}

.health-row {
  grid-template-columns: minmax(0, 1fr) auto 58px;
  min-height: 32px;
  padding: 5px 8px;
}

.health-bar {
  height: 5px;
  border-radius: 4px;
  background: var(--accent);
  opacity: 0.86;
}

.health-bar.warning {
  background: var(--warning);
}

.approval-row {
  grid-template-columns: 9px minmax(0, 1.3fr) minmax(90px, 0.75fr) minmax(70px, 0.65fr) auto;
  min-height: 46px;
  padding: 7px;
}

.audit-row {
  grid-template-columns: auto minmax(0, 0.8fr) minmax(0, 1.8fr) auto;
  min-height: 39px;
  padding: 6px 7px;
}

.audit-action {
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--muted);
  background: currentColor;
}

.dot.success {
  color: var(--success);
}

.dot.warning {
  color: var(--warning);
}

.dot.danger {
  color: var(--danger);
}

.dot.info {
  color: var(--blue);
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.state.success {
  color: var(--success);
}

.state.warning {
  color: var(--warning);
}

.state.danger {
  color: var(--danger);
}

.state.info {
  color: var(--blue);
}

.state.neutral {
  color: var(--text-soft);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--text-soft);
  background: rgba(13, 41, 63, 0.58);
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
}

.tag.warning {
  border-color: rgba(251, 191, 36, 0.4);
  color: var(--warning);
  background: var(--warning-soft);
}

.tag.success {
  border-color: rgba(94, 226, 138, 0.35);
  color: var(--success);
  background: var(--success-soft);
}

.tag.info {
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--blue);
  background: var(--blue-soft);
}

/* 列表页使用固定表头和横向滚动容器，避免窄屏字段互相挤压。 */
.tab-bar {
  display: flex;
  gap: 3px;
  margin-bottom: 12px;
  padding: 3px;
  border-bottom: 1px solid var(--border);
}

.tab-button {
  min-height: 35px;
  padding: 6px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.tab-button[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.data-table-wrap {
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th,
.data-table td {
  max-width: 270px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  color: #91a8b7;
  background: #082035;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.data-table tbody tr:hover {
  background: rgba(16, 49, 73, 0.5);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-empty,
.loading-state,
.error-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-symbol {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: var(--font-mono);
}

.loading-line {
  width: 180px;
  height: 3px;
  overflow: hidden;
  margin: 0 auto 12px;
  border-radius: 3px;
  background: var(--border);
}

.loading-line::after {
  width: 45%;
  height: 100%;
  display: block;
  background: var(--accent);
  animation: loading-slide 1s ease-in-out infinite;
  content: "";
}

@keyframes loading-slide {
  from { transform: translateX(-110%); }
  to { transform: translateX(260%); }
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.summary-fact {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(7, 28, 46, 0.9);
}

.summary-fact dt {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.summary-fact dd {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-catalog {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 8px;
  padding: 12px;
}

.action-card {
  min-height: 122px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-soft);
  background: var(--surface);
  text-align: left;
}

.action-card:hover {
  border-color: rgba(45, 212, 191, 0.55);
  background: var(--surface-hover);
}

.action-code {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
}

.action-card strong {
  color: var(--text);
  font-size: 13px;
}

.action-card span:last-child {
  margin-top: auto;
  color: var(--muted);
  font-size: 10px;
}

.fixture-row {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 68px;
  padding: 10px;
}

.fixture-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 11px;
}

.callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  background: rgba(13, 41, 63, 0.62);
  font-size: 11px;
}

.callout.warning {
  border-color: rgba(251, 191, 36, 0.4);
  color: #f9d96f;
  background: var(--warning-soft);
}

.callout.danger {
  border-color: rgba(251, 90, 101, 0.4);
  color: #ff9ba2;
  background: var(--danger-soft);
}

.callout.success {
  border-color: rgba(94, 226, 138, 0.35);
  color: #8eebb0;
  background: var(--success-soft);
}

/* 敏感操作采用右侧复核抽屉，投影字段和重新认证区明确分隔。 */
.drawer-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 7, 13, 0.7);
  backdrop-filter: blur(3px);
}

.drawer-layer[hidden] {
  display: none;
}

.drawer {
  width: min(520px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-strong);
  background: #061a2b;
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.35);
  animation: drawer-in 180ms ease-out;
}

@keyframes drawer-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.drawer-head {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.drawer-head h2 {
  margin: 0;
  font-size: 17px;
}

.drawer-body {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
}

.drawer-form {
  display: grid;
  gap: 17px;
}

.drawer-section {
  display: grid;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.drawer-section:last-child {
  border-bottom: 0;
}

.drawer-section h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
}

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

.review-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.review-row {
  display: grid;
  grid-template-columns: minmax(105px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.review-row:last-child {
  border-bottom: 0;
}

.review-row dt {
  color: var(--muted);
  font-size: 11px;
}

.review-row dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 11px;
}

.drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: #051725;
}

/* Toast 只显示服务器公开错误码或本地固定提示，不承载 secret 内容。 */
.toast-region {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  width: min(360px, calc(100vw - 36px));
  display: grid;
  gap: 8px;
}

.toast {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text-soft);
  background: #0a2338;
  box-shadow: var(--shadow);
}

.toast.success {
  border-color: rgba(94, 226, 138, 0.45);
}

.toast.danger {
  border-color: rgba(251, 90, 101, 0.48);
}

.toast button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
}

.mobile-overlay {
  display: none;
}

.noscript-shell {
  max-width: 520px;
  margin: 18vh auto;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

@media (max-width: 1220px) {
  :root {
    --sidebar-width: 218px;
  }

  .status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .status-item:nth-child(3) {
    border-right: 0;
  }

  .status-item:nth-child(n + 4) {
    border-top: 1px solid var(--border);
  }

  .bottom-grid {
    grid-template-columns: 0.75fr 1.25fr;
  }

  .bottom-grid > :last-child {
    grid-column: 1 / -1;
  }

  .action-catalog {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 960px) {
  .auth-page {
    grid-template-columns: minmax(360px, 500px) minmax(300px, 0.8fr);
  }

  .auth-visual {
    padding: 26px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: min(288px, 88vw);
    transform: translateX(-105%);
    transition: transform 170ms ease-out;
  }

  .app-shell.nav-open .sidebar {
    transform: none;
  }

  .mobile-overlay {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(0, 6, 12, 0.72);
  }

  .topbar,
  .workspace {
    grid-column: 1;
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .breadcrumbs {
    display: none;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .overview-grid > .panel {
    grid-column: 1;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-height: 58px;
  }

  body {
    font-size: 13px;
  }

  .auth-page {
    display: block;
  }

  .auth-panel {
    min-height: 100vh;
    padding: 90px 22px 40px;
    border-right: 0;
  }

  .auth-brand {
    top: 24px;
    left: 22px;
  }

  .auth-visual {
    display: none;
  }

  .topbar {
    padding: 0 12px;
  }

  .environment-switch {
    display: none;
  }

  .identity-copy span,
  .topbar .button span {
    display: none;
  }

  .topbar .button .topbar-logout-icon {
    display: inline;
  }

  .workspace {
    padding: 13px 11px 78px;
  }

  .page-head {
    min-height: auto;
    align-items: center;
    margin-bottom: 13px;
  }

  .page-head h1 {
    font-size: 18px;
  }

  .page-head p {
    display: none;
  }

  .page-actions .button:not(.button-primary),
  .page-actions .button-primary span.optional-label {
    display: none;
  }

  .status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: auto;
  }

  .status-item {
    min-height: 86px;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 10px;
  }

  .status-item:nth-child(n + 4) {
    display: none;
  }

  .status-rail {
    width: 26px;
    height: 26px;
    font-size: 9px;
  }

  .status-label {
    font-size: 11px;
  }

  .status-detail {
    white-space: normal;
  }

  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .bottom-grid > :last-child {
    grid-column: 1;
  }

  .channel-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .channel-row .availability,
  .channel-row .channel-capacity {
    display: none;
  }

  .approval-row {
    grid-template-columns: 8px minmax(0, 1fr) auto;
  }

  .approval-row > :nth-child(3),
  .approval-row > :nth-child(4) {
    display: none;
  }

  .audit-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .audit-row > :nth-child(3) {
    display: none;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .summary-fact {
    padding: 12px;
  }

  .summary-fact dd {
    font-size: 16px;
  }

  .action-catalog {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    padding: 9px;
  }

  .action-card {
    min-height: 110px;
  }

  .tab-bar {
    max-width: 100%;
    overflow-x: auto;
  }

  .tab-button {
    flex: 0 0 auto;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .drawer {
    width: 100%;
  }

  .drawer-footer .button {
    flex: 1;
  }

  .fixture-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .fixture-row .button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 430px) {
  .identity-copy strong {
    max-width: 120px;
  }

  .topbar-right {
    gap: 6px;
  }

  .page-actions .button-primary {
    width: 36px;
    padding: 0;
    font-size: 0;
  }

  .page-actions .button-primary::after {
    font-size: 18px;
    content: "+";
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .action-catalog {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
