/* 物流服务商与资源情报看板 - 样式
 * 定位：内嵌组件（无外层 header/footer），宽屏优先，无外层滚动条，自适应 100dvh。
 * 视觉语言：克制的单色强调、系统字体、物理缓动与模糊淡入，参考 Apple 官网的细腻质感。
 */

:root {
  --brand: #c7000b;
  --brand-strong: #9d0009;
  --brand-soft: #fff5f6;
  --ink: #1a1d21;
  --ink-2: #4c5560;
  --muted: #8a929c;
  --line: rgba(17, 24, 39, .08);
  --line-soft: rgba(17, 24, 39, .05);
  --bg: #f4f5f7;
  --card: #ffffff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 1px rgba(16, 24, 40, .03);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -14px rgba(16, 24, 40, .2);
  --shadow-lg: 0 30px 80px -20px rgba(16, 24, 40, .32);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --risk-critical: #8a1c1c;
  --risk-high: #c7000b;
  --risk-mid: #c9770a;
  --risk-low: #2f855a;
}

* { box-sizing: border-box; }

html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 620px at 100% -12%, rgba(199, 0, 11, .055) 0%, transparent 55%),
    linear-gradient(180deg, #fbfbfd 0%, var(--bg) 46%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(199, 0, 11, .14); }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.app-shell { height: 100dvh; display: grid; grid-template-rows: 1fr; overflow: hidden; }

/* ------------------------------- 主区 ------------------------------- */
main {
  min-height: 0;
  padding: 16px clamp(16px, 3vw, 56px) 20px;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr);
  gap: 13px;
  overflow: hidden;
  animation: appIn .7s var(--ease-out) both;
}

.hero-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.updated { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); white-space: nowrap; letter-spacing: .01em; }
.updated .ic { width: 13px; height: 13px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
  background: var(--line-soft); color: var(--ink-2); white-space: nowrap;
  transition: background .3s ease, color .3s ease, transform .3s var(--spring);
}
.status-pill:hover { transform: translateY(-1px); }
.status-pill .ic { width: 13px; height: 13px; }
.status-pill.healthy { background: #e8f6ee; color: #1f7a4d; }
.status-pill.degraded { background: #fdf1e3; color: #b45309; }
.status-pill.pending { background: var(--line-soft); color: var(--muted); }
.status-pill.pending .ic { animation: pulse 1.4s ease-in-out infinite; }
.status-pill.healthy .ic { animation: pulse 2.6s ease-in-out infinite; }

.icon-btn {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer;
  transition: color .2s ease, border-color .2s ease, transform .35s var(--spring), box-shadow .25s ease;
}
.icon-btn:hover { color: var(--brand); border-color: #f3c2c6; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.icon-btn:active { transform: translateY(0) scale(.92); }
.icon-btn.loading .ic { animation: spin .9s linear infinite; }

/* ------------------------------- 导航 ------------------------------- */
nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.nav-tabs { display: flex; gap: 2px; align-self: stretch; }
nav button {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent; padding: 0 16px; height: 44px;
  font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; letter-spacing: .01em;
  transition: color .3s ease, transform .3s var(--spring);
}
nav button .ic { width: 15px; height: 15px; opacity: .75; transition: transform .4s var(--spring), opacity .3s ease; }
nav button::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px;
  background: var(--brand);
  transform: scaleX(0); transform-origin: center; transition: transform .42s var(--ease-out);
}
nav button:hover { color: var(--ink); }
nav button:hover .ic { transform: translateY(-2px) scale(1.12); opacity: 1; }
nav button:active { transform: scale(.97); }
nav button.active { color: var(--brand); }
nav button.active::after { transform: scaleX(1); }

/* ------------------------------- 视图 ------------------------------- */
.view { display: none; min-height: 0; overflow: hidden; }
.view.active { display: block; animation: viewIn .52s var(--ease-out) both; }
.view.leaving { animation: viewOut .18s ease both; }
.layout.active { display: grid; grid-template-columns: 1.55fr 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 13px; }
#view-providers.active { display: grid; grid-template-columns: minmax(300px, 360px) 1fr; gap: 13px; }

.card-surface {
  position: relative; height: 100%; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: box-shadow .45s var(--ease), border-color .45s ease;
}
.card-surface:hover { box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 18px 46px -18px rgba(16, 24, 40, .24); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 48px; padding: 0 16px; border-bottom: 1px solid var(--line-soft);
}
.card-head h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; letter-spacing: -.01em; }
.card-head h2 .ic { color: var(--brand); width: 15px; height: 15px; }
.count { font-size: 10px; font-weight: 700; color: var(--muted); background: var(--line-soft); border-radius: 999px; padding: 2px 8px; font-variant-numeric: tabular-nums; }

.segmented { display: inline-flex; background: var(--line-soft); border-radius: 999px; padding: 2px; }
.segmented button {
  border: 0; background: transparent; font-size: 10px; font-weight: 700; color: var(--muted);
  padding: 4px 12px; border-radius: 999px; cursor: pointer;
  transition: color .25s ease, background .35s var(--ease), box-shadow .35s ease, transform .3s var(--spring);
}
.segmented button:hover { color: var(--ink); }
.segmented button:active { transform: scale(.95); }
.segmented button.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }

