/* AI Pages — front-end page styling. Scoped under .ai-page. */

/* 8-bit 像素字體（本地綑綁，OFL 授權見 fonts/ 內檔）。
   只有用到像素風格嘅頁面先會實際下載字體。 */
@font-face {
    font-family: "Press Start 2P";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/press-start-2p-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Press Start 2P";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/press-start-2p-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Fusion Pixel 12px";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/fusion-pixel-12px-zh-hant.woff2") format("woff2");
}

.ai-page {
    --ai-page-text: #1f1b16;
    --ai-page-muted: #6b6259;
    --ai-page-accent: #d7263d;
    --ai-page-line: rgba(0, 0, 0, 0.14);
    --ai-page-code-bg: rgba(0, 0, 0, 0.05);
    padding: 56px 20px;
    color: var(--ai-page-text);
}

.ai-page__container {
    max-width: 820px;
    margin-inline: auto;
}

.ai-page__title {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 3.4vw, 2.6rem);
    line-height: 1.2;
    font-weight: 800;
}

.ai-page__lead {
    margin: 0;
    color: var(--ai-page-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.ai-page__hero {
    margin: 28px 0;
}

.ai-page__hero img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
}

.ai-page__content {
    margin-top: 28px;
    line-height: 1.85;
    font-size: 1.02rem;
}

.ai-page__content h2 {
    margin: 32px 0 12px;
    font-size: 1.5rem;
    font-weight: 800;
}

.ai-page__content h3 {
    margin: 26px 0 10px;
    font-size: 1.22rem;
    font-weight: 700;
}

.ai-page__content p {
    margin: 0 0 16px;
}

.ai-page__content ul,
.ai-page__content ol {
    margin: 0 0 18px;
    padding-left: 1.4em;
}

.ai-page__content li {
    margin-bottom: 8px;
}

.ai-page__content a {
    color: var(--ai-page-accent);
    text-decoration: underline;
}

.ai-page__content blockquote {
    margin: 20px 0;
    padding: 12px 18px;
    border-left: 4px solid var(--ai-page-accent);
    background: rgba(0, 0, 0, 0.03);
    color: var(--ai-page-muted);
}

.ai-page__content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* 其餘內容元素都要跟風格，否則 h4／hr／表格／code 會「唔完整」。 */
.ai-page__content h1,
.ai-page__content h4,
.ai-page__content h5,
.ai-page__content h6 {
    margin: 24px 0 10px;
    line-height: 1.35;
    font-weight: 700;
}

.ai-page__content h1 {
    font-size: 1.7rem;
}

.ai-page__content h4 {
    font-size: 1.1rem;
}

.ai-page__content h5,
.ai-page__content h6 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ai-page-muted);
}

.ai-page__content ul {
    list-style: disc;
}

.ai-page__content ol {
    list-style: decimal;
}

.ai-page__content ul > li::marker,
.ai-page__content ol > li::marker {
    color: var(--ai-page-accent);
    font-weight: 700;
}

.ai-page__content hr {
    margin: 30px 0;
    border: 0;
    border-top: 1px solid var(--ai-page-line);
}

.ai-page__content table {
    width: 100%;
    margin: 0 0 20px;
    border-collapse: collapse;
    font-size: 0.98em;
}

.ai-page__content th,
.ai-page__content td {
    padding: 10px 12px;
    border: 1px solid var(--ai-page-line);
    text-align: left;
    vertical-align: top;
}

.ai-page__content th {
    font-weight: 700;
    background: var(--ai-page-code-bg);
}

.ai-page__content code,
.ai-page__content kbd {
    padding: 0.12em 0.4em;
    border-radius: 4px;
    background: var(--ai-page-code-bg);
    font-size: 0.92em;
}

.ai-page__content pre {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--ai-page-code-bg);
    overflow: auto;
}

.ai-page__content > :first-child {
    margin-top: 0;
}

.ai-page__content > :last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   內容組件：AI 可以用呢批 class 砌出多變版面（卡片／分欄／數字／步驟／CTA）。
   全部用主題變數，所以 35 款風格都自動夾。
   ========================================================================== */

.ai-page__content .ai-lead {
    margin: 0 0 20px;
    font-size: 1.12em;
    line-height: 1.75;
    color: var(--ai-page-muted);
}

.ai-page__content .ai-grid {
    display: grid;
    gap: 18px;
    margin: 0 0 22px;
}

.ai-page__content .ai-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-page__content .ai-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 760px) {
    .ai-page__content .ai-grid--2,
    .ai-page__content .ai-grid--3 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ai-page__content .ai-card {
    padding: 18px 20px;
    border: 1px solid var(--ai-page-line);
    border-radius: 14px;
    background: var(--ai-page-code-bg);
}

.ai-page__content .ai-card > :first-child {
    margin-top: 0;
}

.ai-page__content .ai-card > :last-child {
    margin-bottom: 0;
}

.ai-page__content .ai-badge {
    display: inline-block;
    margin: 0 0 10px;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--ai-page-accent);
    color: #fff;
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.ai-page__content .ai-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 18px;
    border: 1px solid var(--ai-page-line);
    border-radius: 14px;
    background: var(--ai-page-code-bg);
}

.ai-page__content .ai-stat strong {
    font-size: 1.9em;
    line-height: 1.1;
    color: var(--ai-page-accent);
}

.ai-page__content .ai-stat span {
    color: var(--ai-page-muted);
    font-size: 0.92em;
}

.ai-page__content .ai-note {
    display: block;
    margin: 0 0 20px;
    padding: 16px 18px;
    border: 1px solid var(--ai-page-line);
    border-left: 4px solid var(--ai-page-accent);
    border-radius: 0 12px 12px 0;
    background: var(--ai-page-code-bg);
}

.ai-page__content .ai-note > :last-child {
    margin-bottom: 0;
}

.ai-page__content .ai-highlight {
    padding: 0 0.25em;
    background-image: linear-gradient(
        transparent 62%,
        color-mix(in srgb, var(--ai-page-accent) 38%, transparent) 62%
    );
}

.ai-page__content .ai-steps,
.ai-page__content .ai-checks {
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.ai-page__content .ai-steps {
    counter-reset: ai-step;
}

.ai-page__content .ai-steps > li {
    position: relative;
    margin: 0 0 14px;
    padding-left: 46px;
    counter-increment: ai-step;
}

.ai-page__content .ai-steps > li::before {
    content: counter(ai-step);
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ai-page-accent);
    color: #fff;
    font-size: 0.9em;
    font-weight: 700;
}

.ai-page__content .ai-checks > li {
    position: relative;
    margin: 0 0 10px;
    padding-left: 28px;
}

.ai-page__content .ai-checks > li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--ai-page-accent);
    font-weight: 700;
}

.ai-page__content .ai-divider {
    height: 1px;
    margin: 30px 0;
    border: 0;
    background: linear-gradient(90deg, transparent, var(--ai-page-line), transparent);
}

.ai-page__content .ai-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 28px 0 0;
    padding: 20px 22px;
    border: 1px solid var(--ai-page-line);
    border-radius: 16px;
    background: var(--ai-page-code-bg);
}

.ai-page__content .ai-cta p {
    margin: 0;
}

.ai-page__content .ai-btn {
    display: inline-block;
    flex: 0 0 auto;
    padding: 11px 22px;
    border-radius: 999px;
    background: var(--ai-page-accent);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.ai-page__content .ai-btn:hover {
    opacity: 0.92;
    color: #fff;
    transform: translateY(-2px);
}

.ai-page__content .ai-figure {
    margin: 0 0 22px;
}

.ai-page__content .ai-figure figcaption {
    margin-top: 10px;
    color: var(--ai-page-muted);
    font-size: 0.9em;
    text-align: center;
}

/* ==========================================================================
   內容動畫工具 class：可以加喺任何元素上（AI 或人手都可以用）
   全部跟 prefers-reduced-motion 自動停用。
   ========================================================================== */

.ai-page__content .ai-anim-float {
    animation: ai-float 6s ease-in-out infinite;
}

.ai-page__content .ai-anim-pulse {
    animation: ai-pulse 2.6s ease-in-out infinite;
}

.ai-page__content .ai-anim-glow {
    animation: ai-glow 2.8s ease-in-out infinite alternate;
}

.ai-page__content .ai-anim-gradient {
    background-image: linear-gradient(90deg, var(--ai-page-accent), #7c9cff, var(--ai-page-accent));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: ai-holo-text 6s linear infinite;
}

.ai-page__content .ai-anim-shine {
    position: relative;
    overflow: hidden;
}

.ai-page__content .ai-anim-shine::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-18deg);
    animation: ai-shine 3.8s ease-in-out infinite;
}

.ai-page__content .ai-anim-spin-slow {
    animation: ai-spin 16s linear infinite;
}

.ai-page__content .ai-anim-lift {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ai-page__content .ai-anim-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.16);
}

.ai-page__content .ai-anim-zoom {
    transition: transform 0.35s ease;
}

.ai-page__content .ai-anim-zoom:hover {
    transform: scale(1.04);
}

.ai-page__content .ai-anim-tilt {
    transition: transform 0.3s ease;
}

.ai-page__content .ai-anim-tilt:hover {
    transform: rotate(-1.5deg) scale(1.02);
}

@keyframes ai-pulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.045);
    }
}

@keyframes ai-glow {
    from {
        filter: drop-shadow(0 0 4px color-mix(in srgb, var(--ai-page-accent) 45%, transparent));
    }

    to {
        filter: drop-shadow(0 0 18px color-mix(in srgb, var(--ai-page-accent) 70%, transparent));
    }
}

@keyframes ai-shine {
    0% {
        left: -60%;
    }

    60%,
    100% {
        left: 130%;
    }
}

@keyframes ai-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 捲動驅動（零 JS，唔支援嘅瀏覽器唔會播） */
@supports (animation-timeline: view()) {
    .ai-page__content .ai-anim-reveal {
        animation: ai-reveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 60%;
    }

    .ai-page__content .ai-anim-scalein {
        animation: ai-scalein linear both;
        animation-timeline: view();
        animation-range: entry 10% entry 70%;
    }

    .ai-page__content .ai-anim-parallax {
        animation: ai-parallax linear both;
        animation-timeline: view();
        animation-range: cover;
    }
}

