:root {
  color-scheme: light;
  /* 协会官网配色：白底 + 中国红 #b5151d（amac.org.cn 实测主色） */
  --bg: #f6f5f3;
  --nav: #8f060b;
  --nav-soft: rgba(255, 255, 255, 0.14);
  --surface: #ffffff;
  --surface-soft: #faf8f6;
  --text: #333333;
  --muted: #8a8f96;
  --line: #e5e5e5;
  --blue: #b5151d;
  --gold: #c7903e;
  --up: #b91c1c;
  --down: #15803d;
  --shadow: 0 8px 24px rgba(80, 30, 30, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  letter-spacing: 0;
}

button,
select,
input {
  font: inherit;
}

.terminal-shell {
  min-height: 100vh;
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

/* 页脚：原侧边栏的数据源/署名信息收拢到这里 */
.page-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.page-footer a {
  color: var(--muted);
}

.page-footer a:hover {
  color: var(--blue);
}

/* ---------------- 开发者模式：访问统计面板 ---------------- */

.dev-modal {
  width: min(1060px, 100%);
}

.dev-head-tools {
  display: flex;
  gap: 8px;
}

.dev-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.dev-kpi {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-top: 3px solid #7c3aed;
  border-radius: 8px;
  background: var(--surface-soft);
}

.dev-kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dev-kpi strong {
  font-size: 20px;
}

.dev-kpi small {
  color: var(--muted);
  font-size: 11px;
}

.dev-section {
  margin: 16px 0 8px;
  font-size: 14px;
}

.dev-chart {
  width: 100%;
  height: 170px;
}

.dev-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dev-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
}

.dev-table th,
.dev-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.dev-table th {
  position: sticky;
  top: 0;
  background: #f0eeec;
  color: #555;
  font-size: 12px;
}

.dev-table tbody tr:hover {
  background: #faf8ff;
}

.dev-num {
  text-align: right;
  font-weight: 700;
}

.dev-foot {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 620px) {
  .dev-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------------- 内部情报（团队自记打听数据，紫色系区分官方口径） ---------------- */

.intel-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 5px;
  border-radius: 50%;
  background: #7c3aed;
  vertical-align: 2px;
}

.intel-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}

.intel-row:last-of-type {
  border-bottom: 0;
}

.intel-org {
  min-width: 96px;
  padding-left: 8px;
  border-left: 3px solid transparent;
  font-weight: 700;
}

.intel-date {
  color: #7c3aed;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}

.intel-vals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.intel-val {
  white-space: nowrap;
}

.intel-val small {
  margin-left: 5px;
  font-size: 12px;
}

.intel-note {
  color: var(--muted);
  font-size: 12px;
}

.intel-count {
  color: #7c3aed;
  font-size: 12px;
  white-space: nowrap;
}

.intel-del {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.intel-del:hover {
  border-color: #b91c1c;
  color: #b91c1c;
}

.intel-empty {
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

/* 弹窗内的内部记录区块 */
.org-intel {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px dashed #c4b5fd;
  border-radius: 10px;
  background: #faf8ff;
}

.intel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.intel-tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: #7c3aed;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.intel-head small {
  color: var(--muted);
  font-size: 12px;
}

.intel-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #ddd6fe;
}

.intel-field {
  display: grid;
  gap: 4px;
}

.intel-field span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.intel-field input {
  width: 104px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid #ddd6fe;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
}

.intel-field input:focus {
  outline: none;
  border-color: #7c3aed;
}

.intel-note-field input {
  width: 170px;
}

.intel-status {
  min-height: 18px;
  margin: 6px 0 0;
  color: #b91c1c;
  font-size: 12px;
}

.movers-chart {
  height: 640px; /* 实际高度由 JS 按条数动态设置 */
}

.workbench {
  min-width: 0;
  max-width: 1760px;
  margin: 0 auto;
  padding: 22px clamp(16px, 2.6vw, 34px) 34px;
}

.page-vip-entry {
  position: absolute;
  top: 24px;
  right: 26px;
  z-index: 55;
  min-height: 38px;
  border-color: #d19a45;
  color: #c08326;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(80, 30, 30, 0.10);
  backdrop-filter: blur(8px);
}

.page-vip-entry:hover {
  border-color: #b5151d;
  color: #b5151d;
  background: #fff;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-right: 150px;
  margin-bottom: 16px;
}

.topbar .eyebrow {
  white-space: nowrap;
}

/* 页面唯一标题（原先的小眉题 + 大标题合并为一行） */
.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 17px;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.refresh-btn {
  position: relative;
}

.refresh-scope {
  font-size: 11px;
  color: var(--muted);
  padding-left: 7px;
  margin-left: 1px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}

.refresh-scope:empty {
  display: none;
}

.refresh-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f5533d;
  box-shadow: 0 0 0 2px var(--surface);
  animation: refresh-pulse 1.6s ease-in-out infinite;
}

