/* station1998 · 米倉物語風格 · 琥珀金療癒 */
:root {
    --bg-color: #fcfbf9;
    --card-bg: rgba(255, 255, 255, 0.85);
    --primary: #d97706;
    --primary-hover: #b45309;
    --primary-light: #fef3c7;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: rgba(229, 231, 235, 0.8);
    --shadow-soft: 0 20px 40px -15px rgba(0, 0, 0, 0.05);
    --radius-lg: 24px;
    --radius-md: 16px;
    --max-width: 1200px;
    --author-max: 1000px;
    --article-max: 800px;
    --header-height: 56px;
    --font-heading: 'Noto Serif TC', 'Songti TC', 'PingFang TC', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.8;
    overflow-wrap: anywhere;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
a:focus-visible, button:focus-visible, textarea:focus-visible, input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}
h1, h2, h3, h4, p, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, textarea { font: inherit; }

.wrapper {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: 20px;
}
.clamp-2, .clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }

/* ---------- 頂欄 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(252, 251, 249, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}
.site-header--scrolled { box-shadow: var(--shadow-soft); }
.site-header__inner {
    position: relative;
    height: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.site-header__logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
    white-space: nowrap;
    line-height: 1;
}
.site-header__logo:hover { color: var(--primary); }
.site-header__toggle {
    position: relative;
    z-index: 3;
    width: 44px;
    height: 44px;
    margin-right: -.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: 0;
    color: var(--text-main);
    cursor: pointer;
}
.site-header__bar,
.site-header__bar::before,
.site-header__bar::after {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
}
.site-header__bar { position: relative; }
.site-header__bar::before,
.site-header__bar::after {
    content: "";
    position: absolute;
    left: 0;
    transition: transform .3s ease;
}
.site-header__bar::before { transform: translateY(-7px); }
.site-header__bar::after { transform: translateY(7px); }
.site-header__toggle[aria-expanded="true"] .site-header__bar { background: transparent; }
.site-header__toggle[aria-expanded="true"] .site-header__bar::before { transform: rotate(45deg); }
.site-header__toggle[aria-expanded="true"] .site-header__bar::after { transform: rotate(-45deg); }

/* 行動選單：absolute 避開 sticky + backdrop-filter 的 fixed 裁切 */
.site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100dvh - var(--header-height));
    z-index: 2;
    padding: .5rem 20px 2rem;
    background: var(--bg-color);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
}
.site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.site-nav__link {
    display: flex;
    align-items: center;
    min-height: 48px;
    border-bottom: 1px solid var(--border-color);
    font-size: .95rem;
    font-weight: 500;
    color: var(--text-muted);
}
.site-nav__link:hover,
.site-nav__link--curr { color: var(--primary); }

.page { flex: 1 0 auto; padding-bottom: 4rem; }

/* ---------- 共用按鈕 / 卡片媒體 ---------- */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 600;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 20px rgba(217, 119, 6, 0.2);
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-2px);
}
.btn-secondary {
    background: #fff;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.media-fill {
    position: relative;
    overflow: hidden;
    width: 100%;
    background: #f3f4f6;
}
.media-fill img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.media-hero { aspect-ratio: 16 / 10; border-radius: var(--radius-md); }
.media-card { aspect-ratio: 16 / 10; }
.media-cover { aspect-ratio: 16 / 9; border-radius: var(--radius-lg); }
.media-avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}
.section-header h2,
.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
}
.section-header p,
.section-subtitle {
    color: var(--text-muted);
    font-size: .95rem;
}

/* ---------- 首頁 Hero ---------- */
.hero {
    padding: 60px 0 80px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    align-items: center;
}
.hero-content h1,
.hero-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.3;
    margin-bottom: 20px;
}
.hero-title a:hover { color: var(--primary); }
.hero-kicker {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.hero-brief {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    line-height: 1.9;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.hero-visual {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-soft);
}
.hero-visual__link { display: block; margin-bottom: 20px; }
.hero-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.author-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.author-mini__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    flex: none;
    background: #f3f4f6;
}
.author-mini-text h4 {
    font-size: .95rem;
    font-weight: 700;
}
.author-mini-text p {
    font-size: .8rem;
    color: var(--text-muted);
}
.badge-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- 分類 ---------- */
.categories { padding: 40px 0 80px; }
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.category-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
    border-color: var(--primary);
    color: inherit;
}
.category-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.category-card p {
    font-size: .85rem;
    color: var(--text-muted);
}

