:root {
  --bg: #f2f7f7;
  --surface: #ffffff;
  --line: #e2eaea;
  --text: #16201f;
  --text-dim: #6b7a78;
  --accent: #1f8a8a;
  --accent-deep: #166b6c;
  --accent-light: #5fb8b0;
  --accent-pale: #e6f3f2;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(22, 107, 108, .06);
  --shadow-md: 0 8px 24px rgba(22, 107, 108, .10);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { max-width: 840px; margin: 0 auto; padding: 0 20px; }

/* ---------------------------------------------------------- 背景装饰 */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .5;
  animation: float 18s var(--ease) infinite alternate;
}
.bg-blob.a {
  width: 460px; height: 460px;
  background: #3fb6ac;
  top: -140px; left: -90px;
}
.bg-blob.b {
  width: 400px; height: 400px;
  background: #2a8fa8;
  bottom: -120px; right: -70px;
  animation-delay: -6s;
}
.bg-blob.c {
  width: 300px; height: 300px;
  background: #1f8a8a;
  top: 40%; left: 55%;
  animation-delay: -11s;
  opacity: .35;
}
@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.12); }
}

/* ---------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(226, 234, 234, .8);
}
.topbar-inner { display: flex; align-items: center; height: 62px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent) 55%, var(--accent-light));
  display: flex; align-items: center; justify-content: center;
  flex: none;
  box-shadow: 0 4px 12px rgba(31, 138, 138, .35);
}
.logo svg { width: 22px; height: 22px; display: block; }
.brand-text { font-size: 16.5px; font-weight: 600; letter-spacing: .3px; }
.brand-sub {
  font-size: 11.5px; color: var(--text-dim); letter-spacing: 1px;
  padding-left: 12px; border-left: 1px solid var(--line);
  white-space: nowrap;
}
.brand-actions { margin-left: auto; display: flex; gap: 8px; }
.nav-link {
  font-size: 13px; color: var(--text-dim); text-decoration: none;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 13px; transition: all .2s var(--ease);
  background: var(--surface);
}
.nav-link:hover { color: var(--accent-deep); border-color: var(--accent-light); transform: translateY(-1px); }
.nav-link.en { padding: 6px 11px; font-weight: 500; }

/* ---------------------------------------------------------- 主视觉 hero */
.hero {
  text-align: center;
  padding: 56px 0 16px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--accent-deep);
  background: var(--accent-pale);
  border: 1px solid #cde7e4;
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 18px;
  animation: rise .6s var(--ease) both;
}
.hero-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(1.4); }
}
.hero h1 {
  font-size: 34px; font-weight: 700; margin: 0 0 12px;
  letter-spacing: .5px; line-height: 1.25;
  animation: rise .7s var(--ease) both .05s;
}
.hero h1 .grad {
  background: linear-gradient(115deg, #0b4f50 0%, #157778 40%, #1f9a94 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero .sub {
  font-size: 15px; color: #556b69;
  margin: 0 0 6px;
  animation: rise .7s var(--ease) both .1s;
}
.hero .en-sub {
  font-size: 12px; color: #7c9d9a; letter-spacing: 2.5px;
  text-transform: uppercase; margin: 0;
  animation: rise .7s var(--ease) both .15s;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------- 查询面板 */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  margin: 30px 0 22px;
  box-shadow: 0 2px 4px rgba(22,107,108,.04), 0 16px 40px rgba(22,107,108,.12);
  animation: rise .8s var(--ease) both .2s;
  position: relative;
  overflow: hidden;
}
.panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #0f5c5d, #1f8a8a 40%, #2fa8a0 80%, #6ec8bf);
  opacity: .95;
}
.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 500;
}
textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  resize: vertical;
  background: #fbfdfd;
  color: var(--text);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  min-height: 88px;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(31, 138, 138, .12);
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 11px 30px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .5px;
  box-shadow: 0 6px 18px rgba(31, 138, 138, .35);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(31, 138, 138, .42); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  transform: translate(-50%, -50%);
  transition: width .5s var(--ease), height .5s var(--ease);
}
.btn-primary:not(:disabled):active::after { width: 300px; height: 300px; }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 15px;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.btn-ghost:hover { background: var(--accent-pale); color: var(--accent-deep); border-color: var(--accent-light); }

.hint { font-size: 13px; color: var(--text-dim); margin-left: auto; }

