:root {
    --fp-ink: #102033;
    --fp-muted: #5f6f85;
    --fp-soft: #eef6ff;
    --fp-paper: #ffffff;
    --fp-line: #dce8f5;
    --fp-blue: #2478ff;
    --fp-cyan: #18b8d9;
    --fp-mint: #37cfa3;
    --fp-lime: #a7e34f;
    --fp-violet: #6d5dfc;
    --fp-amber: #f4b63f;
    --fp-shadow: 0 22px 60px rgba(38, 86, 133, 0.14);
    --fp-radius: 18px;
}

html {
    scroll-padding-top: 88px;
}

html,
body {
    overflow-x: hidden;
}

body.flypig-home,
body.flypig-theme-page,
body.topic-hub,
body.article-page,
body.flypig-index {
    background:
        linear-gradient(180deg, #f7fbff 0%, #ffffff 34%, #f6fbff 100%);
    color: var(--fp-ink);
}

body.flypig-home::before,
body.flypig-theme-page::before,
body.topic-hub::before,
body.article-page::before,
body.flypig-index::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 10% 12%, rgba(36, 120, 255, 0.13), transparent 34%),
        radial-gradient(circle at 88% 8%, rgba(55, 207, 163, 0.12), transparent 30%),
        linear-gradient(rgba(36, 120, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(36, 120, 255, 0.035) 1px, transparent 1px);
    background-size: auto, auto, 44px 44px, 44px 44px;
}

.navbar,
.hub-header,
body.article-page header,
body.flypig-index header {
    border-bottom: 1px solid rgba(220, 232, 245, 0.88) !important;
    background: rgba(255, 255, 255, 0.84) !important;
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 34px rgba(40, 74, 112, 0.08) !important;
}

.navbar-brand,
.hub-brand {
    color: var(--fp-ink) !important;
    font-weight: 900 !important;
    letter-spacing: 0;
}

.nav-link,
.hub-links a {
    color: #526176 !important;
    font-weight: 700 !important;
}

.nav-link:hover,
.hub-links a:hover,
.hub-links a[aria-current="page"] {
    color: var(--fp-blue) !important;
}

.btn-primary,
.hub-cta,
.fp-btn-primary {
    border: 0 !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, var(--fp-blue), var(--fp-cyan)) !important;
    color: #fff !important;
    box-shadow: 0 14px 30px rgba(36, 120, 255, 0.24) !important;
}

.btn-primary:hover,
.hub-cta:hover,
.fp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(36, 120, 255, 0.3) !important;
}

.btn-outline-primary,
.fp-btn-ghost {
    border-color: rgba(36, 120, 255, 0.24) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.72) !important;
    color: var(--fp-blue) !important;
}

.btn-outline-primary:hover,
.fp-btn-ghost:hover {
    background: var(--fp-blue) !important;
    color: #fff !important;
}

/* Homepage */
body.flypig-home .hero-section {
    min-height: 92vh;
    background:
        linear-gradient(135deg, rgba(247, 251, 255, 0.96), rgba(229, 248, 255, 0.8)),
        url("../images/ai-martech-solutions-hero-background.svg");
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    color: var(--fp-ink);
    overflow: hidden;
}

body.flypig-home .hero-section::before {
    display: none;
}

body.flypig-home .hero-section h1 {
    max-width: 720px;
    color: var(--fp-ink);
    font-size: clamp(2.55rem, 5.5vw, 5.8rem);
    line-height: 0.98;
    letter-spacing: 0;
    text-wrap: balance;
}

body.flypig-home .hero-section .lead {
    max-width: 620px;
    color: var(--fp-muted);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.7;
}

.fp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid rgba(36, 120, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--fp-blue);
    padding: 0.45rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fp-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 2rem;
}

.fp-hero-preview {
    position: relative;
    border: 1px solid rgba(220, 232, 245, 0.94);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--fp-shadow);
    padding: clamp(1rem, 2vw, 1.4rem);
}

.fp-preview-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.fp-preview-title {
    margin: 0;
    color: var(--fp-ink);
    font-weight: 900;
}

.fp-preview-status {
    border-radius: 999px;
    background: rgba(55, 207, 163, 0.14);
    color: #08745b;
    padding: 0.32rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 900;
}

.fp-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.fp-metric,
.fp-workflow-step {
    border: 1px solid rgba(220, 232, 245, 0.88);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    padding: 1rem;
}

.fp-metric strong {
    display: block;
    color: var(--fp-ink);
    font-size: 1.55rem;
    line-height: 1.1;
}

.fp-metric span,
.fp-workflow-step span {
    color: var(--fp-muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.fp-workflow {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.9rem;
}

.fp-workflow-step {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.7rem;
}

.fp-dot {
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fp-blue), var(--fp-mint));
}

