/**
 * StickerFly Main Styles
 * 参考 chpic.su 的现代化设计风格
 */

/* ============================================
   全局样式
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   加载动画
   ============================================ */
#pjax-loader {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(12, 16, 24, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 2000;
}

#pjax-loader.loading {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

#pjax-loader .pjax-loader__inner {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 28px;
    background: rgba(24, 28, 36, 0.6);
    box-shadow: 0 22px 60px rgba(9, 12, 20, 0.45);
    overflow: hidden;
}

#pjax-loader .pjax-loader__ring {
    position: absolute;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-color, #0088cc);
    border-right-color: rgba(255, 255, 255, 0.45);
    animation: pjax-spin 0.9s linear infinite;
    box-shadow: 0 0 20px rgba(0, 136, 204, 0.35);
}

#pjax-loader .pjax-loader__glow {
    position: absolute;
    width: 160%;
    height: 160%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, rgba(0, 136, 204, 0.05) 55%, rgba(0, 136, 204, 0) 70%);
    opacity: 0.45;
    animation: pjax-pulse 1.8s ease-in-out infinite;
}

#pjax-loader .pjax-loader__emoji {
    position: relative;
    font-size: 38px;
    z-index: 1;
    animation: pjax-bounce 1.4s ease-in-out infinite;
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.2));
}

#pjax-loader .pjax-loader__text {
    margin-top: 24px;
    font-size: 12px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
    text-indent: 0.32em;
}

@keyframes pjax-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pjax-pulse {
    0%, 100% { opacity: 0.35; transform: scale(0.9); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

@keyframes pjax-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#pjax-content {
    transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}

#pjax-content.pjax-loading {
    filter: blur(2px);
    transform: scale(0.995);
    opacity: 0.7;
    pointer-events: none;
}

/* ============================================
   Header 头部样式
   ============================================ */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.site-header.header-hidden {
    transform: translateY(-100%);
}

