/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://zephyrus-9527.cc
 Description:  Zephyrus Blog 自定义子主题 - 动态元素增强版
 Author:       Zephyrus
 Author URI:   https://zephyrus-9527.cc
 Template:     generatepress
 Version:      1.1.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  generatepress-child
*/

/* =========================================
   CSS 变量
   ========================================= */
:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-light: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-hover: 0 12px 40px rgba(99, 102, 241, 0.2);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   全局样式
   ========================================= */
body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* =========================================
   顶部渐变条动画
   ========================================= */
.site-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, #a855f7 100%) !important;
    background-size: 200% 200% !important;
    animation: gradientShift 8s ease infinite !important;
    padding: 2rem 0 !important;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shine 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes shine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

/* 顶部标题样式 */
.site-header .site-branding .site-title,
.site-header .site-branding .site-title a {
    color: #ffffff !important;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-size: 1.8rem;
    animation: fadeInDown 0.8s ease;
}

.site-header .site-branding .site-description {
    color: rgba(255,255,255,0.9) !important;
    font-size: 0.95rem;
    animation: fadeInDown 0.8s ease 0.2s both;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Logo 样式 */
.custom-logo-link img {
    max-height: 60px !important;
    width: auto;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.custom-logo-link img:hover {
    transform: scale(1.1) rotate(5deg);
}

/* =========================================
   导航菜单动态效果
   ========================================= */
.main-navigation {
    background: rgba(255,255,255,0.98) !important;
    backdrop-filter: blur(10px);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.main-navigation a {
    color: var(--text-dark) !important;
    font-weight: 500;
    transition: var(--transition-smooth);
    padding: 0.8em 1em !important;
    position: relative;
}

/* 导航链接下划线动画 */
.main-navigation .main-nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.main-navigation .main-nav ul li a:hover::after,
.main-navigation .main-nav ul li[class*="current-menu-"] a::after {
    width: 80%;
}

.main-navigation a:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

/* 当前菜单项 */
.main-navigation .main-nav ul li[class*="current-menu-"] > a {
    color: var(--primary-color) !important;
    background: rgba(99, 102, 241, 0.1) !important;
}

/* =========================================
   文章卡片动态效果
   ========================================= */
.post-image-fixed-height {
    height: 220px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.post-image-fixed-height::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(99, 102, 241, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.post-image-fixed-height:hover::before {
    opacity: 1;
}

.post-image-fixed-height img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-image-fixed-height:hover img {
    transform: scale(1.12) rotate(1deg);
}

/* 特色图片角标 */
.post-image-fixed-height::after {
    content: '📖';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    opacity: 0;
    transform: scale(0) rotate(-180deg);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2;
}

.post:hover .post-image-fixed-height::after {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* 文章卡片主体 */
.archive .post,
.blog .post,
.search-results .post {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-light);
    overflow: hidden;
    transition: var(--transition-smooth);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.archive .post:nth-child(1) { animation-delay: 0.1s; }
.archive .post:nth-child(2) { animation-delay: 0.2s; }
.archive .post:nth-child(3) { animation-delay: 0.3s; }
.archive .post:nth-child(4) { animation-delay: 0.4s; }
.archive .post:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.archive .post:hover,
.blog .post:hover,
.search-results .post:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

/* 文章内容区域 */
.archive .post .entry-content {
    padding: 1.5rem 2rem;
}

/* 文章标题 */
.post h2.entry-title a,
.post h2.entry-title {
    color: var(--text-dark) !important;
    font-weight: 700;
    font-size: 1.4rem;
    transition: var(--transition-smooth);
    line-height: 1.4;
    position: relative;
}

.post h2.entry-title a:hover {
    color: var(--primary-color) !important;
    padding-left: 10px;
}

/* 文章元信息 */
.entry-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: rgba(248, 250, 252, 0.5);
    transition: background 0.3s ease;
}

.post:hover .entry-meta {
    background: rgba(99, 102, 241, 0.05);
}

.entry-meta a {
    color: var(--primary-color) !important;
    transition: var(--transition-smooth);
}

.entry-meta a:hover {
    color: var(--secondary-color) !important;
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

/* 打字机效果图标 */
.entry-meta::before {
    content: '✍️';
    margin-right: 8px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* 分类标签 */
.posted-on .cat-links a,
.entry-meta .cat-links a {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff !important;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.posted-on .cat-links a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transition: width 0.6s, height 0.6s, top 0.6s, left 0.6s;
    transform: translate(-50%, -50%);
}

.posted-on .cat-links a:hover::before {
    width: 200px;
    height: 200px;
}

.posted-on .cat-links a:hover,
.entry-meta .cat-links a:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* 阅读更多按钮 */
.read-more {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff !important;
    border-radius: 25px;
    font-weight: 500;
    transition: var(--transition-smooth);
    text-decoration: none;
    margin: 1rem 2rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.read-more::before {
    content: '→';
    position: absolute;
    left: -20px;
    opacity: 0;
    transition: all 0.3s ease;
}

.read-more::after {
    content: '→';
    position: absolute;
    right: 20px;
    opacity: 1;
    transition: all 0.3s ease;
}

.read-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    padding-left: 40px;
    padding-right: 40px;
}

.read-more:hover::before {
    left: 20px;
    opacity: 1;
}

.read-more:hover::after {
    right: -20px;
    opacity: 0;
}

/* =========================================
   侧边栏动态效果
   ========================================= */
.widget-area .widget {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.widget-area .widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    transition: height 0.3s ease;
}

.widget-area .widget:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.widget-area .widget:hover::before {
    height: 100%;
}

.widget-area .widget h2.widget-title {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: none;
    position: relative;
}

.widget-area .widget h2.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    animation: expandWidth 0.5s ease forwards;
}

@keyframes expandWidth {
    from { width: 0; }
    to { width: 40px; }
}

/* 侧边栏链接 */
.widget-area .widget a {
    color: var(--text-dark) !important;
    transition: var(--transition-smooth);
    display: inline-block;
}

.widget-area .widget a:hover {
    color: var(--primary-color) !important;
    padding-left: 8px;
}

/* 搜索窗口件 */
.widget_search .search-form {
    display: flex;
    gap: 0;
}

.widget_search .search-form .search-field {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 25px 0 0 25px;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.widget_search .search-form .search-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.widget_search .search-form .search-submit {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 0 25px 25px 0;
    padding: 12px 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.widget_search .search-form .search-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.widget_search .search-form .search-submit:hover::before {
    width: 200px;
    height: 200px;
}

.widget_search .search-form .search-submit:hover {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.5);
    transform: scale(1.05);
}

/* =========================================
   滚动条美化
   ========================================= */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* =========================================
   回到顶部按钮
   ========================================= */
.generate-back-to-top {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4) !important;
    animation: bounceIn 0.5s ease;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.generate-back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.generate-back-to-top:hover {
    transform: scale(1.15) rotate(360deg) !important;
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.6) !important;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.generate-back-to-top::before {
    content: '⬆' !important;
    font-size: 1.2rem;
}

/* =========================================
   页脚动态效果
   ========================================= */
.site-footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    color: rgba(255,255,255,0.8);
    padding: 3rem 0;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color), var(--primary-color));
    background-size: 300% 100%;
    animation: gradientFlow 3s linear infinite;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.site-footer a {
    color: rgba(255,255,255,0.8) !important;
    transition: var(--transition-smooth);
}

.site-footer a:hover {
    color: var(--accent-color) !important;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* 社交链接 */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: var(--transition-smooth);
    font-size: 1.3rem;
    position: relative;
    overflow: hidden;
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.social-links a:hover::before {
    opacity: 1;
}

.social-links a:hover {
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
    color: #fff !important;
}

.social-links a span {
    position: relative;
    z-index: 1;
}

/* 版权信息动画 */
.site-info {
    background: transparent !important;
    padding: 1.5rem 0;
    text-align: center;
    color: rgba(255,255,255,0.6);
    animation: fadeInUp 1s ease 0.3s both;
}

.site-info a {
    color: rgba(255,255,255,0.8) !important;
}

.site-info a:hover {
    color: var(--accent-color) !important;
}

/* =========================================
   评论区动态效果
   ========================================= */
.comments-area {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.comments-area:hover {
    box-shadow: var(--shadow-hover);
}

.comment-author vcard {
    font-weight: 600;
    color: var(--text-dark);
    transition: var(--transition-smooth);
}

.comment-author a {
    color: var(--primary-color) !important;
}

.comment-author a:hover {
    color: var(--secondary-color) !important;
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

/* =========================================
   分页动态效果
   ========================================= */
.pagination {
    text-align: center;
    margin-top: 2rem;
}

.pagination .nav-links {
    display: inline-flex;
    gap: 0.5rem;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-dark);
    transition: var(--transition-smooth);
    font-weight: 500;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff !important;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* =========================================
   加载动画
   ========================================= */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: loadingFadeOut 0.5s ease 1.5s forwards;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes loadingFadeOut {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* =========================================
   浮动元素动画
   ========================================= */
.floating-element {
    animation: float 3s ease-in-out infinite;
}

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

/* =========================================
   鼠标跟随效果
   ========================================= */
.cursor-follower {
    position: fixed;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, var(--primary-color), transparent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    mix-blend-mode: screen;
}

body:hover .cursor-follower {
    opacity: 0.5;
}

/* =========================================
   文字渐变效果
   ========================================= */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 3s ease infinite;
}

@keyframes gradientText {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

/* =========================================
   卡片悬停闪光效果
   ========================================= */
.flash-effect {
    position: relative;
    overflow: hidden;
}

.flash-effect::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255,255,255,0.1) 50%,
        transparent 70%
    );
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.flash-effect:hover::after {
    transform: translateX(100%);
}

/* =========================================
   响应式调整
   ========================================= */
@media (max-width: 768px) {
    .archive .post,
    .blog .post {
        border-radius: 12px;
        margin-bottom: 1.5rem;
    }
    
    .post-image-fixed-height {
        height: 180px;
    }
    
    .entry-meta {
        padding: 0.5rem 1rem;
    }
    
    .read-more {
        margin: 1rem 1rem 1.5rem;
    }
    
    .archive .post .entry-content {
        padding: 1rem 1.5rem;
    }
    
    .site-header .site-branding .site-title,
    .site-header .site-branding .site-title a {
        font-size: 1.4rem;
    }
    
    .social-links a {
        width: 44px;
        height: 44px;
    }
    
    .generate-back-to-top {
        width: 44px !important;
        height: 44px !important;
    }
}

/* =========================================
   夜间模式切换（可选）
   ========================================= */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --card-bg: #1e293b;
        --text-dark: #f1f5f9;
        --text-muted: #94a3b8;
        --border-color: #334155;
    }
}
