/* invest 本機網頁的樣式：蘋果風格（系統字型、大標題、圓角卡片、毛玻璃導覽列），淺色／深色自動切換。
   電腦：頂端導覽列；手機（760px 以下）：底部分頁列，內容與按鈕都放大到好點的尺寸，輸入框 17px 免得 iPhone 自動放大。
   CSP 只准本站的樣式檔與頁面內的 style：這裡不載入任何外部字型或圖片。 */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.07);
  --fill-hover: rgba(120, 120, 128, 0.18);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --sep: rgba(60, 60, 67, 0.13);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --on-accent: #ffffff;
  --green: #1a7f35;  /* 白底 5.1:1（AA） */
  --green-soft: rgba(52, 199, 89, 0.14);
  --red: #d70015;
  --red-soft: rgba(255, 59, 48, 0.1);
  --orange: #b25000;
  --orange-soft: rgba(255, 159, 10, 0.16);
  --up: #d70015;   /* 台股習慣：漲紅 */
  --down: #1a7f35; /*        跌綠 */
  --field-bg: #ffffff;
  --field-border: rgba(0, 0, 0, 0.14);
  --nav-bg: rgba(251, 251, 253, 0.78);
  --seg-on: #ffffff;  /* 分段控制選中的那一格 */
  --btn-border: rgba(0, 113, 227, 0.38);  /* 次要按鈕的邊框（2026-10-31 使用者反映按鈕不明顯：改成有邊框的實體按鈕） */
  --card-border: rgba(0, 0, 0, 0.045);    /* 卡片的細邊，淺色底上才看得出是一張卡 */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 6px 20px rgba(0, 0, 0, 0.05);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.05), 0 16px 40px rgba(0, 0, 0, 0.1);
  --radius-xl: 22px;
  --radius-l: 18px;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "PingFang TC",
          "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --page: 1080px;
  --gutter: 22px;
  --tabbar: 0px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.14);
    --fill-hover: rgba(118, 118, 128, 0.32);
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #8e8e93;
    --sep: rgba(84, 84, 88, 0.55);
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-soft: rgba(10, 132, 255, 0.18);
    --green: #30d158;
    --green-soft: rgba(48, 209, 88, 0.16);
    --red: #ff453a;
    --red-soft: rgba(255, 69, 58, 0.16);
    --orange: #ffb340;
    --orange-soft: rgba(255, 159, 10, 0.18);
    --up: #ff453a;
    --down: #30d158;
    --field-bg: #1c1c1e;
    --field-border: rgba(255, 255, 255, 0.16);
    --nav-bg: rgba(22, 22, 23, 0.72);
    --seg-on: #636366;  /* iOS 深色分段控制的選中色：比軌道亮 */
    --btn-border: rgba(10, 132, 255, 0.5);
    --card-border: rgba(255, 255, 255, 0.06);
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-lift: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 40px rgba(0, 0, 0, 0.5);
  }
}

@supports (color: color-mix(in srgb, red, blue)) {
  :root, body.pilot { --btn-border: color-mix(in srgb, var(--accent) 42%, transparent); }
}

/* ---- 基礎 ---------------------------------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
main {
  max-width: var(--page);
  margin: 0 auto;
  padding: 28px var(--gutter) 48px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 1.3em; }
strong, b { font-weight: 600; }
code { font-family: var(--mono); font-size: 0.86em; background: var(--fill-2); padding: 1px 6px; border-radius: 6px;
       word-break: break-all; }
pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 12px;
  padding: 14px 16px;
  background: var(--fill-2);
  border-radius: var(--radius);
  font: 16px/1.65 var(--font);
}
hr { border: 0; border-top: 1px solid var(--sep); margin: 20px 0; }
mark { background: rgba(255, 214, 10, 0.45); color: inherit; border-radius: 3px; padding: 0 2px; }
[hidden] { display: none !important; }  /* 按鈕等元件有自己的 display：hidden 屬性要能蓋過去 */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---- 標題與文字 ---------------------------------------------------------------------------------------------- */

