/* ============================================================
   认证群回调控制台 · 企业级设计令牌与样式
   风格基线：Ant Design 5 / 华为云控制台。克制、专业、轻量。
   ============================================================ */

:root {
  --primary: #1677ff;
  --primary-hover: #4096ff;
  --primary-active: #0958d9;
  --success: #52c41a;
  --warning: #faad14;
  --error: #ff4d4f;

  --text-1: rgba(0, 0, 0, 0.88);
  --text-2: rgba(0, 0, 0, 0.65);
  --text-3: rgba(0, 0, 0, 0.45);
  --text-4: rgba(0, 0, 0, 0.25);

  --border: #d9d9d9;
  --split: #f0f0f0;
  --fill: #f5f5f5;
  --bg: #f0f2f5;
  --white: #fff;
  --header-bg: #fafafa;

  --r2: 2px;
  --r4: 4px;
  --r6: 6px;
  --r8: 8px;

  --shadow-card: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02);
  --shadow-pop: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12);

  --sidebar-w: 216px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: #d9d9d9;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #bfbfbf;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------------------------- 布局 ---------------------------- */

.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--split);
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--r6);
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  letter-spacing: 0.5px;
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.2px;
}

.nav {
  flex: 1;
  padding: 8px 12px;
  overflow: auto;
}

.nav-group {
  font-size: 12px;
  color: var(--text-3);
  padding: 12px 12px 6px;
  letter-spacing: 0.4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r6);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: #f5f7fa;
  color: var(--text-1);
}

.nav-item.active {
  background: #e6f4ff;
  color: var(--primary);
  font-weight: 500;
}

.nav-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  color: currentColor;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.sidebar-foot {
  padding: 16px;
  border-top: 1px solid var(--split);
}

.service-state {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}

.sidebar-note {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
  line-height: 1.5;
  word-break: break-all;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 6px;
}
.dot-ok {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(82, 196, 26, 0.12);
}
.dot-err {
  background: var(--error);
  box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.12);
}

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--split);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.crumb {
  font-size: 14px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 8px;
}
.crumb-root {
  color: var(--text-3);
}
.crumb-sep {
  color: var(--text-4);
}
#crumb-current {
  color: var(--text-1);
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chip {
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r4);
  background: var(--fill);
  color: var(--text-2);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.content {
  padding: 24px;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  flex: 1;
}

/* ---------------------------- 页头 ---------------------------- */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-1);
}

.page-desc {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 4px;
  line-height: 1.5;
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding-top: 4px;
}

/* ---------------------------- 卡片 ---------------------------- */

.card {
  background: var(--white);
  border: 1px solid var(--split);
  border-radius: var(--r8);
  padding: 24px;
}

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

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  min-height: 24px;
}

.card-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-sub {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 400;
}

.card-body-tight {
  margin: -8px -24px -24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.grid-even {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

/* ---------------------------- KPI ---------------------------- */

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

.kpi {
  background: var(--white);
  border: 1px solid var(--split);
  border-radius: var(--r8);
  padding: 20px 24px;
}

.kpi-label {
  font-size: 14px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-value {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  color: var(--text-1);
}

.kpi-value small {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-3);
  margin-left: 4px;
}

.kpi-foot {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------------------------- 图表 ---------------------------- */

.trend {
  display: flex;
  align-items: stretch;
  gap: 10px;
  height: 196px;
  padding-top: 16px;
  border-bottom: 1px solid var(--split);
  background-image: repeating-linear-gradient(to top, #f5f5f5 0, #f5f5f5 1px, transparent 1px, transparent 35px);
}

.trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-width: 0;
  position: relative;
}

.trend-bar-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex: 1;
}

.trend-bar {
  width: 56%;
  max-width: 40px;
  min-height: 2px;
  background: #bae0ff;
  border-radius: var(--r2) var(--r2) 0 0;
  transition: background 0.15s;
  position: relative;
}

.trend-bar.zero {
  background: #e8e8e8;
}

.trend-col.is-today .trend-bar {
  background: var(--primary);
}

.trend-col:hover .trend-bar {
  background: var(--primary);
}

.trend-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.15s;
}

.trend-col:hover .trend-value,
.trend-col.is-today .trend-value {
  opacity: 1;
}

.trend-x {
  font-size: 12px;
  color: var(--text-3);
  padding-bottom: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trend-col.is-today .trend-x {
  color: var(--primary);
}

.dist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dist-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  padding: 7px 0;
}

.dist-name {
  font-size: 13px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dist-track {
  height: 8px;
  background: var(--fill);
  border-radius: var(--r2);
  overflow: hidden;
}

.dist-fill {
  height: 100%;
  border-radius: var(--r2);
  transition: width 0.3s;
}

.dist-count {
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-1);
}

/* ---------------------------- 表格 ---------------------------- */

.table-wrap {
  border: 1px solid var(--split);
  border-radius: var(--r8);
  overflow: auto;
  background: var(--white);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--header-bg);
  color: var(--text-2);
  font-weight: 500;
  font-size: 13px;
  text-align: left;
  height: 44px;
  padding: 0 16px;
  white-space: nowrap;
  border-bottom: 1px solid var(--split);
}

