﻿/* 智数量策 · 题材库（浅色站点风格 + 参考站结构） */
.theme-lib-page { color: var(--text-primary); }
.theme-lib-page > .page-title { margin-bottom: 4px; }
.theme-lib-top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-card); padding: 10px 12px; margin-top: 10px;
}
.theme-lib-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.theme-lib-tabs button {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary);
  border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer;
}
.theme-lib-tabs button:hover { border-color: #a8ccff; color: var(--accent-blue); }
.theme-lib-tabs button.on { background: #e8f1ff; border-color: #a8ccff; color: var(--accent-blue); font-weight: 600; }
.theme-lib-sourcebar { margin-left: auto; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.theme-lib-source-note { font-size: 11.5px; color: var(--text-muted); margin-right: 3px; }
.theme-lib-source-chip { font-size: 11.5px; color: var(--text-secondary); border: 1px solid var(--border); background: var(--bg-secondary); border-radius: 6px; padding: 4px 9px; }
.theme-lib-source-chip.on { color: var(--accent-blue); border-color: #a8ccff; background: #e8f1ff; }
.theme-lib-source-chip.muted { color: var(--text-muted); }
.theme-lib-notice {
  margin: 8px auto 0; width: fit-content; max-width: 100%;
  color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
  padding: 6px 12px; font-size: 12.5px; text-align: center;
}

.theme-lib-layout { display: flex; align-items: stretch; gap: 0; margin-top: 12px; }
.theme-lib-menu {
  flex: 0 0 var(--left-width, 620px); width: var(--left-width, 620px); min-width: 0; max-width: 800px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-card); display: flex; flex-direction: column;
  height: calc(100vh - 285px); min-height: 520px; overflow: hidden;
}
.theme-lib-splitter { flex: 0 0 10px; cursor: col-resize; display: flex; align-items: center; justify-content: center; color: #c8c8c8; user-select: none; }
.theme-lib-splitter::after { content: '⋮'; font-size: 18px; }
.theme-lib-splitter:hover { color: var(--accent-blue); }
.theme-lib-detail {
  flex: 1 1 auto; min-width: 0; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-card); padding: 16px;
  height: calc(100vh - 285px); min-height: 520px; overflow: auto;
}
.theme-lib-layout.collapsed .theme-lib-detail, .theme-lib-layout.collapsed .theme-lib-splitter { display: none; }
.theme-lib-layout.collapsed .theme-lib-menu { flex: 1 1 auto; width: auto; max-width: none; }
.theme-lib-expand {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 5;
  background: #e8f1ff; border: 1px solid #a8ccff; color: var(--accent-blue);
  border-radius: 8px 0 0 8px; padding: 12px 8px; font-size: 12px; cursor: pointer;
  writing-mode: vertical-rl; letter-spacing: 2px;
}

.theme-lib-side-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
}
.theme-lib-side-head strong { font-size: 15px; color: var(--text-primary); }
.theme-lib-side-head span { font-size: 12px; color: var(--text-muted); }
.theme-lib-search-row { display: flex; gap: 8px; padding: 10px 12px 0; }
.theme-lib-search {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: 999px; padding: 8px 13px; font-size: 13px; outline: none;
}
.theme-lib-search::placeholder { color: var(--text-muted); }
.theme-lib-search:focus { border-color: var(--accent-blue); }
.theme-lib-refresh {
  background: var(--accent-blue); border: 1px solid var(--accent-blue); color: #fff;
  border-radius: 999px; padding: 0 14px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.theme-lib-refresh:hover { background: var(--accent-hover); }
.theme-lib-refresh:disabled { opacity: .55; cursor: default; }
.theme-lib-meta { padding: 8px 13px 7px; font-size: 12px; color: var(--text-muted); }
.theme-lib-list-scroll { flex: 1; min-height: 0; overflow: auto; }
.theme-lib-list-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.theme-lib-list-table th {
  position: sticky; top: 0; z-index: 1; background: var(--bg-secondary); color: var(--text-primary);
  text-align: right; font-weight: 700; padding: 10px 7px; border-bottom: 1px solid var(--border);
  cursor: pointer; white-space: nowrap; user-select: none;
}
.theme-lib-list-table th:first-child { text-align: left; width: 31%; }
.theme-lib-list-table th:nth-child(2) { width: 16%; }
.theme-lib-list-table th:nth-child(3) { width: 15%; }
.theme-lib-list-table th:nth-child(4) { width: 12%; }
.theme-lib-list-table th:nth-child(5) { width: 14%; }
.theme-lib-list-table th:nth-child(6) { width: 12%; }
.theme-lib-list-table th.active { color: var(--accent-blue); background: #e8f1ff; }
.theme-lib-list-table th:hover { color: var(--accent-blue); }
.sort-arrow { color: var(--accent-blue); padding-left: 2px; font-size: 11px; }
.theme-lib-list-table td {
  padding: 9px 7px; border-bottom: 1px solid var(--border); text-align: right;
  color: var(--text-primary); vertical-align: middle; font-variant-numeric: tabular-nums;
}
.theme-lib-list-table td.name { text-align: left; position: sticky; left: 0; z-index: 1; background: var(--bg-card); }
.theme-lib-list-table tbody tr { cursor: pointer; }
.theme-lib-list-table tbody tr:hover td { background: #f7f7f7; }
.theme-lib-list-table tbody tr.active td { background: #e8f1ff; }
.theme-lib-list-table tbody tr.active td:first-child { box-shadow: inset 3px 0 0 var(--accent-blue); }
.theme-name { font-size: 14px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.theme-lib-list-table td.heat { color: #d97706; }
.positive { color: var(--cn-up-color) !important; }
.negative { color: var(--cn-down-color) !important; }
.flat { color: var(--text-primary) !important; }
.theme-tag { font-size: 10px; border-radius: 4px; padding: 1px 6px; border: 1px solid; }
.theme-tag.new { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.theme-tag.hot { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.theme-lib-foot { padding: 8px 13px; font-size: 11.5px; color: var(--text-muted); line-height: 1.5; border-top: 1px solid var(--border); }

.theme-lib-detail-inner { padding: 0; }
.theme-lib-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.theme-lib-detail-title { font-size: 26px; font-weight: 700; color: var(--text-primary); }
.theme-lib-detail-sub { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.theme-lib-detail-sub .positive { color: var(--cn-up-color); }
.theme-lib-detail-sub .negative { color: var(--cn-down-color); }
.theme-lib-collapse {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--accent-blue);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.theme-lib-collapse:hover { border-color: #a8ccff; background: #e8f1ff; }
.theme-lib-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.theme-lib-metric { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.theme-lib-metric span { font-size: 12px; color: var(--text-muted); }
.theme-lib-metric b { font-size: 22px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.theme-lib-metric b.positive { color: var(--cn-up-color) !important; }
.theme-lib-metric b.negative { color: var(--cn-down-color) !important; }
.theme-lib-brief { margin: 12px 0 8px; font-size: 13px; line-height: 1.75; color: var(--text-secondary); }
.theme-lib-branch-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.theme-lib-branch { font-size: 11px; color: var(--accent-blue); border: 1px solid #a8ccff; background: #e8f1ff; border-radius: 4px; padding: 2px 7px; }
.theme-lib-detail-tabs { display: flex; gap: 6px; margin-top: 6px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.theme-lib-detail-tabs button {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary);
  border-radius: 7px; padding: 5px 12px; font-size: 12.5px; cursor: pointer;
}
.theme-lib-detail-tabs button.on { background: #e8f1ff; border-color: #a8ccff; color: var(--accent-blue); font-weight: 600; }
.theme-lib-sort-row { display: flex; gap: 6px; margin: 9px 0; }
.theme-lib-sort-row button {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary);
  border-radius: 7px; padding: 5px 11px; font-size: 12px; cursor: pointer;
}
.theme-lib-sort-row button.on { background: #e8f1ff; border-color: #a8ccff; color: var(--accent-blue); font-weight: 600; }
.theme-lib-nodes { display: flex; flex-direction: column; gap: 7px; }
.theme-lib-node { border: 1px solid #e7ebf0; border-left: 1px solid #e7ebf0; border-radius: 12px; overflow: hidden; background: var(--bg-card); }
.theme-lib-node-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fbfcfe; cursor: pointer; }
.theme-lib-node-head:hover { background: #f7f9fc; }
.node-arrow { color: #9ca3af; font-size: 12px; width: 12px; }
.node-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.node-date { font-size: 11px; color: var(--text-muted); }
.node-count { margin-left: auto; font-size: 12px; color: #d97706; }
.theme-lib-node-stocks { padding: 2px 10px 6px; }
.theme-lib-stocks { display: flex; flex-direction: column; gap: 2px; }
.theme-lib-stock { padding: 9px 10px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 5px; }
.theme-lib-stock:hover { background: #f7f7f7; }
.theme-lib-stock-main { display: flex; align-items: baseline; gap: 8px; }
.stock-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.stock-code { font-family: ui-monospace, monospace; font-size: 11px; color: var(--text-muted); }
.theme-lib-tag.leader { font-size: 9.5px; color: #dc2626; border: 1px solid #fecaca; background: #fef2f2; border-radius: 4px; padding: 0 5px; }
.stock-chg { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; }
.stock-price { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; width: 58px; text-align: right; }
.stock-reason { margin-top: 3px; font-size: 12px; line-height: 1.55; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.theme-lib-empty { padding: 30px; text-align: center; color: var(--text-muted); font-size: 13px; }
.theme-lib-graph { width: 100%; height: 560px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; }
.theme-lib-graph-note { margin-top: 5px; font-size: 11px; color: var(--text-muted); }
.theme-lib-json { max-height: 560px; overflow: auto; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-size: 11.5px; line-height: 1.55; color: var(--text-secondary); }

@media (max-width: 1200px) {
  .theme-lib-layout { display: block; }
  .theme-lib-menu { width: auto; max-width: none; height: 440px; min-height: 0; }
  .theme-lib-splitter { display: none; }
  .theme-lib-detail { width: auto; height: auto; min-height: 0; margin-top: 12px; }
  .theme-lib-sourcebar { margin-left: 0; width: 100%; }
}
@media (max-width: 700px) {
  .theme-lib-page > .page-title { font-size: 24px; }
  .theme-lib-tabs button { padding: 6px 9px; font-size: 12px; }
  .theme-lib-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-lib-detail-head { flex-direction: column; }
  .theme-lib-detail-title { font-size: 22px; }
  .theme-lib-list-table { font-size: 12px; }
  .theme-lib-list-table th, .theme-lib-list-table td { padding: 8px 5px; }
}

/* 题材列表静态标题（移除节点/图谱/结构入口后） */
.theme-lib-section-label { font-size: 14px; font-weight: 700; color: var(--text-primary); padding: 0 4px; }

/* 移除来源条后的顶部间距 */
.theme-lib-notice { margin: 10px auto 0 !important; }

/* 右侧常驻：去掉收起/展开，面板向下铺满 */
.theme-lib-collapse, .theme-lib-expand { display: none !important; }
.theme-lib-menu, .theme-lib-detail {
  height: calc(100vh - 100px) !important;
  min-height: 560px !important;
}
@media (max-width: 1200px) {
  .theme-lib-menu { height: 480px !important; min-height: 0 !important; }
  .theme-lib-detail { height: auto !important; min-height: 0 !important; }
}

/* 个股标签：正宗/龙头/涨停/热度/节点 */
.theme-lib-stock-main { flex-wrap: wrap; }
.theme-lib-tag.authentic { font-size: 9.5px; color: #fbbf24; border: 1px solid #78350f; background: #2b1707; border-radius: 4px; padding: 0 5px; }
.theme-lib-tag.leader { font-size: 9.5px; color: #fecaca; border: 1px solid #7f1d1d; background: #450a0a; border-radius: 4px; padding: 0 5px; }
.theme-lib-tag.limit { font-size: 9.5px; color: #fff; border: 1px solid #b91c1c; background: #7f1d1d; border-radius: 4px; padding: 0 5px; }
.theme-lib-tag.heat { font-size: 9.5px; color: #fde68a; border: 1px solid #78350f; background: #2b1707; border-radius: 4px; padding: 0 5px; }
.theme-lib-tag.node { font-size: 9.5px; color: #bae6fd; border: 1px solid #164e63; background: #082f49; border-radius: 4px; padding: 0 5px; }

/* 涨停幅度/涨停时间标签 */
.theme-lib-tag.limit-pct { font-size: 9.5px; color: #fecaca; border: 1px solid #7f1d1d; background: #450a0a; border-radius: 4px; padding: 0 5px; }
.theme-lib-tag.time { font-size: 9.5px; color: #fca5a5; border: 1px solid #7f1d1d; background: #2a0f10; border-radius: 4px; padding: 0 5px; }

/* 字体放大：可读性优先 */
.theme-lib-page { font-size: 14px; }
.theme-lib-list-table { font-size: 14px !important; }
.theme-lib-list-table th { font-size: 14px !important; padding: 11px 8px !important; }
.theme-lib-list-table td { font-size: 14px !important; padding: 10px 8px !important; }
.theme-name { font-size: 16px !important; }
.theme-desc { font-size: 13px !important; line-height: 1.5 !important; }
.theme-lib-search { font-size: 14px !important; padding: 10px 14px !important; }
.theme-lib-refresh { font-size: 14px !important; }
.theme-lib-meta { font-size: 13px !important; }
.theme-lib-foot { font-size: 12px !important; }
.theme-lib-detail-title { font-size: 30px !important; }
.theme-lib-detail-sub { font-size: 13.5px !important; }
.theme-lib-metric span { font-size: 13px !important; }
.theme-lib-metric b { font-size: 28px !important; }
.theme-lib-brief { font-size: 15px !important; line-height: 1.8 !important; }
.theme-lib-branch { font-size: 12px !important; padding: 3px 8px !important; }
.theme-lib-detail-tabs button, .theme-lib-sort-row button { font-size: 14px !important; padding: 7px 14px !important; }
.node-name { font-size: 16px !important; }
.node-date { font-size: 12.5px !important; }
.node-count { font-size: 13px !important; }
.theme-lib-stock-main { gap: 9px !important; }
.stock-name { font-size: 15px !important; }
.stock-code { font-size: 12.5px !important; }
.stock-chg { font-size: 14px !important; }
.stock-price { font-size: 13px !important; }
.stock-reason { font-size: 13px !important; line-height: 1.6 !important; }
.theme-lib-tag,
.theme-lib-tag.authentic,
.theme-lib-tag.leader,
.theme-lib-tag.limit,
.theme-lib-tag.limit-pct,
.theme-lib-tag.time,
.theme-lib-tag.heat,
.theme-lib-tag.node {
  font-size: 12px !important;
  padding: 2px 7px !important;
  font-weight: 600;
}

/* 题材库 A1 · 题材胶囊 */
.theme-pill-sort { display: flex; align-items: center; gap: 4px; padding: 0 8px 7px; flex-wrap: wrap; }
.theme-pill-sort > span { font-size: 10.5px; color: var(--text-muted); margin-right: 2px; }
.theme-pill-sort button { height: 24px; padding: 0 8px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text-secondary); font-size: 10.5px; cursor: pointer; transition: all .15s ease; }
.theme-pill-sort button:hover { border-color: #a8ccff; color: var(--accent-blue); }
.theme-pill-sort button.active { border-color: #a8ccff; background: #eff6ff; color: var(--accent-blue); font-weight: 600; }
.theme-pill-sort button i { font-style: normal; }
.theme-pill-list { display: flex; flex-direction: column; gap: 7px; padding: 0 8px 8px; overflow-y: auto; }
.theme-pill-list::-webkit-scrollbar { width: 5px; }
.theme-pill-list::-webkit-scrollbar-thumb { background: #d4dce6; border-radius: 99px; }
.theme-pill { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 8px 14px; border: 1px solid #e7ebf0; border-radius: 999px !important; background: #fff; cursor: pointer; text-align: left; font-family: inherit; transition: background .15s ease, border-color .15s ease; }
.theme-pill.active { border-color: #1677ff !important; background: #f2f7ff; }
.theme-pill-main { flex: 1; min-width: 0; }
.theme-pill-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.theme-pill-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13.5px; font-weight: 700; color: #1f2329; }
.theme-pill-brief { margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10.5px; color: #8a8f98; }
.theme-pill-badge { flex: 0 0 auto; padding: 1px 5px; border-radius: 999px; font-size: 9px; font-weight: 600; }
.theme-pill-badge.new { color: #b45309; background: #fef3c7; }
.theme-pill-badge.hot { color: #c2410c; background: #ffedd5; }
.theme-pill-stats { display: flex; align-items: stretch; gap: 8px; flex: 0 0 auto; }
.theme-pill-stats > span { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; min-width: 38px; }
.theme-pill-stats em { font-style: normal; font-size: 9px; color: #9ca3af; line-height: 1.2; }
.theme-pill-stats b { font-size: 11.5px; font-weight: 700; color: #374151; font-variant-numeric: tabular-nums; line-height: 1.2; }
.theme-pill-stats b.up { color: #c24141; }
.theme-pill-stats b.down { color: #3f7f58; }
@media (max-width: 900px) {
  .theme-pill-stats > span:nth-child(3), .theme-pill-stats > span:nth-child(4) { display: none; }
}
