/*
Theme Name: Astra Child - 银发好物
Template: astra
Version: 1.3.0
Description: 银发好物推荐网站定制子主题
Text Domain: astra-child
*/

/* ============================================
   银发好物 - 自定义样式 v1.2
   配色：暖橙 #E8743C + 深蓝 #2D5F8B + 浅米 #FAF8F5
   适老化：大字、宽间距、高对比度
   ============================================ */

/* ---- 全局基础 ---- */
:root {
    --yf-orange: #E8743C;
    --yf-orange-dark: #D55F2A;
    --yf-orange-light: #FFF3ED;
    --yf-blue: #2D5F8B;
    --yf-blue-light: #4A8BB8;
    --yf-cream: #FAF8F5;
    --yf-text: #2D2D2D;
    --yf-gray: #6B6B6B;
    --yf-gray-light: #999;
    --yf-border: #eee;
    --yf-red: #E63946;
}

body {
    font-size: 17px !important;
    line-height: 1.8 !important;
    color: var(--yf-text);
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* ---- 导航栏 ---- */
.site-header .ast-main-header-wrap {
    min-height: 72px;
}

.main-header-menu > li > a {
    font-size: 16px !important;
    padding: 12px 18px !important;
    font-weight: 500;
}

.main-header-menu .current-menu-item > a,
.main-header-menu .current_page_item > a {
    color: var(--yf-orange) !important;
    font-weight: 700;
    border-bottom: 3px solid var(--yf-orange);
}

/* ---- Logo ---- */
.site-logo img {
    max-height: 56px;
}

.site-title a {
    font-size: 24px !important;
    font-weight: 800;
    color: var(--yf-blue) !important;
}

/* ---- 首页容器 ---- */
.home .entry-content {
    max-width: 100% !important;
    padding: 0 !important;
}

/* ---- 通用区块标题 ---- */
.yf-section-title {
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    color: var(--yf-blue);
    margin-bottom: 8px;
}

.yf-section-desc {
    text-align: center;
    font-size: 15px;
    color: var(--yf-gray);
    margin-bottom: 36px;
}

/* ---- Hero 区域 ---- */
.yf-hero {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px 50px;
}

.yf-hero h2 {
    font-size: 32px !important;
    color: var(--yf-blue);
    margin-bottom: 16px;
    font-weight: 800;
    line-height: 1.4;
}

.yf-hero p {
    font-size: 18px;
    line-height: 2;
    color: var(--yf-gray);
    margin-bottom: 32px;
}

.yf-hero .yf-btn-hero {
    display: inline-block;
    background: var(--yf-orange);
    color: #fff !important;
    font-size: 18px;
    font-weight: 700;
    padding: 16px 48px;
    border-radius: 50px;
    text-decoration: none !important;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(232, 116, 60, 0.35);
}

.yf-hero .yf-btn-hero:hover {
    background: var(--yf-orange-dark);
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(232, 116, 60, 0.45);
}

/* ---- 热门好物推荐区 ---- */
.yf-recommend {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.yf-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.yf-product-card {
    background: #fff;
    border: 1px solid var(--yf-border);
    border-radius: 12px;
    padding: 16px;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.yf-product-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.yf-product-tag {
    display: inline-block;
    background: var(--yf-orange-light);
    color: var(--yf-orange);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    align-self: flex-start;
}

.yf-product-img {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.yf-product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.yf-product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--yf-text);
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yf-product-rating {
    font-size: 13px;
    color: var(--yf-gray);
    margin-bottom: 8px;
}

.yf-stars {
    color: var(--yf-orange);
    font-size: 14px;
    letter-spacing: 1px;
}

.yf-product-desc {
    font-size: 13px;
    color: var(--yf-gray);
    line-height: 1.6;
    margin: 0 0 12px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yf-product-price {
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.yf-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--yf-red);
}

.yf-price-old {
    font-size: 14px;
    color: var(--yf-gray-light);
    text-decoration: line-through;
}

.yf-btn-buy {
    display: block;
    text-align: center;
    background: var(--yf-orange);
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    padding: 10px 0;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background 0.3s ease;
}

.yf-btn-buy:hover {
    background: var(--yf-orange-dark);
    color: #fff !important;
}

/* ---- 分类卡片区域 ---- */
.yf-categories {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.yf-cat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
}

.yf-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--yf-cream);
    border-radius: 16px;
    padding: 32px 16px;
    text-align: center;
    text-decoration: none !important;
    border: 2px solid transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
}

.yf-cat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--yf-orange);
}

