﻿/* =======================================================================
   网易有道 · 常见问题（FAQ）样式
   —— 设计口径沿用 youdao/style.css 的既有变量：
      品牌红 #fb4a3e / 正文墨色 #101214 / 次级灰 #939599 / 浅底 #f5f6f7
      字体族 Poppins + PingFang SC
   —— 列表页（index.html）：外层只出摘要，短
   —— 详情页（article.html）：完整正文 + 配图 + 来源
   —— 顶部深色信息条复刻参考图：圆形返回键 +「发布时间：… 访问量：…」
   ======================================================================= */

:root {
  --red: #fb4a3e;
  --red-dark: #e23b30;
  --ink: #101214;
  --ink-2: #2a2b2e;
  --sub: #5c6066;
  --gray: #939599;
  --line: #e8eaec;
  --line-2: #f0f1f2;
  --soft: #f5f6f7;
  --blue: #2f6bff;
}

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

html { scroll-behavior: smooth; }

body {
  background: #fff;
  color: var(--ink);
  font-family: Poppins, "PingFang SC", "Microsoft YaHei", -apple-system,
               BlinkMacSystemFont, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { border: 0; max-width: 100%; }

/* 无障碍：仅供读屏的文本 / 跳转链接 */
.hide {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip_link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 10px 16px; z-index: 1000;
}
.skip_link:focus { left: 0; }

/* ============ 容器 ============ */
.wrap { min-width: 960px; width: 72%; margin: 0 auto; }
@media screen and (min-width: 960px)  and (max-width: 1360px) { .wrap { width: 79%; } }
@media screen and (min-width: 1360px) and (max-width: 1440px) { .wrap { width: 63%; } }
@media screen and (min-width: 1440px) { .wrap { width: 62.5%; } }

/* ============ 顶栏（复用官网 70px 固定头的观感） ============ */
.hd {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 900;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-2);
}
.hd__inner {
  display: flex; align-items: center; height: 70px;
  min-width: 960px; width: 72%; margin: 0 auto;
}
@media screen and (min-width: 960px)  and (max-width: 1360px) { .hd__inner { width: 79%; } }
@media screen and (min-width: 1360px) and (max-width: 1440px) { .hd__inner { width: 63%; } }
@media screen and (min-width: 1440px) { .hd__inner { width: 62.5%; } }