h1 {
  font-size: 36px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 6px 0 10px;
  word-break: break-word;
}
h1 .muted { font-weight: 500; font-size: 0.6em; letter-spacing: 0; margin-left: 8px; }
h2 { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.012em; margin: 0 0 14px; }
h3 { font-size: 17px; font-weight: 600; margin: 18px 0 8px; }
h2 .hint, h3 .hint { font-size: 14px; }
.lede { font-size: 19px; line-height: 1.45; color: var(--text-2); margin: 0 0 24px; max-width: 48em; }
.muted { color: var(--text-2); }
.hint { color: var(--text-3); font-weight: 400; font-size: 14px; }
label .hint { display: block; margin-top: 2px; line-height: 1.4; }
.ok { color: var(--green); font-weight: 600; }
.error { color: var(--red); }
ul.error { padding-left: 1.2em; margin: 6px 0; font-size: 15px; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.gain { color: var(--up); }    /* 損益：照台股習慣紅賺綠賠（使用者 2026-10-29 決定），和股價漲跌同色 */
.loss { color: var(--down); }
.footnote { font-size: 14px; color: var(--text-2); margin-top: 8px; }

/* ---- 頂端導覽列（電腦）------------------------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--sep);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: var(--page);
  margin: 0 auto;
  height: 52px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #0a84ff, #5e5ce6);
}
.brand-mark svg { width: 17px; height: 17px; }
/* 分組後 761px 以上都放得下，所以不再橫向捲動（捲動容器會把下拉面板裁掉；2026-10-29） */
.topnav { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.topnav a {
  display: block;
  color: var(--text-2);
  font-size: 14px;
  padding: 6px 11px;
  border-radius: 8px;
  white-space: nowrap;
}
.topnav a:hover { color: var(--text); text-decoration: none; background: var(--fill-2); }
.topnav li.on a { color: var(--text); font-weight: 600; background: var(--fill); }
.topbar .button.small { flex: none; }

/* 一般／專家模式切換（分段控制） */
.mode-switch { display: inline-flex; flex: none; margin: 0; padding: 2px; border-radius: 9px; background: var(--fill); }
.mode-switch button {
  min-height: 28px;
  padding: 3px 12px;
  border: 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  box-shadow: none;
  color: var(--text-2);
}
.mode-switch button:hover { background: var(--fill-2); color: var(--text); }
.mode-switch button.on, .mode-switch button.on:hover { background: var(--seg-on); color: var(--text);
                                                       box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }

/* 下拉選單（股票、報告、帳號）：點開合、不靠懸停；開著的和「子頁面在這組」的主項目都亮起；面板是浮在下面的卡片 */
.topnav li.menu { position: relative; }
.topbar .dropdown { position: relative; flex: none; }
.topbar .dropdown > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  font-size: 14px;
  padding: 6px 9px 6px 11px;
  border-radius: 8px;
  white-space: nowrap;
}
.topbar .dropdown > summary::-webkit-details-marker { display: none; }
.topbar .dropdown > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin: 0 1px 3px 1px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.75;
}
.topbar .dropdown > summary:hover, .topbar .dropdown[open] > summary { color: var(--text); background: var(--fill-2); }
.topnav li.menu.on > .dropdown > summary, .topbar .dropdown.account.on > summary { color: var(--text); font-weight: 600;
                                                                                   background: var(--fill); }
.topbar .dropdown.account > summary svg { width: 18px; height: 18px; }
.topbar .dropdown .panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  min-width: 200px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--sep);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
}
.topbar .dropdown .panel.right { left: auto; right: 0; }
.topbar .dropdown .panel a, .topbar .dropdown .panel button {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  box-shadow: none;
  border-radius: 9px;
  background: none;
  text-align: left;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
}
.topbar .dropdown .panel a:hover, .topbar .dropdown .panel button:hover { background: var(--fill-2); text-decoration: none; }
.topbar .dropdown .panel a.on { font-weight: 600; background: var(--fill); }
.topbar .dropdown .panel .note { margin-top: 6px; padding: 8px 12px 6px; border-top: 1px solid var(--sep); font-size: 12px;
                                 color: var(--text-3); }
.topbar .dropdown .panel form { margin: 0; }
.topbar .dropdown .panel button { color: var(--red); }

/* 761～1000px（iPad 直放、半螢幕視窗）：品牌字與帳號名只留圖示（字仍給讀螢幕軟體），導覽列才放得下 */
@media (min-width: 761px) and (max-width: 1000px) {
  .topbar-inner { gap: 12px; }
  .topnav a, .topbar .dropdown > summary { padding: 6px 8px; }
  .brand-text, .topbar .button.small .label, .topbar .dropdown.account .label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---- 底部分頁列（手機）------------------------------------------------------------------------------------ */

.tabbar { display: none; }

@media (max-width: 760px) {
  :root { --gutter: 16px; --tabbar: calc(54px + env(safe-area-inset-bottom)); }
  body { font-size: 16px; }
  main { padding: 18px var(--gutter) calc(var(--tabbar) + 28px); }
  .topbar-inner { height: 50px; justify-content: space-between; }
  .topnav, .topbar .button.small, .topbar .dropdown.account { display: none; }
  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: var(--nav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--sep);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar > a, .tabbar > details > summary {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 54px;
    color: var(--text-3);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
  }
  .tabbar > a:hover { text-decoration: none; }
  .tabbar svg { width: 26px; height: 26px; }
  .tabbar > a.on, .tabbar > details.on > summary, .tabbar > details[open] > summary { color: var(--accent); }
  .tabbar > details { flex: 1; display: flex; }
  .tabbar > details > summary { list-style: none; }
  .tabbar > details > summary::-webkit-details-marker { display: none; }
  .sheet {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(var(--tabbar) + 10px);
    max-height: calc(100vh - var(--tabbar) - 20px);  /* 項目多、螢幕矮時可以捲，不會被切掉 */
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lift);
    overflow: hidden auto;
  }
  .sheet a, .sheet button {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 52px;
    padding: 0 18px;
    color: var(--text);
    font-size: 17px;
    font-weight: 400;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--sep);
    border-radius: 0;
    box-shadow: none;
    justify-content: flex-start;
  }
  .sheet form:last-child button, .sheet > a:last-child { border-bottom: 0; }
  .sheet a:hover { text-decoration: none; background: var(--fill-2); }
  .sheet svg { width: 22px; height: 22px; color: var(--accent); }
  .sheet .sheet-note { padding: 12px 18px; font-size: 13px; color: var(--text-3); border-bottom: 1px solid var(--sep); }
  .sheet form { margin: 0; }
  .sheet button { color: var(--red); }
  .sheet button svg { color: var(--red); }
}

