/* ===== 股东导入 · 加入自选股（复用 style.css 主站浅色变量）===== */
.hi-topbar { position: sticky; top: 0; z-index: 20; }
.hi-topbar .topbar-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.hi-topbar h1 { font-size: 16px; background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-weight: 700; }

.hi-main { max-width: 1080px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }

.hi-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px;
  padding: 16px; box-shadow: 0 1px 6px rgba(0,0,0,0.05); }

.hi-desc { margin: 0 0 12px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.hi-desc b { color: var(--accent-blue); }

.hi-input { width: 100%; height: 44px; min-height: 0; resize: none; box-sizing: border-box;
  background: var(--bg-deep); border: 1px solid var(--border-default); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; color: var(--text-primary); font-family: inherit; line-height: 1.6;
  outline: none; transition: border-color .15s, box-shadow .15s; }
.hi-input:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.hi-input::placeholder { color: var(--text-muted); }

/* 折叠使用说明 */
.hi-help { margin: 0 0 12px; }
.hi-help summary { display: inline-block; font-size: 13px; color: var(--accent-blue); cursor: pointer;
  user-select: none; padding: 2px 0; }
.hi-help summary:hover { text-decoration: underline; }
.hi-help[open] summary { margin-bottom: 2px; }
.hi-help .hi-desc { margin: 8px 0 0; padding: 10px 12px; background: var(--bg-deep);
  border-radius: 8px; }

.hi-toolbar { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.hi-count { font-size: 13px; color: var(--text-muted); margin-left: auto; }

.hi-btn { border: none; border-radius: 8px; padding: 8px 18px; font-size: 14px; cursor: pointer;
  font-weight: 500; transition: all .15s; font-family: inherit; }
.hi-btn:disabled { opacity: .55; cursor: not-allowed; }
.hi-btn-primary { background: linear-gradient(135deg, var(--accent-blue-dim), var(--accent-blue)); color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25); }
.hi-btn-primary:hover:not(:disabled) { filter: brightness(1.05); }
.hi-btn-ghost { background: var(--bg-elevated); border: 1px solid var(--border-default); color: var(--text-secondary); }
.hi-btn-ghost:hover:not(:disabled) { color: var(--accent-blue); border-color: var(--accent-blue); }

/* 进度条 */
.hi-progress { margin-top: 14px; display: flex; align-items: center; gap: 10px; }
.hi-progress-bar { flex: 1; height: 6px; background: var(--bg-overlay); border-radius: 99px; overflow: hidden; }
.hi-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  transition: width .2s; }
.hi-progress-text { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

/* 登录提示 */
.hi-login h3 { margin: 0 0 8px; font-size: 15px; color: var(--text-primary); }
.hi-login-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hi-input-inline { flex: 1; min-width: 140px; background: var(--bg-deep); border: 1px solid var(--border-default);
  border-radius: 8px; padding: 8px 12px; font-size: 14px; color: var(--text-primary); font-family: inherit; outline: none; }
.hi-input-inline:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.hi-login-msg { display: block; margin-top: 8px; font-size: 13px; min-height: 18px; }
.hi-login-msg.err { color: var(--accent-red); }
.hi-login-msg.ok { color: var(--accent-green); }

/* 结果 head */
.hi-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px; }
.hi-result-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.hi-badge { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 99px; font-size: 12px;
  background: rgba(37,99,235,0.1); color: var(--accent-blue); font-weight: 600; }
.hi-result-actions { display: flex; align-items: center; gap: 12px; }
.hi-checkall { font-size: 13px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.hi-checkall input, .hi-col-check input, .hi-td-check input { width: 16px; height: 16px; cursor: pointer; }

/* 筛选栏 */
.hi-filters { display: flex; flex-wrap: wrap; gap: 14px 18px; padding: 14px; margin-bottom: 12px;
  background: var(--bg-deep); border: 1px solid var(--border-subtle); border-radius: 10px; }
.hi-filter { display: flex; flex-direction: column; gap: 6px; }
.hi-filter > label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.hi-input-num { max-width: 130px; }
.hi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hi-chip { border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-secondary);
  border-radius: 99px; padding: 5px 12px; font-size: 12px; cursor: pointer; transition: all .15s; font-family: inherit; }
.hi-chip:hover { border-color: var(--accent-blue); }
.hi-chip.on { background: rgba(37,99,235,0.12); border-color: var(--accent-blue); color: var(--accent-blue); font-weight: 600; }
.hi-filter-actions { justify-content: flex-end; }

