﻿/* =======================================================================
   网易有道 · 问答社区（community）皮肤
   —— 与 faq/ 的手风琴列表风格完全不同：问题信息流卡片 + 人物 + 采纳答案
   —— 复用品牌红，但布局、组件、交互都另起一套
   ======================================================================= */
:root {
  --red: #fb4a3e; --red-dark: #e23b30; --ink: #1a1a1b; --ink-2: #2a2b2e;
  --sub: #5c6066; --gray: #939599; --line: #e6e8ea; --soft: #f6f7f9;
  --blue: #2f6bff; --green: #00a870; --amber: #f0a020; --bg: #f0f2f5;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased;
}
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); }

/* ============ 顶栏 ============ */
.top {
  position: sticky; top: 0; z-index: 100; background: #fff;
  border-bottom: 1px solid var(--line); height: 58px;
}
.top__in { max-width: 1180px; margin: 0 auto; height: 58px; display: flex; align-items: center; gap: 20px; padding: 0 20px; }
.top__logo { font-size: 20px; font-weight: 700; white-space: nowrap; }
.top__logo i { color: var(--red); font-style: normal; }
.top__logo b { font-weight: 500; color: var(--gray); font-size: 14px; margin-left: 4px; }
.top__search { flex: 1; max-width: 560px; position: relative; }
.top__search input {
  width: 100%; height: 38px; border: 1px solid var(--line); background: var(--soft);
  border-radius: 19px; padding: 0 44px 0 18px; font-size: 14px; font-family: inherit; outline: none;
}
.top__search input:focus { border-color: var(--red); background: #fff; }
.top__search button {
  position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; border: 0; cursor: pointer;
  background: var(--red); border-radius: 50%; color: #fff; font-size: 15px;
}
.top__ask {
  margin-left: auto; height: 38px; padding: 0 18px; border-radius: 19px; background: var(--red);
  color: #fff; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
}
.top__ask:hover { background: var(--red-dark); }

/* ============ 三栏布局 ============ */
.shell { max-width: 1180px; margin: 20px auto; padding: 0 20px; display: flex; gap: 20px; align-items: flex-start; }
.rail { width: 200px; flex: 0 0 200px; position: sticky; top: 78px; }
.rail__tit { font-size: 12px; color: var(--gray); font-weight: 600; letter-spacing: 1px; padding: 0 12px 8px; }
.rail a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.rail a:hover { background: #fff; }
.rail a.on { background: #fff; color: var(--red); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.rail a .n { font-size: 12px; color: var(--gray); }
.rail a.on .n { color: var(--red); }
.rail__hint { margin: 14px 12px 0; font-size: 12px; color: var(--gray); line-height: 1.7; }

.stream { flex: 1; min-width: 0; }
.side2 { width: 240px; flex: 0 0 240px; position: sticky; top: 78px; }
@media screen and (max-width: 1080px) { .side2 { display: none; } }
@media screen and (max-width: 860px) { .rail { display: none; } .shell { padding: 0 12px; } }

/* ============ 信息流：标签条 ============ */
.tabbar {
  background: #fff; border-radius: 12px; padding: 6px; display: flex; gap: 4px; margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.tabbar button {
  border: 0; background: none; font-family: inherit; font-size: 14px; color: var(--sub);
  padding: 8px 16px; border-radius: 8px; cursor: pointer;
}
.tabbar button.on { background: var(--red); color: #fff; font-weight: 500; }
.streamhd { font-size: 13px; color: var(--gray); margin: 0 4px 12px; }

/* ============ 问题卡片 ============ */
.qcard {
  background: #fff; border-radius: 12px; padding: 16px 18px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); transition: box-shadow .15s;
}
.qcard:hover { box-shadow: 0 4px 16px rgba(0,0,0,.09); }
.qcard__top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.qcard__av { width: 26px; height: 26px; border-radius: 50%; flex: 0 0 26px; }
.pavatar { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-family: sans-serif; overflow: hidden; user-select: none; }
.qcard__av.pavatar { font-size: 13px; }
.qhead__av.pavatar { font-size: 15px; }
.acard__av.pavatar { font-size: 17px; }
.qcard__who { font-size: 13px; color: var(--sub); }
.qcard__who b { color: var(--ink-2); font-weight: 500; }
.qcard__role { color: var(--gray); }
.qcard__time { margin-left: auto; font-size: 12px; color: var(--gray); }
.qcard__q { font-size: 17px; font-weight: 600; line-height: 1.5; color: var(--ink); display: block; }
.qcard:hover .qcard__q { color: var(--red); }
.qcard__excerpt {
  margin-top: 8px; font-size: 14px; color: var(--sub); line-height: 1.75;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.qcard__foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tag {
  font-size: 12px; color: var(--sub); background: var(--soft); border-radius: 6px;
  padding: 3px 10px; border: 1px solid var(--line);
}
.tag--cat { color: var(--red); background: #fff1ef; border-color: #ffd9d4; }
/* 问题头上的关键词内链 */
.qhead__tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag--link { text-decoration: none; transition: all .15s; cursor: pointer; }
.tag--link:hover { border-color: var(--red); color: var(--red); background: #fff1ef; }
.qcard__stat { margin-left: auto; display: flex; gap: 16px; font-size: 13px; color: var(--gray); }
.qcard__stat b { color: var(--ink-2); font-weight: 600; }
.solved {
  font-size: 12px; color: var(--green); font-weight: 600; display: inline-flex; align-items: center; gap: 4px;
}
.solved::before { content: "✓"; display: inline-block; width: 16px; height: 16px; line-height: 16px;
  text-align: center; background: var(--green); color: #fff; border-radius: 50%; font-size: 11px; }

/* ============ 侧栏卡片（热门话题 / 统计） ============ */
.panel { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.panel__tit { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.hot a { display: block; font-size: 13px; color: var(--ink-2); line-height: 1.55; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.hot a:last-child { border-bottom: 0; }
.hot a:hover { color: var(--red); }
.hot .rk { display: inline-block; width: 18px; color: var(--red); font-weight: 700; font-style: italic; }
.stat2 { display: flex; justify-content: space-between; text-align: center; }
.stat2 div b { display: block; font-size: 22px; color: var(--ink); font-weight: 700; }
.stat2 div span { font-size: 12px; color: var(--gray); }

/* ============ 分页 ============ */
.pg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 20px 0 10px; justify-content: center; }
.pg button {
  min-width: 36px; height: 36px; padding: 0 12px; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; font-family: inherit; font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.pg button:hover:not(:disabled):not(.cur) { border-color: var(--red); color: var(--red); }
.pg button.cur { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.pg button:disabled { color: #c4c7ca; background: var(--soft); cursor: not-allowed; }
.pg .info { color: var(--gray); font-size: 13px; margin-left: 8px; }
.empty { background: #fff; border-radius: 12px; padding: 60px; text-align: center; color: var(--gray); }
.foot { max-width: 1180px; margin: 20px auto; padding: 20px; text-align: center; font-size: 12px; color: var(--gray); line-height: 1.8; }

/* ======================================================================
   详情页（article.html）：问题头 + 采纳答案 + 其它回答
   ====================================================================== */
.detail { max-width: 820px; margin: 20px auto; padding: 0 20px; }
.crumb { font-size: 13px; color: var(--gray); margin-bottom: 14px; }
.crumb a:hover { color: var(--red); }
.crumb span { margin: 0 7px; color: #ccc; }

.qhead { background: #fff; border-radius: 14px; padding: 22px 24px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.qhead__cat { display: inline-block; font-size: 12px; color: var(--red); background: #fff1ef; border: 1px solid #ffd9d4; border-radius: 6px; padding: 3px 10px; }
.qhead__q { font-size: 24px; font-weight: 700; line-height: 1.45; margin: 12px 0; }
.qhead__meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--gray); flex-wrap: wrap; }
.qhead__av { width: 30px; height: 30px; border-radius: 50%; }
.qhead__meta b { color: var(--ink-2); font-weight: 500; }
.qhead__meta i { font-style: normal; }
.qhead__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: #ccc; }
.qhead__ex { margin-top: 14px; padding: 14px 16px; background: var(--soft); border-radius: 10px; font-size: 15px; color: var(--ink-2); line-height: 1.85; }

.anshd { display: flex; align-items: center; gap: 10px; margin: 24px 4px 12px; }
.anshd b { font-size: 17px; font-weight: 700; }
.anshd span { font-size: 13px; color: var(--gray); }

.acard { background: #fff; border-radius: 14px; padding: 20px 24px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04); position: relative; }
.acard--best { border: 1px solid #b7e6cf; box-shadow: 0 2px 12px rgba(0,168,112,.12); }
.acard__badge { position: absolute; top: -10px; left: 20px; background: var(--green); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 12px; display: inline-flex; align-items: center; gap: 5px; }
.acard__who { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.acard__av { width: 34px; height: 34px; border-radius: 50%; }
.acard__name { font-size: 14px; font-weight: 600; }
.acard__role { font-size: 12px; color: var(--gray); }
.acard__time { margin-left: auto; font-size: 12px; color: var(--gray); }

.abody { font-size: 15.5px; line-height: 1.9; color: #23262a; padding-top: 6px; }
.abody p { margin: 12px 0; }
.abody h2 { font-size: 17px; font-weight: 700; margin: 20px 0 10px; padding-left: 10px; border-left: 3px solid var(--red); }
.abody strong { font-weight: 600; color: var(--ink); }
.abody a { color: var(--blue); }
.abody ol { counter-reset: o; margin: 10px 0; }
.abody ol li { position: relative; padding-left: 30px; margin-bottom: 9px; counter-increment: o; }
.abody ol li::before { content: counter(o); position: absolute; left: 0; top: 3px; width: 20px; height: 20px; background: var(--red); color: #fff; border-radius: 50%; font-size: 12px; line-height: 20px; text-align: center; }
.abody ul li { position: relative; padding-left: 18px; margin-bottom: 8px; }
.abody ul li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
.abody figure { margin: 16px 0; background: var(--soft); border-radius: 10px; padding: 14px; text-align: center; }
.abody figure img { border-radius: 6px; }
.abody figcaption { margin-top: 10px; font-size: 12px; color: var(--gray); }
.abody .note { margin: 14px 0; padding: 12px 16px; background: #f2f7ff; border-left: 3px solid var(--blue); border-radius: 8px; font-size: 14px; color: #2c3238; }
.abody .note--warn { background: #fff7e8; border-left-color: var(--amber); }
.abody table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13.5px; }
.abody th, .abody td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.abody th { background: var(--soft); font-weight: 600; }

.acard__act { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.vote { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 16px; border: 1px solid var(--line); border-radius: 17px; font-size: 13px; color: var(--sub); cursor: pointer; background: #fff; font-family: inherit; }
.vote:hover { border-color: var(--red); color: var(--red); }
.vote.up b { color: var(--red); }
.acard__act .flat { font-size: 13px; color: var(--gray); }
.src { margin-top: 16px; font-size: 12px; color: var(--gray); }
.src a { color: var(--blue); word-break: break-all; }

.similar { background: #fff; border-radius: 14px; padding: 20px 24px; margin: 20px 0; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.similar b { font-size: 15px; font-weight: 700; }
.similar a { display: block; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 14px; color: var(--ink-2); }
.similar a:last-child { border-bottom: 0; }
.similar a:hover { color: var(--red); }
.backc { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 30px; height: 38px; padding: 0 20px; border-radius: 19px; border: 1px solid var(--line); background: #fff; font-size: 14px; color: var(--ink-2); }
.backc:hover { border-color: var(--red); color: var(--red); }

@media screen and (max-width: 640px) {
  .qhead__q { font-size: 20px; } .abody { font-size: 15px; }
}