body.flypig-home section {
    position: relative;
}

body.flypig-home .vision-section,
body.flypig-home .team-section,
body.flypig-home .services-section,
body.flypig-home .portfolio-section {
    background: transparent;
}

body.flypig-home .service-card,
body.flypig-home .portfolio-card,
body.flypig-home .team-stats,
body.flypig-home .vision-stats,
body.flypig-theme-page .tool-card,
body.flypig-theme-page .feature-card,
body.flypig-theme-page .case-card,
body.flypig-theme-page .app-card {
    border: 1px solid rgba(220, 232, 245, 0.9) !important;
    border-radius: var(--fp-radius) !important;
    background: rgba(255, 255, 255, 0.88) !important;
    box-shadow: 0 18px 48px rgba(38, 86, 133, 0.12) !important;
}

body.flypig-home .service-card:hover,
body.flypig-home .portfolio-card:hover,
body.flypig-theme-page .tool-card:hover,
body.flypig-theme-page .feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 60px rgba(38, 86, 133, 0.18) !important;
}

body.flypig-home h2,
body.flypig-theme-page h2 {
    color: var(--fp-ink);
    font-weight: 900;
    letter-spacing: 0;
}

body.flypig-home .service-card i,
body.flypig-home .portfolio-icon,
body.flypig-home .stat-item i,
body.flypig-theme-page .tool-icon,
body.flypig-theme-page .feature-icon,
body.flypig-theme-page .tech-icon,
body.flypig-theme-page .app-icon {
    color: var(--fp-blue);
}

body.flypig-theme-page .ai-gradient-header,
body.flypig-theme-page .service-hero {
    background:
        linear-gradient(135deg, rgba(248, 252, 255, 0.96), rgba(225, 248, 255, 0.82)) !important;
    color: var(--fp-ink) !important;
}

body.flypig-theme-page .ai-gradient-header::before {
    background:
        radial-gradient(circle at 20% 20%, rgba(36, 120, 255, 0.13), transparent 34%),
        radial-gradient(circle at 80% 10%, rgba(55, 207, 163, 0.13), transparent 30%) !important;
}

body.flypig-theme-page .category-card {
    border: 1px solid rgba(220, 232, 245, 0.8);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 16px 40px rgba(38, 86, 133, 0.12);
}

body.flypig-theme-page .category-card h3,
body.flypig-theme-page .ai-gradient-header .display-3,
body.flypig-theme-page .ai-gradient-header .lead,
body.flypig-theme-page .service-hero h1,
body.flypig-theme-page .service-hero .lead {
    color: var(--fp-ink) !important;
}

body.flypig-theme-page .tool-link {
    background: rgba(36, 120, 255, 0.06);
    color: #35506d;
}

body.flypig-theme-page .tool-link:hover {
    background: rgba(36, 120, 255, 0.12);
    color: var(--fp-blue);
}

/* Topic hubs */
body.topic-hub {
    --hub-ink: var(--fp-ink);
    --hub-muted: var(--fp-muted);
    --hub-line: var(--fp-line);
    --hub-paper: rgba(255, 255, 255, 0.88);
    --hub-bg: transparent;
    --hub-blue: var(--fp-blue);
}

body.topic-hub.theme-future { --hub-accent: var(--fp-blue); --hub-accent-2: var(--fp-mint); }
body.topic-hub.theme-survival { --hub-accent: var(--fp-cyan); --hub-accent-2: var(--fp-violet); }
body.topic-hub.theme-zero { --hub-accent: var(--fp-amber); --hub-accent-2: var(--fp-mint); }

.hub-hero {
    padding: clamp(58px, 9vw, 104px) 0 46px;
}

.hub-hero-grid {
    align-items: center;
}

.hub-kicker {
    display: inline-flex;
    border: 1px solid rgba(36, 120, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--hub-accent, var(--fp-blue));
    padding: 0.38rem 0.72rem;
}

.hub-title {
    color: var(--fp-ink);
    font-size: clamp(2.2rem, 5vw, 5.35rem);
    letter-spacing: 0;
    text-wrap: balance;
}

.hub-lead {
    color: var(--fp-muted);
}

.hub-stat,
.hub-card,
.hub-row,
.hub-band {
    border-color: rgba(220, 232, 245, 0.94);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 16px 42px rgba(38, 86, 133, 0.1);
}

.hub-stat,
.hub-card,
.hub-row {
    border-radius: 16px;
}

.hub-band {
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(36, 120, 255, 0.09), rgba(55, 207, 163, 0.08)),
        rgba(255, 255, 255, 0.88);
}

