@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

html { scroll-behavior: smooth; overflow-x: hidden; }
body { overflow-wrap: break-word; }

/* Cookie notice banner (一次性,點掉後寫進 localStorage 不再出現) */
.cookie-notice {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: 880px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid var(--bg-tertiary);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.55;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 9999;
}
.cookie-notice .cookie-notice-text { flex: 1; }
.cookie-notice a { color: var(--primary); }
.cookie-notice button {
    flex-shrink: 0;
    background: var(--gradient-1);
    color: #fff;
    border: none;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: inherit;
}
.cookie-notice button:hover { transform: translateY(-1px); }
@media (max-width: 600px) {
    .cookie-notice {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        font-size: 0.78rem;
        padding: 0.75rem 0.85rem;
    }
    .cookie-notice button { align-self: flex-end; }
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

a { color: var(--primary); }
a:hover { text-decoration: underline; }

/* Header */
.header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--bg-tertiary);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--gradient-1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.logo-title {
    font-size: 1.1rem;
    font-weight: 800;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}
.logo-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.header-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
}
.header-nav a:hover { color: var(--primary); }

.header-nav .header-cta {
    background: var(--gradient-1);
    color: #fff !important;
    padding: 0.45rem 0.95rem;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
    transition: transform 0.15s, box-shadow 0.15s;
}
.header-nav .header-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
    color: #fff !important;
}
@media (max-width: 600px) {
    .header-nav .header-cta {
        padding: 0.32rem 0.65rem;
        font-size: 0.72rem;
        border-radius: 8px;
    }
}

/* Container & sections */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}
.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}
section {
    padding: 4rem 2rem;
}

/* Section header (used on listing pages) */
.section-tag {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: var(--primary);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.section-title {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-primary);
}
.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 720px;
    line-height: 1.65;
    margin-bottom: 1rem;
}

/* Breadcrumb */
.breadcrumb {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.25rem 2rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 0.5rem; color: var(--text-muted); }

/* Article */
.article {
    padding: 2.5rem 2rem 5rem;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    align-items: center;
}
.article-tag {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.article-tag.geo { background: rgba(139, 92, 246, 0.18); color: var(--secondary); }
.article-tag.aeo { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.article-tag.seo { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.article-tag.case { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.article-tag.guide { background: rgba(203, 213, 225, 0.15); color: var(--text-secondary); }
.article-tag.series {
    background: linear-gradient(135deg, rgba(139,92,246,0.22), rgba(217,70,239,0.18));
    color: #8b5cf6;
    border: 1px dashed rgba(139, 92, 246, 0.45);
}

/* 21 天系列：上下篇導覽 */
.series-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 3rem 0 1.5rem;
}
.series-nav a {
    display: block;
    padding: 1rem 1.2rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.22);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}
.series-nav a:hover {
    background: rgba(139, 92, 246, 0.14);
    transform: translateY(-2px);
}
.series-nav .label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    letter-spacing: 0.5px;
}
.series-nav .title {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
}
.series-nav .next { text-align: right; }
.series-nav .disabled {
    opacity: 0.4;
    pointer-events: none;
}
@media (max-width: 640px) {
    .series-nav { grid-template-columns: 1fr; }
    .series-nav .next { text-align: left; }
}

.article h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}
.article h2, section h2:not([class]) {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--bg-tertiary);
}
/* cards-grid 之後緊接的 H2 多留間距,跟卡片區拉開 */
.cards-grid + h2:not([class]) {
    margin-top: 4rem;
}
.article h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}
.article p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.75;
}
.article ul, .article ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}
.article li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}
.article strong { color: var(--text-primary); }
.article em { color: var(--text-secondary); }

