/* fanhao common.css - extracted from 86-file main group */
:root {
  --ink: #1a2540; --muted: #5c6b8a; --bg: #ffffff; --bg-soft: #f4f7fb;
  --accent: #2563eb; --accent-soft: #dbeafe; --border: #e1e7f0; --code: #eef2f7;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; line-height: 1.7; font-size: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.sec-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.header-top { max-width: 1180px; margin: 0 auto; padding: 1rem 1.5rem; display: flex; align-items: center; gap: 1.5rem; }
.topic-brand { color: var(--accent); font-weight: 700; font-size: 1.5rem; white-space: nowrap; letter-spacing: .5px; display: inline-flex; align-items: center; gap: .25rem; text-decoration: none; }
.brand-logo { flex-shrink: 0; }
.brand-stack { display: inline-flex; flex-direction: column; line-height: 1.1; gap: 2px; }
.brand-main { font-size: 1.5rem; font-weight: 700; color: var(--accent); letter-spacing: .5px; }
.brand-tag { font-size: .68rem; font-weight: 400; color: var(--muted); letter-spacing: 1.5px; text-transform: none; }
.site-search { flex: 1; display: flex; max-width: 720px; margin: 0 auto; border: 2px solid var(--accent); border-radius: 4px; overflow: hidden; }
.search-input { flex: 1; border: none; padding: .6rem 1rem; font-size: .95rem; outline: none; background: #fff; color: #1a1a1a; }
.search-btn { background: var(--accent); color: #fff; border: none; padding: 0 1.5rem; font-size: .95rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.search-btn:hover { background: #0056b3; }
.nav-inner { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; gap: 2rem; }
.nav-tabs-bar { background: var(--accent); width: 100%; }
.nav-tabs { background: transparent; padding: 0; }
.nav-tabs .tab-item { color: #fff; padding: .5rem .95rem; text-decoration: none; font-size: .88rem; border-bottom: 2px solid transparent; }
.nav-tabs .tab-item:hover { background: rgba(255,255,255,.1); border-bottom-color: #fff; }
.nav-tabs .tab-item.active { border-bottom-color: #fff; }
.nav-primary { display: flex; gap: 1.5rem; }
.nav-primary a { color: var(--ink); }
.doc-body { max-width: 1180px; margin: 0 auto; padding: 2rem 1.5rem; display: grid; grid-template-columns: 1fr 280px; gap: 2rem; }
.article-main { min-width: 0; }
.crumb { color: var(--muted); font-size: .875rem; margin-bottom: 1rem; }
h1 { color: var(--accent); font-size: 1.875rem; line-height: 1.35; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 2px solid var(--accent-soft); }
h2 { color: var(--accent); font-size: 1.375rem; margin: 2rem 0 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--accent-soft); }
h3 { color: var(--ink); font-size: 1.125rem; margin: 1.5rem 0 .5rem; }
h4 { color: var(--ink); font-size: 1rem; margin: 1rem 0 .5rem; }
.lede { font-size: 1.05rem; background: var(--bg-soft); padding: 1rem 1.25rem; border-left: 3px solid var(--accent); border-radius: 4px; margin-bottom: 1.5rem; }
.sec p { margin: .75rem 0; }
.sec { margin: 2rem 0; }
.faq h3 { color: var(--accent); font-size: 1rem; margin-top: 1.25rem; }
.ref-block { background: var(--bg-soft); border-left: 3px solid var(--accent); padding: 1rem 1.25rem; border-radius: 4px; }
.ref-block ul { padding-left: 1.25rem; }
.ref-block li { margin: .35rem 0; }
.disclaim { background: #fff8e6; border-left: 3px solid #d4a017; padding: .75rem 1rem; border-radius: 4px; margin: 1rem 0; font-size: .92rem; color: #6a5312; }
.author-info { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .875rem; }
.topic-nav { background: var(--bg-soft); padding: 1.25rem; border-radius: 6px; border: 1px solid var(--border); height: fit-content; }
.topic-nav h4 { color: var(--accent); font-size: .95rem; margin-bottom: .75rem; }
.topic-nav ul { list-style: none; padding: 0; }
.topic-nav li { margin: .5rem 0; font-size: .9rem; }
.site-foot { border-top: 1px solid var(--border); background: var(--bg-soft); margin-top: 3rem; }
.foot-inner { max-width: 1180px; margin: 0 auto; padding: 2.5rem 1.5rem 1.5rem; }
.foot-intro { color: var(--muted); font-size: .9rem; line-height: 1.7; margin-bottom: 2rem; max-width: 720px; }
.foot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.5rem; margin-bottom: 2rem; }
.foot-col h4 { color: var(--accent); font-size: .95rem; margin-bottom: .9rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); font-weight: 600; }
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { margin: .55rem 0; }
.foot-col a { color: var(--muted); font-size: .875rem; display: inline-block; line-height: 1.4; }
.foot-col a:hover { color: var(--accent); }
.foot-copy { border-top: 1px solid var(--border); padding-top: 1.25rem; color: var(--muted); font-size: .8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.cmp-table { width: 100%; border-collapse: collapse; margin: 1rem 0 .5rem; font-size: .94rem; }
.cmp-table th, .cmp-table td { border: 1px solid var(--border); padding: .55rem .75rem; text-align: left; vertical-align: top; }
.cmp-table thead th { background: var(--bg-soft); color: var(--accent); font-weight: 600; }
.cmp-table code { background: var(--code); padding: 1px 4px; border-radius: 3px; font-size: .88em; }
.badge { display: inline-block; background: var(--accent-soft); color: var(--accent); padding: 1px 8px; border-radius: 10px; font-size: .82em; margin: 0 3px; font-weight: 500; letter-spacing: .2px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; } .foot-copy { flex-direction: column; gap: .5rem; } }
@media (max-width: 820px) {
  .doc-body { grid-template-columns: 1fr; }
  .topic-nav { position: static; }
  .nav-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .nav-primary { flex-wrap: wrap; }
}
  
/* mobile-h5-patch v1 */
img, video { max-width: 100%; height: auto; }
pre, code { word-break: break-word; overflow-wrap: anywhere; }
.doc-body a { word-break: break-word; }
@media (max-width: 820px) {
  .doc-body { padding: 1.25rem 1rem; gap: 1.25rem; }
  .nav-inner, .foot-inner { padding-left: 1rem; padding-right: 1rem; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
  h3 { font-size: 1.05rem; }
  .lede { font-size: 1rem; padding: .85rem 1rem; }
  .topic-nav a, .foot-col a, .pillar-nav a { display: inline-block; min-height: 32px; line-height: 1.7; padding: 3px 0; }
  .cmp-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .pillar-nav ol { column-count: 1; }
}
@media (max-width: 520px) {
  body { font-size: 15px; }
  .doc-body { padding: 1rem .85rem; }
  h1 { font-size: 1.3rem; line-height: 1.35; }
  h2 { font-size: 1.1rem; }
  .foot-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .nav-inner { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .75rem 1rem; }
  .badge { margin: 2px 3px; }
}
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.title-row h1 { margin: 0; flex: 1; min-width: 240px; }
.page-actions { display: flex; gap: .5rem; align-items: center; flex-shrink: 0; padding-top: .35rem; }
.pa-btn { display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .7rem; border: 1px solid var(--border); background: var(--bg-soft); border-radius: 16px; color: var(--muted); font-size: .82rem; cursor: pointer; transition: all .15s; font-family: inherit; }
.pa-btn:hover { color: var(--accent); border-color: var(--accent); background: #fff; }
.pa-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.pa-btn svg { flex-shrink: 0; }
.side-col { align-self: start; position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.author-card { padding: 1rem 1.1rem; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; gap: .85rem; }
.author-avatar { position: relative; flex-shrink: 0; }
.author-avatar .verified-badge { position: absolute; right: -2px; bottom: -2px; }
.author-meta { min-width: 0; flex: 1; }
.author-name { font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.author-role { font-size: .78rem; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.author-stat { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.author-stat b { color: var(--text); font-weight: 600; }
@media (max-width: 640px) { .author-card { float: none; width: 100%; margin: 0 0 1rem; } }

/* title-row full-width divider — 覆盖 h1 自身 border */
.title-row { border-bottom: 2px solid var(--accent-soft); padding-bottom: .75rem; margin-bottom: 1rem; }
.title-row h1 { border-bottom: none !important; padding-bottom: 0 !important; margin-bottom: 0 !important; }

/* prevent article overflow — Chinese long-sentence break-safety */
.doc-body { overflow-wrap: anywhere; }
.article-main { min-width: 0; overflow-wrap: anywhere; word-wrap: break-word; max-width: 100%; }
.article-main p, .article-main .lede { word-break: normal; overflow-wrap: anywhere; max-width: 100%; }

/* topic-brand no hover underline */
.topic-brand, .topic-brand:hover, .topic-brand *, .topic-brand:hover * { text-decoration: none !important; }

/* mobile nav-tabs 保持横排（不受 nav-inner column 影响） */
@media (max-width: 820px) {
  .nav-inner.nav-tabs { flex-direction: row !important; flex-wrap: wrap; gap: 0 !important; padding: 0 !important; align-items: stretch !important; }
  .nav-tabs .tab-item { flex: 1 1 auto; text-align: center; min-width: 60px; padding: .65rem .5rem; font-size: .9rem; }
}
@media (max-width: 520px) {
  .nav-inner.nav-tabs { padding: 0 !important; }
  .nav-tabs .tab-item { font-size: .82rem; padding: .55rem .35rem; min-width: 50px; }
}

/* mobile H5 补丁 v2: 搜索框收窄 + header 紧凑 */
@media (max-width: 640px) {
  .header-top { flex-direction: column; align-items: stretch; gap: .75rem; padding: .85rem 1rem; }
  .site-search { max-width: 100%; }
  .search-input { padding: .55rem .75rem; font-size: .9rem; }
  .search-btn { padding: 0 .85rem; font-size: .85rem; }
  .topic-brand { justify-content: center; }
  .brand-main { font-size: 1.2rem; }
  .brand-tag { font-size: .62rem; }
}
@media (max-width: 520px) {
  .header-top { padding: .65rem .75rem; gap: .5rem; }
  .brand-logo { width: 48px !important; height: 48px !important; }
  .brand-main { font-size: 1.05rem; }
  .search-btn { padding: 0 .7rem; font-size: .82rem; }
  h1 { font-size: 1.35rem !important; }
  .title-row { flex-wrap: wrap; }
  .page-actions { width: 100%; margin-top: .35rem; }
  .lede { padding: .8rem 1rem; font-size: .95rem; }
}

/* nav tabs 缩小 v3: 桌面 + 移动都收窄 */
.nav-tabs .tab-item { padding: .4rem .75rem !important; font-size: .82rem !important; border-bottom-width: 2px !important; }
@media (max-width: 820px) {
  .nav-tabs .tab-item { padding: .35rem .4rem !important; font-size: .78rem !important; min-width: 48px !important; }
}
@media (max-width: 520px) {
  .nav-tabs .tab-item { padding: .3rem .25rem !important; font-size: .72rem !important; min-width: 42px !important; }
}

/* search box 强制固定宽度，跨页面一致（无论 input 值多长） */
.site-search { flex: 1 1 auto !important; width: 100%; max-width: 720px !important; min-width: 260px; }
.search-input { width: 100%; min-width: 0; }