.header-top {
    padding: 20px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

/* Logo 和站点标题 */
.site-branding {
    flex-shrink: 0;
}

.site-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.site-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.site-title a:hover {
    color: var(--primary-color, #0088cc);
}

.site-description {
    margin: 5px 0 0;
    font-size: 13px;
    color: #999;
}

/* 导航菜单 */
.main-navigation {
    flex: 1;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 10px 16px;
    color: #666;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a {
    color: var(--primary-color, #0088cc);
    background: rgba(0, 136, 204, 0.08);
}

/* 子菜单 */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.nav-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu a {
    padding: 10px 14px;
}

/* 菜单切换按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle .menu-icon,
.menu-toggle .menu-icon::before,
.menu-toggle .menu-icon::after {
    width: 24px;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s;
}

.menu-toggle .menu-icon {
    position: relative;
}

.menu-toggle .menu-icon::before,
.menu-toggle .menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
}

.menu-toggle .menu-icon::before { top: -8px; }
.menu-toggle .menu-icon::after { bottom: -8px; }

.menu-toggle.active .menu-icon { background: transparent; }
.menu-toggle.active .menu-icon::before { 
    top: 0;
    transform: rotate(45deg);
}
.menu-toggle.active .menu-icon::after { 
    bottom: 0;
    transform: rotate(-45deg);
}

html[data-theme="dark"] .menu-toggle .menu-icon,
html[data-theme="dark"] .menu-toggle .menu-icon::before,
html[data-theme="dark"] .menu-toggle .menu-icon::after {
    background: #e2e8f0;
}

/* 移动端导航 - 默认隐藏 */
.mobile-navigation {
    display: none;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
}

.language-switcher__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #4a4a4a;
    text-decoration: none;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.language-switcher__btn:hover {
    color: var(--primary-color, #0088cc);
}

.language-switcher__btn.is-active {
    background: linear-gradient(135deg, #667eea 0%, #0088cc 100%);
    color: #fff;
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.28);
}

.theme-switch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    color: #444;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.theme-switch:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 136, 204, 0.18);
    color: var(--primary-color, #0088cc);
}

.theme-switch__icon {
    font-size: 16px;
    line-height: 1;
}

.theme-switch__icon--moon {
    display: none;
}

html[data-theme="dark"] .theme-switch .theme-switch__icon--sun {
    display: none;
}

html[data-theme="dark"] .theme-switch .theme-switch__icon--moon {
    display: inline;
}

.search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: #666;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.search-toggle:hover {
    background: rgba(0, 136, 204, 0.08);
    color: var(--primary-color, #0088cc);
}

/* 搜索框 */
.search-form-wrapper {
    max-height: 0;
    overflow: hidden;
    background: #f8f9fa;
    transition: max-height 0.3s ease;
}

.search-form-wrapper.active {
    max-height: 100px;
    border-bottom: 1px solid #e0e0e0;
}

.search-form-wrapper .container {
    padding-top: 20px;
    padding-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.search-field {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 15px;
    background: #fff;
    transition: all 0.3s;
}

.search-field:focus {
    outline: none;
    border-color: var(--primary-color, #0088cc);
    box-shadow: 0 0 0 4px rgba(0, 136, 204, 0.1);
}

.search-submit {
    padding: 12px 30px;
    background: var(--primary-color, #0088cc);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.search-submit:hover {
    background: var(--primary-color-dark, #006699);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

/* ============================================
   Main Content 主内容区
   ============================================ */
.site-main {
    min-height: 60vh;
}

.pjax-container {
    transition: opacity 0.3s ease;
}

/* ============================================
   面包屑导航
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px 0;
    font-size: 14px;
    color: #999;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-color, #0088cc);
}

.breadcrumb .separator {
    color: #ccc;
}

.breadcrumb .current {
    color: var(--primary-color, #0088cc);
}

/* ============================================
   文章卡片布局
   ============================================ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.post-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.post-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

/* 文章缩略图 */
.post-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 60%; /* 16:10 比例 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.08);
}

/* 文章内容 */
.post-content {
    padding: 24px;
}

.post-title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
}

.post-excerpt {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.7;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 文章元信息 */
.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #999;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-meta-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.post-category {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 136, 204, 0.08);
    color: var(--primary-color, #0088cc);
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.post-category:hover {
    background: var(--primary-color, #0088cc);
    color: #fff;
}

/* ============================================
   分页导航
   ============================================ */
.pagination-wrapper {
    margin: 60px 0 40px;
    text-align: center;
}

.pagination-wrapper .page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
}

.pagination-wrapper .page-numbers li {
    display: inline-block;
}

.pagination-wrapper a,
.pagination-wrapper span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    color: #666;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination-wrapper a:hover {
    border-color: var(--primary-color, #0088cc);
    color: var(--primary-color, #0088cc);
    background: rgba(0, 136, 204, 0.05);
}

.pagination-wrapper .current {
    background: var(--primary-color, #0088cc);
    border-color: var(--primary-color, #0088cc);
    color: #fff;
}

.pagination-wrapper .dots {
    border: none;
    background: none;
}

/* ============================================
   Sidebar 侧边栏
   ============================================ */
.sidebar {
    padding: 40px 0;
}

.widget {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.widget-title {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget li {
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.widget a:hover {
    color: var(--primary-color, #0088cc);
}

/* ============================================
   Footer 页脚样式
   ============================================ */
.site-footer {
    background: #2c3e50;
    color: #ecf0f1;
    margin-top: 60px;
}

.footer-widgets {
    padding: 60px 0 40px;
}

.footer-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-widget-area .widget {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
}

.footer-widget-area .widget-title {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.footer-widget-area a {
    color: #bdc3c7;
}

.footer-widget-area a:hover {
    color: #fff;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: 24px 0;
}

.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info {
    font-size: 14px;
    color: #95a5a6;
}

.footer-info a {
    color: #ecf0f1;
    text-decoration: none;
}

.footer-info a:hover {
    color: #fff;
}

.footer-menu {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-menu a {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 14px;
}

.footer-menu a:hover {
    color: #fff;
}

/* ============================================
   返回顶部按钮
   ============================================ */
.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color, #0088cc);
    color: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 136, 204, 0.3);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-color-dark, #006699);
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 136, 204, 0.4);
}

/* ============================================
   Dark Theme Overrides
   ============================================ */
html[data-theme="dark"] body {
    background: #0f172a;
    color: #e2e8f0;
}

html[data-theme="dark"] a {
    color: #60a5fa;
}

html[data-theme="dark"] .site-header {
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 22px 45px rgba(2, 6, 23, 0.45);
}

html[data-theme="dark"] .header-top {
    background: rgba(15, 23, 42, 0.72);
}

html[data-theme="dark"] .site-title a,
html[data-theme="dark"] .site-description {
    color: #e2e8f0;
}

html[data-theme="dark"] .nav-menu a {
    color: #cbd5f5;
}

html[data-theme="dark"] .nav-menu a:hover {
    color: #60a5fa;
}

html[data-theme="dark"] .search-toggle {
    color: #94a3b8;
}

html[data-theme="dark"] .search-toggle:hover {
    background: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
}

html[data-theme="dark"] .language-switcher {
    background: rgba(30, 41, 59, 0.85);
    box-shadow: none;
}

html[data-theme="dark"] .language-switcher__btn {
    color: #cbd5f5;
}

html[data-theme="dark"] .language-switcher__btn.is-active {
    background: linear-gradient(135deg, #60a5fa 0%, #7c3aed 100%);
    box-shadow: 0 14px 30px rgba(76, 110, 245, 0.35);
}

html[data-theme="dark"] .theme-switch {
    background: rgba(30, 41, 59, 0.85);
    color: #e2e8f0;
    box-shadow: none;
}

html[data-theme="dark"] .theme-switch:hover {
    color: #60a5fa;
}

html[data-theme="dark"] .search-form-wrapper {
    background: rgba(15, 23, 42, 0.92);
    border-bottom-color: rgba(99, 102, 241, 0.25);
}

html[data-theme="dark"] .search-field {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
}

html[data-theme="dark"] .search-field::placeholder {
    color: #94a3b8;
}

html[data-theme="dark"] .search-submit {
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

html[data-theme="dark"] .search-submit:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
}

html[data-theme="dark"] .breadcrumb {
    color: #94a3b8;
}

html[data-theme="dark"] .breadcrumb a {
    color: #cbd5f5;
}

html[data-theme="dark"] .footer-bottom {
    background: rgba(15, 23, 42, 0.9);
}

html[data-theme="dark"] .footer-bottom p,
html[data-theme="dark"] .footer-menu a {
    color: #94a3b8;
}

html[data-theme="dark"] .footer-menu a:hover {
    color: #f8fafc;
}

html[data-theme="dark"] .back-to-top {
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
}

/* ============================================
   响应式断点
   ============================================ */
@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .header-top {
        padding: 15px 0;
    }

    .header-inner {
        flex-wrap: wrap;
        gap: 15px;
    }

    .menu-toggle {
        display: flex;
        order: 3;
    }

    .main-navigation {
        order: 4;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .main-navigation.active {
        max-height: 500px;
    }

    .nav-menu {
        flex-direction: column;
        padding: 20px 0;
    }

    .nav-menu a {
        padding: 12px 16px;
    }

    .nav-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: 20px;
        margin-top: 8px;
    }

    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

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

    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }

    .back-to-top {
        right: 20px;
        bottom: 20px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-title {
        font-size: 18px;
    }

    .site-title {
        font-size: 18px;
    }

    .language-switcher {
        padding: 3px;
        gap: 2px;
    }

    .language-switcher__btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .theme-switch {
        width: 36px;
        height: 36px;
    }

    .theme-switch__icon {
        font-size: 14px;
    }

    .search-toggle {
        width: 36px;
        height: 36px;
    }

    .search-toggle svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   辅助类
   ============================================ */
.text-center {
    text-align: center;
}

.no-posts {
    padding: 80px 20px;
    text-align: center;
    font-size: 16px;
    color: #999;
}
