/* shared.css — site-wide tokens + masthead.
   唯一的 :root palette 來源：頁面層 CSS 一律 var(--*)，不得自帶色票。
   全站單一 dark palette：surface = --night / --night-panel / --night-lift，
   text = #fff（primary）/ --haze（secondary）/ --fog（tertiary），
   rule = --night-rule（hairline）/ --night-rule-strong（可辨識邊界，≥3:1）。 */
:root {
  color-scheme: dark;
  --night: #000000;
  --night-panel: #0a0a0a;
  --night-lift: #121212;
  --night-rule: rgba(255, 255, 255, 0.08);
  --night-rule-strong: rgba(255, 255, 255, 0.16);
  --signal: #ff3b30;
  --fog: #888888;
  --haze: #cccccc;
  --font-display: "Bodoni Moda", "Noto Serif TC", serif;
  --font-body: "Inter", "Noto Serif TC", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, .8);
  --content-wide: 1180px;

  /* Accent colors */
  --up:       #ff453a; /* crimson red */
  --down:     #0a84ff; /* deep blue/cyan */
  --accent:   #ff453a;
  --accent-dn:#0a84ff;
  --info:     #0a84ff;

  /* Trade Event Colors */
  --entry:       #ff453a;
  --add:         #ff453a;
  --add-ink:     #ff453a;
  --reduce:      #0a84ff;
  --reduce-soft: #1a5bae;
  --exit:        #888888;
  --exit-deep:   #555555;
  --peak:        #bf5af2;
  --slate:       #777777;
  --price-line:  #ffd60a;
  --gold:      #ff453a;
  --gold-soft: #ff6b6b;
  --gold-deep: #cc2424;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--night);
  color: #ffffff;
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: -0.01em;
}
a { color: inherit; text-decoration: none; }
button, select, input, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── masthead ── */
.mast {
  background: var(--night);
  min-height: 60px;
  padding: 16px max(24px, calc((100vw - var(--content-wide)) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--night-rule);
}
.mast-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mast-brand {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
}
.mast-brand--link { color: inherit; text-decoration: none; }
.mast-brand__mark {
  display: block; width: 22px; height: 22px; border-radius: 4px; flex: 0 0 auto;
}
.mast-brand--link:hover .mast-title { color: var(--accent); }
.mast-back {
  font-size: 10px; letter-spacing: 0.05em;
  color: var(--fog); text-decoration: none;
  text-transform: uppercase;
  flex-shrink: 0;
}
.mast-back:hover { color: #fff; }
.mast-title {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: #fff;
}
.mast-title:hover { color: var(--accent); }
a.mast-title { text-decoration: none; }
.mast-sub {
  font-size: 10px;
  color: var(--fog);
  letter-spacing: 0.05em;
  text-transform: none;
}
.mast-sub::before { content: "/"; margin-right: 8px; color: var(--night-rule-strong); }
.mast-code {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.05em; color: var(--accent);
  flex-shrink: 0;
}
.mast-r {
  font-size: 11px; color: var(--fog);
  letter-spacing: 0.02em; text-align: right; flex-shrink: 0;
  display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; flex-wrap: wrap;
}
.mast-r strong { color: #ffffff; font-weight: 700; }

/* ── shared traffic pulse ── */
.etf-mast-r {
  display: flex; align-items: baseline; justify-content: flex-end;
  gap: 8px; flex-wrap: wrap;
}
.site-pulse {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  max-width: 100%;
  color: var(--fog);
  white-space: nowrap;
}
.site-pulse::before {
  content: "";
  width: 1px;
  height: 12px;
  background: rgba(255,255,255,0.16);
  align-self: center;
}
.site-pulse-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.site-pulse-state::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(105,200,148,0.42);
  animation: site-pulse-dot 1.8s ease-out infinite;
}
.site-pulse-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}
.site-pulse-label {
  font-size: 8px;
  color: var(--fog);
  letter-spacing: 0.08em;
}
.site-pulse-value {
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.site-pulse-active { color: var(--up); }
.site-pulse-updated {
  font-size: 8px;
  color: var(--fog);
  letter-spacing: 0.06em;
}
@keyframes site-pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(217,43,75,0.42); }
  70% { box-shadow: 0 0 0 8px rgba(217,43,75,0); }
  100% { box-shadow: 0 0 0 0 rgba(217,43,75,0); }
}

