/**
Theme Name: Astra Child
Theme URI: https://zhanggang.net
Author: 张刚
Author URI: https://zhanggang.net/about
Description: Astra 子主题，优化首页卡片展示、阅读体验、侧边栏和分享功能
Version: 1.0.0
Requires at least: 5.3
Tested up to: 6.9
Requires PHP: 5.3
Template: astra
License: GNU General Public License v2 or later
Text Domain: astra-child
*/

/* ===== 首页 Hero 区域 ===== */
.ast-child-hero {
    text-align: center;
    padding: 3em 1.5em 2em;
    margin-bottom: 2em;
    background: linear-gradient(135deg, #f0f5fa 0%, #e8f0f8 100%);
    border-radius: 12px;
}
.ast-child-hero h1 {
    font-size: 2em;
    font-weight: 700;
    color: #111;
    margin: 0 0 0.5em;
}
.ast-child-hero p {
    font-size: 1.15em;
    color: #555;
    margin: 0;
    line-height: 1.6;
}
.ast-child-hero .hero-cta {
    display: inline-block;
    margin-top: 1.2em;
    padding: 0.6em 1.8em;
    background: #046bd2;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.95em;
    transition: background 0.2s;
}
.ast-child-hero .hero-cta:hover {
    background: #0355a8;
}

/* ===== 文章卡片改进 ===== */
.ast-blog-layout-4-grid .post-content {
    padding: 1.5em;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.ast-blog-layout-4-grid .post-content:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-3px);
}

/* 卡片等高 */
.ast-row {
    display: flex;
    flex-wrap: wrap;
}
.ast-article-post {
    display: flex;
}

/* 标题在卡片中更突出 */
.ast-blog-layout-4-grid .entry-title {
    font-size: 1.2em;
    margin: 0.4em 0 0.3em;
}
.ast-blog-layout-4-grid .entry-title a {
    line-height: 1.4;
}

/* 分类标签边距调整（无缩略图后） */
.ast-blog-single-element .cat-links {
    margin-bottom: 0;
}
.ast-blog-single-element .cat-links a {
    margin-bottom: 4px;
}

/* 摘要最多显示3行，溢出省略 */
.ast-blog-layout-4-grid .ast-excerpt-container {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

/* 阅读更多按钮 */
.read-more {
    margin-top: auto;
    padding-top: 1em;
}
.read-more a {
    display: inline-block;
    padding: 0.4em 1.2em;
    background: #046bd2;
    color: #fff !important;
    border-radius: 5px;
    font-size: 0.88em;
    text-decoration: none;
    transition: background 0.2s;
}
.read-more a:hover {
    background: #0355a8;
}

/* 分类标签美化 */
.ast-blog-single-element .cat-links a {
    background: #f0f5fa;
    color: #046bd2 !important;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.5em;
}

/* ===== 侧边栏样式 ===== */
.widget-area {
    padding-top: 0;
}
.widget-area .widget {
    background: #fff;
    padding: 1.5em;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 1.5em;
}
.widget-area .widget h2 {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 0.8em;
    color: #111;
    padding-bottom: 0.5em;
    border-bottom: 2px solid #046bd2;
}
.widget-area .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.widget-area .widget ul li {
    padding: 0.4em 0;
    border-bottom: 1px solid #f0f0f0;
}
.widget-area .widget ul li:last-child {
    border-bottom: none;
}
.widget-area .widget ul li a {
    color: #333;
    text-decoration: none;
    font-size: 0.93em;
    transition: color 0.2s;
}
.widget-area .widget ul li a:hover {
    color: #046bd2;
}

/* ===== 底部增强 ===== */
.ast-child-footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2em;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2em 1.5em;
}
.ast-child-footer-widgets .footer-widget h3 {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 0.8em;
    color: #f0f0f0;
}
.ast-child-footer-widgets .footer-widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ast-child-footer-widgets .footer-widget ul li {
    padding: 0.25em 0;
}
.ast-child-footer-widgets .footer-widget ul li a {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.2s;
}
.ast-child-footer-widgets .footer-widget ul li a:hover {
    color: #fff;
}
.ast-child-footer-social {
    text-align: center;
    padding: 1em 1.5em 0;
}
.ast-child-footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #aaa;
    background: rgba(255,255,255,0.08);
    text-decoration: none;
    margin: 0 0.3em;
    transition: background 0.2s, color 0.2s;
}
.ast-child-footer-social a:hover {
    background: #046bd2;
    color: #fff;
}
.ast-child-footer-social .social-label {
    color: #aaa;
    font-size: 0.88em;
    margin-right: 0.8em;
}

