:root {
  --bg: #eef4fb;
  --bg-strong: #e3edf9;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-soft: rgba(248, 251, 255, 0.98);
  --panel-dark: #0f2743;
  --line: #d8e4f2;
  --line-strong: #c3d4e7;
  --text: #17304e;
  --muted: #647a94;
  --heading: #10253d;
  --blue-900: #0f2743;
  --blue-700: #1d5fa8;
  --blue-600: #2b6db6;
  --blue-500: #3e84cf;
  --blue-100: #dbeafe;
  --blue-050: #f3f8fe;
  --danger: #bf4f5e;
  --success: #22836a;
  --warn: #b67a1d;
  --shadow-lg: 0 28px 60px rgba(22, 50, 84, 0.16);
  --shadow-md: 0 16px 34px rgba(20, 44, 74, 0.1);
  --shadow-sm: 0 10px 24px rgba(20, 44, 74, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(62, 132, 207, 0.16), transparent 28%),
    linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
}

.app-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
  min-width: 220px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(19, 133, 92, 0.96);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  box-shadow: 0 18px 36px rgba(15, 39, 67, 0.24);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-toast.error {
  background: rgba(184, 62, 78, 0.96);
}

.app-toast.is-hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

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

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  box-shadow: 0 10px 24px rgba(43, 109, 182, 0.18);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(43, 109, 182, 0.24);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

button.ghost,
button.subtle {
  color: var(--blue-700);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  box-shadow: none;
}

.sync-pull-progress {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #d8e3f0;
  border-radius: 4px;
  background: #f7f9fc;
}

.sync-pull-progress.is-hidden {
  display: none;
}

.sync-pull-progress-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.sync-pull-progress-heading > div {
  display: grid;
  gap: 4px;
}

.sync-pull-progress-heading strong {
  color: #181818;
  font-size: 14px;
}

.sync-pull-progress-heading span,
.sync-pull-progress-summary {
  color: #73777f;
  font-size: 12px;
  line-height: 1.5;
}

.sync-pull-progress-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 2px;
  background: #e5e8ed;
}

.sync-pull-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #1677ff;
  transition: width 0.24s ease;
}

.sync-pull-progress.is-indeterminate .sync-pull-progress-bar {
  width: 36% !important;
  animation: sync-progress-indeterminate 1.25s ease-in-out infinite;
}

.sync-pull-progress.is-success .sync-pull-progress-bar {
  background: #00a870;
}

.sync-pull-progress.is-failed .sync-pull-progress-bar {
  background: #d54941;
}

.sync-pull-progress.is-warning .sync-pull-progress-bar {
  background: #ff8f1f;
}

@keyframes sync-progress-indeterminate {
  0% { transform: translateX(-110%); }
  55% { transform: translateX(110%); }
  100% { transform: translateX(285%); }
}

button.danger {
  background: linear-gradient(135deg, #9e4250, var(--danger));
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(43, 109, 182, 0.45);
  box-shadow: 0 0 0 4px rgba(62, 132, 207, 0.12);
}

input:disabled,
select:disabled,
textarea:disabled {
  color: #8ea1b8;
  background: #eef3f9;
  border-color: #d7e1ec;
  cursor: not-allowed;
  box-shadow: none;
}

input[readonly],
textarea[readonly] {
  background: #f7fafe;
  color: #58708d;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.field-source-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.toggle-field {
  align-content: start;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
}

.toggle-control input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.toggle-slider {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #d7e3f0;
  box-shadow: inset 0 0 0 1px rgba(23, 48, 78, 0.08);
  transition: background 0.18s ease;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 14px rgba(16, 37, 61, 0.16);
  transition: transform 0.18s ease;
}

.toggle-control input[type="checkbox"]:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
}

.toggle-control input[type="checkbox"]:checked + .toggle-slider.danger {
  background: linear-gradient(135deg, #dc6a79, var(--danger));
}

.toggle-control input[type="checkbox"]:checked + .toggle-slider::after {
  transform: translateX(22px);
}

.toggle-control input[type="checkbox"]:focus-visible + .toggle-slider {
  box-shadow:
    inset 0 0 0 1px rgba(23, 48, 78, 0.08),
    0 0 0 4px rgba(62, 132, 207, 0.14);
}

.toggle-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.auth-screen {
  min-height: 100vh;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 10%, rgba(67, 174, 255, 0.2), transparent 22%),
    radial-gradient(circle at 80% 14%, rgba(201, 156, 72, 0.14), transparent 18%),
    radial-gradient(circle at 78% 86%, rgba(47, 120, 205, 0.14), transparent 20%),
    linear-gradient(135deg, #03070f 0%, #071221 24%, #0a1f35 58%, #050b16 100%);
}

.auth-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.94;
  filter: saturate(1.14);
}

.auth-ambient,
.auth-grid-mask,
.brand-orbit,
.brand-sheen {
  pointer-events: none;
}

.auth-ambient {
  position: absolute;
  border-radius: 50%;
  filter: blur(16px);
  opacity: 0.9;
  mix-blend-mode: screen;
}

.auth-ambient-one {
  width: 460px;
  height: 460px;
  top: -100px;
  left: -80px;
  background:
    radial-gradient(circle at 35% 35%, rgba(110, 203, 255, 0.78), rgba(35, 117, 214, 0.18) 58%, transparent 74%);
  animation: authFloatOne 14s ease-in-out infinite;
}

.auth-ambient-two {
  width: 520px;
  height: 520px;
  right: -140px;
  bottom: -160px;
  background:
    radial-gradient(circle at 50% 50%, rgba(214, 180, 112, 0.48), rgba(71, 109, 255, 0.1) 54%, transparent 74%);
  animation: authFloatTwo 18s ease-in-out infinite;
}