.hi-notices { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.hi-notice { font-size: 12px; padding: 6px 10px; border-radius: 6px; line-height: 1.5; }
.hi-notice.warn { background: rgba(234,88,12,0.1); color: var(--accent-orange); }
.hi-notice.err { background: rgba(220,38,38,0.08); color: var(--accent-red); }
.hi-notice.info { background: rgba(37,99,235,0.08); color: var(--accent-blue); }

/* 分类统计条 */
.hi-catstat { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.hi-cat-chip { font-size: 12px; padding: 4px 12px; border-radius: 99px; font-weight: 600; }
.hi-cat-chip b { margin-left: 4px; }

/* 分类分组（可折叠） */
.hi-groups { display: flex; flex-direction: column; gap: 10px; }
.hi-group { border: 1px solid var(--border-subtle); border-radius: 10px; overflow: hidden; background: var(--bg-surface); }
.hi-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px; cursor: pointer; user-select: none; background: var(--bg-elevated); }
.hi-group-head:hover { background: var(--bg-overlay); }
.hi-group-title { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text-primary); }
.hi-group-count { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.hi-group-tools { display: inline-flex; align-items: center; gap: 12px; }
.hi-caret { color: var(--text-muted); transition: transform .2s; font-size: 12px; }
.hi-group.open .hi-caret { transform: rotate(180deg); }
.hi-group-body { display: none; }
.hi-group.open .hi-group-body { display: block; }

/* 组内表格 */
.hi-table-wrap { overflow-x: auto; border-top: 1px solid var(--border-subtle); max-height: 460px; overflow-y: auto; }
.hi-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 980px; }
.hi-table thead th { position: sticky; top: 0; background: var(--bg-elevated); color: var(--text-secondary);
  font-weight: 600; text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border-default); white-space: nowrap; z-index: 1; }
.hi-table tbody td { padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); color: var(--text-primary); vertical-align: top; }
.hi-table tbody tr:hover { background: var(--bg-elevated); }
.hi-col-check, .hi-td-check { width: 36px; text-align: center; }
.hi-code { font-family: 'SFMono-Regular', Consolas, monospace; color: var(--text-secondary); font-size: 12px; }
.hi-name { font-weight: 600; }

.hi-holders { display: flex; flex-direction: column; gap: 3px; }
.hi-holder-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-secondary); }
.hi-dir { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 99px; white-space: nowrap; }
.hi-dir.up { background: rgba(220,38,38,0.12); color: var(--accent-red); }
.hi-dir.down { background: rgba(22,163,74,0.12); color: var(--accent-green); }
.hi-dir.new { background: rgba(124,58,237,0.12); color: var(--accent-purple); }
.hi-dir.flat { background: var(--bg-overlay); color: var(--text-muted); }
.hi-pct { font-weight: 600; }
.hi-price-col, .hi-cap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hi-cap { color: var(--text-secondary); }
.hi-price { font-weight: 600; }
.hi-price.up { color: var(--accent-red); }
.hi-price.down { color: var(--accent-green); }
.hi-price.flat { color: var(--text-secondary); }
.hi-muted { color: var(--text-muted); }
.hi-link { color: var(--accent-blue); cursor: pointer; text-decoration: none; font-size: 12px; }
.hi-link:hover { text-decoration: underline; }

/* 底部选择栏 */
.hi-selectbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding: 10px 14px; background: var(--bg-deep); border: 1px solid var(--border-subtle); border-radius: 10px; }
.hi-selstat { font-size: 13px; color: var(--text-secondary); font-weight: 600; }

.hi-empty { text-align: center; color: var(--text-muted); font-size: 14px; padding: 30px 16px; }

/* Toast */
.hi-toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px);
  background: rgba(31,41,55,0.95); color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; max-width: 90%; text-align: center; }
.hi-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- v4: 可排序表头（点击 大→小 / 小→大）--- */
.hi-th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.hi-th-sort:hover { color: var(--accent-blue); }
.hi-th-sort.sorted { color: var(--accent-blue); }
.hi-sort-arrow { font-weight: 700; }
.hi-sortdir-chips { display: inline-flex; margin-left: 8px; }

/* v5: 组内超量提示 */
.hi-group-more{ padding:10px 14px; font-size:12px; color:#64748b; background:rgba(100,116,139,.07); border-top:1px dashed #e2e8f0; }

/* ===== 手机端深度优化（≤680px）：结果表格转卡片 ===== */

@media (max-width: 680px) {
  .hi-main { padding: 12px; gap: 12px; }
  .hi-card { padding: 14px; }
  .hi-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .hi-toolbar .hi-btn { width: 100%; }
  .hi-count { margin: 0; text-align: center; }
  .hi-result-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .hi-result-actions { width: 100%; }
  .hi-result-actions .hi-btn { flex: 1; min-width: 0; }
  .hi-selectbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .hi-selstat { text-align: center; }
  .hi-login-row { flex-direction: column; }
  .hi-login-row .hi-input-inline { width: 100%; }
  .hi-login-row .hi-btn { width: 100%; }
  /* 一行一条 + 左右滑动查看（隐藏次要列：推算价/报告期） */
  .hi-table-wrap { overflow-x: auto; max-height: none; -webkit-overflow-scrolling: touch; }
  .hi-table { min-width: 100%; border: none; }
  .hi-table thead { display: table-header-group; }
  .hi-table th, .hi-table td { white-space: nowrap; font-size: 12px; }
  .hi-table th { padding: 8px 10px; }
  .hi-table td { padding: 9px 10px; }
  .hi-table th:nth-child(6), .hi-table td:nth-child(6),
  .hi-table th:nth-child(9), .hi-table td:nth-child(9) { display: none; }
  .hi-table td .hi-code, .hi-table td .hi-name { font-weight: 600; }
  .hi-link { font-size: 12px; }
  .hi-scroll-hint { display: block; margin: 0 0 8px; color: var(--text-muted); font-size: 11px; text-align: right; }
}
