/* 炒股百科 v3 — 全新设计 */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text2: #64748b;
  --text3: #94a3b8;
  --border: #e2e8f0;
  --accent: #e53e3e;
  --accent2: #f56565;
  --blue: #3b82f6;
  --green: #10b981;
  --orange: #f59e0b;
  --side-w: 280px;
  --hd-h: 60px;
  --radius: 10px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Header === */
.hd {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--hd-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.logo {
  font-size: 20px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo .sub { font-size: 12px; color: var(--text3); font-weight: 400; margin-left: 4px; }
.hd-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.search-box {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; width: 240px; outline: none; transition: border .2s;
}
.search-box:focus { border-color: var(--blue); }
.search-btn {
  background: var(--card); border: 1px solid var(--border); border-left: none;
  border-radius: 0 8px 8px 0; padding: 8px 12px; cursor: pointer; font-size: 16px;
  margin-left: -1px; transition: background .2s;
}
.search-btn:hover { background: #f1f5f9; }
.btn-qh {
  background: linear-gradient(135deg, #e53e3e, #f56565);
  color: #fff !important; padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: opacity .2s;
}
.btn-qh:hover { text-decoration: none !important; opacity: .85; }

/* === Hero (首页) === */
.hero {
  margin-top: var(--hd-h);
  padding: 60px 24px 40px;
  text-align: center;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #fff;
}
.hero h1 { font-size: 32px; margin-bottom: 12px; }
.hero p { font-size: 16px; color: #cbd5e1; max-width: 600px; margin: 0 auto 20px; }
.hero .stats {
  display: inline-flex; gap: 20px;
  background: rgba(255,255,255,.1); padding: 10px 28px; border-radius: 30px;
  font-size: 14px; color: #f1f5f9;
}

/* === Parts Grid (首页) === */
.parts {
  max-width: 1200px; margin: 0 auto; padding: 32px 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.ch-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: box-shadow .2s, transform .15s;
  display: block; color: var(--text);
}
.ch-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.08); transform: translateY(-2px); text-decoration: none; }
.ch-badge { font-size: 12px; color: var(--text3); }
.ch-card h3 { font-size: 17px; margin: 8px 0; font-weight: 600; }
.ch-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-tag {
  font-size: 11px; background: #f1f5f9; color: var(--text2); padding: 2px 8px;
  border-radius: 4px;
}

/* === 奇火AI推广 (首页) === */
.qihuo-sec { max-width: 1200px; margin: 0 auto 40px; padding: 0 24px; }
.qihuo-box {
  background: linear-gradient(135deg, #fef2f2, #fff1f2);
  border: 1px solid #fecaca; border-radius: var(--radius);
  padding: 28px 32px; display: flex; align-items: center; gap: 32px;
}
.qihuo-info h3 { font-size: 18px; color: var(--accent); margin-bottom: 8px; }
.qihuo-info p { font-size: 14px; color: var(--text2); margin-bottom: 4px; }
.qihuo-feat { margin: 8px 0 !important; font-size: 13px !important; }
.qihuo-price { font-size: 14px; color: var(--text); margin-top: 8px; }
.qihuo-price b { color: var(--accent); font-size: 16px; }
.qihuo-btn {
  flex-shrink: 0; background: var(--accent); color: #fff !important;
  padding: 14px 28px; border-radius: 8px; font-size: 15px; font-weight: 600;
  white-space: nowrap; transition: background .2s;
}
.qihuo-btn:hover { background: var(--accent2); text-decoration: none !important; }

/* === Footer === */
.ft {
  text-align: center; padding: 24px; color: var(--text3); font-size: 13px;
  border-top: 1px solid var(--border);
}

/* === 内页Layout === */
.layout { display: flex; margin-top: var(--hd-h); min-height: calc(100vh - var(--hd-h)); }

/* === Sidebar === */
.side, .sidebar {
  width: var(--side-w); flex-shrink: 0;
  background: var(--card); border-right: 1px solid var(--border);
  height: calc(100vh - var(--hd-h));
  position: sticky; top: var(--hd-h);
  overflow-y: auto; overflow-x: hidden;
  padding: 12px 0;
  scrollbar-width: thin;
}
.side::-webkit-scrollbar, .sidebar::-webkit-scrollbar { width: 4px; }
.side::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

/* === Sidebar: 三级导航 (大目录→章节→条目) === */
.sn-part { margin-bottom: 2px; }
.sn-part-title {
  padding: 9px 16px; font-size: 13px; font-weight: 700; color: var(--text3);
  cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
  transition: all .2s; border-radius: 6px; margin: 0 4px;
}
.sn-part.open > .sn-part-title {
  color: #fff; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.sn-arrow {
  font-size: 9px; transition: transform .2s;
  opacity: .5;
}
.sn-part.open > .sn-part-title .sn-arrow,
.sn-ch.open > .sn-ch-title .sn-arrow {
  transform: rotate(90deg); opacity: .8;
}

.sn-part-body { display: none; }
.sn-part.open > .sn-part-body { display: block; }

.sn-ch { margin-bottom: 1px; }
.sn-ch-title {
  padding: 6px 16px 6px 20px; font-size: 13px; font-weight: 500;
  cursor: pointer; user-select: none; color: var(--text2);
  display: flex; align-items: center; justify-content: space-between;
  transition: all .15s; margin: 0 4px; border-radius: 6px;
}
.sn-ch.open > .sn-ch-title { color: var(--accent); font-weight: 600; }
.sn-ch-title:hover { background: #f8fafc; }

.sn-items { display: none; }
.sn-ch.open > .sn-items { display: block; }

.sn-item {
  display: block; padding: 4px 16px 4px 36px; font-size: 13px;
  color: var(--text2); transition: all .1s; line-height: 1.5;
}
.sn-item:hover { background: #f1f5f9; color: var(--text); text-decoration: none; }
.sn-item.active {
  color: var(--accent); font-weight: 600;
  background: #fef2f2; border-left: 3px solid var(--accent);
}

/* === Main Content === */
.main, .main-content { flex: 1; padding: 24px 40px 60px; max-width: 860px; }
.breadcrumb {
  font-size: 13px; color: var(--text3); margin-bottom: 16px;
}
.article h1 { font-size: 26px; margin-bottom: 8px; font-weight: 700; }
.subtitle { font-size: 15px; color: var(--text2); margin-bottom: 24px; }
.placeholder { margin: 24px 0; }
.placeholder svg { width: 100%; max-width: 400px; display: block; margin: 0 auto; border-radius: var(--radius); }
.coming-soon {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius);
  padding: 20px 24px; margin: 24px 0; font-size: 14px; color: #92400e; line-height: 1.8;
}
.coming-soon a { color: #b45309; font-weight: 500; }

.qihuo-inline {
  display: flex; align-items: center; gap: 10px;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px;
  padding: 12px 16px; margin: 32px 0; font-size: 13px; color: #166534;
}
.qihuo-tag { background: #dcfce7; padding: 2px 8px; border-radius: 4px; font-weight: 600; font-size: 12px; }
.qihuo-inline a { color: #15803d; font-weight: 500; }

/* === Page Nav === */
.page-nav {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border);
}
.pn {
  padding: 10px 20px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--text2); transition: all .15s;
}
.pn:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; background: #eff6ff; }

/* === Search Results === */
.search-results {
  position: fixed; top: var(--hd-h); right: 24px; z-index: 200;
  width: 420px; max-height: 60vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.12); display: none;
}
.search-results.show { display: block; }
.sr-item {
  display: block; padding: 10px 16px; border-bottom: 1px solid var(--border);
  color: var(--text);
}
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: #f1f5f9; text-decoration: none; }
.sr-title { font-size: 14px; font-weight: 500; }
.sr-desc { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* === Responsive === */
/* 移动端：隐藏PC端侧边栏，显示汉堡菜单 */
@media (max-width: 900px) {
  .side, .sidebar { display: none; }
  .main, .main-content { padding: 20px 16px 60px; }
  .qihuo-box { flex-direction: column; gap: 16px; }
  .search-box { width: 160px; }
  .parts { grid-template-columns: 1fr; }
}

/* === Hot Topics (首页热门标签) === */
.hot-topics {
  max-width: 1200px; margin: 0 auto; padding: 20px 24px 0;
}
.hot-title {
  font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--text);
}
.hot-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.hot-tag {
  display: inline-block; padding: 6px 14px; border-radius: 20px;
  background: linear-gradient(135deg, #fff5f5, #fef2f2);
  border: 1px solid #fecaca; color: var(--accent); font-size: 13px;
  font-weight: 500; transition: all .2s; white-space: nowrap;
}
.hot-tag:hover { background: var(--accent); color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(229,62,62,.2); }

/* === Footer Ad (全站页脚广告) === */
.ft-ad {
  max-width: 1200px; margin: 0 auto; padding: 20px 24px 12px;
  display: flex; gap: 16px; flex-wrap: wrap;
}
.ft-ad-item {
  flex: 1; min-width: 260px;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #fff7ed, #fff1f2);
  border: 1px solid #fed7aa; border-radius: var(--radius);
  padding: 16px 18px; transition: box-shadow .2s, transform .15s;
}
.ft-ad-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.06); transform: translateY(-1px); }
.ft-ad-icon { font-size: 28px; flex-shrink: 0; }
.ft-ad-item b { font-size: 14px; color: var(--text); display: block; }
.ft-ad-item p { font-size: 12px; color: var(--text2); margin-top: 2px; line-height: 1.4; }
.ft-ad-item a {
  flex-shrink: 0; padding: 6px 14px; border-radius: 6px;
  background: var(--accent); color: #fff !important; font-size: 13px;
  font-weight: 600; white-space: nowrap; transition: background .2s;
}
.ft-ad-item a:hover { background: var(--accent2); text-decoration: none !important; }

/* === Mobile Menu (手机端汉堡菜单) === */
.mobile-menu-btn {
  display: none; background: none; border: none; font-size: 22px;
  cursor: pointer; padding: 4px 8px; line-height: 1; margin-left: auto;
}
.mobile-sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,.4);
}
.mobile-sidebar-overlay.show { display: block; }

/* 移动端侧边栏 */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: var(--hd-h); left: -280px; bottom: 0;
    width: 280px; height: auto; z-index: 160;
    transition: left .3s; background: var(--card);
    box-shadow: 2px 0 10px rgba(0,0,0,.15);
  }
  .sidebar.mobile-open { left: 0; }
  .main { padding: 20px 16px 60px; max-width: 100%; }
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
  .hd { padding: 0 12px; gap: 8px; }
  .logo { font-size: 16px; }
  .logo .sub { display: none; }
  .search-box { width: 0; min-width: 0; padding: 6px 0; border: none; flex: 1; opacity: 0; transition: all .3s; }
  .search-box.active { width: 140px; min-width: 140px; padding: 6px 10px; border: 1px solid var(--border); opacity: 1; }
  .search-btn { padding: 6px 8px; }
  .btn-qh { padding: 6px 10px; font-size: 11px; }
  .btn-qh .btn-qh-long { display: none; }
  .mobile-menu-btn { display: block; }
  .hero { padding: 40px 16px 28px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 14px; }
  .hero .stats { font-size: 12px; padding: 8px 16px; gap: 12px; }
  .hot-topics { padding: 12px 16px 0; }
  .hot-tag { padding: 5px 10px; font-size: 12px; }
  .parts { padding: 20px 16px; gap: 12px; }
  .ch-card { padding: 14px; }
  .ch-card h3 { font-size: 15px; }
  .ch-tag { font-size: 10px; padding: 2px 6px; }
  .qihuo-sec { padding: 0 16px; margin-bottom: 24px; }
  .qihuo-box { padding: 20px; }
  .qihuo-info h3 { font-size: 15px; }
  .qihuo-btn { padding: 10px 20px; font-size: 14px; width: 100%; text-align: center; }
  .ft-ad { padding: 16px; flex-direction: column; gap: 12px; }
  .ft-ad-item { min-width: auto; padding: 12px 14px; }
  .article h1 { font-size: 22px; }
  .article h2 { font-size: 18px; }
  .article h3 { font-size: 16px; }
  .article p { font-size: 14px; }
  .page-nav { flex-direction: column; }
  .pn { text-align: center; }
  .table-wrap { font-size: 13px; }
  .search-results { width: calc(100vw - 24px); right: 12px; max-height: 50vh; }
  .main { padding: 16px 14px 40px; }
  .breadcrumb { font-size: 12px; }
  .compare-box { flex-direction: column; }
  .compare-vs { padding: 4px 0; }
  .flow-step { font-size: 13px; padding: 8px 14px; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 18px; }
  .hero .stats { flex-direction: column; gap: 6px; padding: 8px 20px; }
  .qihuo-price { font-size: 12px; }
  .qihuo-feat { font-size: 11px !important; }
}