.auth-grid-mask {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.82), transparent 88%);
  opacity: 0.18;
}

.auth-frame {
  width: min(1260px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 510px;
  gap: 24px;
  align-items: stretch;
  position: relative;
  perspective: 1800px;
  z-index: 1;
}

.auth-brand-panel,
.auth-form-panel {
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
}

.auth-brand-panel {
  padding: 52px 50px 46px;
  color: #f7fbff;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 16%, rgba(75, 163, 255, 0.14), transparent 26%),
    radial-gradient(circle at 82% 12%, rgba(201, 156, 72, 0.12), transparent 20%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    linear-gradient(180deg, rgba(6, 16, 28, 0.98), rgba(7, 19, 35, 0.96) 46%, rgba(5, 12, 23, 0.99));
  border: 1px solid rgba(201, 156, 72, 0.16);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 548px;
  backdrop-filter: blur(20px);
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.18s ease-out, box-shadow 0.24s ease, border-color 0.24s ease;
  box-shadow:
    0 36px 80px rgba(2, 8, 18, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px rgba(201, 156, 72, 0.04);
}

.brand-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(180, 230, 255, 0.12);
}

.brand-orbit-one {
  width: 360px;
  height: 360px;
  top: -110px;
  right: -70px;
  box-shadow:
    0 0 0 1px rgba(201, 156, 72, 0.04),
    0 0 180px rgba(73, 166, 255, 0.12) inset,
    0 0 120px rgba(201, 156, 72, 0.05);
  animation: orbitSpin 32s linear infinite;
}

.brand-orbit-two {
  width: 220px;
  height: 220px;
  right: 52px;
  bottom: 54px;
  border-style: dashed;
  border-color: rgba(201, 156, 72, 0.16);
  animation: orbitSpinReverse 24s linear infinite;
}

.brand-sheen {
  position: absolute;
  inset: -20% auto auto -10%;
  width: 68%;
  height: 200%;
  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 28%,
    rgba(201, 156, 72, 0.12) 44%,
    transparent 58%,
    transparent 100%
  );
  transform: rotate(8deg);
  animation: authSheen 12s ease-in-out infinite;
}

.auth-kicker,
.section-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.auth-kicker {
  color: rgba(213, 191, 148, 0.72);
}

.section-kicker {
  color: #c99c48;
}

.auth-brand-panel h1 {
  margin: 0;
  font-size: clamp(44px, 4vw, 60px);
  line-height: 1.12;
  letter-spacing: -0.04em;
  text-shadow:
    0 18px 38px rgba(0, 0, 0, 0.3),
    0 0 42px rgba(89, 166, 255, 0.1);
}

.auth-form-panel {
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(245, 247, 250, 0.92), rgba(233, 237, 242, 0.88));
  border: 1px solid rgba(201, 156, 72, 0.18);
  display: grid;
  gap: 14px;
  align-content: start;
  backdrop-filter: blur(24px) saturate(1.25);
  position: relative;
  overflow: hidden;
  min-height: 548px;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.18s ease-out, box-shadow 0.24s ease, border-color 0.24s ease;
  box-shadow:
    0 34px 72px rgba(4, 11, 24, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.auth-form-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(201, 156, 72, 0.12), transparent 24%),
    radial-gradient(circle at 16% 0%, rgba(118, 192, 255, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 48%);
  pointer-events: none;
}

.auth-form-stack {
  position: relative;
  min-height: 478px;
}

.auth-mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(219, 234, 250, 0.72);
  border: 1px solid rgba(195, 212, 231, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.auth-mode-btn {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.auth-mode-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  box-shadow:
    0 12px 28px rgba(43, 109, 182, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.auth-card {
  padding: 30px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(247, 249, 252, 0.95));
  border: 1px solid rgba(213, 220, 231, 0.78);
  box-shadow:
    0 20px 44px rgba(9, 22, 40, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  position: relative;
  overflow: hidden;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: center top;
  transform-style: preserve-3d;
  will-change: transform;
  transition:
    opacity 0.42s ease,
    transform 0.42s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.42s ease;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 156, 72, 0.44), transparent);
  pointer-events: none;
}

.auth-card-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  pointer-events: none;
  filter: blur(10px);
}

.auth-card-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  filter: blur(0);
  transform:
    translate3d(0, 0, 0)
    rotateX(var(--card-rotate-x, 0deg))
    rotateY(var(--card-rotate-y, 0deg))
    scale(1);
}

.card-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.card-heading h2,
.card-heading p {
  margin: 0;
}

.card-heading h2 {
  font-size: 30px;
  line-height: 1.2;
  color: var(--heading);
}

.auth-card .action-row {
  margin-top: 22px;
}

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

.auth-field > span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #3e5874;
  font-size: 13px;
  font-weight: 700;
}