.refresh-btn.has-new {
  border-color: #f5533d;
  color: #f5533d;
}

.refresh-btn.has-new .refresh-scope {
  color: #f5533d;
  border-left-color: #f5533d;
}

@keyframes refresh-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 0 rgba(245, 83, 61, 0.5); }
  50% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 5px rgba(245, 83, 61, 0); }
}

.icon-button:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #fdf6f5;
}

.control-band,
.panel,
.kpi-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-band {
  display: grid;
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  gap: 10px;
  padding: 12px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

select,
input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

select:focus,
input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(181, 21, 29, 0.1);
}

.data-note {
  margin: 12px 0 16px;
  color: #5f5a58;
  font-size: 13px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.kpi-grid.six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.kpi-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-card {
  min-height: 142px;
  padding: 14px;
  overflow: hidden;
}

.channel-card {
  border-top: 3px solid var(--gold);
}

.kpi-card span,
.kpi-card small {
  color: var(--muted);
  font-size: 12px;
}

.kpi-card strong {
  display: block;
  min-height: 34px;
  margin: 8px 0 6px;
  overflow: hidden;
  color: #2b2b2b;
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spark {
  width: 100%;
  height: 38px;
  margin-top: 6px;
}

.spark polyline {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.leaderboard-grid,
.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.leaderboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.panel {
  min-width: 0;
  padding: 15px;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-title span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.chart {
  width: 100%;
  height: 360px;
}

.chart.mid {
  height: 390px;
}

.chart.tall {
  height: 440px;
}

.chart.gauge {
  height: 380px;
}

.insight {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: #fff8eb;
  color: #57401d;
  font-size: 13px;
  line-height: 1.6;
}

.mini-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.mini-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 13px;
}

.mini-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.sub-controls label {
  width: min(260px, 100%);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #e0bcbb;
  border-radius: 8px;
  background: #faf0ef;
  color: #8f060b;
  cursor: pointer;
  font-size: 13px;
}

.chip svg {
  width: 14px;
  height: 14px;
}

.change-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  color: #5f5a58;
  font-size: 13px;
}

.channel-list {
  margin-top: 10px;
}

.channel-list + .channel-list {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.channel-list h3 {
  margin: 0 0 8px;
  color: #4a4442;
  font-size: 14px;
}

.table-wrap {
  overflow: auto;
  max-height: 610px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap.compact {
  max-height: 380px;
}

.table-wrap.matrix-wrap {
  max-height: 72vh;
}

.matrix-wrap table {
  min-width: 1942px;
}

/* 大表顶部紧凑工具条 */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.mini-field {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  width: auto;
}

.mini-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mini-select {
  width: auto;
  min-height: 30px;
  padding: 0 6px;
  font-size: 13px;
}

.status-field {
  flex: 0 1 280px;
}

.status-field .mini-select {
  min-width: 138px;
}

.channel-chips {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.channel-chips::-webkit-scrollbar {
  display: none;
}

.channel-chip {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #555;
  cursor: pointer;
  font-size: 12.5px;
}

.channel-chip.active {
  border-color: #b5151d;
  background: #b5151d;
  color: #fff;
  font-weight: 700;
}

.toolbar-spacer {
  flex: 1;
}

.toolbar-info {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.icon-button.mini {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
}

.icon-button.mini svg {
  width: 14px;
  height: 14px;
}

.zoom-only {
  display: none;
}

/* 缩放模式的冻结表头浮层 */
.zoom-head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
  box-shadow: 0 1px 0 var(--line);
  background: #f5f4f2;
}

.zoom-head table {
  table-layout: fixed;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: #f5f4f2;
  transform-origin: 0 0;
}

/* 多机构对比 PK */
#pkPanel {
  margin-top: 14px;
}

.pk-metric {
  display: inline-flex;
  gap: 0;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.pk-metric button {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  background: #fff;
  color: #555;
  cursor: pointer;
  font-size: 13px;
}

.pk-metric button + button {
  border-left: 1px solid var(--line);
}

.pk-metric button.active {
  background: #b5151d;
  color: #fff;
  font-weight: 700;
}

.pk-quick {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.pk-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.pk-group-label {
  flex: 0 0 auto;
  min-width: 34px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pk-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

/* 整表长图（离屏渲染容器） */
#tablePosterRoot {
  position: fixed;
  top: 0;
  left: -20000px;
  padding: 22px 24px;
  background: #fff;
}

#tablePosterRoot .tp-head h1 {
  margin: 0 0 6px;
  color: #b5151d;
  font-size: 26px;
}

#tablePosterRoot .tp-head p {
  margin: 0 0 16px;
  color: #777;
  font-size: 14px;
}

#tablePosterRoot table {
  min-width: 0;
}

#tablePosterRoot th,
#tablePosterRoot td {
  position: static;
}

.zoom-content {
  width: max-content;
  transform-origin: 0 0;
}

.matrix-wrap.zoomable {
  position: relative;
  height: 68vh;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

@media (max-width: 768px) {
  .zoom-only {
    display: inline-flex;
  }
}

/* 缩放模式下 sticky 定位会错乱，关闭冻结列/表头 */
.matrix-wrap.zoomable th,
.matrix-wrap.zoomable th:first-child,
.matrix-wrap.zoomable td:first-child {
  position: static;
  box-shadow: none;
}

/* ---------- 大表四口径分块 ---------- */

/* 组底色：非货=白、股混=浅蓝、指数=浅金、类固收=浅青 */
.col-ranking { background: #f5f8fc; }
.col-index { background: #fbf7ef; }
.col-fixedIncome { background: #f3faf7; }

th.col-ranking { background: #eaf1f8; }
th.col-index { background: #f6efe0; }
th.col-fixedIncome { background: #e9f5f0; }

.col-group-start { border-left: 2px solid #d8d4d0; }

th.group-head {
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #444;
  border-bottom: 1px solid var(--line);
}

th.group-head.col-nonMoney { background: #f0eeec; }

/* 两行表头都固定 */
thead .group-row th { position: sticky; top: 0; z-index: 2; padding-top: 7px; padding-bottom: 7px; }
thead .field-row th { position: sticky; top: var(--thead-row1, 34px); z-index: 2; }
thead .group-row th[rowspan] { z-index: 3; }

/* 第二行表头首格是数值列，撤销全局 first-child 的左对齐/左冻结 */
.field-row th:first-child {
  left: auto;
  text-align: right;
  box-shadow: none;
}

.matrix-wrap .field-row th:first-child {
  position: sticky;
  left: auto;
}

/* 大表取消行斑马纹（与列底色冲突），保留 hover */
.matrix-wrap tbody tr:nth-child(even) td { background: inherit; }
.matrix-wrap tbody tr:nth-child(even) td.col-ranking { background: #f5f8fc; }
.matrix-wrap tbody tr:nth-child(even) td.col-index { background: #fbf7ef; }
.matrix-wrap tbody tr:nth-child(even) td.col-fixedIncome { background: #f3faf7; }
.matrix-wrap tbody tr:hover td { background: #fff8eb !important; }

/* ---------- 渠道颜色体系 ---------- */

.ch-badge {
  display: inline-block;
  min-width: 38px;
  padding: 2px 8px;
  border-radius: 5px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.5;
}

.ch-third { background: #b5151d; }
.ch-bank { background: #1f4e8c; }
.ch-securities { background: #b07f2e; }
.ch-insurance { background: #6b7280; }

.org-cell {
  display: inline-block;
  padding-left: 8px;
  border-left: 3px solid transparent;
}

.ch-line-third { border-left-color: #b5151d; }
.ch-line-bank { border-left-color: #1f4e8c; }
.ch-line-securities { border-left-color: #b07f2e; }
.ch-line-insurance { border-left-color: #6b7280; }

.dot { display: inline-block; width: 9px; height: 9px; margin-right: 4px; border-radius: 50%; vertical-align: 0; }
.ch-dot-third { background: #b5151d; }
.ch-dot-bank { background: #1f4e8c; }
.ch-dot-securities { background: #b07f2e; }
.ch-dot-insurance { background: #6b7280; }

/* 区间涨跌渠道多选胶囊 */
.movers-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

/* ---------- 口径显隐胶囊 ---------- */

.metric-chips {
  display: flex;
  gap: 5px;
}

.metric-chip {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #999;
  cursor: pointer;
  font-size: 12.5px;
  text-decoration: line-through;
}

.metric-chip.active {
  color: #333;
  font-weight: 700;
  text-decoration: none;
}

.metric-chip.mc-nonMoney.active { border-color: #c9bdb9; background: #f0eeec; }
.metric-chip.mc-ranking.active { border-color: #b9cde4; background: #eaf1f8; }
.metric-chip.mc-index.active { border-color: #e0cfa4; background: #f6efe0; }
.metric-chip.mc-fixedIncome.active { border-color: #b4dcc9; background: #e9f5f0; }

/* 大表首列（机构名）左右滚动时冻结 */
.matrix-wrap th:first-child,
.matrix-wrap td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
}

.matrix-wrap th:first-child {
  z-index: 4;
  background: #f5f4f2;
}

.matrix-wrap tbody tr:nth-child(even) td:first-child {
  background: #fcfaf9;
}

.matrix-wrap tbody tr:hover td:first-child {
  background: #fff8eb;
}

.key-points-panel {
  margin-bottom: 14px;
}

/* 大表页：全局筛选栏与页面级说明不需要（工具条自带起始/截至/渠道/口径）；
   顶部动作按钮保留——单页版里导入数据/更新官网数据只有这一个入口 */
body[data-view="matrix"] .control-band,
body[data-view="matrix"] .data-note {
  display: none;
}

.zoom-hint-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.poster-viewer {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: 92vh;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.poster-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: #b5151d;
  font-size: 13px;
  font-weight: 700;
}

.poster-viewer-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.poster-viewer-body img {
  display: block;
  width: 100%;
  height: auto;
}

/* 数值可点：查看该机构该口径历史曲线 */
.cell-link {
  cursor: pointer;
  border-bottom: 1px dashed transparent;
}

.cell-link:hover {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* 最大看点专栏 */
.focus-panel {
  margin: 14px 0;
  border: 1px solid #e8cfd0;
  background: linear-gradient(180deg, #fffdfc 0%, #fdf7f6 100%);
}

.focus-flag {
  display: inline-block;
  margin-right: 10px;
  padding: 3px 10px;
  border-radius: 6px;
  background: #b5151d;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  vertical-align: 2px;
}

.focus-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  align-items: start;
}

.focus-grid > * {
  min-width: 0;
}

#focusConcentrationChart {
  overflow: hidden;
}

.focus-story h3 {
  margin: 4px 0 12px;
  color: #8f060b;
  font-size: 17px;
  line-height: 1.55;
}

.focus-story .key-points li {
  background: #fff;
}

@media (max-width: 980px) {
  .focus-grid {
    grid-template-columns: 1fr;
  }
}

.key-points {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.key-points li {
  padding: 9px 12px;
  border-left: 3px solid #b5151d;
  border-radius: 0 8px 8px 0;
  background: var(--surface-soft);
  font-size: 13px;
  line-height: 1.7;
  color: #444;
}

.key-points li strong {
  display: inline-block;
  margin-right: 8px;
  color: #b5151d;
  font-size: 12px;
}

.table-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* 深度点评分板块 */
.key-points-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.deep-section {
  margin-bottom: 14px;
}

.deep-section:last-child {
  margin-bottom: 0;
}

.deep-section h3 {
  margin: 0 0 8px;
  padding-left: 10px;
  border-left: 4px solid #b5151d;
  color: #8f060b;
  font-size: 15px;
  line-height: 1.4;
}

.deep-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
  align-items: start;
}

.deep-grid > * {
  min-width: 0;
}

.deep-chart {
  width: 100%;
  height: 230px;
  overflow: hidden;
}

.deep-chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}

.deep-chart-row > * {
  min-width: 0;
}

.chart-cap {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .deep-grid,
  .deep-chart-row {
    grid-template-columns: 1fr;
  }
}

/* AI 解读盒子 */
.ai-box {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #e3cfd0;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffdfc 0%, #fdf7f6 100%);
}

.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #b5151d;
  font-size: 13px;
  font-weight: 800;
}

.ai-text p {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.8;
  color: #3d3a39;
}

.ai-text p:last-child {
  margin-bottom: 0;
}

.ai-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  border-radius: 5px;
  background: #b5151d;
  color: #fff;
  font-size: 12.5px;
}

.ai-loading {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ai-error {
  margin: 0;
  color: #b91c1c;
  font-size: 13px;
}

/* 手机长图（离屏渲染容器） */
#matrixPosterRoot {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 780px;
  padding: 28px 26px 20px;
  background: #fff;
  color: #333;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

#matrixPosterRoot .mp-eyebrow {
  margin: 0 0 6px;
  color: #b5151d;
  font-size: 14px;
  font-weight: 800;
}

#matrixPosterRoot h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

#matrixPosterRoot .mp-sub {
  margin: 0 0 18px;
  color: #777;
  font-size: 14px;
}

#matrixPosterRoot .mp-keys {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #faf9f7;
}

#matrixPosterRoot .mp-keys h2 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #b5151d;
}

#matrixPosterRoot .mp-keys .key-points li {
  font-size: 13.5px;
  background: #fff;
}

#matrixPosterRoot .mp-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
}

#matrixPosterRoot .mp-table th,
#matrixPosterRoot .mp-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #eee;
  text-align: right;
  font-size: 14px;
  white-space: nowrap;
}

#matrixPosterRoot .mp-table th {
  position: static;
  background: #f5f4f2;
  color: #555;
  font-size: 13px;
}

#matrixPosterRoot .mp-table .l {
  text-align: left;
}

#matrixPosterRoot .mp-table th:first-child,
#matrixPosterRoot .mp-table td:first-child {
  width: 52px;
  text-align: center;
}

#matrixPosterRoot .mp-table th:nth-child(n + 3),
#matrixPosterRoot .mp-table td:nth-child(n + 3) {
  width: 88px;
}

#matrixPosterRoot .mp-table td.l {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#matrixPosterRoot .mp-foot {
  margin: 16px 0 0;
  color: #999;
  font-size: 12px;
  text-align: center;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  font-size: 13px;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f5f4f2;
  color: #555555;
  cursor: pointer;
  font-weight: 800;
}

th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 230px;
  background: inherit;
  text-align: left;
}

th:first-child {
  z-index: 3;
  background: #f5f4f2;
}

tbody tr:nth-child(even) td {
  background: #fcfaf9;
}

tbody tr:hover td {
  background: #fff8eb;
}

/* 大表专属：左侧窄序号 + 机构双冻结列 */
.matrix-wrap th.matrix-row-index,
.matrix-wrap td.matrix-row-index {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  padding-right: 6px;
  padding-left: 6px;
  color: #9a928c;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.matrix-wrap .group-row th.matrix-row-index,
.matrix-wrap tbody td.matrix-row-index {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #f8f7f5;
  box-shadow: inset -1px 0 0 var(--line);
}

.matrix-wrap .group-row th.matrix-row-index {
  z-index: 5;
  background: #f1efec;
}

.matrix-wrap .group-row th:nth-child(2),
.matrix-wrap tbody td:nth-child(2) {
  position: sticky;
  left: 42px;
  z-index: 3;
  background: #fff;
  box-shadow: 1px 0 0 var(--line);
}

.matrix-wrap .group-row th:nth-child(2) {
  z-index: 5;
  background: #f5f4f2;
}

.matrix-wrap .field-row th:first-child {
  left: auto;
  min-width: 82px;
  box-shadow: none;
}

.matrix-wrap tbody tr:nth-child(even) td.matrix-row-index {
  background: #f2f0ed;
}

.matrix-wrap tbody tr:nth-child(even) td:nth-child(2) {
  background: #fcfaf9;
}

.matrix-wrap tbody tr:hover td.matrix-row-index,
.matrix-wrap tbody tr:hover td:nth-child(2) {
  background: #fff8eb !important;
}

.up {
  color: var(--up);
  font-weight: 800;
}

.down {
  color: var(--down);
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.badge.new {
  background: #fee2e2;
  color: var(--up);
}

.badge.out {
  background: #dcfce7;
  color: var(--down);
}

.icon-button.accent {
  background: #b5151d;
  border-color: #b5151d;
  color: #fff;
}

.icon-button.accent:hover {
  background: #8f060b;
  border-color: #8f060b;
  color: #fff;
}

#watermarkLayer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background-repeat: repeat;
  /* background-image 由 JS 按当前明暗主题生成注入 */
}

#watermarkLayer[hidden] {
  display: none;
}

.vip-toggle.is-vip {
  border-color: var(--gold);
  color: var(--gold);
}

.vip-toggle.is-vip svg {
  color: var(--gold);
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.55);
}

.modal-mask[hidden] {
  display: none;
}

.modal {
  width: min(760px, 100%);
  min-width: 0;
  max-width: calc(100vw - 36px);
  max-height: 88vh;
  overflow: auto;
  padding: 20px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-tip {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.modal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-row label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.modal-row select,
.modal-row input {
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
}

.import-preview {
  margin-bottom: 12px;
  font-size: 13px;
}

.import-preview table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
}

.import-preview th,
.import-preview td {
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  text-align: left;
}

.import-preview .warn {
  color: var(--up);
  font-weight: 700;
}

.modal-status {
  min-height: 20px;
  font-size: 13px;
  font-weight: 700;
}

.modal-status.ok { color: #15803d; }
.modal-status.err { color: #b91c1c; }

/* ---------------- 本期速览 ---------------- */

body[data-view="digest"] .control-band,
body[data-view="digest"] .data-note {
  display: none;
}

.digest-hero {
  margin-bottom: 16px;
  padding: 24px clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  border-left: 4px solid #b5151d;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow);
}

.digest-period {
  margin: 0 0 8px;
  color: #b5151d;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.digest-headline {
  margin: 0 0 10px;
  color: #2b2b2b;
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.2;
}

.digest-subline {
  margin: 0;
  color: #5f5a58;
  font-size: clamp(13px, 1.4vw, 15px);
  line-height: 1.7;
}

.digest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.digest-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.digest-card:hover {
  border-color: #d89a9d;
  transform: translateY(-2px);
}

.digest-tag {
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  background: #faf0ef;
  color: #8f060b;
  font-size: 12px;
  font-weight: 800;
}

.digest-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: #2b2b2b;
}

.digest-evidence {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.digest-more {
  margin-top: auto;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.digest-channel-row {
  display: grid;
  grid-template-columns: 10px 52px auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.digest-channel-row:last-child {
  border-bottom: 0;
}

.digest-channel-row .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.digest-channel-row .muted {
  font-size: 12px;
}

.digest-share-track {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: #f0eceb;
  overflow: hidden;
}

.digest-share-track div {
  height: 100%;
  border-radius: 999px;
}

.org-link {
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px dashed #d0a3a5;
}

.org-link:hover {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.org-modal {
  width: min(860px, 100%);
}

.org-modal-meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.org-modal-stats {
  margin-bottom: 14px;
}

/* 结构化拆解：非货 → 权益/股混 + 类固收 → 股票指数 + 类主动权益 */
.org-structure {
  display: grid;
  gap: 9px;
}

.org-struct-bar {
  display: flex;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
}

.org-struct-bar i {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.org-struct-l1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 9px;
  align-items: start;
}

.org-branch {
  display: grid;
  gap: 9px;
}

/* 二级拆分：缩进 + 虚线表示从属于权益/股混 */
.org-struct-l2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-left: 14px;
  padding-left: 10px;
  border-left: 2px dashed #d8d4d0;
}

.org-struct-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.org-stat {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: 8px;
  background: var(--surface-soft);
}

.org-stat.lv0 strong {
  font-size: 22px;
}

.org-stat.lv2 {
  padding: 8px 10px;
  background: #fff;
}

.org-stat.lv2 strong {
  font-size: 16px;
}

.org-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.org-share {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f0eeec;
  color: #777;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.org-stat strong {
  font-size: 18px;
}

.org-stat small {
  font-size: 12px;
}

#orgModalChart {
  width: 100%;
  height: 320px;
  overflow: hidden;
}

.org-modal-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.digest-poster-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 8px 14px;
  border: 1px solid #d8a9ab;
  border-radius: 8px;
  background: #fff;
  color: #b5151d;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.digest-poster-btn:hover {
  background: #faf0ef;
}

.digest-poster-btn svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 620px) {
  .org-struct-l1 {
    grid-template-columns: 1fr;
  }

  .org-struct-l2 {
    margin-left: 8px;
    padding-left: 8px;
  }
}

.digest-footer {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 1360px) {
  .kpi-grid.six,
  .kpi-grid.three,
  .kpi-grid.four,
  .leaderboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .control-band {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .workbench {
    padding-top: 12px;
  }

  .eyebrow {
    font-size: 15px;
  }

  .topbar {
    margin-bottom: 10px;
  }

  .topbar,
  .two-column,
  .leaderboard-grid,
  .dashboard-grid,
  .digest-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-right: 0;
    padding-top: 14px;
  }

  body[data-view="matrix"] .topbar {
    padding-top: 8px;
    margin-bottom: 8px;
  }

  body[data-view="matrix"] .eyebrow {
    margin-bottom: 0;
  }

  .span-2,
  .span-3 {
    grid-column: auto;
  }

  .kpi-grid.six,
  .kpi-grid.three,
  .kpi-grid.four,
  .control-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 顶部操作按钮：单行横滑，不再折成多行占屏（横滑容器必须左对齐，右对齐会让左侧溢出不可达） */
  .top-actions {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .top-actions::-webkit-scrollbar {
    display: none;
  }

  .top-actions .icon-button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
  }
}

@media (max-width: 620px) {
  .page-vip-entry {
    top: 10px;
    right: 10px;
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .status-field {
    flex-basis: 100%;
  }

  #mobileSaveImg,
  #matrixExcel,
  #zoomReset {
    flex: 0 0 auto;
  }

  .workbench {
    padding: 16px 12px 28px;
  }

  .kpi-grid.six,
  .kpi-grid.three,
  .kpi-grid.four,
  .control-band {
    grid-template-columns: 1fr;
  }

  .chart,
  .chart.mid,
  .chart.tall {
    height: 340px;
  }

  .kpi-card strong {
    white-space: normal;
  }

  /* 弹窗改为底部抽屉：占满宽度、顶部圆角、上滑入场，更贴合手机操作 */
  .modal-mask {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    padding: 10px 14px calc(18px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
    animation: sheet-up 0.24s ease;
  }

  .modal::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 8px;
    border-radius: 999px;
    background: #ddd;
  }

  .modal-head {
    position: sticky;
    top: -10px;
    z-index: 5;
    margin: -10px -14px 8px;
    padding: 10px 14px 8px;
    background: #fff;
  }

  #orgModalChart {
    height: 280px;
  }

  /* 口径切换：整行铺满，按钮变高好点；口径多时可横滑 */
  .pk-metric {
    display: flex;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .pk-metric::-webkit-scrollbar {
    display: none;
  }

  .pk-metric button {
    flex: 1 0 auto;
    min-height: 38px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  /* 内部记录表单：两列栅格铺满，输入框好点 */
  .intel-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intel-field input,
  .intel-note-field input {
    width: 100%;
  }

  .intel-form .icon-button {
    grid-column: 1 / -1;
    justify-content: center;
  }

  /* 机构胶囊：每组单行横滑，避免堆成一大块 */
  .pk-group-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .pk-group-chips::-webkit-scrollbar {
    display: none;
  }

  .pk-group-chips .channel-chip {
    min-height: 32px;
    white-space: nowrap;
  }
}

@keyframes sheet-up {
  from {
    transform: translateY(28px);
    opacity: 0.5;
  }

  to {
    transform: none;
    opacity: 1;
  }
}