/* ---- 頁首、卡片、清單 -------------------------------------------------------------------------------------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap;
             margin-bottom: 4px; }
.page-head .lede { margin-bottom: 10px; }
.page-head .actions { margin: 4px 0 18px; }
.page-head > div:first-child { min-width: 0; flex: 1 1 420px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--text-2); margin: 0; letter-spacing: 0.01em; }
.card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin: 0 0 18px;
}
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
             margin-bottom: 6px; }
.card-head h2 { margin-bottom: 8px; }
.card-head > a, .card-head .muted a, .more a { font-size: 14px; font-weight: 600; white-space: nowrap; }
.card-tools { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
table.stats tr.muted td { color: var(--text-2); }
table.data.stats th.n, table.data.stats td.n { padding-right: 18px; }  /* 數字欄靠右：和下一欄之間要留空，不然 84 和 40.0% 會黏成一串 */
table.data.stats td:nth-child(6) { white-space: nowrap; }
.glossary-card dl.terms dt { font-weight: 600; color: var(--text); }
/* 下單頁的 AI 建議價格（2026-11-01） */
.ai-suggest { margin: 10px 0 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); }
.ai-suggest .note { margin-bottom: 8px; }
.ai-suggest .ai-box { background: var(--surface); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 10px; }
.ai-suggest .ai-box .eyebrow { margin-bottom: 4px; }
.ai-suggest .ai-range { font-size: 17px; margin: 2px 0 4px; }
.ai-suggest .ai-box p { margin: 0 0 6px; }
.ai-suggest .ai-box .actions { margin: 4px 0 6px; }
.ai-suggest .assess-form { margin: 4px 0; }
.ai-suggest > .hint { margin: 6px 0 0; }
/* 等 AI 的區塊（assess_wait.html）：已經多久、跑動的條、目前在做什麼；做完換新時閃一下 */
.ai-wait { background: var(--surface); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 10px; }
.ai-wait .ai-title { margin: 0 0 8px; }
.ai-wait .ai-phase { margin: 8px 0 4px; }
.ai-wait .hint { margin: 0; }
.ai-pulse { position: relative; height: 4px; border-radius: 2px; background: var(--accent-soft); overflow: hidden; }
.ai-pulse span { position: absolute; top: 0; left: -40%; width: 40%; height: 100%; border-radius: 2px; background: var(--accent);
  animation: ai-pulse 1.6s ease-in-out infinite; }
@keyframes ai-pulse { from { left: -40%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .ai-pulse span { animation: none; left: 0; width: 100%; opacity: 0.5; } }
.ai-fresh .ai-box, .ai-fresh > .warning { animation: ai-fresh 1.5s ease-out; }
@keyframes ai-fresh { from { box-shadow: 0 0 0 4px var(--accent); } to { box-shadow: 0 0 0 0 transparent; } }
.flows-card h3 { font-size: 15px; margin: 14px 0 6px; }
.flows-card h3 .hint { font-weight: 400; margin-left: 8px; }
.flows-card table.data { font-size: 14px; }
.flows-card td .hint { margin-left: 4px; }
.glossary-card dl.terms dd { color: var(--text-2); font-size: 15px; line-height: 1.55; }
.cards-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cards-2 > .card { margin: 0; }
.empty { color: var(--text-2); padding: 14px 16px; border: 1px dashed var(--sep); border-radius: var(--radius); margin: 4px 0 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--sep); padding: 12px 0; }
.list > li:last-child { border-bottom: 0; }
.list > li:first-child { padding-top: 4px; }
.row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text);
  position: relative;
  padding-right: 22px;
}
.row:hover { text-decoration: none; }
.row:hover .row-title { color: var(--accent); }
.row::after {   /* 右側的 › */
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--text-3);
  border-right: 2px solid var(--text-3);
  transform: translateY(-50%) rotate(45deg);
  opacity: 0.6;
}
.row-title { font-weight: 600; font-size: 16px; }
.row-meta { font-size: 14px; color: var(--text-2); line-height: 1.45; }
.row-extra { font-size: 14px; color: var(--text-2); margin-top: 4px; }
.plain { list-style: none; padding: 0; }
.plain li { padding: 7px 0; border-bottom: 1px solid var(--sep); }
.plain li:last-child { border-bottom: 0; }
/* AI 摘要切成的段落與條列（assess.html 的 prose）：段落之間留一點空、條列緊一點、不畫分隔線 */
.prose p { margin: 0 0 10px; }
.prose > :last-child { margin-bottom: 0; }
.prose ul.plain.tight { margin: 0 0 10px; }
.prose ul.plain.tight li { padding: 3px 0 3px 1em; text-indent: -1em; border-bottom: 0; }
.prose .eyebrow { margin: 14px 0 4px; }
.history li { font-size: 15px; white-space: pre-wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--text-2); font-size: 15px; }
.kv dd { margin: 0; word-break: break-word; }

