/* 數字用的等寬字型（只含英數符號，約 12KB）；中文用手機內建字型，打開不用等字型下載 */
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jbm-400.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jbm-500.woff') format('woff'); font-weight: 500; font-style: normal; font-display: swap; }
:root {
  --bg: #0E1013;
  --card: #15181D;
  --card2: #1A1E24;
  --line: #262A31;
  --line2: #333842;
  --text: #EDEBE6;
  --soft: #C4C8CE;
  --muted: #9AA0A8;
  --accent: #5EE3A1;
  --amber: #F2B866;
  --red: #E5766B;
  --gold: #C9A86A;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang TC', 'Noto Sans TC', 'Noto Sans CJK TC', 'Microsoft JhengHei', sans-serif;
  --tabbar: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

.wrap { max-width: 640px; margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) 20px calc(var(--tabbar) + 40px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 22px; }
.wrap.bare { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }

/* 頁首 */
.top { display: flex; flex-direction: column; gap: 6px; }
.top-row { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.badge-demo { font-size: 11px; color: var(--gold); border: 1px solid #5A4A2A; border-radius: 999px; padding: 1px 8px; }
h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: .02em; }
h2 { margin: 0; font-size: 15px; font-weight: 500; }
.sub { margin: 0; font-size: 13px; color: var(--muted); }
.notice { font-size: 13px; line-height: 1.65; color: var(--gold); background: rgba(201,168,106,.08); border: 1px solid #3F3626; border-radius: 12px; padding: 12px 14px; }
.tip { font-size: 13px; line-height: 1.65; color: var(--soft); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; }
.tip a { color: var(--accent); white-space: nowrap; }
.tip svg { flex: none; width: 18px; height: 18px; color: var(--accent); margin-top: 2px; }

/* 數字卡 */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { background: var(--card); padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-label { font-size: 11px; color: var(--muted); }
.kpi-val { font-family: var(--mono); font-size: 22px; font-weight: 500; line-height: 1.2; }
.kpi-val.accent { color: var(--accent); }

/* 篩選與排序 */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 13px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line2); color: var(--soft); display: inline-flex; align-items: center; gap: 6px; }
.chip .n { font-family: var(--mono); opacity: .7; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.toggle[aria-pressed="true"] { background: rgba(201,168,106,.14); color: var(--gold); border-color: #5A4A2A; }
.sortbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.seg { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg button { font-size: 12px; color: var(--muted); border-radius: 7px; padding: 6px 10px; min-height: 30px; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.seg.wide { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); }

/* 標籤 */
.lv { font-size: 12px; font-weight: 500; border-radius: 6px; padding: 1px 7px; white-space: nowrap; line-height: 1.55; display: inline-block; }
.lv.lv2 { color: var(--bg); background: var(--accent); border: 1px solid var(--accent); }
.lv.lv1 { color: var(--accent); border: 1px solid var(--accent); }
.lv.near { color: var(--soft); border: 1px dashed #5A606B; }
.lv.none { color: var(--muted); border: 1px solid var(--line2); }
.lv.sm, .wk.sm, .tag.sm { font-size: 11px; padding: 0 5px; line-height: 18px; }
.wk { font-size: 12px; color: var(--soft); border: 1px solid var(--line2); border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line2); border-radius: 4px; padding: 0 6px; line-height: 18px; white-space: nowrap; }
.tag.big { color: var(--gold); border-color: #5A4A2A; }

/* 週數分組與列表 */
.group { display: flex; flex-direction: column; gap: 10px; }
.group-head { display: flex; align-items: center; justify-content: space-between; }
.group-title { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.group-count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.list { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; min-height: 64px; border-top: 1px solid var(--line); transition: background .15s; }
.row:first-child { border-top: 0; }
.row:hover, .row:active { background: var(--card2); }
.row-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.code { font-family: var(--mono); font-size: 15px; font-weight: 500; flex: none; }
.name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.side-val { font-family: var(--mono); font-size: 15px; }
.side-label { font-size: 11px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); font-size: 14px; line-height: 1.7; padding: 36px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.empty h2 { color: var(--text); margin-bottom: 6px; }
.foot { font-size: 12px; line-height: 1.8; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.foot p { margin: 0; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-note { font-size: 12px; color: var(--muted); line-height: 1.65; margin: 0; }
.chart svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 16px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-ring { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--accent); }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.lg-line { width: 14px; height: 2px; background: var(--soft); }

/* 詳情 */
.nav { display: flex; justify-content: space-between; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 14px; color: var(--soft); padding-right: 12px; }
.back svg { width: 18px; height: 18px; }
.d-head { display: flex; flex-direction: column; gap: 10px; }
.d-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.d-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.d-title h1 { font-family: var(--mono); font-size: 30px; font-weight: 500; }
.d-name { font-size: 17px; }
.d-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.d-price .big { font-family: var(--mono); font-size: 22px; }
.d-price .chg { font-size: 14px; color: var(--soft); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cell { background: var(--card); padding: 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cell-label { font-size: 11px; color: var(--muted); }
.cell-val { font-family: var(--mono); font-size: 17px; }
.cell-val.txt { font-family: var(--sans); font-size: 16px; font-weight: 500; }
.cell-sub { font-size: 11px; color: var(--muted); }

.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { font-weight: 400; color: var(--muted); text-align: right; padding: 6px 4px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td { font-family: var(--mono); text-align: right; padding: 9px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { font-family: var(--sans); color: var(--soft); }
.pos { color: var(--text); }
.neg { color: var(--muted); }
.dim { color: var(--muted); }

.events { display: flex; flex-direction: column; }
.event { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.event:first-child { border-top: 0; padding-top: 0; }
.event-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.event-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.event-grid div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.event-grid .h { font-size: 10.5px; color: var(--muted); }
.event-grid .v { font-family: var(--mono); font-size: 13px; }
.event-grid .b { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

.actions { display: flex; flex-direction: column; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; font-size: 15px; font-weight: 500; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.accent { background: var(--accent); color: var(--bg); }
.btn.ghost { border: 1px solid var(--line2); color: var(--text); font-weight: 400; }
.btn.ghost[aria-pressed="true"] { border-color: rgba(94,227,161,.5); color: var(--accent); }
.btn.small { min-height: 36px; font-size: 13px; padding: 0 12px; border-radius: 9px; }
.btn.danger { border: 1px solid #5B2F2B; color: var(--red); font-weight: 400; }
.btn.block { width: 100%; }
.link { color: var(--accent); }
.link.muted { color: var(--soft); text-decoration: underline; text-underline-offset: 3px; }

/* 表單 */
form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); }
.field textarea { min-height: 112px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); padding: 12px 14px; font: inherit; font-size: 16px; line-height: 1.7; width: 100%; resize: vertical; }
.field textarea:focus { outline: none; border-color: var(--accent); }
.field .count { align-self: flex-end; font-size: 11px; color: var(--muted); }
.field input, .field select { height: 48px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); padding: 0 14px; font: inherit; font-size: 16px; width: 100%; }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field input.mono { font-family: var(--mono); letter-spacing: .04em; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--soft); line-height: 1.6; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.form-error { font-size: 13px; color: var(--red); min-height: 0; margin: 0; }
.form-ok { font-size: 13px; color: var(--accent); margin: 0; }
.inline { display: flex; flex-direction: row; gap: 8px; align-items: stretch; }
.inline .field { flex: 1; }
.inline .btn { align-self: flex-end; min-height: 48px; }

/* 登入頁 */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 24px; max-width: 420px; margin: 0 auto; padding: calc(32px + env(safe-area-inset-top)) 22px calc(32px + env(safe-area-inset-bottom)); }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.brand .mark { margin-left: -2px; }
.brand h1 { font-size: 24px; }
.auth .links { display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--muted); }

/* 自選 */
.w-item { display: grid; grid-template-columns: minmax(0, 1fr) auto 40px; align-items: center; gap: 8px; padding: 10px 4px 10px 16px; border-top: 1px solid var(--line); }
.w-item:first-child { border-top: 0; }
.w-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 4px 0; }
.icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); border-radius: 10px; }
.icon-btn svg { width: 16px; height: 16px; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.search-row:first-child { border-top: 0; }

/* 文章 */
.prose h2 { font-size: 16px; }
.prose p, .prose li { font-size: 14px; line-height: 1.8; color: var(--soft); margin: 0; }
.prose ol, .prose ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.prose b { color: var(--text); font-weight: 500; }
.defs { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; margin: 0; align-items: baseline; }
.defs dt { margin: 0; }
.defs dd { margin: 0; font-size: 13px; line-height: 1.7; color: var(--soft); }

/* 帳號 */
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 4px 0; }
.kv span:first-child { color: var(--muted); }
.dev { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.dev:first-of-type { border-top: 0; }
.dev-name { font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dev-sub { font-size: 11px; color: var(--muted); }

/* 後台 */
.keys-out { font-family: var(--mono); font-size: 13px; background: var(--bg); border: 1px solid var(--line2); border-radius: 10px; padding: 12px; white-space: pre-wrap; word-break: break-all; margin: 0; }
.admin-row { border-top: 1px solid var(--line); padding: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.admin-row:first-of-type { border-top: 0; }
.admin-row .top-line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* 底部分頁 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(14,16,19,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar nav { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: var(--tabbar); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--muted); }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--accent); }

/* 對話框與提示 */
.modal-back { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.62); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.modal { background: var(--card); border: 1px solid var(--line2); border-radius: 18px 18px 0 0; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 700px) { .modal-back { align-items: center; } .modal { border-radius: 18px; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); z-index: 50; background: var(--text); color: var(--bg); font-size: 14px; padding: 10px 16px; border-radius: 10px; max-width: calc(100% - 40px); }
.install { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px 10px 14px; font-size: 13px; color: var(--soft); }
.install img { width: 32px; height: 32px; border-radius: 8px; }
.install span { flex: 1; }

@media (min-width: 700px) {
  .wrap { padding-top: 44px; }
  h1 { font-size: 28px; }
}

/* 首頁金句 */
.quote { margin: 0; padding: 2px 0 2px 16px; border-left: 2px solid var(--gold); display: flex; flex-direction: column; gap: 8px; }
.quote blockquote { margin: 0; font-size: 15px; line-height: 1.85; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.quote figcaption { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.quote figcaption a { margin-left: auto; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.quote-add { align-self: flex-start; font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.quote-mini { margin: 0; padding-left: 12px; border-left: 2px solid var(--gold); font-size: 14px; line-height: 1.75; color: var(--soft); white-space: pre-line; overflow-wrap: anywhere; }
.q-row .q-text { margin: 0; font-size: 14px; line-height: 1.75; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.q-row.on .q-text { padding-left: 12px; border-left: 2px solid var(--gold); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* 上次訊號、回到訊號價附近 */
.icon-btn.end { margin-left: auto; margin-right: -10px; }
.icon-btn.end svg { width: 19px; height: 19px; color: var(--soft); }
.views button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; min-height: 36px; }
.views .n { font-family: var(--mono); opacity: .7; }
.tag.past { color: var(--soft); border-style: dashed; }
.s-last { font-size: 12px; color: var(--muted); line-height: 1.5; display: flex; flex-wrap: wrap; column-gap: 10px; }
.s-last span { white-space: nowrap; }
.s-last b { font-family: var(--mono); font-weight: 500; color: var(--soft); }
.last-sig .card-head h2 { color: var(--gold); }
.ls-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ls-grid > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ls-val { font-family: var(--mono); font-size: 17px; }
.ls-val.strong { color: var(--gold); font-weight: 500; }
.ls-sub { font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* 標誌 */
.mark { --s: 40px; display: block; width: var(--s); height: var(--s); flex: none; border-radius: calc(var(--s) * .23); -webkit-user-select: none; user-select: none; }
.mark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.top-row .mark { margin: -6px 2px -6px -2px; }

/* 名單以外的訊號、續跌提醒、新進入 */
.lv.anders { color: var(--gold); border: 1px solid #5A4A2A; background: rgba(201,168,106,.08); }
.tag.warn { color: var(--red); border-color: #5B2F2B; }
.tag.new { color: var(--bg); background: var(--accent); border-color: var(--accent); font-weight: 500; }
.s-warn { font-size: 12px; color: var(--gold); line-height: 1.5; }

/* 前高與回到前高 */
.s-hi { font-size: 12px; color: var(--muted); line-height: 1.5; display: flex; flex-wrap: wrap; column-gap: 6px; }
.s-hi b { font-family: var(--mono); font-weight: 500; color: var(--soft); }
.s-hi i { font-style: normal; opacity: .5; }
.hi-rec { font-size: 13px; color: var(--soft); line-height: 1.6; margin: 0; }
.hi-rec b { font-family: var(--mono); font-weight: 500; color: var(--text); }
.mkt-line { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 0; display: flex; flex-wrap: wrap; column-gap: 6px; }
.mkt-line b { font-family: var(--mono); font-weight: 500; color: var(--soft); }
.mkt-line i { font-style: normal; opacity: .5; }
.mkt-line span { flex-basis: 100%; color: var(--gold); }
.mkt-line.bear { background: rgba(201,168,106,.08); border: 1px solid #5A4A2A; border-radius: 12px; padding: 10px 12px; }

/* 數據上色 */
.side-val.win { color: var(--accent, #5EE3A1); }
.side-val.gold, .ls-val.gold { color: var(--gold); }
.side-sub { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
.ls-val.win, .event-grid .v.win { color: var(--accent, #5EE3A1); }
.tbl td.hl { color: #5EE3A1; }
.tbl td.hl.strong { background: rgba(94,227,161,.12); font-weight: 600; border-radius: 6px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.prose b.em { color: #5EE3A1; }
.prose b.em-gold { color: var(--gold); }
.hl-card { border-color: #2C5A43; background: linear-gradient(180deg, rgba(94,227,161,.06), transparent 70%), var(--card); }

/* 評價 */
.reviews { display: flex; flex-direction: column; gap: 10px; }
.review { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.review blockquote { margin: 0; font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; }
.review figcaption { margin-top: 8px; font-size: 12px; color: var(--muted); }
.review-text { white-space: pre-wrap; font-size: 14px; line-height: 1.6; margin: 6px 0; }
#tabbar a { position: relative; }
#tabbar .dot { position: absolute; top: 6px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: #E5484D; }
.badge-new { display: inline-block; margin-left: 6px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #E5484D; color: #fff; font-size: 11px; line-height: 18px; text-align: center; vertical-align: middle; }
textarea { width: 100%; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; resize: vertical; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.side-val.hot { color: #7CF5B8; font-weight: 700; text-shadow: 0 0 12px rgba(94,227,161,.35); }
.row-side .side-label, .row-side .side-sub { text-align: right; white-space: nowrap; line-height: 1.35; }
.row-side .side-label { font-size: 11px; }
.legend-note { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 0; }
.legend-note .side-val { font-size: 16px; flex: none; }

/* 底部選單永遠貼底：往下延伸一段同色底，iOS 切頁或回彈時下方不會露出空隙 */
.tabbar { background: #0E1013; transform: translateZ(0); will-change: transform; }
.tabbar::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 200px; background: #0E1013; }
body { min-height: 100vh; min-height: 100dvh; overscroll-behavior-y: none; }
.intro-note { margin: -6px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.intro-note b { color: var(--soft); font-weight: 500; }
/* 表現表格：最佳持有期間 */
.best { display: inline-block; margin-left: 6px; font-family: var(--sans); font-size: 10.5px; font-weight: 600; line-height: 16px; padding: 0 5px; border-radius: 5px; color: var(--bg); background: var(--accent, #5EE3A1); vertical-align: 1px; }
.tbl tr.best-row td { background: rgba(94,227,161,.06); }
.card-lead { margin: 0 0 4px; font-size: 13.5px; line-height: 1.6; color: var(--soft); }
.card-lead b { color: var(--text); }
/* 名單右側：勝過大盤機率 */
.row-side .side-label { margin-bottom: -2px; }
.row-side .side-val { font-size: 17px; }
/* 最近搜尋 */
.recent-head { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 0 4px; }
.recent-head h2 { font-size: 15px; margin: 0; }
.list.recent { padding: 0; }
.recent-row { display: flex; align-items: baseline; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
.recent-row:last-child { border-bottom: 0; }
.recent-row .code { font-family: var(--mono); font-weight: 600; flex: none; }
.recent-row .name { color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 核心業務、同產業 */
.core-line { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; font-size: 13.5px; }
.core-label { flex: none; font-size: 11.5px; color: var(--gold); border: 1px solid #5A4A2A; background: rgba(201,168,106,.08); border-radius: 6px; padding: 0 6px; line-height: 20px; }
.core-val { color: var(--soft); }
.peer { display: flex; flex-direction: column; gap: 8px; }
.peer-label { font-size: 12px; color: var(--muted); }
.peer-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.peer-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 12px; border: 1px solid var(--line2); border-radius: 12px; background: var(--card); color: var(--text); font-size: 14px; }
.peer-chip b { font-weight: 600; }
.peer-chip span { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.peer-chip i { font-style: normal; color: var(--accent); }
.peer-chip:active { background: var(--line); }
.tag-hits { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 14px; }
.tag-row { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--text); }
.tag-row:first-child { border-top: 0; }
.s-core { font-size: 12.5px; color: var(--soft); }

/* 新手教學：聚光燈＋說明卡 */
.tour { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.tour-shade, .tour-block { position: fixed; pointer-events: auto; }
.tour.busy::before { content: ''; position: fixed; inset: 0; pointer-events: auto; }
.tour-ring { position: fixed; border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 2px var(--accent), 0 0 22px 3px rgba(94,227,161,.32), 0 0 0 200vmax rgba(5,7,9,.74); }
.tour-ring.none { box-shadow: 0 0 0 200vmax rgba(5,7,9,.74); }
.tour-card { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); max-width: 480px; margin: 0 auto; pointer-events: auto; background: var(--card2); border: 1px solid var(--line2); border-radius: 18px; padding: 14px 16px; box-shadow: 0 18px 50px rgba(0,0,0,.55); transition: opacity .18s ease; }
.tour-card.at-top { bottom: auto; top: calc(14px + env(safe-area-inset-top)); }
.tour-card.center { bottom: auto; top: 50%; transform: translateY(-50%); }
.tour.busy .tour-card { opacity: 0; }
.tour-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tour-step { font: 500 12px/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.tour-bar { flex: 1; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.tour-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .25s ease; }
.tour-skip { color: var(--muted); font-size: 13px; padding: 6px 2px 6px 8px; }
.tour-card h3 { margin: 0 0 6px; font-size: 17px; line-height: 1.4; }
.tour-text { color: var(--soft); font-size: 14px; line-height: 1.7; }
.tour-text b { color: var(--text); }
.tour-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.tour-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tour-actions .btn { min-width: 96px; }
.tour-card.center .tour-actions .btn.primary { flex: 1; }
.tour-replay { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.tour-replay span { display: flex; flex-direction: column; gap: 2px; }
.tour-replay small { color: var(--muted); font-size: 13px; }
.tour-replay i { font-style: normal; color: var(--accent); font-size: 14px; white-space: nowrap; }
.tour-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }

/* 名單頁標頭：品牌字放大，「入選名單」貼著列表 */
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: .03em; color: var(--text); }
.home-top .sub { margin-top: 2px; }
.list-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: -10px; }
.list-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.list-title h1 { font-size: 24px; }
.list-count { font-size: 12.5px; color: var(--muted); }

/* 摺疊說明 */
.fold-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 0; color: var(--muted); font-size: 13px; text-align: left; }
.fold-head > span { flex: 1; }
.fold-arrow { width: 7px; height: 7px; margin: 0 4px 3px 0; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .22s ease; flex: none; }
.fold.open .fold-arrow { transform: rotate(225deg); margin-bottom: -3px; }
.fold-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease; }
.fold.open .fold-body { grid-template-rows: 1fr; }
.fold-in { min-height: 0; overflow: hidden; color: var(--soft); font-size: 13.5px; line-height: 1.7; }
.fold-in > :first-child { margin-top: 0; }
.fold-in > :last-child { margin-bottom: 8px; }
.fold-in p { margin: 0 0 6px; }
.fold-list { margin: 0 0 8px; padding-left: 1.15em; display: flex; flex-direction: column; gap: 4px; }
.card .fold { margin-top: -4px; }
.card .fold-head { padding: 6px 0 2px; }
.guide-folds { gap: 0; padding-top: 6px; padding-bottom: 6px; }
.guide-folds .fold + .fold { border-top: 1px solid var(--line); }
.guide-folds .fold-head { padding: 12px 0; color: var(--text); font-size: 15px; font-weight: 500; }
.guide-folds .fold-in { font-size: 14px; }
.tour.picking .tour-actions, .tour.picking .tour-bar { visibility: hidden; }
.tour.picking .tour-actions { display: none; }
.tour-lead { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.tour-picks { display: flex; flex-direction: column; gap: 10px; }
.tour-picks .btn { justify-content: space-between; min-height: 52px; font-size: 15.5px; font-weight: 500; }
.tour-picks small { font-size: 12.5px; opacity: .7; font-weight: 400; }
.perf-week .ls-grid { margin-bottom: 2px; }
.perf-tbl td a { color: var(--text); }
.perf-g { display: block; font-size: 11px; color: var(--muted); }
.foot-links { display: flex; gap: 20px; }
.foot-links a { color: var(--accent); font-size: 13px; }
.tour-dim, .tour-ring2 { display: none; }
.tour.multi .tour-dim { display: block; position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tour.multi .tour-ring, .tour.multi .tour-ring2 { box-shadow: 0 0 0 2px var(--accent), 0 0 22px 3px rgba(94,227,161,.32); }
.tour.multi .tour-ring2 { display: block; position: fixed; border-radius: 14px; pointer-events: none; }
/* 龍頭權值：獨立的開關，和市場選擇分開 */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-text b { font-size: 14px; font-weight: 500; }
.switch-text small { font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 46px; height: 28px; flex: none; border-radius: 14px; background: var(--line2); transition: background .2s ease; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"] i { transform: translateX(18px); }
/* 個股頁上方的小按鈕：加入自選、TradingView */
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; width: fit-content; max-width: 100%; }
.d-actions .btn { min-height: 38px; padding: 0 14px; font-size: 13px; gap: 6px; }
.d-actions .btn svg { width: 14px; height: 14px; }
.d-actions #watchBtn[aria-pressed="true"] { color: var(--accent); border-color: rgba(94,227,161,.45); }
.d-actions #watchBtn[aria-pressed="true"] svg { fill: currentColor; }

/* 推播通知 */
.push-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.65; color: var(--soft); }
.push-card p { margin: 0; }
.push-card .btn { align-self: flex-start; margin-top: 2px; }
.push-head { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.push-head svg, .push-line svg, .d-push svg { flex: none; width: 16px; height: 16px; color: var(--accent); }
.push-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--soft); padding: 2px 2px; }
.push-line span { flex: 1; min-width: 0; }
.push-line .link { padding: 6px 4px; font-size: 13px; }
.d-push { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); min-height: 20px; }
.d-push .link { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 0; }
.alerts { padding: 0; gap: 0; overflow: hidden; }
.alerts .card-head { padding: 14px 16px 10px; }
.alert-row { display: flex; align-items: baseline; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--text); font-size: 13px; }
.al-date { font-family: var(--mono); color: var(--muted); flex: none; width: 40px; }
.al-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--soft); }
.al-name b { font-family: var(--mono); font-weight: 600; color: var(--text); }
.al-px { flex: none; color: var(--muted); font-size: 12px; }

/* 語言切換（登入、註冊、帳號頁） */
.lang-switch { display: inline-flex; align-self: flex-end; border: 1px solid var(--line2); border-radius: 999px; padding: 3px; gap: 2px; }
.lang-switch button { font-size: 13px; padding: 6px 12px; border-radius: 999px; color: var(--muted); }
.lang-switch button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.card > .lang-switch { align-self: flex-start; }

/* 試用快到期的提醒 */
.trial-tip { align-items: center; color: var(--text); text-decoration: none; }
.trial-tip span { flex: 1; }
.trial-tip b { color: var(--accent); font-weight: 500; white-space: nowrap; }
.invite-tip { border-color: rgba(94,227,161,.35); }

/* 心得／建議 */
.fb-box { display: flex; flex-direction: column; gap: 12px; }
.fb-box h2 { margin: 0; }
.fb-picks { display: flex; flex-direction: column; gap: 10px; }
.fb-picks .btn { flex-direction: column; align-items: flex-start; gap: 2px; min-height: 58px; padding: 10px 16px; text-align: left; }
.fb-picks .btn b { font-weight: 500; font-size: 15px; }
.fb-picks .btn small { font-size: 12.5px; color: var(--muted); }
.fb-box > .link.muted, .fb-box form .link.muted { align-self: center; padding: 8px; }
.bonus-note { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.review figcaption .link.small { font-size: 12px; padding: 0; }

/* 延長使用期 */
.sec-title { font-size: 15px; margin: 6px 0 -2px; color: var(--soft); font-weight: 500; }
.perk { gap: 10px; }
.perk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.perk-head h3 { margin: 0; font-size: 16px; }
.perk .btn { align-self: flex-start; }
.invite-box { display: flex; gap: 8px; align-items: center; }
.invite-box input { flex: 1; min-width: 0; height: 40px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); color: var(--soft); padding: 0 12px; font-size: 12.5px; }
.perk-link { flex-direction: row; align-items: center; justify-content: space-between; color: var(--text); text-decoration: none; }
.perk-link h2 { margin: 0 0 4px; }
.perk-link i { color: var(--accent); font-style: normal; font-size: 20px; }
a.notice { display: block; text-decoration: none; }

/* 英文文字比較長：自選、搜尋、產業頁的小字可以換行，不會壓到右邊的價格 */
.s-last span { white-space: normal; }
.w-item .w-main, .search-row .w-main, .tag-row { overflow-wrap: anywhere; }
.w-item .row-side { max-width: 112px; }
.w-item .row-side .side-label { white-space: normal; text-align: right; }
.w-item { column-gap: 12px; }

/* 名單：名稱旁的星號直接加入自選；勝率說明放在每一列下方 */
.row.row-v2 { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.row-stat { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }
.row-stat .stat-cap { font-size: 12px; color: var(--muted); line-height: 1.5; }
.row-stat .side-val { font-size: 20px; flex: none; }
.row-star { flex: none; width: 28px; height: 28px; margin: -6px -4px -6px auto; display: grid; place-items: center; color: var(--muted); border-radius: 50%; cursor: pointer; }
.row-star svg { width: 18px; height: 18px; }
.row-star.on { color: var(--gold); }
.row-star.on svg { fill: currentColor; }
.row-star:active { transform: scale(.9); }
.recent-row .row-star { margin-left: auto; align-self: center; }
.recent-row { align-items: center; }
.tag.alert { color: #E8A23A; border-color: #5A4220; }
.notice.alert { color: #F0B35A; border-color: #5A4220; background: rgba(232,162,58,.08); margin-bottom: 12px; }
.admin-notice { display: block; margin: 0 0 12px; font-size: 13px; color: var(--muted); text-decoration: underline; }
label.radio { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 15px; }

/* 個股提醒 */
#remBtn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }

/* 延長使用期：邀請 + 心得 + 建議 */
.perk-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.perk-btn { text-align: left; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin: 0; }
.perk-btn b { font-size: 15px; }
.perk-btn small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.perk-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.invite-perk h3, .invite-perk h2 { display: flex; align-items: center; gap: 8px; }
.invite-perk svg { width: 18px; height: 18px; }

/* App 內建瀏覽器提示 */
.inapp-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--accent); color: #fff; font-size: 13px; line-height: 1.5; }
.inapp-bar span { flex: 1; }
.inapp-bar .btn { flex: none; background: #fff; color: #111; border-color: #fff; }

/* 安裝教學 */
.ins-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ins-step { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; font-size: 15px; line-height: 1.6; }
.ins-step small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.ins-n { width: 28px; height: 28px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.ins-ic { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); }
.ins-ic svg { width: 20px; height: 20px; }
.ins-ic .mark, .ins-ic img { border-radius: 8px; }
.ins-one { margin-bottom: 4px; }
.ins-warn { border-color: var(--accent); }
.ins-warn .btn { margin: 10px 0; }

/* 個股頁：上一檔／下一檔 */
html, body { overscroll-behavior-x: none; overflow-x: hidden; }
#app { will-change: auto; }
.d-pager { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.d-pager button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--soft); border-radius: 10px; }
.d-pager button svg { width: 18px; height: 18px; }
.d-pager button[data-step="1"] svg { transform: scaleX(-1); }
.d-pager button:disabled { opacity: .3; }

/* 首頁搜尋：放大好點 */
.icon-btn.end { width: 48px; height: 48px; margin-right: -6px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); }
.icon-btn.end svg { width: 24px; height: 24px; color: var(--text); }

/* 左右滑：旁邊預先畫好的上一檔／下一檔 */
.peek { position: fixed; inset: 0; overflow: hidden; pointer-events: none; visibility: hidden; background: var(--bg); z-index: 5; }
.peek > .wrap { min-height: 100%; }

/* Email 驗證碼 */
.code-input { font-family: var(--mono); font-size: 26px; letter-spacing: .4em; text-align: center; padding-left: .4em; }
.fold-card summary { cursor: pointer; color: var(--soft); font-size: 14px; list-style: none; }
.fold-card summary::-webkit-details-marker { display: none; }
.fold-card[open] summary { margin-bottom: 14px; }
.auth .btn.block + .btn.block { margin-top: 10px; }
