/* ===========================================================
   Groww H5 — Screener 两页 / Financials / Shareholding
   （参考图 research-1/2/3/4）
   =========================================================== */

/* ---------- 品牌头通用小件 ---------- */
.gw-head-avatar {
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #eef1f5;
  color: var(--gw-ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gw-head-avatar .gw-icon { width: 17px; height: 17px; }
.gw-head-icon.has-dot { position: relative; }
.gw-head-icon.has-dot::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f04438;
}

/* ---------- Screener 首页 ---------- */
.gw-screener { padding-bottom: calc(var(--gw-tabbar-h) + 20px); }

.gw-scr-hero { padding: 6px var(--gw-pad) 0; }
.gw-scr-hero h1 {
  margin: 0 0 8px;
  font-size: 23px;
  font-weight: var(--gw-fw-bold);
  color: var(--gw-ink);
  letter-spacing: -0.4px;
}
.gw-scr-hero p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--gw-ink-3); }

.gw-scr-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px var(--gw-pad) 0;
}
.gw-scr-preset {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--gw-line);
  border-radius: var(--gw-r-lg);
  background: #fff;
  text-align: left;
}
.gw-scr-preset-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}
.gw-scr-preset-icon { color: var(--gw-green); display: flex; }
.gw-scr-preset-icon .gw-icon { width: 30px; height: 30px; }
.gw-scr-preset-arrow { color: var(--gw-ink); font-size: 17px; line-height: 1; }
.gw-scr-preset strong {
  font-size: 14.5px;
  font-weight: var(--gw-fw-bold);
  color: var(--gw-ink);
  line-height: 1.25;
}
.gw-scr-preset em {
  font-style: normal;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--gw-ink-3);
}

.gw-scr-saved-head { margin-top: 20px; }
.gw-scr-saved-head h2 { font-size: 16.5px; }
.gw-linkbtn {
  padding: 0;
  border: none;
  background: none;
  font-size: 13.5px;
  font-weight: var(--gw-fw-semi);
  color: var(--gw-green);
}

.gw-scr-saved {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 var(--gw-pad);
  padding: 14px;
  border: 1px solid var(--gw-line);
  border-radius: var(--gw-r-lg);
}
.gw-scr-saved-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--gw-green-soft);
  color: var(--gw-green);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gw-scr-saved-icon .gw-icon { width: 17px; height: 17px; }
.gw-scr-saved-text { font-size: 12.5px; line-height: 1.5; color: var(--gw-ink-2); }

.gw-scr-cta { padding: 18px var(--gw-pad) 0; }
.gw-scr-create {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 9px;
  background: var(--gw-green);
  color: #fff;
  font-size: 15px;
  font-weight: var(--gw-fw-semi);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ---------- Create Screener ---------- */
.gw-screener-new { padding-bottom: calc(var(--gw-tabbar-h) + 20px); }

.gw-scr-new-head { gap: 10px; }
.gw-scr-new-title {
  flex: 1;
  font-size: 17px;
  font-weight: var(--gw-fw-bold);
  color: var(--gw-ink);
  text-align: left;
}
.gw-scr-new-sub {
  margin: 2px var(--gw-pad) 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--gw-ink-3);
}

