/* ============================================================
   MarketLab 48h验尸榜 共享样式(黑黄封条 UI)
   零图片/零CDN/零emoji; 系统字体; GPU 动画; 无障碍 focus
   ============================================================ */

:root {
  --bg: #111111;
  --bg2: #1a1a1a;
  --bg3: #232323;
  --yellow: #f7c800;
  --yellow-dim: #b39200;
  --yellow-soft: rgba(247, 200, 0, 0.12);
  --text: #f5f5f0;
  --muted: #a6a69c;
  --line: #3a3a3a;
  --red: #ff4d3d;
  --green: #3ddc84;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  --radius: 8px;
  --font: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC",
          "Noto Sans CJK SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(247, 200, 0, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
}

img, svg { vertical-align: middle; }

a { color: var(--yellow); }

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
  border-radius: 4px;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

/* ---------------- 黑黄封条视觉 ---------------- */

.tape-banner {
  position: relative;
  background: repeating-linear-gradient(
    45deg,
    #000 0 14px,
    var(--yellow) 14px 28px
  );
  padding: 10px 12px;
  overflow: hidden;
}

.tape-banner .tape-text {
  display: block;
  text-align: center;
  color: #000;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--yellow);
  padding: 6px 8px;
  border: 2px solid #000;
  border-radius: 2px;
}

/* ----- 竞赛测试横幅(任务37-B; 无 emoji, 黑黄红三色) ----- */
.contest-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 14px;
  background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  border-top: 1px solid var(--yellow);
  border-bottom: 1px solid var(--yellow);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}
.contest-banner-tag {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 12px;
  white-space: nowrap;
}
.contest-banner-text {
  color: var(--yellow);
  font-weight: 600;
}
@media (max-width: 640px) {
  .contest-banner {
    flex-direction: column;
    gap: 4px;
    padding: 6px 10px;
    font-size: 12px;
  }
  .contest-banner-tag { font-size: 11px; padding: 1px 6px; }
}


.tape-corner {
  position: relative;
  padding: 14px 16px;
  background: var(--bg2);
  border: 2px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 rgba(247, 200, 0, 0.25);
}

.tape-corner::before,
.tape-corner::after {
  content: "";
  position: absolute;
  top: 0;
  width: 64px;
  height: 18px;
  background: repeating-linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.45) 0 6px,
    rgba(247, 200, 0, 0.9) 6px 12px
  );
  border-left: 2px solid #000;
  border-right: 2px solid #000;
}

.tape-corner::before { left: -8px; transform: rotate(-8deg); }
.tape-corner::after { right: -8px; transform: rotate(8deg); }

.hazard-strip {
  height: 12px;
  background: repeating-linear-gradient(
    -45deg,
    #000 0 10px,
    var(--yellow) 10px 20px
  );
}

.stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 74px;
  padding: 8px;
  border: 4px double var(--red);
  color: var(--red);
  font-weight: 900;
  text-align: center;
  border-radius: 50%;
  transform: rotate(-8deg);
}

/* ---------------- 顶部导航 ---------------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--line);
}

.site-header .logo {
  font-size: 20px;
  font-weight: 900;
  color: var(--yellow);
  text-decoration: none;
  letter-spacing: 0.06em;
}

.site-nav { display: flex; flex-wrap: wrap; gap: 6px; }

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: #000;
  background: var(--yellow);
  border-color: var(--yellow);
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid var(--yellow);
  border-radius: 6px;
  background: var(--yellow);
  color: #000;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, opacity 0.2s ease;
  will-change: transform;
}

.btn:hover { opacity: 0.92; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--yellow);
  border: 2px solid var(--yellow);
}

.btn-dark {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--line);
}

.btn-danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 14px; }

/* ---------------- 卡片 / SKU 三卡 ---------------- */

.card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.sku-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.sku-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.15s ease, border-color 0.15s ease;
  will-change: transform;
}

.sku-card:hover { transform: translateY(-3px); border-color: var(--yellow); }
.sku-card.featured { border-color: var(--yellow); box-shadow: var(--shadow); }

.sku-card .sku-tag {
  align-self: flex-start;
  background: var(--yellow-soft);
  color: var(--yellow);
  border: 1px solid var(--yellow-dim);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.sku-card h3 { margin: 0; font-size: 20px; }
.sku-card .price { font-size: 30px; font-weight: 900; color: var(--yellow); }
.sku-card .price small { font-size: 14px; color: var(--muted); font-weight: 400; }
.sku-card .desc { color: var(--muted); font-size: 14px; min-height: 42px; }
.sku-card .btn { margin-top: auto; width: 100%; }

/* ---------------- 矩阵特色区块(首页) ---------------- */

.matrix-feature {
  margin-top: 28px;
  padding: 0;
  border-color: var(--yellow);
  overflow: hidden;
  animation: verdict-in 0.5s ease;
  will-change: transform, opacity;
}

.matrix-feature .hazard-strip { margin: 0; }

.matrix-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 22px 24px 16px;
}

