@font-face {
  font-family: "OPPO Sans 3.0";
  src: url("/assets/fonts/OPPOSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "OPPO Sans 3.0";
  src: url("/assets/fonts/OPPOSans-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "OPPO Sans 3.0";
  src: url("/assets/fonts/OPPOSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f3f6f8;
  --panel: #ffffff;
  --panel-2: #f8fafb;
  --line: #dfe6ec;
  --line-soft: #edf1f5;
  --text: #162331;
  --muted: #667685;
  --soft: #8a98a7;
  --green: #16a66a;
  --green-bg: #e8f7ef;
  --green-line: #b9e7cd;
  --red: #e04f4f;
  --red-bg: #fff0f0;
  --red-line: #f3c3c3;
  --blue: #246bfe;
  --amber: #c98218;
  --radius: 8px;
  --shadow: 0 14px 34px rgba(28, 45, 63, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
  font-family: "OPPO Sans 3.0", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 210px),
    var(--bg);
}

.topbar {
  min-height: 72px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 360px minmax(420px, 700px) 1fr;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.home-brand {
  width: 286px;
  height: 58px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  gap: 0;
}

.brand-symbol {
  width: 58px;
  height: 58px;
  display: block;
  object-fit: contain;
}

.brand-wordmark {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 0.9;
}

.brand-word {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-word.foresight {
  color: #231815;
  font-size: 28px;
}

.brand-word.stock {
  color: #0c37b6;
  font-size: 29px;
}

.brand-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.brand-zone {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-zone .home-brand {
  width: 226px;
  height: 52px;
  grid-template-columns: 52px minmax(0, 1fr);
  flex: 0 0 auto;
}

.brand-zone .brand-symbol {
  width: 52px;
  height: 52px;
}

.brand-zone .brand-word.foresight {
  font-size: 21px;
}

.brand-zone .brand-word.stock {
  font-size: 22px;
}

.back-button {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fbfcfd;
  color: #304050;
  font-size: 13px;
  font-weight: 720;
  white-space: nowrap;
}

.back-button:hover {
  border-color: #b8c6d3;
  background: #f4f7f9;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #172033;
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
}

.brand-title {
  display: block;
  font-size: 22px;
  line-height: 1.05;
  font-weight: 760;
}

.brand-domain {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.searchbar {
  height: 44px;
  border: 1px solid #cfd9e3;
  background: var(--panel);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: var(--soft);
  box-shadow: 0 7px 18px rgba(32, 54, 76, 0.05);
  position: relative;
}

.searchbar svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke: #7e8d9d;
}

.searchbar strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.searchbar span {
  font-size: 14px;
}

.search-input {
  min-width: 0;
  flex: 1 1 auto;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--soft);
}

.search-submit {
  height: 28px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7fafc;
  color: #304050;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.search-submit:hover {
  background: #eef4f8;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
  max-height: min(360px, 72vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(22, 35, 49, 0.14);
}

.search-form.has-suggestions .search-suggestions {
  display: grid;
  gap: 4px;
}

.search-suggestion {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
}

.search-suggestion:hover {
  background: #f3f7fa;
}

.search-suggestion-title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 760;
}

.search-suggestion-type {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.search-highlight {
  background: #fff0a8;
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  font-weight: 650;
  color: #304050;
}

.status-pill.pre .status-dot,
.status-pill.after .status-dot {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(201, 130, 24, 0.13);
}

.status-pill.closed .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(224, 79, 79, 0.13);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 166, 106, 0.13);
}

.home-layout,
.detail-layout,
.search-layout {
  min-height: 0;
  flex: 1;
  display: grid;
  align-items: start;
  gap: 18px;
  padding: 18px 24px 22px;
}

.home-layout {
  grid-template-columns: minmax(0, 1fr) 438px;
}

.detail-layout {
  grid-template-columns: minmax(0, 1fr) 370px;
}

.search-layout {
  grid-template-columns: minmax(0, 1.12fr) minmax(460px, 0.88fr);
}

.search-layout.single {
  grid-template-columns: minmax(0, 1fr);
}

.main-content,
.sidebar,
.detail-main,
.search-column {
  min-height: 0;
}

.main-content,
.detail-main,
.search-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section,
.sidebar,
.metric-card,
.search-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section {
  padding: 14px;
}

.section-head {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  margin: 0;
  font-size: 19px;
  line-height: 1;
  font-weight: 760;
}

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

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.market-card {
  height: 96px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, auto);
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
}

.market-name {
  font-size: 23px;
  line-height: 1.18;
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
  overflow: visible;
}

.market-code {
  margin-top: 5px;
  color: var(--soft);
  font-size: 13px;
  line-height: 1;
  font-weight: 680;
  letter-spacing: 0.02em;
}

.market-price {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 18px;
  padding-bottom: 1px;
  text-align: right;
}

.price {
  font-size: 23px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.change {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 24px;
  margin-top: 7px;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.change.positive {
  background: var(--green-bg);
  border: 1px solid var(--green-line);
}

.change.negative {
  background: var(--red-bg);
  border: 1px solid var(--red-line);
}

.market-card .change {
  min-width: auto;
  height: auto;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 23px;
  line-height: 1;
}

.sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 12px;
}

.sector-card {
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbfa);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sector-card.down {
  background: linear-gradient(180deg, #ffffff, #fff8f8);
}

.sector-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sector-name {
  margin: 0;
  font-size: 20px;
  font-weight: 760;
  line-height: 1.25;
}

.sector-top .change {
  min-width: auto;
  height: auto;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1.25;
}

.sector-stocks {
  display: grid;
  gap: 8px;
}

.sector-stock,
.rank-row,
.news-ticker,
.stock-line {
  display: grid;
  align-items: center;
  min-width: 0;
}

.sector-stock {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  background: rgba(246, 249, 251, 0.9);
  border: 1px solid var(--line-soft);
}

.logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
  overflow: hidden;
}

.logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.logo.round {
  border-radius: 99px;
}

.logo.big {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.logo.tiny {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 9px;
}

.c-nvda { background: #72b01d; }
.c-msft { background: #246bfe; }
.c-aapl { background: #222a35; }
.c-amzn { background: #ff9900; color: #19202b; }
.c-meta { background: #0866ff; }
.c-tsla { background: #d71920; }
.c-googl { background: #2f7df6; }
.c-avgo { background: #d8222a; }
.c-eli { background: #b51f2b; }
.c-jpm { background: #7a4f2b; }
.c-spy { background: #243b62; }
.c-qqq { background: #5d54d9; }
.c-dia { background: #a33d2d; }
.c-xlv { background: #0c8a64; }
.c-xlf { background: #1b77a6; }
.c-xle { background: #b7681c; }
.c-smh { background: #6d5bd0; }
.c-arkk { background: #dc5a38; }
.c-crm { background: #00a1e0; }
.c-orcl { background: #c74634; }
.c-nflx { background: #e50914; }
.c-pltr { background: #111827; }
.c-adbe { background: #fa0f00; }
.c-cost { background: #005dab; }
.c-xom { background: #ef3124; }
.c-bac { background: #d4001a; }

.symbol {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.mini-price {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.sector-stock .mini-price {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  font-weight: 760;
}

.mini-change {
  font-size: 12px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.hot-stock-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(156px, 1fr));
  gap: 10px;
}

.hot-stock-card {
  min-height: 150px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
  min-width: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.market-card,
.sector-stock,
.hot-stock-card,
.rank-row,
.news-ticker,
.stock-result-card {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.is-clickable-stock {
  cursor: pointer;
}

.is-clickable-stock:hover {
  border-color: #b9c9d7;
  box-shadow: 0 9px 22px rgba(33, 55, 75, 0.1);
  transform: translateY(-1px);
}

.stock-card-top {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.stock-name {
  font-size: 15px;
  color: var(--text);
  font-weight: 820;
  white-space: normal;
  overflow: visible;
  line-height: 1;
  overflow-wrap: anywhere;
}

.stock-symbol {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.12;
  white-space: nowrap;
}

.stock-card-price {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: start;
  gap: 6px;
  min-width: 0;
}

.stock-card-price strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stock-card-price span {
  text-align: right;
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.sparkline {
  width: 100%;
  height: 31px;
  display: block;
}

.sparkline-empty {
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #f7fafc;
  color: var(--soft);
  font-size: 11px;
  font-weight: 680;
}

.sparkline path,
.sparkline polyline {
  fill: none;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline .area {
  stroke: none;
  opacity: 0.13;
}

.rank-section {
  flex: 1 1 auto;
  min-height: 0;
}

.rank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.rank-card {
  min-height: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.rank-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 760;
}

.rank-list {
  display: grid;
  gap: 7px;
}

.rank-row {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px;
  border-radius: 7px;
  background: #f8fafb;
}

.rank-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 820;
  white-space: nowrap;
  overflow: visible;
}

.rank-code {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
  white-space: nowrap;
}

.rank-value {
  text-align: right;
  white-space: nowrap;
}

.rank-value strong {
  display: block;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.rank-value span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.sidebar {
  height: 100%;
  min-height: 0;
  padding: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.news-list {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.news-head {
  align-items: center;
  gap: 10px;
}

.important-switch {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.important-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  width: 32px;
  height: 18px;
  border: 1px solid #cbd6df;
  border-radius: 999px;
  background: #edf2f6;
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(22, 35, 49, 0.22);
  transition: transform 0.18s ease;
}

.important-switch input:checked + .switch-track {
  border-color: var(--red);
  background: var(--red);
}

.important-switch input:checked + .switch-track::after {
  transform: translateX(14px);
}

.news-item {
  flex: 0 0 auto;
  min-height: 76px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfd;
}

.news-item.important {
  border-color: var(--red-line);
  background: #fffafa;
}

.news-item > div {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.news-time {
  flex: 0 0 42px;
  color: var(--soft);
  font-size: 11px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.news-title {
  width: 100%;
  margin: 0;
  overflow: hidden;
  position: relative;
  font-size: 13px;
  line-height: 1.32;
  font-weight: 650;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.news-brief {
  width: 100%;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
  white-space: pre-line;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.news-item.expanded .news-brief {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}

.news-item.is-collapsible .news-title {
  cursor: pointer;
}

.news-item.important .news-time,
.news-item.important .news-title {
  color: var(--red);
}

.news-item.expanded .news-title {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}

.news-toggle {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 760;
  line-height: inherit;
  cursor: pointer;
}

.news-item.is-collapsible .news-toggle {
  display: inline;
}

.news-item.is-collapsible:not(.expanded) .news-toggle {
  position: absolute;
  top: auto;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding-left: 3px;
  background: #fbfcfd;
}

.news-item.important .news-toggle {
  color: var(--red);
}

.news-item.important.is-collapsible:not(.expanded) .news-toggle {
  background: #fffafa;
}

.news-image-button {
  width: min(168px, 100%);
  height: 126px;
  aspect-ratio: 4 / 3;
  flex: 0 0 auto;
  display: block;
  margin-top: 7px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: #eef3f7;
  cursor: zoom-in;
}

.news-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.news-ticker {
  margin-top: 5px;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  grid-template-columns: 24px minmax(0, 1fr) max-content max-content;
  gap: 6px;
  font-size: 11px;
  justify-content: start;
  padding: 3px 6px 3px 3px;
  border-radius: 7px;
  border: 1px solid var(--line-soft);
  background: #ffffff;
}

.news-ticker strong {
  min-width: 0;
  font-size: 11px;
  white-space: nowrap;
}

.news-ticker .mini-price {
  margin: 0;
  white-space: nowrap;
}

.news-ticker .mini-change {
  white-space: nowrap;
}

.news-meta-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.news-meta-row .news-ticker {
  margin-top: 0;
}

.news-empty {
  padding: 18px 10px;
  border: 1px dashed #cfd9e3;
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 720;
}

.news-image-viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 44px;
  background: rgba(15, 23, 42, 0.68);
}

.news-image-viewer.active {
  display: grid;
}

.news-image-viewer img {
  max-width: min(900px, 88vw);
  max-height: 78vh;
  display: block;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.34);
  background: #ffffff;
}

.news-image-viewer-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sector-badge {
  width: 92px;
  aspect-ratio: 1 / 1;
  padding: 10px;
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sector-badge strong {
  display: block;
  font-size: 13px;
}

.sector-badge span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.sector-badge.up {
  background: var(--green);
}

.sector-badge.down {
  background: var(--red);
}

.stock-hero {
  height: 148px;
  flex: 0 0 148px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.security-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.security-name {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.security-name h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 820;
}

.security-code {
  color: var(--muted);
  font-size: 18px;
  font-weight: 780;
}

.security-price {
  margin-top: 12px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.security-price strong {
  font-size: 34px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.security-price .change,
.security-price .price-delta {
  min-width: auto;
  height: auto;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 34px;
  line-height: 1;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.stock-hero .tag-row {
  display: grid;
  grid-template-columns: repeat(4, 78px);
  justify-content: end;
  align-items: start;
  gap: 8px;
  margin-top: 14px;
  padding-bottom: 2px;
}

.stock-hero .sector-badge {
  width: 78px;
}

.stock-hero .sector-badge strong,
.stock-hero .sector-badge span {
  font-size: 12px;
}

.time-state {
  text-align: right;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}

.chart-area {
  height: 356px;
  flex: 0 0 356px;
  display: flex;
  flex-direction: column;
}

.chart-head {
  justify-content: flex-start;
}

.chart-head .tabs {
  justify-content: flex-start;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbfc;
  color: #455464;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 690;
}

.tab.active {
  color: #ffffff;
  border-color: #1d2a3a;
  background: #1d2a3a;
}

.candles {
  flex: 1;
  width: 100%;
  min-height: 0;
}

.tv-chart-shell {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.tv-chart {
  width: 100%;
  height: 276px;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 12px;
  display: none;
  min-width: 176px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(22, 35, 49, 0.12);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 2px;
}

.chart-area.tv-ready .candles {
  display: none;
}

.empty-state {
  padding: 18px 12px;
  border: 1px dashed #d5dee7;
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 720;
}

.metric-card {
  height: 100%;
  padding: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.metric {
  min-height: 80px;
  padding: 13px;
  border-radius: 8px;
  background: #f8fafb;
  border: 1px solid var(--line-soft);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 11px;
  font-size: 19px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.flow-section {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.flow-panel {
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
}

.flow-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.flow-card {
  height: 78px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: #f8fafb;
  padding: 12px;
}

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

.flow-card strong {
  display: block;
  margin-top: 10px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.bar-chart {
  height: 188px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px 14px 10px;
}

.bars {
  height: 132px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.bar-wrap {
  height: 100%;
  display: flex;
  align-items: end;
  justify-content: center;
}

.bar {
  width: 36px;
  border-radius: 7px 7px 0 0;
  background: var(--green);
}

.bar.negative-bar {
  background: var(--red);
}

.bar-labels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.info-panel {
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.compact-list {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.compact-item {
  padding: 10px;
  border-radius: 8px;
  background: #f8fafb;
  border: 1px solid var(--line-soft);
}

.compact-item span {
  color: var(--soft);
  font-size: 12px;
}

.compact-item p {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.35;
}

.search-panel {
  min-height: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.search-summary {
  height: 92px;
  flex: 0 0 92px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.search-summary h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 820;
}

.search-summary p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.result-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.result-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-soft);
  background: #fbfcfd;
  border-radius: 8px;
}

.result-time {
  color: var(--soft);
  font-size: 12px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.result-title {
  margin: 0;
  font-size: 15px;
  font-weight: 720;
  line-height: 1.3;
}

.result-desc {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

mark {
  background: #fff2a8;
  color: #1d2a3a;
  border-radius: 3px;
  padding: 0 2px;
}

.result-ticker {
  display: grid;
  grid-template-columns: 28px minmax(0, auto);
  gap: 7px;
  align-items: center;
  min-width: 128px;
}

.stock-result-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  overflow: auto;
}

.stock-result-card {
  min-height: 112px;
  padding: 13px;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: #fbfcfd;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.stock-result-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 760;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-result-card .stock-code-row {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.stock-result-card .stock-line {
  margin-top: 12px;
  grid-template-columns: auto auto;
  justify-content: space-between;
  gap: 10px;
}

.stock-result-card .stock-line strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.tab-panel {
  min-height: 0;
  display: none;
  flex-direction: column;
}

.search-panel > .tab-panel {
  flex: 1 1 auto;
}

.tab-panel .result-list,
.tab-panel .stock-result-grid {
  flex: 1 1 auto;
}

.tab-panel.active {
  display: flex;
}

.tab-button {
  cursor: pointer;
}

.quote-flash {
  animation: quoteFlash 0.9s ease;
}

@keyframes quoteFlash {
  0% { background-color: rgba(36, 107, 254, 0.12); }
  100% { background-color: transparent; }
}

@media (min-width: 1181px) {
  body.home-page {
    overflow: hidden;
  }

  .home-page .page-shell {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  .home-page .home-layout {
    height: calc(100vh - 72px);
    min-height: 0;
    align-items: stretch;
    overflow: hidden;
  }

  .home-page .main-content {
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
  }

  .home-page .sidebar {
    height: 100%;
  }

  .home-page .news-list {
    overscroll-behavior: contain;
  }
}

@media (max-width: 1500px) {
  .topbar {
    grid-template-columns: 300px minmax(320px, 1fr) auto;
    gap: 18px;
  }

  .home-brand {
    width: 270px;
    height: 56px;
  }

  .brand-zone .home-brand {
    width: 208px;
    height: 48px;
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .brand-zone .brand-symbol {
    width: 48px;
    height: 48px;
  }

  .brand-zone .brand-word.foresight {
    font-size: 19px;
  }

  .brand-zone .brand-word.stock {
    font-size: 20px;
  }

  .home-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
  }

  .hot-stock-card {
    padding: 8px;
  }

  .hot-stock-grid {
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  }

  .stock-name {
    font-size: 14px;
  }
}

@media (max-width: 1180px) {
  .home-layout,
  .detail-layout,
  .search-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar,
  .metric-card {
    height: auto;
  }

  .news-list {
    max-height: none;
    overflow: visible;
  }

  .detail-layout {
    align-items: stretch;
  }

  .stock-hero {
    height: auto;
    min-height: 148px;
  }
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 14px 18px;
  }

  .searchbar,
  .top-actions {
    width: 100%;
    min-width: 0;
  }

  .top-actions {
    justify-self: stretch;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .home-layout,
  .detail-layout,
  .search-layout {
    padding: 14px;
  }

  .stock-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .time-state {
    text-align: left;
  }

  .stock-hero .tag-row {
    grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
    justify-content: start;
  }

  .stock-hero .sector-badge {
    width: 100%;
  }

  .flow-cards,
  .metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .chart-area {
    height: 338px;
    flex-basis: 338px;
  }

  .tv-chart {
    height: 260px;
  }

  .result-item {
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: start;
  }

  .result-ticker {
    grid-column: 2;
    justify-self: start;
  }

  .result-desc {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

@media (max-width: 640px) {
  .brand-zone {
    align-items: flex-start;
    gap: 10px;
  }

  .brand-zone .home-brand {
    width: min(240px, calc(100vw - 92px));
    height: 48px;
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .brand-zone .brand-symbol {
    width: 48px;
    height: 48px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .brand-title {
    font-size: 19px;
  }

  .brand-domain {
    display: none;
  }

  .home-brand {
    width: min(286px, 100%);
    height: 54px;
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .brand-symbol {
    width: 54px;
    height: 54px;
  }

  .brand-word.foresight {
    font-size: 25px;
  }

  .brand-word.stock {
    font-size: 26px;
  }

  .back-button {
    height: 34px;
    padding: 0 10px;
  }

  .searchbar {
    min-height: 42px;
    height: auto;
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .search-input {
    min-height: 24px;
    flex: 1 1 calc(100% - 42px);
  }

  .search-submit {
    margin-left: auto;
  }

  .search-suggestions {
    max-height: 62vh;
  }

  .top-actions {
    gap: 8px;
    font-size: 12px;
  }

  .status-pill {
    height: 30px;
    padding: 0 10px;
  }

  .home-layout,
  .detail-layout,
  .search-layout {
    gap: 12px;
    padding: 12px;
  }

  .hot-stock-grid {
    grid-template-columns: repeat(auto-fit, minmax(152px, 1fr));
  }

  .hot-stock-card {
    min-height: 148px;
  }

  .chart-area {
    height: 318px;
    flex-basis: 318px;
  }

  .tv-chart {
    height: 240px;
  }

  .section,
  .sidebar,
  .metric-card,
  .search-panel {
    padding: 12px;
  }

  .section-head {
    height: auto;
    min-height: 28px;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
  }

  .section-title {
    font-size: 18px;
  }

  .market-grid,
  .rank-grid,
  .stock-result-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .market-card {
    height: auto;
    min-height: 92px;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .market-name {
    font-size: 22px;
    white-space: normal;
  }

  .market-price {
    justify-content: flex-start;
    gap: 14px;
    text-align: left;
  }

  .price,
  .market-card .change {
    font-size: 22px;
  }

  .sector-grid,
  .hot-stock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sector-card {
    padding: 11px;
  }

  .sector-name,
  .sector-top .change {
    font-size: 17px;
  }

  .sector-stock {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .sector-stock .mini-change {
    grid-column: 2;
    justify-self: start;
  }

  .stock-name {
    font-size: 14px;
  }

  .stock-card-price {
    gap: 6px;
  }

  .news-item {
    gap: 7px;
  }

  .news-time {
    flex-basis: 38px;
  }

  .news-image-button {
    width: min(148px, 100%);
    height: 111px;
  }

  .security-title {
    align-items: flex-start;
  }

  .security-name h1 {
    font-size: 23px;
  }

  .security-code {
    font-size: 16px;
  }

  .security-price {
    flex-wrap: wrap;
    gap: 9px 12px;
  }

  .security-price strong,
  .security-price .change,
  .security-price .price-delta {
    font-size: 28px;
  }

  .chart-area {
    height: 360px;
    flex-basis: 360px;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .flow-cards,
  .metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bars,
  .bar-labels {
    gap: 8px;
  }

  .bar {
    width: 26px;
  }

  .search-summary {
    height: auto;
    flex-basis: auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 4px;
  }

  .search-summary h1 {
    font-size: 23px;
  }

  .result-item {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .result-ticker {
    min-width: 0;
  }

  .stock-result-card h3 {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .stock-result-card .stock-line {
    justify-content: start;
    gap: 12px;
  }
}

@media (max-width: 380px) {
  .topbar {
    padding: 12px;
  }

  .home-layout,
  .detail-layout,
  .search-layout {
    padding: 10px;
  }

  .section,
  .sidebar,
  .metric-card,
  .search-panel {
    padding: 10px;
  }

  .sector-grid,
  .hot-stock-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stock-result-card {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .logo.big {
    width: 34px;
    height: 34px;
  }

  .security-price strong,
  .security-price .change,
  .security-price .price-delta {
    font-size: 25px;
  }
}
