/* ==========================================================================
   医药冷链区块链溯源平台 · 设计系统
   ========================================================================== */
:root {
  --bg: #f2f6fa;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e5edf5;
  --line-2: #eef3f9;
  --brand: #0f766e;
  --brand-2: #0ea5e9;
  --brand-soft: #ecfdf5;
  --brand-glow: rgba(15, 118, 110, 0.18);
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --success: #059669;
  --success-soft: #ecfdf5;
  --info: #2563eb;
  --info-soft: #eff6ff;
  --sidebar-w: 238px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.16);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { opacity: 0.85; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
::selection { background: var(--brand-glow); }

/* ---------- 通用元素 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px var(--brand-glow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.danger { background: var(--danger); }
.btn.danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn.success { background: var(--success); }
.btn.info { background: var(--info); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.lg { padding: 13px 22px; font-size: 15px; }

.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.textarea { resize: vertical; min-height: 78px; }
.field { margin-bottom: 15px; }
.field > label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hint { font-size: 12px; color: var(--muted-2); margin-top: 5px; }
.form-error { color: var(--danger); font-size: 12.5px; margin-top: 8px; min-height: 18px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.card-title { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.section-title { font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: 0.04em; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.muted { background: #f1f5f9; color: var(--muted); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: #f1f5f9; color: var(--muted); font-size: 11.5px; font-weight: 600;
}

.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: -0.2px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 700; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

.hash {
  font-family: var(--mono); font-size: 11px; color: var(--brand);
  background: var(--brand-soft); padding: 2px 7px; border-radius: 6px;
  word-break: break-all;
}
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink-2); word-break: break-all; }

/* ---------- 登录 / 注册 ---------- */
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 28px;
  background:
    radial-gradient(900px 500px at 12% 8%, rgba(14, 165, 233, 0.14), transparent 60%),
    radial-gradient(800px 500px at 88% 92%, rgba(15, 118, 110, 0.16), transparent 60%),
    #eef4f9;
}
.auth-shell {
  width: min(1040px, 100%); min-height: 620px; display: grid;
  grid-template-columns: 1.08fr 0.92fr; background: #fff;
  border-radius: 26px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.auth-visual {
  position: relative; padding: 44px 46px; color: #e2f6f2; overflow: hidden;
  background:
    radial-gradient(600px 300px at 90% 0%, rgba(14, 165, 233, 0.35), transparent 60%),
    linear-gradient(155deg, #07212b 0%, #0b3a44 48%, #0f5c58 100%);
}
.auth-visual::after {
  content: ""; position: absolute; inset: 0; opacity: 0.26; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 30% 20%, #000 20%, transparent 75%);
}
.brand { display: flex; align-items: center; gap: 11px; position: relative; z-index: 1; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2dd4bf, #0ea5e9); color: #06232a;
  box-shadow: 0 10px 24px rgba(13, 148, 136, 0.35);
}
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: 0.01em; color: #fff; }
.brand-sub { font-size: 11px; color: rgba(226, 246, 242, 0.7); letter-spacing: 0.12em; }
.auth-hero { position: relative; z-index: 1; margin-top: 52px; }
.auth-hero h1 { font-size: 31px; line-height: 1.32; color: #fff; letter-spacing: -0.02em; }
.auth-hero h1 em { font-style: normal; color: #5eead4; }
.auth-hero p { margin-top: 14px; font-size: 13.5px; color: rgba(226, 246, 242, 0.78); line-height: 1.8; max-width: 380px; }
.auth-features { position: relative; z-index: 1; margin-top: 34px; display: grid; gap: 14px; }
.auth-feature { display: flex; gap: 12px; align-items: flex-start; }
.auth-feature .ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.12); color: #5eead4;
}
.auth-feature b { display: block; font-size: 13px; color: #ecfeff; font-weight: 700; }
.auth-feature span { font-size: 12px; color: rgba(226, 246, 242, 0.66); }
.auth-chain { position: absolute; right: 30px; bottom: 30px; z-index: 1; display: flex; align-items: center; gap: 8px; opacity: 0.75; }
.auth-chain .node {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid rgba(94, 234, 212, 0.5);
  display: grid; place-items: center; color: #5eead4; background: rgba(4, 47, 46, 0.5);
  animation: pulseNode 3.2s ease-in-out infinite;
}
.auth-chain .node:nth-child(3) { animation-delay: 0.5s; }
.auth-chain .node:nth-child(5) { animation-delay: 1s; }
.auth-chain .line { width: 22px; height: 1px; background: linear-gradient(90deg, rgba(94, 234, 212, 0.15), rgba(94, 234, 212, 0.7)); }
@keyframes pulseNode { 0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); } 50% { box-shadow: 0 0 18px 2px rgba(45, 212, 191, 0.35); } }

.auth-form { padding: 52px 46px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h2 { font-size: 23px; }
.auth-form .lead { color: var(--muted); font-size: 13px; margin-top: 6px; }
.role-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 26px 0 20px; padding: 5px; background: #f1f5f9; border-radius: 12px; }
.role-tab {
  border: none; background: transparent; padding: 9px 6px; border-radius: 9px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; transition: 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.role-tab.active { background: #fff; color: var(--brand); box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08); }
.auth-form .btn { margin-top: 6px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 12.5px; color: var(--muted); }
.demo-box { margin-top: 22px; padding: 13px 15px; border: 1px dashed var(--line); border-radius: 12px; background: #fbfdff; }
.demo-box .title { font-size: 11.5px; color: var(--muted-2); font-weight: 700; letter-spacing: 0.05em; margin-bottom: 8px; }
.demo-accounts { display: grid; gap: 6px; }
.demo-account {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--muted); cursor: pointer; padding: 5px 7px; border-radius: 7px;
}
.demo-account:hover { background: var(--brand-soft); color: var(--brand); }
.demo-account code { font-family: var(--mono); font-size: 11px; color: var(--ink-2); background: #f1f5f9; padding: 1px 6px; border-radius: 5px; }

/* ---------- 应用布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; position: fixed; inset: 0 auto 0 0; z-index: 40;
  display: flex; flex-direction: column; color: #cbd5e1;
  background:
    radial-gradient(420px 240px at 20% 0%, rgba(14, 165, 233, 0.22), transparent 65%),
    linear-gradient(180deg, #081724 0%, #0a2130 55%, #081a26 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.1);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px; padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}
.sidebar-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
.sidebar-brand .name { font-size: 14px; font-weight: 800; color: #fff; line-height: 1.3; }
.sidebar-brand .sub { font-size: 10px; letter-spacing: 0.13em; color: #64748b; }
.sidebar-role {
  margin: 16px 16px 6px; padding: 6px 10px; border-radius: 8px; font-size: 11px;
  color: #5eead4; background: rgba(45, 212, 191, 0.08); border: 1px solid rgba(45, 212, 191, 0.14);
  letter-spacing: 0.05em; text-align: center;
}
.nav { padding: 8px 12px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 10.5px; letter-spacing: 0.12em; color: #475569; padding: 14px 10px 6px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin-bottom: 3px;
  border-radius: 10px; color: #94a3b8; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: 0.18s; border: 1px solid transparent; background: transparent;
  width: 100%; text-align: left;
}
.nav-item svg { flex: none; opacity: 0.85; }
.nav-item:hover { background: rgba(148, 163, 184, 0.08); color: #e2e8f0; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.2), rgba(14, 165, 233, 0.08));
  border-color: rgba(45, 212, 191, 0.16); color: #fff;
  box-shadow: inset 3px 0 0 #2dd4bf;
}
.nav-item .count {
  margin-left: auto; font-size: 10.5px; background: rgba(220, 38, 38, 0.9); color: #fff;
  border-radius: 999px; padding: 1px 6px; font-weight: 700;
}
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(148, 163, 184, 0.1); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 6px 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.25), rgba(14, 165, 233, 0.25));
  color: #5eead4; font-weight: 800; font-size: 13px; border: 1px solid rgba(45, 212, 191, 0.2);
}
.sidebar-user .u-name { font-size: 12.5px; color: #e2e8f0; font-weight: 600; line-height: 1.3; }
.sidebar-user .u-org { font-size: 10.5px; color: #64748b; }
.sidebar-link {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  color: #64748b; font-size: 12px; cursor: pointer; background: none; border: none; width: 100%;
  text-align: left;
}
.sidebar-link:hover { background: rgba(148, 163, 184, 0.08); color: #cbd5e1; }

.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; padding: 0 26px; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.topbar-title { display: flex; flex-direction: column; }
.topbar-title b { font-size: 15px; }
.topbar-title span { font-size: 11.5px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.chain-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 600;
  border: 1px solid rgba(15, 118, 110, 0.15);
}
.chain-chip .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5); animation: pulse 2s infinite;
}
.chain-chip.bad { background: var(--danger-soft); color: var(--danger); border-color: rgba(220, 38, 38, 0.16); }
.chain-chip.bad .pulse { background: var(--danger); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.45); } 70% { box-shadow: 0 0 0 8px rgba(5, 150, 105, 0); } 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); } }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }

.content { padding: 24px 26px 40px; flex: 1; }
.page-head { margin-bottom: 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.view { display: none; animation: fadeUp 0.3s ease; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 数据卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px;
  border-radius: 50%; background: var(--brand-soft); opacity: 0.7;
}
.stat .label { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat .value { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; position: relative; z-index: 1; }
.stat .value small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.stat .foot { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; }
.stat .icon-bubble {
  position: absolute; right: 16px; bottom: 14px; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); z-index: 1;
}
.stat.teal { border-top: 3px solid #14b8a6; }
.stat.blue { border-top: 3px solid #0ea5e9; }
.stat.amber { border-top: 3px solid #f59e0b; }
.stat.red { border-top: 3px solid #ef4444; }
.stat.teal .icon-bubble { background: #ccfbf1; color: #0f766e; }
.stat.blue .icon-bubble { background: #e0f2fe; color: #0284c7; }
.stat.amber .icon-bubble { background: #fef3c7; color: #b45309; }
.stat.red .icon-bubble { background: #fee2e2; color: #b91c1c; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 18px; }
.chart { width: 100%; height: 280px; }
.chart.sm { height: 220px; }
.chart.lg { height: 340px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 700;
  letter-spacing: 0.03em; padding: 11px 14px; background: #f8fafc; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: #f8fbff; }
.table tbody tr:last-child td { border-bottom: none; }
.table .clickable { cursor: pointer; }
.table .primary { font-weight: 700; color: var(--ink); }
.table .sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.link { color: var(--brand); font-weight: 600; cursor: pointer; background: none; border: none; padding: 0; font-size: 12.5px; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--danger); }

.empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty svg { opacity: 0.35; margin-bottom: 10px; }
.empty b { display: block; color: var(--ink-2); font-size: 13.5px; margin-bottom: 3px; }

/* ---------- 筛选栏 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { position: relative; flex: 1; min-width: 220px; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.toolbar .search .input { padding-left: 36px; }
.seg { display: inline-flex; padding: 4px; background: #f1f5f9; border-radius: 10px; gap: 3px; }
.seg button {
  border: none; background: transparent; padding: 7px 14px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.seg button.active { background: #fff; color: var(--brand); box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08); }

/* ---------- 弹窗 / 提示 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  padding: 24px; background: rgba(7, 17, 30, 0.55); backdrop-filter: blur(4px);
}
.modal.show { display: flex; }
.modal-card {
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); width: min(760px, 100%);
  max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  animation: modalIn 0.22s ease;
}
.modal-card.wide { width: min(980px, 100%); }
.modal-card.narrow { width: min(460px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: scale(0.97) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h3 { font-size: 16.5px; }
.modal-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 16px;
}
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; min-width: 250px; max-width: 380px;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: 12px; padding: 12px 14px; box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  font-size: 13px; animation: toastIn 0.25s ease; color: var(--ink-2);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast b { display: block; font-size: 12.5px; color: var(--ink); margin-bottom: 1px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- Tab 页签 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab {
  padding: 10px 16px; border: none; background: none; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.2s ease; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 18px 8px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -24px; top: 4px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand); box-shadow: 0 0 0 3px #fff;
}
.tl-item.warn .tl-dot { border-color: var(--warn); }
.tl-item.danger .tl-dot { border-color: var(--danger); }
.tl-item.success .tl-dot { border-color: var(--success); }
.tl-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-time { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.tl-detail { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tl-hash { margin-top: 5px; }

/* ---------- 链上展示 ---------- */
.chain-block {
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; margin-bottom: 10px;
  background: linear-gradient(180deg, #fff, #fbfdff); transition: 0.18s; cursor: pointer;
}
.chain-block:hover { border-color: rgba(15, 118, 110, 0.35); box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05); }
.chain-block .b-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chain-block .b-index {
  width: 34px; height: 34px; border-radius: 9px; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 800; font-size: 12px; font-family: var(--mono);
}
.chain-block .b-title { font-size: 12.5px; font-weight: 700; }
.chain-block .b-hash { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 7px; word-break: break-all; }
.chain-proof {
  border: 1px solid rgba(15, 118, 110, 0.2); background: linear-gradient(135deg, #f0fdfa, #f0f9ff);
  border-radius: 14px; padding: 16px 18px;
}
.chain-proof .ok-line { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--brand); font-size: 13.5px; }

/* ---------- 温度热力 / 指标 ---------- */
.metric-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric {
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; background: #fbfdff;
}
.metric .k { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.metric .v { font-size: 20px; font-weight: 800; margin-top: 3px; letter-spacing: -0.02em; }
.metric .v small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.metric.good .v { color: var(--success); }
.metric.bad .v { color: var(--danger); }

.alert-banner {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 12px;
  background: var(--danger-soft); border: 1px solid rgba(220, 38, 38, 0.18); color: #991b1b;
  font-size: 12.5px; line-height: 1.6;
}
.alert-banner.warn { background: var(--warn-soft); border-color: rgba(217, 119, 6, 0.2); color: #92400e; }
.alert-banner.info { background: var(--info-soft); border-color: rgba(37, 99, 235, 0.16); color: #1e40af; }
.alert-banner b { display: block; margin-bottom: 2px; }

/* ---------- 空状态骨架 ---------- */
.loading { padding: 40px; display: grid; place-items: center; color: var(--muted); font-size: 12.5px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line);
  border-top-color: var(--brand); animation: spin 0.8s linear infinite; margin-bottom: 9px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 公共溯源页 ---------- */
.trace-body { background: #f2f6fa; }
.trace-nav {
  height: 68px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.trace-nav .brand-name { color: var(--ink); }
.trace-nav .brand-sub { color: var(--muted-2); }
.trace-hero {
  padding: 66px 5vw 108px; text-align: center; color: #fff; position: relative; overflow: hidden;
  background:
    radial-gradient(700px 340px at 50% -10%, rgba(45, 212, 191, 0.3), transparent 65%),
    linear-gradient(160deg, #071c27 0%, #0a3541 55%, #0b4f4b 100%);
}
.trace-hero::after {
  content: ""; position: absolute; inset: 0; opacity: 0.2;
  background-image: linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 0%, #000 10%, transparent 72%);
}
.trace-hero .inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.trace-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px;
  background: rgba(45, 212, 191, 0.12); border: 1px solid rgba(45, 212, 191, 0.25);
  color: #5eead4; font-size: 11.5px; letter-spacing: 0.06em; font-weight: 700;
}
.trace-hero h1 { font-size: clamp(28px, 4vw, 42px); margin-top: 18px; letter-spacing: -0.03em; line-height: 1.24; }
.trace-hero h1 em { font-style: normal; color: #5eead4; }
.trace-hero p { margin-top: 12px; color: rgba(226, 246, 242, 0.72); font-size: 14px; }
.trace-search {
  margin: 30px auto 0; max-width: 620px; display: flex; gap: 8px; padding: 7px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px; backdrop-filter: blur(8px);
}
.trace-search .input {
  background: #fff; border: none; height: 46px; font-size: 14px;
}
.trace-search .btn { height: 46px; padding: 0 24px; background: linear-gradient(135deg, #14b8a6, #0ea5e9); }
.trace-hints { margin-top: 12px; font-size: 11.5px; color: rgba(226, 246, 242, 0.55); }
.trace-hints button { background: none; border: none; color: #5eead4; cursor: pointer; font-size: 11.5px; text-decoration: underline; padding: 0 3px; }
.trace-wrap { max-width: 1140px; margin: -64px auto 0; padding: 0 5vw 60px; position: relative; z-index: 5; }
.trace-panel {
  background: #fff; border-radius: 20px; box-shadow: 0 24px 60px rgba(7, 23, 42, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.6); padding: 26px;
}
.verify-seal {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 15px; border-radius: 999px;
  background: var(--success-soft); color: var(--success); border: 1px solid rgba(5, 150, 105, 0.2);
  font-weight: 700; font-size: 12.5px;
}
.verify-seal.bad { background: var(--danger-soft); color: var(--danger); border-color: rgba(220, 38, 38, 0.2); }
.verify-seal.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(217, 119, 6, 0.2); }
.trace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) 320px; gap: 18px; margin-top: 18px; }
.trace-side .card { padding: 18px; box-shadow: none; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.feature-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.feature-card svg { color: var(--brand); }
.feature-card b { display: block; margin-top: 9px; font-size: 13.5px; }
.feature-card p { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.65; }
.trace-foot { text-align: center; color: var(--muted-2); font-size: 11.5px; padding: 22px 0 34px; }
.record-scroll { max-height: 340px; overflow-y: auto; }

/* ---------- 扫码签收页 ---------- */
.sign-body {
  min-height: 100vh; padding: 22px 14px 40px;
  background: radial-gradient(600px 300px at 50% 0%, rgba(14, 165, 233, 0.14), transparent 65%), #eef4f9;
}
.sign-shell { max-width: 460px; margin: 0 auto; }
.sign-head { text-align: center; padding: 16px 0 20px; }
.sign-head .logo {
  width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #14b8a6, #0ea5e9); color: #04232b;
  box-shadow: 0 14px 30px rgba(13, 148, 136, 0.3);
}
.sign-head h1 { font-size: 20px; }
.sign-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.sign-card { background: #fff; border-radius: 18px; padding: 20px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.sign-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.sign-stat { background: #f8fafc; border-radius: 10px; padding: 9px; text-align: center; border: 1px solid var(--line-2); }
.sign-stat .k { font-size: 10.5px; color: var(--muted); }
.sign-stat .v { font-size: 14px; font-weight: 800; margin-top: 2px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-main, .grid-3, .trace-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-form { padding: 40px 30px; }
  .menu-toggle { display: grid !important; }
  .grid-2 { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .trace-grid { grid-template-columns: 1fr; }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 18px 16px 32px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .trace-search { flex-direction: column; background: transparent; border: none; padding: 0; }
  .trace-search .input { height: 46px; }
  .trace-search .btn { width: 100%; }
  .modal { padding: 10px; }
  .modal-body { padding: 16px; }
  .trace-panel { padding: 18px; }
  .sign-stats { grid-template-columns: 1fr 1fr; }
}
.menu-toggle { display: none; }
@media print {
  .sidebar, .topbar, .btn, .trace-nav, .trace-hero { display: none !important; }
  .main { margin-left: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