tbody td {
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--split);
  color: var(--text-1);
  white-space: nowrap;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #fafafa;
}

tbody tr.clickable {
  cursor: pointer;
}

.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  letter-spacing: -0.1px;
}

.muted {
  color: var(--text-3);
}

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

.nowrap {
  white-space: nowrap;
}

.cell-strong {
  font-weight: 500;
}

.cell-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.col-op {
  text-align: right;
}

/* ---------------------------- 标签 ---------------------------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r2);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  font-weight: 400;
}

.tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 5px;
}

.tag.no-dot::before {
  display: none;
}

.tag.success {
  background: #f6ffed;
  color: #389e0d;
}
.tag.error {
  background: #fff1f0;
  color: #cf1322;
}
.tag.warning {
  background: #fffbe6;
  color: #d48806;
}
.tag.primary {
  background: #e6f4ff;
  color: #0958d9;
}
.tag.default {
  background: #f5f5f5;
  color: rgba(0, 0, 0, 0.65);
}
.tag.purple {
  background: #f9f0ff;
  color: #531dab;
}
.tag.cyan {
  background: #e6fffb;
  color: #08979c;
}

.badge-scope {
  display: inline-block;
  font-size: 11px;
  color: var(--text-3);
  background: var(--fill);
  border-radius: var(--r2);
  padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------------------------- 按钮 ---------------------------- */

.btn {
  height: 32px;
  padding: 0 16px;
  border-radius: var(--r6);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-1);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.btn:active {
  color: var(--primary-active);
  border-color: var(--primary-active);
}

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

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

.btn.danger {
  color: var(--error);
  border-color: #ffccc7;
}

.btn.danger:hover {
  color: #cf1322;
  border-color: var(--error);
  background: #fff1f0;
}

.btn.small {
  height: 28px;
  padding: 0 12px;
  font-size: 13px;
}

.btn.block {
  width: 100%;
}

.btn:disabled,
.btn[disabled] {
  background: var(--fill);
  border-color: var(--border);
  color: var(--text-4);
  cursor: not-allowed;
}

.btn-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
}

.btn-icon svg {
  width: 14px;
  height: 14px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  color: var(--primary-hover);
}

.link-btn.muted {
  color: var(--text-3);
}
.link-btn.muted:hover {
  color: var(--primary);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--r6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  cursor: pointer;
}

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

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------------------------- 表单 ---------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > label,
.field-label {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.4;
}

.field-hint {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
}

.required::before {
  content: "*";
  color: var(--error);
  margin-right: 4px;
}

.input,
.select,
.textarea {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r4);
  background: var(--white);
  color: var(--text-1);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  min-width: 0;
}

