/*
Theme Name: A18
*/

/* 订阅成功消息样式 */
.subscription-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4cc9f0;
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 图片尺寸控制 */
.category-img img,
.featured-img img,
.post-img img,
.popular-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: white;
    font-size: 2rem;
}

/* WordPress默认样式 */
.alignnone {
    margin: 5px 20px 20px 0;
}

.aligncenter,
div.aligncenter {
    display: block;
    margin: 5px auto 5px auto;
}

.alignright {
    float: right;
    margin: 5px 0 20px 20px;
}

.alignleft {
    float: left;
    margin: 5px 20px 20px 0;
}

.wp-caption {
    background: #fff;
    border: 1px solid #f0f0f0;
    max-width: 96%;
    padding: 5px 3px 10px;
    text-align: center;
    margin-bottom: 20px;
}

.wp-caption img {
    border: 0 none;
    height: auto;
    margin: 0;
    max-width: 98.5%;
    padding: 0;
    width: auto;
}

.wp-caption p.wp-caption-text {
    font-size: 11px;
    line-height: 17px;
    margin: 0;
    padding: 0 4px 5px;
}

.screen-reader-text {
    border: 0;
    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: #eee;
    clip: auto !important;
    clip-path: none;
    color: #444;
    display: block;
    font-size: 1em;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* 文章详情页样式 */
.single-post-container {
    padding: 60px 0;
    background: #f8f9fa;
}

.post-content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.single-post {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.post-header {
    margin-bottom: 30px;
}

.post-meta {
    display: flex;
    gap: 20px;
    color: var(--gray);
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.post-meta a {
    color: var(--primary);
    text-decoration: none;
}

.post-meta a:hover {
    text-decoration: underline;
}

.post-title {
    font-size: 2.5rem;
    line-height: 1.3;
    margin-bottom: 20px;
    color: var(--dark);
}

.post-thumbnail {
    margin: -40px -40px 30px;
    height: 400px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.post-content p {
    margin-bottom: 1.5em;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 20px 0;
}

.post-tags {
    margin: 40px 0;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.tags-title {
    font-weight: 600;
    margin-right: 10px;
}

.post-tags .tag {
    display: inline-block;
    padding: 5px 15px;
    background: #f0f0f0;
    border-radius: 20px;
    margin: 5px;
    font-size: 0.9rem;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
}

.post-tags .tag:hover {
    background: var(--primary);
    color: white;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.nav-previous,
.nav-next {
    flex: 0 0 48%;
}

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

.nav-subtitle {
    display: block;
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 5px;
}

.post-navigation a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.post-navigation a:hover {
    color: var(--primary);
}

.related-posts {
    margin-top: 60px;
}

.related-posts h3 {
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.related-post-card {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.related-post-thumbnail {
    height: 200px;
}

.related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-post-content {
    padding: 20px;
}

.related-post-content h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.related-post-content a {
    color: var(--dark);
    text-decoration: none;
}

.related-post-content a:hover {
    color: var(--primary);
}

.related-post-meta {
    font-size: 0.9rem;
    color: var(--gray);
}

/* 分类页面样式 */
.category-container {
    padding: 60px 0;
    background: #f8f9fa;
}

.category-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.category-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.category-description {
    color: var(--gray);
    max-width: 700px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.category-meta {
    color: var(--gray);
    font-size: 1.1rem;
}

.category-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.posts-grid {
    display: grid;
    gap: 30px;
}

.post-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.post-card .post-thumbnail {
    height: 250px;
    margin: 0;
}

.post-card .post-content {
    padding: 25px;
}

.post-card .post-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.post-card .post-title a {
    color: var(--dark);
    text-decoration: none;
}

.post-card .post-title a:hover {
    color: var(--primary);
}

.post-card .post-excerpt {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.post-card .post-meta {
    margin-bottom: 0;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.pagination {
    margin-top: 40px;
    text-align: center;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    border-radius: 4px;
    background: white;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
}

.pagination .page-numbers.current {
    background: var(--primary);
    color: white;
}

.pagination .page-numbers:hover:not(.current) {
    background: var(--accent);
    color: white;
}

.no-posts {
    text-align: center;
    padding: 50px;
    background: white;
    border-radius: 10px;
    color: var(--gray);
}

/* 标签页面样式 */
.tag-header {
    text-align: center;
    padding: 40px 0;
    margin-bottom: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.tag-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.tag-description {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    opacity: 0.9;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.post-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.post-thumbnail {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
}

.post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.post-content {
    padding: 20px;
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-title a {
    color: var(--dark);
    text-decoration: none;
}

.post-title a:hover {
    color: var(--primary);
}

.post-meta {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
}

.post-excerpt {
    color: var(--gray);
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.pagination {
    margin-top: 50px;
    text-align: center;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    border-radius: 5px;
    background: white;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
}

.pagination .page-numbers.current {
    background: var(--primary);
    color: white;
}

.pagination .page-numbers:hover:not(.current) {
    background: var(--light);
    color: var(--primary);
}

.no-posts {
    text-align: center;
    padding: 50px 0;
    color: var(--gray);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .post-content-wrapper,
    .category-content {
        grid-template-columns: 1fr;
    }
    
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .post-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .single-post {
        padding: 20px;
    }
    
    .post-thumbnail {
        margin: -20px -20px 20px;
        height: 300px;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-navigation {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-previous,
    .nav-next {
        flex: 0 0 100%;
        text-align: left;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 10px;
    }

    .tag-header {
        padding: 30px 15px;
    }
    
    .tag-title {
        font-size: 2rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .post-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .category-title {
        font-size: 2rem;
    }
    
    .post-card .post-thumbnail {
        height: 200px;
    }
}