/* Definition list — 用於名詞速查、常見問答區塊 */
.article dl, section dl {
    margin: 1.5rem 0 2rem;
    color: var(--text-secondary);
}
.article dl + dl, section dl + dl {
    margin-top: 1rem;
}
.article dt, section dt {
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding-left: 0.85rem;
    position: relative;
    line-height: 1.6;
}
/* dt 前方項目符號 */
.article dt::before, section dt::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}
/* 第一個 dt 不要有額外 top margin */
.article dl > dt:first-child, section dl > dt:first-child {
    margin-top: 0;
}
.article dd, section dd {
    margin: 0 0 0 1.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--bg-tertiary);
    line-height: 1.75;
    color: var(--text-secondary);
}
.article dd + dt, section dd + dt {
    padding-top: 0.5rem;
}

.article-figure {
    margin: 2rem 0;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 14px;
    padding: 0.75rem;
    text-align: center;
}
.article-figure img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0 auto;
}
.article-figure figcaption {
    margin-top: 0.75rem;
    padding: 0 0.5rem 0.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.55;
    text-align: center;
}

.article table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.75rem 0;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--bg-tertiary);
    font-size: 0.95rem;
}
.article thead th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 700;
    text-align: left;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--bg-tertiary);
}
.article tbody td,
.article tbody th {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bg-tertiary);
    color: var(--text-secondary);
    vertical-align: top;
    line-height: 1.6;
}
.article tbody th {
    color: var(--text-primary);
    font-weight: 600;
    background: rgba(99, 102, 241, 0.04);
}
.article tbody tr:last-child td,
.article tbody tr:last-child th { border-bottom: none; }
.article tbody tr:hover td,
.article tbody tr:hover th { background: rgba(99, 102, 241, 0.06); }
.article tbody tr.row-warn td,
.article tbody tr.row-warn th { background: rgba(245, 158, 11, 0.12); }
.article tbody tr.row-warn:hover td,
.article tbody tr.row-warn:hover th { background: rgba(245, 158, 11, 0.18); }
.article tbody tr.row-danger td,
.article tbody tr.row-danger th { background: rgba(239, 68, 68, 0.12); }
.article tbody tr.row-danger:hover td,
.article tbody tr.row-danger:hover th { background: rgba(239, 68, 68, 0.18); }
.article table strong { color: var(--text-primary); }
.article table code {
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-primary);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.88em;
}

@media (max-width: 700px) {
    .article table { font-size: 0.82rem; }
    .article thead th, .article tbody td, .article tbody th { padding: 0.6rem 0.55rem; }
}

.score-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--bg-tertiary);
    font-size: 0.95rem;
}
.score-table th, .score-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--bg-tertiary);
}
.score-table thead th {
    background: var(--bg-tertiary);
    font-weight: 700;
    color: var(--text-primary);
}
.score-table tbody tr:last-child td { border-bottom: none; }
.score-table .num { text-align: center; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.score-table .num.high { color: var(--success); }
.score-table .num.mid { color: var(--warning); }
.score-table .num.low { color: var(--danger); }

.article blockquote {
    border-left: 3px solid var(--primary);
    background: rgba(99, 102, 241, 0.08);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    color: var(--text-primary);
    font-style: italic;
}

.article code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}
.article pre {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}
.article pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: var(--text-primary);
    font-size: inherit;
}

.article .callout {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-left: 3px solid var(--primary);
}
.article .callout.warn { border-left-color: var(--warning); }
.article .callout.success { border-left-color: var(--success); }
.article .callout.info { border-left-color: var(--secondary); }
.article .callout-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.article .toc {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0 2rem;
    border: 1px solid var(--bg-tertiary);
}
.article .toc-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}
.article .toc ol {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}
.article .toc ol ol {
    padding-left: 1.25rem;
    margin-top: 0.3rem;
    margin-bottom: 0.5rem;
}
.article .toc li { margin: 0.35rem 0; line-height: 1.5; }
.article .toc a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}
.article .toc a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* anchor offset for sticky header so anchor jumps land below header */
.article h2[id], .article h3[id] { scroll-margin-top: 80px; }

.article-references {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 3rem;
}
.article-references h3 {
    margin-top: 0;
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}
.article-references ul { padding-left: 1.25rem; }
.article-references li {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}
.article-references a {
    color: var(--text-secondary);
    text-decoration: none;
}
.article-references a:hover { color: var(--primary); }

