:root, [data-bs-theme="light"] { --ink: #17233d; --navy: #0b1730; --paper: #f3f6fa; --surface: #fff; --muted: #667085; --line: #dfe5ee; }
[data-bs-theme="dark"] { --ink: #e7edf6; --navy: #dce8f8; --paper: #1c1c1c; --surface: #151f2e; --muted: #aab6c8; --line: #2b394d; }
body { background: var(--paper); color: var(--ink); font-family: Inter, "Noto Sans TC", system-ui, sans-serif; }
.app-navbar { background: linear-gradient(110deg, #08152d, #133866); box-shadow: 0 6px 22px rgba(11, 23, 48, .18); }
.eyebrow { color: #2472c8; font-size: .72rem; font-weight: 800; letter-spacing: .14em; margin-bottom: .35rem; }
.card { border: 1px solid var(--line); border-radius: .85rem; box-shadow: 0 8px 28px rgba(26, 43, 74, .05); }
.metric-card { border-top-width: 3px !important; }
.mood-score { font-size: clamp(2.8rem, 8vw, 5rem); font-weight: 750; letter-spacing: -.05em; }
.chart-wrap { min-height: 280px; }
.table { --bs-table-bg: transparent; }
.table thead th { color: var(--muted); font-size: .73rem; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.table a { color: #155ca8; text-decoration: none; }
.table a:hover { text-decoration: underline; }
.table-loading-container { position: relative; }
.table-loading-overlay { align-items: flex-start; background: color-mix(in srgb, var(--surface) 82%, transparent); border-radius: inherit; display: flex; inset: 0; justify-content: center; min-height: 8rem; padding-top: 2.5rem; position: absolute; z-index: 10; }
.table-loading-overlay[hidden] { display: none; }
.table-loading-status { align-items: center; color: var(--muted); display: flex; font-size: 1.125rem; font-weight: 600; gap: .75rem; }
.table-loading-spinner { animation: table-loading-spinner-cycle .7s linear infinite; border-color: color-mix(in srgb, var(--bs-primary) 22%, transparent); border-right-color: var(--bs-primary); border-top-color: var(--bs-primary); height: 1.4rem; width: 1.4rem; }
@keyframes table-loading-spinner-cycle { to { transform: rotate(360deg); } }
.title-cell { min-width: 260px; max-width: 520px; }
.stock-search-history-wrap { min-width: min(320px, 80vw); }
.stock-search-history-menu { max-height: 260px; overflow-y: auto; top: calc(100% + .25rem); z-index: 1080; }
@media (min-width: 576px) { .news-filter-fixed-width { flex: 0 0 180px; width: 180px; } }
.event-badge { color: #1f5791; background: #e6f1fc; }
.stock-news-table th { white-space: nowrap; }
.stock-news-table .stock-news-score { white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty-state { color: var(--muted); padding: 2rem; text-align: center; }
.score-list dt { color: var(--muted); font-weight: 500; }
.score-list dd { text-align: right; }
.news-copy { line-height: 1.8; white-space: pre-line; }
.stock-price-chart { height: 460px; min-height: 320px; }
.dashboard-section-heading { align-items: end; display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dashboard-live-status { align-items: center; color: var(--muted); display: inline-flex; font-size: .8rem; gap: .45rem; white-space: nowrap; }
.dashboard-status-dot { background: #20c997; border-radius: 50%; box-shadow: 0 0 0 0 rgba(32, 201, 151, .55); display: inline-block; height: .5rem; margin-right: .35rem; width: .5rem; animation: dashboard-status-pulse 2.2s infinite; }
.dashboard-metrics .metric-card { overflow: hidden; position: relative; }
.dashboard-metrics .metric-card::after { background: linear-gradient(90deg, transparent, rgba(36, 114, 200, .12), transparent); content: ""; height: 1px; left: -100%; position: absolute; top: 0; width: 100%; animation: dashboard-scan 5s ease-in-out infinite; }
.dashboard-count { font-variant-numeric: tabular-nums; }
.dashboard-interactive-card { transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.dashboard-interactive-card:hover { border-color: rgba(36, 114, 200, .35); box-shadow: 0 12px 34px rgba(26, 43, 74, .1); transform: translateY(-2px); }
.dashboard-event-scroll { height: 520px; overflow: auto; }
.dashboard-event-scroll thead th { background: var(--bs-body-bg); position: sticky; top: 0; z-index: 2; }
.consecutive-momentum-scroll { height: 480px; overflow: auto; }
.consecutive-momentum-table { font-variant-numeric: tabular-nums; }
.consecutive-momentum-table thead th { background: var(--bs-body-bg); position: sticky; top: 0; white-space: nowrap; z-index: 2; }
.dashboard-mood-card { background-image: radial-gradient(circle at 50% 18%, rgba(36, 114, 200, .12), transparent 58%); overflow: hidden; }
.dashboard-panel-card { overflow: hidden; }
.dashboard-pills { gap: .35rem; }
.dashboard-pills .nav-link { border: 1px solid transparent; border-radius: 999px; color: var(--muted); font-size: .88rem; font-weight: 650; padding: .42rem .9rem; }
.dashboard-pills .nav-link.active { background: rgba(36, 114, 200, .12); border-color: rgba(36, 114, 200, .22); color: #155ca8; }
.dashboard-subpanel { border: 1px solid var(--line); border-radius: .75rem; overflow: hidden; }
.dashboard-chart-skeleton { align-items: end; display: flex; gap: 3%; height: 410px; justify-content: center; padding: 3rem 6%; }
.dashboard-chart-skeleton span { background: linear-gradient(180deg, rgba(36, 114, 200, .3), rgba(36, 114, 200, .06)); border-radius: .3rem .3rem 0 0; width: 12%; animation: dashboard-bars 1.2s ease-in-out infinite alternate; }
.dashboard-chart-skeleton span:nth-child(1) { height: 32%; }
.dashboard-chart-skeleton span:nth-child(2) { height: 58%; animation-delay: -.3s; }
.dashboard-chart-skeleton span:nth-child(3) { height: 44%; animation-delay: -.6s; }
.dashboard-chart-skeleton span:nth-child(4) { height: 72%; animation-delay: -.9s; }
.dashboard-chart-skeleton span:nth-child(5) { height: 62%; animation-delay: -.45s; }
.dashboard-motion-ready .dashboard-reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.dashboard-motion-ready .dashboard-reveal.is-visible { opacity: 1; transform: none; }
@keyframes dashboard-status-pulse { 70% { box-shadow: 0 0 0 7px rgba(32, 201, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(32, 201, 151, 0); } }
@keyframes dashboard-scan { 0%, 55% { left: -100%; } 80%, 100% { left: 100%; } }
@keyframes dashboard-bars { from { opacity: .35; transform: scaleY(.92); } to { opacity: .85; transform: scaleY(1); } }
.market-periods .btn.active { background: #133866; border-color: #133866; color: #fff; }
.market-chart-card { overflow: hidden; }
@media (min-width: 992px) { .stock-market-events-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); gap: 1.5rem; } }
.financial-section { overflow: hidden; }
.financial-metric { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: .75rem; padding: .9rem; }
.financial-chart { height: 310px; min-height: 240px; }
.monthly-revenue-chart { height: 360px; min-height: 260px; }
.monthly-revenue-table-wrap { max-height: 560px; }
.monthly-revenue-table td, .monthly-revenue-table th { white-space: nowrap; }
.monthly-revenue-admin-table td, .monthly-revenue-admin-table th { white-space: nowrap; }
.pagination { justify-content: center; flex-wrap: wrap; }
.financial-tabs .nav-link { color: #475467; }
.financial-tabs .nav-link.active { background: #133866; color: #fff; }
.financial-table-wrap { max-height: 560px; }
.financial-statement-table .financial-metric-name { background: #fff; left: 0; min-width: 220px; position: sticky; z-index: 2; }
.financial-statement-table thead .financial-metric-name { z-index: 3; }
.financial-statement-table tbody small { font-size: .68rem; }
.action-popover { --bs-popover-max-width: 320px; --bs-popover-border-color: #c8d6e8; --bs-popover-border-radius: .75rem; --bs-popover-header-bg: #133866; --bs-popover-header-color: #fff; --bs-popover-body-color: #344054; box-shadow: 0 12px 32px rgba(11, 23, 48, .2); }
.action-popover .popover-header { font-size: .9rem; font-weight: 700; }
.action-popover .popover-body { line-height: 1.6; }
.app-toast-container { right: 1rem; top: 1rem; z-index: 1100; }
.app-toast { border: 1px solid #d8e1ec; border-radius: .8rem; box-shadow: 0 14px 38px rgba(11, 23, 48, .2); overflow: hidden; }
.app-toast .toast-header { background: #fff; border-bottom-color: #e7ecf3; color: #253858; padding: .7rem .85rem; }
.app-toast .toast-body { background: #fff; color: #344054; line-height: 1.6; padding: .85rem; }
.app-toast-indicator { background: #2472c8; border-radius: 50%; height: .65rem; margin-right: .55rem; width: .65rem; }
.app-toast-success .app-toast-indicator { background: #198754; }
.app-toast-danger .app-toast-indicator { background: #dc3545; }
.app-toast-warning .app-toast-indicator { background: #e5a100; }
.app-toast-info .app-toast-indicator { background: #2472c8; }
.batch-analysis-toast-container { right: 1rem; top: 6.5rem; z-index: 1090; }
.price-positive, .table .price-positive { color: #c0392b; }
.price-negative, .table .price-negative { color: #198754; }
.event-tooltip { max-width: 320px; white-space: normal; }
.event-tooltip a { color: #155ca8; font-weight: 700; }
.login-page-body { background: #fff; }
.auth-login-page { min-height: 100vh; min-height: 100dvh; }
.auth-login-shell { display: grid; grid-template-columns: minmax(0, 58%) minmax(420px, 42%); min-height: 100vh; min-height: 100dvh; }
.auth-login-visual { background: #061329; min-height: 100%; overflow: hidden; position: relative; }
.auth-login-visual > img { height: 100%; inset: 0; object-fit: cover; object-position: center; position: absolute; width: 100%; }
.auth-login-visual-shade { background: linear-gradient(180deg, rgba(3, 12, 28, .12) 20%, rgba(3, 12, 28, .82) 100%); inset: 0; position: absolute; }
.auth-login-brand { font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; text-decoration: none; }
.auth-login-brand-light { color: #fff; left: clamp(1.5rem, 4vw, 4rem); position: absolute; top: clamp(1.5rem, 4vw, 3rem); z-index: 1; }
.auth-login-brand-light:hover { color: #d9ecff; }
.auth-login-brand-dark { color: var(--navy); display: none; margin-bottom: 3rem; }
.auth-login-brand-dark:hover { color: #155ca8; }
.auth-login-visual-copy { bottom: clamp(2rem, 6vw, 5rem); color: #fff; left: clamp(1.5rem, 5vw, 5rem); max-width: 620px; position: absolute; right: clamp(1.5rem, 5vw, 5rem); z-index: 1; }
.auth-login-kicker { color: #76caff; font-size: .72rem; font-weight: 800; letter-spacing: .18em; margin-bottom: 1rem; }
.auth-login-visual-copy h1 { font-size: clamp(2rem, 3.1vw, 3.5rem); font-weight: 750; letter-spacing: -.04em; line-height: 1.18; margin-bottom: 1rem; }
.auth-login-visual-copy > p:last-child { color: rgba(255, 255, 255, .78); font-size: 1.05rem; line-height: 1.75; margin: 0; }
.auth-login-panel { align-items: center; background: #fff; display: flex; justify-content: center; padding: clamp(2rem, 5vw, 5rem); }
.auth-theme-toggle { position: fixed; right: 1rem; top: 1rem; z-index: 5; }
.auth-login-form-wrap { max-width: 430px; width: 100%; }
.auth-login-heading { margin-bottom: 2rem; }
.auth-login-heading h2 { color: var(--navy); font-size: clamp(2rem, 3vw, 2.6rem); font-weight: 750; letter-spacing: -.04em; margin-bottom: .7rem; }
.auth-login-heading > p:last-child { color: #667085; line-height: 1.7; margin: 0; }
.auth-login-form .form-label { color: #344054; font-size: .9rem; font-weight: 700; }
.auth-login-form .form-control { border-color: #ced7e4; border-radius: .7rem; font-size: 1rem; padding: .78rem .95rem; }
.auth-login-form .form-control:focus { border-color: #2472c8; box-shadow: 0 0 0 .2rem rgba(36, 114, 200, .14); }
.auth-login-form .btn { background: #133866; border-color: #133866; border-radius: .7rem; font-size: 1rem; font-weight: 700; padding: .78rem 1rem; }
.auth-login-form .btn:hover, .auth-login-form .btn:focus { background: #0d2c55; border-color: #0d2c55; }
.auth-captcha-row { align-items: stretch; display: grid; gap: .5rem; grid-template-columns: minmax(0, 1fr) 156px 48px; }
.auth-captcha-image { align-self: center; background: #eef4fb; border: 1px solid #ced7e4; border-radius: .7rem; height: 52px; object-fit: cover; width: 156px; }
.auth-login-form .auth-captcha-refresh { background: #fff; border-color: #ced7e4; color: #344054; font-size: 1.35rem; padding: 0; }
.auth-login-form .auth-captcha-refresh:hover, .auth-login-form .auth-captcha-refresh:focus { background: #eef4fb; border-color: #9fb3ca; color: #133866; }
.auth-login-register { color: #667085; font-size: .9rem; margin-top: 1.35rem; text-align: center; }
.auth-login-register a { color: #155ca8; font-weight: 700; text-decoration: none; }
.auth-login-register a:hover { text-decoration: underline; }
.auth-login-disclaimer { color: #98a2b3; font-size: .75rem; line-height: 1.6; margin: 3rem 0 0; text-align: center; }
@media (max-width: 991.98px) {
  .auth-login-shell { display: block; }
  .auth-login-visual { height: min(34vh, 280px); min-height: 220px; }
  .auth-login-visual > img { object-position: center 32%; }
  .auth-login-brand-light { display: none; }
  .auth-login-brand-dark { display: inline-block; }
  .auth-login-visual-copy { bottom: 1.5rem; left: 2rem; max-width: 520px; right: 2rem; }
  .auth-login-visual-copy h1 { font-size: clamp(1.55rem, 5vw, 2.2rem); margin-bottom: 0; }
  .auth-login-visual-copy > p:last-child, .auth-login-kicker { display: none; }
  .auth-login-panel { min-height: calc(100vh - 280px); min-height: calc(100dvh - 280px); padding: 2.5rem 1.5rem; }
}
@media (max-width: 575.98px) {
  .auth-login-visual { height: 180px; min-height: 180px; }
  .auth-login-visual-copy { bottom: 1.15rem; left: 1.25rem; right: 1.25rem; }
  .auth-login-visual-copy h1 { font-size: 1.45rem; }
  .auth-login-panel { align-items: flex-start; min-height: calc(100vh - 180px); min-height: calc(100dvh - 180px); padding: 2rem 1.25rem; }
  .auth-login-brand-dark { margin-bottom: 2rem; }
  .auth-login-heading { margin-bottom: 1.5rem; }
  .auth-login-disclaimer { margin-top: 2rem; }
  .auth-captcha-row { grid-template-columns: minmax(0, 1fr) 48px; }
  .auth-captcha-image { grid-column: 1 / -1; grid-row: 1; }
  .auth-captcha-row .form-control { grid-column: 1; grid-row: 2; }
  .auth-captcha-refresh { grid-column: 2; grid-row: 2; }
  .app-toast-container { left: .75rem; right: .75rem; top: .75rem; }
  .app-toast-container > .toast { width: 100%; }
}
@media (max-width: 767.98px) { .title-cell { min-width: 220px; } }
@media (max-width: 767.98px) { .stock-price-chart { height: 320px; } }
@media (max-width: 767.98px) { .dashboard-section-heading { align-items: flex-start; flex-direction: column; } .dashboard-chart-skeleton { height: 280px; } .dashboard-event-scroll { height: 420px; } }
@media (prefers-reduced-motion: reduce) {
  .dashboard-status-dot, .dashboard-metrics .metric-card::after, .dashboard-chart-skeleton span { animation: none; }
  .dashboard-motion-ready .dashboard-reveal { opacity: 1; transform: none; transition: none; }
  .dashboard-interactive-card { transition: none; }
  .dashboard-interactive-card:hover { transform: none; }
}
@media (max-width: 767.98px) { .financial-chart, .monthly-revenue-chart { height: 260px; } .financial-statement-table .financial-metric-name { min-width: 180px; } }
.calendar-filter-chip input { position: absolute; opacity: 0; pointer-events: none; }
.calendar-filter-chip span { display: inline-block; padding: .35rem .7rem; border: 1px solid var(--bs-border-color); border-radius: 999px; cursor: pointer; font-size: .875rem; }
.calendar-filter-chip input:checked + span { color: #fff; background: var(--bs-primary); border-color: var(--bs-primary); }
.calendar-date-box { display: flex; flex-direction: column; align-items: center; min-width: 3.25rem; padding: .35rem; color: #fff; background: var(--bs-primary); border-radius: .65rem; line-height: 1.05; }
.calendar-date-box strong { font-size: 1.35rem; }
.calendar-date-box span { font-size: .75rem; }
[class*="calendar-event-"] { background: #52616b; color: #fff; }
.calendar-event-ex_dividend, .calendar-event-ex_right, .calendar-event-ex_right_dividend { background: #c8465b; }
.calendar-event-investor_conference { background: #2767a7; }
.calendar-event-earnings_expected, .calendar-event-earnings_released { background: #6f42c1; }
.calendar-event-monthly_revenue { background: #a66a00; }

[data-bs-theme="dark"] .card { background-color: var(--surface); box-shadow: 0 8px 28px rgba(0, 0, 0, .2); }
[data-bs-theme="dark"] .card-body { background-color: #272727; }
[data-bs-theme="dark"] .card > .card-body:first-child { border-radius: calc(.85rem - 1px) calc(.85rem - 1px) 0 0; }
[data-bs-theme="dark"] .card > .card-body:last-child { border-radius: 0 0 calc(.85rem - 1px) calc(.85rem - 1px); }
[data-bs-theme="dark"] .card > .card-body:only-child { border-radius: calc(.85rem - 1px); }
[data-bs-theme="dark"] .table > tbody { --bs-table-bg: #272727; }
[data-bs-theme="dark"] .list-group { --bs-list-group-bg: #272727; background-color: #272727; }
[data-bs-theme="dark"] .table a, [data-bs-theme="dark"] .event-tooltip a { color: #78b9ff; }
[data-bs-theme="dark"] .event-badge { background: #173552; color: #9bcaff; }
[data-bs-theme="dark"] .financial-metric { background: #111a27; border-color: var(--line); }
[data-bs-theme="dark"] .financial-statement-table .financial-metric-name { background: var(--surface); }
[data-bs-theme="dark"] .financial-tabs .nav-link { color: var(--muted); }
[data-bs-theme="dark"] .dashboard-pills .nav-link.active { background: rgba(120, 185, 255, .14); border-color: rgba(120, 185, 255, .25); color: #78b9ff; }
[data-bs-theme="dark"] .app-toast { border-color: var(--line); box-shadow: 0 14px 38px rgba(0, 0, 0, .4); }
[data-bs-theme="dark"] .app-toast .toast-header,
[data-bs-theme="dark"] .app-toast .toast-body { background: var(--surface); color: var(--ink); }
[data-bs-theme="dark"] .app-toast .toast-header { border-bottom-color: var(--line); }
[data-bs-theme="dark"] .action-popover { --bs-popover-border-color: var(--line); --bs-popover-body-color: var(--ink); }
[data-bs-theme="dark"] .login-page-body,
[data-bs-theme="dark"] .auth-login-panel { background: var(--paper); }
[data-bs-theme="dark"] .auth-login-heading h2,
[data-bs-theme="dark"] .auth-login-form .form-label,
[data-bs-theme="dark"] .auth-login-brand-dark { color: var(--ink); }
[data-bs-theme="dark"] .auth-login-heading > p:last-child,
[data-bs-theme="dark"] .auth-login-register { color: var(--muted); }
[data-bs-theme="dark"] .auth-login-form .auth-captcha-refresh { background: var(--surface); border-color: var(--line); color: var(--ink); }
[data-bs-theme="dark"] .auth-captcha-image { background: #111a27; border-color: var(--line); }
[data-bs-theme="dark"] .theme-icon-sun { color: #ffd166; }
