/* style.css — 页面骨架与首页布局 */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 420px at 82% -120px, rgba(123, 92, 255, 0.2), transparent 66%),
    radial-gradient(700px 380px at 4% 12%, rgba(53, 208, 255, 0.07), transparent 62%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.wrap {
  width: min(var(--wrap), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}
.section { padding: var(--section-y) 0; }
[id] { scroll-margin-top: 78px; }

/* ---------- M1 hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-media {
  position: absolute;
  inset: 0 0 0 auto;
  width: 66%;
  height: 100%;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(5, 10, 27, 0.94) 16%, rgba(5, 10, 27, 0.42) 46%, rgba(5, 10, 27, 0) 74%),
    linear-gradient(0deg, var(--bg) 0%, rgba(5, 10, 27, 0) 26%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding: 34px 0 20px;
  min-height: 330px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--accent-soft);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent-soft);
}
.hero h1 {
  margin-top: 13px;
  max-width: 620px;
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: 0.01em;
}
.hero h1 .grad {
  background: linear-gradient(96deg, #a78bfa 6%, #7b5cff 42%, #35d0ff 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  margin-top: 13px;
  max-width: 540px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 17px; }
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 15px;
}
.hero-stats li { display: flex; align-items: baseline; gap: 7px; }
.hero-stats strong {
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #d8cdff;
}
.hero-stats span { font-size: 11.5px; color: var(--dim); }
.hero-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.hero-tags a {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.hero-tags a:hover { border-color: var(--line-strong); color: var(--ink); }

/* ---------- M2 分类索引 ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

/* ---------- M3 四步路径 ---------- */
.step-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  counter-reset: step;
}
.step-list li {
  position: relative;
  padding: 11px 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(19, 29, 59, 0.9), rgba(9, 16, 35, 0.9));
}
.step-list li::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(180deg, var(--accent), transparent);
}
.step-num {
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent-soft);
}
.step-list h3 {
  margin-top: 5px;
  font-size: var(--fs-h3);
  font-weight: 700;
}
.step-list p {
  margin-top: 5px;
  font-size: 11.5px;
  line-height: 1.68;
  color: var(--muted);
}

/* ---------- M4 精选条目 ---------- */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* ---------- M5 + M6 参数带 ---------- */
.spec-grid > * { min-width: 0; }
.spec-grid {
  display: grid;
  grid-template-columns: 1.62fr 1fr;
  gap: 10px;
  align-items: stretch;
}
.spec-band .panel { display: flex; flex-direction: column; }
.spec-band .table-note { margin-top: auto; padding-top: 8px; }

/* ---------- M7 桌搭 ---------- */
.desk .wrap { position: relative; }
.desk-frame {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: flex-end;
  min-height: 218px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.desk-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 38% 78%;
}
.desk-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 8, 22, 0.05) 0%, rgba(4, 8, 22, 0.45) 50%, rgba(4, 8, 22, 0.93) 84%),
    linear-gradient(0deg, rgba(4, 8, 22, 0.6), transparent 46%);
}
.desk-copy {
  position: relative;
  z-index: 1;
  width: 54%;
  padding: 17px 22px 16px;
}
.desk-copy h2 { font-size: 21px; font-weight: 800; }
.desk-sub { margin-top: 4px; font-size: 12px; color: var(--accent-soft); }
.desk-copy ul { margin-top: 9px; display: grid; gap: 5px; }
.desk-copy li {
  position: relative;
  padding-left: 13px;
  font-size: 11.2px;
  line-height: 1.66;
  color: var(--muted);
}
.desk-copy li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-soft);
}
.desk-copy .text-link { margin-top: 10px; }