/* 選擇器（分段控制）、標籤片 */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: var(--fill-2); border-radius: 11px;
             margin: 0 0 12px; }
.segmented a { padding: 6px 14px; border-radius: 8px; color: var(--text); font-size: 14px; font-weight: 500; }
.segmented a:hover { text-decoration: none; background: var(--fill); }
.segmented a.on { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 980px; background: var(--fill-2);
        color: var(--text); font-size: 14px; }
.chip:hover { text-decoration: none; background: var(--fill); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 980px; font-size: 13px;
         font-weight: 600; background: var(--fill); color: var(--text-2); white-space: nowrap; vertical-align: middle; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.warn { background: var(--orange-soft); color: var(--orange); }
.badge.blue { background: var(--accent-soft); color: var(--accent); }

/* ---- 按鈕 ---------------------------------------------------------------------------------------------------- */

button, .button {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 18px;
  border: 1px solid var(--btn-border);
  border-radius: 980px;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease, opacity 0.15s;
}
button:hover, .button:hover { background: var(--accent-soft); border-color: var(--accent); text-decoration: none; }
button:active, .button:active { transform: scale(0.97); }
button:disabled { opacity: 0.45; cursor: default; transform: none; }
button.primary, .button.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); font-size: 16px;
                                  min-height: 46px; padding: 10px 26px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
button.primary:hover, .button.primary:hover { background: var(--accent-hover); border-color: transparent; }
button.danger { color: var(--red); border-color: rgba(215, 0, 21, 0.4); }
button.danger:hover { background: var(--red-soft); border-color: var(--red); }
.button.small, button.small { min-height: 32px; padding: 5px 14px; font-size: 14px; }
.button.quiet, button.quiet { border-color: transparent; background: var(--fill-2); box-shadow: none; }  /* 原本的灰色樣式，給不想搶眼的 */
.wide { width: 100%; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; }
.actions form { margin: 0; }
form.inline { display: inline; }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }

/* ---- 表單 ---------------------------------------------------------------------------------------------------- */

label { display: block; font-size: 15px; font-weight: 600; margin: 18px 0 7px; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 17px;   /* 16px 以上：iPhone 點進去不會自動放大 */
  color: var(--text);
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
fieldset { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
legend { font-size: 15px; font-weight: 600; padding: 0; margin-bottom: 8px; }
fieldset > label, .options > label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 8px 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--fill-2);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s, color 0.15s;
}
fieldset > label:hover, .options > label:hover { background: var(--fill); }
fieldset > label:has(input:checked), .options > label:has(input:checked) {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.options.stacked > label { display: flex; align-items: flex-start; margin-right: 0; line-height: 1.45; }
input[type=radio], input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; flex: none; }
fieldset input[type=number] { width: 6rem; padding: 6px 10px; font-size: 16px; }
.form-section { margin-bottom: 18px; }
.form-section > h2 { font-size: 13px; text-transform: none; letter-spacing: 0.02em; color: var(--text-2); font-weight: 600;
                     margin: 0 0 -6px; }
.field-hint { font-size: 14px; color: var(--text-2); margin: 6px 0 0; min-height: 1.2em; }
.submit-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }

/* 搜尋框（放大鏡在左邊） */
.searchbar { display: flex; gap: 10px; align-items: center; margin: 0 0 18px; }
.searchbar .field { position: relative; flex: 1; }
.searchbar .field svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px;
                        color: var(--text-3); pointer-events: none; }
.searchbar input { padding-left: 42px; border-radius: 980px; background: var(--fill-2); border-color: transparent; }
.searchbar input:focus { background: var(--field-bg); }

/* ---- 提示框 ------------------------------------------------------------------------------------------------- */

.note, .warning, .general, .done {
  border-radius: 14px;
  padding: 12px 16px;
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
}
.note { background: var(--accent-soft); }
.warning { background: var(--orange-soft); }
.general { background: var(--red-soft); color: var(--text); }
.general .error, .general ul { margin: 0; }
.done { background: var(--green-soft); font-weight: 600; }

/* ---- 數字卡、走勢圖、表格 ------------------------------------------------------------------------------------ */

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 18px; }
.grid > div { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow); padding: 16px 18px; }
.grid .k { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); }
.grid .big { display: block; font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; margin: 4px 0 2px;
             font-variant-numeric: tabular-nums; word-break: break-word; }
.grid .big + span, .grid .big + .k { font-size: 13px; color: var(--text-2); }
.echo { font-size: 22px; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em; background: var(--surface);
        border-radius: var(--radius-xl); box-shadow: var(--shadow); padding: 20px 22px; margin: 0 0 16px; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.hero h1 { margin-bottom: 4px; }
.price { font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.price-sub { font-size: 14px; color: var(--text-2); margin-top: 6px; }

svg.spark { display: block; width: 100%; height: 150px; margin: 4px 0 12px; overflow: visible; }
svg.spark polyline { stroke: var(--accent); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -24px; padding: 0 24px; }
table.data, table.doc-meta { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--sep); vertical-align: top; }
table.data th { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td:first-child { font-weight: 600; }
table.data td.n, table.data th.n { text-align: right; padding-right: 0; padding-left: 12px; white-space: nowrap; }
table.doc-meta th, table.doc-meta td { text-align: left; padding: 8px 18px 8px 0; border-bottom: 1px solid var(--sep);
                                       vertical-align: top; }
table.doc-meta tr:last-child th, table.doc-meta tr:last-child td { border-bottom: 0; }
table.doc-meta th { color: var(--text-2); font-weight: 400; white-space: nowrap; width: 1%; }

details.disclosure { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow); margin: 0 0 12px; }
details.disclosure > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--text-3); }
details.disclosure[open] > summary::after { content: "−"; }
details.disclosure > .body { padding: 0 24px 20px; }
details.disclosure > .body > :first-child { margin-top: 0; }
details.plain-details summary { cursor: pointer; color: var(--accent); font-size: 15px; margin: 4px 0 8px; }

