/* ally.ren — Blog Stylesheet (V3 分页样式修复)
   修复: 补充 .page-current / .page-ellipsis / .page-info 样式，
        与 pagination.py 生成的 HTML 类名对齐
*/

/* ============ CSS Variables ============ */
:root {
    --bg: #f8f5f0;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #555;
    --text-muted: #888;
    --accent: #c0392b;
    --accent-hover: #a93226;
    --border: #e8e4de;
    --border-light: #f0ece6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111111;
        --surface: #1a1a1a;
        --text: #e8e4de;
        --text-secondary: #b0a99f;
        --text-muted: #706b65;
        --accent: #e74c3c;
        --accent-hover: #ff6b5a;
        --border: #2a2a2a;
        --border-light: #222222;
        --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
        --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
        --shadow-lg: 0 8px 30px rgba(0,0,0,0.4);
    }
}

/* ============ Reset & Base ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Source Serif 4', 'Noto Serif SC', Georgia, serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    min-height: 100vh;
}

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

img { max-width: 100%; height: auto; }

code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: var(--border-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
}

pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
    line-height: 1.6;
}

pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

blockquote {
    border-left: 3px solid var(--accent);
    padding: 8px 20px;
    margin: 16px 0;
    color: var(--text-secondary);
    background: var(--border-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 32px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

th, td {
    border: 1px solid var(--border);
    padding: 10px 14px;
    text-align: left;
}

th {
    background: var(--border-light);
    font-weight: 600;
}

/* ============ Header ============ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.92);
}

@media (prefers-color-scheme: dark) {
    .site-header {
        background: rgba(17,17,17,0.92);
    }
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.site-logo {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.site-logo:hover { color: var(--accent); }

.site-nav {
    display: flex;
    gap: 4px;
}

.nav-link {
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--text);
    background: var(--border-light);
}

/* ============ Layout ============ */
.layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    min-height: calc(100vh - 56px - 200px);
}

.main-col { min-width: 0; }
.sidebar-col { min-width: 0; }