/* ---------- 文章網格（首頁 / 作者） ---------- */
.latest-articles { padding: 0 0 80px; }
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.articles-grid > .ad-div {
    grid-column: 1 / -1;
}
.article-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
}
.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
}
.article-card--text {
    padding: 20px;
    justify-content: space-between;
}
.article-card--text:hover { border-color: var(--primary); }
.article-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}
.article-tag {
    font-size: .75rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
}
.article-body h3,
.article-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 12px;
}
.article-card--text h3 { font-size: 1.05rem; margin-bottom: 10px; }
.article-body p,
.article-card p {
    font-size: .9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.article-card--text p {
    font-size: .875rem;
    margin-bottom: 16px;
}
.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}
.article-meta-link {
    font-size: .75rem;
    color: var(--primary);
    font-weight: 600;
}

/* ---------- 作者頁 ---------- */
.author-page {
    max-width: var(--author-max);
    margin: 20px auto 60px;
    width: 90%;
}
.author-profile {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-soft);
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.author-profile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #d97706, #fbbf24, #f59e0b);
}
.author-avatar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.avatar-container {
    position: relative;
    width: 160px;
    height: 160px;
    margin-bottom: 20px;
}
.author-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 10px 25px rgba(217, 119, 6, 0.15);
    background: #f3f4f6;
}
.status-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: .75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.author-name {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -.5px;
    margin-bottom: 4px;
}
.author-title {
    font-size: .95rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 16px;
}
.author-stats {
    display: flex;
    gap: 16px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}
.stat-item {
    background: rgba(243, 244, 246, 0.6);
    padding: 8px 12px;
    border-radius: 12px;
    text-align: center;
    flex: 1;
    min-width: 4.5rem;
}
.stat-num {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
}
.stat-label {
    font-size: .75rem;
    color: var(--text-muted);
}
.author-bio { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.bio-text {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: #374151;
    line-height: 2;
    text-align: justify;
}
.bio-text > p { margin: 0 0 1em; }
.bio-text > p:last-child { margin-bottom: 0; }
.author-articles-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 48px 0 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.author-articles-title .articles-grid { gap: 20px; }

/* ---------- 詳情頁 ---------- */
.detail-page {
    max-width: var(--article-max);
    margin: 0 auto;
    padding: 0 20px;
}
.breadcrumb {
    font-size: .875rem;
    color: var(--text-muted);
    margin: 20px 0 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.article-header {
    margin-bottom: 40px;
    text-align: center;
}
.article-category {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.article-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 20px;
    letter-spacing: -.5px;
}
.article-meta-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px 20px;
    font-size: .9rem;
    color: var(--text-muted);
}
.author-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}
.author-inline img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3f4f6;
}
.article-cover-wrap {
    margin-bottom: 48px;
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.article-content {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 40px;
}
.article-content,
.article__body {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    line-height: 2.1;
    color: #374151;
}
.article-content > p,
.article__body > p {
    margin: 0 0 15px;
    text-align: justify;
}
.article-content > h2,
.article__body > h2 {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: var(--font-heading);
    margin: 40px 0 20px;
    color: var(--text-main);
}
.article-content img,
.article__body img {
    width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: var(--radius-md);
}
.article-content a,
.article__body a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: .2em;
}
.article-content blockquote,
.article__body blockquote {
    background: #fffbeb;
    border-left: 4px solid var(--primary);
    padding: 20px 24px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 32px 0;
    font-size: 1.05rem;
    color: #92400e;
    font-style: italic;
}
.article-content ul,
.article-content ol,
.article__body ul,
.article__body ol {
    margin: 0 0 15px;
    padding-left: 1.5rem;
    list-style: disc;
}
.share-container { margin: 0 0 40px; }

.author-box {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px;
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 40px;
}
.author-box img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-light);
    flex: none;
    background: #f3f4f6;
}
.author-box-info { min-width: 0; }
.author-box-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.author-box-info h3 a:hover { color: var(--primary); }
.author-box-info .author-box__role {
    font-size: .85rem;
    color: var(--primary);
    margin-bottom: 6px;
}
.author-box-info p {
    font-size: .9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.pn {
    display: grid;
    gap: 0;
    margin-bottom: 40px;
    border-top: 1px solid var(--border-color);
}
.pn__item {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    min-width: 0;
}
.pn__label { font-size: .85rem; color: var(--text-muted); }
.pn__title { font-weight: 700; line-height: 1.5; }
.pn__item:hover .pn__title { color: var(--primary); }
.pn__item--next { text-align: right; }

.related { margin-bottom: 40px; }
.related .section-title { font-size: 1.25rem; margin-bottom: 20px; }
.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
.related-item {
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--card-bg);
}
.related-item h3 { font-size: 1rem; font-weight: 600; line-height: 1.5; }

