/**
 * PicShow 主题 - 基础样式
 * Version: 1.0.0
 */

/* ============ CSS Variables ============ */
:root {
    --ps-primary: #3b82f6;
    --ps-primary-light: #8b9cf7;
    --ps-primary-dark: #4a5fd4;
    --ps-bg: #ffffff;
    --ps-bg-secondary: #f5f5f5;
    --ps-card-bg: #ffffff;
    --ps-text: #1a1a1a;
    --ps-text-secondary: #666666;
    --ps-text-muted: #999999;
    --ps-border: #e5e5e5;
    --ps-shadow: 0 2px 12px rgba(0,0,0,0.06);
    --ps-shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    --ps-radius: 12px;
    --ps-radius-sm: 8px;
    --ps-radius-lg: 16px;
    --ps-header-height: 60px;
    --ps-container-width: 1200px;

    /* z-index 层级管理 */
    --z-bg: -1;
    --z-base: 1;
    --z-card: 2;
    --z-sticky: 50;
    --z-header: 100;
    --z-dropdown: 200;
    --z-overlay: 1000;
    --z-modal: 1001;
    --z-toast: 9998;
    --z-search: 9999;
    --z-lightbox: 10000;
    --z-max: 99999;
    --ps-transition: 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ps-text);
    background: var(--ps-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ps-primary, #3b82f6);
    text-decoration: none;
    transition: color var(--ps-transition);
}
a:hover {
    color: var(--ps-primary-dark);
}

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

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: 16px;
}

/* ============ Container ============ */
.ps-container {
    max-width: var(--ps-container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ Header ============ */
.ps-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: var(--ps-card-bg);
    border-bottom: 1px solid var(--ps-border);
    backdrop-filter: blur(10px);
}

.ps-header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

body:has(.ps-header-fixed) {
    padding-top: var(--ps-header-height, 60px);
}

/* ============ Footer Links Section ============ */
.ps-footer-links-section {
    text-align: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--ps-border, #e0e0e0);
    margin-bottom: 16px;
}
.ps-footer-link-title {
    font-size: 0.85rem;
    color: var(--ps-text-secondary, #888);
    margin-bottom: 8px;
}
.ps-footer-link-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}
.ps-footer-link-list a {
    color: var(--ps-text-secondary, #666);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.ps-footer-link-list a:hover {
    color: var(--ps-primary, #3b82f6);
}

/* ============ Search Highlight ============ */
mark.ps-highlight {
    background: rgba(255, 213, 0, 0.35);
    color: inherit;
    padding: 1px 2px;
    border-radius: 2px;
}
html[data-theme="dark"] mark.ps-highlight {
    background: rgba(0, 229, 160, 0.25);
}

/* ============ Badge Dot/Count ============ */
.ps-badge-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1.2;
}
.ps-bottom-nav-item {
    position: relative;
}

/* ============ Reading Progress Bar ============ */
.ps-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--ps-primary, #3b82f6);
    z-index: var(--z-search);
    transition: width 0.1s linear;
    box-shadow: 0 0 6px var(--ps-primary, #3b82f6);
}
.ps-header-fixed .ps-progress-bar {
    top: var(--ps-header-height, 60px);
}

.ps-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.ps-logo {
    flex-shrink: 0;
}

.ps-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ps-text);
    text-decoration: none;
}

.ps-logo-img {
    height: 36px;
    width: auto;
}

.ps-menu-toggle {
    .ps-header-inner {
        height: 50px;
    }
    display: none;
    .ps-header-inner {
        height: 50px;
    }
    font-size: 1.5rem;
    .ps-header-inner {
        height: 50px;
    }
    color: var(--ps-text);
    .ps-header-inner {
        height: 50px;
    }
    padding: 8px;
    .ps-header-inner {
        height: 50px;
    }
}
    .ps-header-inner {
        height: 50px;
    }

.ps-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--ps-text-secondary);
    transition: all 0.2s;
}
.ps-btn-icon:hover {
    background: var(--ps-bg-secondary, #f5f7fa);
    color: var(--ps-text);
}

.ps-icon-sun { display: none; }
[data-theme="dark"] .ps-icon-moon { display: none; }
[data-theme="dark"] .ps-icon-sun { display: inline; }
.ps-dark-active .ps-icon-moon { display: none; }
.ps-dark-active .ps-icon-sun { display: inline; }

/* Navigation */
.ps-nav-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
}

.ps-nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ps-nav-item {
    position: relative;
}