.yf-cat-icon {
    font-size: 40px;
    margin-bottom: 12px;
    line-height: 1;
}

.yf-cat-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--yf-text);
    margin: 0;
}

.yf-cat-card p {
    font-size: 14px;
    color: var(--yf-gray);
    margin: 8px 0 0;
    text-decoration: none !important;
    line-height: 1.5;
    word-break: keep-all;
    white-space: nowrap;
}

/* ---- 选购指南区 ---- */
.yf-guides {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.yf-guide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.yf-guide-card {
    background: #fff;
    border: 1px solid var(--yf-border);
    border-radius: 12px;
    padding: 24px;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.yf-guide-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    transform: translateY(-3px);
}

.yf-guide-label {
    display: inline-block;
    background: var(--yf-blue);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.yf-guide-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--yf-text);
    margin: 0 0 12px;
    line-height: 1.5;
}

.yf-guide-excerpt {
    font-size: 14px;
    color: var(--yf-gray);
    line-height: 1.8;
    margin: 0 0 16px;
}

.yf-guide-meta {
    font-size: 13px;
    color: var(--yf-gray-light);
}

/* ---- 选品标准区 ---- */
.yf-standard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.yf-standard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.yf-standard-card {
    background: var(--yf-cream);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
}

.yf-standard-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.yf-standard-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--yf-blue);
    margin: 0 0 12px;
}

.yf-standard-card p {
    font-size: 14px;
    color: var(--yf-gray);
    line-height: 1.8;
    margin: 0;
}

/* ---- 精选评测区（保留兼容旧代码） ---- */
.yf-reviews {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.yf-review-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.yf-review-card {
    background: #fff;
    border: 1px solid var(--yf-border);
    border-radius: 12px;
    padding: 24px;
    transition: box-shadow 0.3s ease;
}

.yf-review-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.yf-review-card h4 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 12px;
}

.yf-review-card h4 a {
    color: var(--yf-text);
    text-decoration: none !important;
}

.yf-review-card h4 a:hover {
    color: var(--yf-orange);
}

.yf-review-card .yf-excerpt {
    font-size: 15px;
    color: var(--yf-gray);
    line-height: 1.7;
}

.yf-review-card .yf-meta {
    font-size: 13px;
    color: #aaa;
    margin-top: 16px;
}

/* ---- 通用按钮 ---- */
.yf-btn {
    display: inline-block;
    background: var(--yf-orange);
    color: #fff !important;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 50px;
    text-decoration: none !important;
    transition: background 0.3s ease;
}

.yf-btn:hover {
    background: var(--yf-orange-dark);
    color: #fff !important;
}

/* ---- 页脚增强 ---- */
footer .ast-footer-widget-wrap {
    background: var(--yf-blue);
    color: rgba(255, 255, 255, 0.9);
}