.textarea {
  height: auto;
  padding: 8px 10px;
  line-height: 1.6;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.input::placeholder {
  color: var(--text-4);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

.input[readonly] {
  background: var(--fill);
  color: var(--text-2);
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group .input {
  flex: 1;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.filters .field {
  width: 176px;
}

.filters .field.wide {
  width: 220px;
}

.filters .actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

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

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

.switch {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #bfbfbf;
  position: relative;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
  flex: 0 0 36px;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
}

.switch.on {
  background: var(--primary);
}

.switch.on::after {
  left: 18px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
}

.switch-text {
  font-size: 13px;
  color: var(--text-2);
}

/* ---------------------------- 空态 / 加载 ---------------------------- */

.empty {
  padding: 56px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
}

.empty-title {
  color: var(--text-2);
  margin-bottom: 4px;
}

.loading {
  padding: 80px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
}

.skeleton {
  background: linear-gradient(90deg, #f5f5f5 25%, #fafafa 37%, #f5f5f5 63%);
  background-size: 400% 100%;
  animation: sk 1.4s ease infinite;
  border-radius: var(--r4);
  height: 14px;
}

@keyframes sk {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* ---------------------------- 分页 ---------------------------- */

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0 0;
}

.pager .info {
  font-size: 13px;
  color: var(--text-3);
  margin-right: auto;
  font-variant-numeric: tabular-nums;
}

.pager select {
  width: auto;
  height: 28px;
  padding: 0 6px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--r4);
  background: #fff;
  outline: none;
}

.pager .page-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--r4);
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-2);
}

.pager .page-btn:hover:not(:disabled) {
  color: var(--primary);
  border-color: var(--primary);
}

.pager .page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pager .page-btn:disabled {
  color: var(--text-4);
  cursor: not-allowed;
}

/* ---------------------------- 抽屉 ---------------------------- */

.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.drawer-mask.show {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 620px;
  max-width: 94vw;
  background: var(--white);
  z-index: 101;
  transform: translateX(102%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-pop);
}

.drawer.show {
  transform: translateX(0);
}

.drawer-head {
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--split);
}

.drawer-title {
  font-size: 16px;
  font-weight: 500;
}

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

.section + .section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--split);
}

.section-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kv {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 12px 16px;
  font-size: 14px;
}

.kv dt {
  color: var(--text-3);
  font-size: 13px;
}

.kv dd {
  color: var(--text-1);
  word-break: break-all;
  line-height: 1.5;
}

.code {
  background: var(--header-bg);
  border: 1px solid var(--split);
  border-radius: var(--r6);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-1);
  max-height: 420px;
  overflow: auto;
}

.timeline {
  display: flex;
  flex-direction: column;
}

.tl-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 16px;
  position: relative;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: var(--split);
}

.tl-item:last-child::before {
  display: none;
}

.tl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 7px;
  margin-left: 1px;
  z-index: 1;
  box-shadow: 0 0 0 3px #fff;
}

.tl-main {
  min-width: 0;
}

.tl-title {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tl-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ---------------------------- 提示 ---------------------------- */

.toast-wrap {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #fff;
  border: 1px solid var(--split);
  border-radius: var(--r6);
  box-shadow: var(--shadow-pop);
  padding: 10px 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  animation: toast-in 0.18s ease;
}

.toast .t-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 14px;
}

.toast.ok .t-icon {
  background: var(--success);
}
.toast.err .t-icon {
  background: var(--error);
}
.toast.info .t-icon {
  background: var(--primary);
}

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

/* ---------------------------- 提示条 ---------------------------- */

.alert {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r6);
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid;
}

.alert-info {
  background: #e6f4ff;
  border-color: #bae0ff;
  color: #0958d9;
}

.alert-warning {
  background: #fffbe6;
  border-color: #ffe58f;
  color: #d48806;
}

.alert-error {
  background: #fff1f0;
  border-color: #ffccc7;
  color: #cf1322;
}

.alert strong {
  font-weight: 500;
}

/* ---------------------------- 文档 ---------------------------- */

.prose {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-1);
}

.prose h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--split);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 24px 0 8px;
}

.prose p {
  margin: 8px 0;
  color: var(--text-2);
}

.prose ul,
.prose ol {
  margin: 8px 0 8px 20px;
  color: var(--text-2);
}

.prose li {
  margin: 4px 0;
}

.prose code {
  background: var(--fill);
  border-radius: var(--r2);
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: #1f1f1f;
}

.prose pre {
  background: #fafafa;
  border: 1px solid var(--split);
  border-radius: var(--r6);
  padding: 14px 16px;
  overflow: auto;
  margin: 12px 0;
}

.prose pre code {
  background: none;
  padding: 0;
  color: var(--text-1);
  font-size: 12.5px;
  line-height: 1.8;
}

.prose table {
  margin: 12px 0;
  border: 1px solid var(--split);
  border-radius: var(--r6);
  overflow: hidden;
  font-size: 13px;
}

.prose thead th {
  height: 40px;
  font-size: 13px;
}

.prose tbody td {
  height: 40px;
  white-space: normal;
  vertical-align: top;
  padding: 8px 16px;
}

.prose .tip {
  background: #fafafa;
  border-left: 3px solid var(--primary);
  padding: 10px 14px;
  margin: 12px 0;
  color: var(--text-2);
  font-size: 13px;
}

/* ---------------------------- 其他 ---------------------------- */

.stack-8 > * + * {
  margin-top: 8px;
}