/* loading 动画 */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -3px;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- 汇总条 */
.summary {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-dim);
}
.summary span { display: flex; align-items: center; gap: 5px; }
.summary b { color: var(--text); font-weight: 600; font-size: 15px; }
.summary b.count { animation: count-in .5s var(--ease) both; }
@keyframes count-in {
  from { opacity: 0; transform: scale(.6); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------------------------------------------------------- 结果卡 */
.results { display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  animation: card-in .55s var(--ease) both;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
@keyframes card-in {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-no {
  font: 600 15.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .3px;
  word-break: break-all;
}
.badge {
  flex: none;
  font-size: 12.5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  animation: badge-pop .5s var(--ease) both .3s;
}
@keyframes badge-pop {
  from { opacity: 0; transform: scale(.5); }
  to { opacity: 1; transform: scale(1); }
}
.badge[data-s="signed"]    { background: #e2f5e9; color: #177a42; }
.badge[data-s="inTransit"] { background: #e3f0f9; color: #1a5aa8; }
.badge[data-s="abnormal"]  { background: #fdeaea; color: #b5261e; }
.badge[data-s="offline"]   { background: #eef1f2; color: #5d6665; }
.badge[data-s="notFound"]  { background: #f7f1e4; color: #8a6212; }
.badge[data-s="failed"]    { background: #fdeaea; color: #b5261e; }

.card-desc { margin: 12px 0 0; font-size: 13.5px; color: var(--text-dim); }

.card-latest { margin: 10px 0 0; font-size: 15.5px; font-weight: 500; }
.card-latest .t { color: var(--text-dim); font-size: 12px; margin-right: 6px; font-weight: 400; }

.card-meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-top: 14px; font-size: 13px; color: var(--text-dim);
}
.card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.card-meta b { color: var(--text); font-weight: 600; }

.card-note {
  margin-top: 14px;
  padding: 10px 14px;
  background: #fff8ec;
  border-left: 3px solid #e8a23a;
  border-radius: 0 10px 10px 0;
  font-size: 13px;
  color: #8a6212;
  animation: rise .4s var(--ease) both;
}

.toggle {
  margin-top: 16px;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-deep);
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform .2s var(--ease);
}
.toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }

/* ---------------------------------------------------------- 轨迹时间线 */
.traces {
  list-style: none;
  margin: 14px 0 0;
  padding: 0 0 0 18px;
  border-left: 2px solid var(--line);
}
.traces li {
  position: relative;
  padding: 0 0 16px 6px;
  font-size: 14px;
  animation: trace-in .4s var(--ease) both;
}
.traces li::before {
  content: '';
  position: absolute;
  left: -25px; top: 7px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #c3cfcd;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  transition: background .2s;
}
.traces li:first-child::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 138, 138, .18);
}
@keyframes trace-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.traces .tt {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  padding: 48px 0;
  animation: rise .6s var(--ease) both;
}
.empty[hidden] { display: none; }

/* ---------------------------------------------------------- 错误 */
.err {
  background: #fdeaea;
  border: 1px solid #f5c2c0;
  color: #b5261e;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  animation: rise .4s var(--ease) both;
}

/* ---------------------------------------------------------- 多渠道结果对比 */
.sources {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1.5px dashed var(--line);
  animation: rise .5s var(--ease) both;
}
.sources-head {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.sources-head::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
.source-list { display: flex; flex-direction: column; gap: 12px; }
.source-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fcfdfd;
  transition: all .25s var(--ease);
}
.source-item:hover { transform: translateX(3px); }
.source-item.is-primary { border-color: #b8dcd9; background: #f3faf9; box-shadow: 0 2px 8px rgba(31,138,138,.08); }
.source-item.is-conflict { border-color: #f0c8b6; background: #fffaf6; }
.source-head {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.source-name { font-weight: 600; font-size: 14.5px; }
.src-flag {
  font-size: 11px; padding: 3px 9px;
  border-radius: 999px; font-weight: 600; white-space: nowrap;
}
.src-flag-primary { background: #e2f2f1; color: var(--accent-deep); }
.src-flag-conflict { background: #fdeaea; color: #b5261e; }
.src-flag-consistent { background: #e2f5e9; color: #177a42; }
.src-status { font-size: 12.5px; color: var(--text-dim); margin-left: auto; }
.source-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-top: 8px; font-size: 12.5px; color: var(--text-dim);
}
.source-meta b { color: var(--text); font-weight: 600; }
.source-item .traces { margin-top: 10px; }
.source-item .traces li { font-size: 13.5px; }
.src-empty { margin: 8px 0 0; font-size: 12.5px; color: var(--text-dim); }

/* ---------------------------------------------------------- 页脚 */
.foot {
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 20px;
}
.foot p { margin: 0; }
.foot-links {
  margin-top: 10px !important;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.foot-links a { color: var(--text-dim); text-decoration: none; transition: color .2s; }
.foot-links a:hover { color: var(--accent-deep); text-decoration: underline; }
.foot-links span { color: #c4c9d0; }
.foot-brand {
  margin-top: 12px !important;
  color: var(--accent-deep);
  letter-spacing: .5px;
  font-weight: 500;
}

/* ---------------------------------------------------------- 响应式 */
@media (max-width: 600px) {
  .brand-sub { display: none; }
  .hero h1 { font-size: 26px; }
  .hint { margin-left: 0; width: 100%; }
  .card-meta { gap: 12px; }
  .panel { padding: 18px; }
}