.matrix-slogan {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
  color: var(--yellow);
  line-height: 1.35;
}

.matrix-viz {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ring-wrap { text-align: center; }

.ring-wrap svg {
  display: block;
  margin: 0 auto;
}

.ring-label {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.matrix-bars {
  flex: 1;
  min-width: 170px;
  display: grid;
  gap: 7px;
}

.matrix-bar-row {
  display: grid;
  grid-template-columns: 76px 1fr 36px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.matrix-bar-track {
  height: 11px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.matrix-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow-dim), var(--yellow));
  border-radius: 999px;
}

.demo-note {
  padding: 0 24px 16px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* ---------------- 报告矩阵评测结果 ---------------- */

.matrix-card .matrix-bar-row {
  grid-template-columns: minmax(110px, 1.1fr) minmax(120px, 1.4fr) auto;
  font-size: 12px;
}

.matrix-card h3 {
  margin: 18px 0 8px;
  font-size: 15px;
  color: var(--yellow);
}

.matrix-result-head {
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--bg2);
  border: 2px solid var(--yellow);
  border-radius: 6px;
}

.matrix-summary {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--yellow);
  line-height: 1.5;
}

.matrix-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 14px 0 4px;
}

.matrix-stat {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
}

.matrix-stat-num {
  font-size: 34px;
  font-weight: 900;
  color: var(--yellow);
  line-height: 1.2;
}

/* ---------------- 表单 ---------------- */

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 16px;
  font-family: inherit;
}

.form-group textarea { min-height: 96px; resize: vertical; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--yellow);
  outline: none;
  box-shadow: 0 0 0 3px rgba(247, 200, 0, 0.25);
}

.form-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 6px;
  min-height: 0;
}

.field-error {
  border-color: var(--red) !important;
}

.radio-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.radio-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 15px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.radio-grid label:has(input:checked) {
  border-color: var(--yellow);
  background: var(--yellow-soft);
}

.radio-grid input { min-height: auto; width: auto; accent-color: var(--yellow); }

/* ---------------- 锁/门禁 ---------------- */

.lock-panel {
  position: relative;
  border: 2px dashed var(--yellow-dim);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(247, 200, 0, 0.05) 18px 36px),
    var(--bg2);
  padding: 40px 24px;
  text-align: center;
}

.lock-panel h2 { margin: 0 0 8px; color: var(--yellow); }
.lock-panel p { color: var(--muted); margin: 0 0 18px; }

.locked-content { display: none; }
.unlocked .locked-content { display: block; }

/* ---------------- 弹窗 / toast ---------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
}

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--bg2);
  border: 2px solid var(--yellow);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.modal h3 { margin: 0 0 10px; color: var(--yellow); }
.modal p { margin: 0 0 18px; color: var(--muted); }
.modal .btn { width: 100%; margin-top: 8px; }
.modal .btn-ghost { margin-top: 6px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 18px;
  background: var(--yellow);
  color: #000;
  font-weight: 700;
  border-radius: 6px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  will-change: opacity, transform;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 短信登录(auth.js) ---------------- */

.auth-area {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.auth-area .btn {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 14px;
  white-space: nowrap;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--yellow-dim);
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--yellow);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.auth-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
}

.auth-intro { font-size: 13px; }

.auth-err {
  color: var(--red);
  font-size: 13px;
  margin: 8px 0 0;
  min-height: 0;
}

.code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.code-row input { flex: 1; min-width: 0; }
.code-row .btn { flex: none; width: auto; margin-top: 0; }

.test-code {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--yellow-dim);
  background: var(--yellow-soft);
  color: var(--yellow);
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
}

/* 小屏弹窗内部可滚动, 避免键盘顶出后按钮不可达 */
.modal {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

/* ---------------- 触控优化(移动端) ---------------- */

a,
button,
input,
select,
textarea,
label,
[role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------- 结果页要素 ---------------- */

.verdict-box {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border: 2px solid var(--yellow);
  border-radius: var(--radius);
  background: var(--bg2);
  margin-bottom: 20px;
}

.danger-gauge {
  width: 140px;
  height: 12px;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.danger-gauge .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow) 55%, var(--red));
  transition: width 0.6s ease;
  will-change: width;
}

