/* 4-page navigation (選股漏斗 / 我的持股 / 前瞻驗證 / 研究), the 研究 sub-navigation, the hidden 策略實驗室,
   and the 我的持股 / 研究總覽 / 前瞻驗證 pages. Owner: shell. */

/* ---------- 研究 sub-navigation ---------- */
.subtabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px var(--sp-3);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--panel) 60%, transparent);
}
.subtabs::-webkit-scrollbar { display: none; }
.subtabs[hidden] { display: none; }
.subtab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--fs-sm);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-1) ease, background var(--dur-1) ease;
}
.subtab:hover { color: var(--text); background: var(--panel-2); }
.subtab[aria-selected="true"] { color: var(--text); background: var(--panel-2); border-color: var(--border-strong); }
.badge-archived,
.badge-note {
  display: inline-block;
  padding: 0 6px;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  line-height: 1.6;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.badge-archived { color: var(--muted); border: 1px solid var(--border-strong); }
.badge-note { color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }

/* ---------- 策略實驗室 only on 研究 › 突破排行／星系／回測 ---------- */
.app.lab-hidden { grid-template-columns: 0 minmax(0, 1fr); }
.app.lab-hidden > .lab-shell { visibility: hidden; border-right: 0; }
.app.lab-hidden .topbar [data-act="lab"] { display: none; }
@media (max-width: 900px) {
  .app.lab-hidden { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 我的持股 ---------- */
.hd-host .hd { max-width: 1280px; }
.hd-urgent {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  font-size: var(--fs-md);
}
.hd-urgent b { font-size: var(--fs-xs); letter-spacing: 0.06em; color: var(--muted); }
.hd-urgent.is-danger { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); box-shadow: inset 3px 0 0 var(--danger); }
.hd-urgent.is-warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); box-shadow: inset 3px 0 0 var(--warn); }
.hd-main { padding: 14px; border-radius: var(--sv-r, 14px); background: var(--panel); border: 1px solid var(--border); }
.hd-rules { padding: 14px 16px; border-radius: var(--sv-r, 14px); background: var(--panel); border: 1px solid var(--border); }
.hd-rules h3 { margin: 0 0 8px; font-size: var(--fs-lg); }
.hd-rules h3 small { font-size: var(--fs-xs); color: var(--muted); font-weight: 400; margin-left: 6px; }
.hd-note { margin: 10px 0 0; font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; }

/* ---------- 研究總覽 ---------- */
.rs-host .rs { max-width: 1400px; }
.rs-muted { color: var(--muted); font-size: var(--fs-sm); }
.rs-ten { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 14px; }
.rs-ten__card { padding: 14px 16px; border-radius: var(--sv-r, 14px); background: var(--panel); border: 1px solid var(--border); min-width: 0; }
.rs-ten__card h3 { margin: 0 0 10px; font-size: var(--fs-lg); }
.rs-ten__card h3 small { display: block; margin-top: 3px; font-size: var(--fs-xs); font-weight: 400; color: var(--muted); line-height: 1.5; }
.rs-tablewrap { overflow-x: auto; }
.rs-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.rs-table th, .rs-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.rs-table thead th { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.rs-table tbody th { font-weight: 500; white-space: normal; min-width: 9em; }
.rs-table .num { text-align: right; font-family: var(--font-mono); }
.rs-table td small { display: block; color: var(--muted); font-size: var(--fs-2xs); }
.rs-table tr.is-bench th, .rs-table tr.is-bench td { color: var(--text); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.rs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.rs-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--sv-r, 14px);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: inset 3px 0 0 var(--rs-tone, var(--border-strong));
  min-width: 0;
}
.rs-card--neg { --rs-tone: color-mix(in srgb, var(--muted) 70%, transparent); }
.rs-card--mixed { --rs-tone: var(--warn); }
.rs-card--pos { --rs-tone: var(--accent); }
.rs-card--pending { --rs-tone: color-mix(in srgb, var(--accent) 45%, transparent); }
.rs-card header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.rs-card h3 { margin: 0; font-size: var(--fs-lg); flex: 1 1 auto; }
.rs-tone, .rs-status { font-size: var(--fs-2xs); padding: 1px 8px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); color: var(--text-2); white-space: nowrap; }
.rs-tone--mixed { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.rs-tone--pending { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.rs-q { margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.55; }
.rs-verdict { margin: 0; font-size: var(--fs-md); line-height: 1.6; }
.rs-verdict b { display: inline-block; margin-right: 8px; font-size: var(--fs-xs); color: var(--muted); letter-spacing: 0.06em; }
.rs-nums { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.rs-nums div { padding: 6px 8px; border-radius: var(--r-sm); background: var(--panel-2); min-width: 0; }
.rs-nums dt { font-size: var(--fs-2xs); color: var(--muted); line-height: 1.4; }
.rs-nums dd { margin: 2px 0 0; font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text); overflow-wrap: anywhere; }
.rs-cav { margin: 0; padding-left: 1.2em; font-size: var(--fs-xs); color: var(--muted); line-height: 1.55; }
.rs-card footer { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; font-size: var(--fs-xs); }
.rs-card footer a { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
.rs-card footer a:hover { text-decoration: underline; }
.rs-goto { font: inherit; font-size: var(--fs-xs); padding: 2px 10px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: transparent; color: var(--text-2); cursor: pointer; }
.rs-goto:hover { color: var(--text); background: var(--panel-2); }
.rs-foot { margin: 0; font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; }

/* ---------- 前瞻驗證 page ---------- */
.mu-verdict-note { margin-top: 8px !important; }
