/* ==========================================================================
   PQ Litmus 样式
   顺序：设计令牌（浅色 / 深色）→ 基础 → 通用组件 → 顶栏 → 首屏 → 检测状态与报告
        → 背景与依据 → CTA 与页脚 → 响应式
   ========================================================================== */

/* ---------- 设计令牌 ---------- */
:root {
  color-scheme: light;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f6f8fc;
  --bg-translucent: rgba(246, 248, 252, 0.82);
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --surface-3: #e6ebf3;
  --text: #0b1220;
  --text-2: #334155;
  --muted: #64748b;
  --border: #e3e8f0;
  --border-strong: #cbd5e1;

  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef2ff;
  --on-brand: #ffffff;
  --gradient-brand: linear-gradient(135deg, #4f46e5, #7c3aed);
  --ring: rgba(79, 70, 229, 0.22);

  --red: #dc2626;
  --red-soft: #fef2f2;
  --red-border: #fecaca;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --green: #059669;
  --green-soft: #ecfdf5;
  --green-border: #a7f3d0;
  --info: #64748b;
  --on-tone: #ffffff;

  --grid-line: rgba(15, 23, 42, 0.05);
  --glow-1: rgba(99, 102, 241, 0.2);
  --glow-2: rgba(168, 85, 247, 0.16);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 30px -14px rgba(15, 23, 42, 0.24);
  --shadow-lg: 0 30px 60px -30px rgba(15, 23, 42, 0.45);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --container: 1160px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f1e;
  --bg-translucent: rgba(10, 15, 30, 0.78);
  --surface: #121b31;
  --surface-2: #1a2540;
  --surface-3: #22304f;
  --text: #e8ecf4;
  --text-2: #bac3d5;
  --muted: #8d98ae;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);

  --brand: #8b95f8;
  --brand-2: #b39dfb;
  --brand-soft: rgba(129, 140, 248, 0.14);
  --on-brand: #ffffff;
  --gradient-brand: linear-gradient(135deg, #5b5cf0, #8b5cf6);
  --ring: rgba(129, 140, 248, 0.34);

  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --red-border: rgba(248, 113, 113, 0.38);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --amber-border: rgba(251, 191, 36, 0.38);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.12);
  --green-border: rgba(52, 211, 153, 0.38);
  --info: #94a3b8;
  --on-tone: #0a0f1e;

  --grid-line: rgba(255, 255, 255, 0.045);
  --glow-1: rgba(99, 102, 241, 0.3);
  --glow-2: rgba(168, 85, 247, 0.22);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.45), 0 14px 34px -16px rgba(0, 0, 0, 0.75);
  --shadow-lg: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}

