/**
 * 觉照交易博客 - 增强样式表
 * 版本: 1.0.1
 * 包含: 内容区块、评论区、返回顶部、社交分享等增强样式
 */

/* ============================================
   CSS 变量增强
   ============================================ */
:root {
    --juezhao-blue: #2563eb;
    --juezhao-blue-dark: #1d4ed8;
    --juezhao-gold: #d4af37;
    --juezhao-gold-light: #f0c75E;
    --juezhao-bg-dark: #1a1a2e;
    --juezhao-bg-primary: #ffffff;
    --juezhao-text-primary: #1f2937;
    --juezhao-text-secondary: #6b7280;
    --juezhao-radius: 12px;
    --juezhao-radius-lg: 16px;
    --juezhao-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --juezhao-transition: all 0.3s ease;
}

/* ============================================
   WordPress 核心样式修复
   ============================================ */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ============================================
   返回顶部按钮
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--juezhao-blue) 0%, var(--juezhao-blue-dark) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--juezhao-transition);
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

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

.back-to-top:hover {
    background: linear-gradient(135deg, var(--juezhao-gold) 0%, var(--juezhao-gold-light) 100%);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.back-to-top:active {
    transform: translateY(0);
}

/* ============================================
   内容区块样式 - 表格
   ============================================ */
.post__content table,
.page__content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--juezhao-bg-primary);
    border-radius: var(--juezhao-radius);
    overflow: hidden;
    box-shadow: var(--juezhao-shadow);
}

.post__content th,
.page__content th {
    background: linear-gradient(135deg, var(--juezhao-blue) 0%, var(--juezhao-blue-dark) 100%);
    color: white;
    font-weight: 600;
    text-align: left;
    padding: 1rem 1.25rem;
}

.post__content td,
.page__content td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.post__content tr:last-child td,
.page__content tr:last-child td {
    border-bottom: none;
}

.post__content tr:hover td,
.page__content tr:hover td {
    background: #f9fafb;
}

/* ============================================
   内容区块样式 - 代码
   ============================================ */
.post__content code,
.page__content code {
    background: #f1f5f9;
    color: #dc2626;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.875em;
}

.post__content pre,
.page__content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: var(--juezhao-radius);
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.post__content pre code,
.page__content pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

/* ============================================
   内容区块样式 - WordPress 区块编辑器
   ============================================ */
.wp-block {
    margin: 1.5rem 0;
}

.wp-block-image {
    margin: 1.5rem 0;
}

.wp-block-image img {
    border-radius: var(--juezhao-radius);
    box-shadow: var(--juezhao-shadow);
}

.wp-block-image .alignleft {
    float: left;
    margin: 0.5rem 1.5rem 0.5rem 0;
}

.wp-block-image .alignright {
    float: right;
    margin: 0.5rem 0 0.5rem 1.5rem;
}

.wp-block-image .aligncenter {
    display: block;
    margin: 0.5rem auto;
}

.wp-block-quote {
    border-left: 4px solid var(--juezhao-gold);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: #fafafa;
    font-style: italic;
    color: var(--juezhao-text-secondary);
}

.wp-block-quote cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--juezhao-text-secondary);
}

.wp-block-pullquote {
    border-top: 4px solid var(--juezhao-blue);
    border-bottom: 4px solid var(--juezhao-blue);
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
    font-style: italic;
    font-size: 1.25rem;
    color: var(--juezhao-text-primary);
}

.wp-block-separator {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2rem auto;
    max-width: 200px;
}

.wp-block-separator.is-style-wide {
    max-width: 100%;
}

.wp-block-separator.is-style-dots {
    border: none;
    text-align: center;
}

.wp-block-separator.is-style-dots::before {
    content: '···';
    color: var(--juezhao-gold);
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
}

.wp-block-cover {
    margin: 1.5rem 0;
    border-radius: var(--juezhao-radius);
    overflow: hidden;
}

.wp-block-gallery {
    margin: 1.5rem 0;
}

.wp-block-gallery .blocks-gallery-item img {
    border-radius: var(--juezhao-radius);
}

.wp-block-button {
    margin: 1rem 0;
}

.wp-block-button__link {
    background: linear-gradient(135deg, var(--juezhao-blue) 0%, var(--juezhao-blue-dark) 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--juezhao-radius);
    text-decoration: none;
    transition: var(--juezhao-transition);
}

.wp-block-button__link:hover {
    background: linear-gradient(135deg, var(--juezhao-gold) 0%, var(--juezhao-gold-light) 100%);
    transform: translateY(-2px);
}

.wp-block-embed {
    margin: 1.5rem 0;
}

.wp-block-embed iframe {
    border-radius: var(--juezhao-radius);
    box-shadow: var(--juezhao-shadow);
}

/* ============================================
   图片对齐样式
   ============================================ */