/* 搜尋結果、報告 */
.hits { list-style: none; padding: 0; margin: 8px 0 0; }
.hits li { padding: 10px 0; border-top: 1px solid var(--sep); font-size: 15px; line-height: 1.6; }
.snippet { color: var(--text); }
.result h3 { margin: 0 0 2px; font-size: 18px; }
.result .muted { font-size: 14px; }
.pages { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
         gap: 8px; }
.pages li { background: var(--fill-2); border-radius: 10px; padding: 8px 12px; font-size: 14px; border: 0; }

/* ---- 問 AI（像訊息 App）--------------------------------------------------------------------------------------- */

.chat-page main, main.chat { max-width: 820px; }
.chat-log { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 18px; }
.msg { max-width: 85%; padding: 11px 16px; border-radius: 22px; font-size: 16px; line-height: 1.55; word-wrap: break-word;
       overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 7px;
            white-space: pre-wrap; }
.msg.ai { align-self: flex-start; max-width: 94%; background: var(--surface); box-shadow: var(--shadow);
          border-bottom-left-radius: 7px; }
.msg.ai p { margin: 6px 0; }
.msg.ai p:first-child { margin-top: 0; }
.msg.ai ul, .msg.ai ol { margin: 6px 0; padding-left: 1.3em; }
.msg.ai li { margin: 3px 0; }
.msg.ai table { border-collapse: collapse; margin: 8px 0; font-size: 14px; display: block; overflow-x: auto; }
.msg.ai th, .msg.ai td { border: 1px solid var(--sep); padding: 5px 9px; text-align: left; }
.msg.ai hr { margin: 10px 0; }
.msg .steps { font-size: 13px; color: var(--text-3); margin-bottom: 4px; }
.msg .steps div::before { content: "查："; }
.msg .alert { color: var(--red); font-weight: 600; margin-top: 6px; }
.msg .notice { color: var(--orange); font-size: 14px; margin-top: 6px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.examples button { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 400;
                   white-space: normal; text-align: left; line-height: 1.35; border-radius: 16px; border-color: var(--card-border); }
.examples button:hover { background: var(--surface-2); }
.composer-wrap {
  position: sticky;
  bottom: calc(var(--tabbar) + 10px);
  z-index: 20;
  margin-top: 10px;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--sep);
  border-radius: 26px;
  box-shadow: var(--shadow-lift);
  padding: 6px 6px 6px 18px;
}
.composer textarea {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 9px 0;
  min-height: 42px;
  max-height: 200px;
  resize: none;
  font-size: 17px;
}
.composer textarea:focus { box-shadow: none; }
.composer .send {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  flex: none;
  margin-bottom: 2px;
}
.composer .send svg { width: 20px; height: 20px; }
.composer-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 6px 0; font-size: 14px; }
.composer-tools button { min-height: 30px; padding: 4px 12px; font-size: 14px; }
.composer-tools #chat-status { color: var(--text-2); }

/* ---- 一般模式：燈號、白話成績卡、結果框 --------------------------------------------------------------------- */

.light-dot { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; vertical-align: -1px;
             background: var(--fill); }