.article-cta {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid var(--bg-tertiary);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 3rem;
    text-align: center;
}
.article-cta h3 {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
    color: var(--text-primary);
}
.article-cta p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--gradient-1);
    color: #fff;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
    text-decoration: none;
}
.btn-primary:disabled {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
    box-shadow: none;
}
.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--bg-tertiary);
}
.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    text-decoration: none;
}

/* Card grid (used by blog/case-studies listing pages) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 16px;
    padding: 1.75rem;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2);
    text-decoration: none;
}
.card-emoji {
    font-size: 2.2rem;
    line-height: 1;
}
.card-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.35;
}
.card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0;
}
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--bg-tertiary);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--bg-tertiary);
    padding: 3rem 2rem 2rem;
    margin-top: auto;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2.5rem;
}
.footer-brand {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}
.footer-brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.footer-col h4 {
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bg-tertiary);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
    .header { padding: 0.85rem 1.25rem; }
    .header-nav { gap: 1rem; }
    .header-nav a { font-size: 0.85rem; }
    .container, .container-wide { padding: 0 1.25rem; }
    section { padding: 2.5rem 1.25rem; }
    .article { padding: 1.5rem 1.25rem 3rem; }
    .breadcrumb { padding: 1rem 1.25rem 0; }
    .article h1 { font-size: 1.8rem; }
    .article h2 { font-size: 1.35rem; }
    .article h3 { font-size: 1.1rem; }
    .section-title { font-size: 1.7rem; }
    .cards-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
    .footer-inner { grid-template-columns: 1fr; }
    .header { padding: 0.55rem 0.85rem; }
    /* logo 第一行獨佔,nav 第二行可 wrap */
    .header-inner { gap: 0.45rem; flex-wrap: wrap; row-gap: 0.5rem; }
    .logo { gap: 0.5rem; flex-shrink: 0; min-width: 0; max-width: 100%; }
    .logo-icon { width: 30px; height: 30px; font-size: 1rem; border-radius: 8px; flex-shrink: 0; }
    .logo-text { min-width: 0; }
    .logo-title { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .logo-tag { font-size: 0.65rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .header-nav {
        width: 100%;
        gap: 0.4rem;
        flex-wrap: wrap;
        justify-content: center;
        padding-top: 0.45rem;
        border-top: 1px solid var(--bg-tertiary);
    }
    .header-nav a {
        font-size: 0.78rem;
        white-space: nowrap;
        padding: 0.18rem 0.35rem;
    }
}
@media (max-width: 380px) {
    .logo-tag { display: none; }
    .header-nav a { font-size: 0.72rem; }
    .header-nav .header-cta { padding: 0.28rem 0.55rem; font-size: 0.7rem; }
}

/* Sponsor section (about.html) */
.sponsor-section {
    margin: 2.5rem 0 1rem;
    padding: 1.75rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid var(--bg-tertiary);
    border-radius: 16px;
}
.sponsor-section h2 {
    margin-top: 0;
    border-bottom: none;
    padding-bottom: 0;
}
.sponsor-buttons {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin: 1.25rem 0 0.75rem;
}
.sponsor-buttons .btn-primary,
.sponsor-buttons .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}
.sponsor-buttons .btn-primary {
    background: var(--gradient-1);
    color: #fff;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.28);
}
.sponsor-buttons .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4); }
.sponsor-buttons .btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--bg-tertiary);
}
.sponsor-buttons .btn-secondary:hover { background: var(--bg-secondary); border-color: var(--primary); }
.sponsor-buttons .sponsor-disabled { opacity: 0.65; cursor: not-allowed; }
.cta-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.85rem;
    line-height: 1.55;
}
@media (max-width: 600px) {
    .sponsor-buttons { flex-direction: column; align-items: stretch; }
    .sponsor-buttons .btn-primary,
    .sponsor-buttons .btn-secondary { justify-content: center; }
}

