/* 股價雷達 — 米白紙感、黑線框、金色點綴；台股慣例：紅漲綠跌 */

:root {
  --bg: #faf8f3;
  --paper: #fffdf9;
  --ink: #141414;
  --muted: #6e695f;
  --line: #141414;
  --line-soft: #e0d9c9;
  --grid: #ece6d8;
  --gold: #c9b37e;
  --gold-soft: #f0e9d6;
  --up: #cf222e;
  --down: #14804a;
  --up-soft: rgba(207, 34, 46, 0.3);
  --down-soft: rgba(20, 128, 74, 0.3);
  --dot: rgba(20, 20, 20, 0.05);
  --shadow: 0 10px 30px rgba(20, 20, 20, 0.12);
  --serif: 'Noto Serif TC', 'Songti TC', 'PMingLiU', serif;
  --sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
}

[data-theme='dark'] {
  --bg: #121110;
  --paper: #1a1917;
  --ink: #f1eee7;
  --muted: #9c968b;
  --line: #57524a;
  --line-soft: #2e2c28;
  --grid: #262421;
  --gold: #c9b37e;
  --gold-soft: #2f2a1c;
  --up: #ff5c63;
  --down: #35c477;
  --up-soft: rgba(255, 92, 99, 0.32);
  --down-soft: rgba(53, 196, 119, 0.32);
  --dot: rgba(255, 255, 255, 0.035);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg) radial-gradient(var(--dot) 1px, transparent 1px) 0 0 / 22px 22px;
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 28px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--ink); }
.muted { color: var(--muted); }

/* ── 頁首 ── */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 30; }
.header-inner { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand-mark { width: 42px; height: 42px; background: #141414; color: var(--gold); display: grid; place-items: center; }
.brand-name { font-family: var(--serif); font-weight: 900; font-size: 19px; letter-spacing: 0.14em; white-space: nowrap; }
.nav { display: flex; gap: 4px; padding-left: 20px; border-left: 1px dotted var(--line); align-self: stretch; align-items: center; }
.nav a { padding: 9px 16px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.nav a:hover { border-color: var(--line-soft); }
.nav a.active { background: var(--gold); border-color: var(--line); color: #141414; }
.header-search { flex: 1; max-width: 320px; margin-left: auto; }
.header-search input { height: 40px; padding: 0 12px; }
.header-right { display: flex; align-items: center; gap: 16px; flex: none; }
.ticker { display: flex; gap: 18px; font-size: 13px; white-space: nowrap; }
.tick { display: inline-flex; align-items: baseline; gap: 6px; }
.tick em { font-style: normal; color: var(--muted); }
.tick small { font-size: 12px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); flex: none; }
.icon-btn:hover { background: var(--gold-soft); }
.icon-btn.small { width: 30px; height: 30px; border-color: var(--line-soft); font-size: 12px; color: var(--muted); }
.icon-btn.small:hover { border-color: var(--line); color: var(--ink); }

/* ── 搜尋 ── */
.search-box { position: relative; }
.search-box input {
  width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: 0; outline-offset: 0;
}
.search-box input::placeholder { color: var(--muted); }
.search-panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); max-height: 420px; overflow: auto;
}
.search-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  padding: 10px 14px; background: none; border: 0; border-bottom: 1px solid var(--line-soft); text-align: left;
}
.search-item:last-child { border-bottom: 0; }
.search-item.active, .search-item:hover { background: var(--gold-soft); }
.si-name b { display: block; font-size: 15px; }
.si-name small, .si-price small { display: block; font-size: 12px; color: var(--muted); }
.si-price { font-weight: 700; }
.si-price small { color: inherit; font-weight: 400; }
.search-empty { padding: 14px; color: var(--muted); }