/* ---------- 基础 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

/* 中文用户首次打开时由 boot.js 先隐藏，app.js 换好文案后再显示 */
html.i18n-pending body {
  visibility: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s, color 0.25s;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

code {
  padding: 0.05em 0.35em;
  font-size: 0.86em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}

pre {
  margin: 0;
}

pre code {
  padding: 0;
  font-size: inherit;
  border: 0;
  background: none;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection {
  background: var(--ring);
}

/* ---------- 通用组件 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -56px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--text);
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  transition: top 0.15s;
}

.skip-link:focus {
  top: 12px;
}

.mono {
  font-size: 0.92em;
}

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

.wrap {
  word-break: break-all;
}

.icon {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  cursor: progress;
  opacity: 0.75;
  transform: none;
}

.button-primary {
  color: var(--on-brand);
  background: var(--gradient-brand);
  box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.button-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -10px rgba(79, 70, 229, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.button-ghost {
  height: 38px;
  padding: 0 12px;
  font-size: 0.875rem;
  color: var(--text-2);
  background: var(--surface);
  border-color: var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.button-ghost:hover {
  color: var(--brand);
  border-color: var(--brand);
  transform: translateY(-1px);
}

.button-light {
  color: #312e81;
  background: #ffffff;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.6);
}

.button-light:hover {
  transform: translateY(-1px);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.chip:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.chip[data-demo]::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

/* 小圆点的颜色规则要盖过上面的 .chip[data-demo]::before，所以带上 [data-demo] 提高优先级 */
.chip[data-demo].chip-green::before {
  background: var(--green);
}

.chip-green:hover {
  color: var(--green);
  border-color: var(--green);
  background: var(--green-soft);
}

.chip[data-demo].chip-amber::before {
  background: var(--amber);
}

.chip-amber:hover {
  color: var(--amber);
  border-color: var(--amber);
  background: var(--amber-soft);
}

.chip[data-demo].chip-red::before {
  background: var(--red);
}

.chip-red:hover {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-soft);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  color: var(--text-2);
  background: var(--surface-2);
}

.pill-red {
  color: var(--red);
  background: var(--red-soft);
  border-color: var(--red-border);
}

.pill-amber {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: var(--amber-border);
}

.pill-green {
  color: var(--green);
  background: var(--green-soft);
  border-color: var(--green-border);
}

/* 中性色（例如算法表里“无实际影响”的行） */
.pill-muted {
  color: var(--muted);
  background: var(--surface-3);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-official {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.badge-inferred {
  color: #7e22ce;
  background: #faf5ff;
  border-color: #e9d5ff;
}

.badge-advisory {
  color: #0e7490;
  background: #ecfeff;
  border-color: #a5f3fc;
}

.badge-primary,
.badge-baseline {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

:root[data-theme="dark"] .badge-official {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(147, 197, 253, 0.32);
}

:root[data-theme="dark"] .badge-inferred {
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(216, 180, 254, 0.32);
}

:root[data-theme="dark"] .badge-advisory {
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.16);
  border-color: rgba(103, 232, 249, 0.32);
}

:root[data-theme="dark"] .badge-primary,
:root[data-theme="dark"] .badge-baseline {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(203, 213, 225, 0.26);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
}

.tag-muted {
  color: var(--muted);
}

.dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--info);
}

.dot.pass {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.dot.warn {
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.dot.fail {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin-bottom: 18px;
}

.card-head h2 {
  font-size: 1.25rem;
}

.card-sub {
  font-size: 0.875rem;
  color: var(--muted);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-translucent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.25s;
}

.topbar.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 6px 20px -14px rgba(15, 23, 42, 0.35);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 4px 8px rgba(79, 70, 229, 0.35));
}

.brand-name {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-tag {
  margin-left: 2px;
  padding-left: 10px;
  font-size: 0.8125rem;
  white-space: nowrap;
  color: var(--muted);
  border-left: 1px solid var(--border-strong);
}

.topnav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.topnav a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  transition: background-color 0.15s, color 0.15s;
}

.topnav a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}

.lang-button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.lang-button:hover {
  color: var(--text);
}

.lang-button[aria-pressed="true"] {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-2);
  background: var(--surface);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, transform 0.12s;
}

.icon-button:hover {
  color: var(--brand);
  border-color: var(--brand);
  transform: translateY(-1px);
  text-decoration: none;
}

#theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] #theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] #theme-toggle .icon-moon {
  display: none;
}

/* ---------- 分享菜单与轻提示 ---------- */
/* 桌面端：挂在顶栏分享按钮下方的下拉层。菜单位于顶栏之外（顶栏的毛玻璃效果会改变 fixed 定位的参照），
   位置由 app.js 写在 --share-top / --share-right 上；手机上由下面的媒体查询改成贴屏底的弹出层。 */
.share-menu {
  position: fixed;
  top: var(--share-top, auto);
  right: var(--share-right, 0);
  z-index: 60;
  min-width: 224px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.share-items {
  display: grid;
  gap: 2px;
}

.share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  color: var(--text-2);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.share-item::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.55;
}