.alignleft {
    float: left;
    margin: 0.5rem 1.5rem 0.5rem 0;
}

.alignright {
    float: right;
    margin: 0.5rem 0 0.5rem 1.5rem;
}

.aligncenter {
    display: block;
    margin: 0.5rem auto;
}

.alignnone {
    margin: 0.5rem 0;
}

.size-full {
    width: 100%;
    height: auto;
    border-radius: var(--juezhao-radius);
}

.size-large {
    max-width: 100%;
    height: auto;
    border-radius: var(--juezhao-radius);
}

/* ============================================
   评论区样式
   ============================================ */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--juezhao-text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comments-title::before {
    content: '\f086';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--juezhao-blue);
}

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

.comment {
    background: #f9fafb;
    border-radius: var(--juezhao-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.comment__author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment__author .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--juezhao-gold);
}

.comment__author .fn {
    font-weight: 600;
    color: var(--juezhao-text-primary);
}

.comment__author .says {
    color: var(--juezhao-text-secondary);
    font-size: 0.875rem;
}

.comment__metadata {
    font-size: 0.8rem;
    color: var(--juezhao-text-secondary);
    margin-bottom: 0.75rem;
}

.comment__metadata a {
    color: var(--juezhao-blue);
    text-decoration: none;
}

.comment__metadata a:hover {
    text-decoration: underline;
}

.comment__content {
    color: var(--juezhao-text-primary);
    line-height: 1.7;
}

.comment__content p {
    margin-bottom: 0.75rem;
}

.comment__content p:last-child {
    margin-bottom: 0;
}

.reply {
    margin-top: 0.75rem;
}

.reply a {
    color: var(--juezhao-blue);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.reply a:hover {
    color: var(--juezhao-gold);
}

.comment__children {
    list-style: none;
    padding-left: 2rem;
    margin-top: 1rem;
}

.comment__children .comment {
    background: white;
    border: 1px solid #e5e7eb;
}

/* 评论表单 */
.comment__reply-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--juezhao-text-primary);
    margin-bottom: 1rem;
}

.comment__form label {
    display: block;
    font-weight: 500;
    color: var(--juezhao-text-primary);
    margin-bottom: 0.5rem;
}

.comment__form input[type="text"],
.comment__form input[type="email"],
.comment__form input[type="url"],
.comment__form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--juezhao-radius);
    font-size: 1rem;
    transition: var(--juezhao-transition);
}

.comment__form input:focus,
.comment__form textarea:focus {
    outline: none;
    border-color: var(--juezhao-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comment__form textarea {
    min-height: 150px;
    resize: vertical;
}

.comment__formsubmit {
    background: linear-gradient(135deg, var(--juezhao-blue) 0%, var(--juezhao-blue-dark) 100%);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: var(--juezhao-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--juezhao-transition);
}

.comment__formsubmit:hover {
    background: linear-gradient(135deg, var(--juezhao-gold) 0%, var(--juezhao-gold-light) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

/* ============================================
   社交分享按钮
   ============================================ */
.social-share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f9fafb;
    border-radius: var(--juezhao-radius);
}

.social-share__label {
    font-weight: 600;
    color: var(--juezhao-text-primary);
    margin-right: 0.5rem;
}

.social-share a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    transition: var(--juezhao-transition);
}

.social-share a:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-share .share-weixin {
    background: #07c160;
}

.social-share .share-weibo {
    background: #e6162d;
}

.social-share .share-twitter {
    background: #1da1f2;
}

.social-share__item--telegram {
    background: #0088cc;
}

/* ============================================
   面包屑导航
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--juezhao-text-secondary);
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-radius: var(--juezhao-radius);
}

.breadcrumb__link {
    color: var(--juezhao-blue);
    text-decoration: none;
}

.breadcrumb__link:hover {
    text-decoration: underline;
}

.breadcrumb__separator {
    color: #d1d5db;
}

.breadcrumb__current {
    color: var(--juezhao-text-primary);
    font-weight: 500;
}

/* ============================================
   加载动画
   ============================================ */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--juezhao-bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loading.loaded {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--juezhao-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   页面过渡效果
   ============================================ */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.page-transition.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   滚动进度条
   ============================================ */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--juezhao-blue) 0%, var(--juezhao-gold) 100%);
    z-index: 99999;
    transition: width 0.1s ease;
}

/* ============================================
   文章页增强
   ============================================ */
.post {
    animation: fadeInUp 0.6s ease;
}

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

.post__featured-image {
    margin-bottom: 2rem;
}

.post__featured-image img {
    width: 100%;
    height: auto;
    border-radius: var(--juezhao-radius-lg) var(--juezhao-radius-lg) 0 0;
}

