/* Enterprise light/dark theme — concise corporate style */
:root,
[data-theme="light"] {
    --bg: #f4f6f9;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-2: #eef1f5;
    --text: #1a2332;
    --text-secondary: #5a6a7e;
    --muted: #7a8a9e;
    --border: #e2e7ee;
    --accent: #1f6feb;
    --accent-hover: #1858c7;
    --accent-soft: rgba(31, 111, 235, 0.08);
    --success: #1a7f4b;
    --danger: #c9372c;
    --header-bg: rgba(255, 255, 255, 0.92);
    --header-border: #e2e7ee;
    --shadow: 0 1px 2px rgba(26, 35, 50, 0.04);
    --shadow-md: 0 8px 24px rgba(26, 35, 50, 0.08);
    --radius: 8px;
    --header-h: 60px;
    --max: 1200px;
    --pad: 20px;
    --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

[data-theme="dark"] {
    --bg: #0e1218;
    --bg-elevated: #151b24;
    --surface: #151b24;
    --surface-2: #1c2430;
    --text: #e8edf4;
    --text-secondary: #a0aec0;
    --muted: #8494a7;
    --border: #273140;
    --accent: #4c8dff;
    --accent-hover: #6ba1ff;
    --accent-soft: rgba(76, 141, 255, 0.14);
    --success: #3dd68c;
    --danger: #f07178;
    --header-bg: rgba(14, 18, 24, 0.92);
    --header-border: #273140;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%;
    color-scheme: light;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent;
}
[data-theme="dark"] { color-scheme: dark; }
html, body { margin: 0; padding: 0; }

/* Scrollbar — Firefox uses scrollbar-* above; WebKit below */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
*::-webkit-scrollbar-track {
    background: transparent;
}
*::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--muted) 45%, transparent);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--accent) 70%, var(--muted));
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
    background: transparent;
}

/* Fallback when color-mix unsupported */
@supports not (background: color-mix(in srgb, #000 50%, transparent)) {
    html {
        scrollbar-color: #9aa3b2 transparent;
    }
    [data-theme="dark"] {
        scrollbar-color: #5a6578 transparent;
    }
    *::-webkit-scrollbar-thumb {
        background-color: rgba(122, 138, 158, 0.55);
    }
    *::-webkit-scrollbar-thumb:hover {
        background-color: rgba(31, 111, 235, 0.65);
    }
    [data-theme="dark"] *::-webkit-scrollbar-thumb {
        background-color: rgba(132, 148, 167, 0.45);
    }
    [data-theme="dark"] *::-webkit-scrollbar-thumb:hover {
        background-color: rgba(76, 141, 255, 0.7);
    }
}
body,
.site-body {
    font-family: var(--font);
    background:
        radial-gradient(1200px 420px at 10% -10%, var(--accent-soft), transparent 60%),
        radial-gradient(900px 360px at 95% 0%, rgba(26, 35, 50, 0.04), transparent 55%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.55;
    display: flex;
    flex-direction: column;
}
[data-theme="dark"] .site-body {
    background:
        radial-gradient(1000px 380px at 8% -8%, var(--accent-soft), transparent 58%),
        radial-gradient(800px 320px at 100% 0%, rgba(0, 0, 0, 0.35), transparent 50%),
        var(--bg);
}
.site-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 28px var(--pad) 64px;
}
.site-footer {
    flex-shrink: 0;
    margin-top: auto;
    border-top: 1px solid var(--border);
    color: var(--muted);
    text-align: center;
    padding: 28px var(--pad);
    font-size: 0.8125rem;
    background: var(--bg-elevated);
    position: static;
}
.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--header-border);
}
.header-inner {
    max-width: var(--max);
    margin: 0 auto;
    min-height: var(--header-h);
    padding: 0 var(--pad);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}
.brand {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    color: var(--text);
    font-weight: 650;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
    z-index: 2;
}
.brand:hover { color: var(--text); }
.brand-left { margin-right: 0; }
.brand-right {
    display: inline-flex;
    line-height: 0;
}
.brand-logo {
    height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    display: block;
}
.brand-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.nav-cats {
    display: flex;
    gap: 4px;
    z-index: 2;
}
.nav-cats a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
}
.nav-cats a:hover {
    color: var(--text);
    background: var(--surface-2);
}

.header-search {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    width: min(340px, 30vw);
    z-index: 1;
}
.header-search input {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 6px 0 0 6px;
    padding: 0 12px;
    outline: none;
}
.header-search input:focus {
    border-color: var(--accent);
    background: var(--surface);
}
.header-search button {
    flex: 0 0 auto;
    height: 36px;
    border: 1px solid var(--accent);
    border-left: 0;
    background: var(--accent);
    color: #fff;
    padding: 0 14px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}
.header-search button:hover { background: var(--accent-hover); }

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}
.nav-links {
    display: flex;
    gap: 4px;
}
.nav-links a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
}
.nav-links a:hover {
    color: var(--text);
    background: var(--surface-2);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: var(--surface-2);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
}
.theme-toggle:hover {
    color: var(--text);
    background: var(--border);
}
.theme-icon {
    font-size: 0.95rem;
    line-height: 1;
    display: block;
}
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.nav-toggle:hover {
    color: var(--text);
    border-color: var(--muted);
}