.share-item:hover,
.share-item:focus-visible {
  color: var(--brand);
  background: var(--brand-soft);
  text-decoration: none;
  outline: none;
}

.share-hint {
  margin: 6px 12px;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
}

/* 轻提示：平时在屏幕下方不可见，加上 .is-visible 后浮出，两秒后由 app.js 收回 */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 80;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 首屏 ---------- */
/* 检测状态与报告排在首屏之后、营销区块之前：一点击检测就能看到进度与结果（DOM 顺序不变，便于无结果时阅读） */
main {
  display: flex;
  flex-direction: column;
}

.hero {
  order: -2;
}

#status,
#result {
  order: -1;
}

.hero {
  position: relative;
  isolation: isolate;
  padding: 96px 0 56px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 20%, transparent 70%);
}

.hero-bg::after {
  content: "";
  position: absolute;
  top: -220px;
  left: 50%;
  width: 980px;
  height: 560px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--glow-1), transparent), radial-gradient(closest-side at 72% 42%, var(--glow-2), transparent);
  filter: blur(12px);
}

.hero-inner {
  max-width: 880px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  max-width: 100%;
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* 红点与文字绑在一起：窄屏上先在文字内部折行，日期徽标整体换到下一行 */
.badge-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.badge-date {
  padding: 1px 9px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 999px;
}

.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--red);
  border-radius: 50%;
  opacity: 0;
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  from {
    transform: scale(0.6);
    opacity: 0.8;
  }
  to {
    transform: scale(1.7);
    opacity: 0;
  }
}

.hero-title {
  margin-top: 24px;
  font-size: clamp(2.25rem, 1.1rem + 4vw, 4rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.hero-title em {
  display: inline-block; /* 强调词组整体换行，不会被拆到两行 */
  font-style: normal;
  color: transparent;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-lede {
  max-width: 740px;
  margin: 20px auto 0;
  font-size: 1.125rem;
  color: var(--text-2);
}

.scan-form {
  margin-top: 36px;
}

.scan-box {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.scan-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring), var(--shadow-md);
}

.scan-box.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.16);
  animation: shake 0.3s;
}

@keyframes shake {
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.scan-icon {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.scan-box input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  font: inherit;
  font-size: 1.0625rem;
  color: var(--text);
  background: transparent;
  outline: none;
}

.scan-box input::placeholder {
  color: var(--muted);
}

.scan-box .button {
  flex: none;
}

.scan-hint {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--muted);
}

.scan-hint.is-error {
  font-weight: 600;
  color: var(--red);
}

.samples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.samples-label {
  margin-right: 2px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.samples-divider {
  width: 1px;
  height: 20px;
  margin: 0 8px;
  background: var(--border-strong);
}

/* ---------- 特点 ---------- */
.features {
  padding: 40px 0 72px;
}

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

.feature {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.feature:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 12px;
  color: var(--brand);
  background: var(--brand-soft);
}

.feature-icon .icon {
  width: 22px;
  height: 22px;
}

.feature h3 {
  font-size: 1rem;
}

.feature p {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--text-2);
}

/* ---------- 检测中 ---------- */
.result,
.result-status {
  min-height: 40px;
  margin-top: 8px;
}

.result:focus {
  outline: none;
}

.result.is-updating {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.2s;
}

#result > * {
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.status-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
}

