/*
Theme Name: SEO Optimized Theme
Theme URI: https://yourdomain.com
Author: Your Name
Author URI: https://yourdomain.com
Description: 一个高度优化的WordPress主题，专注于搜索引擎友好性和用户体验
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: seo-theme
Tags: seo-optimized, responsive, fast-loading, mobile-friendly
*/

/* 基础重置和排版 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.6;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    background-color: #fff;
    overflow-x: hidden;
}

/* 容器布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* 头部样式 */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

/* 网站品牌 */
.site-branding {
    display: flex;
    align-items: center;
}

.custom-logo {
    max-height: 60px;
    width: auto;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.site-title a {
    text-decoration: none;
    color: #333;
}

.site-description {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* 导航菜单 */
.main-navigation {
    display: flex;
    align-items: center;
}

.primary-menu-container ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.primary-menu-container li {
    margin: 0 1rem;
}

.primary-menu-container a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.primary-menu-container a:hover {
    color: #007cba;
}

/* 移动菜单切换 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
    position: relative;
    transition: background 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background: #333;
    left: 0;
    transition: transform 0.3s;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

/* 主要内容区域 */
.site-main {
    padding: 2rem 0;
    min-height: 60vh;
}

/* 文章网格 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.post {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* 文章缩略图 */
.post-thumbnail {
    position: relative;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post:hover .post-thumbnail img {
    transform: scale(1.05);
}

/* 文章内容 */
.entry-header {
    padding: 1.5rem;
}

.entry-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.entry-title a {
    text-decoration: none;
    color: #333;
}

.entry-title a:hover {
    color: #007cba;
}

.entry-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.entry-content {
    padding: 0 1.5rem 1.5rem;
}

.entry-content p {
    margin-bottom: 1rem;
}

/* 页脚样式 */
.site-footer {
    background: #f8f9fa;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-widget h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: #333;
}

.footer-menu-container ul {
    list-style: none;
}

.footer-menu-container li {
    margin-bottom: 0.5rem;
}

.footer-menu-container a {
    text-decoration: none;
    color: #666;
    transition: color 0.3s;
}

.footer-menu-container a:hover {
    color: #007cba;
}

.subscribe-form {
    display: flex;
    gap: 0.5rem;
}

.subscribe-form input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.subscribe-form button {
    padding: 0.5rem 1rem;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.subscribe-form button:hover {
    background: #005a87;
}

.site-info {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
    color: #666;
    font-size: 0.875rem;
}

/* 面包屑导航 */
.breadcrumb {
    background: #f8f9fa;
    padding: 1rem 0;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #007cba;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    transition: all 0.3s;
}

.pagination .page-numbers.current {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.pagination .page-numbers:hover:not(.current) {
    background: #f8f9fa;
    border-color: #007cba;
}

/* 社交分享 */
.social-share {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.social-share h4 {
    margin-bottom: 1rem;
    color: #333;
}

.social-share-buttons {
    display: flex;
    gap: 1rem;
}

.social-share a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.social-share a:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 相关文章 */
.related-posts {
    margin: 3rem 0;
}

.related-posts h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* 评论区域 */
.comments-area {
    margin-top: 3rem;
}

.comments-title {
    margin-bottom: 1.5rem;
    color: #333;
}

.comment-list {
    list-style: none;
    margin-bottom: 2rem;
}

.comment {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-author .avatar {
    border-radius: 50%;
}

.comment-metadata {
    font-size: 0.875rem;
    color: #666;
}

.comment-content {
    line-height: 1.6;
}

/* 表单样式 */
.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.comment-form .form-submit {
    margin-bottom: 0;
}

.submit {
    background: #007cba;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.submit:hover {
    background: #005a87;
}

/* 辅助类 */
.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;
    width: 1px;
    word-wrap: normal !important;
}

.alignleft {
    float: left;
    margin-right: 1rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin: 0 auto 1rem;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* 加载动画 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}