:root{ --gap:16px; --card-min-h:320px; --head-h:32px; --cap-h:22px; }
html,body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial; background:#f8fafc;}
.wrap{max-width:1400px;margin:0 auto;padding:16px}
.muted{color:#888}
.card{border:1px solid #eee;border-radius:10px;padding:12px;background:#fff}
.left-scroll{max-height:72vh;overflow:auto}
table{border-collapse:collapse;width:100%;font-size:13px}
th,td{border-bottom:1px solid #eee;padding:8px 10px;white-space:nowrap;vertical-align:middle}
th{background:#fafafa;position:sticky;top:0;z-index:1;text-align:center}
td{text-align:left}
.op-link{cursor:pointer;color:#2563eb}
.op-link:hover{color:#1d4ed8;text-decoration:underline}
.btn-plus{display:inline-flex;justify-content:center;align-items:center;width:20px;height:20px;border:1px solid #cbd5e1;border-radius:6px;background:#fff;cursor:pointer;user-select:none}
.btn-plus:hover{background:#f1f5f9}
.btn-plus .minus{display:none}
.btn-plus.open .plus{display:none}
.btn-plus.open .minus{display:inline}
tr.detail td{background:#fcfcff;color:#334155}
.pill{display:inline-block;padding:2px 6px;border:1px solid #e5e7eb;border-radius:999px;background:#fafafa;color:#666;font-size:12px;margin-right:6px}
tr.hl{background:#fff5e6}

/* 风向徽章 & Context 小文本  */
.fxcell .mini{color:#64748b;font-size:12px;margin-left:6px}
.noctx{font-size:13px;color:#94a3b8}
.badge{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:2px 8px;font-size:12px;border:1px solid #e5e7eb;background:#fff}
.badge.fx-strong{background:#ecfdf5;border-color:#a7f3d0;color:#065f46}
.badge.fx-midup{background:#eff6ff;border-color:#bfdbfe;color:#1e3a8a}
.badge.fx-weak{background:#fff7ed;border-color:#fed7aa;color:#9a3412}
.badge.fx-middown{background:#fef2f2;border-color:#fecaca;color:#991b1b}
.pol-bull{color:#d02626}
.pol-bear{color:#2563eb}
.pol-neu{color:#64748b}

/* 工具栏（与表格同容器） */
.toolbar{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;align-items:center;margin-bottom:8px}
.t-left{display:flex;gap:8px;align-items:center}
.t-mid{display:flex;justify-content:center}
.t-right{display:flex;justify-content:flex-end}

/* 下拉（指标列 ON/OFF） */
.dropdown{position:relative}
.dd-btn{border:1px solid #cbd5e1;border-radius:8px;padding:6px 10px;background:#fff;cursor:pointer}
.dd-menu{position:absolute;top:110%;left:0;z-index:10;min-width:220px;background:#fff;border:1px solid #e5e7eb;border-radius:10px;box-shadow:0 6px 18px rgba(0,0,0,.06);padding:8px;display:none;max-height:300px;overflow:auto}
.dd-item{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:8px;cursor:pointer}
.dd-item:hover{background:#f8fafc}
.dd-item .tick{margin-left:auto;color:#10b981;visibility:hidden}
.dd-item.on .tick{visibility:visible}
.dd-foot{border-top:1px dashed #e5e7eb;margin-top:6px;padding-top:6px;font-size:12px;color:#64748b}

/* 搜索栏（右区） */
.searchbar{display:flex;gap:8px;align-items:center}
.searchbar input{border:1px solid #cbd5e1;border-radius:8px;padding:6px 10px;font-size:13px;min-width:220px}
.icon-btn{border:1px solid #cbd5e1;border-radius:8px;padding:6px 9px;background:#f8fafc;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:34px;height:32px}
.icon-btn:hover{background:#eef2f7}
.ico{display:inline-block;width:16px;height:16px}
.ico svg{display:block;width:16px;height:16px}
.spinner{display:inline-block;width:16px;height:16px;border:2px solid #cbd5e1;border-top-color:#2563eb;border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

/* 搜索结果日期区 */
.search-panel{margin:6px 0 10px 0;display:none}
.date-chips{display:flex;gap:8px;flex-wrap:wrap}
.date-chip{border:1px solid #e5e7eb;border-radius:999px;padding:4px 10px;background:#fff;cursor:pointer}
.date-chip:hover{background:#f1f5f9}

/* 细节三列稳定布局 */
tr.detail td{ white-space: normal !important; }
.detailflex{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:12px;
  align-items:stretch;
}
.rowcard{
  display:grid;
  grid-template-rows: var(--head-h) 1fr;
  min-height: var(--card-min-h);
  border:1px solid #e5e7eb;border-radius:10px;padding:10px;background:#fff;
  overflow:hidden;
}
.rowcard h4{
  margin:0;padding:0 4px;
  line-height: var(--head-h);
  height: var(--head-h);
  display:flex;align-items:center;justify-content:space-between;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  font-size:14px;
}
.rowcard h4 a{font-size:12px;color:#2563eb;text-decoration:none;margin-left:6px;flex:0 0 auto}
.rowcard h4 a:hover{text-decoration:underline}

/* 技术指标卡 */
.desc-scroll{ overflow:auto; min-height:0; padding-right:2px; }
.tech-list{display:flex;flex-direction:column;gap:6px}
.tech-row{display:flex;align-items:flex-start;gap:6px;min-width:0}
.tech-row .tx{
  flex:1 1 auto; min-width:0;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* 行业/概念卡正文 */
.ctx-inner{
  display:grid;
  grid-template-columns:30% 70%;
  gap:12px;
  min-height:0;
}
.ctx-left{ overflow:auto; min-height:0 }
.kv{display:flex;flex-direction:column;gap:6px}
.kv .item{display:block;background:#f8fafc;border:1px solid #e5e7eb;border-radius:8px;padding:6px 8px;font-size:12px;line-height:1.4}

.ctx-right{
  display:grid;
  grid-template-rows: 1fr var(--cap-h);
  min-height:0;
}
.chartbox{ width:100%; aspect-ratio: 4 / 3; overflow:hidden; align-self:stretch; justify-self:stretch; }
.chart{ width:100%; height:100%; display:block; color:#2563eb; }
.chartcap{ height: var(--cap-h); line-height: var(--cap-h); font-size:12px;color:#64748b;text-align:center; white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }

@media (max-width: 1200px){
  .toolbar{grid-template-columns:1fr 1fr 1fr}
}
@media (max-width: 860px){
  .toolbar{grid-template-columns:1fr; gap:8px}
  .t-mid{justify-content:flex-start}
  .t-right{justify-content:flex-start}
  .detailflex{grid-template-columns:1fr;}
  :root{ --card-min-h:360px; }
}

/* 门禁遮罩（统一样式） */
.gate-mask{
  position:fixed;inset:0;display:none;align-items:center;justify-content:center;
  background:rgba(15,23,42,.55);z-index:9999;padding:16px
}
.gate-card{
  width:min(720px,96vw);background:#fff;border-radius:14px;border:1px solid #e5e7eb;
  padding:18px 18px 14px;box-shadow:0 12px 30px rgba(0,0,0,.12);color:#0f172a
}
.gate-card h3{margin:0 0 6px 0;font-size:18px}
.gate-card p{margin:6px 0;color:#475569}
.gate-ops{margin-top:10px;display:flex;gap:10px;flex-wrap:wrap}
.gate-ops a,.gate-ops button{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  height:36px;padding:0 12px;border-radius:10px;border:1px solid #cbd5e1;background:#fff;cursor:pointer;
  text-decoration:none;color:#1f2937
}
.gate-ops a.primary,.gate-ops button.primary{background:#2563eb;color:#fff;border-color:#2563eb}
.gate-ops a:hover,.gate-ops button:hover{background:#f1f5f9}
.gate-ops a.primary:hover,.gate-ops button.primary:hover{background:#1d4ed8}

/* 表格上方说明条（与表格同宽） */
.table-note{
  border:1px solid #e5e7eb; background:#fafafa; color:#475569;
  border-radius:10px; padding:8px 10px; margin:0 0 8px 0; font-size:13px
}