/* ============ Hero ============ */
.hero {
    text-align: center;
    padding: 48px 20px 40px;
    margin-bottom: 32px;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 42px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.hero-sub {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 28px;
}

/* ============ Search Box ============ */
.search-box {
    max-width: 480px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* ============ Article Card ============ */
.article-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    transition: box-shadow 0.2s, transform 0.2s;
}

.article-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.article-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-card h2 a {
    color: var(--text);
}

.article-card h2 a:hover {
    color: var(--accent);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.article-meta a {
    color: var(--text-secondary);
}

.article-meta a:hover {
    color: var(--accent);
}

.article-excerpt {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin-top: 8px;
}

.article-excerpt img {
    border-radius: 10px;
    margin: 8px 0;
}

/* ============ Tags ============ */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag-pill {
    display: inline-block;
    padding: 3px 12px;
    background: var(--border-light);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.2s;
}

.tag-pill:hover {
    background: var(--accent);
    color: #fff;
}

/* ============ Post Card ============ */
.post-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 36px 40px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.post-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.post-content {
    font-size: 16px;
    line-height: 1.9;
    color: var(--text);
}

.post-content h1, .post-content h2, .post-content h3 {
    font-family: 'Playfair Display', serif;
    margin: 32px 0 12px;
    line-height: 1.3;
}

.post-content h2 { font-size: 24px; }
.post-content h3 { font-size: 20px; }

.post-content p { margin-bottom: 16px; }
.post-content ul, .post-content ol { padding-left: 24px; margin-bottom: 16px; }
.post-content li { margin-bottom: 4px; }

.post-content img {
    border-radius: var(--radius-sm);
    margin: 16px 0;
    display: block;
}

.post-content a {
    color: var(--accent);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.post-content a:hover {
    border-bottom-color: var(--accent);
}

/* ============ Author Header ============ */
.author-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 32px;
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.author-bio {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============ Back Link ============ */
.back-link {
    margin-bottom: 20px;
}

.back-link a {
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.2s;
}

.back-link a:hover {
    color: var(--accent);
}

/* ============ Breadcrumb ============ */
.breadcrumb-card {
    padding: 12px 20px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
}

.breadcrumb-card a {
    color: var(--text-muted);
    font-size: 14px;
}

.breadcrumb-card a:hover {
    color: var(--accent);
}

/* ============ Badges ============ */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-private {
    background: #fef3cd;
    color: #856404;
}

.badge-pending {
    background: #d1ecf1;
    color: #0c5460;
}

@media (prefers-color-scheme: dark) {
    .badge-private {
        background: #3d3520;
        color: #f0c040;
    }
    .badge-pending {
        background: #1a3040;
        color: #5bc0de;
    }
}

.edited-tag {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* ============ Export Button ============ */
.export-btn {
    color: var(--text-secondary);
    transition: color 0.2s;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.export-modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:9999; justify-content:center; align-items:center; }
.export-modal-overlay.is-open { display:flex; }
.export-modal { background:#fff; border-radius:16px; padding:36px 32px; max-width:380px; width:90%; text-align:center; box-shadow:0 20px 60px rgba(0,0,0,.3); position:relative; }
.export-modal h3 { font-size:20px; margin:0 0 8px; color:#1a1a1a; }
.export-modal p { font-size:14px; color:#666; margin:0 0 20px; line-height:1.6; }
.export-modal img { width:200px; height:200px; border-radius:12px; border:1px solid #eee; margin-bottom:16px; object-fit:contain; }
.export-modal .step { display:flex; align-items:center; gap:8px; justify-content:center; font-size:13px; color:#888; margin-bottom:6px; }
.export-modal .step b { color:#2c5aa0; }
.export-modal .close-btn { display:inline-block; margin-top:12px; padding:10px 32px; background:#f5f5f5; border:none; border-radius:8px; font-size:14px; cursor:pointer; color:#666; }
.export-modal .close-btn:hover { background:#eee; }
.site-toast { position:fixed; bottom:32px; left:50%; transform:translateX(-50%); background:var(--text); color:var(--bg); padding:12px 28px; border-radius:var(--radius-sm); font-size:14px; z-index:9999; opacity:0; transition:opacity .3s ease; pointer-events:none; font-family:'Source Serif 4',serif; box-shadow:var(--shadow-lg); }
.site-toast.show { opacity:1; }
.browser-compat-notice { position:fixed; top:0; left:0; right:0; z-index:99999; background:#fef2f2; color:#991b1b; padding:16px 20px; font-size:14px; text-align:center; font-family:system-ui,sans-serif; }

.export-btn:hover {
    color: var(--accent);
}

/* ============ Actions Bar ============ */
.actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0 0;
    border-top: 1px solid var(--border-light);
    margin-top: 24px;
    position: relative;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--border-light);
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--border);
    color: var(--text);
}

.action-btn.liked {
    color: var(--accent);
    background: rgba(192,57,43,0.08);
}

/* ============ Share Menu ============ */
.share-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    z-index: 50;
    min-width: 140px;
}

.share-menu a {
    display: block;
    padding: 8px 20px;
    color: var(--text);
    font-size: 14px;
    transition: background 0.15s;
}

.share-menu a:hover {
    background: var(--border-light);
    color: var(--accent);
}

/* ============ Comments Section ============ */
.comments-section-card {
    margin-top: 16px;
}

.comments-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text);
}

.comment-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-reply {
    margin-left: 24px;
    padding-left: 16px;
    border-left: 2px solid var(--border);
}

.comment-depth-2 {
    margin-left: 48px;
}

.comment-depth-3 {
    margin-left: 72px;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.comment-time {
    font-size: 12px;
    color: var(--text-muted);
}

.reply-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: inherit;
    transition: all 0.2s;
}

.reply-btn:hover {
    color: var(--accent);
    background: rgba(192,57,43,0.06);
}

.reply-ref {
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 4px;
    opacity: 0.8;
}

.comment-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    word-break: break-word;
    overflow-wrap: break-word;
}

.comment-body img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 6px;
    display: none;
}

/* ============ Comment Form ============ */
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-form input,
.comment-form textarea {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--accent);
}

.comment-form textarea {
    resize: vertical;
    min-height: 80px;
}

.comment-form button {
    align-self: flex-end;
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form button:hover {
    background: var(--accent-hover);
}

.comment-login-required {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--border-light);
    color: var(--text-secondary);
    font-size: 14px;
}

.comment-login-required[hidden] { display: none; }
.comment-login-required p { margin: 0; }
.comment-login-link { font-weight: 600; white-space: nowrap; }
.comment-form input:disabled,
.comment-form textarea:disabled,
.comment-form button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

/* ============ Sidebar ============ */
.sidebar-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: var(--border-light);
    border-radius: var(--radius-sm);
}

.stat-number {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.qr-container {
    text-align: center;
}

.qr-image {
    width: 160px;
    height: 160px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.qr-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.author-rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.author-rank-item:hover {
    background: var(--border-light);
}

.rank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.rank-name {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-count {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-cloud a {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.tag-cloud a:hover {
    color: var(--accent);
}

/* ============ Pagination (修复: 补充 .page-current / .page-ellipsis / .page-info) ============ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 32px 0;
}

.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border-light);
    transition: all 0.2s;
}

.pagination .page-link:hover {
    background: var(--border-light);
    color: var(--text);
}

/* 修复: 当前页高亮样式 — 与 pagination.py 生成的 page-current 类名对齐 */
.pagination .page-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
}

/* 修复: 省略号样式 */
.pagination .page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 36px;
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 2px;
}

/* 修复: 页码信息样式 */
.pagination .page-info {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ============ Empty State ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* ============ Footer ============ */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
    margin-top: 48px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-brand h3 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text);
}

.footer-brand p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
}

.footer-col h4 {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    margin-bottom: 16px;
    color: var(--text);
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--accent);
}

.footer-links-section {
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    margin-bottom: 24px;
}

.footer-links-section h4 {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--text);
}

.footer-links-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
}

.footer-links-wrap a {
    color: var(--text-muted);
    font-size: 13px;
    transition: color 0.2s;
}

.footer-links-wrap a:hover {
    color: var(--accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 13px;
}

.footer-bottom p {
    margin-bottom: 4px;
}

/* ============ Error Pages ============ */
.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-code {
    font-family: 'Playfair Display', serif;
    font-size: 72px;
    font-weight: 700;
    color: var(--text-muted);
    line-height: 1;
    margin-bottom: 12px;
}

.error-title {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--text);
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.error-link {
    display: inline-block;
    padding: 12px 28px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: background 0.2s;
}

.error-link:hover {
    background: var(--accent-hover);
    color: #fff;
}

/* ============ Loading Animation ============ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.article-card {
    animation: fadeIn 0.4s ease both;
}

.article-card:nth-child(2) { animation-delay: 0.05s; }
.article-card:nth-child(3) { animation-delay: 0.1s; }
.article-card:nth-child(4) { animation-delay: 0.15s; }
.article-card:nth-child(5) { animation-delay: 0.2s; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
        padding: 20px 16px;
        gap: 24px;
    }

    .sidebar-col {
        order: -1;
    }

    .hero h1 {
        font-size: 32px;
    }

    .post-card {
        padding: 24px 20px;
    }

    .post-header h1 {
        font-size: 26px;
    }

    .author-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .comment-reply {
        margin-left: 12px;
        padding-left: 12px;
    }

    .comment-depth-2 {
        margin-left: 24px;
    }

    .comment-depth-3 {
        margin-left: 36px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 26px;
    }

    .article-card {
        padding: 20px 16px;
    }

    .article-card h2 {
        font-size: 18px;
    }

    .site-nav {
        gap: 0;
    }

    .nav-link {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* ============ Inline Style Replacements ============ */
.rank-name-truncated { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-size-12 { font-size: 12px; }
.tag-size-13 { font-size: 13px; }
.tag-size-14 { font-size: 14px; }
.tag-size-15 { font-size: 15px; }
.tag-size-16 { font-size: 16px; }
.tag-size-17 { font-size: 17px; }
.tag-size-18 { font-size: 18px; }
.footer-tagline { font-size: 12px; }
.excerpt-image { max-width: 100%; height: auto; border-radius: 10px; margin: 8px 0; display: block; }
.excerpt-image-placeholder { color: var(--text-muted); font-size: 13px; }
.markdown-image { max-width: 100%; border-radius: 8px; margin: 20px 0; display: block; }
.author-actions { float: right; font-size: 13px; display: flex; gap: 12px; align-items: center; }
.comment-status { color: var(--text-muted); }
.comment-form-spaced { margin-top: 24px; }
.search-result-info { color: var(--text-muted); margin-bottom: 20px; font-size: 14px; }
.search-results-title { font-family: 'Playfair Display', serif; font-size: 24px; margin-bottom: 16px; }
.tag-page-title { font-size: 28px; margin-bottom: 8px; }
.tag-page-count { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.guide-title, .legal-title { font-family: 'Playfair Display', serif; font-size: 28px; margin-bottom: 24px; }
.guide-section-title { font-family: 'Playfair Display', serif; font-size: 20px; margin: 24px 0 12px; }
.guide-list { padding-left: 24px; margin: 12px 0; }
.legal-card { background: var(--surface); border-radius: var(--radius); padding: 32px 36px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }

/* ============ Mobile Enhancements ============ */
@media (max-width: 600px) {
    .header-inner {
        padding: 0 12px;
    }

    .post-content {
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .post-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .post-content pre {
        margin-left: -8px;
        margin-right: -8px;
        border-radius: 0;
    }

    .comment-body img {
        max-width: 100%;
        height: auto;
    }

    .search-input {
        font-size: 16px; /* 防止 iOS 自动缩放 */
    }

    .btn, .nav-link {
        min-height: 44px; /* 触控友好最小尺寸 */
        display: inline-flex;
        align-items: center;
    }
}
/* ── AdSense 广告位 ───────────────────────────────── */
.ad-slot{
  margin:28px 0;
  padding:0;
  text-align:center;
  min-height:0;
}
.ad-slot .ad-label{
  margin:0 0 6px;
  font-size:11px;
  line-height:1.4;
  letter-spacing:.08em;
  color:#b8b3ac;
  text-transform:uppercase;
}
.ad-slot ins.adsbygoogle{
  display:block;
  width:100%;
}
/* 侧栏广告位：随卡片风格 */
.ad-slot.ad-sidebar1{
  margin-top:20px;
  padding:16px 12px;
  background:#faf8f4;
  border:1px solid #ece7de;
  border-radius:10px;
}
/* 文章页正文后广告位：与正文宽度一致 */
.ad-slot.ad-detail_mid{
  margin:32px 0;
  padding:20px 0;
  border-top:1px solid #f0ece4;
  border-bottom:1px solid #f0ece4;
}
/* 文章页底部（评论区前）广告位 */
.ad-slot.ad-detail_bottom{
  margin:24px 0 8px;
}
/* 首页列表后广告位 */
.ad-slot.ad-home_mid{
  margin:32px 0;
}
@media(max-width:768px){
  .ad-slot{margin:20px 0;}
  .ad-slot.ad-sidebar1{padding:14px 10px;}
}
