/* ============ 基础 ============ */
:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1e2430;
  --text-2: #5b6472;
  --text-3: #8a93a3;
  --line: #e8ebf1;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .05);
  --shadow-hover: 0 4px 8px rgba(15, 23, 42, .08), 0 10px 24px rgba(15, 23, 42, .09);
}

/* 品类主题色（切换 Tab 时由 body class 控制） */
body.tab-cpu { --accent: #3b82f6; --accent-deep: #1d4ed8; --accent-soft: #eff6ff; }
body.tab-gpu { --accent: #10b981; --accent-deep: #047857; --accent-soft: #ecfdf5; }
body.tab-soc { --accent: #8b5cf6; --accent-deep: #6d28d9; --accent-soft: #f5f3ff; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ 顶部 Hero ============ */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -80px, color-mix(in srgb, var(--accent) 45%, transparent), transparent 60%),
    linear-gradient(160deg, #101623 0%, #1a2233 70%, #202a40 100%);
  color: #fff;
  padding: 56px 20px 72px;
}

.hero-inner { max-width: 1080px; margin: 0 auto; }

.hero-badge {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 2px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .92);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #fff, color-mix(in srgb, var(--accent) 60%, #fff));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  margin-top: 12px;
  font-size: clamp(14px, 2.2vw, 17px);
  color: rgba(255, 255, 255, .78);
  max-width: 640px;
}

.hero-meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-item {
  font-size: 13px;
  color: rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  padding: 5px 12px;
  border-radius: 8px;
}

/* ============ Tab 导航 ============ */
.tabs {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.tabs-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.tab-btn {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .18s ease;
  display: flex;
  align-items: center;
  gap: 7px;
}

.tab-btn:hover { border-color: var(--accent); color: var(--accent-deep); }

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent);
}

.tab-btn .count {
  font-size: 12px;
  font-weight: 700;
  background: rgba(0, 0, 0, .08);
  padding: 1px 8px;
  border-radius: 999px;
}

.tab-btn.active .count { background: rgba(255, 255, 255, .25); }

/* ============ 主体 ============ */
.page { max-width: 1080px; margin: 0 auto; padding: 26px 20px 60px; }

.section-title {
  font-size: 19px;
  font-weight: 800;
  margin: 26px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 5px;
  height: 20px;
  border-radius: 3px;
  background: var(--accent);
}

/* ---- 快速结论 ---- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.quick-card {
  background: linear-gradient(180deg, var(--accent-soft), #fff 70%);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}

.quick-card .q-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.quick-card .q-pick {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
}

.quick-card .q-desc { font-size: 13px; color: var(--text-2); }

/* ---- 行情动态 ---- */
.market-notes {
  margin-top: 22px;
  background: #fffbe8;
  border: 1px solid #f6e6a6;
  border-radius: var(--radius);
  padding: 14px 18px;
}

.market-notes h3 { font-size: 14px; color: #8a6d1a; margin-bottom: 8px; }

.market-notes ul { list-style: none; }

.market-notes li {
  font-size: 13.5px;
  color: #6b5b23;
  padding: 3px 0 3px 18px;
  position: relative;
}

.market-notes li::before {
  content: "▪";
  position: absolute;
  left: 2px;
  color: #d3a625;
}

/* ---- 筛选/排序 ---- */
.controls {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}

.chip:hover { border-color: var(--accent); color: var(--accent-deep); }

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.sort-box { display: flex; align-items: center; gap: 8px; }

.sort-box label { font-size: 13.5px; color: var(--text-3); }

.sort-box select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  outline: none;
}

.sort-box select:focus { border-color: var(--accent); }

/* ---- 榜单 ---- */
.rank-list { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }

.rank-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 208px 216px;
  gap: 18px;
  align-items: center;
  transition: box-shadow .18s ease, transform .18s ease;
}