.back-top {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 90;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.back-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}
.back-top:hover {
    background: var(--accent-hover);
}

.mobile-panel {
    display: none;
    padding: 8px var(--pad) 16px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.mobile-panel.is-open { display: block; }
.mobile-panel[hidden] { display: none !important; }
.mobile-search { display: none; margin-bottom: 12px; }
.mobile-search .header-search {
    position: static;
    transform: none;
    width: 100%;
}
.mobile-section-title {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    margin: 8px 0 8px;
}
.mobile-cats, .mobile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}
.mobile-cats a, .mobile-links a {
    color: var(--text-secondary);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
}

/* Slider */
.slider {
    position: relative;
    border-radius: calc(var(--radius) + 4px);
    overflow: hidden;
    margin-bottom: 36px;
    background: var(--surface-2);
    aspect-ratio: 21 / 8;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    touch-action: pan-y;
}
.slider-track {
    position: absolute;
    inset: 0;
}
.slide {
    display: none;
    position: absolute;
    inset: 0;
}
.slide.is-active { display: block; }
.slide a {
    display: block;
    width: 100%;
    height: 100%;
}
.slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.55s ease;
}
.slide.is-active img { transform: scale(1.02); }
.slide-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 28px 22px 18px;
    background: linear-gradient(transparent, rgba(8, 12, 18, 0.72));
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    z-index: 1;
}
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #1a2332;
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    box-shadow: var(--shadow);
    opacity: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, background 0.15s ease;
}
.slider-btn .slider-btn-icon {
    display: block;
    flex-shrink: 0;
}
.slider:hover .slider-btn,
.slider:focus-within .slider-btn { opacity: 1; }
[data-theme="dark"] .slider-btn {
    background: rgba(21, 27, 36, 0.92);
    color: #e8edf4;
}
.slider-btn:hover { background: #fff; }
[data-theme="dark"] .slider-btn:hover { background: var(--surface); }
.slider-btn.prev { left: 14px; }
.slider-btn.next { right: 14px; }
.slider-dots {
    position: absolute;
    left: 0; right: 0; bottom: 14px;
    display: flex;
    justify-content: center;
    gap: 7px;
    z-index: 2;
}
.slider-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 0;
    transition: width 0.2s ease, background 0.2s ease;
}
.slider-dots .dot.is-active {
    width: 22px;
    border-radius: 999px;
    background: #fff;
}

/* Sections & cards */
.category-block, .recommend-block { margin-bottom: 40px; }
.block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.block-head h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.block-head-bar {
    width: 4px;
    height: 1.05em;
    border-radius: 999px;
    background: var(--accent);
    display: inline-block;
}
.more-link {
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}
.more-link:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}
.post-card {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    min-width: 0;
}
.post-card:hover {
    color: var(--text);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}
.post-cover {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--surface-2);
    position: relative;
}
.post-cover::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 28%;
    background: linear-gradient(transparent, rgba(8, 12, 18, 0.18));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.post-card:hover .post-cover::after { opacity: 1; }