.gw-filter-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px var(--gw-pad) 0;
}
.gw-filter-row {
  padding: 12px 14px 14px;
  border: 1px solid var(--gw-line);
  border-radius: var(--gw-r-lg);
  background: #fff;
}
.gw-filter-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.gw-filter-label {
  font-size: 13.5px;
  font-weight: var(--gw-fw-semi);
  color: var(--gw-ink);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.gw-info { font-size: 11px; color: var(--gw-ink-3); }

.gw-filter-cmp {
  flex: 0 0 auto;
  max-width: 60%;
  padding: 5px 8px;
  border: 1px solid var(--gw-line);
  border-radius: 7px;
  background: #fff;
}
.gw-filter-cmp select {
  width: 100%;
  border: none;
  background: none;
  font-size: 11px;
  color: var(--gw-ink-2);
  appearance: none;
}

.gw-filter-body {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.gw-filter-slider { flex: 1; display: flex; min-width: 0; }

/* 绿色进度条：用 --gw-fill 控制已填充比例 */
.gw-filter-slider input[type='range'] {
  width: 100%;
  height: 26px;
  margin: 0;
  background: none;
  appearance: none;
  -webkit-appearance: none;
}
.gw-filter-slider input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    var(--gw-green) 0,
    var(--gw-green) var(--gw-fill),
    #e4e7ec var(--gw-fill),
    #e4e7ec 100%
  );
}
.gw-filter-slider input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  border: 2.5px solid var(--gw-green);
  background: #fff;
}

.gw-filter-value {
  width: 74px;
  flex: 0 0 auto;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--gw-line);
  border-radius: 7px;
  font-size: 13px;
  font-weight: var(--gw-fw-semi);
  color: var(--gw-ink);
  text-align: center;
}

/* Matching results 卡 */
.gw-scr-matches {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px var(--gw-pad) 0;
  padding: 14px;
  border-radius: var(--gw-r-lg);
  background: var(--gw-green-soft);
}
.gw-scr-matches span { font-size: 12.5px; color: var(--gw-ink-2); }
.gw-scr-matches > div:first-child strong {
  display: block;
  margin-top: 3px;
  font-size: 23px;
  font-weight: var(--gw-fw-bold);
  color: var(--gw-ink);
  letter-spacing: -0.4px;
}
.gw-scr-matches-avg { display: flex; align-items: center; gap: 8px; }
.gw-scr-matches-icon { color: var(--gw-green); display: flex; }
.gw-scr-matches-icon .gw-icon { width: 26px; height: 26px; }
.gw-scr-matches-num { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.gw-scr-matches-num b { font-size: 14px; font-weight: var(--gw-fw-bold); color: var(--gw-green); }
.gw-scr-matches-num em { font-style: normal; font-size: 10.5px; color: var(--gw-ink-3); }

.gw-scr-actions {
  display: flex;
  gap: 10px;
  padding: 16px var(--gw-pad) 0;
}
.gw-scr-clear {
  flex: 0 0 38%;
  height: 44px;
  border: 1px solid var(--gw-line);
  border-radius: 9px;
  background: #fff;
  color: var(--gw-ink);
  font-size: 14.5px;
  font-weight: var(--gw-fw-semi);
}
.gw-scr-view {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 9px;
  background: var(--gw-green);
  color: #fff;
  font-size: 14.5px;
  font-weight: var(--gw-fw-semi);
}

/* ---------- 个股研究页共用头部 ---------- */
.gw-research { padding-bottom: calc(var(--gw-tabbar-h) + 20px); }

.gw-scr-stock-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 2px var(--gw-pad) 0;
}
.gw-scr-stock-logo { width: 42px; flex: 0 0 auto; }
.gw-scr-stock-logo svg { width: 100%; height: auto; display: block; }
.gw-scr-stock-names { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gw-scr-stock-names strong { font-size: 16px; font-weight: var(--gw-fw-bold); color: var(--gw-ink); }
.gw-scr-stock-names em { font-style: normal; font-size: 12px; color: var(--gw-ink-3); }
.gw-scr-stock-price { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.gw-scr-stock-price b { font-size: 16.5px; font-weight: var(--gw-fw-bold); color: var(--gw-ink); }
.gw-scr-stock-price em { font-style: normal; font-size: 12.5px; font-weight: var(--gw-fw-semi); }

.gw-scr-tabs {
  display: flex;
  gap: 20px;
  padding: 0 var(--gw-pad);
  margin-top: 14px;
  border-bottom: 1px solid var(--gw-line);
  overflow-x: auto;
  scrollbar-width: none;
}
.gw-scr-tabs::-webkit-scrollbar { display: none; }
.gw-scr-tabs .gw-stock-tab {
  padding: 0 0 9px;
  border: none;
  background: none;
  font-size: 13.5px;
  font-weight: var(--gw-fw-med);
  color: var(--gw-ink-3);
  white-space: nowrap;
  position: relative;
}
.gw-scr-tabs .gw-stock-tab.is-active { color: var(--gw-ink); font-weight: var(--gw-fw-semi); }
.gw-scr-tabs .gw-stock-tab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--gw-green);
}