.ps-nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--ps-text);
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.2s;
}
.ps-nav-link:hover {
    background: var(--ps-bg-secondary, #f5f7fa);
    color: var(--ps-primary, #3b82f6);
}

.ps-nav-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.ps-has-down::after {
    content: '\ea4e';
    font-family: 'remixicon';
    font-size: 0.75rem;
    margin-left: 2px;
}

.ps-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: var(--ps-card-bg);
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    box-shadow: var(--ps-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s;
    z-index: var(--z-dropdown);
    padding: 4px;
}
.ps-nav-dropdown:hover > .ps-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.ps-dropdown-menu li a {
    display: block;
    padding: 8px 12px;
    color: var(--ps-text);
    border-radius: 4px;
    white-space: nowrap;
}
.ps-dropdown-menu li a:hover {
    background: var(--ps-bg-secondary, #f5f7fa);
    color: var(--ps-primary, #3b82f6);
}

/* Search Bar */
.ps-search-bar {
    padding: 12px 0;
    background: var(--ps-bg-secondary, #f5f7fa);
    border-top: 1px solid var(--ps-border);
    position: relative;
}
.ps-search-bar-form {
    display: flex;
    gap: 8px;
}
.ps-search-bar-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    background: var(--ps-card-bg);
    color: var(--ps-text);
    outline: none;
}
.ps-search-bar-input:focus {
    border-color: var(--ps-primary, #3b82f6);
}
.ps-search-bar-btn {
    padding: 10px 20px;
    background: var(--ps-primary, #3b82f6);
    color: #fff;
    border-radius: 8px;
    font-size: 1.1rem;
}
/* Search Dropdown */
.ps-search-dropdown {
    max-width: 600px;
    margin: 8px auto 0;
    background: var(--ps-card-bg, #fff);
    border: 1px solid var(--ps-border, #e5e5e5);
    border-radius: 8px;
    box-shadow: var(--ps-shadow, 0 2px 12px rgba(0,0,0,0.06));
    display: none;
}
.ps-search-dropdown.ps-show { display: block; }
.ps-search-section { padding: 12px 16px; }
.ps-search-section + .ps-search-section { border-top: 1px solid var(--ps-border); }
.ps-search-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--ps-text-secondary, #888);
}
.ps-search-clear {
    background: none;
    border: none;
    color: var(--ps-text-secondary, #999);
    cursor: pointer;
    font-size: 0.8rem;
}
.ps-search-clear:hover { color: var(--ps-primary); }
.ps-search-section-body {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ps-search-tag {
    padding: 4px 12px;
    background: var(--ps-bg-secondary, #f5f7fa);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--ps-text-secondary, #666);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}
.ps-search-tag:hover {
    background: var(--ps-primary);
    color: #fff;
}
.ps-search-history-del {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0 2px;
}
.ps-search-history-del:hover { color: #e74c3c; }

/* ============ Hero Banner (横幅搜索区) ============ */
.ps-hero-banner {
    position: relative;
    width: 100%;
    padding: 60px 20px 50px;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(135deg, #3b82f6 0%, #0284c7 100%);
}
.ps-hero-banner-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.05" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,218.7C672,203,768,149,864,128C960,107,1056,117,1152,138.7C1248,160,1344,192,1392,208L1440,224L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom center;
    background-size: cover;
    opacity: 0.5;
}
.ps-hero-banner-inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}
.ps-hero-banner-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.ps-hero-banner-desc {
    font-size: 1rem;
    color: rgba(255,255,255,0.85);
    margin-bottom: 24px;
}
.ps-hero-banner .ps-hero-search-form {
    display: flex;
    max-width: 560px;
    margin: 0 auto 16px;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.ps-hero-banner .ps-hero-search-input {
    flex: 1;
    border: none;
    padding: 14px 24px;
    font-size: 1rem;
    background: transparent;
    outline: none;
    color: #333;
}
.ps-hero-banner .ps-hero-search-btn {
    border: none;
    background: var(--ps-primary, #3b82f6);
    color: #fff;
    padding: 14px 24px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: opacity 0.2s;
}
.ps-hero-banner .ps-hero-search-btn:hover { opacity: 0.85; }
.ps-hero-hot-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}
.ps-hero-hot-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}
.ps-hero-hot-tag {
    padding: 3px 12px;
    background: rgba(255,255,255,0.18);
    border-radius: 20px;
    font-size: 0.8rem;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s;
}
.ps-hero-hot-tag:hover {
    background: rgba(255,255,255,0.35);
}
html[data-theme="dark"] .ps-hero-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
html[data-theme="dark"] .ps-hero-banner .ps-hero-search-form {
    background: #1e1e2e;
}
html[data-theme="dark"] .ps-hero-banner .ps-hero-search-input {
    color: #e8e8e8;
}
@media (max-width: 768px) {
    .ps-hero-banner {
        padding: 40px 16px 36px;
    }
    .ps-hero-banner-title {
        font-size: 1.5rem;
    }
    .ps-hero-banner .ps-hero-search-form {
        max-width: 100%;
    }
}

/* ============ In-Article Ad ============ */

/* ============ Page Transition Loader ============ */
.ps-pjax-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ps-primary, #3b82f6), #38bdf8, #4facfe);
    z-index: var(--z-lightbox);
    animation: ps-pjax-progress 1.5s ease forwards;
    box-shadow: 0 0 10px var(--ps-primary, #3b82f6);
}
@keyframes ps-pjax-progress {
    0% { width: 0; }
    30% { width: 40%; }
    60% { width: 70%; }
    90% { width: 90%; }
    100% { width: 95%; }
}

/* ============ Dynamic Background (Video) ============ */
.ps-bg-video-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}
.ps-bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ps-bg-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.75);
}
html[data-theme="dark"] .ps-bg-video-overlay {
    background: rgba(10,10,10,0.82);
}

/* ============ In-Article Ad ============ */
.ps-ad-in-article {
    margin: 24px 0;
    padding: 16px;
    background: var(--ps-bg-secondary, #f9f9f9);
    border: 1px dashed var(--ps-border, #ddd);
    border-radius: var(--ps-radius, 8px);
    text-align: center;
    font-size: 0.9rem;
    color: var(--ps-text-secondary, #888);
}
.ps-ad-in-article::before {
    content: '广告';
    display: block;
    font-size: 0.7rem;
    color: var(--ps-text-muted, #bbb);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

/* ============ Announcement Widget ============ */
.ps-announce-content {
    font-size: 0.9rem;
    color: var(--ps-text-secondary, #666);
    line-height: 1.7;
    padding: 10px 12px;
    background: var(--ps-bg-secondary, #f9f9f9);
    border-radius: 8px;
    border-left: 3px solid var(--ps-primary, #3b82f6);
}

/* ============ Weather Widget ============ */
.ps-weather-temp {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ps-primary, #3b82f6);
}
.ps-weather-desc {
    font-size: 0.95rem;
    color: var(--ps-text, #333);
    margin: 4px 0;
}
.ps-weather-detail, .ps-weather-city, .ps-weather-info {
    font-size: 0.8rem;
    color: var(--ps-text-secondary, #888);
}
.ps-weather-loading {
    color: var(--ps-text-secondary, #999);
    font-size: 0.85rem;
}
.ps-weather-loading i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Hero Slider ============ */
.ps-hero {
    position: relative;
    width: 100%;
    margin-top: 20px;
    padding: 0;
    overflow: hidden;
}

.ps-hero-slider {
    position: relative;
    border-radius: var(--ps-radius-lg);
    overflow: hidden;
}
.ps-hero-full .ps-hero-slider {
    aspect-ratio: 21/9;
}

.ps-hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 200px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}
.ps-hero-slide a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}
.ps-hero-slide.ps-active {
    opacity: 1;
    position: relative;
    pointer-events: auto;
}

.ps-hero-img {
    width: 100%;
    min-height: 200px;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: var(--ps-bg-secondary, #eee);
}

.ps-hero-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 30px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 1.3rem;
    font-weight: 600;
}

.ps-hero-prev, .ps-hero-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #333;
    z-index: 10;
    transition: all 0.2s;
}
.ps-hero-prev { left: 30px; }
.ps-hero-next { right: 30px; }
.ps-hero-prev:hover, .ps-hero-next:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.ps-hero-dots {
    position: absolute;
    bottom: 15px;
    right: 30px;
    display: flex;
    gap: 8px;
    z-index: 10;
}
.ps-hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.2s;
}
.ps-hero-dot.ps-active {
    background: #fff;
    width: 24px;
    border-radius: 4px;
}

/* ============ Content Wrap (Main + Sidebar) ============ */
.ps-main-wrap {
    padding-top: 10px;
}
.ps-content-wrap {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.ps-content-main {
    flex: 1;
    min-width: 0;
}

/* ============ Toolbar ============ */
/* ============ Toolbar ============ */
.ps-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 16px;
    clear: both;
    gap: 10px;
}
.ps-toolbar-right {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}
.ps-toolbar-divider {
    width: 1px;
    height: 18px;
    background: var(--ps-border);
    opacity: 0.5;
}

/* ============ Switcher Label ============ */
.ps-switcher-label {
    font-size: 0.8rem;
    color: var(--ps-text-muted);
    margin-right: 4px;
    user-select: none;
}

/* ============ Layout Switcher (版面) ============ */
.ps-layout-switcher {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

/* ============ Style Switcher (风格) ============ */
.ps-style-switcher {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.ps-style-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    padding: 0;
}
.ps-style-btn:hover {
    transform: scale(1.15);
}
.ps-style-btn.ps-active {
    box-shadow: 0 0 0 2px var(--ps-primary);
    transform: scale(1.15);
}
.ps-style-btn.ps-active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--ps-primary, #3b82f6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* ============ Sidebar Toggle (侧栏) ============ */
.ps-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ps-toggle-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: var(--ps-text-muted);
    font-size: 0.85rem;
    transition: all 0.2s;
    position: relative;
    padding: 0;
    background: var(--ps-bg-secondary, #f5f7fa);
}
.ps-toggle-btn:hover {
    color: var(--ps-text);
    transform: scale(1.15);
}
.ps-toggle-btn.ps-hidden {
    color: var(--ps-primary, #3b82f6);
    box-shadow: 0 0 0 2px var(--ps-primary);
}
.ps-sidebar.ps-collapsed {
    display: none !important;
}
.ps-content-wrap.ps-no-sidebar .ps-content-main {
    max-width: 100%;
}

.ps-layout-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--ps-text-muted);
    font-size: 0.95rem;
    transition: all 0.2s;
    background: transparent;
    border: 1px solid transparent;
}
.ps-layout-btn:hover {
    color: var(--ps-text);
    background: var(--ps-bg-secondary, #f5f7fa);
}
.ps-layout-btn.ps-active {
    color: var(--ps-primary, #3b82f6);
    background: var(--ps-bg-secondary, #f5f7fa);
    border-color: var(--ps-border);
}

/* ============ Article List ============ */
.ps-article-list {
    clear: both;
    padding-top: 10px;
}

/* Grid Layout */
.ps-layout-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.ps-layout-grid .ps-card-cover {
    aspect-ratio: 4/3;
}

/* Masonry 2-column Layout */
.ps-layout-masonry2 {
    column-count: 2;
    column-gap: 20px;
}
.ps-layout-masonry2 .ps-card {
    break-inside: avoid;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
}
.ps-layout-masonry2 .ps-card-cover {
    aspect-ratio: auto;
    min-height: 140px;
    max-height: 360px;
}
.ps-layout-masonry2 .ps-card-img {
    height: auto;
    max-height: 360px;
}

/* Masonry 3-column Layout */
.ps-layout-masonry {
    column-count: 3;
    column-gap: 20px;
}
.ps-layout-masonry .ps-card {
    break-inside: avoid;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
}
.ps-layout-masonry .ps-card-cover {
    aspect-ratio: auto;
    min-height: 160px;
    max-height: 320px;
}
.ps-layout-masonry .ps-card-img {
    height: auto;
    max-height: 320px;
}

/* Gallery Layout */
.ps-layout-gallery {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.ps-layout-gallery .ps-card-cover {
    aspect-ratio: 16/10;
}
.ps-layout-gallery .ps-card-body {
    padding: 12px;
}
.ps-layout-gallery .ps-card-footer,
.ps-layout-gallery .ps-card-tags {
    display: none;
}

/* List Layout */
.ps-layout-list {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}
.ps-layout-list .ps-card {
    display: flex;
    flex-direction: row;
}
.ps-layout-list .ps-card-cover {
    width: 220px;
    min-width: 220px;
    aspect-ratio: auto;
    height: 160px;
}
.ps-layout-list .ps-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px 20px;
}
.ps-layout-list .ps-card-title {
    font-size: 1.1rem;
}
.ps-layout-list .ps-card-tags {
    margin-top: 6px;
}

/* ============ Film Strip Layout ============ */
.ps-film-strip {
    position: relative;
    padding: 20px;
    background: #0a0a0a;
    border-radius: 8px;
    margin-bottom: 16px;
}
.ps-film-track {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    position: relative;
    padding: 12px 0;
}
.ps-film-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 12px;
    background: repeating-linear-gradient(
        to right,
        #0a0a0a 0px,
        #0a0a0a 12px,
        #222 12px,
        #222 24px,
        #0a0a0a 24px,
        #0a0a0a 36px
    );
}
.ps-film-track::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 12px;
    background: repeating-linear-gradient(
        to right,
        #0a0a0a 0px,
        #0a0a0a 12px,
        #222 12px,
        #222 24px,
        #0a0a0a 24px,
        #0a0a0a 36px
    );
}
.ps-film-frame {
    flex: 0 0 auto;
    width: 100%;
    background: #111;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.ps-film-frame:hover { transform: scale(1.03); }
.ps-film-frame::before,
.ps-film-frame::after {
    content: '';
    display: block;
    height: 16px;
    background: repeating-linear-gradient(
        to right,
        transparent 0px,
        transparent 12px,
        #333 12px,
        #333 20px,
        transparent 20px,
        transparent 32px
    );
}
.ps-film-img-wrap {
    width: 100%;
    height: 200px;
    overflow: hidden;
}
.ps-film-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.ps-film-frame:hover .ps-film-img { transform: scale(1.08); }
.ps-film-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255,255,255,0.5);
}
.ps-film-info {
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ps-film-title {
    color: #e8e8e8;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}
.ps-film-date {
    color: #666;
    font-size: 0.75rem;
}
.ps-film-link {
    position: absolute;
    top: 20px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
}
.ps-film-frame:hover .ps-film-link { opacity: 1; }
.ps-film-nav {
    display: none;
}
.ps-film-prev,
.ps-film-next {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--ps-border, #ddd);
    background: var(--ps-card-bg, #fff);
    color: var(--ps-text, #333);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}
.ps-film-prev:hover,
.ps-film-next:hover {
    background: var(--ps-primary, #3b82f6);
    color: #fff;
    border-color: var(--ps-primary, #3b82f6);
}
.ps-film-counter {
    font-size: 0.9rem;
    color: var(--ps-text-secondary, #888);
}
html[data-theme="dark"] .ps-film-frame { background: #0a0a0a; }
html[data-theme="dark"] .ps-film-frame::before,
html[data-theme="dark"] .ps-film-frame::after { background: repeating-linear-gradient(to right, transparent 0px, transparent 12px, #222 12px, #222 20px, transparent 20px, transparent 32px); }
@media (max-width: 768px) {
    .ps-film-track { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .ps-film-frame { width: 100%; }
    .ps-film-img-wrap { height: 140px; }
}

/* ============ Timeline Layout ============ */
.ps-layout-timeline {
    position: relative;
    padding: 0 0 0 40px;
}
.ps-layout-timeline::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--ps-border, #e0e0e0);
}
.ps-layout-timeline .ps-card {
    position: relative;
    margin-bottom: 24px;
    display: flex;
    flex-direction: row;
    border-radius: var(--ps-radius, 8px);
}
.ps-layout-timeline .ps-card::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 24px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ps-primary, #3b82f6);
    border: 2px solid var(--ps-card-bg, #fff);
    box-shadow: 0 0 0 3px var(--ps-primary, #3b82f6);
    z-index: 1;
}
.ps-layout-timeline .ps-card-cover {
    width: 200px;
    min-width: 200px;
    aspect-ratio: auto;
    height: 150px;
}
.ps-layout-timeline .ps-card-body {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ps-layout-timeline .ps-card-title {
    font-size: 1.1rem;
}
@media (max-width: 768px) {
    .ps-layout-timeline {
        padding-left: 30px;
    }
    .ps-layout-timeline::before {
        left: 10px;
    }
    .ps-layout-timeline .ps-card {
        flex-direction: column;
    }
    .ps-layout-timeline .ps-card::before {
        left: -24px;
    }
    .ps-layout-timeline .ps-card-cover {
        width: 100%;
        height: 180px;
    }
}

/* ============ Card ============ */
.ps-card {
    background: var(--ps-card-bg);
    border-radius: var(--ps-radius);
    overflow: hidden;
    box-shadow: var(--ps-shadow);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.ps-card:hover {
    box-shadow: var(--ps-shadow-hover);
    transform: translateY(-6px);
    border-color: var(--ps-primary, #3b82f6);
}
.ps-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ps-primary, #3b82f6), var(--ps-primary-light, #8b9cf7));
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2;
}
.ps-card:hover::after { opacity: 1; }

.ps-card-cover {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--ps-bg-secondary, #f5f7fa);
}

.ps-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.ps-card:hover .ps-card-img {
    transform: scale(1.05);
}

.ps-card-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--ps-text-muted);
    background: var(--ps-bg-secondary, #f5f7fa);
}

/* No-cover placeholder with gradient + title */
.ps-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.9);
    position: relative;
}
.ps-placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.4;
    margin-bottom: 8px;
}
.ps-placeholder-title {
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    padding: 0 16px;
    opacity: 0.8;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* No-cover card adjustments */
.ps-card-no-cover .ps-card-cover {
    aspect-ratio: 16/9;
}

.ps-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--ps-transition);
}
.ps-card:hover .ps-card-overlay {
    opacity: 1;
}
.ps-card-link {
    padding: 8px 24px;
    background: #fff;
    color: #333;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.ps-card-link:hover {
    background: var(--ps-primary, #3b82f6);
    color: #fff;
}

.ps-card-body {
    padding: 16px;
}

.ps-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}
.ps-card-title a {
    color: var(--ps-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ps-card-title a:hover {
    color: var(--ps-primary, #3b82f6);
}

.ps-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--ps-text-muted);
    margin-bottom: 8px;
}

.ps-card-desc {
    font-size: 0.85rem;
    color: var(--ps-text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.ps-card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--ps-text-muted);
}
.ps-card-footer i {
    margin-right: 2px;
}

.ps-card-tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ps-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}
.ps-badge-top {
    background: var(--ps-primary, #3b82f6);
    color: #fff;
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
}

.ps-sort-badge a {
    display: inline-block;
    padding: 2px 8px;
    background: var(--ps-bg-secondary, #f5f7fa);
    color: var(--ps-text-secondary);
    border-radius: 4px;
    font-size: 0.75rem;
}

.ps-tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--ps-bg-secondary, #f5f7fa);
    color: var(--ps-text-secondary);
    border-radius: 20px;
    font-size: 0.75rem;
    transition: all 0.2s;
}
.ps-tag:hover {
    background: var(--ps-primary, #3b82f6);
    color: #fff;
}

/* ============ Pagination ============ */
.ps-pagination {
    margin: 40px 0;
    text-align: center;
}
.ps-pagination a, .ps-pagination span {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 2px;
    border-radius: 8px;
    color: var(--ps-text);
    font-size: 0.9rem;
}
.ps-pagination a:hover {
    background: var(--ps-bg-secondary, #f5f7fa);
    color: var(--ps-primary, #3b82f6);
}
.ps-pagination .current {
    background: var(--ps-primary, #3b82f6);
    color: #fff;
}

.ps-load-more {
    display: inline-block;
    padding: 12px 40px;
    background: var(--ps-bg-secondary, #f5f7fa);
    border-radius: 30px;
    color: var(--ps-text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}
.ps-load-more:hover {
    background: var(--ps-primary, #3b82f6);
    color: #fff;
}

.ps-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--ps-text-muted);
}
.ps-empty i {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
}

/* ============ Article Detail ============ */
.ps-article {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

.ps-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--ps-text-muted);
    margin-bottom: 24px;
}
.ps-breadcrumb a {
    color: var(--ps-text-secondary);
}
.ps-breadcrumb a:hover {
    color: var(--ps-primary, #3b82f6);
}

.ps-article-header {
    margin-bottom: 24px;
}

.ps-article-title {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 16px;
    color: var(--ps-text);
}

.ps-article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--ps-text-muted);
}
.ps-article-meta-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.ps-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.ps-meta-item i {
    font-size: 1rem;
}

.ps-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 4px;
    vertical-align: middle;
}

.ps-edit-link {
    color: var(--ps-text-muted);
    font-size: 1.1rem;
}
.ps-edit-link:hover {
    color: var(--ps-primary, #3b82f6);
}

.ps-article-cover {
    margin: 24px 0;
    border-radius: var(--ps-radius);
    overflow: hidden;
}
.ps-article-cover img {
    width: 100%;
    display: block;
    cursor: zoom-in;
}

.ps-article-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--ps-text);
}
.ps-article-content h2, .ps-article-content h3, .ps-article-content h4 {
    margin: 1.5em 0 0.5em;
    font-weight: 700;
}
.ps-article-content h2 { font-size: 1.5rem; }
.ps-article-content h3 { font-size: 1.25rem; }
.ps-article-content p {
    margin: 1em 0;
}
.ps-article-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1em 0;
}
.ps-article-content blockquote {
    border-left: 4px solid var(--ps-primary);
    padding: 12px 20px;
    margin: 1em 0;
    background: var(--ps-bg-secondary, #f5f7fa);
    border-radius: 0 var(--ps-radius-sm) var(--ps-radius-sm) 0;
    color: var(--ps-text-secondary);
}
.ps-article-content code {
    background: var(--ps-bg-secondary, #f5f7fa);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.ps-article-content pre {
    background: #282c34;
    color: #abb2bf;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
    max-width: 100%;
    white-space: pre;
    word-wrap: normal;
    -webkit-overflow-scrolling: touch;
}
.ps-article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    word-break: normal;
    white-space: pre;
    overflow-wrap: normal;
}
.ps-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.ps-article-content table th, .ps-article-content table td {
    border: 1px solid var(--ps-border);
    padding: 10px 14px;
    text-align: left;
}
.ps-article-content table th {
    background: var(--ps-bg-secondary, #f5f7fa);
    font-weight: 600;
}

.ps-article-tags {
    margin: 30px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Article Actions */
.ps-article-actions {
    display: flex;
    gap: 12px;
    margin: 24px 0;
    padding: 16px 0;
    border-top: 1px solid var(--ps-border);
    border-bottom: 1px solid var(--ps-border);
}

.ps-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--ps-border);
    border-radius: 20px;
    color: var(--ps-text-secondary);
    font-size: 0.85rem;
    transition: all 0.2s;
}
.ps-action-btn:hover {
    border-color: var(--ps-primary, #3b82f6);
    color: var(--ps-primary, #3b82f6);
}
.ps-action-btn i {
    font-size: 1rem;
}

/* Author Card */
.ps-author-card {
    margin: 30px 0;
    padding: 24px;
    background: var(--ps-bg-secondary, #f5f7fa);
    border-radius: var(--ps-radius);
}
.ps-author-card-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}
.ps-author-card-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}
.ps-author-card-info {
    flex: 1;
}
.ps-author-card-info h4 {
    margin-bottom: 4px;
}
.ps-author-card-info h4 a {
    color: var(--ps-text);
}
.ps-author-card-desc {
    font-size: 0.85rem;
    color: var(--ps-text-secondary);
}
.ps-author-card-btn {
    flex-shrink: 0;
}

/* Related */
.ps-related {
    margin: 40px 0;
}
.ps-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--ps-text);
}
.ps-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.ps-related-item {
    border-radius: 8px;
    overflow: hidden;
    background: var(--ps-card-bg);
    box-shadow: var(--ps-shadow);
    transition: all 0.2s;
}
.ps-related-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--ps-shadow-hover);
}
.ps-related-cover {
    aspect-ratio: 16/10;
    background-size: cover;
    background-position: center;
    background-color: var(--ps-bg-secondary);
}
.ps-related-no-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--ps-text-muted);
}
.ps-related-info {
    padding: 12px;
}
.ps-related-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--ps-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ps-related-info span {
    font-size: 0.75rem;
    color: var(--ps-text-muted);
}

/* Neighbor */
.ps-neighbor {
    display: flex;
    gap: 16px;
    margin: 30px 0;
}
.ps-neighbor-prev, .ps-neighbor-next {
    flex: 1;
    min-width: 0;
}
.ps-neighbor-prev a,
.ps-neighbor-next a {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: var(--ps-bg-secondary, #f5f7fa);
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
    height: 100%;
}
.ps-neighbor-prev a {
    align-items: flex-start;
}
.ps-neighbor-next a {
    align-items: flex-end;
    text-align: right;
}
.ps-neighbor-prev a:hover,
.ps-neighbor-next a:hover {
    background: var(--ps-primary, #3b82f6);
    color: #fff;
    border-color: var(--ps-primary, #3b82f6);
}
.ps-neighbor-prev a:hover .ps-neighbor-label,
.ps-neighbor-next a:hover .ps-neighbor-label,
.ps-neighbor-prev a:hover .ps-neighbor-title,
.ps-neighbor-next a:hover .ps-neighbor-title {
    color: #fff;
}
.ps-neighbor-label {
    display: block;
    font-size: 0.8rem;
    color: var(--ps-text-muted);
    margin-bottom: 6px;
    white-space: nowrap;
}
.ps-neighbor-title {
    font-size: 0.95rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}
.ps-neighbor-next {
    text-align: right;
}

/* ============ Comments ============ */
.ps-comment-header {
    margin: 30px 0 16px;
}
.ps-comment-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.ps-comment {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--ps-border);
}
.ps-comment-child {
    margin-left: 44px;
    border-bottom: none;
    padding: 12px 0;
}

.ps-comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.ps-comment-body {
    flex: 1;
}
.ps-comment-meta {
    margin-bottom: 6px;
}
.ps-comment-meta strong {
    font-size: 0.9rem;
    color: var(--ps-text);
}
.ps-comment-time {
    font-size: 0.8rem;
    color: var(--ps-text-muted);
    margin-left: 8px;
}
.ps-comment-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--ps-text-secondary);
}
.ps-comment-reply {
    margin-top: 6px;
}
.ps-reply-btn {
    font-size: 0.8rem;
    color: var(--ps-text-muted);
    padding: 4px 8px;
    border-radius: 4px;
}
.ps-reply-btn:hover {
    background: var(--ps-bg-secondary, #f5f7fa);
    color: var(--ps-primary, #3b82f6);
}

.ps-comment-page {
    margin: 16px 0;
    text-align: center;
}

/* Comment Form */
.ps-comment-form-wrap {
    margin: 30px 0;
}
.ps-comment-form-wrap h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}
.ps-comment-form {
    margin: 0;
}
.ps-form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    background: var(--ps-card-bg);
    color: var(--ps-text);
    resize: vertical;
    min-height: 100px;
    outline: none;
}
.ps-form-textarea:focus {
    border-color: var(--ps-primary, #3b82f6);
}
.ps-comment-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}
.ps-form-input {
    flex: 1;
    min-width: 150px;
    padding: 10px 12px;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    background: var(--ps-card-bg);
    color: var(--ps-text);
    outline: none;
}
.ps-form-input:focus {
    border-color: var(--ps-primary, #3b82f6);
}
.ps-captcha {
    margin-top: 12px;
}
.ps-comment-submit {
    margin-top: 16px;
    display: flex;
    gap: 12px;
}
.ps-login-hint {
    font-size: 0.9rem;
    color: var(--ps-text-secondary);
}

/* ============ Sidebar ============ */
.ps-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--ps-header-height) + 20px);
}

.ps-widget {
    background: var(--ps-card-bg);
    border-radius: var(--ps-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--ps-shadow);
}

.ps-widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ps-primary);
    color: var(--ps-text);
}

.ps-widget-list {
    margin: 0;
}
.ps-widget-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--ps-border);
}
.ps-widget-list li:last-child {
    border-bottom: none;
}
.ps-widget-list a {
    color: var(--ps-text-secondary);
    font-size: 0.9rem;
}
.ps-widget-list a:hover {
    color: var(--ps-primary, #3b82f6);
}

.ps-widget-article {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.ps-widget-article-cover {
    width: 60px;
    height: 45px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    background-color: var(--ps-bg-secondary);
}
.ps-widget-article-title {
    flex: 1;
    font-size: 0.85rem;
    color: var(--ps-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ps-widget-content {
    font-size: 0.9rem;
    color: var(--ps-text-secondary);
    line-height: 1.6;
}

.ps-blogger-info {
    text-align: center;
}
.ps-blogger-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}
.ps-blogger-name {
    margin-bottom: 6px;
    font-size: 1rem;
}
.ps-blogger-desc {
    font-size: 0.85rem;
    color: var(--ps-text-secondary);
    line-height: 1.5;
}

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

.ps-sort-list ul {
    padding: 0;
}
.ps-sort-list > li {
    padding: 8px 0;
    border-bottom: 1px solid var(--ps-border);
}
.ps-sort-list > li:last-child {
    border-bottom: none;
}
.ps-sort-list > li > a {
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ps-sort-children {
    padding: 4px 0 0 0;
    margin: 0;
}
.ps-sort-children li {
    padding: 3px 0 3px 16px;
    font-size: 0.85rem;
    color: var(--ps-text-secondary);
}
.ps-sort-children li a {
    color: var(--ps-text-secondary);
}
.ps-sort-children li a:hover {
    color: var(--ps-primary, #3b82f6);
}

/* Calendar full width */
.ps-widget #calendar {
    width: 100%;
}
.ps-widget #calendar table {
    width: 100%;
    border-collapse: collapse;
}
.ps-widget #calendar td,
.ps-widget #calendar th {
    padding: 4px;
    text-align: center;
    font-size: 0.8rem;
}

.ps-comment-widget-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.ps-comment-widget-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}
.ps-comment-widget-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ps-text);
}
.ps-comment-widget-time {
    font-size: 0.75rem;
    color: var(--ps-text-muted);
}
.ps-comment-widget-text {
    display: block;
    width: 100%;
    font-size: 0.85rem;
    color: var(--ps-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.ps-search-form {
    display: flex;
    gap: 4px;
}
.ps-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    background: var(--ps-bg);
    color: var(--ps-text);
    outline: none;
}
.ps-search-input:focus {
    border-color: var(--ps-primary, #3b82f6);
}
.ps-search-btn {
    padding: 8px 14px;
    background: var(--ps-primary, #3b82f6);
    color: #fff;
    border-radius: 8px;
    font-size: 1rem;
}

.ps-archive-select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    background: var(--ps-card-bg);
    color: var(--ps-text);
}

.ps-twitter-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--ps-border);
}
.ps-twitter-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 4px;
}
.ps-twitter-name {
    font-size: 0.85rem;
    font-weight: 600;
}
.ps-twitter-time {
    font-size: 0.75rem;
    color: var(--ps-text-muted);
    margin-left: 6px;
}
.ps-twitter-content {
    font-size: 0.85rem;
    color: var(--ps-text-secondary);
    margin-top: 4px;
}

/* ============ Footer ============ */
.ps-footer {
    margin-top: 60px;
    padding: 30px 0;
    background: var(--ps-bg-secondary, #f5f7fa);
    border-top: 1px solid var(--ps-border);
}

.ps-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.ps-footer-info {
    font-size: 0.85rem;
    color: var(--ps-text-muted);
}
.ps-icp {
    margin-right: 16px;
}
.ps-copyright a {
    color: var(--ps-text-secondary);
}

.ps-footer-links {
    display: flex;
    gap: 12px;
}
.ps-social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--ps-card-bg);
    color: var(--ps-text-secondary);
    font-size: 1.1rem;
    transition: all 0.2s;
}
.ps-social-link:hover {
    background: var(--ps-primary, #3b82f6);
    color: #fff;
}

.ps-footer-custom {
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--ps-text-muted);
}

/* ============ Ad ============ */
/* 首页顶部广告 - 导航栏内全宽 */
.ps-header .ps-ad-top {
    margin: 0;
    padding: 0;
    width: 100%;
    text-align: center;
    background: transparent;
}
.ps-header .ps-ad-top > * {
    max-width: 100%;
}

.ps-ad {
    margin: 16px 0;
    text-align: center;
}

/* ============ Back to top ============ */
.ps-back-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--ps-primary, #3b82f6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.2s;
    z-index: var(--z-sticky);
}
.ps-back-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* ============ Modal ============ */
.ps-modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: var(--z-overlay);
}
.ps-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: var(--z-modal);
    width: 90%;
    max-width: 400px;
}
.ps-modal-card {
    background: var(--ps-card-bg);
    border-radius: var(--ps-radius-lg);
    padding: 30px;
    position: relative;
}
.ps-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.5rem;
    color: var(--ps-text-muted);
    background: none;
    border: none;
    cursor: pointer;
}
.ps-modal-head h3 {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 20px;
}
.ps-modal-alert {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: none;
    font-size: 0.9rem;
}
.ps-modal-alert.ps-alert-error {
    display: block;
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}
.ps-modal-alert.ps-alert-success {
    display: block;
    background: #efe;
    color: #060;
    border: 1px solid #cfc;
}

.ps-form-group {
    margin-bottom: 14px;
}
.ps-form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ps-border);
    border-radius: 8px;
    background: var(--ps-bg);
    color: var(--ps-text);
    outline: none;
}
.ps-form-group input:focus {
    border-color: var(--ps-primary, #3b82f6);
}
.ps-form-captcha {
    display: flex;
    gap: 8px;
}
.ps-form-captcha img {
    height: 40px;
    cursor: pointer;
}
.ps-form-inline {
    display: flex;
    gap: 8px;
}
.ps-form-inline input {
    flex: 1;
}

.ps-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--ps-text-secondary);
    margin-bottom: 16px;
    cursor: pointer;
}
.ps-checkbox input {
    width: auto;
}

.ps-modal-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
}
.ps-modal-switch a {
    margin: 0 8px;
    color: var(--ps-primary, #3b82f6);
}

.ps-login-ext {
    margin-top: 16px;
}

/* ============ Buttons ============ */
.ps-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}
.ps-btn-primary {
    background: var(--ps-primary, #3b82f6);
    color: #fff;
}
.ps-btn-primary:hover {
    background: var(--ps-primary-dark);
    color: #fff;
}
.ps-btn-outline {
    background: transparent;
    border: 1px solid var(--ps-border);
    color: var(--ps-text);
}
.ps-btn-outline:hover {
    border-color: var(--ps-primary, #3b82f6);
    color: var(--ps-primary, #3b82f6);
}
.ps-btn-ghost {
    background: transparent;
    color: var(--ps-text-secondary);
}
.ps-btn-ghost:hover {
    color: var(--ps-primary, #3b82f6);
}
.ps-btn-block {
    display: flex;
    width: 100%;
}

/* ============ Zoomable ============ */
.ps-zoomable {
    cursor: zoom-in;
    transition: transform var(--ps-transition);
}

/* ============ Download Button ============ */
.ps-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--ps-primary, #3b82f6);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none !important;
}

/* ============ Lazyload ============ */
.ps-lazyload {
    opacity: 0;
    transition: opacity 0.4s ease;
}
.ps-lazyload.ps-loaded {
    opacity: 1;
}

/* ============ Page ============ */
.ps-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    .ps-layout-masonry {
        column-count: 2;
    }
    .ps-layout-masonry2 {
        column-count: 2;
    }
    .ps-content-wrap {
        flex-direction: column;
    }
    .ps-sidebar {
        width: 100%;
        position: static;
    }
    .ps-sidebar.ps-collapsed {
        display: none !important;
    }
}

@media (max-width: 768px) {
    :root {
        --ps-header-height: 50px;
    }
    .ps-header-inner {
        height: 50px;
    }

    .ps-menu-toggle {
    .ps-header-inner {
        height: 50px;
    }
        display: flex;
    .ps-header-inner {
        height: 50px;
    }
    }
    .ps-header-inner {
        height: 50px;
    }

    /* 导航移出 header，独立定位 */
    .ps-nav-wrap {
        position: fixed;
        top: var(--ps-header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--ps-card-bg);
        z-index: var(--z-max);
        transform: translateX(-100%);
        transition: transform var(--ps-transition);
        padding: 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .ps-nav-wrap.ps-open {
        transform: translateX(0);
    }
    .ps-nav-list {
        flex-direction: column;
        align-items: stretch;
    }
    .ps-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding-left: 16px;
    }

    .ps-layout-masonry {
        column-count: 2;
    }

    .ps-layout-list .ps-card {
        flex-direction: column;
    }
    .ps-layout-list .ps-card-cover {
        width: 100%;
        min-width: auto;
        height: 200px;
        aspect-ratio: auto;
    }

    .ps-hero-slider {
        aspect-ratio: 16/9;
    }

    .ps-article-title {
        font-size: 1.4rem;
    }

    .ps-neighbor {
        flex-direction: column;
    }
    .ps-neighbor-next {
        text-align: left;
    }

    .ps-author-card-inner {
        flex-wrap: wrap;
    }
    .ps-author-card-btn {
        width: 100%;
        text-align: center;
    }

    .ps-back-top {
        bottom: 20px;
        right: 20px;
    }

    .ps-toolbar {
        flex-direction: row;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: wrap;
    }

    /* 手机端隐藏版面切换 */
    .ps-layout-switcher {
        display: flex; gap: 4px;
    }

    .ps-style-switcher {
        gap: 4px;
    }

    .ps-switcher-label {
        font-size: 0.7rem;
    }

    .ps-style-btn {
        width: 18px;
        height: 18px;
    }

    .ps-toggle-btn {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }

    .ps-toolbar-divider {
        height: 14px;
    }

    /* 手机端导航层级最高 */
    .ps-nav-wrap {
        z-index: var(--z-search);
    }

    .ps-nav-wrap.ps-open {
        background: var(--ps-card-bg);
    }

    /* 手机端侧边栏 */
    .ps-sidebar {
        width: 100%;
        position: static;
    }
}

@media (max-width: 480px) {
    .ps-card-cover {
        aspect-ratio: 3/2;
    }

    .ps-article-actions {
        flex-wrap: wrap;
    }

    .ps-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============ Dark Mode ============ */
/* CSS变量由JS内联设置（最高优先级），此处定义元素样式 */
html[data-theme="dark"] body {
    background: var(--ps-bg, #0a0a0a) !important;

/* Override CSS variables for dark mode */
html[data-theme="dark"] {
    --ps-bg: #0a0a0a;
    --ps-bg-secondary: #141414;
    --ps-card-bg: #1a1a1a;
    --ps-text: #e8e8e8;
    --ps-text-secondary: #999;
    --ps-text-muted: #555;
    --ps-border: #2a2a2a;
}
    color: var(--ps-text, #e8e8e8);
}
html[data-theme="dark"] .ps-header {
    background: var(--ps-card-bg, #1a1a1a) !important;
    border-bottom-color: var(--ps-border, #2a2a2a) !important;
}
html[data-theme="dark"] .ps-card,
html[data-theme="dark"] .ps-widget {
    background: var(--ps-card-bg, #1a1a1a);
    border-color: var(--ps-border, #2a2a2a);
}
html[data-theme="dark"] .ps-card:hover {
    border-color: var(--ps-primary, #00e5a0);
    box-shadow: 0 0 20px rgba(0,229,160,0.1);
}
html[data-theme="dark"] .ps-footer {
    background: var(--ps-bg-secondary, #141414) !important;
    border-top-color: var(--ps-border, #2a2a2a);
}
html[data-theme="dark"] .ps-modal-card {
    background: var(--ps-card-bg, #1a1a1a);
    border: 1px solid var(--ps-border, #2a2a2a);
}
html[data-theme="dark"] .ps-article-content {
    color: var(--ps-text, #e8e8e8);
}
html[data-theme="dark"] .ps-article-content pre {
    background: var(--ps-bg-secondary, #141414);
    border: 1px solid var(--ps-border, #2a2a2a);
}
html[data-theme="dark"] .ps-search-bar,
html[data-theme="dark"] .ps-hero {
    background: var(--ps-bg-secondary, #141414);
}
html[data-theme="dark"] .ps-hero-title {
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
}
html[data-theme="dark"] .ps-nav-wrap {
    background: var(--ps-card-bg, #1a1a1a);
}
html[data-theme="dark"] .ps-dropdown-menu {
    background: var(--ps-card-bg, #1a1a1a);
    border-color: var(--ps-border, #2a2a2a);
}
html[data-theme="dark"] .ps-dropdown-menu li a:hover {
    background: var(--ps-bg-secondary, #141414);
}
html[data-theme="dark"] .ps-breadcrumb,
html[data-theme="dark"] .ps-card-meta,
html[data-theme="dark"] .ps-card-footer,
html[data-theme="dark"] .ps-neighbor-label,
html[data-theme="dark"] .ps-comment-time,
html[data-theme="dark"] .ps-meta-item {
    color: var(--ps-text-muted, #555);
}
html[data-theme="dark"] .ps-form-textarea,
html[data-theme="dark"] .ps-form-input,
html[data-theme="dark"] .ps-search-input,
html[data-theme="dark"] .ps-search-bar-input,
html[data-theme="dark"] .ps-archive-select {
    background: var(--ps-bg-secondary, #141414);
    border-color: var(--ps-border, #2a2a2a);
    color: var(--ps-text, #e8e8e8);
}
html[data-theme="dark"] .ps-action-btn,
html[data-theme="dark"] .ps-btn-outline {
    border-color: var(--ps-border, #2a2a2a);
    color: var(--ps-text-secondary, #999);
}
html[data-theme="dark"] .ps-tag {
    background: rgba(0,229,160,0.1);
    color: #00e5a0;
    border-color: transparent;
}
html[data-theme="dark"] img {
    opacity: 0.92;
}
html[data-theme="dark"] img:hover {
    opacity: 1;
}
/* Pagination dark mode */
html[data-theme="dark"] .ps-pagination a,
html[data-theme="dark"] .ps-pagination span {
    color: #e8e8e8;
}
html[data-theme="dark"] .ps-pagination a:hover {
    background: #222;
    color: #00e5a0;
}
html[data-theme="dark"] .ps-pagination .current {
    background: var(--ps-primary, #00e5a0);
    color: #000;
}
/* ============ Mobile Bottom Navigation ============ */
.ps-bottom-nav {
    display: none;
}
.ps-mobile-panel {
    display: none;
}
.ps-mobile-panel-header {
    display: none;
}
.ps-mobile-sort-item {
    display: none;
}

@media (max-width: 768px) {
    .ps-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: var(--z-toast);
        background: var(--ps-card-bg, #fff);
        border-top: 1px solid var(--ps-border, #e5e5e5);
        padding: 6px 0 env(safe-area-inset-bottom, 8px);
        justify-content: space-around;
        align-items: center;
    }
    .ps-bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        padding: 4px 0;
        color: var(--ps-text-muted, #999);
        font-size: 0.65rem;
        text-decoration: none;
        transition: color 0.2s;
        gap: 2px;
    }
    .ps-bottom-nav-item i {
        font-size: 1.2rem;
    }
    .ps-bottom-nav-item.ps-active,
    .ps-bottom-nav-item:active {
        color: var(--ps-primary, #3b82f6);
    }

    /* 底部留出导航空间 */
    .ps-footer {
        padding-bottom: 70px;
    }
    .ps-back-top {
        bottom: 75px !important;
    }

    /* 分类弹出面板 */
    .ps-mobile-panel {
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: var(--z-max);
        background: var(--ps-card-bg, #fff);
        border-radius: 16px 16px 0 0;
        max-height: 60vh;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        animation: slideUp 0.25s ease;
    }
    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    .ps-mobile-panel.ps-open {
        display: block !important;
    }
    .ps-mobile-panel-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid var(--ps-border, #e5e5e5);
        font-weight: 700;
        font-size: 1rem;
    }
    .ps-mobile-panel-close {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: var(--ps-bg-secondary, #f5f5f5);
        font-size: 1.2rem;
        color: var(--ps-text-muted, #999);
    }
    .ps-mobile-panel-body {
        padding: 12px 20px;
        overflow-y: auto;
        max-height: calc(60vh - 56px);
    }
    .ps-mobile-sort-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        border-bottom: 1px solid var(--ps-border, #e5e5e5);
        color: var(--ps-text, #333);
        font-size: 0.95rem;
        text-decoration: none;
    }
    .ps-mobile-sort-item:last-child {
        border-bottom: none;
    }
    .ps-mobile-sort-child {
        padding-left: 20px;
        font-size: 0.85rem;
        color: var(--ps-text-secondary, #666);
    }
    .ps-mobile-sort-count {
        background: var(--ps-bg-secondary, #f5f5f5);
        color: var(--ps-text-muted, #999);
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 0.75rem;
    }
}
/* ============ TOC 文章目录 ============ */
.ps-toc-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}
.ps-toc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--ps-card-bg, #fff);
    border: 1px solid var(--ps-border, #e8e8e8);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--ps-text, #333);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s;
    user-select: none;
}
.ps-toc-toggle:hover {
    background: var(--ps-primary, #3b82f6);
    color: #fff;
    border-color: var(--ps-primary, #3b82f6);
}
.ps-toc-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background: var(--ps-card-bg, #fff);
    border: 1px solid var(--ps-border, #e8e8e8);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    width: 280px;
    max-height: 60vh;
    overflow-y: auto;
    z-index: var(--z-sticky);
    animation: ps-toc-fade-in 0.2s ease;
}
@keyframes ps-toc-fade-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.ps-toc-wrap.ps-toc-open .ps-toc-panel {
    display: block;
}
.ps-toc-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--ps-border, #e8e8e8);
    position: sticky;
    top: 0;
    background: var(--ps-card-bg, #fff);
    z-index: 1;
}
.ps-toc-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ps-text, #333);
}
.ps-toc-close {
    background: none;
    border: none;
    color: var(--ps-text-secondary, #999);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px;
}
.ps-toc-close:hover { color: var(--ps-text, #333); }
.ps-toc-list {
    padding: 8px 0;
}
.ps-toc-item {
    display: block;
    padding: 6px 16px;
    font-size: 0.82rem;
    color: var(--ps-text-secondary, #666);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    line-height: 1.5;
}
.ps-toc-item:hover {
    color: var(--ps-primary, #3b82f6);
    background: var(--ps-bg-secondary, #f5f5f5);
}
.ps-toc-item.ps-toc-active {
    color: var(--ps-primary, #3b82f6);
    border-left-color: var(--ps-primary, #3b82f6);
    background: var(--ps-bg-secondary, #f5f5f5);
}
.ps-toc-h3 {
    padding-left: 28px;
    font-size: 0.78rem;
}
.ps-toc-h4 {
    padding-left: 40px;
    font-size: 0.75rem;
}

/* Code Highlight - Prism.js overrides */
.ps-article-content pre[class*="language-"] {
    border-radius: 8px;
    margin: 16px 0;
    font-size: 0.85rem;
    line-height: 1.6;
}
.ps-article-content code[class*="language-"] {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
}
.ps-article-content :not(pre) > code {
    background: var(--ps-bg-secondary, #f0f0f0);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--ps-primary, #e83e8c);
}
/* Toolbar (copy button) */
div.code-toolbar > .toolbar {
    opacity: 0.8;
}
div.code-toolbar > .toolbar button {
    font-size: 0.75rem;
}

/* Dark mode TOC */
html[data-theme="dark"] .ps-toc-toggle,
html[data-theme="dark"] .ps-toc-panel,
html[data-theme="dark"] .ps-toc-head {
    background: #141414;
    border-color: #333;
    color: #e8e8e8;
}
html[data-theme="dark"] .ps-toc-title,
html[data-theme="dark"] .ps-toc-close {
    border-color: #333;
    color: #e8e8e8;
}
html[data-theme="dark"] .ps-toc-item {
    color: #999;
}
html[data-theme="dark"] .ps-toc-item:hover,
html[data-theme="dark"] .ps-toc-item.ps-toc-active {
    color: #00e5a0;
    background: #1a1a1a;
    border-left-color: #00e5a0;
}

/* Responsive - hide TOC on mobile only */
@media (max-width: 768px) {
    .ps-toc-wrap {
        display: none !important;
    }
}

/* ============ Emoji Picker ============ */
.ps-emoji-wrap {
    position: relative;
    display: inline-block;
}
.ps-emoji-btn {
    background: none;
    border: 1px solid var(--ps-border, #ddd);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--ps-text-secondary, #666);
    transition: all 0.2s;
    margin-right: 8px;
}
.ps-emoji-btn:hover {
    border-color: var(--ps-primary, #3b82f6);
    color: var(--ps-primary, #3b82f6);
}
.ps-emoji-panel {
    position: absolute;
    top: 100%; bottom: auto;
    left: 0;
    background: var(--ps-card-bg, #fff);
    border: 1px solid var(--ps-border, #ddd);
    border-radius: 8px;
    padding: 12px;
    width: 320px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: var(--z-overlay);
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}
.ps-emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
    border: none;
    background: none;
}
.ps-emoji-item:hover {
    background: var(--ps-bg-secondary, #f0f0f0);
    transform: scale(1.2);
}
/* Dark mode emoji */
html[data-theme="dark"] .ps-emoji-panel {
    background: #1a1a1a;
    border-color: #333;
}
html[data-theme="dark"] .ps-emoji-item:hover {
    background: #2a2a2a;
}

/* ============ Download Button Enhanced ============ */
.ps-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--ps-primary, #3b82f6), #0284c7);
    color: #fff;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102,126,234,0.3);
    margin: 8px 0;
}
.ps-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102,126,234,0.4);
    color: #fff;
}
.ps-download-btn i {
    font-size: 1.1rem;
}
.ps-pwd-box {
    background: var(--ps-bg-secondary, #f5f7fa);
    border: 1px solid var(--ps-border, #e8e8e8);
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
}

/* ============ Film Strip Gallery ============ */
.ps-photos-header {
    text-align: center;
    padding: 40px 0 20px;
}
.ps-page-title {
    font-size: 1.8rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.ps-page-desc {
    color: var(--ps-text-secondary, #888);
    font-size: 0.9rem;
}
/* ============ 点赞按钮已赞状态 ============ */
.ps-like-btn.ps-liked {
    color: #e74c3c !important;
    pointer-events: none;
    opacity: 0.85;
}
.ps-like-btn.ps-liked i {
    color: #e74c3c;
}
/* ============ Pjax Loading Indicator ============ */
.ps-pjax-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--ps-primary, #3b82f6);
    z-index: var(--z-lightbox);
    transition: width 0.3s;
    animation: pjax-loading 1s ease-in-out infinite;
}
@keyframes pjax-loading {
    0% { width: 0; left: 0; }
    50% { width: 60%; left: 20%; }
    100% { width: 0; left: 100%; }
}
.ps-content-main {
    transition: opacity 0.2s ease;
}
/* ============ Hero 轮播图版面（全宽/双栏） ============ */

.ps-hero {
    position: relative;
    overflow: hidden;
}

/* 全宽模式 */
.ps-hero-full .ps-hero-slider {
    width: 100%;
}

/* 双栏模式 */
.ps-hero-dual {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.ps-hero-dual .ps-hero-main {
    flex: 1;
    min-width: 0;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    display: flex;
    align-items: stretch;
}

.ps-hero-dual .ps-hero-slider {
    width: 100%;
    aspect-ratio: auto;
    min-height: 200px;
    height: 100%;
}

.ps-hero-dual .ps-hero-slide {
    height: 100%;
}
.ps-hero-dual .ps-hero-img {
    height: 100%;
}
.ps-hero-dual .ps-hero-prev,
.ps-hero-dual .ps-hero-next {
    /* 箭头在双栏模式下调整位置 */
}

/* 右侧栏 */
.ps-hero-side {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ps-hero-side-box {
    background: var(--ps-card-bg, #fff);
    border: 1px solid var(--ps-border, #e5e5e5);
    border-radius: 12px;
    padding: 16px;
    flex: 1;
}

.ps-hero-side-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ps-border, #e5e5e5);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ps-hero-side-title i {
    color: var(--ps-primary, #3b82f6);
}

.ps-hero-side-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--ps-text-secondary, #666);
}

.ps-hero-side-content a {
    color: var(--ps-primary, #3b82f6);
    text-decoration: none;
}

.ps-hero-side-content a:hover {
    text-decoration: underline;
}

.ps-hero-side-content p {
    margin: 0 0 8px;
}

.ps-hero-side-content ul,
.ps-hero-side-content ol {
    margin: 0;
    padding-left: 20px;
}

.ps-hero-side-content li {
    margin-bottom: 4px;
}

.ps-hero-side-ad {
    flex: none;
}

.ps-hero-side-ad img {
    max-width: 100%;
    border-radius: 8px;
}

/* 响应式 */
@media (max-width: 768px) {
    .ps-hero-dual {
        flex-direction: column;
    }

    .ps-hero-side {
        width: 100%;
    }

    .ps-hero-dual .ps-hero-main {
        border-radius: 8px;
    }
}
/* ============ Hero 双栏暗色模式 ============ */
html[data-theme=dark] .ps-hero-side-box {
    background: #141414 !important;
    border-color: #2a2a2a !important;
}
html[data-theme=dark] .ps-hero-side-title {
    border-color: #2a2a2a !important;
    color: #e8e8e8 !important;
}
html[data-theme=dark] .ps-hero-side-content {
    color: #999 !important;
}
html[data-theme=dark] .ps-hero-side-content a {
    color: #00e5a0 !important;
}
/* ============ 侧栏广告位 ============ */
.ps-widget-ad {
    margin-bottom: 16px;
}
.ps-widget-ad > div {
    border-radius: 8px;
    overflow: hidden;
}
.ps-widget-ad img {
    max-width: 100%;
    border-radius: 8px;
}

/* 横幅广告 */
.ps-ad-banner {
    margin: 16px 0;
    border-radius: 10px;
    overflow: hidden;
}
.ps-ad-banner img {
    max-width: 100%;
    border-radius: 10px;
}


/* === 移动端fixed元素优化 === */
@media (max-width: 768px) {
    /* 底部导航与返回顶部不重叠 */
    .ps-back-top {
        bottom: 80px;
        right: 16px;
    }

    /* 搜索弹窗适配 */
    .ps-search-bar {
        top: 56px;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
    }

    /* 模态框适配键盘 */
    .ps-modal {
        top: 40%;
        max-height: 80vh;
        overflow-y: auto;
    }

    /* 灯箱适配 */
    .ps-lightbox-overlay {
        z-index: var(--z-lightbox);
    }

    /* 确保底部导航在最上层 */
    .ps-bottom-nav {
        z-index: var(--z-sticky);
    }
}

/* === 移动端轮播图修复 === */
@media (max-width: 768px) {
    .ps-hero-full .ps-hero-slider {
        aspect-ratio: 16/9;
    }
    .ps-hero-slide {
        background-size: cover;
        background-position: center;
    }
    .ps-hero-slide .ps-hero-img {
        background-size: cover;
        background-position: center;
    }
}

/* 分类面板点击后自动关闭 */
.ps-mobile-sort-item {
    cursor: pointer;
}

/* ============ Skip Navigation (Accessibility) ============ */
.ps-skip-nav {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9999;
    padding: 10px 15px;
    background: var(--ps-primary-color, #3b82f6);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    border-radius: 0 0 4px 0;
}
.ps-skip-nav:focus {
    left: 0;
}

/* ============ Timeline Layout 增强 ============ */
.ps-layout-timeline {
    position: relative;
    padding: 0 0 0 50px !important;
}

/* 竖线 - 更明显 */
.ps-layout-timeline::before {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    left: 22px !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 3px !important;
    background: linear-gradient(to bottom, var(--ps-primary, #3b82f6), var(--ps-primary, #3b82f6) 50%, var(--ps-border, #e0e0e0)) !important;
    border-radius: 2px !important;
    z-index: 0 !important;
}

/* 时间节点圆点 - 更大更明显 */
.ps-layout-timeline .ps-card::before {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    left: -35px !important;
    top: 28px !important;
    width: 14px !important;
    height: 14px !important;
    border-radius: 50% !important;
    background: var(--ps-primary, #3b82f6) !important;
    border: 3px solid #fff !important;
    box-shadow: 0 0 0 3px var(--ps-primary, #3b82f6), 0 2px 8px rgba(0,0,0,0.15) !important;
    z-index: 1 !important;
}

/* 暗色模式 */
html[data-theme="dark"] .ps-layout-timeline::before {
    background: linear-gradient(to bottom, var(--ps-primary, #3b82f6), var(--ps-primary, #3b82f6) 50%, #333) !important;
}
html[data-theme="dark"] .ps-layout-timeline .ps-card::before {
    border-color: #1a1a1a !important;
}

/* 移动端调整 */
@media (max-width: 768px) {
    .ps-layout-timeline {
        padding-left: 35px !important;
    }
    .ps-layout-timeline::before {
        left: 12px !important;
    }
    .ps-layout-timeline .ps-card::before {
        left: -28px !important;
        width: 12px !important;
        height: 12px !important;
    }
}

/* 时间线布局卡片不能裁剪圆点 */
.ps-layout-timeline .ps-card {
    overflow: visible !important;
}
.ps-layout-timeline .ps-card-cover {
    overflow: hidden !important;
}

/* 移动端版面切换按钮样式 */
@media (max-width: 768px) {
    .ps-layout-switcher {
        display: flex !important;
        gap: 4px !important;
        flex-wrap: wrap !important;
        align-items: center !important;
    }
    .ps-layout-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 14px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .ps-switcher-label {
        font-size: 12px !important;
        margin-right: 4px !important;
    }
}
/* === 版面切换按钮移动端可见性修复 === */
@media (max-width: 768px) {
    .ps-layout-btn {
        border: 1px solid var(--ps-border, #ddd) !important;
        background: var(--ps-card-bg, #fff) !important;
    }
    .ps-layout-btn.ps-active {
        border-color: var(--ps-primary, #3b82f6) !important;
        background: var(--ps-bg-secondary, #f5f7fa) !important;
    }
}


/* 移动端工具栏：版面和风格各占一行 */
@media (max-width: 768px) {
    .ps-toolbar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        flex-wrap: wrap !important;
    }
    .ps-layout-switcher {
        display: flex !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        width: 100% !important;
    }
    .ps-toolbar-right {
        display: flex !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        width: 100% !important;
    }
    .ps-layout-btn {
        width: 30px !important;
        height: 30px !important;
        font-size: 14px !important;
    }
    .ps-style-btn {
        width: 22px !important;
        height: 22px !important;
    }
    .ps-switcher-label {
        font-size: 12px !important;
        min-width: 30px !important;
    }
}
