:root {
    color-scheme: dark;
    --page-bg: #111;
    --surface: #0f161e;
    --line: rgba(143, 164, 181, 0.22);
    --text: #eef3f7;
    --muted: #8999a7;
    --gold: #ffc83d;
    --red: #ff4358;
    --blue: #22bdf0;
    --focus: #68d4ff;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--page-bg) !important;
}

body.report-home-page {
    min-width: 0;
    min-height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
    background: var(--page-bg) !important;
    color: var(--text) !important;
    font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 20;
    display: grid;
    min-height: 84px;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    padding: 18px clamp(20px, 4vw, 64px);
    border-bottom: 0;
    background: transparent;
}

.brand {
    display: inline-flex;
    width: max-content;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    width: 46px;
    height: 52px;
    flex: 0 0 46px;
    place-items: center;
    border: 0;
    background: transparent;
}

.brand-mark img {
    display: block;
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.brand strong,
.brand small {
    display: block;
    letter-spacing: 0;
}

.brand strong {
    color: #f3f6f8;
    font-size: 15px;
}

.brand small {
    margin-top: 3px;
    color: var(--muted);
    font: 10px Consolas, monospace;
    text-transform: uppercase;
}

.view-switch {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    padding: 3px;
    border: 1px solid rgba(143, 164, 181, 0.25);
    border-radius: 6px;
    background: rgba(15, 22, 30, 0.88);
}

.view-switch a {
    display: grid;
    min-width: 88px;
    min-height: 36px;
    place-items: center;
    border-radius: 3px;
    color: #9eabb7;
    font-size: 13px;
    font-weight: 800;
}

.view-switch a.is-active {
    background: #e9eef2;
    color: #111820;
}

.member-link {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-self: end;
    gap: 7px;
    padding: 0 16px;
    border: 1px solid rgba(143, 164, 181, 0.3);
    border-radius: 4px;
    color: #dce4eb;
    font-size: 13px;
    font-weight: 800;
}

.brand:focus-visible,
.view-switch a:focus-visible,
.member-link:focus-visible,
.hero-actions a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

main {
    position: relative;
    z-index: 3;
}

.hero {
    position: relative;
    display: flex;
    min-height: 100svh;
    align-items: center;
    overflow: hidden;
    padding: 118px clamp(24px, 7vw, 112px) 82px;
    border-bottom: 0;
    background: transparent;
}

.hero-copy {
    position: relative;
    z-index: 8;
    width: min(520px, 36vw);
    text-shadow: 0 2px 14px #070b10, 0 1px 3px #070b10;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 18px;
    color: #b9c6d1;
    font-size: 14px;
    font-weight: 800;
}

.kicker span {
    width: 28px;
    height: 2px;
    background: var(--gold);
    box-shadow: 0 0 12px rgba(255, 200, 61, 0.68);
}

.hero h1 {
    max-width: 100%;
    margin: 0;
    color: #fff;
    font-size: 72px;
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0;
}

.hero-summary {
    max-width: 520px;
    margin: 24px 0 0;
    color: #c4ced7;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.hero-actions a {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 22px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 900;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.hero-actions a:hover {
    transform: translateY(-2px);
}

.primary-action {
    border: 1px solid var(--gold);
    background: var(--gold);
    color: #263747;
    box-shadow: 0 12px 34px rgba(255, 200, 61, 0.16);
    text-shadow: none;
}

.primary-action span {
    color: #263747;
    text-shadow: none;
}

.secondary-action {
    border: 1px solid rgba(178, 195, 208, 0.35);
    background: #0b1117;
    color: #e8eef3;
}

.demo-note {
    margin: 18px 0 0;
    color: #657481;
    font: 11px Consolas, monospace;
}

.embedded-report {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    min-width: 0;
    overflow: hidden;
    background: #111;
}

.embedded-report > div:first-child,
.embedded-report .plotly-graph-div {
    width: 100% !important;
}

.embedded-report .plotly-graph-div {
    height: 100% !important;
    margin: 0 auto;
}

.chart-swipe-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 6;
    display: grid;
    width: min(340px, calc(100% - 32px));
    min-height: 132px;
    place-items: center;
    gap: 12px;
    padding: 18px 22px;
    transform: translate(-50%, -50%) scale(0.97);
    border: 1px solid rgba(255, 200, 61, 0.45);
    border-radius: 6px;
    background: rgba(7, 12, 17, 0.68);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.4);
    color: #f7fafc;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: opacity 0.32s ease, transform 0.32s ease, visibility 0.32s ease;
}

.chart-swipe-guide.is-visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.chart-swipe-guide.is-hiding {
    transform: translate(-50%, -50%) scale(0.98);
    opacity: 0;
    visibility: hidden;
}

.chart-swipe-visual {
    position: relative;
    display: flex;
    width: 190px;
    height: 48px;
    align-items: center;
    justify-content: space-between;
    color: var(--gold);
}

.chart-swipe-visual::before {
    position: absolute;
    right: 22px;
    bottom: 5px;
    left: 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 200, 61, 0.9), transparent);
    content: "";
}

.chart-swipe-arrow {
    font-size: 27px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 0 12px rgba(255, 200, 61, 0.72);
}

.chart-swipe-device-wrap {
    position: absolute;
    top: 0;
    left: 50%;
    width: 28px;
    height: 42px;
    margin-left: -14px;
    animation: chart-swipe-demo 1.45s ease-in-out infinite;
    will-change: transform;
}

.chart-swipe-mouse {
    position: absolute;
    inset: 0 2px 2px;
    border: 2px solid #fff;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.chart-swipe-mouse::before {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 2px;
    height: 8px;
    margin-left: -1px;
    border-radius: 2px;
    background: var(--gold);
    content: "";
}