/* ── shared tab bar ── */
/* ── shared tab bar ── */
.tabs {
  display: flex; gap: 8px;
  border-bottom: 1px solid var(--night-rule);
  overflow-x: auto; padding: 0 0 12px 0;
  background: transparent;
  border-radius: 0;
}
.tabs::-webkit-scrollbar { height: 0; }
.tabs button, .tabs .tab {
  flex: 0 0 auto;
  background: transparent; border: none;
  min-height: 36px;
  padding: 6px 12px;
  font-family: inherit; font-size: 11px; letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fog); cursor: pointer; white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: all .2s ease;
}
.tabs button:hover, .tabs .tab:hover { color: #fff; border-color: var(--night-rule); }
.tabs button.active, .tabs .tab.active {
  color: #fff; border-color: var(--night-rule-strong); background: var(--night-panel); font-weight: 600;
  box-shadow: none;
}
.tabs button .count, .tabs .tab .count {
  color: var(--fog); font-weight: 400; margin-left: 5px; font-size: 9px;
}

/* ── shared note / footer ── */
.note {
  margin-top: 16px; padding: 12px 14px;
  border: 1px solid var(--night-rule);
  font-size: 11px; color: var(--fog); background: var(--night-panel);
  border-radius: var(--radius-sm);
}
.site-footer {
  margin-top: 24px; padding-top: 10px;
  border-top: 1px solid var(--night-rule);
  font-size: 10px; color: var(--fog);
}
.public-disclosure-footer {
  width: 100%; margin-top: 40px;
  border-top: 1px solid var(--night-rule);
  background: var(--night); color: var(--fog);
}
.public-disclosure-footer__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  width: min(100%, 1240px); margin: 0 auto; padding: 22px 32px 28px;
}
.public-disclosure-footer__brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: #fff; font-family: var(--font-mono); font-size: 11px;
  font-weight: 700; letter-spacing: .12em; text-decoration: none; text-transform: uppercase;
}
.public-disclosure-footer__brand img { display: block; border-radius: 6px; }
.public-disclosure-footer__links {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 18px; font-size: 12px;
}
.public-disclosure-footer__links a {
  color: inherit; text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 4px;
}
.public-disclosure-footer__links a:hover { color: #fff; }

@media print {
  .public-disclosure-footer { margin-top: 24px; background: #fff; color: #333; }
}

@media (max-width: 640px) {
  body { font-size: 12px; }
  .mast {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: flex-start;
  }
  .mast-l { gap: 8px; min-width: 0; flex: 1 1 auto; }
  .mast-brand { gap: 7px; }
  .mast-brand__mark { width: 24px; height: 24px; border-radius: 6px; }
  .mast-name { display: none; }
  .mast-title { font-size: 12px; letter-spacing: 0.05em; }
  .mast-back  { font-size: 10px; }
  .mast-r {
    font-size: 9px;
    text-align: right;
    flex: 0 0 100%;
    min-width: 0;
    justify-content: flex-start;
    margin-top: 2px;
    opacity: 0.85;
  }
  .etf-mast-r {
    flex: 0 0 100%;
    min-width: 0;
    text-align: left;
    margin-top: 2px;
  }
  .site-pulse {
    flex: 0 1 auto;
    gap: 4px;
    min-width: 0;
  }
  .site-pulse::before,
  .site-pulse-state,
  .site-pulse-secondary,
  .site-pulse-updated {
    display: none;
  }
  .etf-mast-r .site-pulse {
    flex: 1 0 100%;
    margin-left: 0;
  }
  .mast-r .site-pulse {
    margin-left: 0;
  }
  .bar .site-pulse {
    flex: 1 0 100%;
    margin-left: 0;
    justify-content: flex-start;
    padding-top: 2px;
  }
  .site-pulse-label { font-size: 8px; letter-spacing: 0.02em; }
  .site-pulse-value { font-size: 10px; }
  .tabs { padding-top: 8px; }
  .tabs button, .tabs .tab { padding: 6px 10px; font-size: 11px; }
  .tabs button .count, .tabs .tab .count { display: none; }
  .note { font-size: 10px; padding: 8px 10px; }
  .public-disclosure-footer { margin-top: 28px; }
  .public-disclosure-footer__inner { display: grid; gap: 14px; padding: 18px 14px 24px; }
  .public-disclosure-footer__links { display: grid; justify-content: stretch; gap: 10px; font-size: 12px; }
  .public-disclosure-footer__links a { min-height: 24px; }
}

@media (max-width: 380px) {
  .mast { padding: 7px 10px; }
  .mast-title { font-size: 11px; }
  .site-pulse-label { font-size: 7px; }
  .site-pulse-value { font-size: 9px; }
  .tabs button, .tabs .tab { padding: 5px 8px; font-size: 10px; }
}

/* ── scroll reveal system ── */
.reveal-wrapper {
  overflow: hidden;
  display: block;
}
.reveal-text {
  display: block;
  transform: translateY(102%);
  opacity: 0;
  transition: transform 1.2s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 1.2s cubic-bezier(0.1, 0.9, 0.2, 1);
  will-change: transform, opacity;
}
.reveal-text.active {
  transform: translateY(0);
  opacity: 1;
}
.reveal-card {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s cubic-bezier(0.1, 0.9, 0.2, 1), transform 1.2s cubic-bezier(0.1, 0.9, 0.2, 1);
  will-change: transform, opacity;
}
.reveal-card.active {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay classes */
.delay-1 { transition-delay: 0.1s !important; }
.delay-2 { transition-delay: 0.2s !important; }
.delay-3 { transition-delay: 0.3s !important; }
.delay-4 { transition-delay: 0.4s !important; }
.delay-5 { transition-delay: 0.5s !important; }
.delay-6 { transition-delay: 0.6s !important; }

/* ── public footer ── */
.public-disclosure-footer {
  border-top: 1px solid var(--night-rule);
  padding: 48px 0;
  margin-top: 64px;
  background: var(--night-panel);
}
.public-disclosure-footer__inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}
.public-disclosure-footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}
.public-disclosure-footer__links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.public-disclosure-footer__links a {
  color: var(--fog);
  text-decoration: none;
  font-size: 11px;
  font-family: var(--font-body);
  transition: color 0.16s ease;
  font-weight: 500;
}
.public-disclosure-footer__links a:hover {
  color: #ffffff;
}

/* ── interactive policy modal ── */
.policy-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.policy-modal.active {
  display: flex;
}
.policy-content {
  background: var(--night-lift);
  border: 1px solid var(--night-rule-strong);
  border-radius: var(--radius-md);
  padding: 32px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-soft);
  transform: translateY(15px);
  transition: transform 0.25s cubic-bezier(0.1, 0.8, 0.25, 1);
}
.policy-modal.active .policy-content {
  transform: translateY(0);
}
.policy-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--fog);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.16s ease;
}
.policy-close:hover {
  color: #ffffff;
}
.policy-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--night-rule);
  padding-bottom: 8px;
}
.policy-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--haze);
  font-family: var(--font-body);
}
.policy-text p {
  margin: 0 0 12px 0;
}
.policy-text h4 {
  color: #ffffff;
  margin: 16px 0 6px 0;
  font-size: 13px;
  font-weight: 700;
}
.policy-text a {
  color: var(--up);
  text-decoration: underline;
  transition: color 0.16s ease;
}
.policy-text a:hover {
  color: #ffffff;
}

@media (max-width: 760px) {
  .public-disclosure-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}