.spinner {
  flex: none;
  width: 36px;
  height: 36px;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

.status-target {
  font-size: 1.0625rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.status-step {
  min-height: 1.5em;
  margin-top: 2px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.status-dots {
  display: flex;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background-color 0.2s, transform 0.2s;
}

.status-dot.is-active {
  background: var(--brand);
  transform: scale(1.3);
}

.progress {
  height: 4px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition-property: width;
  transition-timing-function: linear;
}

.skeleton {
  margin-top: 16px;
}

.skeleton .kpi-grid,
.skeleton-columns {
  margin-top: 16px;
}

.skeleton-block {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.skeleton-block.is-banner {
  height: 148px;
}

.skeleton-block.is-tile {
  height: 112px;
}

.skeleton-block.is-tall {
  height: 320px;
}

.skeleton-columns {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 16px;
}

/* ---------- 错误 ---------- */
.error-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  padding: 26px 28px;
  border-color: var(--red-border);
}

.error-icon,
.verdict-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  color: var(--on-tone);
  background: var(--red);
  box-shadow: 0 10px 24px -10px var(--red);
}

.error-icon .icon,
.verdict-icon .icon {
  width: 28px;
  height: 28px;
  stroke-width: 2.4;
}

.error-body h2 {
  font-size: 1.25rem;
}

.error-body p {
  margin-top: 8px;
  color: var(--text-2);
}

.error-body p.muted {
  font-size: 0.875rem;
}

.error-actions {
  margin-top: 16px;
}

.error-details {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--muted);
}

.error-details summary {
  font-weight: 600;
  cursor: pointer;
}

.error-details pre {
  margin-top: 8px;
  padding: 12px;
  overflow-x: auto;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

/* ---------- 报告：结论横幅 ---------- */
.verdict {
  --tone: var(--green);
  --tone-soft: var(--green-soft);
  --tone-border: var(--green-border);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 20px;
  align-items: start;
  padding: 28px;
  overflow: hidden;
  border-color: var(--tone-border);
}

.verdict::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: 5px;
  background: var(--tone);
}

.verdict::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(640px 220px at 0% 0%, var(--tone-soft), transparent 70%);
  pointer-events: none;
}

.verdict-red {
  --tone: var(--red);
  --tone-soft: var(--red-soft);
  --tone-border: var(--red-border);
}

.verdict-amber {
  --tone: var(--amber);
  --tone-soft: var(--amber-soft);
  --tone-border: var(--amber-border);
}

.verdict-green {
  --tone: var(--green);
  --tone-soft: var(--green-soft);
  --tone-border: var(--green-border);
}

.verdict-icon {
  color: var(--on-tone);
  background: var(--tone);
  box-shadow: 0 10px 24px -10px var(--tone);
}

/* 作为网格项允许收缩，超长域名才会换行而不是把横幅撑宽 */
.verdict-body {
  min-width: 0;
}

.verdict-label {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tone);
}