.light-dot.green { background: #34c759; box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.18); }
.light-dot.yellow { background: #ffcc00; box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.22); }
.light-dot.red { background: #ff3b30; box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.16); }
.light-dot.gray { background: #c7c7cc; }
.light-dot.none { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--text-2); margin: -8px 0 14px; }
.legend > span { display: inline-flex; align-items: center; gap: 8px; }
.score-head { display: flex; align-items: flex-start; gap: 14px; }
.score-head .light-dot { width: 18px; height: 18px; margin-top: 7px; }
.score-head h2 { margin: 0 0 2px; }
.score-head p { margin: 0; font-size: 15px; }
.score-headline { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; margin: 14px 0 8px; }
.score-headline.light-green { color: var(--green); }
.score-headline.light-red { color: var(--red); }
.score-headline.light-yellow { color: var(--orange); }
.score-headline.light-gray { color: var(--text-2); }
.facts { list-style: none; padding: 0; margin: 0 0 10px; }
.facts li { padding: 4px 0 4px 18px; position: relative; font-size: 16px; }
.facts li::before { content: ""; position: absolute; left: 4px; top: 0.85em; width: 5px; height: 5px; border-radius: 50%;
                    background: var(--text-3); }
.reliability { font-size: 14px; color: var(--text-2); background: var(--fill-2); border-radius: 10px; padding: 8px 12px;
               margin: 8px 0 6px; }
.score-mini { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--sep); }
.score-mini:last-of-type { border-bottom: 0; }
.score-mini .light-dot { margin-top: 5px; }
.score-mini .score-headline { font-size: 16px; margin: 0; }
.verdict { border-left: 0; }
.verdict-word { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
.verdict-detail { font-size: 19px; font-weight: 600; margin: 0 0 6px; }
.verdict.tone-green { background: linear-gradient(180deg, var(--green-soft), var(--surface) 70%); }
.verdict.tone-green .verdict-word { color: var(--green); }
.verdict.tone-red { background: linear-gradient(180deg, var(--red-soft), var(--surface) 70%); }
.verdict.tone-red .verdict-word { color: var(--red); }
.verdict.tone-yellow .verdict-word { color: var(--orange); }
.verdict.tone-blue .verdict-word { color: var(--accent); }
.verdict.tone-gray .verdict-word { color: var(--text-2); }
.tone { font-weight: 600; }
.tone-green { color: var(--green); }
.tone-red { color: var(--red); }
.tone-yellow { color: var(--orange); }
.tone-blue { color: var(--accent); }
.tone-gray { color: var(--text-2); }

/* ---- 登入頁 ------------------------------------------------------------------------------------------------- */

body.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(10, 132, 255, 0.16), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(94, 92, 230, 0.16), transparent 60%),
    var(--bg);
}
body.login main { width: 100%; max-width: 440px; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.login-card {
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--shadow-lift);
  padding: 40px 32px 28px;
  text-align: center;
}
.app-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 100%);
  box-shadow: 0 10px 24px rgba(10, 132, 255, 0.35);
}
.app-icon svg { width: 44px; height: 44px; }
.login-card h1 { font-size: 28px; margin: 0 0 6px; }
.login-card .sub { color: var(--text-2); font-size: 15px; margin: 0 0 26px; display: flex; align-items: center;
                   justify-content: center; gap: 6px; }
.login-card .sub svg { width: 15px; height: 15px; }
.login-card form { text-align: left; }
.field-group { border: 1px solid var(--field-border); border-radius: 14px; overflow: hidden; background: var(--field-bg);
               margin-bottom: 16px; }
.field-group input { border: 0; border-radius: 0; background: transparent; padding: 14px 16px; }
.field-group input:focus { box-shadow: none; background: var(--accent-soft); }
.field-group input + label + input, .field-group input + input { border-top: 1px solid var(--sep); }
.login-card .general { text-align: left; }
.login-card .fine { font-size: 13px; color: var(--text-3); margin: 18px 0 0; line-height: 1.5; }

/* ---- 頁尾 --------------------------------------------------------------------------------------------------- */

.site-footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter) 32px;
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.site-footer form { margin: 0; }
.site-footer svg { width: 14px; height: 14px; vertical-align: -2px; }

/* ---- 手機的細節 --------------------------------------------------------------------------------------------- */