.line-list { margin: 0; padding-left: 20px; }
.line-list li { margin-bottom: 8px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 28px 0 12px;
  font-size: 20px;
  color: var(--yellow);
}

.section-title::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--yellow);
  transform: rotate(45deg);
}

.copy-line {
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.copy-line span { flex: 1; }

/* ---------------- 排行榜大屏 ---------------- */

.marquee {
  overflow: hidden;
  white-space: nowrap;
  border-top: 2px solid var(--yellow);
  border-bottom: 2px solid var(--yellow);
  padding: 10px 0;
  background: var(--bg2);
}

.marquee-track {
  display: inline-block;
  animation: marquee-scroll 28s linear infinite;
  will-change: transform;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.rank-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.rank-row .rank-num {
  font-size: 26px;
  font-weight: 900;
  color: var(--yellow);
  text-align: center;
}

.rank-row .danger { color: var(--red); font-weight: 800; }

/* ---------------- 表格(管理后台) ---------------- */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

th { color: var(--yellow); font-weight: 800; white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.badge.ok { background: rgba(61, 220, 132, 0.15); color: var(--green); }
.badge.warn { background: rgba(247, 200, 0, 0.15); color: var(--yellow); }
.badge.bad { background: rgba(255, 77, 61, 0.15); color: var(--red); }

/* ---------------- 状态: 加载 / 空 / 错误 ---------------- */

.state-box {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg2);
}

.skeleton {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg3) 25%, var(--line) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.4s linear infinite;
  will-change: background-position;
}

.skeleton.line { height: 16px; margin-bottom: 10px; }

@keyframes skeleton-shine {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ---------------- 页脚 / 工具类 ---------------- */

.site-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.5; margin-top: 6px; }
.center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.big-number {
  font-size: 44px;
  font-weight: 900;
  color: var(--yellow);
  line-height: 1;
}

.danger-number {
  font-size: 56px;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
}

/* ---------------- 流式步骤(诊断 / 12步深度尽调共用) ---------------- */

.stream-steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.stream-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 6px;
  opacity: 0.45;
  transition: opacity 0.2s ease;
  will-change: opacity;
}

.stream-step.active { opacity: 1; border-color: var(--yellow); }
.stream-step.done { opacity: 1; border-color: rgba(61, 220, 132, 0.55); }
.stream-step.fail { opacity: 1; border-color: rgba(255, 77, 61, 0.6); }

.stream-step .step-ico {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  font-weight: 900;
  font-size: 13px;
  color: var(--muted);
}

.stream-step.done .step-ico { border-color: var(--green); color: var(--green); }
.stream-step.fail .step-ico { border-color: var(--red); color: var(--red); }

.stream-step .step-body { flex: 1; min-width: 0; }
.stream-step .step-title { font-weight: 700; }
.stream-step .step-sub { color: var(--muted); font-size: 13px; }

.spinner {
  border: 2px solid var(--line);
  border-top-color: var(--yellow);
  animation: spin 0.8s linear infinite;
  will-change: transform;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.deep-steps { margin-bottom: 16px; }
.deep-step { margin-bottom: 12px; }
.deep-step strong { color: var(--yellow); }
.deep-step p { margin: 4px 0 0; }

.deep-verdict {
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--bg2);
  border: 2px solid var(--yellow);
  border-radius: 6px;
}

.deep-verdict h3 { margin: 0 0 6px; color: var(--yellow); }
.deep-verdict p { margin: 0; }

.verdict-pop {
  animation: verdict-in 0.5s ease;
  will-change: transform, opacity;
}

@keyframes verdict-in {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 640px) {
  .page { padding: 12px 10px 48px; }
  .site-header { justify-content: center; text-align: center; }
  .site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
  }
  .auth-area { margin-left: 0; justify-content: center; }
  .rank-row { grid-template-columns: 42px 1fr; }
  .big-number { font-size: 32px; }
  .danger-number { font-size: 42px; }
  .matrix-head { grid-template-columns: 1fr; padding: 16px 14px 10px; }
  .matrix-slogan { font-size: 19px; }
  .demo-note { padding: 0 14px 12px; }
}

/* 横屏矮视口: 收紧间距, 弹窗保持可滚动 */
@media (max-height: 520px) and (orientation: landscape) {
  .page { padding-top: 8px; }
  .site-header { margin-bottom: 10px; }
}

/* ---------------- 动效无障碍 ---------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 打印: 去掉深色底, 输出黑字 */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .tape-banner, .btn, .toast { display: none; }
  .card, .sku-card { border-color: #000; background: #fff; }
}