footer .widget-title {
    color: #fff !important;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

footer .ast-footer-widget-wrap a {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 15px;
    line-height: 2.2;
}

footer .ast-footer-widget-wrap a:hover {
    color: var(--yf-orange) !important;
}

footer .ast-small-footer-wrap {
    background: #1a3f5c;
}

footer .ast-small-footer-wrap a {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ---- 搜索框 ---- */
.ast-header-search .astra-search-icon {
    font-size: 20px;
    padding: 12px;
}

/* ---- 面包屑导航 ---- */
.yf-breadcrumb {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 20px;
    font-size: 14px;
    color: #999;
}

.yf-breadcrumb a {
    color: var(--yf-blue);
    text-decoration: none;
}

.yf-breadcrumb a:hover {
    color: var(--yf-orange);
}

/* ---- 文章页优化 ---- */
.entry-content {
    font-size: 17px;
    line-height: 1.9;
}

.entry-content h2 {
    font-size: 24px;
    color: var(--yf-blue);
    margin-top: 32px;
}

.entry-content h3 {
    font-size: 20px;
    color: var(--yf-text);
    margin-top: 24px;
}

/* ---- 评测评分卡片 ---- */
.yf-review-box {
    background: var(--yf-cream);
    border: 1px solid #e8e0d8;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.yf-review-box h4 {
    font-size: 18px;
    color: var(--yf-blue);
    margin: 0 0 16px;
}

.yf-score {
    display: inline-block;
    background: var(--yf-orange);
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    padding: 8px 20px;
    border-radius: 8px;
}

.yf-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}

.yf-pros ul,
.yf-cons ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.yf-pros li {
    color: #2e7d32;
    padding: 4px 0;
}

.yf-cons li {
    color: #c62828;
    padding: 4px 0;
}

/* ---- 首页模块背景色分区 v1.3.0 ----
   浅米/白交替，让首页纵向层次更清晰 */
.yf-band-cream {
    background: var(--yf-cream);
}
.yf-band-white {
    background: #fff;
}

/* ---- 好物推荐页 v1.3.0 ---- */
.yf-recommend-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

.yf-page-lead {
    font-size: 16px;
    line-height: 2;
    color: var(--yf-gray);
    text-align: center;
    max-width: 780px;
    margin: 0 auto 30px;
}

.yf-cat-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 48px;
}

.yf-cat-nav a {
    display: inline-block;
    background: var(--yf-cream);
    color: var(--yf-blue);
    font-size: 16px;
    font-weight: 600;
    padding: 10px 26px;
    border-radius: 50px;
    border: 1px solid var(--yf-border);
    text-decoration: none !important;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.yf-cat-nav a:hover {
    background: var(--yf-orange);
    color: #fff !important;
    border-color: var(--yf-orange);
}

.yf-cat-section {
    margin-bottom: 56px;
    scroll-margin-top: 90px;
}

.yf-cat-section .yf-section-title::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: var(--yf-orange);
    margin: 10px auto 0;
    border-radius: 2px;
}

.yf-page-note {
    font-size: 14px;
    color: var(--yf-gray-light);
    text-align: center;
    margin-top: 40px;
    padding: 18px;
    background: var(--yf-cream);
    border-radius: 8px;
}

/* ---- 独立页面隐藏页面标题区 v1.2.5 ----
   首页/选品标准/关于我们/联系我们/好物推荐等 page 类页面：
   页面大标题与导航菜单重复且纯空白，统一隐藏（文章页 single 不受影响） */
body.page .entry-header {
    display: none !important;
}

/* ---- 分类归档页优化 v1.2.4 ----
   隐藏分类页顶部大标题区：导航已高亮当前分类，标题重复且纯空白 */
body.archive .ast-archive-description {
    display: none !important;
}

/* 归档页文章卡片上重复的分类标签：与当前分类页重复，隐藏 */
.archive .ast-blog-single-element.cat-links {
    display: none !important;
}

/* 归档页文章卡片微调：更紧凑、间距统一 */
.archive .ast-article-post {
    border-bottom: 1px solid var(--yf-border);
    padding-bottom: 28px;
}

.archive .ast-article-post:last-child {
    border-bottom: none;
}

