:root {
  --font-sans: "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --bg-page: #f7f8fa;
  --bg-card: #ffffff;
  --bg-inner: #f9fafb;
  --border-card: #e5e7eb;
  --border-divider: #e5e7eb;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --blue-banner: #007acc;
  --blue-primary: #2563eb;
  --blue-soft: #eff6ff;
  --blue-border: #bfdbfe;
  --amber-text: #b45309;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --green-text: #15803d;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;
  --red-text: #dc2626;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }

.mirror-banner {
  width: 100%;
  background: var(--blue-banner);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.45;
}
.mirror-banner__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mirror-banner__text { min-width: 0; }
.mirror-banner__line1 {
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.mirror-banner__line2 { color: #dbeafe; font-size: 11px; margin-top: 2px; }
.mirror-banner__sep { opacity: 0.65; margin: 0 2px; }
.mirror-banner__link { color: #ffffff; text-decoration: underline; }
.version-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  vertical-align: middle;
}

.mirror-app {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 16px 48px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 24px 30px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.card + .card { margin-top: 16px; }

.card-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title-xl { margin: 0 0 6px; font-size: 20px; font-weight: 700; color: var(--text-primary); }
.card-title-base { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--text-primary); }
.card-subtitle { margin: 0; font-size: 13px; color: var(--text-muted); }

.btn-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  gap: 6px;
  height: 36px;
  padding: 0 22px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.ui-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ui-btn--primary { background: var(--blue-primary); color: #ffffff; }
.ui-btn--neutral { background: #f3f4f6; color: #374151; border-color: #e5e7eb; }
.ui-btn--danger-outline { background: #ffffff; color: #dc2626; border: 1px solid #fecaca; }
.ui-btn--sm { height: 28px; padding: 0 12px; font-size: 12px; border-radius: 8px; }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.pill--green { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.pill--amber { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.pill--red { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.pill--blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.pill--gray { background: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; }

.mono { font-family: var(--font-mono); }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.step-item {
  background: #f9fafb;
  border: 1px solid #eef0f3;
  border-radius: 10px;
  padding: 12px;
}
.step-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.step-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.kpi-item {
  background: #f9fafb;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 10px 12px;
}
.kpi-label { font-size: 11.5px; color: var(--text-muted); }
.kpi-value { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-top: 2px; }

.inner-group {
  background: #f9fafb;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  padding: 12px 16px;
}
.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid #eef0f3;
}
.kv-row:last-child { border-bottom: none; }
.kv-label { color: var(--text-muted); min-width: 112px; flex-shrink: 0; }
.kv-value { color: var(--text-primary); font-weight: 500; text-align: right; word-break: break-all; }

.notice-box {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.55;
}
.notice-box--amber { background: var(--amber-bg); color: var(--amber-text); border: 1px solid var(--amber-border); }
.notice-box--red { background: var(--red-bg); color: var(--red-text); border: 1px solid var(--red-border); }
.notice-box--green { background: var(--green-bg); color: var(--green-text); border: 1px solid var(--green-border); }

.proto-log-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.proto-log-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  font-size: 12px;
  line-height: 1.5;
  padding: 5px 8px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  width: 100%;
  overflow: hidden;
}
.proto-dir {
  display: inline-block;
  text-align: center;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.proto-dir--tx { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.proto-dir--rx { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.proto-dir--info { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.proto-dir--warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.proto-dir--err { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.proto-label { color: #334155; font-weight: 600; white-space: nowrap; }
.proto-hex {
  flex: 1 1 220px;
  color: #475569;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}
.proto-meta {
  width: 100%;
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
}

.hidden { display: none !important; }

@media (max-width: 640px) {
  .card { padding: 18px 18px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-grid { grid-template-columns: 1fr; }
}

.ui-input {
  height: 36px;
  width: 132px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}
.ui-input:focus {
  border-color: var(--blue-primary);
}