/* ---------- Financials ---------- */
.gw-fin-period {
  display: flex;
  gap: 8px;
  padding: 14px var(--gw-pad) 0;
}
.gw-fin-period-btn {
  height: 32px;
  padding: 0 16px;
  border: 1px solid var(--gw-line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: var(--gw-ink-2);
}
.gw-fin-period-btn.is-active {
  border-color: var(--gw-green-soft);
  background: var(--gw-green-soft);
  color: var(--gw-green);
  font-weight: var(--gw-fw-semi);
}

.gw-fin-card {
  margin: 12px var(--gw-pad) 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--gw-line);
  border-radius: var(--gw-r-lg);
}
.gw-fin-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gw-fin-card h2 {
  margin: 0;
  font-size: 14px;
  font-weight: var(--gw-fw-semi);
  color: var(--gw-ink);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.gw-fin-unit { font-size: 11px; color: var(--gw-ink-3); }

/* 柱状图：柱子等高容器 + 底部标签 */
.gw-fin-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-top: 10px;
  /* 高度要给「数值 + 柱 + 年份」三者留够空间：原来 128px 高再扣 20px padding，
     柱子按 100% 撑满会把年份标签顶出容器，2026 那根的字被裁掉。 */
  height: 150px;
  padding-bottom: 18px;
  box-sizing: border-box;
}
.gw-fin-bar {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  /* 年份是绝对定位在底部，柱区再让出标签高度，避免重叠 */
  padding-bottom: 16px;
  box-sizing: border-box;
}
.gw-fin-bar-val {
  font-size: 9.5px;
  color: var(--gw-ink-2);
  margin-bottom: 4px;
  white-space: nowrap;
}
.gw-fin-bar-col {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: #c9ecd9;
  min-height: 4px;
}
.gw-fin-bar.is-last .gw-fin-bar-col { background: var(--gw-green); }
/* 标签在柱体下方的留白里，不需要反白；最后一根柱加粗以突出「本期」 */
.gw-fin-bar.is-last .gw-fin-bar-label { color: var(--gw-ink); font-weight: 600; }
.gw-fin-bar-label {
  position: absolute;
  /* bottom:0 会压在柱身内部；柱子底部留了 16px，标标签沉到那条留白里 */
  bottom: -16px;
  font-size: 10px;
  color: var(--gw-ink-3);
  line-height: 16px;
}

.gw-fin-ratios {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 var(--gw-pad);
}
.gw-fin-ratio {
  padding: 10px 8px;
  border: 1px solid var(--gw-line);
  border-radius: 9px;
  text-align: center;
}
.gw-fin-ratio span { display: block; font-size: 10.5px; color: var(--gw-ink-3); }
.gw-fin-ratio b { display: block; margin-top: 4px; font-size: 14px; font-weight: var(--gw-fw-bold); color: var(--gw-ink); }

.gw-fin-stmt {
  width: calc(100% - var(--gw-pad) * 2);
  margin: 8px var(--gw-pad) 0;
  border-collapse: collapse;
}
.gw-fin-stmt td {
  padding: 9px 0;
  font-size: 13px;
  color: var(--gw-ink);
  border-bottom: 1px solid var(--gw-line-2);
}
.gw-fin-stmt td:nth-child(2) { text-align: right; font-weight: var(--gw-fw-semi); }
.gw-fin-stmt td:nth-child(3) { text-align: right; width: 66px; font-weight: var(--gw-fw-semi); }