/* Contact form (contact.html) */
.contact-form {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    max-width: 640px;
    width: 100%;
}
.contact-form label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}
.contact-form .form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}
.contact-form select,
.contact-form input,
.contact-form textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
}
.contact-form select {
    background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%), linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position: calc(100% - 18px) center, calc(100% - 13px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 2rem;
}
.contact-form select:focus,
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}
.contact-form .btn-primary {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.3rem;
    background: var(--gradient-1);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.28);
}
.contact-form .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4); }
.contact-form .form-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-top: 0.4rem;
}
.contact-form .form-note a { color: var(--primary); }
@media (max-width: 600px) {
    .contact-form .btn-primary { align-self: stretch; justify-content: center; }
}

/* === 結果頁 / about 頁回饋區塊 === */
.feedback-section {
    display: block;
    margin: 2.5rem 0 1rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.07) 0%, rgba(139, 92, 246, 0.07) 100%);
    border: 1px solid var(--bg-tertiary);
    border-radius: 16px;
}
.feedback-section h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    border-bottom: none;
    padding-bottom: 0;
}
.feedback-section > p,
.feedback-section-intro {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}
.feedback-section h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: none;
}
.rating-group {
    display: flex;
    gap: 0.6rem;
    margin: 0 0 1.75rem;
    flex-wrap: wrap;
    align-items: center;
}
.rating-btn {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    padding: 0;
    background: var(--bg-secondary);
    border: 2px solid var(--bg-tertiary);
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
    line-height: 1;
}
.rating-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.18);
}
.rating-btn.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.28);
}
.feedback-comment-label,
.feedback-input-label {
    display: block;
    width: 100%;
    margin: 0 0 1rem;
}
.feedback-comment-label > span,
.feedback-input-label > span {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}
.feedback-comment-label textarea,
.feedback-input-label input,
.feedback-input-label select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 10px;
    padding: 0.75rem 0.95rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.55;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.feedback-input-label select {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%), linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position: calc(100% - 18px) center, calc(100% - 13px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 2.5rem;
    cursor: pointer;
}
.feedback-comment-label textarea {
    resize: vertical;
    min-height: 110px;
}
.feedback-comment-label textarea:focus,
.feedback-input-label input:focus,
.feedback-input-label select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.feedback-error {
    margin-top: 0.85rem;
    padding: 0.6rem 0.85rem;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.9rem;
    line-height: 1.5;
}
.contact-section {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--bg-tertiary);
}
.about-author-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
    margin: 1.25rem 0 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--bg-tertiary);
}
.about-author-cta .btn-primary,
.about-author-cta .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.25rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.about-author-cta .btn-primary {
    background: var(--gradient-1);
    color: #fff;
    border: none;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.28);
}
.about-author-cta .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4); }
.about-author-cta .btn-secondary {
    background: var(--gradient-2);
    color: #fff;
    border: none;
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.28);
}
.about-author-cta .btn-secondary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(245, 87, 108, 0.4); }
@media (max-width: 600px) {
    .about-author-cta { flex-direction: column; align-items: stretch; }
    .about-author-cta .btn-primary,
    .about-author-cta .btn-secondary { justify-content: center; }
}
.feedback-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: auto;
    min-width: 160px;
    margin-top: 0.5rem;
    padding: 0.75rem 1.6rem;
    background: var(--gradient-1);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.28);
}
.feedback-submit-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4); }
.feedback-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.feedback-thanks {
    margin-top: 0.85rem;
    color: var(--success);
    font-weight: 600;
    font-size: 0.95rem;
}
.feedback-divider {
    margin: 1.75rem 0;
    border: none;
    border-top: 1px solid var(--bg-tertiary);
}
@media (max-width: 600px) {
    .feedback-section { padding: 1.5rem 1.1rem; margin: 2rem 0 1rem; }
    .feedback-section h2 { font-size: 1.15rem; }
    .feedback-section h3 { font-size: 0.95rem; }
    .rating-group { gap: 0.45rem; }
    .rating-btn { width: 48px; height: 48px; font-size: 1.5rem; border-radius: 12px; }
    .feedback-submit-btn { width: 100%; min-width: 0; }
}
