/* 生活服务与休闲工具：保持传统工具站的信息密度，统一内容卡片和双栏结构。 */
.yz-life-tool,
.yz-leisure-tool {
    padding-bottom: 12px;
}

.yz-life-layout,
.yz-leisure-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 20px;
    margin-top: 14px;
}

.yz-life-layout::before,
.yz-life-layout::after,
.yz-leisure-layout::before,
.yz-leisure-layout::after {
    display: none;
    content: none;
}

.yz-life-main,
.yz-life-side,
.yz-leisure-main,
.yz-leisure-side {
    float: none;
    width: auto;
    padding: 0;
}

.yz-life-tool .layui-card,
.yz-life-detail .layui-card,
.yz-life-list .layui-card,
.yz-leisure-tool .layui-card,
.yz-leisure-detail .layui-card {
    overflow: hidden;
    border: 1px solid #dce6f2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(31, 78, 121, .035);
}

.yz-life-primary,
.yz-leisure-primary {
    border-top: 3px solid #2f80ed !important;
}

.yz-life-heading,
.yz-leisure-heading {
    box-sizing: border-box;
    height: auto;
    min-height: 58px;
    padding: 15px 20px;
    border-bottom: 1px solid #e2eaf3;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
    line-height: 1.45;
}

.yz-life-heading h1,
.yz-life-primary h1,
.yz-leisure-heading h1,
.yz-leisure-primary h1 {
    margin: 0;
    color: #233f61;
    font-size: 24px;
    font-weight: 700;
}

.yz-life-primary > .layui-card-body,
.yz-leisure-primary > .layui-card-body {
    padding: 22px;
}

.yz-life-tool .layui-card-header.box__tit,
.yz-life-detail .layui-card-header.box__tit,
.yz-life-list .layui-card-header.box__tit,
.yz-leisure-tool .layui-card-header.box__tit,
.yz-leisure-detail .layui-card-header.box__tit {
    position: relative;
    box-sizing: border-box;
    height: auto;
    min-height: 48px;
    padding: 13px 16px 12px 27px;
    border-bottom: 1px solid #e3eaf2;
    color: #294766;
    line-height: 1.45;
}

.yz-life-tool .layui-card-header.box__tit::before,
.yz-life-detail .layui-card-header.box__tit::before,
.yz-life-list .layui-card-header.box__tit::before,
.yz-leisure-tool .layui-card-header.box__tit::before,
.yz-leisure-detail .layui-card-header.box__tit::before {
    position: absolute;
    top: 16px;
    left: 14px;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: #ff922b;
    content: "";
}

.yz-life-tool img,
.yz-life-detail img,
.yz-life-list img,
.yz-leisure-tool img,
.yz-leisure-detail img {
    max-width: 100%;
    height: auto;
}

.yz-life-tool table,
.yz-life-detail table,
.yz-life-list table,
.yz-leisure-tool table,
.yz-leisure-detail table {
    max-width: 100%;
}

.yz-life-tool input.layui-input,
.yz-life-tool textarea.layui-textarea,
.yz-life-tool select,
.yz-leisure-tool input.layui-input,
.yz-leisure-tool textarea.layui-textarea,
.yz-leisure-tool select {
    border-color: #cfdceb;
    border-radius: 5px;
}

.yz-life-tool .layui-btn:not(.layui-btn-primary),
.yz-leisure-tool .layui-btn:not(.layui-btn-primary) {
    border-radius: 5px;
    background: #2f80ed;
}

.yz-life-tool pre,
.yz-life-detail pre,
.yz-leisure-tool pre,
.yz-leisure-detail pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* 实用网站详情：截图、信息表与最外层侧栏使用独立布局，避免旧栅格互相覆盖。 */
.yz-life-site .yz-site-overview {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
    gap: 20px;
}

.yz-life-site .yz-site-preview,
.yz-life-site .yz-site-facts {
    min-width: 0;
}

.yz-life-site .site-img {
    display: block;
    width: 100%;
    height: 180px;
    margin-top: 5px;
    border: 1px solid #e0e8f1;
    border-radius: 6px;
    background: #f5f8fc;
    box-shadow: none;
    object-fit: cover;
    object-position: top center;
}

.yz-life-site .yz-site-preview > ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 8px;
    margin: 0;
    padding: 0;
    text-align: center;
}

.yz-life-site .yz-site-preview > ul::before,
.yz-life-site .yz-site-preview > ul::after {
    display: none;
    content: none;
}

.yz-life-site .yz-site-preview > ul li {
    float: none;
    width: auto;
    min-width: 0;
    padding: 0;
    list-style: none;
}

.yz-life-site .yz-site-facts .layui-table {
    margin-top: 5px;
    table-layout: fixed;
}

