/* =========================================================================
   Fedora 台灣社群 — 網站樣式
   疊在 Bootstrap 5.3 上面；配色沿用原本的 Fedora 藍（#003366 → #0056B3 → #007BFF）。
   ========================================================================= */

/* ---------- 色彩與尺寸 ---------- */
:root {
    --bg: #f6f9fd;
    --bg-soft: #edf3fb;
    --bg-sunken: #e6eef8;
    --surface: #ffffff;
    --surface-2: #f9fbfe;
    --ink: #0e1a2b;
    --ink-2: #3a4a60;
    --muted: #63728a;
    --line: #dce5f1;
    --line-strong: #c7d3e4;

    --accent: #0056b3;
    --accent-hover: #00468f;
    --accent-bright: #007bff;
    --accent-soft: #e5f0ff;
    --accent-ink: #00468f;
    --on-accent: #ffffff;
    --deep: #003366;
    --sky: #4da6ff;

    --pomelo: #f5a623;
    --pomelo-soft: #fff3dc;
    --pomelo-ink: #9a5b00;

    --hero-grad: linear-gradient(128deg, #001b38 0%, #003366 32%, #0056b3 68%, #007bff 100%);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow-1: 0 1px 2px rgba(8, 30, 66, .05), 0 2px 10px rgba(8, 30, 66, .05);
    --shadow-2: 0 2px 6px rgba(8, 30, 66, .06), 0 18px 48px -14px rgba(0, 51, 102, .25);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
    --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", "Noto Sans Mono CJK TC", Menlo, Consolas, monospace;
    --header-h: 64px;

    --bs-body-font-family: var(--font);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--ink);
    --bs-link-color-rgb: 0, 86, 179;
    --bs-link-hover-color-rgb: 0, 70, 143;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0a111e;
    --bg-soft: #0f1929;
    --bg-sunken: #060c17;
    --surface: #111c2e;
    --surface-2: #16233a;
    --ink: #eaf1fb;
    --ink-2: #c2cee0;
    --muted: #8a99b0;
    --line: #1f2d45;
    --line-strong: #2c3e5d;

    --accent: #4da6ff;
    --accent-hover: #7dbdff;
    --accent-bright: #4da6ff;
    --accent-soft: #0f2747;
    --accent-ink: #8cc7ff;
    --on-accent: #03152b;

    --pomelo-soft: #3a2a0e;
    --pomelo-ink: #ffc766;

    --hero-grad: linear-gradient(128deg, #000a1f 0%, #001a38 34%, #002e5c 70%, #004a8f 100%);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 10px rgba(0, 0, 0, .25);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 18px 48px -14px rgba(0, 0, 0, .6);

    --bs-link-color-rgb: 77, 166, 255;
    --bs-link-hover-color-rgb: 125, 189, 255;
    color-scheme: dark;
}

/* ---------- 基本 ---------- */
html { scroll-padding-top: calc(var(--header-h) + 16px); }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4, h5 { color: var(--ink); letter-spacing: -.01em; line-height: 1.3; }

::selection { background: color-mix(in srgb, var(--accent-bright) 28%, transparent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent-bright) 60%, transparent); outline-offset: 2px; border-radius: 6px; }

code { font-family: var(--mono); font-size: .88em; padding: .12em .4em; border-radius: 6px; background: var(--bg-soft); color: var(--ink); overflow-wrap: anywhere; }
pre {
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.65;
    background: #0b1626 !important;
    color: #e6eefa !important;
    border-radius: var(--radius);
    padding: 16px 20px;
    overflow-x: auto;
    margin: 0 0 1.2em;
}
pre code, pre code.hljs { background: none !important; padding: 0; color: inherit; font-size: inherit; }

.text-muted { color: var(--muted) !important; }
.text-primary { color: var(--accent) !important; }
.nowrap { white-space: nowrap; }

.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; color: var(--on-accent); }

.container { max-width: 1200px; }

