:root {
  --ink: #1a2332;
  --ink-2: #243044;
  --ink-3: #314158;
  --paper: #eef1f5;
  --panel: #ffffff;
  --line: #d5dbe6;
  --line-soft: #e6ebf2;
  --text: #1c2430;
  --text-2: #5a6578;
  --muted: #8a94a6;
  --cinnabar: #b83b2e;
  --cinnabar-dark: #962f24;
  --pine: #2f6b57;
  --pine-soft: #e8f3ee;
  --warn: #b7791f;
  --warn-soft: #f8efd8;
  --danger: #b83b2e;
  --danger-soft: #f8e8e6;
  --ok: #2f6b57;
  --ok-soft: #e8f3ee;
  --shadow: 0 8px 28px rgba(26, 35, 50, 0.12);
  --radius: 8px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Noto Serif SC", "Songti SC", "SimSun", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--paper);
}

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

a { color: var(--cinnabar); }

[hidden] { display: none !important; }

/* 显式覆盖：避免 .modal-mask { display:flex } 盖住 hidden 导致全屏透明遮罩吞点击 */
.modal-mask[hidden],
.drawer-mask[hidden],
#view-login[hidden],
#view-app[hidden] {
  display: none !important;
  pointer-events: none !important;
}

/* —— 登录 —— */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
  background:
    linear-gradient(145deg, rgba(26, 35, 50, 0.92), rgba(36, 48, 68, 0.88)),
    radial-gradient(circle at 20% 20%, rgba(184, 59, 46, 0.25), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(47, 107, 87, 0.22), transparent 45%),
    linear-gradient(160deg, #1a2332, #314158);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px;
  background: rgba(255, 255, 255, 0.96);
}

.login-brand {
  margin-bottom: 32px;
}

.login-seal,
.sidebar-seal {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--cinnabar);
  color: #fff;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
  overflow: hidden;
  position: relative;
}

.login-seal img,
.sidebar-seal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.login-brand h1 {
  margin: 16px 0 6px;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.login-brand p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

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

.login-form label {
  display: grid;
  gap: 6px;
}

.login-form label span,
.field span {
  font-size: 13px;
  color: var(--text-2);
}

.login-form input,
.field input,
.field select,
.field textarea,
.toolbar input,
.toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.login-form input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar input:focus,
.toolbar select:focus {
  border-color: #9aa8bc;
  box-shadow: 0 0 0 3px rgba(49, 65, 88, 0.12);
}

.login-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* 登录右侧：全幅水墨 + 左下大字（无内嵌空方框） */
.login-aside {
  position: relative;
  overflow: hidden;
  background: #0e131a;
  min-height: 100vh;
}

.login-aside-visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.login-aside-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
  filter: contrast(1.08) saturate(0.85);
}

.login-aside-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 14, 20, 0.55) 0%, rgba(10, 14, 20, 0.12) 42%, transparent 68%),
    linear-gradient(180deg, transparent 45%, rgba(8, 12, 18, 0.72) 100%);
  pointer-events: none;
}

.login-aside-copy {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  color: #fff;
  font-family: var(--display);
  pointer-events: none;
  text-align: center;
  max-width: 92%;
  padding: 0;
  background: none;
  backdrop-filter: none;
  box-shadow: none;
}

.login-aside-copy p {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 46px);
  font-weight: 700;
  letter-spacing: 0.28em;
  line-height: 1.45;
  white-space: nowrap;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.9),
    0 2px 8px rgba(0, 0, 0, 0.85),
    0 6px 20px rgba(0, 0, 0, 0.55);
}