.yz-life-site .yz-site-category-grid,
.yz-life-site .yz-site-hot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
    margin: 0;
    padding: 14px 16px;
}

.yz-life-site .yz-site-category-grid li,
.yz-life-site .yz-site-hot-grid li {
    min-width: 0;
    list-style: none;
    line-height: 32px;
}

.yz-life-site .yz-site-hot-grid img {
    width: 18px;
    height: 18px;
    object-fit: cover;
}

/* 网站分类列表完整展示简介，卡片按所在行的最高内容自然对齐。 */
.yz-life-list-site_sort .yz-site-list-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin: 0;
    padding: 0;
}

.yz-life-list-site_sort .yz-site-list-grid > li {
    min-width: 0;
    list-style: none;
}

.yz-life-list-site_sort .yz-site-list-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 18px;
    border: 1px solid #e2eaf3;
    border-radius: 7px;
}

.yz-life-list-site_sort .yz-site-list-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
}

.yz-life-list-site_sort .yz-site-list-name img {
    flex: 0 0 auto;
}

.yz-life-list-site_sort .yz-site-list-description {
    display: -webkit-box;
    min-height: 3.5em;
    max-height: 3.5em;
    margin: 9px 0 0;
    color: #718096;
    line-height: 1.75;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.yz-life-list-site_sort .yz-site-list-meta {
    margin-top: auto;
    padding-top: 10px;
}

/* 黄历的宽表格属于正文后续内容，不参与上方主栏与侧栏的网格行高计算。 */
.yz-huangli-followup {
    clear: both;
    margin-top: 20px;
}

/* 黄历侧栏中的静态日历固定为 272px，给它单独留足空间，避免日期和底部按钮被裁切。 */
.yz-life-huangli .yz-life-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
    align-items: start;
}

.yz-life-huangli .yz-life-side > .layui-card > .layui-card-body {
    padding-right: 10px;
    padding-left: 10px;
}

.yz-life-huangli #ID-laydate-static-1,
.yz-life-huangli #ID-laydate-static-1 .layui-laydate {
    display: block;
    width: 100%;
}

.yz-life-huangli #ID-laydate-static-1 .layui-laydate-main {
    margin: 0 auto;
}

/* 黄历首页右栏只展示三行相关工具，避免侧栏过长把正文后续区块整体推下去。 */
.yz-life-tool.yz-life-huangli .yz-life-side > .layui-card:last-child .layui-card-body > li:nth-child(n+10) {
    display: none;
}

/* 中药材条目文字长短不一，使用网格按行排列，避免旧式浮动产生交错空洞。 */
.yz-life-herbal .yz-herbal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
}

.yz-life-herbal .yz-herbal-grid::before,
.yz-life-herbal .yz-herbal-grid::after {
    display: none;
    content: none;
}

.yz-life-herbal .yz-herbal-grid > li {
    box-sizing: border-box;
    float: none;
    width: auto;
    min-width: 0;
}

@media (max-width: 991px) {
    .yz-life-layout,
    .yz-leisure-layout {
        display: block;
    }

    .yz-life-main,
    .yz-life-side,
    .yz-leisure-main,
    .yz-leisure-side {
        width: 100%;
    }

    .yz-life-side,
    .yz-leisure-side {
        margin-top: 16px;
    }

    .yz-life-huangli .yz-life-layout {
        display: block;
    }

    .yz-life-site .yz-site-overview {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .yz-life-list-site_sort .yz-site-list-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .yz-life-layout,
    .yz-leisure-layout {
        margin-top: 10px;
    }

    .yz-life-heading h1,
    .yz-life-primary h1,
    .yz-leisure-heading h1,
    .yz-leisure-primary h1 {
        font-size: 20px;
    }

    .yz-life-primary > .layui-card-body,
    .yz-leisure-primary > .layui-card-body {
        padding: 15px;
    }

    .yz-life-tool .layui-btn,
    .yz-leisure-tool .layui-btn {
        margin-bottom: 7px;
    }

    .yz-life-tool .layui-table,
    .yz-life-detail .layui-table,
    .yz-life-list .layui-table {
        display: block;
        overflow-x: auto;
        white-space: normal;
    }

    .yz-life-herbal .yz-herbal-grid {
        grid-template-columns: 1fr;
    }

    .yz-life-site .yz-site-overview {
        grid-template-columns: 1fr;
    }

    .yz-life-site .site-img {
        height: auto;
        max-height: 260px;
        aspect-ratio: 16 / 10;
    }

    .yz-life-site .yz-site-preview > ul {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .yz-life-list-site_sort .yz-site-list-grid {
        grid-template-columns: 1fr;
    }
}