.reply { margin-bottom: 40px; }
.reply .section-title { font-size: 1.25rem; margin-bottom: 20px; }
.reply__form { display: grid; gap: .75rem; }
.reply__field {
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    color: var(--text-main);
}
.reply__field:disabled { color: var(--text-muted); }
.reply__btn {
    justify-self: start;
    min-height: 44px;
    padding: 0 1.5rem;
    border: 0;
    border-radius: 30px;
    background: var(--primary);
    color: #fff;
    opacity: .55;
    cursor: not-allowed;
}

/* ---------- 分頁 ---------- */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 2rem;
}
.pager__btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 .875rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    font-variant-numeric: tabular-nums;
}
a.pager__btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.pager__btn--curr {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
}
.pager__btn--off {
    color: var(--text-muted);
    border-style: dashed;
    cursor: default;
}

/* ---------- 分類 / 更多 / 全部 / alone（保留原頁能力樣式） ---------- */
.page-head {
    padding: 2rem 0 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.page-head__title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
}
.page-head__desc {
    margin-top: .5rem;
    color: var(--text-muted);
}
.entries-list {
    display: grid;
    gap: 20px;
}
.entry-row {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
.entry-row__title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.5;
}
.entry-row__brief { color: var(--text-muted); font-size: .9rem; }
.entry-row__meta { font-size: .8rem; color: var(--text-muted); }
.log__row {
    display: flex;
    gap: 1rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
}
.log__row time {
    flex: none;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.log__row:hover { color: var(--primary); }

.standalone {
    max-width: var(--article-max);
    margin: 2rem auto 0;
}
.standalone__top {
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.standalone__top h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    line-height: 1.35;
}
.standalone__body {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    line-height: 2;
    color: #374151;
}
.standalone__body > p { margin: 0 0 .875rem; }
.standalone__body img { margin: 1rem 0; border-radius: var(--radius-md); }

.stay-touch {
    max-width: var(--article-max);
    margin: 2.5rem auto 0;
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}
.stay-touch__title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    margin-bottom: .5rem;
}
.stay-touch__desc {
    font-size: .95rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}
.stay-touch__form {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}
.stay-touch__field {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.stay-touch__label {
    font-size: .9rem;
    font-weight: 600;
}
.stay-touch__form input,
.stay-touch__form textarea {
    width: 100%;
    padding: .9rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: #fff;
    color: var(--text-main);
}
.stay-touch__form input:focus,
.stay-touch__form textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.stay-touch__submit {
    align-self: flex-start;
    padding: .85rem 1.75rem;
    border: 0;
    border-radius: 30px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.stay-touch__submit:hover { background: var(--primary-hover); }
.stay-touch__submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}
.stay-touch__msg,
.js-stay-touch-msg {
    font-size: .9rem;
    min-height: 1.4em;
}
.stay-touch__msg[hidden] { display: none; }
.stay-touch__msg.is-ok,
.js-stay-touch-msg.is-ok { color: #15803d; }
.stay-touch__msg.is-error,
.js-stay-touch-msg.is-error { color: #b42318; }

/* ---------- 頁尾 ---------- */
.site-footer {
    margin-top: auto;
    background: #fff;
    border-top: 1px solid var(--border-color);
    padding: 40px 0 30px;
    color: var(--text-muted);
    font-size: .9rem;
}
.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.site-footer__logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}
.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
}
.site-footer__nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--text-muted);
}
.site-footer__nav a:hover { color: var(--primary); }

/* ---------- 斷點 ---------- */
@media (max-width: 1024px) {
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 40px 0;
    }
    .hero-title { font-size: 2.2rem; }
}

@media (min-width: 768px) {
    .pn { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 2rem; }
    .article-title { font-size: 2.5rem; }
    .standalone__top h1 { font-size: 2rem; }
}

@media (min-width: 1024px) {
    .site-header__toggle { display: none; }
    .site-nav {
        position: static;
        display: flex;
        align-items: center;
        gap: 28px;
        height: auto;
        max-height: none;
        top: auto;
        right: auto;
        left: auto;
        padding: 0;
        background: none;
        overflow: visible;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
    }
    .site-nav__link {
        min-height: auto;
        padding: 0;
        border-bottom: 0;
        font-size: .95rem;
    }
}