.chart-swipe-finger {
    display: none;
}

.chart-swipe-guide p {
    margin: 0;
    color: #f1f5f8;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.55;
    text-align: center;
    letter-spacing: 0;
    text-shadow: 0 2px 8px #000;
}

.chart-swipe-mobile-text {
    display: none;
}

@keyframes chart-swipe-demo {
    0%, 100% { transform: translateX(-58px); }
    50% { transform: translateX(58px); }
}

#deepseek-analysis,
#plotly-hud {
    display: none !important;
}

body.report-home-page .embedded-report .gridlayer,
body.report-home-page .embedded-report .gtitle,
body.report-home-page .embedded-report .xaxislayer-above .xtick text,
body.report-home-page .embedded-report .yaxislayer-above .ytick text,
body.report-home-page #mobile-bar {
    display: none !important;
}

#mobile-d3-chart svg text,
#mobile-d3-chart svg > g:first-of-type {
    display: none !important;
}

.seo-guide {
    position: relative;
    z-index: 10;
    padding: 76px 24px 82px;
    background: #0b1117;
    color: #dce5ec;
}

.seo-guide-inner {
    width: min(900px, 100%);
    margin: 0 auto;
}

.seo-label {
    margin: 0 0 18px;
    color: var(--gold);
    font-size: 13px;
    font-weight: 900;
}

.seo-item {
    padding: 32px 0;
    border-top: 1px solid rgba(143, 164, 181, 0.2);
}

.seo-item-lead {
    padding-top: 0;
    border-top: 0;
}

.seo-item h2 {
    margin: 0;
    color: #f3f6f8;
    font-size: 30px;
    line-height: 1.35;
    letter-spacing: 0;
}

.seo-item p {
    max-width: 800px;
    margin: 14px 0 0;
    color: #aebbc6;
    font-size: 17px;
    line-height: 1.9;
}

.seo-item a {
    margin: 0 3px;
    color: var(--gold);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.seo-disclaimer {
    margin: 8px 0 0;
    color: #6f7f8c;
    font-size: 13px;
}

@media (min-width: 901px) {
    .embedded-report {
        top: 10svh;
        bottom: 10svh;
        left: 20%;
    }

    #chip-toggle-wrap {
        position: absolute !important;
        top: 10px !important;
        right: 14px !important;
    }
}

@media (max-width: 1120px) {
    .hero-copy {
        width: 38vw;
    }

    .hero h1 {
        font-size: 58px;
    }

    .hero-summary {
        font-size: 17px;
    }

}

@media (max-width: 900px) {
    .topbar {
        position: absolute;
        min-height: 70px;
        grid-template-columns: 1fr auto;
        padding: 12px 18px;
    }

    .view-switch {
        display: none;
    }

    .hero {
        display: flex;
        min-height: 100svh;
        align-items: flex-start;
        padding: 0;
        overflow: hidden;
    }

    .hero-copy {
        z-index: 8;
        width: 100%;
        padding: 112px 24px 38px;
    }

    .hero h1 {
        font-size: 52px;
    }

    .hero-summary {
        max-width: 620px;
    }

    .embedded-report {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        min-height: 100svh;
        border-top: 0;
        border-left: 0;
    }

    .embedded-report .plotly-graph-div {
        height: 100% !important;
        min-height: 100svh;
    }

    .chart-swipe-guide {
        top: 70%;
        width: min(310px, calc(100% - 36px));
        min-height: 122px;
        padding: 16px 18px;
    }

    .chart-swipe-mouse,
    .chart-swipe-desktop-text {
        display: none;
    }

    .chart-swipe-finger {
        position: absolute;
        top: -4px;
        left: -4px;
        display: grid;
        width: 36px;
        height: 42px;
        place-items: center;
        color: #fff;
        font-family: "Segoe UI Symbol", sans-serif;
        filter: drop-shadow(0 0 8px rgba(255, 200, 61, 0.75));
    }

    .chart-swipe-finger::before {
        font-size: 35px;
        font-weight: 400;
        line-height: 1;
        content: "☝";
    }

    .chart-swipe-mobile-text {
        display: inline;
    }
}

@media (max-width: 520px) {
    .topbar {
        gap: 12px;
        padding: 10px 14px;
    }

    .brand-mark {
        width: 42px;
        height: 48px;
        flex-basis: 42px;
    }

    .brand strong {
        font-size: 14px;
    }

    .brand small {
        display: none;
    }

    .member-link {
        min-height: 38px;
        padding: 0 12px;
    }

    .member-link span {
        display: none;
    }

    .hero-copy {
        display: flex;
        width: 100%;
        height: 46svh;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        padding: 72px 18px 12px;
        text-align: center;
    }

    .kicker {
        margin-bottom: 14px;
    }

    .hero h1 {
        font-size: 42px;
    }

    .hero-summary {
        margin-top: 18px;
        font-size: 16px;
        line-height: 1.65;
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
        margin-top: 24px;
    }

    .hero-actions a {
        min-height: 44px;
        padding: 0 16px;
        font-size: 13px;
    }

    .embedded-report {
        top: 46svh;
        bottom: auto;
        height: 49svh;
        min-height: 0;
    }

    .embedded-report > div:first-child,
    .embedded-report .plotly-graph-div {
        height: 100% !important;
        min-height: 0 !important;
    }

    .seo-guide {
        padding: 56px 18px 62px;
    }

    .seo-item {
        padding: 27px 0;
    }

    .seo-item h2 {
        font-size: 25px;
    }

    .seo-item p {
        font-size: 16px;
        line-height: 1.8;
    }

    .chart-swipe-guide {
        top: 72%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chart-swipe-guide,
    .chart-swipe-device-wrap {
        animation: none !important;
        transition: none !important;
    }
}
