/* 知学在线 - 前端样式（无外部依赖） */
:root {
  --brand: #5b6ef5; --brand-2: #8b5cf6; --ink: #1f2430; --muted: #6b7280;
  --line: #e5e7eb; --bg: #f7f8fb; --card: #ffffff; --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif; color: var(--ink); background: var(--bg); line-height: 1.75; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); font-size: 14px; }

/* 头部 */
.site-header { background: linear-gradient(120deg, var(--brand), var(--brand-2)); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(91,110,245,.25); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { color: #fff; font-weight: 700; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; }
.logo-mark { background: rgba(255,255,255,.2); border-radius: 8px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.main-nav a { color: rgba(255,255,255,.92); margin-left: 22px; font-size: 15px; }
.main-nav a:hover { color: #fff; text-decoration: none; }
.nav-toggle { display: none; background: rgba(255,255,255,.15); color: #fff; border: 0; font-size: 18px; border-radius: 8px; padding: 4px 12px; }

/* 首页 */
.hero { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 28px; margin: 24px 0; }
.hero h1 { font-size: 28px; color: var(--brand); margin-bottom: 8px; }
.hero p { color: var(--muted); }
.layout-2col { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.feed-title { font-size: 20px; margin-bottom: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 8px 24px rgba(31,36,48,.08); transform: translateY(-2px); }
.card-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.card-title { font-size: 19px; line-height: 1.4; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--brand); text-decoration: none; }
.card-desc { color: var(--muted); font-size: 14.5px; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chip { background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); font-size: 12.5px; padding: 3px 12px; border-radius: 999px; font-weight: 600; }
.tags span { color: var(--brand-2); font-size: 13px; margin-right: 8px; }
.sidebar .side-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.side-box h3 { font-size: 15px; margin-bottom: 10px; color: var(--ink); }
.cat-list { list-style: none; }
.cat-list li { padding: 7px 0; border-bottom: 1px dashed var(--line); display: flex; flex-direction: column; }
.cat-list li:last-child { border-bottom: 0; }
.cat-list .muted { font-size: 12.5px; }
.cat-list.plain a { color: var(--muted); }

/* 面包屑 */
.breadcrumb { color: var(--muted); font-size: 13.5px; padding: 18px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb .current { color: var(--ink); }

/* 文章 */
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 38px; margin: 16px 0 30px; }
.post-header { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 24px; }
.post-title { font-size: 28px; line-height: 1.35; margin: 10px 0; }
.post-meta { color: var(--muted); font-size: 13.5px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.post-lede { margin-top: 14px; background: color-mix(in srgb, var(--brand) 7%, white); border-left: 3px solid var(--brand); padding: 12px 16px; border-radius: 0 8px 8px 0; color: #444; font-size: 15px; }
.post-body { font-size: 16.5px; }
.post-body p { margin: 0 0 18px; }
.post-body h2 { font-size: 21px; margin: 30px 0 14px; padding-left: 12px; border-left: 4px solid var(--brand); line-height: 1.4; }
.post-body h3 { font-size: 18px; margin: 24px 0 12px; color: var(--brand); }
.post-body ul, .post-body ol { margin: 0 0 18px 26px; }
.post-body li { margin-bottom: 8px; }
.post-body blockquote { background: var(--bg); border-left: 4px solid var(--brand-2); padding: 12px 18px; border-radius: 0 8px 8px 0; color: #555; margin: 0 0 18px; }
.post-body code { background: #eef0f6; border-radius: 4px; padding: 1px 6px; font-size: 14px; }
.post-body figure { margin: 22px 0; }
.post-figure img { max-width: 100%; border-radius: 10px; display: block; margin: 0 auto; }
.post-figure figcaption { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }
.video-box { position: relative; padding-top: 56.25%; background: #000; border-radius: 10px; overflow: hidden; }
.video-box iframe, .video-box video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.table-wrap { overflow-x: auto; margin: 20px 0; }
.post-body table { border-collapse: collapse; width: 100%; font-size: 15px; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 9px 13px; text-align: left; }
.post-body th { background: var(--bg); }

/* 核心要点框（GEO 重点） */
.key-points { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 8%, white), color-mix(in srgb, var(--brand-2) 6%, white)); border: 1px solid color-mix(in srgb, var(--brand) 25%, white); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 22px; }
.key-points h2 { font-size: 15px; color: var(--brand); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.key-points h2::before { content: "✦"; }
.key-points ul { margin-left: 20px; }
.key-points li { margin-bottom: 6px; color: #374151; }

/* 文章目录 */
.toc { background: var(--card); border: 1px dashed color-mix(in srgb, var(--brand) 40%, white); border-radius: var(--radius); padding: 16px 22px; margin: 0 0 24px; }
.toc-title { font-weight: 700; font-size: 14.5px; color: var(--brand); margin-bottom: 8px; }
.toc ol { margin: 0 0 0 20px; font-size: 14.5px; }
.toc li { margin-bottom: 4px; }
.post-body h2 { scroll-margin-top: 76px; }

/* 作者落款（E-E-A-T） */
.author-box { display: flex; gap: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 26px 0 0; }
.author-avatar { width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.author-info b { font-size: 14.5px; }
.author-info p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }

/* 标签 & 上下篇 */
.post-tags { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 16px; }
.tag-link { display: inline-block; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: 13.5px; color: var(--muted); margin: 0 8px 8px 0; }
.tag-link:hover { color: var(--brand); border-color: var(--brand); text-decoration: none; }
.pn-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.pn { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; min-height: 62px; }
.pn span { color: var(--muted); font-size: 12px; }
.pn b { font-size: 14px; color: var(--ink); font-weight: 600; }
a.pn:hover { border-color: var(--brand); text-decoration: none; }
a.pn:hover b { color: var(--brand); }
.pn.next { text-align: right; }

/* 搜索 */
.search-form { display: flex; gap: 10px; margin-top: 12px; }
.search-form input { flex: 1; }
.header-search input { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); border-radius: 999px; color: #fff; padding: 6px 14px; font-size: 13px; width: 130px; }
.header-search input::placeholder { color: rgba(255,255,255,.7); }

@media (max-width: 860px) {
  .header-search { display: none; }
  .pn-nav { grid-template-columns: 1fr; }
}
.faq-box { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 26px 0; }
.faq-box h2 { border: 0; padding: 0; margin: 0 0 12px; font-size: 19px; }
.faq-box details { border-bottom: 1px dashed var(--line); padding: 10px 0; }
.faq-box details:last-child { border-bottom: 0; }
.faq-box summary { cursor: pointer; font-weight: 600; }
.faq-box .faq-a { color: #555; padding: 8px 0 2px 8px; }
.related { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; }
.related h2 { font-size: 18px; margin-bottom: 10px; }
.related ul { list-style: none; }
.related li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.related li:last-child { border-bottom: 0; }
.related time { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* 分类头 & 404 */
.cat-head { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; margin: 16px 0; }
.cat-head h1 { font-size: 24px; }
.cat-head p { color: var(--muted); margin-top: 6px; }
.notfound { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 60px 20px; margin: 24px 0; }
.notfound h1 { font-size: 64px; color: var(--brand); }
.btn { display: inline-block; background: var(--card); border: 1px solid var(--line); color: var(--ink); padding: 9px 18px; border-radius: 9px; font-size: 14.5px; cursor: pointer; }
.btn:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 页脚 */
.site-footer { background: #232937; color: #aab1c2; margin-top: 40px; padding: 34px 0 0; font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; padding-bottom: 22px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.footer-links a { color: #aab1c2; }
.footer-links a:hover { color: #fff; }
.copyright { border-top: 1px solid #323a4d; padding: 14px 20px; text-align: center; font-size: 13px; }

/* 响应式 */
@media (max-width: 860px) {
  .layout-2col { grid-template-columns: 1fr; }
  .post { padding: 24px 18px; }
  .main-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--brand); flex-direction: column; padding: 10px 20px 16px; }
  .main-nav a { display: block; margin: 8px 0; }
  .nav-open .main-nav { display: flex; }
  .nav-toggle { display: block; }
}
