/* ===== 炒股干货知识库 样式 ===== */
:root {
  --red: #c0392b;
  --red-deep: #a93226;
  --gold: #f39c12;
  --ink: #2c3e50;
  --ink-light: #6b7a8d;
  --bg: #f7f8fa;
  --card: #ffffff;
  --line: #e8ecf1;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(44, 62, 80, 0.06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 16px;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ===== 头部 ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}
.logo {
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo-mark { margin-right: 4px; }
.main-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}
.main-nav a {
  color: var(--ink-light);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 14.5px;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--red); background: #fdf1ef; text-decoration: none; }
.main-nav a.active { color: #fff; background: var(--red); }
.search-box { display: flex; }
.search-box input {
  border: 1.5px solid var(--line);
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 7px 12px;
  width: 200px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.search-box input:focus { border-color: var(--red); }
.search-box button {
  border: none;
  background: var(--red);
  color: #fff;
  padding: 0 16px;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  cursor: pointer;
}
.search-box button:hover { background: var(--red-deep); }

/* ===== 广告位占位 ===== */
.ad-slot {
  background: repeating-linear-gradient(45deg, #f4f6f8, #f4f6f8 12px, #eef1f5 12px, #eef1f5 24px);
  border: 1.5px dashed #cdd6e0;
  border-radius: 8px;
  color: #9aa8b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  margin: 14px 0;
  letter-spacing: 1px;
}
.ad-banner { height: 68px; }
.ad-side { height: 220px; margin: 14px 0; }
.ad-inread { height: 90px; margin: 22px 0; }

/* ===== 首页 hero ===== */
.main-content { padding: 22px 16px 50px; }
.hero {
  background: linear-gradient(135deg, #a93226 0%, #c0392b 55%, #d35400 100%);
  border-radius: var(--radius);
  color: #fff;
  padding: 42px 34px;
  margin-bottom: 24px;
}
.hero h1 { font-size: 30px; font-weight: 800; margin-bottom: 12px; }
.hero p { max-width: 720px; opacity: .94; font-size: 15.5px; }
.hero-tags { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.35);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
}

/* ===== 分类卡片 ===== */
.home-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.cat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(192,57,43,.13); text-decoration: none; }
.cat-name { font-weight: 700; color: var(--ink); font-size: 16px; }
.cat-count { font-size: 12.5px; color: var(--ink-light); }

/* ===== 首页布局 ===== */
.home-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.section-title {
  font-size: 20px;
  border-left: 4px solid var(--red);
  padding-left: 12px;
  margin-bottom: 16px;
}

/* ===== 文章卡片 ===== */
.article-list { display: flex; flex-direction: column; gap: 14px; }
.article-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: block;
  transition: transform .15s, box-shadow .15s;
}
.article-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(44,62,80,.10); text-decoration: none; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.badge {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-cat { background: #fdf1ef; color: var(--red); border: 1px solid #f5d6d0; }
.badge-code { background: #f0f4f8; color: #5d6d7e; border: 1px solid #dfe6ed; }
.views { margin-left: auto; font-size: 12.5px; color: var(--ink-light); }
.article-card h3 { font-size: 18px; margin-bottom: 8px; line-height: 1.45; }
.article-card:hover h3 { color: var(--red); }
.summary { color: var(--ink-light); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: #9aa8b8; align-items: center; }
.tag { background: #f4f6f8; padding: 2px 8px; border-radius: 4px; color: #7b8a9d; }

/* ===== 侧栏 ===== */
.home-side, .article-side { display: flex; flex-direction: column; gap: 6px; }
.side-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.side-card h3 { font-size: 16px; margin-bottom: 12px; color: var(--ink); }
.hot-list { list-style: none; counter-reset: hot; }
.hot-list li {
  counter-increment: hot;
  padding: 8px 0 8px 30px;
  position: relative;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.hot-list li:last-child { border-bottom: none; }
.hot-list li::before {
  content: counter(hot);
  position: absolute;
  left: 0; top: 10px;
  width: 20px; height: 20px;
  background: #f4f6f8;
  color: var(--ink-light);
  border-radius: 4px;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.hot-list li:nth-child(1)::before { background: var(--red); color: #fff; }
.hot-list li:nth-child(2)::before { background: #e67e22; color: #fff; }
.hot-list li:nth-child(3)::before { background: var(--gold); color: #fff; }
.hot-views { display: block; font-size: 12px; color: #9aa8b8; }
.start-list { list-style: none; }
.start-list li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.start-list li:last-child { border-bottom: none; }

/* ===== 文章页 ===== */
.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 26px; }
.breadcrumb { font-size: 13.5px; color: var(--ink-light); margin-bottom: 14px; }
.article-main {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 34px;
  box-shadow: var(--shadow);
}
.article-title { font-size: 26px; line-height: 1.5; margin-bottom: 12px; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: #9aa8b8;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
  align-items: center;
}
.toc {
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 18px;
  margin: 18px 0;
  font-size: 14px;
}
.toc summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.toc ol { margin: 10px 0 2px 18px; color: var(--ink-light); }
.toc li { margin: 3px 0; }

.article-body { font-size: 16.5px; margin-top: 10px; }
.article-body h2 {
  font-size: 21px;
  margin: 30px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--red);
  line-height: 1.4;
}
.article-body h3 { font-size: 17.5px; margin: 22px 0 10px; color: #34495e; }
.article-body p { margin: 12px 0; }
.article-body strong { color: var(--red-deep); }
.article-body ul, .article-body ol { margin: 12px 0 12px 24px; }
.article-body li { margin: 6px 0; }
.article-body blockquote {
  border-left: 4px solid var(--gold);
  background: #fdf9f0;
  padding: 10px 16px;
  border-radius: 0 8px 8px 0;
  color: #7d6608;
  margin: 16px 0;
  font-size: 15px;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14.5px;
}
.article-body th, .article-body td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}
.article-body th { background: #f4f6f8; }
.article-body code {
  background: #f4f6f8;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 14px;
  color: #c0392b;
}
.article-body pre {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 14px 18px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 14px 0;
  font-size: 13.5px;
}
.article-body pre code { background: none; color: inherit; padding: 0; }
.article-body hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }

.article-tags { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-link { background: #fdf1ef; border: 1px solid #f5d6d0; padding: 4px 12px; border-radius: 999px; font-size: 13px; }
.tag-link:hover { background: var(--red); color: #fff; text-decoration: none; }

.article-nav {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 14px;
}
.article-nav a { max-width: 48%; }

.related { margin-top: 28px; }
.related h3 { font-size: 18px; margin-bottom: 14px; border-left: 4px solid var(--red); padding-left: 10px; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.related-card {
  background: #fafbfc; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; color: var(--ink);
}
.related-card:hover { border-color: var(--red); text-decoration: none; }
.related-card h4 { font-size: 15px; margin-bottom: 6px; color: var(--red-deep); }
.related-card p { font-size: 13px; color: var(--ink-light); }

.side-desc { font-size: 14px; color: var(--ink-light); margin-bottom: 14px; }
.btn-cat {
  display: inline-block;
  background: var(--red); color: #fff;
  padding: 8px 16px; border-radius: 8px; font-size: 14px; text-align: center;
}
.btn-cat:hover { background: var(--red-deep); color: #fff; text-decoration: none; }

/* ===== 分类/搜索/关于页 ===== */
.page-title { font-size: 24px; margin-bottom: 8px; }
.page-count { font-size: 15px; color: var(--ink-light); font-weight: 400; }
.page-desc { color: var(--ink-light); font-size: 15px; margin-bottom: 20px; }
.result-count { color: var(--ink-light); margin-bottom: 14px; font-size: 14.5px; }
.empty-tip { padding: 40px 0; text-align: center; color: var(--ink-light); }
.search-page { margin: 6px 0 20px; }
.search-page input { width: 340px; }
.about-body { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; box-shadow: var(--shadow); max-width: 860px; }
.about-body h2 { font-size: 19px; margin: 22px 0 10px; border-left: 4px solid var(--red); padding-left: 10px; }
.about-body h2:first-child { margin-top: 0; }
.about-body ul { margin: 8px 0 8px 22px; }
.about-body li { margin: 5px 0; }
.about-stats { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.about-stats li { background: #f4f6f8; padding: 6px 14px; border-radius: 8px; font-size: 14px; }
.notfound { text-align: center; padding: 80px 0; }
.notfound h1 { font-size: 60px; color: var(--red); }
.notfound p { margin: 12px 0 22px; color: var(--ink-light); }

/* ===== 页脚 ===== */
.site-footer {
  background: #2c3e50;
  color: #cfd8e0;
  margin-top: 30px;
  padding: 30px 0 26px;
  font-size: 14px;
}
.footer-cats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; }
.footer-cats a { color: #e6ecf1; font-size: 13.5px; }
.footer-cats a:hover { color: var(--gold); }
.footer-stats { margin-bottom: 8px; }
.footer-disclaimer { font-size: 13px; color: #95a5b3; margin-bottom: 10px; }
.footer-copy { font-size: 13px; }
.footer-copy a { color: #bdc9d4; }

/* ===== 响应式 ===== */
@media (max-width: 960px) {
  .home-layout, .article-layout { grid-template-columns: 1fr; }
  .article-side { order: 2; }
}
@media (max-width: 640px) {
  .header-inner { gap: 10px; }
  .search-box input { width: 130px; }
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 23px; }
  .article-main { padding: 22px 18px; }
  .article-title { font-size: 21px; }
  .related-grid { grid-template-columns: 1fr; }
  .search-page input { width: 60vw; }
}

/* ===== 资料库 ===== */
.lib-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); }
.stat-item strong { display: block; font-size: 26px; color: var(--red); }
.stat-item span { font-size: 13px; color: var(--ink-light); }
.lib-dirs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 30px; }

.file-table { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.file-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px;
  align-items: center; padding: 10px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-size: 14px;
}
.file-row:hover { border-color: var(--red); text-decoration: none; }
.fno { font-family: Consolas, monospace; color: #9aa8b8; font-size: 13px; }
.ftitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row:hover .ftitle { color: var(--red); }
.fdir, .fext, .fsize, .fviews { color: #9aa8b8; font-size: 12.5px; white-space: nowrap; }
.fext { background: #f4f6f8; padding: 1px 8px; border-radius: 4px; }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 26px 0 10px; }
.pg-btn { padding: 6px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink-light); font-size: 14px; }
.pg-btn:hover { border-color: var(--red); color: var(--red); text-decoration: none; }
.pg-current { background: var(--red); color: #fff; border-color: var(--red); }
.pg-dots { color: #9aa8b8; padding: 6px 4px; }

.kind-tabs { display: flex; gap: 8px; margin: 14px 0 18px; }
.kind-tab { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-light); font-size: 14px; }
.kind-tab:hover { text-decoration: none; color: var(--red); border-color: var(--red); }
.kind-tab.active { background: var(--red); border-color: var(--red); color: #fff; }

/* ===== 文件级资料页 ===== */
.file-head { margin-bottom: 6px; }
.global-no { font-family: Consolas, monospace; font-size: 13px; color: var(--red-deep); background: #fdf1ef; padding: 3px 12px; border-radius: 6px; border: 1px solid #f5d6d0; }
.badge-file { background: #eef7f0; color: #1e7e4a; border: 1px solid #cde8d6; }
.topic-banner { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 18px 0; }
.topic-banner p { font-size: 13.5px; color: var(--ink-light); margin: 6px 0 0; }
.topic-link { font-weight: 700; font-size: 16px; }
.file-info-card { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 18px 0; }
.file-info-card h2 { margin-top: 0; font-size: 16px; }
.file-info-card table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0; }
.file-info-card th { text-align: left; width: 100px; color: var(--ink-light); font-weight: 500; padding: 6px 10px 6px 0; vertical-align: top; }
.file-info-card td { padding: 6px 0; word-break: break-all; }
.article-body .file-info-card th, .article-body .file-info-card td { border: none; padding: 6px 10px 6px 0; }
.version-list { list-style: none; }
.version-list li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.version-list li:last-child { border-bottom: none; }
.btn-ghost { background: #fff; color: var(--red); border: 1.5px solid var(--red); margin-top: 8px; }
.btn-ghost:hover { background: #fdf1ef; }

/* ===== AI 总结与原书引导 ===== */
.ai-summary { background: #f4f9f6; border: 1px solid #d6ead9; border-radius: 10px; padding: 18px 20px; margin: 18px 0; }
.ai-summary h2 { font-size: 17px; margin: 0 0 10px; color: #1e7e4a; border-left: 4px solid #1e7e4a; padding-left: 10px; }
.ai-summary p { font-size: 15.5px; line-height: 1.85; margin: 0; }
.ai-mark { background: #1e7e4a; color: #fff; font-size: 12px; padding: 2px 7px; border-radius: 4px; margin-right: 6px; vertical-align: 2px; }
.points-box { margin-top: 14px; background: #fff; border: 1px solid #d6ead9; border-radius: 8px; padding: 10px 16px; }
.points-box summary { cursor: pointer; font-weight: 700; color: #1e7e4a; font-size: 14.5px; }
.points-box ul { margin: 10px 0 4px 20px; font-size: 14.5px; color: var(--ink); }
.points-box li { margin: 5px 0; }
.scanned-note { background: #fdf6ec; border: 1px solid #f0dfc0; border-radius: 10px; padding: 16px 20px; margin: 18px 0; }
.scanned-note strong { color: #b07d2b; }
.scanned-note p { font-size: 14.5px; color: #8a6d3b; margin: 6px 0 0; }
.original-note { background: #f4f6f8; border-radius: 8px; padding: 12px 18px; margin: 22px 0 0; font-size: 13.5px; color: var(--ink-light); }

/* ===== 首页资料库入口 ===== */
.lib-entry { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px; margin-bottom: 26px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.lib-entry-text h2 { font-size: 19px; margin-bottom: 4px; }
.lib-entry-text p { font-size: 13.5px; color: var(--ink-light); }
.lib-entry-dirs { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; justify-content: flex-end; min-width: 300px; }
.lib-chip { background: #f4f6f8; border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; font-size: 13px; color: var(--ink); }
.lib-chip em { font-style: normal; color: #9aa8b8; margin-left: 3px; }
.lib-chip:hover { border-color: var(--red); color: var(--red); text-decoration: none; }
.lib-chip-more { background: #fdf1ef; border-color: #f5d6d0; color: var(--red); }
@media (max-width: 760px) {
  .file-row { grid-template-columns: 1fr auto; }
  .fdir, .fviews { display: none; }
  .lib-entry-dirs { justify-content: flex-start; }
}