.hub-stat strong,
.hub-card small,
.hub-row em {
    color: var(--hub-accent, var(--fp-blue));
}

.hub-card:hover,
.hub-row:hover {
    border-color: color-mix(in srgb, var(--hub-accent, var(--fp-blue)) 38%, white);
    box-shadow: 0 24px 60px rgba(38, 86, 133, 0.16);
}

.hub-pill {
    border-color: rgba(220, 232, 245, 0.9);
    background: rgba(255, 255, 255, 0.8);
}

/* Article template */
body.article-page {
    font-family: "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.article-page #article-container {
    max-width: 1120px;
}

body.article-page #article-container > .bg-white {
    border: 1px solid rgba(220, 232, 245, 0.94);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92) !important;
    box-shadow: var(--fp-shadow);
}

body.article-page #article-container h1 {
    color: var(--fp-ink);
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1.12;
    text-wrap: balance;
}

body.article-page .markdown-content {
    width: min(100%, 820px);
    margin: 0 auto;
    color: #213347;
    font-size: 1.08rem;
    line-height: 1.86;
}

body.article-page .markdown-content h2 {
    margin-top: 3.2rem;
    border-bottom: 0;
    color: var(--fp-ink);
    font-size: clamp(1.55rem, 2.5vw, 2.25rem);
}

body.article-page .markdown-content h2::before {
    content: "";
    display: block;
    width: 52px;
    height: 4px;
    margin-bottom: 0.72rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--fp-blue), var(--fp-mint));
}

body.article-page .markdown-content p,
body.article-page .markdown-content li {
    color: #2e4054;
}

body.article-page .markdown-content img {
    border: 1px solid rgba(220, 232, 245, 0.92);
    box-shadow: 0 18px 46px rgba(38, 86, 133, 0.12);
}

body.article-page .markdown-content table {
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(38, 86, 133, 0.08);
}

body.article-page .markdown-content a {
    color: var(--fp-blue);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

body.article-page #related-articles > a {
    border: 1px solid rgba(220, 232, 245, 0.94) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 16px 42px rgba(38, 86, 133, 0.1) !important;
}

/* Article index */
body.flypig-index .gradient-header {
    background:
        linear-gradient(135deg, rgba(247, 251, 255, 0.98), rgba(227, 249, 255, 0.86)) !important;
    color: var(--fp-ink) !important;
}

body.flypig-index .gradient-header h2,
body.flypig-index .gradient-header p {
    color: var(--fp-ink) !important;
}

body.flypig-index .gradient-header button {
    border: 1px solid rgba(220, 232, 245, 0.9);
    background: rgba(255, 255, 255, 0.78) !important;
    color: var(--fp-ink) !important;
    box-shadow: 0 10px 24px rgba(38, 86, 133, 0.1);
}

body.flypig-index .gradient-header button:hover {
    border-color: rgba(36, 120, 255, 0.35);
    background: #ffffff !important;
    color: var(--fp-blue) !important;
}

body.flypig-index #btn-series-lobster-knowledge {
    background: linear-gradient(135deg, #ffb238, #ff8f4d) !important;
    color: #ffffff !important;
    border-color: transparent;
}

body.flypig-index #articleSearch {
    border: 1px solid rgba(36, 120, 255, 0.18);
    background: rgba(255, 255, 255, 0.92);
    color: var(--fp-ink);
    box-shadow: 0 16px 40px rgba(38, 86, 133, 0.12);
}

body.flypig-index #articleSearch::placeholder {
    color: #7c8aa0;
}

body.flypig-index #static-content-index {
    background: transparent !important;
}

body.flypig-index #static-content-index .rounded-xl,
body.flypig-index #static-content-index .rounded-2xl {
    border-color: rgba(220, 232, 245, 0.94) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 16px 42px rgba(38, 86, 133, 0.1) !important;
}

@media (max-width: 991px) {
    body.flypig-home .hero-section {
        min-height: auto;
        padding: 118px 0 68px;
    }

    .fp-hero-preview {
        margin-top: 2rem;
    }

    .hub-nav {
        align-items: flex-start;
        flex-direction: column;
        padding: 0.8rem 0;
    }

    .hub-links {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .fp-hero-actions,
    .fp-preview-grid {
        grid-template-columns: 1fr;
    }

    .fp-hero-actions .btn,
    .fp-hero-actions a {
        width: 100%;
        justify-content: center;
    }

    body.article-page #article-container > .bg-white {
        border-radius: 18px;
        padding: 1.25rem !important;
    }

    body.article-page .markdown-content {
        font-size: 1rem;
        line-height: 1.78;
    }
}