.hd__logo {
  font-size: 21px; font-weight: 600; letter-spacing: -.5px;
  color: var(--ink); margin-right: 38px; white-space: nowrap;
}
.hd__logo i { color: var(--red); font-style: normal; }
.hd__nav { display: flex; gap: 34px; white-space: nowrap; }
.hd__nav a { font-size: 16px; font-weight: 500; color: var(--ink); }
.hd__nav a:hover { color: var(--red); }
.hd__nav a.current { color: var(--red); font-weight: 600; }
.hd__spacer { flex: 1; }
.hd__back { font-size: 15px; color: var(--sub); white-space: nowrap; }
.hd__back:hover { color: var(--red); }
/* ============ 列表页头图 ============ */
.hero {
  padding: 132px 0 40px;
  text-align: center;
  background:
    radial-gradient(900px 260px at 50% -40px, #fff1ef 0%, rgba(255,255,255,0) 70%),
    linear-gradient(180deg, #fbfcfd 0%, #fff 100%);
  border-bottom: 1px solid var(--line-2);
}
.hero__tit {
  font-size: 40px; font-weight: 600; line-height: 1.25; letter-spacing: -1px;
}
.hero__tit em { color: var(--red); font-style: normal; }
.hero__desc {
  margin: 14px auto 0; max-width: 720px;
  font-size: 16px; color: var(--sub);
}

/* 搜索框 */
.search {
  position: relative; margin: 28px auto 0;
  max-width: 620px; display: flex; align-items: center;
  border: 2px solid var(--ink); border-radius: 30px;
  padding: 4px 4px 4px 22px; background: #fff;
}
.search__input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 16px; color: var(--ink); height: 46px;
  font-family: inherit;
}
.search__input::placeholder { color: #b6b9bd; }
.search__btn {
  border: 0; cursor: pointer; background: var(--red); color: #fff;
  font-size: 15px; font-weight: 500; font-family: inherit;
  height: 46px; padding: 0 30px; border-radius: 26px;
}
.search__btn:hover { background: var(--red-dark); }
.search__count {
  position: absolute; left: 0; bottom: -30px;
  font-size: 13px; color: var(--gray);
}
/* ============ 主体两栏 ============ */
.main {
  display: flex; align-items: flex-start; gap: 46px;
  min-width: 960px; width: 72%; margin: 44px auto 90px;
}
@media screen and (min-width: 960px)  and (max-width: 1360px) { .main { width: 79%; } }
@media screen and (min-width: 1360px) and (max-width: 1440px) { .main { width: 63%; } }
@media screen and (min-width: 1440px) { .main { width: 62.5%; } }

/* 左侧分类 */
.side { position: sticky; top: 96px; width: 216px; flex: 0 0 216px; }
.side__tit {
  font-size: 13px; font-weight: 600; color: var(--gray);
  letter-spacing: 1px; margin-bottom: 12px;
}
.side__nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; margin-bottom: 4px; border-radius: 10px;
  font-size: 15px; color: var(--ink-2); cursor: pointer;
}
.side__nav a:hover { background: var(--soft); }
.side__nav a.active { background: #fff1ef; color: var(--red); font-weight: 600; }
.side__num {
  font-size: 12px; color: var(--gray); background: var(--soft);
  border-radius: 20px; padding: 1px 8px; min-width: 26px; text-align: center;
}
.side__nav a.active .side__num { background: #ffe1de; color: var(--red); }

.side__hint {
  margin-top: 22px; padding: 14px; border-radius: 10px;
  background: var(--soft); font-size: 12px; color: var(--gray); line-height: 1.7;
}

.content { flex: 1; min-width: 0; }
/* ============ 分组标题 ============ */
.group { margin-bottom: 40px; }
.group__tit {
  font-size: 20px; font-weight: 600; padding-bottom: 12px;
  border-bottom: 2px solid var(--ink); margin-bottom: 6px;
}
.group__tit em {
  font-style: normal; font-size: 13px; font-weight: 400;
  color: var(--gray); margin-left: 10px;
}

/* ============ 手风琴问答 ============ */
.qa { border-bottom: 1px solid var(--line); }
.qa__q {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  background: none; border: 0; cursor: pointer; text-align: left;
  padding: 18px 4px; font-family: inherit;
}
.qa__q:hover .qa__qtext { color: var(--red); }
.qa__idx {
  flex: 0 0 24px; height: 24px; border-radius: 6px; background: var(--soft);
  color: var(--gray); font-size: 12px; line-height: 24px; text-align: center;
  margin-top: 2px;
}
.qa.open .qa__idx { background: var(--red); color: #fff; }
.qa__qtext {
  flex: 1; font-size: 17px; font-weight: 500; color: var(--ink); line-height: 1.6;
}
.qa.open .qa__qtext { color: var(--red); }
.qa__arrow {
  flex: 0 0 16px; height: 16px; margin-top: 8px; position: relative;
}
.qa__arrow::before, .qa__arrow::after {
  content: ""; position: absolute; background: var(--gray);
  transition: transform .22s, opacity .22s;
}
.qa__arrow::before { left: 0; top: 7px; width: 16px; height: 2px; }
.qa__arrow::after  { left: 7px; top: 0; width: 2px; height: 16px; }
.qa.open .qa__arrow::before { background: var(--red); }
.qa.open .qa__arrow::after  { opacity: 0; transform: rotate(90deg); }
/* 折叠体：默认收起 */
.qa__body { display: none; padding: 0 4px 22px 40px; }
.qa.open .qa__body { display: block; }

/* 外层「发布时间：… 访问量：…」信息条 —— 参考图同款字段 */
.qa__pub {
  display: flex; align-items: center; gap: 18px;
  font-size: 13px; color: var(--gray); margin-bottom: 12px;
}
.qa__pub b { font-weight: 400; }
.qa__pub .dot {
  width: 3px; height: 3px; border-radius: 50%; background: #d0d3d6;
}

.qa__summary { font-size: 15px; color: var(--ink-2); line-height: 1.85; }
.qa__summary strong { font-weight: 600; color: var(--ink); }

.qa__points { margin: 12px 0 0; }
.qa__points li {
  position: relative; padding-left: 18px; margin-bottom: 6px;
  font-size: 14px; color: var(--sub);
}
.qa__points li::before {
  content: ""; position: absolute; left: 4px; top: 10px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--red);
}

.qa__foot { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.qa__more {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 20px; border-radius: 20px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 500;
}
.qa__more:hover { background: var(--red); }
.qa__more::after { content: "›"; font-size: 16px; line-height: 1; }
.qa__meta { font-size: 13px; color: var(--gray); }

.empty {
  padding: 60px 0; text-align: center; color: var(--gray); font-size: 15px;
}

/* ============ 分页控件 ============ */
.pager2 {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line);
}
.pg__b {
  min-width: 38px; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  font-family: inherit; font-size: 14px; color: var(--ink-2); cursor: pointer;
  transition: all .15s;
}
.pg__b:hover:not(:disabled):not(.cur) { border-color: var(--red); color: var(--red); }
.pg__b.cur { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; cursor: default; }
.pg__b:disabled { color: #c4c7ca; cursor: not-allowed; background: var(--soft); }
.pg__dot { color: var(--gray); padding: 0 2px; }
.pg__info { margin-left: auto; font-size: 13px; color: var(--gray); }
@media screen and (max-width: 960px) {
  .pg__info { width: 100%; margin: 8px 0 0; text-align: center; }
}
/* =======================================================================
   详情页（article.html）
   ======================================================================= */

/* ---- 深色信息条：复刻参考图（居中「发布时间：… 访问量：…」+ 左侧圆形返回键） ---- */
.pubbar {
  position: relative; margin-top: 70px;
  background: #000; color: #6b7075;
  padding: 26px 0; text-align: center;
}
.pubbar__meta {
  font-size: 22px; line-height: 1.4; letter-spacing: .5px;
  color: #5b6165; font-weight: 400;
}
.pubbar__meta span { margin-left: 22px; }
.pubbar__back {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #e7e9ea;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1;
}
.pubbar__back:hover { background: rgba(255, 255, 255, .3); }

@media screen and (max-width: 1200px) {
  .pubbar__meta { font-size: 17px; }
}

/* 面包屑 */
.crumb {
  min-width: 960px; width: 72%; margin: 22px auto 0;
  font-size: 13px; color: var(--gray);
}
@media screen and (min-width: 960px)  and (max-width: 1360px) { .crumb { width: 79%; } }
@media screen and (min-width: 1360px) and (max-width: 1440px) { .crumb { width: 63%; } }
@media screen and (min-width: 1440px) { .crumb { width: 62.5%; } }
.crumb a:hover { color: var(--red); }
.crumb span { margin: 0 8px; color: #d0d3d6; }
/* 正文 + 目录 两栏 */
.art_wrap {
  display: flex; align-items: flex-start; gap: 52px;
  min-width: 960px; width: 72%; margin: 22px auto 90px;
}
@media screen and (min-width: 960px)  and (max-width: 1360px) { .art_wrap { width: 79%; } }
@media screen and (min-width: 1360px) and (max-width: 1440px) { .art_wrap { width: 63%; } }
@media screen and (min-width: 1440px) { .art_wrap { width: 62.5%; } }

.art { flex: 1; min-width: 0; }

.art__hd { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.art__cat {
  display: inline-block; font-size: 13px; color: var(--red);
  background: #fff1ef; border-radius: 20px; padding: 4px 14px; margin-bottom: 16px;
}
.art__tit {
  font-size: 32px; font-weight: 600; line-height: 1.4; letter-spacing: -.5px;
}
.art__info {
  margin-top: 14px; font-size: 13px; color: var(--gray);
}
.art__info i { font-style: normal; margin: 0 8px; color: #d0d3d6; }

/* 导语 */
.art__lead {
  margin: 24px 0 0; padding: 20px 22px; border-radius: 12px;
  background: var(--soft); border-left: 3px solid var(--red);
  font-size: 16px; line-height: 1.9; color: var(--ink-2);
}
.art__lead strong { font-weight: 600; color: var(--ink); }

/* 目录 */
.toc { position: sticky; top: 96px; width: 214px; flex: 0 0 214px; }
.toc__tit {
  font-size: 13px; font-weight: 600; color: var(--gray);
  letter-spacing: 1px; margin-bottom: 10px;
}
.toc__nav a {
  display: block; padding: 7px 0 7px 14px; font-size: 13px; line-height: 1.6;
  color: var(--sub); border-left: 2px solid var(--line);
}
.toc__nav a:hover { color: var(--red); }
.toc__nav a.active {
  color: var(--red); border-left-color: var(--red); font-weight: 500;
}
/* ---- 正文排版 ---- */
.art__body { font-size: 16px; line-height: 1.95; color: #23262a; }
.art__body h2 {
  font-size: 23px; font-weight: 600; color: var(--ink);
  margin: 44px 0 14px; padding-left: 14px; border-left: 4px solid var(--red);
  line-height: 1.4; scroll-margin-top: 90px;
}
.art__body h3 {
  font-size: 18px; font-weight: 600; color: var(--ink); margin: 28px 0 10px;
}
.art__body p { margin-bottom: 16px; }
.art__body strong { font-weight: 600; color: var(--ink); }
.art__body a { color: var(--blue); border-bottom: 1px solid #cddaff; }
.art__body a:hover { color: var(--red); border-bottom-color: #ffc9c4; }

.art__body ul, .art__body ol { margin: 0 0 18px; }
.art__body ul li {
  position: relative; padding-left: 20px; margin-bottom: 9px;
}
.art__body ul li::before {
  content: ""; position: absolute; left: 5px; top: 13px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--red);
}
.art__body ol { counter-reset: ol; }
.art__body ol li {
  position: relative; padding-left: 30px; margin-bottom: 9px; counter-increment: ol;
}
.art__body ol li::before {
  content: counter(ol); position: absolute; left: 0; top: 5px;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-size: 12px; line-height: 21px; text-align: center;
}

/* 段内小标记 */
.unverified {
  display: inline-block; font-size: 12px; color: #b06a00;
  background: #fff6e5; border-radius: 4px; padding: 0 6px; margin: 0 2px;
  vertical-align: 1px;
}
/* 配图 */
.figure {
  margin: 26px 0; padding: 18px; border-radius: 14px;
  background: var(--soft); text-align: center;
}
.figure img {
  max-width: 100%; border-radius: 8px; display: inline-block;
  background: #fff;
}
.figure figcaption {
  margin-top: 12px; font-size: 13px; color: var(--gray); line-height: 1.7;
}

/* 提示块 */
.note {
  margin: 22px 0; padding: 16px 18px; border-radius: 10px;
  background: #f2f7ff; border-left: 3px solid var(--blue);
  font-size: 14.5px; line-height: 1.85; color: #2c3238;
}
.note--warn { background: #fff7e8; border-left-color: #f0a020; }

/* 表格 */
.tbl_wrap { overflow-x: auto; margin: 22px 0; }
.tbl {
  width: 100%; border-collapse: collapse; font-size: 14px;
  border: 1px solid var(--line);
}
.tbl th, .tbl td {
  border: 1px solid var(--line); padding: 11px 14px;
  text-align: left; vertical-align: top; line-height: 1.7;
}
.tbl th { background: var(--soft); font-weight: 600; white-space: nowrap; }
.tbl tbody tr:nth-child(2n) td { background: #fcfcfd; }

/* 引文 */
.quote {
  margin: 22px 0; padding: 14px 20px; border-left: 3px solid var(--line);
  color: var(--sub); font-size: 15px; line-height: 1.9;
}
.quote cite { display: block; margin-top: 8px; font-size: 13px; color: var(--gray); font-style: normal; }
/* 资料来源 */
.sources { margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line); }
.sources__tit { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.sources ol { counter-reset: s; }
.sources li {
  position: relative; padding-left: 26px; margin-bottom: 8px;
  counter-increment: s; font-size: 13.5px; color: var(--sub); line-height: 1.75;
}
.sources li::before {
  content: "[" counter(s) "]"; position: absolute; left: 0; top: 0;
  color: var(--gray); font-size: 12px;
}
.sources a { color: var(--blue); word-break: break-all; }
.sources a:hover { color: var(--red); }

/* 关键词内链（相关话题） */
.taglinks { margin-top: 30px; font-size: 13px; color: var(--gray); }
.taglinks__a {
  display: inline-block; margin: 4px 6px 0 0; padding: 4px 12px;
  border: 1px solid var(--line); border-radius: 16px; font-size: 13px;
  color: var(--ink-2); background: #fff; text-decoration: none;
}
.taglinks__a:hover { border-color: var(--red); color: var(--red); }
.taglinks__cat { color: var(--red); border-color: #ffd4cf; background: #fff5f3; }

/* 相关问题 */
.related { margin-top: 40px; }
.related__tit { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.related__list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.related__item {
  display: block; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; color: var(--ink-2); line-height: 1.6;
}
.related__item:hover { border-color: var(--red); color: var(--red); }

/* 上下篇 */
.pager {
  display: flex; justify-content: space-between; gap: 20px;
  margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 14px;
}
.pager a, .pager span { max-width: 46%; color: var(--sub); line-height: 1.6; }
.pager a:hover { color: var(--red); }
.pager span { color: #c4c7ca; }
.pager a:last-child, .pager span:last-child { text-align: right; }

/* 返回列表按钮（正文底部） */
.backlist {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 30px;
  height: 38px; padding: 0 22px; border-radius: 20px;
  border: 1px solid var(--line); font-size: 14px; color: var(--ink-2);
}
.backlist:hover { border-color: var(--red); color: var(--red); }
/* ============ 页脚（沿用官网灰底口径） ============ */
.ft {
  background: var(--soft); color: var(--gray);
  font-size: 13px; line-height: 1.9; text-align: center;
  padding: 34px 20px 40px; margin-top: 40px;
}
.ft p { max-width: 900px; margin: 0 auto; }
.ft a { color: var(--gray); text-decoration: underline; }
.ft a:hover { color: var(--red); }
.ft__legal { margin-top: 10px; color: #b0b3b6; }

/* ============ 窄屏兜底：官网本身 min-width:960px，这里做基本可读处理 ============ */
@media screen and (max-width: 960px) {
  .wrap, .hd__inner, .main, .art_wrap, .crumb {
    min-width: 0; width: auto; padding-left: 18px; padding-right: 18px;
  }
  .main, .art_wrap { flex-direction: column; gap: 26px; }
  .side, .toc { position: static; width: auto; flex: none; }
  .hero { padding: 100px 18px 32px; }
  .hero__tit { font-size: 28px; }
  .art__tit { font-size: 24px; }
  .related__list { grid-template-columns: 1fr; }
  .pubbar__meta { font-size: 15px; }
  .qa__body { padding-left: 4px; }
}

/* 打印：只留正文 */
@media print {
  .hd, .toc, .pager, .related, .pubbar__back, .ft { display: none; }
  .art_wrap { width: auto; min-width: 0; }
  .pubbar { background: #fff; color: #000; padding: 8px 0; }
  .pubbar__meta { color: #444; font-size: 13px; }
}