/* ===== 正文阅读优化 ===== */
body,
.entry-content p,
.entry-content li,
.comment-content p {
    font-size: 17px !important;
    line-height: 1.8 !important;
    color: #333333 !important;
}
body {
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont, sans-serif !important;
}
.entry-title,
.entry-title a,
h1, h2, h3, h4, h5, h6 {
    color: #111111 !important;
}
.entry-title a:hover {
    color: #046bd2 !important;
}
.single .content-area,
.page .content-area {
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    float: none;
}
.single .site-main,
.page .site-main {
    padding: 0 20px;
}
.entry-content p {
    margin-bottom: 1.2em !important;
}
.entry-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    color: #d63384;
}
.entry-content pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1em;
    overflow-x: auto;
}
.entry-content blockquote {
    border-left: 4px solid #046bd2;
    background: #f8f9fa;
    padding: 1em 1.5em;
    margin: 1.5em 0;
    font-style: normal;
    color: #555;
}
.entry-content img {
    border-radius: 6px;
}
.entry-content strong {
    color: #111;
}
.entry-content a:hover {
    text-decoration: underline;
}
.entry-content ul,
.entry-content ol {
    margin: 0.8em 0 0.8em 1.5em;
    padding: 0;
}
.entry-content ul li,
.entry-content ol li {
    margin-bottom: 0.4em;
}
.main-header-menu .menu-link {
    font-size: 15px;
}
html {
    scroll-behavior: smooth;
}

/* 文章导航 */
.post-navigation {
    margin-top: 2em;
    padding-top: 1.5em;
    border-top: 1px solid #e9ecef;
}
.post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 1em;
}
.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
}
.post-navigation a {
    color: #046bd2;
    font-size: 15px;
}
::selection {
    background: #046bd2;
    color: #fff;
}
::-moz-selection {
    background: #046bd2;
    color: #fff;
}
.entry-meta {
    font-size: 14px;
    color: #888;
    margin-bottom: 1em;
}
.entry-meta a {
    color: #046bd2;
}

/* 搜索框 */
.ast-search-menu-icon .search-form {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}
.ast-search-menu-icon .search-field {
    padding: 8px 12px;
    font-size: 14px;
}
.ast-search-menu-icon .search-submit {
    background: #046bd2;
    color: #fff;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .single .site-main,
    .page .site-main {
        padding: 0 16px;
    }
    .entry-content {
        padding: 0 4px;
    }
    .ast-child-hero {
        padding: 2em 1em 1.5em;
    }
    .ast-child-hero h1 {
        font-size: 1.5em;
    }
    .ast-child-footer-widgets {
        grid-template-columns: 1fr;
        gap: 1.5em;
    }
    .ast-blog-layout-4-grid .entry-title {
        font-size: 1.1em;
    }
}

@media (max-width: 544px) {
    .ast-grid-3 .ast-grid-common-col {
        width: 100%;
    }
}

/* ===== 打印样式 ===== */
@media print {
    .site-header,
    .site-footer,
    .ast-scroll-to-top,
    .post-navigation,
    .comments-area,
    .ast-blog-single-element .cat-links,
    .ast-child-hero,
    .widget-area {
        display: none !important;
    }
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    .entry-content a {
        text-decoration: underline;
    }
}

/* ===== 暗色模式 ===== */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a2e !important;
        color: #e0e0e0 !important;
    }
    .entry-content p,
    .entry-content li,
    .comment-content p {
        color: #d0d0d0 !important;
    }
    .entry-title,
    .entry-title a,
    h1, h2, h3, h4, h5, h6 {
        color: #f0f0f0 !important;
    }
    .site-header,
    .ast-primary-header-bar {
        background-color: #16213e !important;
    }
    .ast-blog-layout-4-grid .post-content {
        background: #16213e !important;
    }
    .ast-child-hero {
        background: linear-gradient(135deg, #16213e, #0f3460) !important;
    }
    .ast-child-hero h1 {
        color: #f0f0f0;
    }
    .ast-child-hero p {
        color: #b0b0b0;
    }
    .ast-blog-single-element .cat-links a {
        background: #0f3460 !important;
        color: #7ec8e3 !important;
    }
    .site-footer {
        background-color: #16213e !important;
    }
    .ast-footer-copyright {
        color: #aaa !important;
    }
    .widget-area .widget {
        background: #16213e !important;
    }
    .widget-area .widget h2 {
        color: #f0f0f0;
        border-bottom-color: #0f3460;
    }
    .widget-area .widget ul li {
        border-bottom-color: rgba(255,255,255,0.05);
    }
    .widget-area .widget ul li a {
        color: #c0c0c0;
    }
    .entry-content code {
        background: #2a2a4a;
        color: #ff79c6;
    }
    .entry-content pre {
        background: #2a2a4a;
        border-color: #333;
    }
    .entry-content blockquote {
        background: #16213e;
        border-left-color: #7ec8e3;
        color: #c0c0c0;
    }
    .entry-content strong {
        color: #f0f0f0;
    }
}