.stack-16 > * + * {
  margin-top: 16px;
}

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

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

.spacer {
  flex: 1;
}

.mini-note {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 6px;
  line-height: 1.6;
}

.divider {
  height: 1px;
  background: var(--split);
  margin: 16px 0;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  max-height: 220px;
  overflow: auto;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 10px;
  background: var(--header-bg);
  border-radius: var(--r4);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2,
  .grid-even {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 64px;
  }
  .brand-text,
  .nav-group,
  .sidebar-foot {
    display: none;
  }
  .brand {
    justify-content: center;
    padding: 16px 0;
  }
  .nav-item span:not(.nav-icon) {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 0;
  }
  .main {
    margin-left: 64px;
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .filters .field {
    width: 100%;
  }
}

/* ---------------------------- 凭证与公钥 ---------------------------- */

.token-card .card-head {
  margin-bottom: 16px;
}

.token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--header-bg);
  border: 1px solid var(--split);
  border-radius: var(--r6);
}

.token-value {
  font-size: 15px;
  letter-spacing: 0.2px;
  color: var(--text-1);
  word-break: break-all;
  line-height: 1.4;
}

.token-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.meter {
  height: 4px;
  border-radius: 2px;
  background: #f0f0f0;
  overflow: hidden;
  margin: 16px 0 8px;
}

.meter-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.4s linear;
}

.meter-fill.is-warn {
  background: var(--warning);
}

.meter-fill.is-error {
  background: var(--error);
}

.meter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 16px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 24px;
  padding-top: 16px;
  border-top: 1px dashed var(--split);
}

.meta-item.span-2 {
  grid-column: span 2;
}

.meta-label {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 4px;
}

.meta-value {
  font-size: 13px;
  color: var(--text-1);
  word-break: break-all;
  line-height: 1.45;
}

.seg {
  display: inline-flex;
  padding: 2px;
  background: var(--fill);
  border-radius: var(--r6);
  gap: 2px;
}

.seg-btn {
  border: 0;
  background: transparent;
  border-radius: var(--r4);
  padding: 5px 12px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  transition: background 0.15s, color 0.15s;
}

.seg-btn:hover {
  color: var(--text-1);
}

.seg-btn.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font-weight: 500;
}

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

.alg-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r6);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.alg-card:hover {
  border-color: var(--primary-hover);
}

.alg-card.active {
  border-color: var(--primary);
  background: #f0f7ff;
}

.alg-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}

.alg-desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.45;
}

.lifecycle {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lc-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.lc-step .tag {
  flex-shrink: 0;
}

.lc-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  padding-top: 1px;
}

.lc-arrow {
  width: 1px;
  height: 12px;
  margin-left: 22px;
  background: var(--border);
}

.rate-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: var(--header-bg);
  border: 1px solid var(--split);
  border-radius: var(--r6);
  font-size: 13px;
  color: var(--text-2);
}

.rate-strip b {
  color: var(--text-1);
  font-weight: 500;
}

.op-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.link-btn.danger {
  color: var(--error);
}

.link-btn.danger:hover {
  color: #ff7875;
}

.countdown {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.countdown.is-warn {
  color: #d48806;
}

.countdown.is-danger {
  color: var(--error);
}

@media (max-width: 1280px) {
  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .meta-item.span-2 {
    grid-column: span 2;
  }
}

.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cell-stack .cell-sub {
  margin-top: 0;
}

/* ---------------------------- 回调校验日志 ---------------------------- */

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--split);
  border-radius: var(--r6);
  overflow: hidden;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--split);
  background: var(--white);
}

.check-item:last-child {
  border-bottom: 0;
}

.check-item.is-fail {
  background: #fff2f0;
}

.check-mark {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 600;
}

.check-item.is-pass .check-mark {
  background: #e8f8ef;
  color: #0f9d58;
}

.check-item.is-fail .check-mark {
  background: var(--error);
  color: #fff;
}

.check-body {
  min-width: 0;
  flex: 1;
}

.check-label {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.45;
}

.check-item.is-fail .check-label {
  color: #a8071a;
  font-weight: 500;
}

.check-detail {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
  margin-top: 1px;
  word-break: break-all;
}

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

.sig-item {
  padding: 10px 12px;
  background: var(--header-bg);
  border: 1px solid var(--split);
  border-radius: var(--r6);
  min-width: 0;
}

.sig-value {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-1);
  word-break: break-all;
}

@media (max-width: 1280px) {
  .sig-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