@media (max-width: 760px) {
  h1 { font-size: 30px; }
  h2 { font-size: 20px; }
  .lede { font-size: 17px; margin-bottom: 18px; }
  .card { padding: 18px; border-radius: 18px; margin-bottom: 14px; }
  .table-wrap { margin: 0 -18px; padding: 0 18px; }
  .cards-2 { grid-template-columns: 1fr; gap: 14px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid > div { padding: 13px 14px; border-radius: 16px; }
  .grid .big { font-size: 22px; }
  .grid.tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .grid.tiles > div { padding: 12px 11px; }
  .grid.tiles .big { font-size: 19px; }
  .grid.tiles .k { font-size: 11.5px; }
  .echo { font-size: 19px; padding: 16px 18px; }
  .price { font-size: 36px; }
  .actions > .button, .actions > button, .actions > form, .actions > form > button { flex: 1 1 auto; }
  details.disclosure > summary { padding: 15px 18px; }
  details.disclosure > .body { padding: 0 18px 18px; }
  .site-footer { padding-bottom: calc(var(--tabbar) + 18px); }
  main + .site-footer { margin-top: -24px; }
  .msg { font-size: 16px; max-width: 90%; }
  .login-card { padding: 32px 22px 22px; border-radius: 24px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .score-headline { font-size: 19px; }
  .verdict-word { font-size: 26px; }
  .verdict-detail { font-size: 17px; }
  .legend { gap: 6px 14px; font-size: 13px; }
  .mode-switch button { padding: 3px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- 模擬投資（T9）---- */
.sim-card { display: block; margin-bottom: 18px; color: var(--text); }
.sim-card:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.sim-card .k { display: block; font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.sim-card .row-title, .sim-card .row-meta { display: block; }
.sim-actions .button, .order-ticket button.primary { min-height: 48px; font-size: 17px; padding-left: 22px; padding-right: 22px; }
.order-ticket input[type=text], .order-ticket select, .order-ticket textarea { font-size: 17px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
@media (max-width: 760px) {
  .sticky-next { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); background: var(--bg); padding: 10px 0;
                 margin: 0; z-index: 5; }
  .sticky-next button.primary { flex: 1; min-height: 52px; }
}

/* 帳戶頁「持股與委託」：一檔股票一個區塊（標題列＋持股一行＋委託中＋最近結果） */
.stock-groups .row-title { display: flex; justify-content: space-between; gap: 12px; }
.stock-groups .pl { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.stock-groups .sub { display: grid; grid-template-columns: 4.5em 1fr; gap: 2px 10px; margin-top: 8px; align-items: start; }
.stock-groups .sub-k { font-size: 13px; font-weight: 600; color: var(--text-3); padding-top: 4px; }
.stock-groups .sub ul.plain.tight { margin: 0; }
.stock-groups .sub ul.plain.tight li { padding: 3px 0; border-bottom: 0; font-size: 14px; color: var(--text-2); line-height: 1.5; }
.stock-groups .sub .badge { margin-right: 2px; }
@media (max-width: 760px) {
  .stock-groups .sub { grid-template-columns: 1fr; gap: 0; }
  .stock-groups .sub ul.plain.tight li { font-size: 15px; }
}

.badges .badge { white-space: normal; text-align: left; }
/* 委託與成交：分頁籤帶筆數，每張委託一個色塊（不再用細線隔開） */
.tabs { margin-bottom: 16px; }
.tabs .count { margin-left: 6px; font-size: 12px; line-height: 1.4; padding: 0 7px; border-radius: 980px; background: var(--fill); }
.tabs a.on .count { background: var(--accent-soft); color: var(--accent); }
.order-cards > li { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow); padding: 16px 18px; margin: 0 0 12px; border-bottom: 0; }
.order-cards > li:first-child { padding-top: 16px; }
.order-cards > li:last-child { margin-bottom: 0; }
.order-cards .row-title { font-size: 17px; margin-bottom: 6px; }
.order-cards .row-extra { margin-top: 6px; }
/* ---- AI 演示（ADR-0013）：這些頁面換一套強調色（紫），一看就知道不是自己的模擬 ---- */
body.pilot { --accent: #6e3bd6; --accent-hover: #7d4fe0; --accent-soft: rgba(110, 59, 214, 0.12); --nav-bg: rgba(246, 242, 253, 0.82); }
@media (prefers-color-scheme: dark) {
  body.pilot { --accent: #a78bfa; --accent-hover: #b9a3fb; --accent-soft: rgba(167, 139, 250, 0.2); --nav-bg: rgba(28, 22, 40, 0.76); }
}
.pilot-badge { background: var(--accent); color: var(--on-accent); font-weight: 700; letter-spacing: 0.02em; }
h1 .pilot-badge { font-size: 14px; vertical-align: middle; margin-right: 4px; }
.pilot-list > li, .pilot-runs > li { border-left: 4px solid var(--accent); padding-left: 14px; }
.pilot-runs > li { margin: 0 0 12px; background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; border-bottom: 0; }
.pilot-runs .row-title { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pilot-journal .eyebrow { margin-top: 10px; color: var(--accent); }
.pilot-journal p, .pilot-journal ul { margin: 4px 0; }
.pilot-order { border-left: 4px solid var(--accent); }
.pilot-order.sell { border-left-color: var(--orange); }
.pilot-order .row-extra strong { color: var(--text); }
.pilot-stats { background: var(--accent-soft); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; }
.pilot-stats p { margin: 2px 0; font-size: 14px; }
.pilot-review h3 { font-size: 16px; margin: 14px 0 6px; }
/* AI 評估頁的名詞：內文加底色連到名詞解釋，解釋旁回到內文；跳到時留出頂端導覽列的高度 */
a.term { background: var(--accent-soft); color: var(--accent); padding: 1px 6px; border-radius: 6px; text-decoration: none; }
a.term:hover { background: var(--fill-hover); }
a.term, .term-entry { scroll-margin-top: 96px; }
a.term:target, .term-entry:target { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.glossary .row-title { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.glossary .example { color: var(--text-2); }
.term-back { font-size: 13px; font-weight: 500; white-space: nowrap; }
/* 目前持股損益：列表上的色塊連到 /sim/N/pl；損益頁每檔一列 */
.sim-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sim-row .row { flex: 1 1 300px; min-width: 0; }
.sim-row .row > span > span { display: block; }  /* 標題、說明、補充各一行（手機上不擠成一團） */
.pl-link { display: flex; flex-direction: column; flex: 0 0 auto; min-width: 190px; padding: 10px 14px; border-radius: var(--radius);
           background: var(--fill-2); color: var(--text); }
.pl-link:hover { background: var(--fill); text-decoration: none; }
.pl-link .k { font-size: 12px; font-weight: 600; color: var(--text-2); }
.pl-link .v { font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pl-link.gain .v { color: var(--up); }
.pl-link.loss .v { color: var(--down); }
.pl-link .s { font-size: 13px; color: var(--text-2); }
.pl-rows .row-title { display: flex; justify-content: space-between; gap: 12px; }
.pl-rows .pl { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-rows .pl small { font-weight: 500; font-size: 13px; margin-left: 6px; }
@media (max-width: 760px) { .pl-link { width: 100%; } }
/* AI 演示分享（ADR-0013 決策 11）：清單每一列旁的「分享」、跳到「別人分享給我的」時不被頂端的導覽列蓋住 */
.sim-row .share-link { flex: 0 0 auto; }
#shared { scroll-margin-top: 80px; }
.share-picks li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
/* 今日摘要（2026-10-31）：固定八段 */
.digest-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.digest-toc a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 980px;
                background: var(--fill-2); color: var(--text); font-size: 13px; }
.digest-toc a:hover { background: var(--fill); text-decoration: none; }
.digest .num, .digest-toc .num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
                                 border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 12px;
                                 font-weight: 700; margin-right: 8px; flex: 0 0 auto; }
.digest-toc .num { width: 18px; height: 18px; font-size: 11px; margin-right: 0; }
.digest-section h2 { display: flex; align-items: center; margin-bottom: 4px; }
.digest-section .hint { margin: 0 0 10px; }
.digest-items li { padding: 6px 0; border-top: 1px solid var(--sep); line-height: 1.5; }
.digest-items li:first-child { border-top: 0; }
.digest-items li.up a, .digest-items li.up { color: var(--up); }
.digest-items li.down a, .digest-items li.down { color: var(--down); }
.digest-items li.bad { color: var(--red); }
.digest-section .more { margin: 8px 0 0; font-size: 14px; }
/* 清單頁頂端「我的模擬投資｜AI 演示」切換；帳戶頁醒目入口：委託中幾張、全部委託紀錄、每日紀錄（2026-10-31） */
.sim-switch, .group-switch { margin: 0 0 14px; }
/* 首頁「今日」（ADR-0014）：兩欄卡片 */
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 18px; }
.home-grid > .card { margin: 0; }
.home-card .card-head h2 { font-size: 19px; }
.home-line { margin: 0 0 8px; font-weight: 600; }
.status-strip { display: flex; align-items: center; gap: 10px; margin: -6px 0 16px; font-size: 14px; }
@media (max-width: 760px) { .home-grid { grid-template-columns: 1fr; gap: 12px; } }
.assess-form { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.assess-form label.check { font-size: 14px; color: var(--text-2); font-weight: 500; margin: 0; }
.tag-edit summary { margin-top: 10px; }
.quick-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 18px; }
.quick-links a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: var(--radius-l);
                 background: var(--surface); border: 1px solid var(--card-border); box-shadow: var(--shadow); color: var(--text); }
.quick-links a:hover { border-color: var(--btn-border); text-decoration: none; }
.quick-links a.hot { box-shadow: inset 4px 0 0 var(--accent), var(--shadow); }
.quick-links .k { font-size: 12px; font-weight: 600; color: var(--text-2); }
.quick-links .v { font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.quick-links .s { font-size: 13px; color: var(--text-2); }
.quick-links a.hot .v, .quick-links a.hot .s { color: var(--accent); }
@media (max-width: 760px) { .quick-links { grid-template-columns: 1fr 1fr; } .quick-links a:first-child { grid-column: 1 / -1; } }
.sticky-next { background: var(--surface); }
dl.ohlc { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px 14px; margin: 4px 0 10px; }
dl.ohlc div { min-width: 0; }
dl.ohlc dt { font-size: 13px; color: var(--text-2); }
dl.ohlc dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 760px) {
  dl.ohlc { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.card .holding-table + .kv, .card p.holding-cards + .holding-table + .kv { margin-top: 16px; }
/* ---- 投資風格（ADR-0015）：建立頁的三個選項（名稱、一句話、做法條列）、帳戶頁與清單的標籤、補選卡、換風格卡與風格紀錄
   （2026-11-06）、下單確認頁的占比 ----
   只用變數：深色模式與 AI 演示的紫色自動跟著換；不用紅、綠（台股的漲跌色），免得被看成賺賠。 */
.style-choices > label { padding: 12px 14px; }
.style-body { display: block; flex: 1 1 auto; min-width: 0; }
.style-body strong { margin-right: 4px; }
.style-points { display: block; margin: 6px 0 0; color: var(--text-2); font-size: 14px; font-weight: 400; line-height: 1.5; }
.style-points > span { display: block; padding-left: 1em; text-indent: -1em; }
.style-points > span::before { content: "・"; }
.style-note { margin: 2px 0 0; line-height: 1.5; }
.badge.style-tag { background: var(--accent-soft); color: var(--accent); white-space: normal; }
.badge.style-tag.none { background: var(--fill); color: var(--text-2); font-weight: 500; }
.row-title .badge.style-tag { margin-left: 4px; font-size: 12px; padding: 2px 8px; }
.style-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 14px; }
.style-line .muted { font-size: 14px; }
.style-line .style-change-link { font-size: 14px; font-weight: 600; white-space: nowrap; }
.style-history { margin: -8px 0 14px; font-size: 14px; line-height: 1.5; }
.style-backfill .options, .style-change .options { margin-top: 10px; }
.style-change .options > label:has(input:disabled) { cursor: default; color: var(--text-2); }  /* 目前的那個：不能選 */
.style-change .options > label:has(input:disabled):hover { background: var(--fill-2); }
.badge.style-current { margin-left: 6px; font-size: 12px; padding: 2px 8px; }
.style-check .hint { display: block; margin-top: 2px; }
.row-extra.style-extra { color: var(--text-2); }
@media (max-width: 760px) {
  .style-points { font-size: 15px; }
  .style-line { gap: 6px; }
  .style-backfill .submit-bar > button, .style-change .submit-bar > button { flex: 1; }
}