@keyframes ai-scalein {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes ai-parallax {
    from {
        transform: translateY(46px);
    }

    to {
        transform: translateY(-46px);
    }
}

/* ==========================================================================
   版面組件（進階）：全寬色帶、Hero、標籤、事實格、時間軸、價錢卡、手風琴
   ========================================================================== */

.ai-page {
    overflow-x: clip;
}

/* 全寬色帶：由內容區跳出，橫跨整個畫面闊度（色塊背景）。 */
.ai-page__content .ai-band {
    margin-block: 36px;
    margin-inline: calc(50% - 50vw);
    padding-block: 44px;
    padding-inline: max(20px, calc(50vw - 50%));
    background: var(--ai-page-code-bg);
}

.ai-page__content .ai-band--accent {
    color: #fff;
    background: var(--ai-page-accent);
}

.ai-page__content .ai-band--accent a,
.ai-page__content .ai-band--accent h2,
.ai-page__content .ai-band--accent h3,
.ai-page__content .ai-band--accent .ai-kicker {
    color: #fff;
}

.ai-page__content .ai-band--dark {
    color: #eef2f8;
    background: #10131a;
}

.ai-page__content .ai-band--dark h2,
.ai-page__content .ai-band--dark h3,
.ai-page__content .ai-band--dark a {
    color: #fff;
}

.ai-page__content .ai-band > :first-child {
    margin-top: 0;
}

.ai-page__content .ai-band > :last-child {
    margin-bottom: 0;
}

/* Hero 卡 */
.ai-page__content .ai-hero {
    margin: 0 0 26px;
    padding: 36px 34px;
    border: 1px solid var(--ai-page-line);
    border-radius: 20px;
    background:
        radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--ai-page-accent) 24%, transparent), transparent 62%),
        var(--ai-page-code-bg);
}

.ai-page__content .ai-hero > :first-child {
    margin-top: 0;
}

.ai-page__content .ai-hero > :last-child {
    margin-bottom: 0;
}

.ai-page__content .ai-kicker {
    margin: 0 0 8px;
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ai-page-accent);
}

/* 標籤 */
.ai-page__content .ai-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.ai-page__content .ai-tag {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--ai-page-line);
    border-radius: 999px;
    background: var(--ai-page-code-bg);
    font-size: 0.85em;
}

/* 事實格 */
.ai-page__content .ai-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.ai-page__content .ai-fact {
    padding: 14px 16px;
    border: 1px solid var(--ai-page-line);
    border-radius: 12px;
    background: var(--ai-page-code-bg);
    font-size: 0.95em;
}

/* 價錢卡 */
.ai-page__content .ai-price {
    padding: 22px 24px;
    border: 2px solid var(--ai-page-line);
    border-radius: 18px;
    background: var(--ai-page-code-bg);
    text-align: center;
}

.ai-page__content .ai-price strong {
    display: block;
    margin-bottom: 4px;
    font-size: 2.2em;
    line-height: 1.15;
    color: var(--ai-page-accent);
}

/* 時間軸 */
.ai-page__content .ai-timeline {
    margin: 0 0 22px;
    padding: 0 0 0 26px;
    list-style: none;
    border-left: 2px solid var(--ai-page-line);
}

.ai-page__content .ai-timeline > li {
    position: relative;
    margin: 0 0 18px;
}

.ai-page__content .ai-timeline > li::before {
    content: "";
    position: absolute;
    top: 7px;
    left: -33px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ai-page-accent);
    box-shadow: 0 0 0 4px var(--ai-page-code-bg);
}

/* 引言句 */
.ai-page__content .ai-quote {
    margin: 26px 0;
    padding: 6px 0 6px 20px;
    border-left: 4px solid var(--ai-page-accent);
    font-size: 1.15em;
    font-style: italic;
    color: var(--ai-page-muted);
}

/* 手風琴（用 AI 產生嘅 div 結構，由 ai-pages-fx.js 控制開合） */
.ai-page__content .ai-accordion {
    margin: 0 0 22px;
}

.ai-page__content .ai-acc {
    margin-bottom: 10px;
    border: 1px solid var(--ai-page-line);
    border-radius: 12px;
    background: var(--ai-page-code-bg);
    overflow: hidden;
}

.ai-page__content .ai-acc__q {
    position: relative;
    margin: 0;
    padding: 14px 46px 14px 18px;
    cursor: pointer;
    font-weight: 700;
    user-select: none;
}

.ai-page__content .ai-acc__q::after {
    content: "＋";
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    color: var(--ai-page-accent);
}

.ai-page__content .ai-acc.is-open .ai-acc__q::after {
    content: "－";
}

.ai-page__content .ai-acc__a {
    display: none;
    padding: 0 18px 16px;
}

.ai-page__content .ai-acc.is-open .ai-acc__a {
    display: block;
}

/* ==========================================================================
   互動組件：Tabs、Carousel、數字滾動、目錄、嵌入（由 ai-pages-fx.js 驅動）
   ========================================================================== */

/* Tabs */
.ai-page__content .ai-tabs {
    margin: 0 0 24px;
}

.ai-page__content .ai-tabs__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ai-page-line);
}

.ai-page__content .ai-tab {
    padding: 8px 16px;
    border: 1px solid var(--ai-page-line);
    border-radius: 999px;
    background: var(--ai-page-code-bg);
    font-weight: 700;
    font-size: 0.95em;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ai-page__content .ai-tab:hover {
    transform: translateY(-1px);
}

.ai-page__content .ai-tab.is-active {
    color: #fff;
    background: var(--ai-page-accent);
    border-color: var(--ai-page-accent);
}

.ai-page__content .ai-tab-panel {
    display: none;
}

.ai-page__content .ai-tab-panel.is-active {
    display: block;
    animation: ai-reveal 0.35s ease both;
}

/* Carousel */
.ai-page__content .ai-carousel {
    position: relative;
    margin: 0 0 24px;
}

.ai-page__content .ai-carousel__track {
    display: flex;
    gap: 16px;
    padding-bottom: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.ai-page__content .ai-slide {
    flex: 0 0 min(320px, 80%);
    scroll-snap-align: start;
    padding: 18px 20px;
    border: 1px solid var(--ai-page-line);
    border-radius: 16px;
    background: var(--ai-page-code-bg);
}

.ai-page__content .ai-slide > :first-child {
    margin-top: 0;
}

.ai-page__content .ai-slide > :last-child {
    margin-bottom: 0;
}

.ai-page__content .ai-carousel__nav {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.ai-page__content .ai-carousel__prev,
.ai-page__content .ai-carousel__next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--ai-page-line);
    border-radius: 50%;
    background: var(--ai-page-code-bg);
    font-size: 1.2em;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.ai-page__content .ai-carousel__prev:hover,
.ai-page__content .ai-carousel__next:hover {
    color: #fff;
    background: var(--ai-page-accent);
    border-color: var(--ai-page-accent);
}

/* 數字滾動 */
.ai-page__content .ai-counter {
    font-variant-numeric: tabular-nums;
}

/* Sticky 目錄（用 <div class="ai-toc"></div> 做佔位，JS 自動生成） */
.ai-page__content .ai-toc {
    position: sticky;
    top: 84px;
    z-index: 5;
    margin: 0 0 26px;
    padding: 12px 14px;
    border: 1px solid var(--ai-page-line);
    border-radius: 14px;
    background: var(--ai-page-code-bg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.ai-page__content .ai-toc:empty {
    display: none;
}

.ai-page__content .ai-toc__title {
    margin: 0 0 8px;
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ai-page-muted);
}

.ai-page__content .ai-toc__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ai-page__content .ai-toc__list a {
    font-size: 0.92em;
    text-decoration: none;
}

.ai-page__content .ai-toc__list a.is-active {
    font-weight: 700;
    border-bottom: 2px solid var(--ai-page-accent);
}

.ai-page__content .ai-toc__list .is-sub a {
    padding-left: 12px;
    opacity: 0.8;
}

/* 嵌入（YouTube／Google Maps）：JS 驗證網址後才建立 iframe */
.ai-page__content .ai-embed {
    position: relative;
    margin: 0 0 24px;
    padding: 16px;
    border: 1px solid var(--ai-page-line);
    border-radius: 14px;
    background: var(--ai-page-code-bg);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    color: var(--ai-page-muted);
    font-size: 0.9em;
    word-break: break-all;
}

.ai-page__content .ai-embed--map {
    aspect-ratio: 16 / 10;
}

.ai-page__content .ai-embed__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 閱讀進度條（fixed，JS 建立並更新） */
.ai-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99990;
    width: 100%;
    height: 3px;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--ai-progress-a, #d7263d), var(--ai-progress-b, #ff7a00));
    pointer-events: none;
}

.ai-page--preview {
    padding: 0;
}

/* 版面風格 preset（由每頁「版面風格」欄位控制） */
.ai-page--wide .ai-page__container {
    max-width: 1120px;
}

.ai-page--narrow .ai-page__container {
    max-width: 660px;
}

.ai-page--boxed .ai-page__container {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: clamp(24px, 4vw, 48px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
}

.ai-page--plain {
    padding-block: 24px;
}

.ai-page--plain .ai-page__title {
    font-size: 1.6rem;
}

/* ==========================================================================
   視覺風格 preset（由每頁「視覺風格」欄位控制）
   純 CSS、唔使 AI，一揀即換；再用「自訂 CSS」微調。
   ========================================================================== */

/* 8-bit 像素風 */
.ai-page--theme-pixel8bit {
    --ai-page-text: #e8f0ff;
    --ai-page-muted: #9fb6d8;
    --ai-page-accent: #ffd400;
    --ai-page-line: rgba(255, 255, 255, 0.28);
    --ai-page-code-bg: rgba(255, 255, 255, 0.08);
    font-family: "Press Start 2P", "Fusion Pixel 12px", ui-monospace, "Courier New", monospace;
    line-height: 1.95;
    background-color: #0b1030;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 2px, transparent 2px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 2px, transparent 2px),
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0 2px, transparent 2px 4px);
    background-size: 32px 32px, 32px 32px, auto;
    border-top: 6px solid #ff2d7a;
    border-bottom: 6px solid #00e0ff;
}

.ai-page--theme-pixel8bit .ai-page__title {
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.6;
    text-shadow: 4px 4px 0 #ff2d7a, 8px 8px 0 rgba(0, 0, 0, 0.45);
}

.ai-page--theme-pixel8bit .ai-page__lead {
    color: var(--ai-page-accent);
}

.ai-page--theme-pixel8bit .ai-page__content h2,
.ai-page--theme-pixel8bit .ai-page__content h3 {
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.7;
    border-bottom: 5px solid var(--ai-page-accent);
    padding-bottom: 10px;
}

.ai-page--theme-pixel8bit .ai-page__content a {
    color: #00e0ff;
    text-decoration: none;
    border-bottom: 3px dotted #00e0ff;
}

.ai-page--theme-pixel8bit .ai-page__content strong {
    color: var(--ai-page-accent);
}

.ai-page--theme-pixel8bit .ai-page__content li::marker {
    color: var(--ai-page-accent);
}

.ai-page--theme-pixel8bit .ai-page__content blockquote {
    color: var(--ai-page-muted);
    background: rgba(255, 255, 255, 0.07);
    border-left: 8px solid var(--ai-page-accent);
    border-radius: 0;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
}

.ai-page--theme-pixel8bit .ai-page__hero img,
.ai-page--theme-pixel8bit .ai-page__content img {
    border: 4px solid #fff;
    border-radius: 0;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.55);
    image-rendering: pixelated;
}

/* 真 8-bit：RPG 對話框外框、像素項目符號、掃描線 */
.ai-page--theme-pixel8bit {
    position: relative;
    overflow: hidden;
}

.ai-page--theme-pixel8bit .ai-page__container {
    position: relative;
    z-index: 1;
    padding: clamp(20px, 3.5vw, 36px);
    background: #101a45;
    border: 4px solid #fff;
    border-radius: 0;
    box-shadow:
        0 0 0 4px #0b1030,
        0 0 0 8px #fff,
        12px 12px 0 8px rgba(0, 0, 0, 0.45);
}

.ai-page--theme-pixel8bit::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.45;
    background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 2px, transparent 2px 4px);
    animation: ai-scan 6s linear infinite;
}