@media (max-width: 768px) {
    :root { --header-height: 50px; }
    .author-profile {
        grid-template-columns: 1fr;
        padding: 30px 20px;
        gap: 24px;
        text-align: center;
    }
    .author-stats { max-width: 300px; margin: 0 auto; }
    .articles-grid,
    .category-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 2rem; }
    .section-header h2,
    .section-title { font-size: 1.5rem; }
    .article-content { padding: 24px 20px; }
    .article-title { font-size: 1.5rem; }
    .article-content,
    .article__body { font-size: 1.125rem; }
    .article-content > p,
    .article__body > p { margin-bottom: 15px; }
    .author-box {
        flex-direction: column;
        text-align: center;
    }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .btn-primary,
    .btn-secondary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ---------- legacy pages compat ---------- */
.layout { display: grid; gap: 2rem; margin-top: 2rem; }
.layout__main, .layout__side { min-width: 0; }
.crumbs { display: none; }
.crumbs__list { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .875rem; color: var(--text-muted); }
.crumbs__list li + li::before { content: "/"; margin-right: .5rem; color: var(--border-color); }
.crumbs__list a:hover { color: var(--primary); }
.card { position: relative; }
.stretched-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #f3f4f6;
    flex-shrink: 0;
    border-radius: var(--radius-md);
}
.card__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.kicker {
    position: relative;
    z-index: 2;
    display: inline-flex;
    font-size: .8rem;
    font-weight: 600;
    color: var(--primary);
}
.leader {
    flex: 1 1 1.5rem;
    min-width: 1.5rem;
    height: 4px;
    margin-bottom: .55em;
    background: radial-gradient(circle, var(--text-muted) 1px, transparent 1.4px) left center / 8px 4px repeat-x;
    opacity: .75;
}
.entries { border-top: 1px solid var(--border-color); }
.entry {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    grid-template-areas: "num body" ". media";
    column-gap: .875rem;
    row-gap: 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color);
}
.entry__num {
    grid-area: num;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}
.entry__body {
    grid-area: body;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-width: 0;
}
.entry__line {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    column-gap: .5rem;
    row-gap: .25rem;
    min-width: 0;
}
.entry__title {
    flex: 1 1 100%;
    min-width: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.45;
}
.entry__date {
    flex: none;
    font-size: .8rem;
    color: var(--text-muted);
}
.entry__brief { font-size: .95rem; color: var(--text-muted); }
.entry__meta { font-size: .8rem; color: var(--text-muted); }
.entry__media { grid-area: media; }
.entry--noimg { grid-template-areas: "num body"; }
.side { display: flex; flex-direction: column; gap: 2rem; }
.side .section-title { font-size: 1.15rem; margin-bottom: .75rem; }
.side__cats li { border-bottom: 1px solid var(--border-color); }
.side__cat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
}
.side__cat--curr { color: var(--primary); font-weight: 700; }
.side__recent li { padding: .75rem 0; border-bottom: 1px solid var(--border-color); }
.side__recent a { font-weight: 600; line-height: 1.5; }
.side__recent time { display: block; margin-top: .25rem; font-size: .8rem; color: var(--text-muted); }
.side__author { display: flex; gap: .875rem; align-items: center; }
.side__author img { width: 3.5rem; height: 3.5rem; flex: none; object-fit: cover; border-radius: 50%; }
.side__author a { font-weight: 700; color: var(--primary); }
.log__era {
    margin: 2rem 0 .25rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--text-main);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary);
}
.log__era:first-child { margin-top: 0; }
@media (min-width: 600px) {
    .entry {
        grid-template-columns: 2.5rem minmax(0, 1fr) 10rem;
        grid-template-areas: "num body media";
        align-items: stretch;
    }
    .entry--noimg { grid-template-columns: 2.5rem minmax(0, 1fr); grid-template-areas: "num body"; }
    .entry__title { flex: 0 1 auto; }
}
@media (min-width: 768px) {
    .crumbs { display: block; padding-top: 1.25rem; }
}
@media (min-width: 1024px) {
    .layout { grid-template-columns: 17rem minmax(0, 1fr); gap: 3rem; }
    .layout__main { grid-column: 2; grid-row: 1; }
    .layout__side { grid-column: 1; grid-row: 1; align-self: start; position: sticky; top: calc(var(--header-height) + 1.5rem); }
    .entry { grid-template-columns: 3rem minmax(0, 1fr) 12rem; }
    .entry--noimg { grid-template-columns: 3rem minmax(0, 1fr); }
}