.rank-item:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.rank-item.top-1 { background: linear-gradient(135deg, #fffaf0, #fff 55%); border-color: #f3d9a4; }
.rank-item.top-2 { background: linear-gradient(135deg, #f8fafc, #fff 55%); border-color: #d7dee8; }
.rank-item.top-3 { background: linear-gradient(135deg, #fbf3ec, #fff 55%); border-color: #e8cdb8; }

.rank-no {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  background: #f1f3f7;
  color: var(--text-3);
}

.rank-item.top-1 .rank-no { background: linear-gradient(135deg, #ffd257, #f59e0b); color: #7c4a03; box-shadow: 0 3px 10px rgba(245, 158, 11, .4); }
.rank-item.top-2 .rank-no { background: linear-gradient(135deg, #e2e8f0, #b6c2d3); color: #45566c; }
.rank-item.top-3 .rank-no { background: linear-gradient(135deg, #eabf9a, #d09a6a); color: #6b3f1d; }

/* 信息区 */
.item-info { min-width: 0; }

.item-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.item-name { font-size: 16.5px; font-weight: 750; letter-spacing: .2px; }

.brand-chip {
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.item-specs { font-size: 13px; color: var(--text-3); margin-top: 3px; }

.item-comment {
  font-size: 13.5px;
  color: var(--text-2);
  margin-top: 7px;
  padding-left: 10px;
  border-left: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
}

.item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }

.tag {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  background: #f3f5f9;
  border: 1px solid var(--line);
  padding: 2px 9px;
  border-radius: 999px;
}

.rep-phone {
  font-size: 13px;
  color: var(--accent-deep);
  margin-top: 4px;
  font-weight: 600;
}

/* 价格区 */
.price-col { display: flex; flex-direction: column; gap: 6px; }

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 9px;
  padding: 5px 10px;
  font-size: 13px;
  border: 1px solid transparent;
}

.price-row .p-name { font-weight: 650; display: flex; align-items: center; gap: 5px; }

.price-row .p-val { font-weight: 750; font-variant-numeric: tabular-nums; }

.price-row a.price-link { color: inherit; text-decoration: none; display: flex; justify-content: space-between; width: 100%; align-items: center; gap: 8px; }
.price-row a.price-link:hover .p-val { text-decoration: underline; }

.price-row.jd { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.price-row.pdd { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.price-row.xy { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.price-row .p-val .arrow { font-size: 11px; opacity: .55; margin-left: 3px; }

.price-note { font-size: 12px; color: var(--text-3); padding: 1px 2px 0; }

/* 分数区 */
.score-col { display: flex; flex-direction: column; gap: 12px; }

.score-row .s-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 5px;
}

.score-row .s-head b { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }

.bar { height: 8px; background: #eef1f6; border-radius: 999px; overflow: hidden; }

.bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 65%, #fff), var(--accent));
  transition: width .5s ease;
}

.bar.value-bar > span {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.score-hint { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* 空状态 */
.empty {
  text-align: center;
  color: var(--text-3);
  padding: 60px 0;
  font-size: 14.5px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ---- 避坑指南 ---- */
.tips {
  margin-top: 30px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.tips h3 { font-size: 16px; font-weight: 800; margin-bottom: 12px; }

.tips ul { list-style: none; }

.tips li {
  font-size: 14px;
  color: var(--text-2);
  padding: 6px 0 6px 26px;
  position: relative;
}

.tips li::before {
  content: "⚠️";
  position: absolute;
  left: 0;
  font-size: 13px;
}

/* ---- 方法论 ---- */
.methodology {
  margin-top: 30px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}

.methodology h2 { font-size: 18px; font-weight: 800; margin-bottom: 14px; }

.method-list { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }

.method-list li { font-size: 14px; color: var(--text-2); }

.method-list b { color: var(--text); }

.disclaimer {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--text-3);
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
}

/* ---- 页脚 ---- */
.footer {
  text-align: center;
  padding: 26px 20px 34px;
  color: var(--text-3);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  .rank-item {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
  }

  .rank-no { width: 38px; height: 38px; font-size: 15px; }

  .price-col {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .price-row { flex: 1 1 45%; }

  .score-col {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 20px;
  }

  .score-row { flex: 1; }
}

@media (max-width: 560px) {
  .hero { padding: 40px 16px 54px; }

  .page { padding: 20px 14px 46px; }

  .price-row { flex: 1 1 100%; }

  .score-col { flex-direction: column; gap: 12px; }

  .controls { flex-direction: column; align-items: stretch; }

  .sort-box { justify-content: space-between; }
}