/* === Article Content Components === */
.article h2 {
  font-size: 20px; font-weight: 700; color: var(--text);
  margin: 32px 0 16px; padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.article h3 {
  font-size: 17px; font-weight: 600; color: var(--text);
  margin: 24px 0 12px;
}
.article p {
  margin: 12px 0; line-height: 1.8; color: #334155;
}
.article ul, .article ol {
  margin: 12px 0 12px 24px; line-height: 2;
}
.article li { margin-bottom: 4px; color: #334155; }
.article strong { color: var(--text); }

/* Info Card */
.info-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  margin: 16px 0; overflow: hidden;
  border-left: 4px solid var(--blue);
}
.info-card-title {
  background: #eff6ff; padding: 12px 16px; font-size: 15px; font-weight: 600;
  color: var(--blue);
}
.info-card-body {
  padding: 14px 16px; font-size: 14px; line-height: 1.8; color: #334155;
}

/* Tip Box */
.tip-box {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius);
  padding: 14px 16px; margin: 20px 0;
  font-size: 14px; line-height: 1.7; color: #92400e;
}
.tip-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* Table */
.table-wrap {
  overflow-x: auto; margin: 16px 0;
  border-radius: var(--radius); border: 1px solid var(--border);
}
.table-wrap table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.table-wrap th {
  background: #f8fafc; padding: 10px 14px; text-align: left;
  font-weight: 600; color: var(--text); border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.table-wrap td {
  padding: 10px 14px; border-bottom: 1px solid #f1f5f9; color: #334155;
}
.table-wrap tbody tr:hover { background: #f8fafc; }
.table-wrap tbody tr:last-child td { border-bottom: none; }

/* Flow Chart */
.flow-chart {
  display: flex; flex-direction: column; align-items: center;
  margin: 20px 0; padding: 20px;
  background: #f8fafc; border-radius: var(--radius); border: 1px solid var(--border);
}
.flow-step {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 20px; width: 100%; max-width: 500px;
  font-size: 14px; color: #334155;
}
.flow-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.flow-arrow {
  font-size: 20px; color: var(--accent); margin: 4px 0;
}

/* === Image Container === */
.img-container {
  margin: 24px 0;
  text-align: center;
}
.img-container img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.img-caption {
  font-size: 13px;
  color: var(--text3);
  margin-top: 8px;
}

/* Compare Box */
.compare-box {
  display: flex; align-items: stretch; gap: 0;
  margin: 16px 0; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.compare-col {
  flex: 1; padding: 16px;
}
.compare-col ul { margin: 8px 0 8px 20px; font-size: 14px; line-height: 1.9; }
.compare-title {
  font-size: 16px; font-weight: 700; text-align: center;
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.compare-col:first-child .compare-title { color: var(--blue); border-color: var(--blue); }
.compare-col:last-child .compare-title { color: var(--green); border-color: var(--green); }
.compare-vs {
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: var(--text3);
  background: #f1f5f9; padding: 0 16px;
}