/* ---------- Shareholding ---------- */
.gw-sh-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px var(--gw-pad) 0;
}
.gw-sh-chart { position: relative; width: 136px; flex: 0 0 auto; }
.gw-sh-donut { width: 100%; height: auto; display: block; }
.gw-sh-chart-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--gw-ink);
  text-align: center;
  line-height: 1.35;
}
.gw-sh-chart-label em { font-style: normal; font-size: 10px; color: var(--gw-ink-3); }

.gw-sh-legend {
  flex: 1;
  min-width: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.gw-sh-legend li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--gw-ink-2);
}
.gw-sh-legend i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.gw-sh-legend span { flex: 1; }
.gw-sh-legend b { font-weight: var(--gw-fw-semi); color: var(--gw-ink); }

.gw-sh-trend {
  margin: 16px var(--gw-pad) 0;
  border: 1px solid var(--gw-line);
  border-radius: var(--gw-r-lg);
  overflow: hidden;
}
.gw-sh-trend header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 8px;
}
.gw-sh-trend h2 { margin: 0; font-size: 14.5px; font-weight: var(--gw-fw-bold); color: var(--gw-ink); }
.gw-sh-period {
  padding: 4px 8px;
  border: 1px solid var(--gw-line);
  border-radius: 7px;
}
.gw-sh-period select { border: none; background: none; font-size: 11.5px; color: var(--gw-ink-2); appearance: none; }

.gw-sh-trend table { width: 100%; border-collapse: collapse; }
.gw-sh-trend th {
  padding: 6px 6px;
  font-size: 10.5px;
  font-weight: var(--gw-fw-med);
  color: var(--gw-ink-3);
  text-align: right;
}
.gw-sh-trend th:first-child { text-align: left; padding-left: 14px; }
.gw-sh-trend td {
  padding: 9px 6px;
  font-size: 11.5px;
  color: var(--gw-ink);
  text-align: right;
  border-top: 1px solid var(--gw-line-2);
}
.gw-sh-trend td:first-child { text-align: left; padding-left: 14px; }
.gw-sh-trend tr.is-first td { background: var(--gw-green-soft); font-weight: var(--gw-fw-semi); }
.gw-sh-trend tr:last-child td { padding-bottom: 12px; }

.gw-sh-funds, .gw-sh-similar { padding: 0 var(--gw-pad); display: flex; flex-direction: column; gap: 8px; }
.gw-sh-fund {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--gw-line);
  border-radius: var(--gw-r-md);
}
.gw-sh-fund-logo {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
}
.gw-sh-fund-names { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gw-sh-fund-names strong { font-size: 13px; font-weight: var(--gw-fw-semi); color: var(--gw-ink); }
.gw-sh-fund-names em { font-style: normal; font-size: 10.5px; color: var(--gw-ink-3); }
.gw-sh-fund b { font-size: 13px; font-weight: var(--gw-fw-semi); color: var(--gw-ink); }

.gw-sh-similar {
  flex-direction: row;
  gap: 8px;
}
.gw-sh-sim {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--gw-line);
  border-radius: var(--gw-r-md);
  text-decoration: none;
}
.gw-sh-sim-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.gw-sh-sim-names { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gw-sh-sim-names strong {
  font-size: 12.5px;
  font-weight: var(--gw-fw-bold);
  color: var(--gw-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gw-sh-sim-names em { font-style: normal; font-size: 11.5px; color: var(--gw-ink-2); }
.gw-sh-sim > em { font-style: normal; font-size: 11.5px; font-weight: var(--gw-fw-semi); }

.gw-sh-empty { padding: 14px 0; text-align: center; }
.gw-sh-trend td.gw-sh-empty { text-align: center; padding: 16px 0; }