/* ---------- M8 收录说明 ---------- */
.notes-grid {
  display: grid;
  grid-template-columns: 176px repeat(4, minmax(0, 1fr)) 164px;
  gap: 12px;
  align-items: start;
  padding-top: 12px;
  padding-bottom: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.notes-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-h2);
  font-weight: 800;
}
.notes-head p { margin-top: 5px; font-size: 11px; color: var(--dim); }
.notes-items { display: contents; }
.notes-items div { min-width: 0; }
.notes-items dt { font-size: 11.5px; font-weight: 700; color: #d8cdff; letter-spacing: 0.06em; }
.notes-items dd { margin-top: 5px; font-size: 10.5px; line-height: 1.65; color: var(--muted); }
.notes-dates { font-size: 10.5px; color: var(--dim); }
.notes-dates h3 { font-size: 11.5px; font-weight: 700; color: #d8cdff; letter-spacing: 0.06em; }
.notes-dates ul { margin-top: 6px; display: grid; gap: 4px; list-style: none; }
.notes-dates time { font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif; color: var(--muted); margin-right: 5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .notes-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .notes-head { grid-column: 1 / -1; }
  .notes-dates { grid-column: 1 / -1; }
  .notes-dates ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .header-inner { gap: 12px; }
  /* 汉堡按钮已移除：导航改为横向滚动常显，保证窄屏仍有入口 */
  .main-nav {
    position: static;
    display: block;
    margin-left: auto;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav > ul { flex-wrap: nowrap; gap: 2px; }
  .main-nav a { padding: 8px 8px; font-size: 12.5px; }
  .main-nav .dropdown:hover > .dropdown-menu { display: none; }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .toc { position: static; }
  .toc-toggle { display: inline-flex; }
  .toc .toc-body { display: none; margin-top: 6px; }
  .toc.is-open .toc-body { display: grid; }
  .list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-aside { max-width: 520px; }
  .hero-media { width: 100%; opacity: 0.5; }
  .hero-media::after {
    background:
      linear-gradient(90deg, var(--bg) 0%, rgba(5, 10, 27, 0.9) 42%, rgba(5, 10, 27, 0.55) 100%),
      linear-gradient(0deg, var(--bg) 0%, rgba(5, 10, 27, 0.2) 40%);
  }
  .hero-inner { padding-top: 34px; }
  .lede { max-width: 100%; }
  .spec-grid { grid-template-columns: 1fr; }
  .desk-copy { width: 62%; }
}

@media (max-width: 760px) {
  :root { --section-y: 18px; --gutter: 18px; }
  .header-inner { height: auto; min-height: 58px; flex-wrap: wrap; padding: 8px 0; }
  .site-logo-text { font-size: 15px; }
  .brand-text small { display: none; }
  .hero-inner { min-height: 0; padding: 28px 0 22px; }
  .hero h1 { font-size: 33px; }
  .hero-stats { gap: 18px; }
  .hero-stats strong { font-size: 17px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .page-hero { padding: 16px 0 14px; }
  .page-hero-grid { flex-direction: column; align-items: flex-start; gap: 14px; }
  .page-facts { gap: 20px; }
  .filter-sort { margin-left: 0; width: 100%; }
  .filter-sort select { flex: 1 1 auto; }
  .list-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .related-entries ul { grid-template-columns: 1fr; }
  .chip { height: 32px; padding: 0 11px; }
  .article-body { font-size: 14px; }
  .article-body > h2 { font-size: 18px; }
  .article-layout { padding-top: 2px; }
  .cat-thumb { aspect-ratio: 16 / 9; }
  .cat-name { font-size: 14px; }
  .cat-desc { font-size: 12px; }
  .step-list { grid-template-columns: 1fr; gap: 10px; }
  .feat-grid { grid-template-columns: 1fr; }
  .entry-thumb { flex-basis: 104px; width: 104px; }
  .entry-title { font-size: 15px; }
  .entry-desc { -webkit-line-clamp: 3; }
  .sec-head { flex-direction: column; gap: 3px; align-items: flex-start; }
  .spec-table { min-width: 520px; }
  .desk-frame { display: block; min-height: 0; }
  .desk-img { position: relative; height: 190px; }
  .desk-frame::after {
    background: linear-gradient(0deg, #040816 0%, rgba(4, 8, 22, 0.4) 55%, transparent 100%);
    top: 120px;
  }
  .desk-copy { width: 100%; padding: 14px 16px 18px; }
  .desk-copy ul { gap: 8px; }
  .notes-grid { grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  .notes-items { display: contents; }
  .notes-dates ul { grid-template-columns: 1fr 1fr; }
  .cta-inner { flex-wrap: wrap; gap: 14px; padding: 18px 0; }
  .cta-thumb { flex-basis: 64px; width: 64px; height: 48px; }
  .cta-copy h2 { font-size: 20px; }
  .cta-copy { flex-basis: calc(100% - 78px); }
  .cta-actions { width: 100%; }
  .cta-actions .btn { flex: 1 1 auto; justify-content: center; }
  .footer-row { flex-direction: column; gap: 18px; padding-top: 22px; }
  .footer-row > * { flex: 1 1 auto; width: 100%; min-width: 0; }
  .footer-bottom { flex-direction: column; gap: 4px; }
}

@media (max-width: 400px) {
  .cat-grid { grid-template-columns: 1fr; }
  .notes-grid { grid-template-columns: 1fr; }
  .notes-dates ul { grid-template-columns: 1fr 1fr; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- 窄屏触控目标 ---------- */
@media (max-width: 760px) {
  .footer-col a { display: inline-block; padding: 5px 0; }
  .toc a { padding: 8px 6px; }
  .crumb a { display: inline-block; padding: 4px 0; }
  .hero-tags a { padding: 6px 11px; }
  .article-meta span { font-size: 11.5px; }
  .related-entries .entry-card { min-height: 132px; }
}