/* ---- 响应式 ---- */
@media (max-width: 1200px) {
    .yf-product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .yf-cat-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .yf-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .yf-standard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .yf-hero h2 {
        font-size: 24px;
    }
    .yf-hero p {
        font-size: 16px;
    }
    .yf-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .yf-product-card {
        padding: 12px;
    }
    .yf-product-img {
        height: 140px;
    }
    .yf-cat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .yf-cat-card {
        padding: 24px 12px;
    }
    .yf-cat-card p {
        white-space: normal;
    }
    .yf-guide-grid {
        grid-template-columns: 1fr;
    }
    .yf-review-grid {
        grid-template-columns: 1fr;
    }
    .yf-standard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .yf-pros-cons {
        grid-template-columns: 1fr;
    }
    body {
        font-size: 16px;
    }
    /* ---- 移动端适老化优化 ---- */
    .yf-hero {
        padding: 24px 16px 20px;
    }
    .yf-hero p {
        font-size: 16px;
        line-height: 1.8;
        margin-bottom: 20px;
    }
    .yf-hero .yf-btn-hero {
        font-size: 17px;
        padding: 14px 40px;
    }
    .yf-section-title {
        font-size: 22px;
    }
    .yf-section-desc {
        font-size: 14px;
        margin-bottom: 20px;
    }
    .yf-recommend {
        padding: 24px 14px 40px;
    }
    .yf-product-tag {
        font-size: 13px;
    }
    .yf-product-name {
        font-size: 16px;
    }
    .yf-product-rating {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .yf-product-grid {
        grid-template-columns: 1fr;
    }
    .yf-standard-grid {
        grid-template-columns: 1fr;
    }
    .yf-product-card {
        padding: 14px;
    }
    .yf-product-img {
        height: 160px;
    }
}

/* ========================================
   分类页文章卡片封面图修复
   解决 Astra 父主题导致的封面图顶部空白和文字截断问题
   ======================================== */

/* 1. 取消第一张卡片的负上边距（Astra 默认 margin-top:-1.5em） */
.ast-blog-featured-section:first-child .post-thumb-img-content {
    margin-top: 0 !important;
}

/* 2. 取消图片放大效果（Astra 默认 transform:scale(1.1) 导致上下被裁） */
.post-thumb-img-content img {
    transform: scale(1) !important;
}

/* 3. 图片容器不裁切，确保完整显示 */
.post-thumb-img-content {
    overflow: visible !important;
}

/* 4. 图片填满容器宽度，高度按比例自适应 */
.post-thumb-img-content img {
    aspect-ratio: auto !important;
    width: 100% !important;
    height: auto !important;
    object-fit: fill !important;
    display: block;
}

/* 5. 取消 .ast-article-inner 的内边距，消除封面图顶部白色空白 */
.ast-article-inner {
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* 6. 文字内容区域恢复内边距（因为父容器去掉了padding） */
.ast-article-inner .post-content,
.ast-article-inner .entry-header,
.ast-article-inner .entry-content {
    padding-left: 24px !important;
    padding-right: 24px !important;
}

/* 7. 确保文章卡片整体有圆角和阴影 */
.ast-article-post {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    background: #fff;
    overflow: hidden;
}

/* 8. 图片容器上方无间距，紧贴卡片顶部 */
.ast-blog-featured-section {
    margin-bottom: 0 !important;
}

/* 9. 封面图顶部跟随卡片圆角 */
.post-thumb-img-content img {
    border-radius: 12px 12px 0 0;
}

/* ========================================
   移动端导航菜单适老化优化
   ======================================== */
@media (max-width: 768px) {
    /* 顶部站点名称加大 */
    .ast-site-title-wrap .site-title a,
    .site-branding .site-title {
        font-size: 22px !important;
    }

    /* 移动端菜单链接增大字号与点击区域 */
    .main-header-menu .menu-link,
    .ast-builder-menu-mobile .menu-link,
    .main-navigation .menu-link {
        font-size: 17px !important;
        padding: 12px 16px !important;
    }

    /* 汉堡按钮加大 */
    .ast-mobile-menu-buttons .menu-toggle,
    .ast-header-break-point .ast-button-wrap .menu-toggle {
        font-size: 20px !important;
        min-width: 48px;
        min-height: 48px;
    }

    /* 页脚菜单增大 */
    .site-footer .menu-link,
    .footer-widget-area .menu-link {
        font-size: 15px !important;
        padding: 8px 10px !important;
    }
}