/* ------------------------------- 今日一句话 ------------------------------- */
.daily-brief {
  grid-column: 1 / -1; height: auto; overflow: hidden;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 13px 18px;
  background: linear-gradient(118deg, #ffffff 0%, #fff6f7 100%);
  border-color: #f3cdd1;
  animation: fadeUp .5s var(--ease-out) both;
}
.daily-brief[hidden] { display: none; }
.daily-brief::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.brief-head { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; color: var(--brand); white-space: nowrap; letter-spacing: .02em; }
.brief-head .ic { width: 15px; height: 15px; }
.brief-date { font-size: 10px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.brief-text { margin: 0; min-width: 0; font-size: 12px; line-height: 1.6; color: var(--ink); }
.daily-brief .chip { justify-self: end; }

/* ------------------------------- 信号 ------------------------------- */
#signals { height: calc(100% - 48px); overflow: auto; scrollbar-width: none; scroll-behavior: smooth; }
#signals::-webkit-scrollbar { display: none; }

.signal {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 13px; align-items: center;
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer;
  transition: background .2s ease, transform .4s var(--ease-out);
  animation: fadeUp .5s var(--ease-out) both;
}
.signal:hover { background: var(--brand-soft); transform: translateX(5px); }
.signal .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--brand)); flex: none; transition: transform .4s var(--spring); }
.signal:hover .dot { transform: scale(1.5); }
.signal.risk-critical .dot, .signal.risk-极高 .dot { animation: pulse 1.8s ease-in-out infinite; }
.signal:nth-child(1) { animation-delay: .02s; }
.signal:nth-child(2) { animation-delay: .06s; }
.signal:nth-child(3) { animation-delay: .1s; }
.signal:nth-child(4) { animation-delay: .14s; }
.signal:nth-child(5) { animation-delay: .18s; }
.signal:nth-child(6) { animation-delay: .22s; }
.signal:nth-child(7) { animation-delay: .26s; }
.signal:nth-child(8) { animation-delay: .3s; }
.signal:nth-child(9) { animation-delay: .34s; }
.signal:nth-child(10) { animation-delay: .38s; }
.signal:nth-child(11) { animation-delay: .42s; }
.signal:nth-child(12) { animation-delay: .46s; }
.signal .body { min-width: 0; }
.signal strong { font-size: 11.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s ease; }
.signal:hover strong { color: var(--brand); }
.signal p { font-size: 9.5px; color: var(--muted); margin: 3px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.signal .meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 9px; color: #98a2ad; }
.signal .meta .ic { width: 11px; height: 11px; }

.chip { display: inline-flex; align-items: center; font-size: 9px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; background: var(--line-soft); color: var(--ink-2); transition: transform .3s var(--spring); }
.chip.risk-极高 { background: #fbeaea; color: var(--risk-critical); }
.chip.risk-高 { background: #fdeff0; color: var(--risk-high); }
.chip.risk-中 { background: #fdf3e3; color: var(--risk-mid); }
.chip.risk-低 { background: #e9f5ee; color: var(--risk-low); }
.chip.topic { background: #eef2f7; color: #3f4a56; }

/* ------------------------------- 表格 ------------------------------- */
.table-wrap { height: calc(100% - 48px); overflow: auto; scrollbar-width: none; scroll-behavior: smooth; }
.table-wrap::-webkit-scrollbar { display: none; }
table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
th { background: #1f2731; color: #fff; text-align: left; position: sticky; top: 0; z-index: 1; font-weight: 600; letter-spacing: .04em; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
tbody tr { animation: fadeUp .45s var(--ease-out) both; transition: background .2s ease, transform .3s var(--ease-out); }
tbody tr:nth-child(1) { animation-delay: .02s; }
tbody tr:nth-child(2) { animation-delay: .05s; }
tbody tr:nth-child(3) { animation-delay: .08s; }
tbody tr:nth-child(4) { animation-delay: .11s; }
tbody tr:nth-child(5) { animation-delay: .14s; }
tbody tr:nth-child(6) { animation-delay: .17s; }
tbody tr:nth-child(7) { animation-delay: .2s; }
tbody tr:nth-child(8) { animation-delay: .23s; }
tbody tr:hover { background: var(--brand-soft); }
tbody tr:nth-child(even) { background: #fcfdfe; }
tbody tr:nth-child(even):hover { background: var(--brand-soft); }

.search { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; background: #fff; transition: border-color .25s ease, box-shadow .3s ease; }
.search:focus-within { border-color: #f0b6bb; box-shadow: 0 0 0 4px rgba(199, 0, 11, .07); }
.search .ic { width: 14px; height: 14px; color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; font-size: 11px; width: 150px; color: var(--ink); }

.select-wrap { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; background: #fff; transition: border-color .25s ease, box-shadow .3s ease; }
.select-wrap:focus-within { border-color: #f0b6bb; box-shadow: 0 0 0 4px rgba(199, 0, 11, .07); }
.select-wrap .ic { width: 14px; height: 14px; color: var(--muted); }
.select-wrap select { border: 0; outline: 0; background: transparent; font-size: 11px; color: var(--ink); max-width: 180px; cursor: pointer; font-family: inherit; }

/* ------------------------------- 服务商主从 ------------------------------- */
.provider-list { height: calc(100% - 48px); overflow: auto; scrollbar-width: none; scroll-behavior: smooth; }
.provider-list::-webkit-scrollbar { display: none; }
.provider-row {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer;
  transition: background .2s ease, padding-left .4s var(--ease-out);
}
.provider-row:hover { background: #fafbfc; padding-left: 19px; }
.provider-row.active { background: var(--brand-soft); }
.provider-row.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--brand); }
.provider-row .name { font-size: 11.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.provider-row .name .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); transition: background .25s ease, transform .4s var(--spring); }
.provider-row.active .name .dot { background: var(--brand); }
.provider-row:hover .name .dot { transform: scale(1.4); }
.provider-row .sub { font-size: 9px; color: var(--muted); margin-top: 2px; padding-left: 14px; }
.provider-row .go { color: var(--brand); opacity: 0; transform: translateX(-5px); transition: opacity .25s ease, transform .4s var(--ease-out); }
.provider-row:hover .go, .provider-row.active .go { opacity: 1; transform: none; }

.provider-detail { height: calc(100% - 48px); overflow: auto; padding: 18px 20px 26px; scrollbar-width: none; scroll-behavior: smooth; }
.provider-detail::-webkit-scrollbar { display: none; }
.pd-head, .perf-grid, .spark-wrap, .pd-news { animation: fadeUp .5s var(--ease-out) both; }
.pd-head { animation-delay: .02s; }
.perf-grid { animation-delay: .07s; }
.spark-wrap { animation-delay: .12s; }
.pd-news { animation-delay: .17s; }
.pd-head h2 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.02em; }
.pd-alias { font-size: 10px; color: var(--muted); line-height: 1.6; }
.pd-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.pd-chips .chip:hover { transform: translateY(-2px); }

.perf-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.perf { background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; transition: transform .35s var(--ease-out), background .35s ease, box-shadow .35s ease; }
.perf:hover { transform: translateY(-3px); background: #fff; box-shadow: var(--shadow-sm); }
.perf b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.perf span { font-size: 9px; color: var(--muted); }
.perf.alert b { color: var(--brand); }

.spark-wrap { margin-top: 20px; }
.spark-head { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: var(--muted); margin-bottom: 8px; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 54px; }
.spark .bar { flex: 1; min-height: 3px; background: var(--brand); opacity: .3; border-radius: 3px 3px 0 0; transition: opacity .25s ease, transform .35s var(--spring); transform-origin: bottom; }
.spark .bar:hover { opacity: 1; transform: scaleY(1.08); }
.spark-axis { display: flex; justify-content: space-between; font-size: 9px; color: #a8b0b9; margin-top: 5px; }

.pd-news { margin-top: 22px; }
.pd-news h3 { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--brand); letter-spacing: .06em; margin: 0 0 6px; }
.pd-note { font-size: 10px; color: var(--muted); margin: 0 0 6px; line-height: 1.7; }
.news-item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px;
  padding: 10px 8px; border-bottom: 1px solid var(--line-soft); cursor: pointer; border-radius: 10px;
  transition: background .2s ease, transform .35s var(--ease-out);
  animation: fadeUp .45s var(--ease-out) both;
}
.news-item:nth-child(2) { animation-delay: .03s; }
.news-item:nth-child(3) { animation-delay: .06s; }
.news-item:nth-child(4) { animation-delay: .09s; }
.news-item:nth-child(5) { animation-delay: .12s; }
.news-item:nth-child(6) { animation-delay: .15s; }
.news-item:nth-child(7) { animation-delay: .18s; }
.news-item:hover { background: var(--brand-soft); transform: translateX(5px); }
.news-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--brand)); flex: none; transition: transform .4s var(--spring); }
.news-item:hover .dot { transform: scale(1.35); }
.news-item .ni-body { min-width: 0; }
.news-item strong { font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s ease; }
.news-item:hover strong { color: var(--brand); }
.news-item .meta { font-size: 9px; color: var(--muted); margin-top: 2px; }
.news-item time { font-size: 9px; color: var(--muted); }

/* ------------------------------- 资源卡片 ------------------------------- */
.cards.active { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; overflow: auto; align-content: start; padding-right: 4px; scrollbar-width: none; scroll-behavior: smooth; }
.cards.active::-webkit-scrollbar { display: none; }
.view-head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px; }
.view-head h2 { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: 13px; }
.view-head h2 .ic { color: var(--brand); width: 15px; height: 15px; }
.card {
  position: relative; overflow: hidden; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .45s var(--ease-out), box-shadow .45s ease, border-color .45s ease;
  animation: fadeUp .55s var(--ease-out) both;
}
.card:nth-child(2) { animation-delay: .04s; }
.card:nth-child(3) { animation-delay: .08s; }
.card:nth-child(4) { animation-delay: .12s; }
.card:nth-child(5) { animation-delay: .16s; }
.card:nth-child(6) { animation-delay: .2s; }
.card:nth-child(7) { animation-delay: .24s; }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: #f2cdd0; }
.card small { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 700; }
.card small .ic { width: 13px; height: 13px; transition: transform .4s var(--spring); }
.card:hover small .ic { transform: rotate(-10deg) scale(1.15); }
.card h3 { margin: 12px 0 6px; font-size: 15px; letter-spacing: -.01em; }
.card p { font-size: 10px; color: var(--muted); line-height: 1.65; margin: 4px 0; display: flex; align-items: center; gap: 5px; }
.card p .ic { width: 12px; height: 12px; }

/* ------------------------------- 抽屉 ------------------------------- */
.scrim { position: fixed; inset: 0; z-index: 9; background: rgba(23, 32, 42, .28); backdrop-filter: blur(3px) saturate(140%); opacity: 0; transition: opacity .3s ease; }
.scrim.show { opacity: 1; }

aside {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 92vw);
  background: var(--card); z-index: 10; box-shadow: var(--shadow-lg);
  transform: translateX(105%); transition: transform .42s var(--ease-out);
  overflow: auto; scrollbar-width: none;
}
aside::-webkit-scrollbar { display: none; }
aside.open { transform: none; }
aside .drawer-close { position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; transition: color .25s ease, border-color .25s ease, transform .45s var(--spring); }
aside .drawer-close:hover { color: var(--brand); border-color: #f3c2c6; transform: rotate(90deg); }
.drawer-body { padding: 26px; animation: fadeUp .45s var(--ease-out) both; }
.drawer-body .chip { margin-bottom: 12px; }
.drawer-body h2 { font-size: 21px; margin: 8px 0 6px; line-height: 1.35; letter-spacing: -.02em; }
.drawer-body .muted { color: var(--muted); font-size: 10px; margin: 0; }
.drawer-body h3 { display: flex; align-items: center; gap: 6px; font-size: 11px; margin: 20px 0 5px; color: var(--brand); letter-spacing: .06em; }
.drawer-body h3::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--brand); }
.drawer-body p { font-size: 11.5px; line-height: 1.85; color: var(--ink-2); margin: 4px 0; }
.drawer-body a { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; color: var(--brand); font-weight: 700; font-size: 11px; text-decoration: none; border-bottom: 1px solid rgba(199, 0, 11, .3); padding-bottom: 2px; transition: gap .3s var(--ease-out), border-color .25s ease; }
.drawer-body a:hover { gap: 10px; border-color: var(--brand); }

/* ------------------------------- 状态 ------------------------------- */
.empty { display: grid; place-items: center; gap: 10px; padding: 30px 16px; font-size: 11px; color: var(--muted); line-height: 1.8; text-align: center; animation: fadeUp .5s var(--ease-out) both; }
.empty code { background: var(--line-soft); padding: 1px 6px; border-radius: 5px; }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, #eef1f4 25%, #f7f9fb 37%, #eef1f4 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-signal { display: grid; grid-template-columns: 8px 1fr; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line-soft); }
.sk-signal .bar { border-radius: 50%; }
.sk-signal .lines { display: grid; gap: 7px; }
.sk-signal .l1 { height: 11px; width: 70%; }
.sk-signal .l2 { height: 9px; width: 95%; }

/* ------------------------------- 无障碍 ------------------------------- */
:focus-visible { outline: 2px solid rgba(199, 0, 11, .55); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------- 动画 ------------------------------- */
@keyframes appIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px) scale(.99); filter: blur(5px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes viewOut { from { opacity: 1; transform: none; filter: blur(0); } to { opacity: 0; transform: translateY(-6px) scale(.995); filter: blur(4px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ------------------------------- 响应式（宽屏优先） ------------------------------- */
@media (min-width: 1600px) {
  main { padding: 20px clamp(24px, 3.4vw, 80px) 24px; gap: 16px; }
  .cards.active { grid-template-columns: repeat(4, 1fr); }
  .perf-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1280px) and (max-width: 1599px) {
  .cards.active { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  #view-providers.active { grid-template-columns: minmax(260px, 300px) 1fr; }
  .perf-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .cards.active { grid-template-columns: repeat(2, 1fr); }
  #view-providers.active { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1.2fr); }
}
@media (max-width: 760px) {
  main { padding: 12px; grid-template-rows: 40px minmax(0, 1fr); gap: 9px; }
  nav button { flex: 1; justify-content: center; padding: 0 4px; font-size: 10.5px; height: 40px; }
  nav button .ic { display: none; }
  .layout.active { grid-template-columns: 1fr; }
  .layout .overview-provider { display: none; }
  .daily-brief { grid-template-columns: 1fr; gap: 6px; padding: 12px 14px; }
  .daily-brief .chip { justify-self: start; }
  .signal { padding: 10px 11px; }
  .cards.active { grid-template-columns: 1fr; }
  .table-wrap table { min-width: 620px; }
  .search input { width: 120px; }
  .updated { display: none; }
  .hero-meta { gap: 8px; }
}


/* ------------------------- Final polish layer ------------------------- */
.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 100;
  padding: 9px 13px; border-radius: 10px; background: #fff; color: var(--brand);
  border: 1px solid rgba(199,0,11,.22); box-shadow: var(--shadow);
  font-size: 12px; font-weight: 700; text-decoration: none;
  transform: translateY(-160%); transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }
button, input, select { font: inherit; }
button:disabled { cursor: wait; opacity: .72; }
.card-surface::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
}
.card-head, .provider-detail, #signals, .provider-list, .table-wrap { position: relative; z-index: 1; }
.signal:focus-visible, .news-item:focus-visible, .provider-row:focus-visible {
  outline: 2px solid rgba(199,0,11,.42); outline-offset: -3px; background: var(--brand-soft);
}
.empty-mark {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px;
  color: var(--brand); background: var(--brand-soft); border: 1px solid rgba(199,0,11,.09);
}
@supports not (backdrop-filter: blur(3px)) { .scrim { background: rgba(23,32,42,.52); } }
@media (hover: none) {
  .card-surface:hover, .card:hover, .perf:hover { transform: none; box-shadow: var(--shadow-sm); }
  .provider-row .go { opacity: .55; transform: none; }
}
@media (max-width: 760px) {
  html, body { overflow: auto; min-height: 100%; }
  .app-shell { min-height: 100dvh; height: auto; }
  main { min-height: 100dvh; overflow: visible; }
  nav { min-width: 0; }
  .nav-tabs { min-width: 0; flex: 1; }
  .status-pill { padding-inline: 8px; }
  #view-providers.active { grid-template-rows: minmax(260px, 42vh) minmax(420px, auto); }
}
