/* ==========================================================================
   蓝魔鬼科普网 · style.css（首页专属）
   依赖 tokens.css（变量）与 components.css（基础排版 / 页头 / 页脚 / 按钮 / 区块标题）。
   设计基准：1440（视觉稿 1024×1536 归一化），内容栏 1320。
   首页分区预算（1440 基准）：header 65 / hero 409 / topics 327 / editor 200 /
   latest 300 / duo 330 / faq 267 / notice 74 / footer 188 = 2160
   ========================================================================== */

/* ------------------------------------------------------------------- hero */
.hero {
  position: relative;
  overflow: hidden;
  color: var(--ink-invert);
  background: linear-gradient(118deg, var(--navy-deep) 0%, var(--navy) 46%, var(--navy-lift) 100%);
  isolation: isolate;
}

.hero-media {
  position: absolute;
  top: 0;
  right: max(0px, calc((100% - 1440px) / 2));
  width: 47%;
  height: 100%;
  z-index: 0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 45%;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--navy-deep) 0%, rgba(0, 26, 82, .72) 18%, rgba(0, 26, 82, 0) 62%),
    linear-gradient(180deg, rgba(0, 26, 82, .35) 0%, rgba(0, 26, 82, 0) 28%, rgba(0, 33, 94, .55) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 26px 24px 30px;
}

.hero-copy { max-width: 800px; }

.eyebrow {
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-base);
  letter-spacing: .16em;
  color: #7fb2ff;
  margin-bottom: 10px;
}

.hero h1 {
  font-size: var(--fs-hero);
  font-weight: 800;
  letter-spacing: -.012em;
  color: var(--ink-invert);
  margin-bottom: 18px;
}

.hero-lead {
  font-size: var(--fs-3xl);
  line-height: 1.68;
  color: var(--ink-on-navy);
  max-width: 780px;
  margin-bottom: 26px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-actions .btn { font-size: var(--fs-2xl); }

.hero-tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 780px;
  margin-top: 26px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .07);
  font-size: var(--fs-lg);
  line-height: 1.65;
  color: var(--ink-on-navy);
}
.hero-tip-icon {
  flex: none;
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(110, 168, 255, .18);
  color: #7fb2ff;
}

/* ----------------------------------------------------------- topic grid */
.topics { padding: 28px 0 32px; }

.topics .topic-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 22px;
  margin-top: 20px;
}

.topic-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.topic-card:hover {
  transform: translateY(-2px);
  border-color: #cfe0f8;
  box-shadow: var(--shadow-card-hover);
}

.topic-hit {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 28px 12px 26px;
  text-align: center;
}

.topic-num {
  position: absolute;
  top: 0; left: 0;
  padding: 4px 10px;
  border-radius: var(--radius) 0 12px 0;
  background: var(--blue);
  color: var(--ink-invert);
  font-size: var(--fs-s);
  font-weight: 700;
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  letter-spacing: .04em;
}

.topic-icon {
  width: 44px; height: 44px;
  margin: 28px 0 20px;
  color: var(--blue-deep);
}
.topic-icon svg { width: 100%; height: 100%; }

.topic-card h3 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
}
.topic-card p {
  margin-top: 6px;
  font-size: var(--fs-lg);
  line-height: 1.55;
  color: var(--muted);
}

/* ------------------------------------------------------------ editor picks */
.editor { padding: 12px 0 14px; }

.pick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 10px;
}

.pick {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.pick-thumb { display: block; }
.pick-thumb img {
  width: 160px;
  height: 112px;
  object-fit: cover;
  border-radius: 10px;
}
.pick-body h3 { font-size: var(--fs-3xl); font-weight: 700; line-height: 1.4; }
.pick-body h3 a { color: var(--ink); }
.pick-body h3 a:hover { color: var(--blue-deep); }
.pick-body p {
  margin-top: 6px;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--muted);
}

/* ------------------------------------------------------------ latest grid */
.latest { padding: 12px 0 14px; }

.latest-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 22px;
  margin-top: 10px;
}

.latest-thumb {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--blue-pale);
}
.latest-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.latest-card:hover .latest-thumb img { transform: scale(1.04); }

.latest-card .tag { position: absolute; top: 8px; left: 8px; }