.verdict-host {
  margin-top: 2px;
  font-size: clamp(1.375rem, 2.4vw, 1.875rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.verdict-summary {
  max-width: 72ch;
  margin-top: 6px;
  color: var(--text-2);
}

.verdict-meta {
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.verdict-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.verdict-deadline {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tone);
  background: var(--tone-soft);
  border: 1px solid var(--tone-border);
  border-radius: 10px;
}

.verdict-note {
  grid-column: 1 / -1;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- 报告：关键指标 ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.kpi {
  position: relative;
  padding: 18px 20px 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.kpi::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--tone, transparent);
}

.kpi.is-pass {
  --tone: var(--green);
}

.kpi.is-warn {
  --tone: var(--amber);
}

.kpi.is-fail {
  --tone: var(--red);
}

.kpi.is-info {
  --tone: var(--info);
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.kpi-value {
  margin-top: 10px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.kpi-value.mono {
  font-size: 1rem;
  font-weight: 600;
}

.kpi-note {
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* ---------- 报告：两栏布局 ---------- */
.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: start;
  gap: 16px;
  margin-top: 16px;
}

.result-main,
.result-side {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.result-main > *,
.result-side > * {
  min-width: 0;
}

/* ---------- 报告：检查项 ---------- */
.check-group + .check-group {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-strong);
}

.check-group-title {
  margin-bottom: 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.check + .check {
  margin-top: 10px;
}

.check:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.check.is-warn {
  border-color: var(--amber-border);
}

.check.is-fail {
  border-color: var(--red-border);
  background: linear-gradient(90deg, var(--red-soft), transparent 60%), var(--surface);
}

.check-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  border-radius: 50%;
  color: var(--info);
  background: var(--surface-2);
}

/* 作为网格项允许收缩，很长的证书名才会换行 */
.check-body {
  min-width: 0;
}

.check-icon .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}

.check.is-pass .check-icon {
  color: var(--green);
  background: var(--green-soft);
}

.check.is-warn .check-icon {
  color: var(--amber);
  background: var(--amber-soft);
}

.check.is-fail .check-icon {
  color: var(--red);
  background: var(--red-soft);
}

.check-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.check-title {
  font-weight: 600;
}

.check-detail {
  margin-top: 4px;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.check-advice {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.875rem;
  color: var(--text-2);
}

/* ---------- 报告：证书链 ---------- */
.chain {
  display: grid;
}

.chain-node {
  position: relative;
  padding: 0 0 22px 28px;
}

.chain-node:last-child {
  padding-bottom: 4px;
}

.chain-node::before {
  content: "";
  position: absolute;
  top: 22px;
  bottom: -2px;
  left: 7px;
  width: 2px;
  background: var(--border-strong);
}

.chain-node:last-child::before {
  display: none;
}

.chain-node::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 16px;
  height: 16px;
  border: 3px solid var(--info);
  border-radius: 50%;
  background: var(--surface);
}

.chain-node.is-pass::after {
  border-color: var(--green);
}

.chain-node.is-warn::after {
  border-color: var(--amber);
}

.chain-node.is-fail::after {
  border-color: var(--red);
}

.chain-role {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.chain-cn {
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.chain-key {
  margin: 6px 0 10px;
}

.chain-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 18px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
}

.chain-fields div {
  display: flex;
  gap: 6px;
  min-width: 0;
  font-size: 0.875rem;
}

.chain-fields dt {
  flex: none;
  color: var(--muted);
}

.chain-fields dd {
  margin: 0;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.chain-notes {
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- 报告：TLS 明细与 HTTP 层 ---------- */
.kv {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.kv th,
.kv td {
  padding: 9px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.kv tr:last-child th,
.kv tr:last-child td {
  border-bottom: 0;
}

.kv th {
  width: 38%;
  padding-right: 12px;
  font-weight: 500;
  color: var(--muted);
}

.kv td {
  color: var(--text);
  overflow-wrap: anywhere;
}

.support-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
}

.support-title {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.support-title + .support-title,
.support-list + .support-title {
  margin-top: 14px;
}

.support-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.support {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  font-size: 0.8125rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.support-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.support-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
}

.support.is-good .support-state {
  color: var(--green);
}

.support.is-good .dot {
  background: var(--green);
}

.support.is-bad .support-state {
  color: var(--red);
}

.support.is-bad .dot {
  background: var(--red);
}

.support.is-unknown .support-state {
  color: var(--amber);
}

.support.is-unknown .dot {
  background: var(--amber);
}

/* ---------- 报告：迁移建议 ---------- */
.advice-groups {
  display: grid;
  gap: 18px;
}

.advice-group {
  --tone: var(--brand);
  --tone-soft: var(--brand-soft);
  --tone-border: var(--border-strong);
  min-width: 0; /* 作为网格项时允许收缩到容器宽度以内，长命令在 pre 里滚动 */
  padding: 18px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--tone-border);
  border-radius: var(--radius-lg);
}

.advice-group.is-now {
  --tone: var(--red);
  --tone-soft: var(--red-soft);
  --tone-border: var(--red-border);
}

.advice-group.is-soon {
  --tone: var(--amber);
  --tone-soft: var(--amber-soft);
  --tone-border: var(--amber-border);
}

.advice-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.advice-index {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--on-tone);
  background: var(--tone);
  border-radius: 8px;
}

.advice-group-head h3 {
  font-size: 1.0625rem;
}

.step {
  padding: 14px 16px;
  background: var(--tone-soft);
  border-radius: var(--radius);
}

.step + .step {
  margin-top: 12px;
}

.step h4 {
  font-size: 0.9875rem;
}

.step p {
  margin-top: 6px;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.step p.muted {
  font-size: 0.875rem;
}

.snippet {
  margin-top: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.snippet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.snippet pre {
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text);
}

.copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.copy:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.copy .icon {
  width: 14px;
  height: 14px;
}

/* ---------- 背景与依据 ---------- */
.section {
  padding: 88px 0;
}

.learn {
  border-top: 1px solid var(--border);
}

.section-head {
  max-width: 760px;
  margin-bottom: 48px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.section-title {
  margin-top: 14px;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  letter-spacing: -0.03em;
}

.section-lede {
  margin-top: 16px;
  font-size: 1.0625rem;
  color: var(--text-2);
}

.subsection-title {
  margin: 64px 0 20px;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.timeline {
  position: relative;
  display: grid;
  gap: 16px;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 7px;
  width: 2px;
  background: linear-gradient(var(--border-strong), var(--brand));
}

.event {
  position: relative;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.event::before {
  content: "";
  position: absolute;
  top: 26px;
  left: -28px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
}

.event-key {
  border-color: rgba(79, 70, 229, 0.45);
}

.event-key::before {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.event-date {
  display: inline-flex;
  padding: 2px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: 999px;
}

.event h3 {
  margin-top: 12px;
  font-size: 1.125rem;
}

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

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.algo-table {
  width: 100%;
  min-width: 880px;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.algo-table th {
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.algo-table td {
  padding: 14px 16px;
  vertical-align: top;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}

.algo-table tr:last-child td {
  border-bottom: 0;
}

.algo-table tbody tr:hover {
  background: var(--surface-2);
}

.algo-table td:first-child {
  min-width: 190px;
  color: var(--text);
}

.cell-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.badge-note {
  margin-left: 6px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.row-red td:first-child {
  box-shadow: inset 3px 0 0 var(--red);
}

.row-amber td:first-child {
  box-shadow: inset 3px 0 0 var(--amber);
}

.row-green td:first-child {
  box-shadow: inset 3px 0 0 var(--green);
}

.row-muted td:first-child {
  box-shadow: inset 3px 0 0 var(--border-strong);
}

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

.rule {
  --tone-border: var(--border);
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--tone-border);
  border-top-width: 3px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.rule-red {
  --tone-border: var(--red-border);
}

.rule-amber {
  --tone-border: var(--amber-border);
}

.rule-green {
  --tone-border: var(--green-border);
}

.rule h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.0625rem;
}

.rule ul {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding-left: 18px;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.rule-note {
  margin-top: 14px;
  padding: 10px 12px;
  font-size: 0.875rem;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 10px;
}

.prose {
  max-width: 82ch;
  margin-top: 20px;
  color: var(--text-2);
}

.prose-list {
  display: grid;
  gap: 10px;
  max-width: 900px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: item;
}

.prose-list li {
  position: relative;
  padding: 14px 18px 14px 46px;
  font-size: 0.9375rem;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  counter-increment: item;
}

.prose-list li::before {
  content: counter(item, decimal-leading-zero);
  position: absolute;
  top: 15px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand);
}

.faq {
  display: grid;
  gap: 10px;
  max-width: 880px;
}

.faq-item {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s;
}

.faq-item[open] {
  border-color: var(--border-strong);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  transform: rotate(-135deg);
}

.faq-item p {
  padding: 0 20px 18px;
  color: var(--text-2);
}

.sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: source;
}

.sources li {
  position: relative;
  padding: 16px 18px 16px 52px;
  font-size: 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  counter-increment: source;
}

.sources li::before {
  content: counter(source);
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
}

.sources a {
  font-weight: 600;
  color: var(--text);
}

.sources a:hover {
  color: var(--brand);
}

.source-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.source-note {
  margin-top: 8px;
  color: var(--text-2);
}

/* ---------- CTA 与页脚 ---------- */
.cta {
  padding: 0 0 88px;
}

.cta-card {
  position: relative;
  overflow: hidden;
  padding: 56px 32px;
  text-align: center;
  color: #ffffff;
  border-radius: var(--radius-xl);
  background: radial-gradient(120% 160% at 10% 0%, rgba(255, 255, 255, 0.2), transparent 50%), var(--gradient-brand);
  box-shadow: var(--shadow-lg);
}

.cta-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  pointer-events: none;
}

.cta-card > * {
  position: relative;
}

.cta-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.025em;
}

.cta-text {
  max-width: 580px;
  margin: 14px auto 0;
  font-size: 1.0625rem;
  color: rgba(255, 255, 255, 0.84);
}

.cta .button {
  margin-top: 28px;
}

.footer {
  padding: 32px 0 40px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.footer-note {
  max-width: 680px;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .feature-grid,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-grid,
  .skeleton-columns,
  .rules,
  .sources {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .topnav,
  .brand-tag {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  .topbar-inner {
    gap: 10px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .lang-switch {
    padding: 2px;
  }

  .lang-button {
    padding: 0 9px;
    font-size: 0.8rem;
  }

  /* 手机上收紧倒计时胶囊的内边距，让一句话尽量排在一行 */
  .hero-badge {
    padding: 6px 10px;
    gap: 6px 8px;
  }

  .badge-main {
    gap: 8px;
  }

  .hero {
    padding: 64px 0 40px;
  }

  .scan-box {
    flex-wrap: wrap;
    padding: 10px;
  }

  .scan-box input {
    flex: 1 1 0;
  }

  .scan-box .button {
    width: 100%;
  }

  .samples-divider {
    display: none;
  }

  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 手机上关键指标保持两列，避免报告过长 */
  .kpi-grid {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi {
    padding: 14px 14px 16px;
  }

  .kpi-value {
    font-size: 1rem;
  }

  .card {
    padding: 18px;
  }

  .status-card {
    gap: 14px;
    padding: 18px;
  }

  .status-dots {
    display: none;
  }

  .verdict,
  .error-card {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }

  .verdict-actions {
    justify-content: flex-start;
  }

  .section {
    padding: 64px 0;
  }

  .subsection-title {
    margin-top: 48px;
  }

  .timeline {
    padding-left: 22px;
  }

  .event {
    padding: 16px;
  }

  .event::before {
    left: -22px;
  }

  .lang-button {
    padding: 0 10px;
  }

  /* 手机：分享菜单贴着屏幕底部弹出（像操作表），触控区域加大，后面压一层半透明遮罩 */
  html.share-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(15, 23, 42, 0.35);
  }

  .share-menu {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    min-width: 0;
    padding: 8px;
    border-radius: var(--radius-lg);
  }

  .share-item {
    min-height: 48px;
    padding: 10px 14px;
    font-size: 1rem;
  }

  .share-hint {
    margin: 8px 14px 6px;
  }

  .cta-card {
    padding: 40px 20px;
  }
}

@media (max-width: 340px) {
  /* 最窄的屏幕（如 320px）：顶栏放不下品牌名，只留图标（读屏名称仍在） */
  .topbar .brand-name {
    display: none;
  }
}

@media (min-width: 361px) and (max-width: 413px) {
  /* 这个宽度段里两行标题差一点点放不下，英文的问号会被单独挤到第三行：字号略减，让第二行完整地排在一行 */
  .hero-title {
    font-size: calc(1.1rem + 3.3vw);
  }
}

@media (max-width: 360px) {
  /* 很窄的屏幕：标题缩小，并取消固定换行，让两行按词组自然折行 */
  .hero-title {
    font-size: 1.75rem;
  }

  .hero-title br {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
