/* ==========================================================================
   自行车 · 车型与部件知识库
   设计宽 1440 / 内容栏 1328，区块高度按 03-ui/compare-log.md 的分区预算落位
   ========================================================================== */

:root {
  /* 底色与面 */
  --bg: #f2f3f5;
  --surface: #ffffff;
  --panel: #ebf0f4;
  /* 深色区（页头 / hero / 页脚） */
  --dark: #1f2e3a;
  --dark-2: #24343f;
  --dark-ink: #ffffff;
  --dark-soft: #a9b7c1;
  /* 文字 */
  --ink: #16222c;
  --ink-2: #3d4a55;
  --ink-3: #6b7885;
  /* 线与强调 */
  --line: #e2e6ea;
  --line-strong: #cfd6dc;
  --accent: #f6c039;
  --accent-dark: #e2a71d;
  --accent-ink: #2a2417;
  /* 排印 */
  --sans: 'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  /* 尺寸 */
  --wrap: 1328px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 14px 34px -28px rgba(22, 34, 44, .55);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-2);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; color: var(--ink); letter-spacing: .01em; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }

.wrap {
  width: min(var(--wrap), calc(100% - 112px));
  margin-inline: auto;
}

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

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  padding: 10px 18px; background: var(--accent); color: var(--accent-ink);
  border-radius: 0 0 10px 10px; font-weight: 700; text-decoration: none;
  transition: top .18s ease;
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- M0 页头 */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--dark);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.header-inner {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--dark-ink);
  flex: 0 0 auto;
}

.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.4px solid rgba(246, 192, 57, .85);
  color: var(--accent);
}
.brand-mark svg { width: 20px; height: 20px; }

.brand-name { font-size: 20px; font-weight: 700; letter-spacing: .04em; }

.brand-divider {
  width: 1px; height: 16px; background: rgba(255, 255, 255, .22);
}

.brand-sub { font-size: 12px; color: var(--dark-soft); letter-spacing: .06em; }

.nav {
  display: flex; align-items: center; gap: 26px;
  flex-wrap: wrap; justify-content: flex-end;
}
.nav-item { position: relative; }
.nav a {
  position: relative;
  font-size: 13px; color: var(--muted); text-decoration: none;
  padding: 6px 0;
  transition: color .18s ease;
}
.nav a:hover { color: var(--ink-invert); }
.nav a.is-current { color: var(--ink-invert); font-weight: 600; }
.nav a.is-current::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--accent); border-radius: 2px;
}

.dropdown-menu {
  display: none;
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  min-width: 176px;
  max-height: 360px; overflow-y: auto;
  padding: 8px 4px;
  background: var(--dark-2);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, .3);
  z-index: 50;
}
.nav-item:hover .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block; padding: 7px 14px;
  font-size: 12.5px; white-space: nowrap; border-radius: 6px;
}
.dropdown-menu a:hover { background: rgba(255, 255, 255, .08); color: var(--ink-invert); }

.nav-toggle {
  display: none;
  width: 40px; height: 34px; padding: 0 9px;
  background: transparent; border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px; cursor: pointer;
  flex-direction: column; justify-content: center; gap: 4px;
}
.nav-toggle span {
  display: block; height: 1.6px; background: var(--ink-invert); border-radius: 2px;
}

/* ---------------------------------------------------------------- M1 hero */
.hero {
  position: relative;
  min-height: 369px;
  background: var(--dark);
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute; inset: 0 0 0 auto;
  width: 54%;
  z-index: -1;
}
.hero-media img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: 50% 52%;
}
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--dark) 0%, rgba(31, 46, 58, .96) 34%, rgba(31, 46, 58, .55) 62%, rgba(31, 46, 58, .05) 100%),
    linear-gradient(180deg, rgba(31, 46, 58, .1) 0%, rgba(31, 46, 58, .45) 100%);
}

.hero-inner { position: relative; padding: 40px 0 34px; }