.latest-card h3 { font-size: var(--fs-md-lg); font-weight: 700; line-height: 1.4; margin-top: 7px; }
.latest-card h3 a { color: var(--ink); }
.latest-card h3 a:hover { color: var(--blue-deep); }
.latest-card > p { margin-top: 4px; font-size: var(--fs-s); line-height: 1.45; color: var(--muted); }
.latest-card .meta {
  margin-top: 6px;
  font-size: var(--fs-xs);
  color: var(--faint);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
}

/* -------------------------------------------------------- duo: compare + check */
.duo { padding: 14px 0 18px; }

.duo-grid {
  display: grid;
  grid-template-columns: 2.04fr 1fr;
  gap: 24px;
  align-items: start;
}

.table-wrap { margin-top: 12px; overflow-x: auto; }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.compare-table th,
.compare-table td {
  padding: 6.5px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
}
.compare-table thead th {
  background: var(--blue-pale);
  color: var(--ink);
  font-weight: 700;
  font-size: var(--fs-md);
  border-bottom: 1px solid #d8e6fb;
}
.compare-table tbody th { font-weight: 700; color: var(--ink); font-size: var(--fs-md); }
.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td { border-bottom: 0; }
.compare-table tbody tr:hover { background: var(--surface); }

.check {
  background: var(--blue-card);
  border: 1px solid #dbe8fb;
  border-radius: var(--radius-lg);
  padding: 14px 18px 12px;
}
.check h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-3xl);
  font-weight: 800;
}
.check-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
}
.check-sub { font-size: var(--fs-s); line-height: 1.5; color: var(--muted); }
.check-count {
  flex: none;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--white);
  border: 1px solid #dbe8fb;
  color: var(--blue-deep);
  font-size: var(--fs-s);
  font-weight: 700;
  white-space: nowrap;
}

.check-list { margin-top: 8px; display: grid; gap: 3px; }

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2.5px 10px;
  border: 1px solid #e3ecfb;
  border-radius: 9px;
  background: var(--white);
  font-size: var(--fs-base);
  line-height: 1.45;
  color: var(--text);
  cursor: pointer;
}
.check-item input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.check-item > span { cursor: default; }

.check-item .box {
  position: relative;
  flex: none;
  width: 18px; height: 18px;
  border: 1.5px solid #c3d6f0;
  border-radius: 5px;
  background: var(--white);
  transition: background .15s, border-color .15s;
  cursor: default;
}
.check-item input:checked + .box {
  background: var(--blue);
  border-color: var(--blue);
}
.check-item input:checked + .box::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid var(--ink-invert);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check-item input:checked ~ span:last-child { color: var(--faint); text-decoration: line-through; }
.check-item input:focus-visible + .box { outline: 2px solid var(--blue); outline-offset: 2px; }

.check-reset {
  margin-top: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue-deep);
  font-size: var(--fs-base);
  text-decoration: underline;
  cursor: pointer;
}
.check-reset:hover { color: var(--blue); }

/* -------------------------------------------------------------------- faq */
.faq { padding: 20px 0 22px; }

.faq h2 { margin-bottom: 10px; }

.faq-list { border-top: 1px solid var(--line); }

.faq-row {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
}
.faq-row h3 {
  font-size: var(--fs-md-lg);
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
}
.faq-row p {
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text);
  max-width: 900px;
}

/* -------------------------------------------------------------- responsive */
@media (max-width: 1240px) {
  .hero h1 { font-size: 54px; }
  .hero-media { width: 50%; }
  .topics .topic-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .latest .latest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .hero-media {
    position: relative;
    right: auto;
    width: 100%;
    height: 260px;
    order: -1;
  }
  .hero-inner { padding-top: 22px; }
  .hero-copy { max-width: none; }
  .hero h1 { font-size: 44px; }
  .pick-grid { grid-template-columns: 1fr; }
  .duo-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .hero h1 { font-size: 34px; }
  .hero-lead { font-size: var(--fs-xl); }
  .hero-media { height: 200px; }
  .topics .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .latest .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pick { grid-template-columns: 110px minmax(0, 1fr); }
  .pick-thumb img { width: 110px; height: 78px; }
  .faq-row { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 480px) {
  .topics .topic-grid { grid-template-columns: 1fr 1fr; }
  .latest .latest-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 100%; }
}