.login-aside-copy::before {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  background: var(--cinnabar, #b83b2e);
  margin: 0 auto 18px;
}

.login-aside.has-custom-image .login-aside-visual img {
  filter: none;
}

.brand-preview {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.brand-preview-card {
  width: 220px;
  border: 1px solid var(--line, #e5e8ee);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.brand-preview-card .thumb {
  height: 120px;
  background: #f3f5f8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2, #888);
  font-size: 13px;
}

.brand-preview-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-preview-card.aside .thumb img {
  object-fit: cover;
}

.brand-preview-card .meta {
  padding: 10px 12px;
  font-size: 13px;
}

/* —— 主框架 —— */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, var(--ink), var(--ink-2));
  color: #d9e0ea;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand strong {
  display: block;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.06em;
  color: #fff;
}

.sidebar-brand small {
  color: rgba(217, 224, 234, 0.55);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.sidebar-nav {
  flex: 1;
  overflow: auto;
  padding: 12px 10px 20px;
}

.nav-group {
  margin-top: 14px;
}

.nav-group:first-child {
  margin-top: 4px;
}

.nav-group-title {
  padding: 8px 12px 6px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(217, 224, 234, 0.42);
  text-transform: none;
}

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: rgba(232, 237, 244, 0.88);
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active {
  background: rgba(184, 59, 46, 0.92);
  color: #fff;
  font-weight: 600;
}

.sidebar-foot {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 10px;
}

.user-chip {
  font-size: 13px;
  line-height: 1.45;
}

.user-chip strong {
  display: block;
  color: #fff;
}

.user-chip span {
  color: rgba(217, 224, 234, 0.55);
  font-size: 12px;
}

.user-chip .impersonate-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(212, 107, 8, 0.25);
  color: #ffd591;
  font-size: 11px;
}

.impersonate-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 28px;
  background: #fff7e8;
  border-bottom: 1px solid #ffd591;
  color: #8c5a12;
  font-size: 13px;
}

.impersonate-banner strong {
  color: #ad6800;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 28px 14px;
  background: linear-gradient(180deg, #f7f8fb, var(--paper));
  border-bottom: 1px solid var(--line-soft);
}

.topbar h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.04em;
}