.nav-post {
    flex: 1;
    padding: 1rem 1.25rem;
    background: #f9fafb;
    border-radius: var(--juezhao-radius);
    text-decoration: none;
    transition: var(--juezhao-transition);
}

.nav-post:hover {
    background: linear-gradient(135deg, var(--juezhao-blue) 0%, var(--juezhao-blue-dark) 100%);
    color: white;
}

.nav-post .nav-post__label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    opacity: 0.7;
}

.nav-post .nav-post__title {
    display: block;
    font-weight: 600;
}

.nav-post.next {
    text-align: right;
}

    /* ============================================
       侧边栏样式
       ============================================ */
    .widget-area {
        margin-top: 2rem;
    }
    
    .widget {
        background: #f9fafb;
        border-radius: var(--juezhao-radius);
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .widget-title {
        font-size: 1.125rem;
        font-weight: 700;
        color: var(--juezhao-text-primary);
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 2px solid var(--juezhao-gold);
    }
    
    .widget ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .widget li {
        padding: 0.5rem 0;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .widget li:last-child {
        border-bottom: none;
    }
    
    .widget a {
        color: var(--juezhao-text-primary);
        text-decoration: none;
        transition: var(--juezhao-transition);
    }
    
    .widget a:hover {
        color: var(--juezhao-blue);
    }
    
    /* 侧边栏布局 */
    .page-wrapper,
    .single-wrapper {
        display: flex;
        gap: 2rem;
    }
    
    .page-wrapper .post__content,
    .single-wrapper .post__content {
        flex: 1;
        min-width: 0;
    }
    
    .page-wrapper .widget-area,
    .single-wrapper .widget-area {
        flex: 0 0 280px;
        position: sticky;
        top: 100px;
        align-self: flex-start;
    }
    
    @media (max-width: 768px) {
        .page-wrapper,
        .single-wrapper {
            flex-direction: column;
        }
        
        .page-wrapper .widget-area,
        .single-wrapper .widget-area {
            flex: none;
            width: 100%;
            position: static;
        }
    }
    
    /* ============================================
       响应式增强
       ============================================ */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
    
    .alignleft,
    .alignright {
        float: none;
        display: block;
        margin: 1rem auto;
    }
    
    .social-share {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .comment__children {
        padding-left: 1rem;
    }
    
    .comment {
        padding: 1rem;
    }
}

/* ============================================
   觉照首页动画与视觉效果
   ============================================ */

/* Hero区域入场动画 */
@keyframes juezhao-fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes juezhao-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes juezhao-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(12px); }
}

@keyframes juezhao-pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(212, 175, 55, 0.8);
    }
}

@keyframes juezhao-gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Hero标题渐变文字动画 */
.juezhao-hero-title {
    background: linear-gradient(135deg, #ffffff 0%, #d4af37 50%, #ffffff 100%);
    background-size: 200% 200%;
    animation: juezhao-gradient-shift 4s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero区域入场延迟 */
.juezhao-hero-emblem {
    animation: juezhao-fadeInDown 0.8s ease-out;
}

.juezhao-hero-title {
    animation: juezhao-fadeInUp 0.8s ease-out 0.15s both;
}

.juezhao-hero-subtitle {
    animation: juezhao-fadeInUp 0.8s ease-out 0.3s both;
}

.juezhao-hero-tagline {
    animation: juezhao-fadeInUp 0.8s ease-out 0.45s both;
}

.juezhao-hero-cta {
    animation: juezhao-fadeInUp 0.8s ease-out 0.6s both;
}

/* Hero Emblem光环效果 */
.juezhao-hero-emblem-inner {
    animation: juezhao-pulse-glow 2s ease-in-out infinite;
}

/* 理论卡片悬停效果 */
.juezhao-theory-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.juezhao-theory-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 50px rgba(37, 99, 235, 0.2);
}

/* 核心理念玻璃态效果 */
.juezhao-spirit-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.juezhao-spirit-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.15);
}

/* CTA按钮悬停效果 */
.juezhao-cta-primary {
    background: linear-gradient(135deg, #d4af37 0%, #f4cf67 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.juezhao-cta-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.juezhao-cta-primary:hover::before {
    left: 100%;
}

.juezhao-cta-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.5);
}

/* 语录区块装饰线动画 */
.juezhao-quote-mark {
    animation: juezhao-fadeIn 1s ease-out 0.2s both;
}

/* 文章卡片网格布局 */
.juezhao-post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.juezhao-post-card {
    transition: all 0.3s ease;
    border-radius: 16px;
    overflow: hidden;
}

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

/* 移动端优化 */
@media (max-width: 768px) {
    .juezhao-hero-emblem-inner {
        width: 70px !important;
        height: 70px !important;
        font-size: 1.5rem !important;
    }

    .juezhao-theory-card:hover,
    .juezhao-spirit-card:hover {
        transform: translateY(-4px);
    }
}

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