@keyframes ai-scan {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 48px;
    }
}

.ai-page--theme-pixel8bit .ai-page__content ul {
    padding-left: 1.5em;
    list-style: none;
}

.ai-page--theme-pixel8bit .ai-page__content ul > li {
    position: relative;
}

.ai-page--theme-pixel8bit .ai-page__content ul > li::before {
    content: "▸";
    position: absolute;
    left: -1.15em;
    color: var(--ai-page-accent);
}

/* Game Boy 綠（單色像素） */
.ai-page--theme-gameboy {
    --ai-page-text: #0f380f;
    --ai-page-muted: #306230;
    --ai-page-accent: #2f6d1f;
    --ai-page-line: rgba(15, 56, 15, 0.35);
    --ai-page-code-bg: rgba(15, 56, 15, 0.1);
    font-family: "Press Start 2P", "Fusion Pixel 12px", ui-monospace, "Courier New", monospace;
    line-height: 2;
    background-color: #9bbc0f;
    background-image: radial-gradient(rgba(15, 56, 15, 0.14) 1px, transparent 1px);
    background-size: 4px 4px;
}

.ai-page--theme-gameboy .ai-page__container {
    padding: clamp(20px, 3.5vw, 36px);
    background: #c6de8c;
    border: 4px solid #0f380f;
    border-radius: 0;
    box-shadow: 8px 8px 0 rgba(15, 56, 15, 0.45);
}

.ai-page--theme-gameboy .ai-page__title {
    color: #0f380f;
    text-transform: uppercase;
    line-height: 1.6;
    text-shadow: 3px 3px 0 rgba(15, 56, 15, 0.3);
}

.ai-page--theme-gameboy .ai-page__lead {
    color: #306230;
}

.ai-page--theme-gameboy .ai-page__content h2,
.ai-page--theme-gameboy .ai-page__content h3 {
    color: #0f380f;
    text-transform: uppercase;
    line-height: 1.7;
    border-bottom: 4px solid #0f380f;
    padding-bottom: 8px;
}

.ai-page--theme-gameboy .ai-page__content a {
    color: #0f380f;
    text-decoration: none;
    border-bottom: 3px dotted #0f380f;
}

.ai-page--theme-gameboy .ai-page__content blockquote {
    color: #306230;
    background: rgba(15, 56, 15, 0.08);
    border-left: 8px solid #0f380f;
    border-radius: 0;
    box-shadow: 6px 6px 0 rgba(15, 56, 15, 0.25);
}

.ai-page--theme-gameboy .ai-page__hero img,
.ai-page--theme-gameboy .ai-page__content img {
    border: 4px solid #0f380f;
    border-radius: 0;
    filter: grayscale(1) contrast(1.08);
    image-rendering: pixelated;
}

/* 平面卡通 */
.ai-page--theme-cartoon {
    --ai-page-text: #21252b;
    --ai-page-muted: #5b6169;
    --ai-page-accent: #ff7a00;
    font-family: "Nunito", "Segoe UI", "Noto Sans TC", system-ui, sans-serif;
    background-color: #fff6e9;
}

.ai-page--theme-cartoon .ai-page__container {
    padding: clamp(24px, 4vw, 44px);
    background: #fff;
    border: 3px solid #21252b;
    border-radius: 28px;
    box-shadow: 0 10px 0 rgba(33, 37, 43, 0.9);
}

.ai-page--theme-cartoon .ai-page__title {
    color: var(--ai-page-accent);
    font-weight: 900;
    letter-spacing: -0.01em;
}

.ai-page--theme-cartoon .ai-page__content strong {
    padding: 0 0.2em;
    border-radius: 6px;
    background: #ffe08a;
}

.ai-page--theme-cartoon .ai-page__content blockquote {
    color: #6b5327;
    background: #fff3d6;
    border: 2px dashed #ffb547;
    border-radius: 16px;
}