.page-desc {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-root {
  padding: 18px 28px 36px;
}

/* —— 通用组件 —— */
.panel {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(26, 35, 50, 0.03);
}

.panel + .panel {
  margin-top: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.panel-body {
  padding: 16px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.toolbar .field {
  min-width: 160px;
  flex: 1;
}

.toolbar .field.grow {
  flex: 2;
  min-width: 220px;
}

.rev-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 8px;
}

.rev-card {
  background: #f7f8fb;
  border: 1px solid var(--line, #e5e8ee);
  border-radius: 10px;
  padding: 14px 16px;
}

.rev-card .k {
  font-size: 12px;
  color: var(--text-2, #7a8494);
  margin-bottom: 6px;
}

.rev-card .v {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink, #1a2332);
  font-variant-numeric: tabular-nums;
}

.rev-card .v.small {
  font-size: 14px;
  font-weight: 600;
}

.rev-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  border-bottom: 1px solid var(--line, #e5e8ee);
}

.rev-tab {
  border: 0;
  background: transparent;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-2, #7a8494);
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.rev-tab.active {
  color: var(--cinnabar, #b83b2e);
  border-bottom-color: var(--cinnabar, #b83b2e);
  font-weight: 600;
}

@media (max-width: 900px) {
  .rev-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

.field.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.grid-form .full {
  grid-column: 1 / -1;
}

/* 上游通道表单 */
.upstream-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.up-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.up-section-type {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
}

.up-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.up-section-title-sub {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

.up-panel {
  padding: 14px 16px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.up-panel[hidden] {
  display: none !important;
}

.up-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.up-grid .full {
  grid-column: 1 / -1;
}

.up-grid-keys {
  margin-top: 2px;
}

.up-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-3);
}

.up-type-select {
  font-size: 14px;
}

.up-check-field > span:first-child {
  margin-bottom: 2px;
}

.up-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
}

.up-check input {
  margin: 0;
  width: 15px;
  height: 15px;
  accent-color: var(--cinnabar);
}

.upstream-form textarea {
  min-height: 88px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.btn {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  background: #fff;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--cinnabar);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--cinnabar-dark);
}

.btn-secondary {
  background: var(--ink-2);
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--ink);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
  color: #d9e0ea;
}

.app-main .btn-ghost,
.modal .btn-ghost,
.drawer .btn-ghost {
  border-color: var(--line);
  color: var(--text-2);
  background: #fff;
}

.app-main .btn-ghost:hover:not(:disabled),
.modal .btn-ghost:hover:not(:disabled),
.drawer .btn-ghost:hover:not(:disabled) {
  background: var(--paper);
  color: var(--text);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #efc6c1;
}

.btn-danger:hover:not(:disabled) {
  background: #f3d7d3;
}

.btn-ok {
  background: var(--pine-soft);
  color: var(--pine);
  border-color: #c5dfd3;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
  padding: 11px 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-2);
}

.icon-btn:hover {
  background: var(--paper);
  color: var(--text);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}

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

table.data th,
table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

table.data th {
  background: #f6f8fb;
  color: var(--text-2);
  font-weight: 600;
  white-space: nowrap;
}

table.data th.th-sortable {
  padding: 0;
}

.th-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  color: inherit;
  text-align: left;
}

.th-sort-btn:hover {
  background: #eef2f7;
}

.th-sort-btn.active {
  color: var(--cinnabar);
}

.th-sort-btn .sort-icon {
  font-size: 11px;
  line-height: 1;
  opacity: 0.55;
}

.th-sort-btn.active .sort-icon {
  opacity: 1;
}

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

table.data tbody tr:hover td {
  background: #f8fafc;
}

table.data tr.clickable {
  cursor: pointer;
}

table.data tr.clickable:hover td {
  background: #f1f5f9;
}

.muted { color: var(--muted); font-size: 12px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; word-break: break-all; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
}

.tag-ok { background: var(--ok-soft); color: var(--ok); border-color: #c5dfd3; }
.tag-warn { background: var(--warn-soft); color: var(--warn); border-color: #ead7a4; }

.callout {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--line, #e5e8ee);
  background: #f7f8fa;
}

.callout-warn {
  background: #fff8e8;
  border-color: #ead7a4;
  color: #6b5a28;
}

.callout strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}
.tag-off { background: #eef1f5; color: var(--text-2); border-color: var(--line); }
.tag-danger { background: var(--danger-soft); color: var(--danger); border-color: #efc6c1; }
.tag-info { background: #e8f1fb; color: #2f6fed; border-color: #c9dbf5; }

.btn-xs {
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.4;
  border-radius: 4px;
}

.btn-warn {
  background: #fff7e8;
  color: #d46b08;
  border-color: #ffd591;
}

.btn-warn:hover:not(:disabled) {
  background: #ffefd6;
}

.btn-danger-text {
  background: #fff;
  color: var(--danger);
  border-color: var(--line);
}

.btn-danger-text:hover:not(:disabled) {
  background: var(--danger-soft);
}

.ck-manage-wrap {
  max-height: calc(100vh - 320px);
}

table.ck-manage {
  min-width: 1320px;
}

.ck-check-cell {
  width: 36px;
  text-align: center;
  vertical-align: middle;
}

.ck-check-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.ck-filter-toolbar {
  margin-top: 4px;
}

.ck-filter-abnormal-field {
  min-width: auto;
  flex: 0 0 auto;
}

.ck-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 4px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.ck-filter-count {
  align-self: center;
  font-size: 13px;
  white-space: nowrap;
}

.ck-batch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2, #f8f9fb);
}

.ck-batch-meta {
  margin-right: 4px;
  font-size: 13px;
}

.ck-name-main {
  font-weight: 600;
}

.ck-id-hint {
  margin-top: 2px;
  font-size: 11px;
}

.ck-stat-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 220px;
}

.ck-gap-hint {
  margin-top: 4px;
  font-size: 12px;
  color: #c45c26;
}

.receive-info {
  display: grid;
  gap: 4px;
  min-width: 200px;
  max-width: 320px;
  font-size: 12px;
}

.recv-line {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  line-height: 1.4;
}

.recv-k {
  flex: 0 0 52px;
  color: var(--text-2);
}

.recv-amt {
  color: var(--text);
  word-break: break-all;
}

.recv-amt-wrap {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.recv-amt-stats {
  display: grid;
  gap: 2px;
}

.recv-amt-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: baseline;
  line-height: 1.35;
}

.recv-amt-v {
  min-width: 40px;
  font-weight: 600;
  color: #1a5fb4;
}

.recv-amt-sep {
  color: var(--text-2);
}

.amt-rem-ok {
  color: #1a7f37;
}

.amt-rem-zero {
  color: var(--text-2);
  font-weight: 500;
}

.ck-stock-summary {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #f7fafc 0%, #fff 100%);
}

.ck-stock-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

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

.ck-stock-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #eef5ff;
  border: 1px solid #d0e2ff;
  font-size: 13px;
  color: var(--text);
}

.ck-stock-chip b {
  font-size: 15px;
  color: #1a5fb4;
}

.amt-stats-tbl td.amt-rem-ok,
.amt-stats-tbl .amt-rem-ok {
  color: #1a7f37;
}

.ck-ops {
  display: grid;
  gap: 6px;
  min-width: 280px;
}

.ck-ops-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ck-log-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
  max-width: 420px;
}

.ck-limit-cell {
  white-space: nowrap;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}

.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-2);
  flex-wrap: wrap;
}

.pager-nums {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.pager-nums .pager-num {
  min-width: 32px;
  padding-left: 8px;
  padding-right: 8px;
}

.pager-ellipsis {
  padding: 0 4px;
  color: var(--muted);
  user-select: none;
}

.pager-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pager-jump input {
  width: 64px;
  min-width: 64px;
  padding: 4px 8px;
  text-align: center;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.check-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #fafbfc;
}

.check-list label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.tree {
  display: grid;
  gap: 6px;
}

.tree-node {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #fff;
}

.tree-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

.tree-children {
  margin-left: 18px;
  padding: 0 0 8px;
  display: grid;
  gap: 6px;
}

.result-box,
#ck-action-result {
  /* 禁止展示接口原文 JSON；旧缓存脚本若仍写入也不显示 */
  display: none !important;
}

.plain-log {
  margin-top: 12px;
  padding: 12px;
  background: #f6f8fb;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  color: var(--text-2);
}

.qr-box {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 20px;
  background: #f6f8fb;
  border-radius: 8px;
  border: 1px dashed var(--line);
}

.qr-box img {
  width: 220px;
  height: 220px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
}

.split-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

/* —— 弹层 / 抽屉 —— */
.modal-mask,
.drawer-mask {
  position: fixed;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(18, 24, 34, 0.45);
  z-index: 40;
}

.modal-mask:not([hidden]),
.drawer-mask:not([hidden]) {
  display: flex;
  pointer-events: auto;
}

.modal-mask:not([hidden]) {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  width: min(640px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.modal.wide {
  width: min(860px, 100%);
}

.modal-head,
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-head h3,
.drawer-head h3 {
  margin: 0;
  font-size: 16px;
}

.modal-body,
.drawer-body {
  padding: 16px 18px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line-soft);
}

.drawer-mask:not([hidden]) {
  justify-content: flex-end;
}

.drawer {
  width: min(480px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  animation: slideIn .18s ease-out;
}

.drawer-body {
  overflow: auto;
  flex: 1;
}

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

.action-grid .btn {
  text-align: center;
}

.cookie-meta {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: #f6f8fb;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  font-size: 13px;
}

.cookie-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cookie-meta span:first-child {
  color: var(--text-2);
}

@keyframes slideIn {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 24px));
}

.toast {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: fadeIn .18s ease-out;
}

.toast.ok { background: var(--pine); }
.toast.err { background: var(--cinnabar); }

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

@media (max-width: 960px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-aside { display: none; }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    min-height: auto;
  }
  .split-2,
  .grid-form,
  .up-grid {
    grid-template-columns: 1fr;
  }
  .page-root,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }
}