.hero-eyebrow {
  font-size: 12px; letter-spacing: .16em; font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero h1 {
  color: var(--ink-invert);
  font-size: 46px;
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: .015em;
}

.hero-lead {
  margin-top: 14px;
  max-width: 560px;
  font-size: 14px;
  line-height: 1.9;
  color: #b9c5cd;
}

.hero-actions {
  margin-top: 22px;
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 26px;
  border-radius: 22px;
  font-size: 14px; font-weight: 700; letter-spacing: .02em;
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost {
  color: var(--ink-invert);
  border: 1px solid rgba(255, 255, 255, .4);
}
.btn-ghost:hover { border-color: var(--ink-invert); background: var(--line-alt); }

.hero-stats {
  display: flex; align-items: center; gap: 16px;
  margin-left: 6px; padding-left: 20px;
  border-left: 1px solid rgba(255, 255, 255, .2);
  font-size: 12.5px; color: var(--dark-soft);
}
.hero-stats li { display: inline-flex; align-items: baseline; gap: 5px; }
.hero-stats strong { color: var(--accent); font-size: 15px; font-weight: 700; }

/* ------------------------------------------------------------ 通用区段头 */
.section { position: relative; }

.section-head h2 {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: .01em;
}
.section-sub {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-3);
  max-width: 860px;
}

/* -------------------------------------------------- M2 场景（y 439–821） */
.section-scenario { padding: 28px 0 63px; }

.scenario-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.scenario-card {
  position: relative;
  height: 212px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--dark-2);
  box-shadow: var(--shadow);
}
.scenario-card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.scenario-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13, 22, 29, .12) 0%, rgba(13, 22, 29, .48) 42%, rgba(13, 22, 29, .9) 100%);
}

.scenario-body {
  position: relative; z-index: 1;
  height: 100%;
  padding: 14px 16px 15px;
  display: flex; flex-direction: column; justify-content: flex-end;
  align-items: flex-start;
}

.scenario-num {
  position: absolute; top: 12px; left: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 7px;
  border-radius: 8px;
  background: rgba(246, 192, 57, .92);
  color: var(--accent-ink);
  font-size: 12px; font-weight: 700;
  letter-spacing: .02em;
}

.scenario-body h3 {
  color: var(--ink-invert);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}
.scenario-body p {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.65;
  color: rgba(255, 255, 255, .84);
}

.pill {
  margin-top: 11px;
  display: inline-flex; align-items: center;
  height: 27px; padding: 0 12px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11.5px; font-weight: 700;
  text-decoration: none;
  transition: background .18s ease;
}
.pill:hover { background: var(--ink-invert); }

/* ------------------------------------------------ M3 分类（y 821–1043） */
.section-cats { padding: 6px 0 9px; }
.section-cats .section-head h2 { font-size: 22px; }