/* ---------- 按鈕（調整 Bootstrap 的 .btn） ---------- */
.btn {
    --bs-btn-font-weight: 700;
    --bs-btn-border-radius: 999px;
    --bs-btn-padding-x: 20px;
    --bs-btn-padding-y: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5em;
    transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-lg { --bs-btn-padding-x: 28px; --bs-btn-padding-y: 13px; --bs-btn-font-size: 17px; --bs-btn-border-radius: 999px; }
.btn-sm { --bs-btn-padding-x: 14px; --bs-btn-padding-y: 6px; --bs-btn-font-size: 14px; --bs-btn-border-radius: 999px; }
.btn-primary, .btn-fedora {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-color: var(--on-accent);
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-hover-color: var(--on-accent);
    --bs-btn-active-bg: var(--accent-hover);
    --bs-btn-active-border-color: var(--accent-hover);
    --bs-btn-active-color: var(--on-accent);
    box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn-outline-primary {
    --bs-btn-color: var(--accent);
    --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-bg: var(--accent-soft);
    --bs-btn-hover-border-color: var(--accent);
    --bs-btn-hover-color: var(--accent-ink);
    --bs-btn-active-bg: var(--accent-soft);
    --bs-btn-active-border-color: var(--accent);
    --bs-btn-active-color: var(--accent-ink);
    background: var(--surface);
}
.btn-white {
    --bs-btn-bg: #ffffff;
    --bs-btn-color: #002a57;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-bg: #eaf3ff;
    --bs-btn-hover-color: #002a57;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: #eaf3ff;
    --bs-btn-active-color: #002a57;
}
.btn-glass {
    --bs-btn-bg: rgba(255, 255, 255, .12);
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgba(255, 255, 255, .35);
    --bs-btn-hover-bg: rgba(255, 255, 255, .22);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: rgba(255, 255, 255, .5);
    --bs-btn-active-bg: rgba(255, 255, 255, .22);
    --bs-btn-active-color: #fff;
    backdrop-filter: blur(8px);
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink-2);
    font-size: 18px;
    cursor: pointer;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); }

/* ---------- 頂端 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--header-h);
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    backdrop-filter: saturate(1.6) blur(16px);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 100%; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 18px; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand img { width: 34px; height: 34px; transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.brand:hover img { transform: rotate(-12deg) scale(1.06); }
.brand small { color: var(--muted); font-weight: 700; font-size: 14px; }

.main-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.main-nav a { color: var(--ink-2); font-size: 15px; font-weight: 600; padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
.main-nav a:hover { color: var(--ink); background: var(--bg-soft); }
.main-nav a.active { color: var(--accent-ink); background: var(--accent-soft); }
.main-nav .ext { font-size: 11px; opacity: .55; margin-left: 3px; }
.main-nav .nav-download { display: none; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.nav-toggle { display: none; }
.theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: inline-block; }
:root[data-theme="dark"] .theme-icon-dark { display: none; }

@media (max-width: 991.98px) {
    .nav-toggle { display: inline-grid; }
    .header-download { display: none; }
    .header-actions { margin-left: auto; }
    .main-nav {
        position: fixed;
        inset: var(--header-h) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 12px 16px 20px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-2);
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: opacity .18s ease, transform .18s ease, visibility .18s;
    }
    .main-nav a { padding: 12px 14px; font-size: 17px; }
    .main-nav .nav-download { display: inline-flex; margin-top: 10px; }
    body.nav-open .main-nav { transform: none; opacity: 1; visibility: visible; }
    .nav-close-icon { display: none; }
    body.nav-open .nav-open-icon { display: none; }
    body.nav-open .nav-close-icon { display: inline-block; }
}

/* ---------- 區塊 ---------- */
.section { padding: 96px 0; position: relative; }
.section-tight { padding: 64px 0; }
.section-alt { background: var(--bg-soft); }

.section-head { max-width: 760px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 12px; }
.section-head .lead { margin: 0; }
.section-foot { margin-top: 40px; text-align: center; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--accent-ink);
    margin-bottom: 12px;
}
.eyebrow.pomelo { color: var(--pomelo-ink); }

.lead { font-size: clamp(17px, 1.6vw, 19px); font-weight: 400; color: var(--ink-2); line-height: 1.8; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* 卡片：整張可點的用 a.tile */
.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-1);
    color: var(--ink);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