/* ── 版面 ── */
main.wrap { flex: 1; padding-top: 34px; padding-bottom: 72px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.page-head { margin-bottom: 22px; }
.page-head h1, .block-head h2, .stock-head h1, .hero h1 { font-family: var(--serif); font-weight: 900; letter-spacing: 0.02em; }
.page-head h1 { font-size: 34px; line-height: 1.25; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 760px; }
.block { margin-top: 52px; }
.block-head { display: flex; align-items: baseline; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.block-head h2 { font-size: 24px; }
.block-head .sub, .sub { color: var(--muted); font-size: 13px; }
.link { margin-left: auto; border-bottom: 1px solid var(--ink); font-size: 14px; white-space: nowrap; }
.link:hover { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px;
  background: var(--paper); border: 1px solid var(--line); font-weight: 700; white-space: nowrap; border-radius: 0;
}
.btn:hover { background: var(--gold-soft); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { background: var(--ink); opacity: 0.86; }

.chip {
  display: inline-flex; align-items: center; height: 40px; padding: 0 16px; background: var(--paper);
  border: 1px solid var(--line); font-size: 15px; white-space: nowrap; border-radius: 0;
}
.chip:hover { background: var(--gold-soft); }
.chip.active { background: var(--gold); color: #141414; font-weight: 700; }
.chip.small { height: 30px; padding: 0 10px; font-size: 13px; border-color: var(--line-soft); }
.chip.small.active { border-color: var(--line); }

.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border: 1px solid var(--line-soft); font-size: 12.5px; white-space: nowrap; background: var(--paper); }
.tag-strong { border-color: var(--line); font-weight: 700; }
.tag-up { color: var(--up); border-color: var(--up); }
.tag-down { color: var(--down); border-color: var(--down); }

.panel { background: var(--paper); border: 1px solid var(--line); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-family: var(--serif); font-size: 17px; font-weight: 900; }
.panel-head > span { font-size: 12.5px; color: var(--muted); }

.notice { border: 1px solid var(--line); background: var(--paper); padding: 26px; display: grid; gap: 14px; justify-items: start; }
.notice.error { border-color: var(--up); }
.notice h3 { font-family: var(--serif); font-size: 19px; }
.notice p { color: var(--muted); max-width: 720px; }
.notice a:not(.btn) { border-bottom: 1px solid currentColor; color: var(--ink); }
.notice code { background: var(--gold-soft); padding: 1px 6px; font-size: 13px; }
.notice pre { white-space: pre-wrap; word-break: break-all; font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.steps { list-style: decimal; padding-left: 22px; display: grid; gap: 6px; }
.empty { color: var(--muted); padding: 22px 18px; text-align: center; }

/* ── 首頁 ── */
.hero { max-width: 1040px; margin: 44px auto 0; }
.eyebrow { letter-spacing: 0.16em; color: var(--muted); font-size: 14px; }
.hero h1 { font-size: clamp(30px, 5vw, 50px); line-height: 1.25; margin: 10px 0 24px; }
.hero-search { display: flex; }
.hero-search input { height: 78px; padding: 0 22px; font-size: 20px; border-right: 0; }
.hero-search .btn { height: 78px; padding: 0 34px; font-size: 18px; flex: none; }
.hero-search .search-panel { top: calc(100% + 4px); }
.chips, .preset-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.index-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 16px; margin-top: 56px; }
.index-tile { background: var(--paper); border: 1px solid var(--line); padding: 18px 22px; display: grid; gap: 2px; }
.index-tile > span { font-size: 13px; color: var(--muted); letter-spacing: 0.08em; }
.index-tile b { font-family: var(--serif); font-size: 32px; line-height: 1.25; text-align: left; }
.index-tile small { font-size: 14px; text-align: left; }
.ai-tile { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ai-tile > span { color: var(--gold); }
.ai-tile b { font-size: 21px; line-height: 1.45; }
.ai-tile small { color: var(--gold); }
.ai-tile:hover { opacity: 0.9; }

.rank-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rank-list li + li { border-top: 1px solid var(--line-soft); }
.rank-list a { display: flex; align-items: center; gap: 12px; padding: 10px 18px; }
.rank-list a:hover { background: var(--gold-soft); }
.rank-no { width: 20px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.rank-name { flex: 1; min-width: 0; }
.rank-name b { margin-right: 8px; }
.rank-name small { color: var(--muted); font-size: 12.5px; }
.rank-val { font-weight: 700; }

/* ── 表格 ── */
.table-wrap { border: 1px solid var(--line); background: var(--paper); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { font-size: 12.5px; font-weight: 500; color: var(--muted); text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--paper); }
.table th.num { text-align: right; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr[data-href]:hover { background: var(--gold-soft); }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover, .sorted { color: var(--ink) !important; }
.cell-stock a { display: grid; }
.cell-stock b { font-size: 16px; line-height: 1.35; }
.cell-stock span { font-size: 12px; color: var(--muted); }
.cell-star { width: 44px; padding-right: 0 !important; }
.cell-act { width: 52px; text-align: right; }
.q-price { display: inline-block; font-size: 17px; font-weight: 700; padding: 1px 7px; margin-right: -7px; }
.q-price.limit-up { background: var(--up); color: #fff; }
.q-price.limit-down { background: var(--down); color: #fff; }
.q-price.flash { animation: flash 0.7s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 2px var(--gold); } to { box-shadow: 0 0 0 2px transparent; } }
.q-chg { font-weight: 700; line-height: 1.3; }
.q-chg small { display: block; font-size: 12px; font-weight: 400; }
.table-note { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.table-note.warn { margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--gold); background: var(--gold-soft); color: var(--ink); }
.table td.empty { white-space: normal; padding: 40px 18px; }

.star { background: none; border: 0; padding: 4px 6px; font-size: 19px; line-height: 1; color: var(--muted); }
.star:hover { color: var(--ink); }
.star.on { color: #c9962a; }
.star.star-wide { font-size: 15px; padding: 0 18px; color: var(--bg); background: var(--ink); border: 1px solid var(--line); }
.star.star-wide.on { background: var(--gold); color: #141414; }

.watch-menu { position: absolute; z-index: 60; min-width: 210px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.wm-title { padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line-soft); }
.wm-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; background: none; border: 0; text-align: left; }
.wm-item:hover { background: var(--gold-soft); }
.wm-item small { margin-left: auto; color: var(--muted); font-size: 12px; }
.wm-check { width: 18px; font-weight: 700; color: #c9962a; }
.wm-new { border-top: 1px solid var(--line-soft); }

/* ── 自選 ── */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.tab { height: 44px; padding: 0 18px; background: var(--paper); border: 1px solid var(--line-soft); white-space: nowrap; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.tab small { font-weight: 400; font-size: 12px; }
.tab.active { border-color: var(--line); background: var(--gold); color: #141414; }
.tab-add { border-style: dashed; font-weight: 400; }
.tab:hover:not(.active) { border-color: var(--line); color: var(--ink); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.toolbar .grow { flex: 1; min-width: 240px; }
.toolbar .search-box input { height: 40px; padding: 0 12px; }

/* ── 篩選 ── */
.filters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px 16px; padding: 20px; margin: 18px 0 26px; background: var(--paper); border: 1px solid var(--line); }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--muted); }
.field input, .field select { width: 100%; height: 40px; padding: 0 10px; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 0; }
.field input:focus, .field select:focus { border-color: var(--line); outline: none; }
.input-unit { position: relative; }
.input-unit input { padding-right: 30px; }
.input-unit i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12.5px; color: var(--muted); pointer-events: none; }
.result-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.result-head b { font-family: var(--serif); font-size: 22px; }
.more { text-align: center; margin-top: 16px; }

/* ── AI 雷達 ── */
.ai-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.ai-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.market-view { margin: 0 0 18px; padding: 18px 22px; background: var(--ink); color: var(--bg); font-size: 16px; line-height: 1.75; }
.market-view span { display: block; font-size: 12.5px; letter-spacing: 0.14em; color: var(--gold); margin-bottom: 4px; }
.themes { display: grid; gap: 18px; }
.theme { background: var(--paper); border: 1px solid var(--line); }
.theme > header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.theme-no { font-family: var(--serif); font-weight: 900; color: var(--gold); font-size: 20px; }
.theme h3 { font-family: var(--serif); font-size: 21px; font-weight: 900; margin-right: 4px; }
.conf { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.conf em { font-style: normal; margin-right: 4px; }
.conf i { width: 9px; height: 9px; border: 1px solid var(--line); }
.conf i.on { background: var(--gold); }
.theme dl { display: grid; grid-template-columns: 44px 1fr; gap: 8px 12px; padding: 16px 20px; }
.theme dt { color: var(--muted); font-size: 13px; padding-top: 1px; }
.theme-stocks { border-top: 1px solid var(--line-soft); }
.theme-stocks li { display: flex; align-items: center; border-bottom: 1px solid var(--line-soft); }
.theme-stocks li:last-child { border-bottom: 0; }
.theme-stocks a { flex: 1; min-width: 0; display: grid; grid-template-columns: 110px 110px 1fr; gap: 14px; align-items: center; padding: 11px 6px 11px 20px; }
.theme-stocks a:hover { background: var(--gold-soft); }
.theme-stocks .star { margin: 0 10px; }
.ts-name b { display: block; }
.ts-name small { color: var(--muted); font-size: 12px; }
.ts-price { font-weight: 700; }
.ts-price small { display: block; font-size: 12px; font-weight: 400; }
.ts-reason { font-size: 14px; color: var(--muted); }
.theme footer { padding: 12px 20px 14px; border-top: 1px solid var(--line); display: grid; gap: 5px; font-size: 13px; }
.theme footer > span { font-size: 12px; letter-spacing: 0.12em; color: var(--muted); }
.theme footer a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme footer a:hover { text-decoration: underline; }
.theme footer small { color: var(--muted); margin-left: 8px; }
.disclaimer { margin-top: 16px; font-size: 12.5px; color: var(--muted); }

.news { position: sticky; top: 88px; }
.news-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.news-tags:empty { display: none; }
.news-list { max-height: calc(100vh - 230px); overflow: auto; }
.news-list li + li { border-top: 1px solid var(--line-soft); }
.news-list a { display: grid; gap: 4px; padding: 12px 18px; }
.news-list a:hover { background: var(--gold-soft); }
.news-list b { font-weight: 500; line-height: 1.5; }
.news-list small { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.news-list small .tag { height: 20px; padding: 0 6px; font-size: 11.5px; }
.news-list.cols { display: grid; grid-template-columns: 1fr 1fr; max-height: none; }
.news-list.cols li { border-top: 0; border-bottom: 1px solid var(--line-soft); }
.news-list.cols li:nth-child(odd) { border-right: 1px solid var(--line-soft); }
.news-list.cols li.empty, .news-list.cols li.loading { grid-column: 1 / -1; border: 0; }

/* ── 個股 ── */
.back { display: inline-block; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.back:hover { color: var(--ink); }
.stock-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.stock-head h1 { font-size: 38px; line-height: 1.2; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quote { display: grid; grid-template-columns: minmax(260px, auto) 1fr; }
.quote-main { padding: 20px 26px; border-right: 1px solid var(--line); display: grid; align-content: center; }
.quote-label { font-size: 13px; color: var(--muted); }
.quote-label em { font-style: normal; margin-left: 8px; }
.quote-price { font-family: var(--serif); font-size: 52px; line-height: 1.15; text-align: left; justify-self: start; padding: 0 6px; margin-left: -6px; }
.quote-price.limit-up { background: var(--up); color: #fff; }
.quote-price.limit-down { background: var(--down); color: #fff; }
.quote-chg { font-size: 17px; font-weight: 700; text-align: left; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.stats > div { padding: 14px 20px; border-left: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); margin: 0 0 -1px -1px; }
.stats dt { font-size: 12.5px; color: var(--muted); }
.stats dd { font-size: 19px; font-weight: 700; text-align: left; }

.stock-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; margin: 18px 0; align-items: start; }
.side { display: grid; gap: 18px; }
.chart-head { flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button { height: 34px; padding: 0 14px; background: var(--paper); border: 0; border-right: 1px solid var(--line); font-weight: 700; white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--gold-soft); }
.seg button.active { background: var(--ink); color: var(--bg); }
.seg-light:empty { display: none; }
.seg-light button { font-weight: 400; }
.seg-light button.active { background: var(--gold); color: #141414; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 10px 18px 0; font-size: 13px; color: var(--muted); min-height: 54px; align-content: flex-start; }
.legend b { color: var(--ink); font-weight: 700; }
.legend b.up { color: var(--up); }
.legend b.down { color: var(--down); }
.ma-row { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.ma i { display: inline-block; width: 10px; height: 3px; margin-right: 5px; vertical-align: middle; }
.chart { height: 470px; padding: 0 6px 8px; position: relative; }
.chart .notice { margin: 20px 12px; }

table.five { width: 100%; border-collapse: collapse; font-size: 14px; }
table.five th { font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 12px; }
table.five td { padding: 7px 12px; border-top: 1px solid var(--line-soft); font-weight: 700; }
table.five td.vol { position: relative; font-weight: 400; width: 27%; }
table.five td.vol span { position: relative; }
.bar { position: absolute; top: 5px; bottom: 5px; }
.bar-bid { right: 0; background: var(--up-soft); }
.bar-ask { left: 0; background: var(--down-soft); }
.inst li { display: grid; grid-template-columns: 52px 1fr 78px; align-items: center; gap: 10px; padding: 11px 18px; }
.inst li + li { border-top: 1px solid var(--line-soft); }
.inst li > span { font-size: 13.5px; color: var(--muted); }
.inst-track { position: relative; height: 12px; background: linear-gradient(var(--line-soft), var(--line-soft)) center / 1px 100% no-repeat; }
.inst-track i { position: absolute; top: 1px; bottom: 1px; }
.inst-track i.up { background: var(--up); }
.inst-track i.down { background: var(--down); }
.inst b { font-size: 15px; }
.stock-grid + .news { position: static; }

/* ── 頁尾、提示 ── */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0 30px; font-size: 12.5px; color: var(--muted); }
.site-footer p + p { margin-top: 4px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 18px; font-size: 14px; opacity: 0; pointer-events: none; transition: 0.2s; z-index: 80; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── 響應式 ── */
@media (max-width: 1180px) {
  .ticker { display: none; }
  .filters { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 980px) {
  .ai-layout, .stock-grid { grid-template-columns: 1fr; }
  .news { position: static; }
  .news-list { max-height: 520px; }
  .side { grid-template-columns: 1fr 1fr; }
  .rank-grid, .index-row { grid-template-columns: 1fr; }
  .hide-md { display: none; }
  .quote { grid-template-columns: 1fr; }
  .quote-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .filters { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .wrap { padding: 0 14px; }
  main.wrap { padding-top: 22px; padding-bottom: 48px; }
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-name { font-size: 17px; }
  .header-right { margin-left: auto; }
  .nav { order: 3; width: 100%; padding-left: 0; border-left: 0; overflow-x: auto; }
  .nav a { flex: 1; text-align: center; padding: 8px 10px; }
  .header-search { order: 4; max-width: none; width: 100%; flex: none; margin: 0; }
  body[data-page='home'] .header-search { display: none; }
  .hero { margin-top: 14px; }
  .hero-search input { height: 58px; font-size: 16px; padding: 0 14px; }
  .hero-search .btn { height: 58px; padding: 0 20px; font-size: 16px; }
  .index-row { margin-top: 30px; gap: 10px; }
  .index-tile b { font-size: 26px; }
  .block { margin-top: 36px; }
  .page-head h1 { font-size: 28px; }
  .stock-head h1 { font-size: 30px; }
  .table th, .table td { padding: 10px 10px; }
  .cell-stock b { font-size: 15px; }
  .q-price { font-size: 16px; }
  .hide-sm { display: none; }
  .filters { grid-template-columns: 1fr 1fr; padding: 14px; gap: 10px; }
  .side { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .quote-price { font-size: 42px; }
  .chart { height: 380px; }
  .news-list.cols { grid-template-columns: 1fr; }
  .news-list.cols li:nth-child(odd) { border-right: 0; }
  .theme-stocks a { grid-template-columns: 1fr auto; padding-left: 14px; }
  .ts-reason { grid-column: 1 / -1; }
  .theme > header, .theme dl, .theme footer { padding-left: 14px; padding-right: 14px; }
  .conf { margin-left: 0; }
  .stock-head { align-items: flex-start; flex-direction: column; }
  .toolbar .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