/* 太空 */
.ai-page--theme-space {
    --ai-page-text: #e8eeff;
    --ai-page-muted: #a9b6da;
    --ai-page-accent: #8fb4ff;
    --ai-page-line: rgba(150, 180, 255, 0.32);
    --ai-page-code-bg: rgba(255, 255, 255, 0.08);
    background-color: #060a1f;
    background-image:
        radial-gradient(2px 2px at 20% 30%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 70% 18%, #cfe0ff, transparent),
        radial-gradient(1.5px 1.5px at 42% 76%, #fff, transparent),
        radial-gradient(2px 2px at 86% 62%, #bcd0ff, transparent),
        radial-gradient(ellipse at 50% -10%, rgba(80, 110, 255, 0.35), transparent 60%);
}

.ai-page--theme-space .ai-page__title {
    color: #fff;
    text-shadow: 0 0 24px rgba(120, 160, 255, 0.85);
}

.ai-page--theme-space .ai-page__content h2,
.ai-page--theme-space .ai-page__content h3 {
    color: #dbe6ff;
}

.ai-page--theme-space .ai-page__content blockquote {
    border-left: 3px solid rgba(150, 180, 255, 0.6);
    border-radius: 12px;
    background: rgba(140, 170, 255, 0.08);
}

/* 科幻霓虹 */
.ai-page--theme-scifi {
    --ai-page-text: #d7fbff;
    --ai-page-muted: #7fd7e8;
    --ai-page-accent: #00e5ff;
    --ai-page-line: rgba(0, 229, 255, 0.35);
    --ai-page-code-bg: rgba(0, 229, 255, 0.08);
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    background-color: #03070d;
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
}

.ai-page--theme-scifi .ai-page__title {
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    text-shadow: 0 0 8px #00e5ff, 0 0 24px rgba(0, 229, 255, 0.6);
}

.ai-page--theme-scifi .ai-page__content h2,
.ai-page--theme-scifi .ai-page__content h3 {
    color: #7ef9ff;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.ai-page--theme-scifi .ai-page__content a {
    color: #ff5cf0;
}

.ai-page--theme-scifi .ai-page__content blockquote {
    border-left: 2px solid var(--ai-page-accent);
    background: rgba(0, 229, 255, 0.06);
    box-shadow: inset 0 0 24px rgba(0, 229, 255, 0.08);
}

.ai-page--theme-scifi .ai-page__hero img,
.ai-page--theme-scifi .ai-page__content img {
    border: 1px solid rgba(0, 229, 255, 0.5);
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.25);
}

/* 復古報紙 */
.ai-page--theme-retro {
    --ai-page-text: #26221c;
    --ai-page-muted: #6b6459;
    --ai-page-accent: #9b2c2c;
    font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
    background-color: #f6f1e7;
}

.ai-page--theme-retro .ai-page__title {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-bottom: 3px double #26221c;
    padding-bottom: 12px;
}

.ai-page--theme-retro .ai-page__content h2,
.ai-page--theme-retro .ai-page__content h3 {
    border-bottom: 1px solid rgba(38, 34, 28, 0.3);
}

.ai-page--theme-retro .ai-page__content blockquote {
    border-left: 3px solid #26221c;
    background: transparent;
    font-style: italic;
}

/* 雜誌風 */
.ai-page--theme-magazine {
    --ai-page-text: #111;
    --ai-page-muted: #666;
    --ai-page-accent: #d7263d;
    background: #fff;
}

.ai-page--theme-magazine .ai-page__title {
    font-size: clamp(2.1rem, 5.6vw, 3.8rem);
    line-height: 1.03;
    letter-spacing: -0.02em;
}

.ai-page--theme-magazine .ai-page__content h2 {
    font-size: 1.8rem;
    letter-spacing: -0.01em;
}

.ai-page--theme-magazine .ai-page__content > p:first-of-type::first-letter {
    float: left;
    margin: 0.06em 0.12em 0 0;
    font-size: 3.4em;
    line-height: 0.86;
    font-weight: 800;
    color: var(--ai-page-accent);
}

/* 極簡白 */
.ai-page--theme-minimal {
    --ai-page-text: #1a1a1a;
    --ai-page-muted: #767676;
    --ai-page-accent: #1a1a1a;
    background: #fff;
}

.ai-page--theme-minimal .ai-page__lead {
    font-size: 1.15rem;
}

.ai-page--theme-minimal .ai-page__content h2,
.ai-page--theme-minimal .ai-page__content h3 {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.ai-page--theme-minimal .ai-page__content blockquote {
    background: transparent;
}

/* 玻璃擬物 */
.ai-page--theme-glass {
    --ai-page-text: #101828;
    --ai-page-muted: #475467;
    --ai-page-accent: #5b8def;
    background: linear-gradient(135deg, #e8f0ff, #f7e9ff 45%, #e9fbff);
}

.ai-page--theme-glass .ai-page__container {
    padding: clamp(24px, 4vw, 44px);
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(16, 24, 40, 0.14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.ai-page--theme-glass .ai-page__content blockquote {
    border-left: 3px solid rgba(91, 141, 239, 0.5);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.5);
}

/* 賽博龐克 */
.ai-page--theme-cyberpunk {
    --ai-page-text: #f2f0ff;
    --ai-page-muted: #b9a8d8;
    --ai-page-accent: #ff2fb9;
    --ai-page-line: rgba(255, 47, 185, 0.4);
    --ai-page-code-bg: rgba(255, 255, 255, 0.08);
    font-family: "Rajdhani", "Noto Sans TC", system-ui, sans-serif;
    background-color: #120023;
    background-image:
        linear-gradient(rgba(255, 47, 185, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.12) 1px, transparent 1px),
        radial-gradient(ellipse at 80% -10%, rgba(255, 47, 185, 0.35), transparent 55%),
        radial-gradient(ellipse at 0% 110%, rgba(0, 240, 255, 0.3), transparent 55%);
    background-size: 44px 44px, 44px 44px, auto, auto;
}

.ai-page--theme-cyberpunk .ai-page__title {
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 2px 0 #ff2fb9, -2px 0 #00f0ff, 0 0 26px rgba(255, 47, 185, 0.6);
}

.ai-page--theme-cyberpunk .ai-page__content h2,
.ai-page--theme-cyberpunk .ai-page__content h3 {
    color: #00f0ff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid var(--ai-page-accent);
    padding-bottom: 6px;
}

.ai-page--theme-cyberpunk .ai-page__content a {
    color: #ffd400;
}

.ai-page--theme-cyberpunk .ai-page__content blockquote {
    color: var(--ai-page-muted);
    background: rgba(255, 47, 185, 0.12);
    border-left: 4px solid #00f0ff;
}

/* 蒸氣波 */
.ai-page--theme-vaporwave {
    --ai-page-text: #2b1b4d;
    --ai-page-muted: #6b5a92;
    --ai-page-accent: #ff5fa2;
    font-family: "Poppins", "Noto Sans TC", system-ui, sans-serif;
    background: linear-gradient(180deg, #ffe9f6 0%, #e7ddff 45%, #cdf3ff 100%);
}

.ai-page--theme-vaporwave .ai-page__title {
    color: #5b2a86;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    text-shadow: 2px 2px 0 #ffd1e8, 4px 4px 0 rgba(0, 0, 0, 0.08);
}

.ai-page--theme-vaporwave .ai-page__content h2,
.ai-page--theme-vaporwave .ai-page__content h3 {
    color: #b0368f;
    letter-spacing: 0.06em;
}

.ai-page--theme-vaporwave .ai-page__content blockquote {
    background: rgba(255, 255, 255, 0.55);
    border-left: 4px solid var(--ai-page-accent);
    border-radius: 0 12px 12px 0;
}

.ai-page--theme-vaporwave .ai-page__hero img,
.ai-page--theme-vaporwave .ai-page__content img {
    border-radius: 8px;
    box-shadow: 8px 8px 0 rgba(255, 95, 162, 0.35), -8px -8px 0 rgba(90, 200, 255, 0.35);
}

/* 終端機 */
.ai-page--theme-terminal {
    --ai-page-text: #7dfba6;
    --ai-page-muted: #4fd07f;
    --ai-page-accent: #b6ff5c;
    --ai-page-line: rgba(125, 251, 166, 0.3);
    --ai-page-code-bg: rgba(0, 255, 120, 0.08);
    font-family: ui-monospace, "Courier New", monospace;
    background-color: #04120a;
    background-image: repeating-linear-gradient(0deg, rgba(0, 255, 120, 0.05) 0 1px, transparent 1px 3px);
}

.ai-page--theme-terminal .ai-page__title {
    color: #b6ff5c;
    text-shadow: 0 0 10px rgba(120, 255, 150, 0.6);
}

.ai-page--theme-terminal .ai-page__title::before {
    content: "> ";
    color: var(--ai-page-accent);
}

.ai-page--theme-terminal .ai-page__content h2::before {
    content: "## ";
    color: var(--ai-page-muted);
}

.ai-page--theme-terminal .ai-page__content a {
    color: #6ee7ff;
}

.ai-page--theme-terminal .ai-page__content blockquote {
    color: var(--ai-page-muted);
    background: rgba(0, 255, 120, 0.06);
    border-left: 3px solid var(--ai-page-accent);
}

/* 工程藍圖 */
.ai-page--theme-blueprint {
    --ai-page-text: #eaf3ff;
    --ai-page-muted: #9fc0e6;
    --ai-page-accent: #7fd4ff;
    --ai-page-line: rgba(255, 255, 255, 0.35);
    --ai-page-code-bg: rgba(255, 255, 255, 0.1);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    background-color: #062a4a;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
}

.ai-page--theme-blueprint .ai-page__title {
    display: inline-block;
    color: #fff;
    letter-spacing: 0.06em;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 10px 14px;
}

.ai-page--theme-blueprint .ai-page__content h2,
.ai-page--theme-blueprint .ai-page__content h3 {
    color: #bfe6ff;
    letter-spacing: 0.04em;
}

.ai-page--theme-blueprint .ai-page__content blockquote {
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(191, 230, 255, 0.6);
}

/* 美式漫畫 */
.ai-page--theme-comic {
    --ai-page-text: #14110f;
    --ai-page-muted: #4a443d;
    --ai-page-accent: #e63946;
    font-family: "Comic Sans MS", "Chalkboard SE", "Noto Sans TC", system-ui, sans-serif;
    background-color: #fff9ec;
    background-image: radial-gradient(rgba(20, 17, 15, 0.14) 1.2px, transparent 1.2px);
    background-size: 10px 10px;
}

.ai-page--theme-comic .ai-page__title {
    display: inline-block;
    color: #fff;
    background: var(--ai-page-accent);
    padding: 6px 14px;
    border: 3px solid #14110f;
    border-radius: 6px;
    transform: rotate(-1.5deg);
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
    box-shadow: 5px 5px 0 #14110f;
}

.ai-page--theme-comic .ai-page__content h2 {
    color: #14110f;
    border-bottom: 4px solid #14110f;
}

.ai-page--theme-comic .ai-page__content strong {
    padding: 0 0.18em;
    background: #ffe066;
    border: 2px solid #14110f;
    border-radius: 4px;
}

.ai-page--theme-comic .ai-page__content blockquote {
    color: #4a443d;
    background: #fff;
    border: 3px solid #14110f;
    border-radius: 10px;
    box-shadow: 5px 5px 0 rgba(20, 17, 15, 0.85);
}

/* 手帳筆記 */
.ai-page--theme-notebook {
    --ai-page-text: #33302b;
    --ai-page-muted: #7a7368;
    --ai-page-accent: #e07a5f;
    font-family: "Kalam", "Bradley Hand", "Noto Sans TC", cursive, system-ui, sans-serif;
    background-color: #fffdf5;
    background-image: repeating-linear-gradient(180deg, transparent 0 31px, rgba(90, 130, 190, 0.25) 31px 32px);
}

.ai-page--theme-notebook .ai-page__container {
    padding-left: 44px;
    border-left: 2px solid rgba(224, 122, 95, 0.5);
}

.ai-page--theme-notebook .ai-page__title {
    color: #2f4f7f;
}

.ai-page--theme-notebook .ai-page__content h2,
.ai-page--theme-notebook .ai-page__content h3 {
    color: #e07a5f;
}

.ai-page--theme-notebook .ai-page__content blockquote {
    background: #fff4d6;
    border: 1px dashed #e0b98a;
    border-radius: 8px;
}

/* 高級奢華 */
.ai-page--theme-luxury {
    --ai-page-text: #eae0c8;
    --ai-page-muted: #b3a682;
    --ai-page-accent: #d4af37;
    --ai-page-line: rgba(212, 175, 55, 0.35);
    --ai-page-code-bg: rgba(212, 175, 55, 0.08);
    font-family: "Cormorant Garamond", Georgia, "Noto Serif TC", serif;
    background-color: #0d0c0a;
    background-image: radial-gradient(ellipse at 50% -20%, rgba(212, 175, 55, 0.18), transparent 60%);
}

.ai-page--theme-luxury .ai-page__title {
    color: #f3e6c4;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    border-bottom: 1px solid rgba(212, 175, 55, 0.6);
    padding-bottom: 14px;
}

.ai-page--theme-luxury .ai-page__content h2,
.ai-page--theme-luxury .ai-page__content h3 {
    color: #e9d9a8;
    letter-spacing: 0.1em;
}

.ai-page--theme-luxury .ai-page__content a {
    color: #e6c964;
}

.ai-page--theme-luxury .ai-page__content blockquote {
    color: var(--ai-page-muted);
    background: rgba(212, 175, 55, 0.08);
    border-left: 2px solid var(--ai-page-accent);
    font-style: italic;
}

/* 粉彩柔和 */
.ai-page--theme-pastel {
    --ai-page-text: #3a3a50;
    --ai-page-muted: #7b7b96;
    --ai-page-accent: #7f8ff4;
    background: linear-gradient(160deg, #fdf2f8, #eef4ff 50%, #eefaf3);
}

.ai-page--theme-pastel .ai-page__container {
    padding: clamp(24px, 4vw, 44px);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(122, 122, 160, 0.14);
}

.ai-page--theme-pastel .ai-page__title {
    color: #5b64c9;
}

.ai-page--theme-pastel .ai-page__content blockquote {
    background: #f1f0ff;
    border-left: 4px solid #b9c0ff;
    border-radius: 0 14px 14px 0;
}

/* 可愛粉紅 */
.ai-page--theme-kawaii {
    --ai-page-text: #5b3546;
    --ai-page-muted: #9c7286;
    --ai-page-accent: #ff7fb0;
    background-color: #fff0f6;
    background-image: radial-gradient(rgba(255, 127, 176, 0.22) 2px, transparent 2px);
    background-size: 26px 26px;
}

.ai-page--theme-kawaii .ai-page__container {
    padding: clamp(24px, 4vw, 40px);
    background: #fff;
    border: 3px dashed #ffb3d1;
    border-radius: 30px;
}

.ai-page--theme-kawaii .ai-page__title {
    color: #ff5c9d;
}

.ai-page--theme-kawaii .ai-page__content h2::after {
    content: " ♡";
    color: #ff9ec4;
}

.ai-page--theme-kawaii .ai-page__content blockquote {
    background: #ffe6f1;
    border: 2px solid #ffc2da;
    border-radius: 18px;
}

/* 東方水墨 */
.ai-page--theme-ink {
    --ai-page-text: #23262b;
    --ai-page-muted: #6a6f78;
    --ai-page-accent: #8c1f1f;
    font-family: "Noto Serif TC", "Songti TC", Georgia, serif;
    background-color: #f7f5ef;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(0, 0, 0, 0.05), transparent 50%),
        radial-gradient(ellipse at 90% 100%, rgba(0, 0, 0, 0.04), transparent 45%);
}

.ai-page--theme-ink .ai-page__title {
    letter-spacing: 0.14em;
    border-bottom: 1px solid rgba(35, 38, 43, 0.35);
    padding-bottom: 12px;
}

.ai-page--theme-ink .ai-page__content h2,
.ai-page--theme-ink .ai-page__content h3 {
    letter-spacing: 0.1em;
    border-left: 6px solid var(--ai-page-accent);
    padding-left: 12px;
}

.ai-page--theme-ink .ai-page__content blockquote {
    background: rgba(140, 31, 31, 0.05);
    border-left: 3px solid var(--ai-page-accent);
    font-style: italic;
}

/* 包浩斯 */
.ai-page--theme-bauhaus {
    --ai-page-text: #111;
    --ai-page-muted: #555;
    --ai-page-accent: #d62828;
    font-family: "Futura", "Noto Sans TC", system-ui, sans-serif;
    background-color: #f4f0e6;
}

.ai-page--theme-bauhaus .ai-page__title {
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-left: 18px solid #1d4ed8;
    padding-left: 16px;
}

.ai-page--theme-bauhaus .ai-page__content h2 {
    display: inline-block;
    padding: 4px 10px;
    background: #f4c430;
}

.ai-page--theme-bauhaus .ai-page__content a {
    color: #d62828;
}

.ai-page--theme-bauhaus .ai-page__content blockquote {
    color: #fff;
    background: #1d4ed8;
    border-left: 0;
    border-radius: 0;
    padding: 16px 20px;
}

/* 自然森林 */
.ai-page--theme-forest {
    --ai-page-text: #1e2a22;
    --ai-page-muted: #586b5d;
    --ai-page-accent: #2f7d4f;
    background: linear-gradient(180deg, #eaf5ec, #f4f1e6 70%);
}

.ai-page--theme-forest .ai-page__title {
    color: #1f5f3c;
}

.ai-page--theme-forest .ai-page__content h2,
.ai-page--theme-forest .ai-page__content h3 {
    color: #2f7d4f;
    border-bottom: 2px solid rgba(47, 125, 79, 0.3);
}

.ai-page--theme-forest .ai-page__content blockquote {
    background: rgba(47, 125, 79, 0.08);
    border-left: 4px solid var(--ai-page-accent);
}

/* 海洋 */
.ai-page--theme-ocean {
    --ai-page-text: #062b3f;
    --ai-page-muted: #3d6c82;
    --ai-page-accent: #0a86b5;
    background: linear-gradient(180deg, #e6f7ff, #cdeeff 40%, #e9fbf5);
}

.ai-page--theme-ocean .ai-page__title {
    color: #08415c;
}

.ai-page--theme-ocean .ai-page__content h2,
.ai-page--theme-ocean .ai-page__content h3 {
    color: #0a86b5;
}

.ai-page--theme-ocean .ai-page__content blockquote {
    background: rgba(10, 134, 181, 0.08);
    border-left: 4px solid var(--ai-page-accent);
    border-radius: 0 14px 14px 0;
}

/* 黑白電影 */
.ai-page--theme-noir {
    --ai-page-text: #f2f2f2;
    --ai-page-muted: #a6a6a6;
    --ai-page-accent: #ffd166;
    --ai-page-line: rgba(255, 255, 255, 0.28);
    --ai-page-code-bg: rgba(255, 255, 255, 0.08);
    font-family: "Playfair Display", Georgia, "Noto Serif TC", serif;
    background-color: #0a0a0a;
}

.ai-page--theme-noir .ai-page__title {
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    border-bottom: 3px double rgba(255, 255, 255, 0.5);
    padding-bottom: 14px;
}

.ai-page--theme-noir .ai-page__content h2,
.ai-page--theme-noir .ai-page__content h3 {
    color: #fff;
    letter-spacing: 0.08em;
}

.ai-page--theme-noir .ai-page__content blockquote {
    color: var(--ai-page-muted);
    background: rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--ai-page-accent);
}

/* ==========================================================================
   動態・高級風格（純 CSS 動畫，全部支援 prefers-reduced-motion）
   ========================================================================== */

/* 極光流動 */
.ai-page--theme-aurora {
    --ai-page-text: #eaf2ff;
    --ai-page-muted: #a9bcd8;
    --ai-page-accent: #7ef9d1;
    --ai-page-line: rgba(255, 255, 255, 0.22);
    --ai-page-code-bg: rgba(255, 255, 255, 0.1);
    background-color: #060b1a;
    background-image:
        radial-gradient(60% 60% at 20% 20%, rgba(0, 255, 200, 0.35), transparent 60%),
        radial-gradient(50% 50% at 80% 30%, rgba(120, 90, 255, 0.35), transparent 60%),
        radial-gradient(60% 60% at 50% 90%, rgba(0, 180, 255, 0.3), transparent 60%);
    background-size: 200% 200%;
    animation: ai-aurora 18s ease-in-out infinite alternate;
}

.ai-page--theme-aurora .ai-page__container {
    padding: clamp(24px, 4vw, 44px);
    background: rgba(10, 18, 35, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ai-page--theme-aurora .ai-page__title {
    color: #fff;
    text-shadow: 0 0 30px rgba(126, 249, 209, 0.6);
}

.ai-page--theme-aurora .ai-page__content blockquote {
    color: var(--ai-page-muted);
    background: rgba(126, 249, 209, 0.08);
    border-left: 3px solid var(--ai-page-accent);
    border-radius: 0 14px 14px 0;
}

@keyframes ai-aurora {
    0% {
        background-position: 0 0, 100% 0, 50% 100%;
    }

    100% {
        background-position: 30% 20%, 60% 40%, 40% 70%;
    }
}

/* 霓虹脈衝 */
.ai-page--theme-neon {
    --ai-page-text: #f3f0ff;
    --ai-page-muted: #b6a8e0;
    --ai-page-accent: #ff2fd0;
    --ai-page-line: rgba(255, 47, 208, 0.42);
    --ai-page-code-bg: rgba(255, 47, 208, 0.1);
    background-color: #0a0416;
}

.ai-page--theme-neon .ai-page__title {
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    animation: ai-neon 2.4s ease-in-out infinite alternate;
}

.ai-page--theme-neon .ai-page__content h2,
.ai-page--theme-neon .ai-page__content h3 {
    color: #00e5ff;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.7);
}

.ai-page--theme-neon .ai-page__content a {
    color: #ffd400;
    text-shadow: 0 0 10px rgba(255, 212, 0, 0.5);
}

.ai-page--theme-neon .ai-page__content blockquote {
    color: var(--ai-page-muted);
    background: rgba(255, 47, 208, 0.1);
    border-left: 3px solid #00e5ff;
}

.ai-page--theme-neon .ai-page__hero img,
.ai-page--theme-neon .ai-page__content img {
    border: 1px solid rgba(0, 229, 255, 0.6);
    box-shadow: 0 0 22px rgba(255, 47, 208, 0.45);
}

@keyframes ai-neon {
    from {
        text-shadow: 0 0 6px #ff2fd0, 0 0 18px #ff2fd0;
    }

    to {
        text-shadow: 0 0 10px #00e5ff, 0 0 26px #00e5ff, 0 0 48px #ff2fd0;
    }
}

/* 故障藝術 */
.ai-page--theme-glitch {
    --ai-page-text: #e8fff6;
    --ai-page-muted: #8fd6c4;
    --ai-page-accent: #00ff9c;
    --ai-page-line: rgba(0, 255, 156, 0.35);
    --ai-page-code-bg: rgba(0, 255, 156, 0.08);
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    background-color: #050607;
    background-image: repeating-linear-gradient(0deg, rgba(0, 255, 156, 0.05) 0 1px, transparent 1px 3px);
}

.ai-page--theme-glitch .ai-page__title {
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    animation: ai-glitch 3.4s steps(1, end) infinite;
}

.ai-page--theme-glitch .ai-page__content h2,
.ai-page--theme-glitch .ai-page__content h3 {
    color: #00ff9c;
    text-shadow: 1px 0 #ff005c, -1px 0 #00fff0;
}

.ai-page--theme-glitch .ai-page__content a {
    color: #00fff0;
}

.ai-page--theme-glitch .ai-page__content blockquote {
    color: var(--ai-page-muted);
    background: rgba(0, 255, 156, 0.08);
    border-left: 3px solid var(--ai-page-accent);
}

@keyframes ai-glitch {
    0%,
    90%,
    100% {
        transform: translate(0, 0);
        text-shadow: 2px 0 #ff005c, -2px 0 #00fff0;
    }

    92% {
        transform: translate(-3px, 1px);
        text-shadow: -3px 0 #ff005c, 3px 0 #00fff0;
    }

    95% {
        transform: translate(3px, -1px);
        text-shadow: 3px 0 #ff005c, -3px 0 #00fff0;
    }

    97% {
        transform: translate(-2px, 0);
        text-shadow: 2px 0 #00fff0, -2px 0 #ff005c;
    }
}

/* 星空漂流 */
.ai-page--theme-starfield {
    --ai-page-text: #eef4ff;
    --ai-page-muted: #9fb0d0;
    --ai-page-accent: #9fc0ff;
    --ai-page-line: rgba(255, 255, 255, 0.25);
    --ai-page-code-bg: rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    background-color: #04070f;
    background-image:
        radial-gradient(1.6px 1.6px at 12% 22%, #fff, transparent),
        radial-gradient(1.4px 1.4px at 68% 14%, #cfe0ff, transparent),
        radial-gradient(1.6px 1.6px at 34% 68%, #fff, transparent),
        radial-gradient(1.2px 1.2px at 82% 58%, #bcd0ff, transparent),
        radial-gradient(1.6px 1.6px at 52% 88%, #fff, transparent),
        radial-gradient(ellipse at 50% -10%, rgba(90, 120, 255, 0.28), transparent 60%);
    background-size: 320px 320px;
    animation: ai-stars 70s linear infinite;
}

.ai-page--theme-starfield::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(1.6px 1.6px at 30% 30%, #fff, transparent),
        radial-gradient(1.4px 1.4px at 76% 64%, #fff, transparent),
        radial-gradient(1.4px 1.4px at 18% 78%, #dbe6ff, transparent);
    background-size: 240px 240px;
    animation: ai-twinkle 4.5s ease-in-out infinite alternate;
}

.ai-page--theme-starfield .ai-page__container {
    position: relative;
    z-index: 1;
}

.ai-page--theme-starfield .ai-page__title {
    color: #fff;
    text-shadow: 0 0 26px rgba(159, 192, 255, 0.85);
}

.ai-page--theme-starfield .ai-page__content blockquote {
    color: var(--ai-page-muted);
    background: rgba(140, 170, 255, 0.08);
    border-left: 3px solid rgba(150, 180, 255, 0.6);
    border-radius: 0 14px 14px 0;
}

@keyframes ai-stars {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 320px 640px;
    }
}

@keyframes ai-twinkle {
    from {
        opacity: 0.35;
    }

    to {
        opacity: 0.9;
    }
}

/* 全息幻彩 */
.ai-page--theme-holographic {
    --ai-page-text: #eaf0ff;
    --ai-page-muted: #a9b6d8;
    --ai-page-accent: #8af0ff;
    --ai-page-line: rgba(255, 255, 255, 0.25);
    --ai-page-code-bg: rgba(255, 255, 255, 0.1);
    background-color: #070b18;
}

.ai-page--theme-holographic .ai-page__container {
    position: relative;
    padding: clamp(24px, 4vw, 44px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
    border-radius: 22px;
}

.ai-page--theme-holographic .ai-page__container::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: 22px;
    pointer-events: none;
    background: linear-gradient(120deg, #00e5ff, #a855f7, #ff2fd0, #facc15, #00e5ff);
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    animation: ai-holo 6s linear infinite;
}

.ai-page--theme-holographic .ai-page__title {
    background: linear-gradient(90deg, #8af0ff, #c4b5fd, #ffa8e8, #8af0ff);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: ai-holo-text 8s linear infinite;
}

.ai-page--theme-holographic .ai-page__content h2,
.ai-page--theme-holographic .ai-page__content h3 {
    color: #cfe4ff;
}

.ai-page--theme-holographic .ai-page__content blockquote {
    color: var(--ai-page-muted);
    background: rgba(138, 240, 255, 0.08);
    border-left: 3px solid rgba(196, 181, 253, 0.7);
    border-radius: 0 14px 14px 0;
}

@keyframes ai-holo {
    from {
        background-position: 0% 50%;
    }

    to {
        background-position: 300% 50%;
    }
}

@keyframes ai-holo-text {
    from {
        background-position: 0% 50%;
    }

    to {
        background-position: 300% 50%;
    }
}

/* 合成波網格 */
.ai-page--theme-synthwave {
    --ai-page-text: #ffe9fb;
    --ai-page-muted: #c9a6dd;
    --ai-page-accent: #ff4dd2;
    --ai-page-line: rgba(255, 77, 210, 0.4);
    --ai-page-code-bg: rgba(255, 77, 210, 0.1);
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #12002b 0%, #2a0a4a 45%, #3d0f5c 100%);
}

.ai-page--theme-synthwave::before {
    content: "";
    position: absolute;
    left: -50%;
    right: -50%;
    bottom: -42%;
    height: 92%;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 77, 210, 0.5) 2px, transparent 2px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.45) 2px, transparent 2px);
    background-size: 64px 64px;
    transform: perspective(360px) rotateX(70deg);
    transform-origin: bottom center;
    animation: ai-grid 2.6s linear infinite;
}

.ai-page--theme-synthwave .ai-page__container {
    position: relative;
    z-index: 1;
}

.ai-page--theme-synthwave .ai-page__title {
    color: #fff;
    text-shadow: 0 0 18px #ff4dd2, 0 0 40px #ff4dd2;
}

.ai-page--theme-synthwave .ai-page__content h2,
.ai-page--theme-synthwave .ai-page__content h3 {
    color: #00e5ff;
    text-shadow: 0 0 14px rgba(0, 229, 255, 0.6);
}

.ai-page--theme-synthwave .ai-page__content blockquote {
    color: var(--ai-page-muted);
    background: rgba(255, 77, 210, 0.12);
    border-left: 3px solid #00e5ff;
}

@keyframes ai-grid {
    from {
        background-position: 0 0, 0 0;
    }

    to {
        background-position: 0 64px, 0 0;
    }
}

/* 泡泡漂浮 */
.ai-page--theme-bubble {
    --ai-page-text: #26324a;
    --ai-page-muted: #5b6b88;
    --ai-page-accent: #4aa8ff;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #eaf6ff, #f6ecff);
}

.ai-page--theme-bubble::before,
.ai-page--theme-bubble::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    opacity: 0.55;
    pointer-events: none;
}

.ai-page--theme-bubble::before {
    top: 8%;
    left: -50px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle at 30% 30%, #fff, #bfe3ff);
    animation: ai-float 9s ease-in-out infinite;
}

.ai-page--theme-bubble::after {
    right: -40px;
    bottom: 6%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 30% 30%, #fff, #ffd6f2);
    animation: ai-float 12s ease-in-out infinite reverse;
}

.ai-page--theme-bubble .ai-page__container {
    position: relative;
    z-index: 1;
    padding: clamp(24px, 4vw, 40px);
    background: rgba(255, 255, 255, 0.78);
    border-radius: 28px;
    box-shadow: 0 20px 50px rgba(74, 168, 255, 0.16);
}

.ai-page--theme-bubble .ai-page__title {
    color: #2b6fd6;
}

@keyframes ai-float {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-26px);
    }
}

/* ==========================================================================
   動漫・角色風格（只係配色／氣氛參考，不含任何官方圖像或商標素材）
   ========================================================================== */

/* 龍珠風：熱血橙藍、能量感 */
.ai-page--theme-dragonball {
    --ai-page-text: #17223f;
    --ai-page-muted: #5a6a92;
    --ai-page-accent: #ff7a00;
    --ai-page-line: rgba(27, 58, 140, 0.25);
    --ai-page-code-bg: rgba(27, 58, 140, 0.08);
    background-color: #fff6e5;
    background-image:
        repeating-linear-gradient(135deg, rgba(255, 122, 0, 0.14) 0 12px, transparent 12px 24px),
        radial-gradient(circle at 88% 12%, rgba(255, 212, 0, 0.4), transparent 26%),
        radial-gradient(circle at 8% 88%, rgba(27, 58, 140, 0.12), transparent 26%);
}

.ai-page--theme-dragonball .ai-page__container {
    padding: clamp(24px, 4vw, 42px);
    background: #fff;
    border: 4px solid #1b3a8c;
    border-radius: 18px;
    box-shadow: 10px 10px 0 #ff7a00;
}

.ai-page--theme-dragonball .ai-page__title {
    color: #ff7a00;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-shadow: 3px 3px 0 #1b3a8c;
}

.ai-page--theme-dragonball .ai-page__content h2,
.ai-page--theme-dragonball .ai-page__content h3 {
    color: #1b3a8c;
    border-bottom: 4px solid #ffd400;
    padding-bottom: 8px;
}

.ai-page--theme-dragonball .ai-page__content a {
    color: #1b3a8c;
}

.ai-page--theme-dragonball .ai-page__content strong {
    color: #ff7a00;
}

.ai-page--theme-dragonball .ai-page__content blockquote {
    color: #33436b;
    background: #eef3ff;
    border-left: 6px solid #1b3a8c;
    border-radius: 0 14px 14px 0;
}

/* 美少女戰士風：粉金月光 */
.ai-page--theme-sailormoon {
    --ai-page-text: #2a2140;
    --ai-page-muted: #6d6390;
    --ai-page-accent: #ff69b4;
    --ai-page-line: rgba(246, 196, 83, 0.55);
    --ai-page-code-bg: rgba(255, 105, 180, 0.08);
    font-family: "Cormorant Garamond", Georgia, "Noto Serif TC", serif;
    background: linear-gradient(180deg, #fff2f8 0%, #f6f1ff 55%, #fff9ec 100%);
    background-image:
        radial-gradient(2px 2px at 18% 22%, rgba(246, 196, 83, 0.7), transparent),
        radial-gradient(2px 2px at 74% 16%, rgba(255, 105, 180, 0.6), transparent),
        radial-gradient(2px 2px at 42% 78%, rgba(246, 196, 83, 0.6), transparent),
        radial-gradient(2px 2px at 88% 62%, rgba(255, 105, 180, 0.5), transparent);
    background-size: 260px 260px;
}

.ai-page--theme-sailormoon .ai-page__container {
    padding: clamp(24px, 4vw, 44px);
    background: rgba(255, 255, 255, 0.82);
    border: 2px solid #f6c453;
    border-radius: 26px;
    box-shadow: 0 18px 44px rgba(255, 105, 180, 0.18);
}

.ai-page--theme-sailormoon .ai-page__title {
    color: #d63c8a;
    letter-spacing: 0.06em;
    text-shadow: 0 0 18px rgba(246, 196, 83, 0.6);
}

.ai-page--theme-sailormoon .ai-page__title::before {
    content: "☾ ";
    color: #f6c453;
}

.ai-page--theme-sailormoon .ai-page__content h2,
.ai-page--theme-sailormoon .ai-page__content h3 {
    color: #6a4bb5;
    border-bottom: 2px solid rgba(246, 196, 83, 0.7);
    padding-bottom: 8px;
}

.ai-page--theme-sailormoon .ai-page__content blockquote {
    color: #6d6390;
    background: #fff6fb;
    border-left: 4px solid #ff69b4;
    border-radius: 0 16px 16px 0;
}

/* 百變小櫻風：魔法粉＋星星 */
.ai-page--theme-sakura {
    --ai-page-text: #4a3350;
    --ai-page-muted: #8a7392;
    --ai-page-accent: #ff8fc0;
    --ai-page-line: rgba(154, 208, 255, 0.6);
    --ai-page-code-bg: rgba(255, 143, 192, 0.1);
    background-color: #fff5fa;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(154, 208, 255, 0.35), transparent 22%),
        radial-gradient(circle at 88% 30%, rgba(255, 183, 213, 0.45), transparent 24%),
        radial-gradient(circle at 60% 85%, rgba(255, 230, 150, 0.35), transparent 22%);
}

.ai-page--theme-sakura .ai-page__container {
    padding: clamp(24px, 4vw, 42px);
    background: #fff;
    border: 3px dashed #ffc2da;
    border-radius: 28px;
    box-shadow: 0 16px 40px rgba(255, 143, 192, 0.2);
}

.ai-page--theme-sakura .ai-page__title {
    color: #e2569a;
}

.ai-page--theme-sakura .ai-page__title::after {
    content: " ✦";
    color: #f0c14b;
}

.ai-page--theme-sakura .ai-page__content h2,
.ai-page--theme-sakura .ai-page__content h3 {
    color: #6aa8e0;
}

.ai-page--theme-sakura .ai-page__content h2::after {
    content: " ★";
    color: #ff8fc0;
}

.ai-page--theme-sakura .ai-page__content strong {
    color: #e2569a;
}

.ai-page--theme-sakura .ai-page__content blockquote {
    color: #8a7392;
    background: #fff0f7;
    border: 2px solid #ffd0e4;
    border-radius: 18px;
}

/* 多啦A夢風：藍白紅、圓潤 */
.ai-page--theme-doraemon {
    --ai-page-text: #17233d;
    --ai-page-muted: #5b6b88;
    --ai-page-accent: #e8433f;
    --ai-page-line: rgba(15, 111, 214, 0.3);
    --ai-page-code-bg: rgba(15, 111, 214, 0.08);
    background-color: #eaf4ff;
    background-image: radial-gradient(rgba(15, 111, 214, 0.14) 2px, transparent 2px);
    background-size: 22px 22px;
}

.ai-page--theme-doraemon .ai-page__container {
    padding: clamp(24px, 4vw, 42px);
    background: #fff;
    border: 4px solid #0f6fd6;
    border-radius: 30px;
    box-shadow: 0 12px 0 rgba(15, 111, 214, 0.25);
}

.ai-page--theme-doraemon .ai-page__title {
    display: inline-block;
    padding: 6px 18px;
    color: #fff;
    background: #0f6fd6;
    border-radius: 999px;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15);
}

.ai-page--theme-doraemon .ai-page__content h2,
.ai-page--theme-doraemon .ai-page__content h3 {
    color: #0f6fd6;
    border-bottom: 3px solid #ffd400;
    padding-bottom: 8px;
}

.ai-page--theme-doraemon .ai-page__content a {
    color: #0f6fd6;
}

.ai-page--theme-doraemon .ai-page__content strong {
    color: #e8433f;
}

.ai-page--theme-doraemon .ai-page__content blockquote {
    color: #6b5a2a;
    background: #fff9e5;
    border: 3px solid #ffd400;
    border-radius: 20px;
}

/* ==========================================================================
   動態效果（全部 AI 頁面預設開啟）
   1) 捲動進場  2) 卡片跟滑鼠發光  3) 打字機標題（逐頁開啟）
   ========================================================================== */

/* 1) 捲動進場：用 CSS 捲動時間軸，零 JS；唔支援嘅瀏覽器唔會播（唔會閃）。 */
@supports (animation-timeline: view()) {
    .ai-page--fx-reveal .ai-page__title,
    .ai-page--fx-reveal .ai-page__lead,
    .ai-page--fx-reveal .ai-page__hero,
    .ai-page--fx-reveal .ai-page__content > * {
        animation: ai-reveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 60%;
    }
}

@keyframes ai-reveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2) 卡片跟滑鼠發光：--ai-glow-x/y 由 JS 寫入；放喺內容後面，唔會蓋住文字。 */
.ai-page--fx-glow .ai-page__container {
    position: relative;
    isolation: isolate;
}

.ai-page--fx-glow .ai-page__container::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    background: radial-gradient(
        340px circle at var(--ai-glow-x, 50%) var(--ai-glow-y, 0%),
        rgba(255, 255, 255, 0.35),
        transparent 62%
    );
    background: radial-gradient(
        340px circle at var(--ai-glow-x, 50%) var(--ai-glow-y, 0%),
        color-mix(in srgb, var(--ai-page-accent) 55%, transparent),
        transparent 62%
    );
}

@media (hover: hover) and (pointer: fine) {
    .ai-page--fx-glow .ai-page__container:hover::before {
        opacity: 1;
    }
}

/* 3) 打字機標題：閃爍游標（打字由 JS 負責）。 */
.ai-page--fx-type .ai-page__title.ai-typing::after {
    content: "▌";
    margin-left: 2px;
    color: var(--ai-page-accent);
    animation: ai-caret 0.9s step-end infinite;
}

@keyframes ai-caret {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* 4) 捲動標題視差（逐頁開啟）：標題隨捲動放大／上移。 */
/* 視覺化編輯預覽：唔播捲動動畫，確保元素位置／可見度同最終版一致 */
.ai-page--fx-static .ai-page__title,
.ai-page--fx-static .ai-page__lead,
.ai-page--fx-static .ai-page__hero,
.ai-page--fx-static .ai-page__content > *,
.ai-page--fx-static .ai-anim-reveal,
.ai-page--fx-static .ai-anim-scalein,
.ai-page--fx-static .ai-anim-parallax {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

@supports (animation-timeline: view()) {
    .ai-page--fx-reveal.ai-page--fx-title-parallax .ai-page__title {
        animation: ai-title-parallax linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 45%;
    }
}

@keyframes ai-title-parallax {
    from {
        opacity: 0.45;
        transform: translateY(30px) scale(0.94);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 尊重「減少動態」設定 */
@media (prefers-reduced-motion: reduce) {
    .ai-page,
    .ai-page::before,
    .ai-page::after,
    .ai-page *,
    .ai-page *::before,
    .ai-page *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ==========================================================================
   視覺化編輯（Visual Builder）iframe 預覽用：
   核心嗰啲樣式只喺後台父頁嘅 visual-builder.css 載入，iframe 內冇，
   加上按鈕用 Tabler 變數（--tblr-*），前台主題唔一定有 → 編輯掣會隱形。
   呢度補返，確保「編輯／刪除」掣喺預覽入面睇得見、點得到。
   ========================================================================== */

[data-shortcode-id] {
    position: relative;
}

.vb-shortcode-toolbar {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 9999;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

[data-shortcode-id]:hover > .vb-shortcode-toolbar,
[data-shortcode-id].vb-active > .vb-shortcode-toolbar {
    opacity: 1;
}

.vb-shortcode-toolbar .vb-toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: #206bc4;
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.vb-shortcode-toolbar .vb-toolbar-btn:hover {
    transform: translateY(-1px);
}

.vb-shortcode-toolbar .vb-toolbar-btn.vb-delete-btn {
    background: #d63939;
}

.vb-shortcode-toolbar .vb-toolbar-btn svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
}

[data-shortcode-id].vb-active {
    outline: 2px solid #206bc4;
    outline-offset: 2px;
}

/* ==========================================================================
   完全自由版面（LayoutBuilder：wb-*）
   ========================================================================== */
.wb-section {
    display: block;
}

.wb-inner {
    max-width: 1000px;
    margin-inline: auto;
}

.wb-row {
    display: grid;
    gap: 20px;
}

.wb-row--1 {
    grid-template-columns: minmax(0, 1fr);
}

.wb-row--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wb-row--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wb-row--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 760px) {
    .wb-row--2,
    .wb-row--3,
    .wb-row--4 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.wb-col {
    min-width: 0;
}

.wb-heading {
    margin: 0 0 12px;
    line-height: 1.25;
}

.wb-text {
    margin: 0 0 14px;
    line-height: 1.8;
}

.wb-button-wrap {
    margin: 0 0 14px;
}

.wb-button {
    display: inline-block;
    text-decoration: none;
}

.wb-divider {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.wb-spacer {
    display: block;
}

.wb-products {
    display: block;
}

/* ==========================================================================
   標題特效：精品金屬掃光（只限最上面嘅主標題）
   做法同 shop 站 homepage hero 一樣：
   底層＝實色金屬漸層；上層＝一條白色高光由右掃到左。
   無 3D、無陰影、無外圍光暈。
   ========================================================================== */
.ai-page--fx-title-metal {
    --ai-metal-a: #c2185b;
    --ai-metal-b: #e8589a;
    --ai-metal-c: #a8144f;
    --ai-metal-shine: rgba(255, 255, 255, 0.92);
}

.ai-page--ttone-rose {
    --ai-metal-a: #c2185b;
    --ai-metal-b: #e8589a;
    --ai-metal-c: #a8144f;
    --ai-metal-shine: rgba(255, 255, 255, 0.92);
}

.ai-page--ttone-gold {
    --ai-metal-a: #9d7534;
    --ai-metal-b: #d9be8b;
    --ai-metal-c: #a87f3d;
    --ai-metal-shine: rgba(255, 252, 240, 0.95);
}

.ai-page--ttone-silver {
    --ai-metal-a: #6f7783;
    --ai-metal-b: #cfd6de;
    --ai-metal-c: #59606b;
    --ai-metal-shine: rgba(255, 255, 255, 0.95);
}

.ai-page--ttone-blue {
    --ai-metal-a: #14508f;
    --ai-metal-b: #4a9fe0;
    --ai-metal-c: #0f3f75;
    --ai-metal-shine: rgba(255, 255, 255, 0.92);
}

.ai-page--ttone-cyan {
    --ai-metal-a: #17848f;
    --ai-metal-b: #46cbd8;
    --ai-metal-c: #0f6b74;
    --ai-metal-shine: rgba(240, 255, 255, 0.95);
}

.ai-page--ttone-green {
    --ai-metal-a: #1c6b46;
    --ai-metal-b: #4fbf7a;
    --ai-metal-c: #145334;
    --ai-metal-shine: rgba(240, 255, 246, 0.92);
}

.ai-page--ttone-red {
    --ai-metal-a: #a01d28;
    --ai-metal-b: #e05a63;
    --ai-metal-c: #7d141d;
    --ai-metal-shine: rgba(255, 244, 244, 0.92);
}

.ai-page--ttone-orange {
    --ai-metal-a: #b45f1b;
    --ai-metal-b: #f0904a;
    --ai-metal-c: #8f4a13;
    --ai-metal-shine: rgba(255, 247, 240, 0.92);
}

.ai-page--ttone-purple {
    --ai-metal-a: #5a2490;
    --ai-metal-b: #a56fe0;
    --ai-metal-c: #431a6d;
    --ai-metal-shine: rgba(250, 244, 255, 0.92);
}

/* 只套用喺最上面嘅主標題（h1）；內容大標題唔會發光。 */
.ai-page--fx-title-metal .ai-page__title {
    font-family: "Noto Serif TC", "Songti TC", "Times New Roman", Georgia, serif;
    font-weight: 700;
    letter-spacing: 0.03em;
    background-image:
        linear-gradient(104deg, rgba(255, 255, 255, 0) 46%, var(--ai-metal-shine) 50%, rgba(255, 255, 255, 0) 54%),
        linear-gradient(104deg, var(--ai-metal-a), var(--ai-metal-b) 46%, var(--ai-metal-c));
    background-repeat: no-repeat, no-repeat;
    background-size: 200% 100%, 100% 100%;
    background-position: 120% 0, 0 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: none;
    /* 掃光速度：10 秒一個循環。 */
    animation: ai-metal-sweep 10s linear infinite;
}

/* 幻彩虹光：底層換成多色漸層，高光一樣掃。 */
.ai-page--fx-title-metal.ai-page--ttone-rainbow .ai-page__title {
    background-image:
        linear-gradient(104deg, rgba(255, 255, 255, 0) 46%, rgba(255, 255, 255, 0.95) 50%, rgba(255, 255, 255, 0) 54%),
        linear-gradient(104deg, #c2185b, #e08a2c 26%, #2f9e6b 50%, #2f6fb5 74%, #7a3fb5);
}

/* 舊瀏覽器唔支援 background-clip: text 時，至少保持主色（唔會變透明） */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
    .ai-page--fx-title-metal .ai-page__title {
        color: var(--ai-metal-b, #e8589a);
        -webkit-text-fill-color: var(--ai-metal-b, #e8589a);
    }
}

@keyframes ai-metal-sweep {
    from {
        background-position: 120% 0, 0 0;
    }

    to {
        background-position: -120% 0, 0 0;
    }
}

/* ==========================================================================
   似片頁面（Film／場景時間軸）
   一幕一幕嘅內容區塊，兩種播法：
   1) --scroll：捲到邊播到邊（CSS 捲動時間軸，零 JS）。
   2) --auto：開頁自己按每幕秒數播；keyframes 由 SceneComposer 產生。
   兩種都係純 CSS 動畫，跟系統「減少動態」自動停用（停用時會靜態列出全部場景）。
   ========================================================================== */

.ai-film {
    position: relative;
    margin: 8px 0 4px;
}

.ai-film__stage {
    position: relative;
}

.ai-film__scene {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58vh;
    padding: clamp(28px, 5vw, 56px) clamp(20px, 5vw, 56px);
    border: 1px solid var(--ai-page-line);
    border-radius: 22px;
    overflow: hidden;
    isolation: isolate;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
}

.ai-film__inner {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    justify-items: center;
    width: 100%;
    max-width: 46rem;
}

.ai-film__kicker {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.85;
}

.ai-film__title {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2.7rem);
    line-height: 1.15;
    font-weight: 800;
}

.ai-film__text {
    margin: 0;
    font-size: clamp(1rem, 1.7vw, 1.16rem);
    line-height: 1.75;
    opacity: 0.92;
}

.ai-film__media {
    margin: 0;
    width: 100%;
    max-width: 34rem;
}

.ai-film__media img {
    display: block;
    width: 100%;
    max-height: 42vh;
    object-fit: cover;
    border-radius: 16px;
}

/* 場景底色 */
.ai-film__scene--dark {
    background: #0b1020;
    border-color: rgba(255, 255, 255, 0.16);
    color: #f4f6fb;
}

.ai-film__scene--accent {
    background: linear-gradient(135deg, var(--ai-page-accent), rgba(0, 0, 0, 0.55));
    border-color: transparent;
    color: #fff;
}

.ai-film__scene--gradient {
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.22), transparent 55%),
        linear-gradient(135deg, var(--ai-page-accent), rgba(0, 0, 0, 0.7));
    border-color: transparent;
    color: #fff;
}

/* 捲動模式：一幕接一幕，用捲動時間軸播入場。 */
.ai-film--scroll .ai-film__scene + .ai-film__scene {
    margin-top: clamp(18px, 4vw, 40px);
}

@supports (animation-timeline: view()) {
    .ai-film--scroll .ai-film__scene {
        animation-duration: 1s;
        animation-fill-mode: both;
        animation-timing-function: linear;
        animation-timeline: view();
        animation-range: entry 15% cover 45%;
    }

    .ai-film--scroll .ai-film__anim--fade {
        animation-name: ai-film-view-fade;
    }

    .ai-film--scroll .ai-film__anim--up {
        animation-name: ai-film-view-up;
    }

    .ai-film--scroll .ai-film__anim--zoom {
        animation-name: ai-film-view-zoom;
    }

    .ai-film--scroll .ai-film__anim--left {
        animation-name: ai-film-view-left;
    }

    .ai-film--scroll .ai-film__anim--right {
        animation-name: ai-film-view-right;
    }

    .ai-film--scroll .ai-film__anim--blur {
        animation-name: ai-film-view-blur;
    }
}

@keyframes ai-film-view-fade {
    from {
        opacity: 0.05;
    }

    to {
        opacity: 1;
    }
}

@keyframes ai-film-view-up {
    from {
        opacity: 0.05;
        transform: translateY(42px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ai-film-view-zoom {
    from {
        opacity: 0.05;
        transform: scale(0.93);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes ai-film-view-left {
    from {
        opacity: 0.05;
        transform: translateX(-52px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes ai-film-view-right {
    from {
        opacity: 0.05;
        transform: translateX(52px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes ai-film-view-blur {
    from {
        opacity: 0.05;
        filter: blur(14px);
    }

    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* 自動播放模式：全部場景疊喺同一個位輪流出現（keyframes 由 PHP 產生）。 */
.ai-film--auto .ai-film__stage {
    display: grid;
}

.ai-film--auto .ai-film__scene {
    grid-area: 1 / 1;
    opacity: 0;
}

.ai-film__replay {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 8px 18px;
    font: inherit;
    font-size: 0.92rem;
    color: inherit;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--ai-page-line);
    border-radius: 999px;
}

.ai-film__replay:hover {
    border-color: var(--ai-page-accent);
    color: var(--ai-page-accent);
}

.ai-film--scroll .ai-film__replay {
    display: none;
}

/* 視覺化編輯嘅靜態預覽：唔播動畫，場景要順序排開（唔好疊住）。 */
.ai-page--fx-static .ai-film__stage {
    display: block !important;
}

.ai-page--fx-static .ai-film__scene {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
}

/* 尊重「減少動態」：唔播動畫，但一定要睇得齊全部場景。 */
@media (prefers-reduced-motion: reduce) {
    .ai-film--auto .ai-film__stage {
        display: block !important;
    }

    .ai-film--auto .ai-film__scene {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .ai-film__replay {
        display: none !important;
    }
}