.post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}
.post-card:hover .post-cover img { transform: scale(1.05); }
.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--muted);
    background:
        linear-gradient(145deg, var(--surface-2), var(--accent-soft));
}
.post-card-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 13px 13px;
    min-width: 0;
}
.post-title {
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.35;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-views {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    line-height: 1;
    flex: 0 0 auto;
    white-space: nowrap;
}

.page-head {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.page-head h1 {
    margin: 0 0 8px;
    font-size: clamp(1.4rem, 3.2vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}
.page-sub { margin: 0; color: var(--muted); font-size: 0.875rem; }
.empty-state {
    text-align: center;
    padding: 56px 20px;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: calc(var(--radius) + 2px);
    font-size: 0.9rem;
}

.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 28px;
    flex-wrap: wrap;
}
.pagination a {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 550;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.pagination a.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Post detail */
.post-detail {
    width: 100%;
    max-width: none;
    margin: 0 0 8px;
}
.post-meta {
    color: var(--muted);
    font-size: 0.8125rem;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}
.post-meta-cat {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.75rem;
}
.post-meta-cat:hover { color: var(--accent-hover); }
.post-meta-sep { opacity: 0.55; }

.post-hero {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 28px;
    align-items: stretch;
    margin-bottom: 28px;
}
.post-hero.is-text-only {
    grid-template-columns: 1fr;
}
.post-detail-cover {
    margin: 0;
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: calc(var(--radius) + 2px);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    background: var(--surface-2);
}
.post-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}
.post-hero-side {
    min-width: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    padding: 22px 24px;
    box-shadow: var(--shadow);
}
.post-hero-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.post-hero-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}
.post-hero-title {
    margin: 0;
    font-size: clamp(1.25rem, 2.8vw, 1.65rem);
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.3;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-hero-views {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.8125rem;
    font-weight: 550;
    color: var(--muted);
}
.post-hero-label {
    margin: 4px 0 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--accent);
}
.post-summary {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.75;
    overflow-wrap: anywhere;
    white-space: normal;
    text-indent: 0;
}
.post-plot {
    margin: 0;
    flex: 1;
    min-height: 0;
    overflow: auto;
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.8;
    overflow-wrap: anywhere;
}
.post-plot p,
.post-plot div {
    margin: 0 0 0.85em;
    text-indent: 0 !important;
    padding-left: 0 !important;
}
.post-plot p:last-child,
.post-plot div:last-child {
    margin-bottom: 0;
}
.post-plot img {
    border-radius: 6px;
    margin: 10px auto;
    border: 1px solid var(--border);
}

.pan-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    padding: 18px 20px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
}
.pan-section h2 {
    margin: 0 0 14px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.pan-list { display: flex; flex-wrap: wrap; gap: 10px; }
.pan-btn {
    border: 1px solid var(--border);
    background: var(--accent-soft);
    color: var(--accent);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 650;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.pan-btn-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 3px;
}
.pan-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}
.pan-btn:hover .pan-btn-icon {
    filter: brightness(1.05);
}
.pan-code-hint {
    margin-left: 2px;
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.85;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.recommend-block .block-head {
    margin-bottom: 16px;
}
.recommend-block .block-head h2::before {
    content: "";
    width: 4px;
    height: 1.05em;
    border-radius: 999px;
    background: var(--accent);
    display: inline-block;
    margin-right: 10px;
    vertical-align: -0.12em;
}

/* Modal */
.pan-modal[hidden] {
    display: none !important;
}
.pan-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}
.pan-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.pan-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 20, 28, 0.55);
    cursor: pointer;
}
.pan-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(360px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px 20px 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transform: translateY(6px);
    transition: transform 0.18s ease;
}
.pan-modal.is-open .pan-modal-dialog {
    transform: translateY(0);
}
body.pan-modal-open {
    overflow: hidden;
}
.pan-modal-close {
    position: absolute;
    right: 8px;
    top: 4px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    line-height: 1;
    z-index: 2;
}
.pan-modal-close:hover {
    color: var(--text);
}
.pan-modal-dialog h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 650;
}
.pan-modal-name { margin: 0 0 8px; color: var(--accent); font-weight: 500; }
.pan-modal-code { margin: 0 0 12px; color: var(--success); font-size: 0.875rem; }
.pan-qr {
    width: min(168px, 52vw);
    height: min(168px, 52vw);
    margin: 0 auto 16px;
    background: #fff;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}
.pan-qr img,
.pan-qr canvas,
.pan-qr table {
    display: block;
    margin: 0 auto;
}
.pan-qr-fallback {
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.5;
    padding: 8px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 6px;
    border: 0;
    cursor: pointer;
    font-weight: 550;
    font-size: 0.875rem;
}
.btn-primary {
    background: var(--accent);
    color: #fff !important;
}
.btn-primary:hover { background: var(--accent-hover); }
.pan-visit { min-width: 132px; }

@media (max-width: 1100px) {
    .header-search { width: min(280px, 26vw); }
}

@media (max-width: 900px) {
    .nav-cats, .nav-links { display: none; }
    .header-search {
        position: static;
        transform: none;
        flex: 1;
        width: auto;
        max-width: none;
        min-width: 0;
    }
    .nav-toggle { display: inline-flex; }
    .slider { aspect-ratio: 16 / 9; }
    .post-hero {
        grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
        gap: 18px;
    }
    .post-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (max-width: 640px) {
    :root, [data-theme="light"], [data-theme="dark"] {
        --pad: 14px;
        --header-h: 54px;
    }
    .header-search { display: none; }
    .mobile-search { display: block; }
    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .post-card:hover { transform: none; }
    .post-card-body {
        padding: 9px 10px 10px;
        gap: 6px;
    }
    .post-title {
        font-size: 0.8rem;
    }
    .post-views {
        font-size: 0.6875rem;
    }
    .slider {
        aspect-ratio: 2 / 1;
        margin-bottom: 22px;
        border-radius: var(--radius);
    }
    .slider-btn { display: none; }
    .slide-caption {
        font-size: 0.9rem;
        padding: 20px 14px 14px;
    }
    .pan-btn { flex: 1 1 calc(50% - 8px); }
    .site-main { padding-top: 16px; padding-bottom: 40px; }
    .post-hero {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 20px;
    }
    .post-detail-cover {
        max-width: 220px;
        width: 100%;
        margin: 0 auto;
    }
    .post-hero-side {
        padding: 16px 18px;
        border-radius: var(--radius);
    }
    .post-hero-title {
        font-size: 1.15rem;
    }
    .post-hero-views {
        font-size: 0.75rem;
    }
    .post-hero-label {
        margin-bottom: 8px;
        font-size: 0.72rem;
    }
    .post-summary {
        font-size: 0.9rem;
        line-height: 1.7;
    }
    .post-detail-cover,
    .pan-section {
        border-radius: var(--radius);
    }
    .block-head h2 { font-size: 1.05rem; }
}

@media (max-width: 640px) {
    .back-top {
        right: 14px;
        bottom: 18px;
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
}