.auth-field em {
  color: #8799ad;
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

.auth-card button:not(.ghost) {
  min-height: 52px;
  padding-inline: 24px;
  background:
    linear-gradient(135deg, #1c4d91 0%, #256fd1 38%, #c99c48 100%);
  box-shadow:
    0 18px 38px rgba(14, 48, 94, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 0 0 1px rgba(255, 226, 165, 0.12);
  position: relative;
  overflow: hidden;
}

.auth-actions {
  align-items: center;
}

.auth-actions button:first-child {
  flex: 1 1 250px;
}

.auth-actions .ghost {
  min-width: 100px;
}

.auth-footnote {
  margin: 16px 0 0;
  color: #8293a7;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.auth-card button:not(.ghost)::after {
  content: "";
  position: absolute;
  inset: -120% auto auto -20%;
  width: 72%;
  height: 280%;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 36%,
    rgba(255, 238, 194, 0.34) 48%,
    transparent 60%
  );
  transform: rotate(8deg);
  transition: transform 0.5s ease;
}

.auth-card button:not(.ghost):hover::after {
  transform: translateX(170%) rotate(8deg);
}

.auth-card button.ghost {
  min-height: 50px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  border-color: rgba(201, 156, 72, 0.18);
}

.auth-card button.ghost:hover {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 28px rgba(28, 77, 143, 0.08);
}

.auth-card input[readonly] {
  background: linear-gradient(180deg, #f3f5f8, #f7f9fb);
  color: #748398;
}

.auth-card input,
.auth-card select {
  min-height: 50px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(245, 247, 250, 0.98));
  border-color: rgba(210, 217, 229, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 6px 18px rgba(20, 44, 74, 0.04);
  position: relative;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.auth-card input:focus,
.auth-card select:focus {
  border-color: rgba(201, 156, 72, 0.42);
  box-shadow:
    0 0 0 4px rgba(201, 156, 72, 0.12),
    0 14px 28px rgba(15, 48, 93, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(249, 246, 239, 0.96));
  transform: translateY(-1px);
}

@keyframes authFloatOne {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(24px, 18px, 0) scale(1.08);
  }
}

@keyframes authFloatTwo {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-30px, -18px, 0) scale(1.05);
  }
}

@keyframes orbitSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes orbitSpinReverse {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

@keyframes authSheen {
  0%,
  100% {
    transform: translateX(-16%) rotate(8deg);
    opacity: 0.2;
  }
  50% {
    transform: translateX(22%) rotate(8deg);
    opacity: 0.48;
  }
}

.card-heading.compact {
  margin-bottom: 14px;
}

.card-heading p:last-child {
  color: var(--muted);
  line-height: 1.72;
}

.form-grid {
  display: grid;
  gap: 16px;
}

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

.form-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.form-grid.compact {
  gap: 14px;
}

.action-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.operations-step-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.operations-step-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(43, 109, 182, 0.1);
  border: 1px solid rgba(43, 109, 182, 0.14);
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.operations-step-pill.subtle {
  background: rgba(118, 142, 170, 0.12);
  border-color: rgba(118, 142, 170, 0.16);
  color: var(--muted);
}

.operations-guidance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.operations-date-override {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.operations-date-override label {
  margin: 0;
}

.subtle-action {
  justify-self: flex-start;
  min-height: 38px;
  padding: 8px 14px;
  color: var(--muted) !important;
}

.quick-role-list {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feedback-banner,
.feedback-note {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--blue-050);
  border: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.7;
}

.feedback-note.action-hint {
  background: #f8fbff;
  color: #516b8f;
}

.feedback-note.success {
  color: var(--success);
  border-color: rgba(34, 131, 106, 0.2);
  background: rgba(34, 131, 106, 0.08);
}

.feedback-note.error {
  color: var(--danger);
  border-color: rgba(191, 79, 94, 0.2);
  background: rgba(191, 79, 94, 0.08);
}

.auth-feedback {
  min-height: 0;
  margin: 12px 4px 0;
  padding: 0;
  word-break: break-word;
  color: var(--muted);
  font: 14px/1.6 "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
}

.auth-feedback:not(:empty) {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--blue-050);
}

.auth-feedback.success {
  color: var(--success);
  border-color: rgba(34, 131, 106, 0.2);
  background: rgba(34, 131, 106, 0.08);
}

.auth-feedback.error {
  color: var(--danger);
  border-color: rgba(191, 79, 94, 0.2);
  background: rgba(191, 79, 94, 0.08);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
}

.app-hidden {
  display: none !important;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    linear-gradient(180deg, #0f2743, #133257 55%, #102842);
  color: #f5f9fe;
  display: grid;
  gap: 16px;
  align-content: start;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sidebar-brand h2,
.sidebar-brand p,
.sidebar-user-card strong,
.sidebar-user-card p,
.sidebar-footnote strong,
.sidebar-footnote span {
  margin: 0;
}

.sidebar-brand h2 {
  margin-top: 8px;
  font-size: 26px;
  line-height: 1.12;
}

.sidebar-copy,
.sidebar-user-card p {
  color: rgba(245, 249, 254, 0.68);
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.sidebar-user-card,
.sidebar-footnote,
.sidebar-workload-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-card span,
.sidebar-footnote span,
.sidebar-nav-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 249, 254, 0.58);
}

.sidebar-user-card strong,
.sidebar-footnote strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sidebar-user-head {
  display: flex;
  gap: 14px;
  align-items: center;
}

.sidebar-avatar-shell {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  overflow: hidden;
  flex: 0 0 72px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-avatar-image,
.sidebar-avatar-fallback {
  width: 100%;
  height: 100%;
}

.sidebar-avatar-image {
  object-fit: cover;
  display: block;
}

.sidebar-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  color: #f5f9fe;
  background:
    radial-gradient(circle at 28% 24%, rgba(62, 132, 207, 0.36), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.sidebar-user-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

#sidebarUsernameMeta {
  margin: 0;
  color: rgba(245, 249, 254, 0.78);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.sidebar-user-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.sidebar-role-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #eff6ff;
  background: rgba(62, 132, 207, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-role-chip.subtle {
  color: rgba(245, 249, 254, 0.72);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-avatar-upload {
  margin-top: 12px;
  display: flex;
}

.sidebar-user-actions {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.sidebar-action-btn {
  width: 100%;
  justify-content: center;
}

.sidebar-avatar-trigger {
  width: 100%;
  justify-content: center;
  color: #eff6ff !important;
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  padding: 10px 14px;
}

.sidebar-avatar-input {
  display: none !important;
}

.sidebar-workload-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.sidebar-workload-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-workload-item span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 249, 254, 0.54);
}

.sidebar-workload-item strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1.08;
  color: #ffffff;
}

.sidebar-workload-item small {
  display: block;
  margin-top: 6px;
  color: rgba(245, 249, 254, 0.7);
  line-height: 1.5;
}

.sidebar-workload-grid[data-role="sales"] .sidebar-workload-item {
  background: linear-gradient(180deg, rgba(18, 80, 142, 0.42), rgba(18, 55, 94, 0.42));
  border-color: rgba(85, 155, 226, 0.28);
}

.sidebar-workload-grid[data-role="operations"] .sidebar-workload-item {
  background: linear-gradient(180deg, rgba(23, 111, 96, 0.42), rgba(18, 72, 65, 0.42));
  border-color: rgba(71, 176, 154, 0.26);
}

.sidebar-workload-grid[data-role="finance"] .sidebar-workload-item {
  background: linear-gradient(180deg, rgba(124, 84, 24, 0.4), rgba(92, 58, 16, 0.4));
  border-color: rgba(204, 157, 72, 0.24);
}

.sidebar-workload-grid[data-role="management"] .sidebar-workload-item {
  background: linear-gradient(180deg, rgba(90, 42, 118, 0.42), rgba(62, 28, 83, 0.42));
  border-color: rgba(175, 112, 214, 0.24);
}

.sidebar-workload-grid[data-role="admin"] .sidebar-workload-item {
  background: linear-gradient(180deg, rgba(126, 41, 71, 0.42), rgba(82, 24, 47, 0.42));
  border-color: rgba(214, 105, 142, 0.24);
}

.sidebar-nav-links {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.side-nav-link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 18px;
  text-decoration: none;
  color: rgba(245, 249, 254, 0.88);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  gap: 16px;
}

.side-nav-link:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.side-nav-link span,
.side-nav-link small {
  overflow-wrap: anywhere;
}

.side-nav-link span {
  flex: 1 1 auto;
}

.side-nav-link small {
  flex: 0 0 auto;
  color: rgba(245, 249, 254, 0.54);
  text-align: right;
}

.app-main {
  padding: 22px;
  display: grid;
  gap: 18px;
  max-height: 100vh;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.topbar,
.session-strip,
.content-card,
.inner-card,
.data-table-card,
.workspace-hero {
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid rgba(218, 229, 241, 0.88);
  box-shadow: var(--shadow-sm);
}

.topbar {
  padding: 18px 22px;
  display: block;
}

.topbar h1,
.workspace-hero h2,
.inner-card h3 {
  margin: 0;
  color: var(--heading);
}

.topbar h1 {
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.topbar p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.kpi-card,
.stat-card {
  padding: 12px 16px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(243, 248, 254, 0.95), rgba(255, 255, 255, 0.92));
  border: 1px solid var(--line);
}

.kpi-card span,
.stat-card .stat-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-card strong,
.stat-card .stat-value {
  display: block;
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.12;
  color: var(--heading);
}

.session-strip {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.role-workspace {
  display: none;
  gap: 18px;
}

.role-workspace.active {
  display: grid;
}

.workspace-hero {
  padding: 24px;
  display: grid;
  gap: 18px;
  background:
    radial-gradient(circle at top right, rgba(62, 132, 207, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.94));
}

.hero-copy-block p:last-child {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.78;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

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

.kpi-card p,
.stat-card .stat-detail {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.content-card {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.operations-launchpad {
  min-height: min(620px, calc(100vh - 150px));
  align-content: center;
  padding: clamp(28px, 4vw, 54px);
  background:
    radial-gradient(circle at 90% 4%, rgba(201, 156, 72, 0.15), transparent 24%),
    radial-gradient(circle at 2% 100%, rgba(62, 132, 207, 0.14), transparent 28%),
    linear-gradient(145deg, #fafdff 0%, #f2f7fc 100%);
}

.operations-launchpad .card-heading {
  max-width: 620px;
  margin-bottom: 12px;
}

.operations-launchpad .card-heading h2 {
  font-size: clamp(30px, 3.2vw, 42px);
}

.operations-launchpad-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.operations-launch-card {
  min-height: 172px;
  padding: 22px;
  display: grid;
  align-content: space-between;
  justify-items: start;
  gap: 12px;
  border: 1px solid rgba(203, 218, 234, 0.96);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--heading);
  text-align: left;
  box-shadow: 0 10px 28px rgba(23, 48, 78, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.operations-launch-card:hover {
  transform: translateY(-3px);
  border-color: rgba(43, 109, 182, 0.42);
  box-shadow: 0 18px 34px rgba(23, 48, 78, 0.12);
}

.operations-launch-card:focus-visible {
  outline: 3px solid rgba(62, 132, 207, 0.3);
  outline-offset: 3px;
}

.operations-launch-card.primary {
  background: linear-gradient(135deg, #133c71, #246bc2);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 18px 34px rgba(25, 78, 145, 0.24);
}

.operations-launch-card.primary:hover {
  border-color: transparent;
  box-shadow: 0 22px 40px rgba(25, 78, 145, 0.32);
}

.operations-launch-index {
  color: #7692af;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.operations-launch-card.primary .operations-launch-index {
  color: rgba(255, 226, 165, 0.82);
}

.operations-launch-card strong {
  font-size: 20px;
  line-height: 1.25;
}

.operations-launch-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
}

.operations-launch-card.primary small {
  color: rgba(240, 247, 255, 0.76);
}

.operations-launch-card.data {
  background:
    radial-gradient(circle at 90% 15%, rgba(201, 156, 72, 0.22), transparent 32%),
    linear-gradient(145deg, #fffdf7, #f5f9ff);
}

.custodian-data-dashboard {
  display: grid;
  gap: 18px;
}

.custodian-data-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(203, 218, 234, 0.9);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.92));
}

.custodian-data-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.custodian-data-panel-header h3 {
  margin: 0;
  color: var(--heading);
  font-size: 19px;
}

.custodian-data-panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.custodian-data-count {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 800;
}

.custodian-table-scroll {
  height: min(52vh, 480px);
  overflow-x: auto;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

/* 托管数据通常为长表，保留可见轨道以明确表内可用滚轮浏览。 */
.custodian-table-scroll::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.custodian-table-scroll::-webkit-scrollbar-track {
  background: #edf3fa;
  border-radius: 999px;
}

.custodian-table-scroll::-webkit-scrollbar-thumb {
  background: #9cb6d4;
  border: 3px solid #edf3fa;
  border-radius: 999px;
}

.custodian-table-scroll::-webkit-scrollbar-thumb:hover {
  background: #5d88ba;
}

.content-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.content-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.content-split > .content-card,
.content-split > .inner-card {
  min-width: 0;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.inner-card {
  padding: 20px;
  display: grid;
  gap: 16px;
  min-width: 0;
}

.summary-card {
  margin-top: 4px;
}

.data-table-card {
  padding: 4px;
  overflow: hidden;
  min-width: 0;
}

.sales-table-scroll {
  max-height: 360px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.operations-table-scroll {
  max-height: 420px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.finance-table-scroll {
  max-height: 420px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.summary-block {
  padding: 16px;
  border-radius: 16px;
  background: var(--blue-050);
  border: 1px solid var(--line);
  line-height: 1.72;
}

.summary-block.emphasis {
  background: linear-gradient(180deg, rgba(236, 245, 255, 0.96), rgba(249, 252, 255, 0.96));
}

.summary-block.next-step {
  background: linear-gradient(180deg, rgba(245, 249, 255, 0.98), rgba(255, 255, 255, 0.98));
  border-color: rgba(43, 109, 182, 0.18);
}

.summary-block.action-feedback {
  background: #f7fbff;
}

.summary-block.action-feedback:empty {
  display: none;
}

.commission-scheme-card {
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.98), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(43, 109, 182, 0.12);
}

.commission-scheme-grid {
  align-items: end;
}

.commission-table-scroll {
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.commission-allocation-table {
  min-width: 1180px;
}

.commission-allocation-table th,
.commission-allocation-table td {
  vertical-align: middle;
}

.commission-allocation-table th:nth-child(1),
.commission-allocation-table td:nth-child(1) {
  width: 72px;
  text-align: center;
}

.commission-allocation-table th:nth-child(2),
.commission-allocation-table td:nth-child(2) {
  width: 138px;
}

.commission-allocation-table th:nth-child(5),
.commission-allocation-table th:nth-child(6),
.commission-allocation-table th:nth-child(7),
.commission-allocation-table td:nth-child(5),
.commission-allocation-table td:nth-child(6),
.commission-allocation-table td:nth-child(7) {
  width: 128px;
}

.commission-allocation-table input,
.commission-allocation-table select {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
}

.commission-level-badge {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-weight: 800;
}

.commission-absolute-input {
  background: #eef7ff;
  border-color: rgba(43, 109, 182, 0.26);
  color: var(--blue-700);
  font-weight: 800;
}

.commission-ratio-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #f8fbff;
}

.commission-ratio-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.commission-ratio-summary .is-valid {
  color: #16785f;
  background: #e8f7f1;
}

.commission-ratio-summary .is-warning {
  color: #a45c00;
  background: #fff3df;
}

.commission-ratio-summary .company-ratio {
  color: var(--blue-700);
  background: var(--blue-100);
}

.commission-ratio-summary .commission-balance-btn {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--blue-700);
  background: #fff;
  border: 1px solid rgba(43, 109, 182, 0.2);
  box-shadow: none;
  font-size: 12px;
}

button.danger-text {
  color: #a33d4c;
}

.commission-preview-shell {
  display: grid;
  gap: 16px;
}

.commission-preview-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.commission-preview-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 700;
}

.commission-result-grid,
.commission-result-mini-grid {
  display: grid;
  gap: 12px;
}

.commission-result-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.commission-result-card,
.commission-result-mini-card {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  min-width: 0;
}

.commission-result-card {
  padding: 16px;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.commission-result-mini-card {
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.commission-role-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.commission-role-amount {
  font-size: 24px;
  font-weight: 800;
  color: var(--heading);
  line-height: 1.1;
}

.commission-role-meta,
.commission-result-mini-card small {
  color: var(--muted);
  line-height: 1.55;
}

.commission-result-card.role-fund_manager {
  background: linear-gradient(180deg, #eef7ff, #ffffff);
}

.commission-result-card.role-sales {
  background: linear-gradient(180deg, #f1fbf8, #ffffff);
}

.commission-result-card.role-introducer {
  background: linear-gradient(180deg, #fff8ec, #ffffff);
}

.commission-result-card.role-distributor {
  background: linear-gradient(180deg, #f8f2ff, #ffffff);
}

.commission-result-card.role-company {
  background: linear-gradient(180deg, #f6f8fc, #ffffff);
}

.table-inline-scheme {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.table-inline-scheme span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.table-inline-scheme select {
  padding: 8px 12px;
  min-height: 38px;
  background: #fff;
}

.result-card pre,
.stat-detail {
  padding: 18px;
  border-radius: 16px;
  background: #0f2743;
  color: #eaf3fd;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

thead {
  background: #f4f8fd;
}

th,
td {
  padding: 15px 14px;
  border-bottom: 1px solid #e7eef7;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
  position: relative;
}

.table-header-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
}

.table-header-btn {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  color: var(--blue-700);
  box-shadow: none;
  font-size: 12px;
  line-height: 1;
}

.table-header-btn:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--line-strong);
}

.table-header-btn.is-active {
  background: var(--blue-100);
  border-color: rgba(43, 109, 182, 0.28);
}

.table-header-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: 248px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 12px;
}

.table-header-menu-title {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.table-header-menu-section {
  display: grid;
  gap: 8px;
}

.table-header-menu-section + .table-header-menu-section {
  padding-top: 12px;
  border-top: 1px solid rgba(216, 228, 242, 0.92);
}

.table-header-menu-section-title {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.table-header-menu-actions,
.table-header-menu-filters {
  display: grid;
  gap: 8px;
}

.table-header-menu-filters {
  max-height: 240px;
  overflow: auto;
  padding-right: 2px;
}

.table-header-menu button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  min-height: 38px;
  border-radius: 10px;
  box-shadow: none;
}

.table-header-menu button.ghost.is-selected {
  background: var(--blue-100);
  border-color: rgba(43, 109, 182, 0.28);
}

tbody tr:hover {
  background: #f8fbff;
}

tbody tr.table-row-selected {
  background: rgba(219, 234, 254, 0.55);
}

tbody tr[data-application-id] {
  cursor: pointer;
}

tbody tr[data-finance-fee-record-id] {
  cursor: pointer;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(34, 131, 106, 0.12);
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.status-pill.warn {
  background: rgba(182, 122, 29, 0.12);
  color: var(--warn);
}

.status-pill.neutral {
  background: rgba(100, 122, 148, 0.12);
  color: var(--muted);
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1280px) {
  .auth-frame,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
  }

  .session-strip,
  .form-grid.four,
  .form-grid.five,
  .kpi-grid,
  .kpi-grid-three,
  .topbar-meta,
  .operations-guidance-grid,
  .commission-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .auth-screen,
  .app-main {
    padding: 16px;
  }

  .auth-brand-panel,
  .auth-form-panel,
  .topbar,
  .workspace-hero,
  .content-card,
  .inner-card {
    padding: 18px;
  }

  .auth-form-stack {
    min-height: 0;
  }

  .auth-brand-panel {
    min-height: 0;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .form-grid.two,
  .form-grid.four,
  .form-grid.five,
  .content-split,
  .content-stack,
  .session-strip,
  .kpi-grid,
  .kpi-grid-three,
  .topbar-meta,
  .operations-guidance-grid,
  .commission-result-grid,
  .commission-result-mini-grid {
    grid-template-columns: 1fr;
  }

  .operations-launchpad {
    min-height: 0;
  }

  .operations-launchpad-grid {
    grid-template-columns: 1fr;
  }

  .section-toolbar,
  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }
}

/* 控制台化界面：信息密度、层级和操作路径统一为企业工作台风格。 */
:root {
  --bg: #f5f7fa;
  --bg-strong: #eef2f6;
  --panel: #ffffff;
  --panel-soft: #fafcff;
  --line: #e5e7eb;
  --line-strong: #d9dee7;
  --text: #1f2937;
  --muted: #6b7280;
  --heading: #1f2937;
  --blue-900: #0f3f85;
  --blue-700: #1677ff;
  --blue-600: #1677ff;
  --blue-500: #4096ff;
  --blue-100: #e6f4ff;
  --blue-050: #f5faff;
  --radius-xl: 12px;
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 3px rgba(31, 41, 55, 0.08);
}

body {
  background: var(--bg);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

button {
  min-height: 32px;
  padding: 6px 14px;
  border-radius: 4px;
  background: var(--blue-600);
  box-shadow: none;
}

button:hover {
  box-shadow: none;
  background: #4096ff;
  transform: none;
}

button.ghost,
button.subtle {
  color: #2468c7;
  background: #fff;
  border-color: #b8d2f3;
}

input,
select,
textarea {
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 4px;
  font-size: 14px;
}

label { gap: 6px; }
label span { letter-spacing: 0; }

.app-shell { grid-template-columns: 248px minmax(0, 1fr); }

.app-sidebar {
  padding: 18px 14px;
  background: #0b1d36;
  gap: 14px;
  overflow-y: auto;
}

.sidebar-brand h2 { margin-top: 0; font-size: 22px; }
.sidebar-user-card,
.sidebar-footnote,
.sidebar-workload-card { border-radius: 8px; padding: 14px; }
.sidebar-avatar-shell { width: 54px; height: 54px; border-radius: 8px; flex-basis: 54px; }
.sidebar-avatar-fallback { font-size: 21px; }
.sidebar-workload-item { border-radius: 6px; padding: 10px 12px; }
.sidebar-workload-item strong { font-size: 21px; }

.app-main {
  padding: 0 22px 28px;
  gap: 16px;
  max-height: none;
  overflow: visible;
  background: var(--bg);
}

html { overflow-y: scroll; }

body { overflow-y: visible; }

body[data-page-role="operations"] {
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
  min-height: 100vh;
}

body[data-page-role="operations"] .app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -22px;
  padding: 17px 22px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.96);
}

.topbar h1 { font-size: 22px; letter-spacing: 0; }
.topbar h1::before { content: "工作台 / "; color: #8c8c8c; font-size: 13px; font-weight: 500; }
.topbar p:last-child { font-size: 13px; }

.content-card,
.inner-card,
.data-table-card,
.workspace-hero,
.session-strip {
  border-radius: 8px;
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.content-card { padding: 20px; gap: 16px; }
.inner-card { padding: 18px; }
.card-heading { margin-bottom: 16px; gap: 6px; }
.card-heading h2 { font-size: 22px; }
.card-heading h3,
.inner-card h3 { font-size: 17px; }
.section-kicker { color: #1677ff; letter-spacing: .08em; }

.operations-launchpad {
  min-height: auto;
  align-content: start;
  padding: 26px;
  background: #fff;
}

.operations-launchpad-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sales-launchpad-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.management-launchpad-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.management-dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

body[data-page-role="management"] .app-main,
.management-workspace-panel {
  align-content: start;
}

@media (max-width: 1180px) {
  .sales-launchpad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .sales-launchpad-grid { grid-template-columns: 1fr; }
}

.management-workspace-panel {
  min-height: 0;
}

.management-workspace-panel .card-heading {
  margin-bottom: 0;
}

.management-workspace-panel .data-table-card {
  width: 100%;
  align-self: start;
}

.management-workspace-panel .data-table-card thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}
.operations-launch-card {
  min-height: 146px;
  padding: 18px;
  border-radius: 8px;
  box-shadow: none;
}
.operations-launch-card:hover { transform: none; box-shadow: 0 4px 14px rgba(31, 41, 55, .12); }
.operations-launch-card strong { font-size: 18px; }
.operations-launch-index { color: #8c8c8c; }

.form-grid { gap: 14px; }
.action-row {
  margin-top: 14px;
  gap: 8px;
  align-items: center;
}
.summary-block,
.feedback-banner,
.feedback-note { border-radius: 6px; padding: 12px 14px; }
.operations-step-pill { min-height: 30px; padding: 5px 10px; border-radius: 4px; font-size: 12px; }
.data-table-card { border-radius: 6px; }
.custodian-data-panel { border-radius: 8px; padding: 16px; }

table { font-size: 13px; }
th { background: #f7f8fa !important; color: #4b5563; }
th, td { padding: 10px 12px !important; }

@media (max-width: 1280px) {
  .app-shell { grid-template-columns: 216px minmax(0, 1fr); }
  .management-launchpad-grid,
  .management-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .management-launchpad-grid,
  .management-dashboard-grid { grid-template-columns: 1fr; }
}

/* 最终覆盖通用 data-table-card 的 overflow:hidden，确保托管长表可双向滚动。 */
.data-table-card.custodian-table-scroll {
  display: block;
  width: 100%;
  height: min(52vh, 480px);
  max-height: 480px;
  overflow-x: scroll !important;
  overflow-y: scroll !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  touch-action: pan-x pan-y;
}

.data-table-card.custodian-table-scroll > table,
.data-table-card.custodian-table-scroll > .table-scroll-shell > table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.data-table-card.custodian-table-scroll > .table-scroll-shell {
  min-width: 100%;
  overflow: visible;
}

.data-table-card.custodian-table-scroll th,
.data-table-card.custodian-table-scroll td {
  min-width: 132px;
  white-space: nowrap;
}

.data-table-card.custodian-table-scroll th:first-child .table-header-menu {
  right: auto;
  left: 0;
}

.data-table-card.custodian-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}

.data-table-card.custodian-table-scroll thead th:has(.table-header-btn.is-active) {
  z-index: 30;
}

/* 运营托管页：阿里云控制台式紧凑信息层级 */
body[data-page-role="operations"] #operations-sync {
  background: #f5f7fa;
  border-radius: 4px;
  box-shadow: none;
}

#operations-sync > .card-heading {
  padding: 18px 20px;
  margin: -20px -20px 0;
  background: #fff;
  border-bottom: 1px solid #e5e6eb;
}

#operations-sync .content-stack { gap: 16px; }

#operations-sync .console-card {
  padding: 0;
  overflow: visible;
  border: 1px solid #e5e6eb;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
  background: #fff;
}

.console-card-heading {
  min-height: 56px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e6eb;
}

.console-card-heading h3 { font-size: 15px; }
.console-card-heading p { margin: 4px 0 0; color: #86909c; font-size: 12px; }
#operations-sync .console-card > .form-grid,
#operations-sync .console-card > .action-row,
#operations-sync .console-card > .card-heading { margin-left: 16px; margin-right: 16px; }
#operations-sync .console-card > .form-grid { margin-top: 16px; }

.console-filter-panel,
.console-maintenance-panel {
  margin: 14px 16px 0;
  border: 1px solid #e5e6eb;
  border-radius: 2px;
  background: #fafbfc;
}

.console-filter-panel summary,
.console-maintenance-panel summary {
  min-height: 40px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1d2129;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.console-filter-panel summary::-webkit-details-marker,
.console-maintenance-panel summary::-webkit-details-marker { display: none; }
.console-filter-panel summary::before,
.console-maintenance-panel summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #4e5969;
  transition: transform .16s ease;
}
.console-filter-panel[open] summary::before,
.console-maintenance-panel[open] summary::before { transform: rotate(90deg); }
.console-filter-panel summary small,
.console-maintenance-panel summary small { margin-left: auto; color: #86909c; font-weight: 400; }
.console-maintenance-panel summary { color: #ad6800; }
.console-filter-content { padding: 14px 12px; border-top: 1px solid #e5e6eb; background: #fff; }
.console-filter-content .action-row { margin-bottom: 0; }

#operations-sync input,
#operations-sync select { min-height: 34px; padding: 7px 10px; border-radius: 2px; }
#operations-sync button { min-height: 34px; padding: 7px 14px; border-radius: 2px; box-shadow: none; }
#operations-sync button:hover { transform: none; }
#operations-sync .console-query-actions { padding: 0 16px; }

.table-result-toolbar {
  min-height: 46px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e5e6eb;
  background: #fff;
  color: #4e5969;
  font-size: 13px;
}
.table-result-toolbar strong { color: #1677ff; }
.table-result-toolbar .table-export-btn { min-height: 30px; padding: 5px 12px; border-radius: 2px; color: #1677ff; border-color: #94bfff; }
.table-scroll-shell { width: 100%; overflow: auto; }
.data-table-card.operations-table-scroll {
  max-height: none;
  margin: 10px 0 0;
  overflow: visible;
  border-radius: 2px;
  box-shadow: none;
}
.data-table-card.operations-table-scroll:empty { display: none; }
.data-table-card.operations-table-scroll .table-scroll-shell {
  max-height: min(48vh, 430px);
  padding-bottom: 12px;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}
.data-table-card.operations-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}
.data-table-card.operations-table-scroll table { min-width: 900px; }
.table-empty-state { margin: 0; padding: 26px 16px; text-align: center; color: #86909c; background: #fff; }

#operations-core .operations-step-card:first-child {
  gap: 10px;
}

#operations-core .operations-step-card:first-child .card-heading {
  margin-bottom: 0;
}

#operations-core .operations-redemption-card {
  gap: 10px;
}

#operations-core .operations-redemption-card .card-heading {
  margin-bottom: 0;
}

.operations-primary-actions {
  margin-top: 0;
}

.operations-primary-actions .subtle-action {
  margin-left: auto;
}

.operations-compact-selection {
  gap: 10px;
}

.operations-compact-selection label {
  gap: 4px;
}

.operations-compact-selection input {
  min-height: 34px;
}

#operations-core .operations-date-override {
  margin-top: 0;
}

.operations-inline-feedback {
  margin: 0;
  padding: 9px 12px;
  line-height: 1.45;
}

.operations-compact-prompt {
  margin: 0;
  padding: 10px 12px;
  line-height: 1.5;
  color: #344054;
  background: #f5f9ff;
  border-color: #d6e6fb;
}

.risk-detail-trigger {
  min-height: 0;
  padding: 0;
  display: inline-grid;
  justify-items: start;
  gap: 3px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  text-align: left;
}

.risk-detail-trigger:hover,
.risk-detail-trigger:focus-visible {
  transform: none;
  background: #fff7e8;
  outline: 2px solid #f5b544;
  outline-offset: 2px;
}

.risk-detail-trigger small {
  color: #475467;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.risk-detail-dialog {
  width: min(780px, calc(100vw - 32px));
  max-height: min(82vh, 760px);
  padding: 0;
  overflow: hidden;
  color: #172b4d;
  background: #fff;
  border: 1px solid #d8e2ef;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(15, 35, 64, .24);
}

.risk-detail-dialog::backdrop {
  background: rgba(9, 30, 66, .52);
  backdrop-filter: blur(2px);
}

.risk-dialog-shell {
  max-height: min(82vh, 760px);
  display: flex;
  flex-direction: column;
}

.risk-dialog-header {
  padding: 18px 20px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e5eaf0;
  background: linear-gradient(135deg, #f7fbff, #fffaf0);
}

.risk-dialog-header h2,
.risk-dialog-header p { margin: 0; }
.risk-dialog-header h2 { margin-top: 3px; font-size: 21px; }
.risk-dialog-close { min-height: 32px; padding: 5px 12px; }
.risk-dialog-body { padding: 18px 20px 22px; overflow-y: auto; }

.risk-dialog-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: #475467;
}

.risk-dialog-identity strong { color: #1677ff; }

.risk-dialog-metrics {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.risk-dialog-metrics > div {
  padding: 10px 12px;
  display: grid;
  gap: 3px;
  background: #f6f8fb;
  border: 1px solid #e5eaf0;
  border-radius: 7px;
}

.risk-dialog-metrics span { color: #667085; font-size: 12px; }
.risk-dialog-metrics strong { font-size: 14px; }
.risk-dialog-section { margin-top: 18px; }
.risk-dialog-section h3 { margin: 0 0 9px; font-size: 16px; }
.risk-dialog-list { display: grid; gap: 8px; }

.risk-dialog-item {
  padding: 11px 12px;
  border-left: 4px solid #f5a623;
  border-radius: 6px;
  background: #fffaf0;
}

.risk-dialog-item > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.risk-dialog-item p { margin: 6px 0 0; color: #475467; line-height: 1.55; }
.risk-dialog-actions { padding: 13px 15px; background: #f5f9ff; border: 1px solid #d6e6fb; border-radius: 8px; }
.risk-dialog-actions ol { margin: 0; padding-left: 22px; }
.risk-dialog-actions li + li { margin-top: 7px; }
.risk-dialog-next { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid #d6e6fb; }
.risk-dialog-error { padding: 14px; color: #8a2c0d; background: #fff4ed; border-radius: 8px; }
.risk-dialog-error p:last-child { margin-bottom: 0; }

@media (max-width: 760px) {
  .console-filter-panel summary small,
  .console-maintenance-panel summary small { display: none; }
  .data-table-card.operations-table-scroll { margin-left: 10px; margin-right: 10px; }
  .operations-primary-actions .subtle-action { margin-left: 0; }
  .risk-dialog-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.linked-application-dialog { width: min(640px, calc(100vw - 32px)); max-height: 85vh; overflow: auto; border: 1px solid #dbe3ed; border-radius: 18px; padding: 28px; color: #172435; }
.linked-application-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.linked-application-dialog dl { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr; gap: 12px; }
.linked-application-dialog dt { color: #64748b; }
.linked-application-dialog dd { margin: 0; overflow-wrap: anywhere; }
.linked-application-dialog button { margin: 12px 12px 0 0; }
#feishuLoginBtn[hidden] { display: none; }
