/* ============================================================
   Watchpilot · research.css
   段: 研报 Panel
   (从 hero-panels.css 第 2279-2698 行拆出)
   ============================================================ */

  /* ═════════════════════════════════════════════════════════════════
     研报 Panel · 东方财富密度 × Watchpilot 极简
     表头 sticky + 12 列 + 一屏 25 行 + 红绿仅用于评级和涨跌
     ═════════════════════════════════════════════════════════════════ */
  
  .research-container {
    margin: -32px -32px 0 -32px;
    background: var(--bg-main);
  }
  @media (max-width: 768px) {
    .research-container { margin: 0; }
  }
  
  /* 页面头(标题 + 搜索 + 自选 + 最近更新) */
  .research-pagehead {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
  }
  .research-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-1);
    letter-spacing: -0.5px;
  }
  .research-title em {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    color: var(--text-2);
  }
  .research-search {
    flex: 1;
    max-width: 320px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 5px 10px;
    height: 30px;
  }
  .research-search input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-1);
    width: 100%;
  }
  .research-search input::placeholder { color: var(--text-3); }
  .research-search svg { color: var(--text-3); flex-shrink: 0; }
  
  .research-pagehead-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 18px;
  }
  
  /* 「仅看自选股」复选框 */
  .research-only-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
  }
  .research-only-check input {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid var(--border-strong);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    background: var(--bg-card);
    margin: 0;
    flex-shrink: 0;
  }
  .research-only-check input:checked {
    background: var(--accent);
    border-color: var(--accent);
  }
  .research-only-check input:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 1.8px 1.8px 0;
    transform: rotate(45deg);
  }
  
  .research-update {
    font-size: 12px;
    color: var(--text-3);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
  }
  
  /* 顶部 Tab 行 */
  .research-tabnav {
    display: flex;
    align-items: center;
    gap: 28px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 24px;
    height: 44px;
  }
  .research-tabnav-item {
    font-size: 14px;
    color: var(--text-2);
    cursor: pointer;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    transition: color 0.12s;
    user-select: none;
    letter-spacing: -0.1px;
  }
  .research-tabnav-item:hover { color: var(--text-1); }
  .research-tabnav-item.active {
    color: var(--accent);
    font-weight: 600;
  }
  .research-tabnav-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
  }
  
  /* 筛选行(时间/行业/评级/变动) */
  .research-filters {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    padding: 10px 24px;
  }
  .filter-row {
    display: flex;
    flex-wrap: wrap;
    row-gap: 6px;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
  }
  .filter-row + .filter-row { border-top: 1px dashed var(--border-subtle); padding-top: 8px; margin-top: 2px; }
  .filter-label {
    font-size: 12px;
    color: var(--text-3);
    width: 36px;
    flex-shrink: 0;
    font-weight: 500;
  }
  .chip {
    font-size: 13px;
    height: 24px;
    padding: 0 12px;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.12s;
    user-select: none;
    font-family: var(--font-sans);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
  }
  .chip:hover { background: var(--bg-hover); color: var(--text-1); }
  .chip.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
  }
  .chip.more {
    color: var(--text-3);
    border: 1px dashed var(--border-strong);
  }
  
  /* 表格 */
  .research-table-wrap {
    background: var(--bg-card);
    margin: 0;
  }
  
  .research-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
  }
  
  .research-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 5;
  }
  .research-table thead th {
    text-align: left;
    padding: 11px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    letter-spacing: 0.04em;
    border-bottom: 1.5px solid var(--border-strong);
    background: var(--bg-card);
    user-select: none;
    cursor: pointer;
    white-space: nowrap;
  }
  .research-table thead th:hover { color: var(--text-1); }
  .research-table thead th.num { text-align: right; }
  .research-table thead th .sort-icon {
    color: var(--text-4);
    margin-left: 2px;
    font-size: 10px;
  }
  
  .research-table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.08s;
  }
  .research-table tbody tr:hover { background: var(--bg-hover); }
  .research-table tbody td {
    padding: 11px 10px;
    color: var(--text-1);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .research-table tbody td.num {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    text-align: right;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.2px;
  }
  
  /* 股票列(名+代码) */
  .rt-stock {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  .rt-stock-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1);
    letter-spacing: -0.1px;
  }
  .rt-stock-code {
    font-size: 11px;
    color: var(--text-3);
    font-family: var(--font-mono);
    letter-spacing: -0.3px;
  }
  
  /* 评级标签 5 档 */
  .rating {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 3px;
    line-height: 1.5;
    text-align: center;
  }
  .rating-buy     { background: #E63946; color: white; }
  .rating-hold    { background: rgba(230,57,70,0.10); color: var(--up); }
  .rating-neutral { background: var(--bg-subtle); color: var(--text-2); }
  .rating-reduce  { background: rgba(6,167,125,0.10); color: var(--down); }
  .rating-sell    { background: #06A77D; color: white; }
  
  /* 变动箭头 */
  .change-icon {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    font-family: var(--font-mono);
    width: 18px;
  }
  .change-up    { color: var(--up); }
  .change-down  { color: var(--down); }
  .change-keep  { color: var(--text-3); }
  .change-new   { color: var(--accent); }
  
  /* 研报标题(单行 ellipsis) */
  .rt-title {
    font-size: 13px;
    color: var(--text-1);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.1px;
  }
  .research-table tbody tr:hover .rt-title { color: var(--text-1); }
  
  /* 机构/分析师 */
  .rt-org { color: var(--text-2); font-size: 13px; }
  .rt-analyst { color: var(--text-2); font-size: 13px; }
  
  /* 月报数 + 关注度条 */
  .rt-count-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
  }
  .rt-count {
    font-size: 13px;
    font-weight: 500;
  }
  .rt-count.low { color: var(--text-3); }
  .rt-count.mid { color: var(--text-1); font-weight: 600; }
  .rt-count.high { color: var(--up); font-weight: 700; }
  .rt-count-bar {
    width: 36px;
    height: 2.5px;
    background: var(--bg-subtle);
    overflow: hidden;
  }
  .rt-count-bar-fill {
    height: 100%;
    background: var(--up);
  }
  
  /* 数值列 */
  .rt-num-empty { color: var(--text-3); }
  
  /* 日期列 */
  .rt-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-3);
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  .rt-date.today { color: var(--up); font-weight: 600; }
  
  /* 分页 */
  .research-pagination {
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-3);
  }
  .research-pagination .total {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
  }
  .pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .page-btn {
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--text-2);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.12s;
    user-select: none;
  }
  .page-btn:hover { background: var(--bg-hover); color: var(--text-1); }
  .page-btn.active {
    background: var(--accent);
    color: white;
  }
  .page-btn.ellipsis { cursor: default; color: var(--text-3); }
  .page-btn.ellipsis:hover { background: transparent; color: var(--text-3); }
  
  /* 列宽 */
  .col-stock    { width: 110px; }
  .col-rating   { width: 60px; }
  .col-change   { width: 38px;  text-align: center; }
  .col-title    { width: auto; }
  .col-org      { width: 92px; }
  .col-analyst  { width: 70px; }
  .col-count    { width: 80px; text-align: right; }
  .col-eps      { width: 70px; text-align: right; }
  .col-pe       { width: 60px; text-align: right; }
  .col-date     { width: 64px; text-align: right; }

  /* 行业 chip — row 用 flex 让 label 浮左, 子容器 .industry-chips-grid 内用 grid */
  .research-filters .filter-row[data-row="industry"] {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 8px;
  }
  .research-filters .filter-row[data-row="industry"] > .filter-label {
    flex: 0 0 auto;
    padding-top: 4px;
    min-width: 40px;
  }
  .research-filters .filter-row[data-row="industry"] .industry-chips-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
  }
  .research-filters .filter-row[data-row="industry"] .industry-chips-grid > .chip {
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
  }

  /* 近 3 月没数据的评级/变动 chip 灰显 + 禁用点击 */
  .research-filters .chip.chip-empty {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
  }

  /* 行业 chip 折叠 — 没数据的默认隐藏 */
  .research-filters .industry-chips-grid .chip.chip-hidden {
    display: none;
  }
  .research-filters .industry-chips-grid .chip.chip-more {
    border: 1px dashed var(--border-strong);
    color: var(--text-3);
    cursor: pointer;
  }
  .research-filters .industry-chips-grid .chip.chip-more:hover {
    color: var(--text-1);
    background: var(--bg-hover);
  }

  .research-table thead th .sort-icon {
    display: inline-block !important;
    margin-left: 4px !important;
    padding: 0 !important;
    font-size: 10px !important;
    color: var(--text-3) !important;
    vertical-align: middle !important;
    position: static !important;
    float: none !important;
  }

  /* 表头排序图标 — 强力覆盖原 CSS (sort-icon 紧跟列名后) */
  .research-table thead th {
    white-space: nowrap !important;
    position: relative !important;
    overflow: visible !important;
  }
  .research-table thead th > .sort-icon,
  .research-table thead th .sort-icon {
    display: inline-block !important;
    position: static !important;
    margin: 0 0 0 4px !important;
    padding: 0 !important;
    right: auto !important;
    left: auto !important;
    top: auto !important;
    font-size: 10px !important;
    color: var(--text-3) !important;
    vertical-align: middle !important;
    float: none !important;
    transform: none !important;
  }
  .research-table thead th .sort-icon.active {
    color: var(--accent) !important;
    font-weight: bold;
  }