.cat-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.cat-grid a {
  display: flex; flex-direction: column; align-items: center;
  height: auto; min-height: 170px;
  padding: 20px 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  text-align: center;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.cat-grid a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.cat-grid svg {
  width: 36px; height: 36px;
  fill: none; stroke: var(--ink); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
  flex: 0 0 auto;
}
.cat-name {
  margin-top: 9px;
  font-size: 14px; font-weight: 700; color: var(--ink);
  line-height: 1.3;
}
.cat-desc {
  margin-top: 5px;
  font-size: 11px; line-height: 1.55; color: var(--ink-3);
}

/* ---------------------------------------------- M4 精选（y 1043–1372） */
.section-featured { padding: 12px 0 12px; }
.section-featured .section-head h2 { font-size: 25px; }

.feature-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card > a {
  display: flex; flex-direction: column;
  height: 100%;
  padding: 0 0 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.feature-card > a:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.feature-thumb {
  display: block;
  aspect-ratio: 4.6 / 1;
  overflow: hidden;
  background: var(--panel);
}
.feature-thumb img { width: 100%; height: 100%; object-fit: cover; }

.feature-tag {
  display: inline-block;
  margin: 11px 15px 0;
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  color: var(--accent-dark);
  text-transform: none;
}

.feature-card h3 {
  margin: 5px 15px 0;
  font-size: 16px; line-height: 1.34; font-weight: 700;
}

.feature-card p {
  margin: 6px 15px 0;
  font-size: 12px; line-height: 1.5; color: var(--ink-3);
}

.feature-link {
  margin: 7px 15px 0;
  font-size: 12.5px; font-weight: 700; color: var(--ink);
}
.feature-link::after { content: " →"; color: var(--accent-dark); }

/* ---------------------------------------------- M5 速查表（y 1372–1600） */
.section-parts { padding: 2px 0 2px; }

.section-head-inline {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 40px;
}
.section-head-inline h2 { font-size: 22px; line-height: 1.2; }
.section-head-inline .section-sub {
  margin-top: 0; max-width: 780px;
  font-size: 11.5px; line-height: 1.6;
}

.table-scroll { margin-top: 8px; overflow-x: auto; }

.parts-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 12.5px;
}
.parts-table thead th {
  background: #334250;
  color: var(--ink-invert);
  font-size: 12.5px; font-weight: 600;
  text-align: left;
  padding: 7px 16px;
  white-space: nowrap;
}
.parts-table tbody th {
  text-align: left;
  font-weight: 700; color: var(--ink);
  padding: 5px 16px;
  white-space: nowrap;
}
.parts-table tbody td {
  padding: 5px 16px;
  line-height: 1.4;
  color: var(--ink-2);
  border-top: 1px solid var(--line);
}
.parts-table tbody tr:nth-child(even) { background: #fafbfc; }
.parts-table th:first-child, .parts-table td:first-child { width: 12%; }
.parts-table th:nth-child(2), .parts-table td:nth-child(2) { width: 25%; }
.parts-table th:nth-child(3), .parts-table td:nth-child(3) { width: 24%; }

/* --------------------------------- M6 保养周期 / M7 误区（y 1600–1820） */
.section-care { padding: 4px 0 4px; }

.care-band {
  display: grid;
  grid-template-columns: 1.72fr 1fr;
  gap: 48px;
  align-items: start;
}

.care-col .section-head h2, .myth-col .section-head h2 { font-size: 20px; }
.care-col .section-sub { font-size: 12.5px; max-width: 700px; }

.cycle-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.cycle-grid li {
  padding: 9px 10px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.cycle-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px; border-radius: 50%;
  background: rgba(246, 192, 57, .22);
  color: var(--accent-dark);
}
.cycle-icon svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.cycle-grid h3 {
  margin-top: 6px;
  font-size: 12.5px; font-weight: 700; line-height: 1.3;
}
.cycle-grid p {
  margin-top: 4px;
  font-size: 10.5px; line-height: 1.55; color: var(--ink-3);
}

.myth-col .section-head h2 { font-size: 20px; }

.myth-list {
  margin-top: 10px;
  counter-reset: myth;
}
.myth-list li {
  position: relative;
  padding: 4px 0 6px 32px;
  border-bottom: 1px solid var(--line);
  counter-increment: myth;
}
.myth-list li:last-child { border-bottom: 0; }
.myth-list li::before {
  content: counter(myth);
  position: absolute; left: 0; top: 5px;
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(246, 192, 57, .22);
  color: var(--accent-dark);
  font-size: 11px; font-weight: 700;
}
.myth-list h3 { font-size: 13px; font-weight: 700; line-height: 1.3; }
.myth-list p {
  margin-top: 3px;
  font-size: 10.5px; line-height: 1.45; color: var(--ink-3);
}

/* -------------------------------------------------- M8 说明（y 1820–1965） */
.section-note { padding: 12px 0 10px; }

.note-panel {
  background: var(--panel);
  border-radius: 16px;
  padding: 18px 26px 20px;
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 30px;
  align-items: start;
}

.note-head { display: flex; align-items: center; gap: 9px; }
.note-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px; border-radius: 8px;
  background: var(--surface); color: var(--ink);
}
.note-icon svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.note-head h2 { font-size: 18px; font-weight: 700; }

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.note-grid dt {
  font-size: 11.5px; font-weight: 700; color: var(--ink);
  letter-spacing: .08em;
}
.note-grid dd {
  margin: 5px 0 0;
  font-size: 11.5px; line-height: 1.7; color: var(--ink-3);
}

/* ------------------------------------------------------- M9 页脚（深色） */
.site-footer {
  margin-top: 34px;
  background: var(--dark);
  color: var(--dark-soft);
  padding: 26px 0 14px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px 40px;
  padding-bottom: 20px;
}
.footer-inner > * { flex: 1 1 200px; min-width: 170px; }
.footer-brand { flex: 1.4 1 240px; }

.brand-footer .brand-name { font-size: 18px; }
.footer-brand p {
  margin-top: 10px;
  font-size: 12px; line-height: 1.75;
  color: var(--dark-soft);
  max-width: 300px;
}

.footer-col h2 {
  font-size: 12.5px; font-weight: 700; color: var(--ink-invert);
  letter-spacing: .08em;
  margin-bottom: 9px;
}
.footer-col ul { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-col a {
  font-size: 12px; color: var(--muted); text-decoration: none;
  transition: color .18s ease;
}
.footer-col a:hover { color: var(--accent); }
.footer-about p { font-size: 12px; line-height: 1.75; color: var(--dark-soft); }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 13px;
  font-size: 11.5px; color: #7f8d97;
}
.footer-bottom a { color: inherit; text-decoration: none; }
.footer-bottom a:hover { color: var(--accent); }

/* ============================================================ 响应式 */
@media (max-width: 1180px) {
  .wrap { width: min(var(--wrap), calc(100% - 64px)); }
  .nav { gap: 18px; }
  .brand-sub { display: none; }
  .brand-divider { display: none; }
  .care-band { grid-template-columns: 1fr; gap: 28px; }
  .note-panel { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 1024px) {
  .header-inner { height: 64px; }
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--dark-2);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    padding: 0;
    max-height: 0; overflow: hidden;
    transition: max-height .22s ease;
  }
  .nav.is-open { max-height: calc(100vh - 64px); overflow-y: auto; }
  .nav a {
    width: 100%; padding: 12px 32px;
    border-top: 1px solid var(--line-alt);
    font-size: 14px;
  }
  .nav a.is-current::after { left: 32px; right: auto; width: 28px; bottom: 6px; }
  .nav-item { width: 100%; }
  .nav-item > a { display: block; }
  .dropdown-menu {
    position: static; transform: none; display: block;
    min-width: 0; max-height: none; overflow: visible;
    padding: 0; background: transparent; border: 0; box-shadow: none;
  }
  .dropdown-menu a { padding: 9px 44px; font-size: 13px; color: var(--dark-soft); }

  .hero h1 { font-size: 38px; }
  .hero-media { width: 62%; }
  .scenario-grid { grid-template-columns: repeat(2, 1fr); }
  .scenario-card { height: 220px; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .cat-grid a { height: auto; min-height: 156px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-thumb { aspect-ratio: 3 / 1; }
  .cycle-grid { grid-template-columns: repeat(2, 1fr); }
  .note-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { gap: 26px 28px; }
  .footer-inner > * { flex: 1 1 160px; }
  .footer-about { flex-basis: 100%; }
}

@media (max-width: 720px) {
  .wrap { width: calc(100% - 36px); }

  .hero { min-height: 0; }
  .hero-media { position: relative; inset: auto; width: 100%; height: 210px; }
  .hero-media::after {
    background: linear-gradient(180deg, rgba(31, 46, 58, .15) 0%, rgba(31, 46, 58, .8) 78%, var(--dark) 100%);
  }
  .hero-inner { padding: 22px 0 28px; }
  .hero h1 { font-size: 29px; line-height: 1.24; }
  .hero-lead { font-size: 13.5px; }
  .hero-actions { gap: 10px; }
  .hero-stats {
    flex-basis: 100%;
    margin: 4px 0 0; padding-left: 0;
    border-left: 0; gap: 14px;
    font-size: 12px;
  }

  .section-scenario { padding: 30px 0 26px; }
  .section-head h2 { font-size: 21px; }
  .scenario-grid { grid-template-columns: 1fr; gap: 14px; }
  .scenario-card { height: 200px; }

  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-grid a { min-height: 150px; }

  .feature-grid { grid-template-columns: 1fr; }
  .feature-thumb { aspect-ratio: 2 / 1; }

  .section-head-inline { flex-direction: column; align-items: flex-start; gap: 10px; }
  .table-scroll { margin-inline: -18px; padding-inline: 18px; }
  .parts-table { min-width: 640px; }

  .cycle-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .care-band { gap: 22px; }

  .note-grid { grid-template-columns: 1fr; gap: 14px; }
  .note-panel { padding: 16px 18px 18px; }

  .site-footer { margin-top: 26px; }
  .footer-inner { flex-direction: column; gap: 22px; }
  .footer-inner > * { flex: 0 0 auto; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
}

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