a.tile:hover { color: var(--ink); transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--accent-bright) 35%, var(--line)); }
.tile h3 { font-size: 19px; font-weight: 700; margin: 0 0 8px; }
.tile p { color: var(--ink-2); margin: 0; }
.tile .tile-more { margin-top: auto; padding-top: 18px; font-weight: 700; font-size: 15px; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.tile .tile-more i { font-size: 13px; transition: transform .2s ease; }
a.tile:hover .tile-more i { transform: translateX(3px); }

.icon-tile {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    margin-bottom: 18px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 21px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    background: var(--accent-soft);
    color: var(--accent-ink);
    white-space: nowrap;
}
.pill.neutral { background: var(--bg-soft); color: var(--ink-2); }

/* 篩選用的膠囊按鈕列 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-2);
    font-weight: 600;
    font-size: 15px;
}
.chip:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.chip.active { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.chip .count { font-size: 12px; opacity: .7; }

/* ---------- 首頁：主視覺 ---------- */
.hero {
    position: relative;
    padding: 96px 0 104px;
    background: var(--hero-grad);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}
.hero::before, .hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
    animation: drift 18s ease-in-out infinite alternate;
}
.hero::before { width: 520px; height: 520px; left: -160px; top: 60px; background: #007bff; }
.hero::after { width: 460px; height: 460px; right: -120px; top: -80px; background: #4da6ff; animation-delay: -6s; }
@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(60px, 40px) scale(1.12); }
}
.hero-grain {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .07;
    background-image: radial-gradient(rgba(255, 255, 255, .9) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}
.hero-mark {
    position: absolute;
    z-index: -1;
    right: max(4vw, calc(50% - 640px));
    bottom: -90px;
    width: min(42vw, 460px);
    opacity: .08;
    filter: brightness(0) invert(1);
    pointer-events: none;
}

.hero-content { text-align: center; max-width: 900px; margin: 0 auto; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    margin-bottom: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}
.hero-badge:hover { color: #fff; background: rgba(255, 255, 255, .22); }
.hero-badge b { background: #fff; color: #003366; border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.hero-badge i { font-size: 12px; }

.hero h1 {
    font-size: clamp(38px, 6.6vw, 76px);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -.03em;
    color: #fff;
    margin-bottom: 24px;
    text-wrap: balance;
}
.hero h1 .hl {
    background: linear-gradient(100deg, #ffffff 0%, #bfe0ff 45%, #7cc4ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-sub { font-size: clamp(17px, 2vw, 21px); line-height: 1.75; color: rgba(255, 255, 255, .9); max-width: 720px; margin: 0 auto 36px; text-wrap: pretty; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-meta { margin-top: 24px; font-size: 14px; color: rgba(255, 255, 255, .82); display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: center; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }

/* 首頁的快捷卡片往上疊到主視覺 */
.quick-links { margin-top: -56px; position: relative; z-index: 2; }

/* ---------- 子頁面的標題區 ---------- */
.page-hero {
    position: relative;
    padding: 72px 0 56px;
    overflow: hidden;
    isolation: isolate;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(900px 380px at 88% -10%, color-mix(in srgb, var(--sky) 22%, transparent), transparent 70%),
        radial-gradient(800px 420px at 0% 0%, color-mix(in srgb, var(--accent-bright) 14%, transparent), transparent 70%),
        var(--bg);
}
.page-hero h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 800; letter-spacing: -.03em; margin-bottom: 14px; text-wrap: balance; }
.page-hero .lead { max-width: 760px; margin-bottom: 0; }
.page-hero.center { text-align: center; }
.page-hero.center .lead { margin-left: auto; margin-right: auto; }
.page-hero .hero-ctas { margin-top: 28px; }
.page-hero:not(.center) .hero-ctas { justify-content: flex-start; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs i { font-size: 10px; opacity: .6; }

/* ---------- 推薦專案（Pomelo） ---------- */
.feature-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 48px;
    align-items: center;
    padding: clamp(28px, 4vw, 48px);
    border-radius: 32px;
    background:
        radial-gradient(600px 300px at 100% 0%, color-mix(in srgb, var(--pomelo) 16%, transparent), transparent 70%),
        var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
}
.feature-band h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.feature-band h2 img { width: 44px; height: 44px; }
.feature-band .tagline { font-size: 19px; font-weight: 700; color: var(--pomelo-ink); margin-bottom: 14px; }
.feature-band .lead { font-size: 17px; }
.feature-band ul { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 8px; }
.feature-band li { display: flex; gap: 10px; color: var(--ink-2); }
.feature-band li i { color: var(--pomelo); margin-top: 6px; font-size: 14px; }
.btn-pomelo {
    --bs-btn-bg: var(--pomelo);
    --bs-btn-border-color: var(--pomelo);
    --bs-btn-color: #2b1a00;
    --bs-btn-hover-bg: #e8930f;
    --bs-btn-hover-border-color: #e8930f;
    --bs-btn-hover-color: #2b1a00;
    --bs-btn-active-bg: #e8930f;
    --bs-btn-active-color: #2b1a00;
}
.feature-shot {
    border-radius: 14px;
    padding: 8px 8px 0;
    background: linear-gradient(180deg, #2a2838, #1a1924);
    box-shadow: var(--shadow-2);
    transform: perspective(2000px) rotateY(-6deg) rotateX(2deg);
    transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.feature-shot:hover { transform: none; }
.feature-shot img { display: block; width: 100%; height: auto; border-radius: 8px 8px 0 0; }
@media (max-width: 900px) {
    .feature-band { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .feature-shot { transform: none; }
}

/* ---------- 教學 ---------- */
.post-card .pill { align-self: flex-start; margin-bottom: 14px; }
.post-card h3 { font-size: 18px; line-height: 1.45; }
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); margin-top: 10px; }
.post-meta span { display: inline-flex; align-items: center; gap: 6px; }

.empty-state { text-align: center; color: var(--muted); padding: 48px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }

/* 文章內文 */
.prose { max-width: 820px; margin: 0 auto; font-size: 17px; line-height: 1.85; color: var(--ink); overflow-wrap: break-word; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 1.8em 0 .6em; font-weight: 800; }
.prose h1 { font-size: 30px; }
.prose h2 { font-size: 26px; padding-bottom: .3em; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 21px; }
.prose h4 { font-size: 18px; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose li + li { margin-top: .3em; }
.prose img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.prose blockquote { margin: 0 0 1.2em; padding: 12px 18px; border-left: 4px solid var(--accent-bright); background: var(--accent-soft); border-radius: 0 12px 12px 0; color: var(--ink-2); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; }
.prose th { background: var(--bg-soft); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; opacity: 1; }
.prose > :first-child { margin-top: 0; }

.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 820px; margin: 56px auto 0; }
.post-nav a { padding: 18px 22px; }
.post-nav small { display: block; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.post-nav strong { display: block; line-height: 1.45; }
.post-nav .next { text-align: right; grid-column: 2; }
@media (max-width: 620px) { .post-nav { grid-template-columns: minmax(0, 1fr); } .post-nav .next { grid-column: auto; } }

/* ---------- 下載 ---------- */
.release-card { padding: 32px; }
.release-card h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; margin-bottom: 6px; }
.dl-group + .dl-group { margin-top: 20px; }
.dl-group h3 { font-size: 15px; font-weight: 700; color: var(--muted); letter-spacing: .04em; margin-bottom: 10px; }
.dl-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.mirror-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mirror-form .form-select { width: auto; border-radius: 999px; padding-left: 18px; background-color: var(--surface); }
.version-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.steps { counter-reset: step; }
.step-card img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); margin-top: 18px; }
.step-num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; margin-bottom: 14px; }

/* ---------- 召喚行動 ---------- */
.cta-band {
    position: relative;
    overflow: hidden;
    padding: clamp(40px, 6vw, 72px) clamp(24px, 5vw, 72px);
    border-radius: 32px;
    background: var(--hero-grad);
    color: #fff;
    text-align: center;
    isolation: isolate;
}
.cta-band::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 380px;
    height: 380px;
    right: -100px;
    bottom: -170px;
    border-radius: 50%;
    background: #4da6ff;
    filter: blur(70px);
    opacity: .55;
}
.cta-band h2 { color: #fff; font-size: clamp(26px, 4vw, 40px); font-weight: 800; letter-spacing: -.02em; }
.cta-band p { color: rgba(255, 255, 255, .88); font-size: 18px; max-width: 620px; margin: 0 auto 28px; }

/* ---------- 頁尾 ---------- */
.site-footer { background: var(--bg-sunken); border-top: 1px solid var(--line); padding: 64px 0 32px; font-size: 15px; margin-top: 0; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; }
.footer-brand p { color: var(--muted); margin-top: 14px; max-width: 340px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-cols h3 { font-size: 13px; font-weight: 800; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.footer-cols a { display: flex; align-items: center; gap: 6px; padding: 4px 0; color: var(--ink-2); }
.footer-cols a:hover { color: var(--accent); }
.footer-cols .ext { font-size: 10px; opacity: .5; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 13.5px; color: var(--muted); }
.footer-bottom p { margin: 0; }
@media (max-width: 860px) {
    .footer-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 舊頁面沿用的樣式（登入、後台首頁等） ---------- */
.hero-section { background: var(--hero-grad); color: #fff; padding: 56px 0; text-align: center; }
.hero-section h1 { color: #fff; font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
.hero-section p, .hero-section .text-muted { color: rgba(255, 255, 255, .85) !important; }
.card-custom { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: 24px; color: var(--ink); }
.section-title { font-size: 26px; font-weight: 800; text-align: center; margin-bottom: 15px; color: var(--ink); }
.login-container { background: var(--surface); color: var(--ink); padding: 40px; border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow-2); max-width: 420px; margin: 0 auto; }
/* 舊頁面在自己的 <style> 裡寫死白底，深色模式時蓋回來 */
.dark-mode .login-container, .dark-mode .card-custom, .dark-mode .user-info { background: var(--surface) !important; color: var(--ink) !important; }
.form-control, .form-select { border-color: var(--line-strong); }
.form-control:focus, .form-select:focus { border-color: var(--accent-bright); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--accent-bright) 25%, transparent); }

/* ---------- 減少動態、列印 ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
    .site-header, .site-footer, .post-nav { display: none !important; }
    body { background: #fff; color: #000; }
}

/* ---------- 小幫手 ---------- */
.ast-fab {
    position: fixed; right: 20px; bottom: 20px; z-index: 1040;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 18px 8px 10px; border-radius: 999px;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
    font: inherit; font-weight: 700; box-shadow: var(--shadow-2); cursor: pointer;
    transition: transform .15s ease;
}
.ast-fab:hover { transform: translateY(-2px); }
.ast-fab img { width: 34px; height: 34px; }
.ast-fab.ast-speaking { border-color: var(--accent-bright); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-bright) 25%, transparent), var(--shadow-2); }
.ast-hint {
    position: fixed; right: 20px; bottom: 84px; z-index: 1040; max-width: 260px;
    display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px;
    box-shadow: var(--shadow-2); font-size: 14px; line-height: 1.5; cursor: pointer;
}
.ast-hint[hidden], .ast-panel[hidden], .ast-tourbar[hidden] { display: none !important; }
.ast-hint-close { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 2px; }

.ast-panel {
    position: fixed; right: 20px; bottom: 84px; z-index: 1041;
    width: min(380px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 110px));
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 20px;
    box-shadow: var(--shadow-2);
}
.ast-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ast-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ast-title small { color: var(--muted); font-size: 12px; }
.ast-icon { border: 0; background: transparent; color: var(--ink-2); min-width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font: inherit; font-size: 14px; }
.ast-icon:hover { background: var(--bg-soft); color: var(--ink); }
.ast-rate { font-size: 12px; font-weight: 700; padding: 0 8px; }
.ast-send { background: var(--accent); color: var(--on-accent); }
.ast-send:hover { background: var(--accent-hover); color: var(--on-accent); }
.ast-listening { background: #d9363e !important; color: #fff !important; }

.ast-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.ast-msg { max-width: 92%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.ast-msg p { margin: 0; }
.ast-msg.bot { background: var(--bg-soft); align-self: flex-start; border-bottom-left-radius: 4px; }
.ast-msg.user { background: var(--accent); color: var(--on-accent); align-self: flex-end; border-bottom-right-radius: 4px; }
.ast-results { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.ast-results small { margin-left: 6px; color: var(--muted); }
.ast-results q { display: block; color: var(--ink-2); font-size: 13px; quotes: none; }
.ast-actions, .ast-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ast-chips { margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); max-height: 96px; overflow-y: auto; }
.ast-chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--accent-ink); border-radius: 999px; padding: 3px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ast-chip:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.ast-input { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-top: 1px solid var(--line); }
.ast-text { flex: 1; min-width: 0; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 15px; }
.ast-tourbar { display: flex; align-items: center; gap: 2px; padding: 6px 10px; border-top: 1px solid var(--line); background: var(--accent-soft); }
.ast-tour-label { flex: 1; font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.ast-touring .ast-chips, .ast-touring .ast-input { display: none; }

/* 導覽時被框起來的區塊 */
.ast-focus { outline: 3px solid var(--accent-bright); outline-offset: 6px; border-radius: 12px; transition: outline-color .2s; }

@media (max-width: 520px) {
    .ast-fab-label { display: none; }
    .ast-fab { padding: 8px; }
    .ast-panel { right: 12px; bottom: 76px; }
    .ast-hint { right: 12px; }
}
@media print { .ast-fab, .ast-panel, .ast-hint { display: none !important; } }
