/* =============================================================
   News / Blog list page – UI redesign.
   Markup / data elements are unchanged; only visual styling is
   overhauled.  The old violet theme (#4a28b7 / #1a1859 / #fbf9ff)
   is replaced with a neutral card grid that inherits the site
   theme color via `var(--primary-color)` (updated at runtime
   from the admin "网站主题" setting).

   Layout:
     - Desktop: 2-column → .News-box (article cards) on left,
       .right (sidebar) sticky on right.
     - Each article is a horizontal card (image left, copy right).
     - Sidebar blocks share a clean white-card look with subtle
       border + soft shadow instead of the old purple fill.
     - Mobile (≤991px): sidebar drops below the article list.
   ============================================================= */

#News {
    padding: 0;
    background: #f6f7fb;
}

#News > .py-\[10px\].p_y40 {
    padding-top: 40px;
    padding-bottom: 60px;
}

#News > .py-\[10px\].p_y40 > .app-container {
    /* Keep the same horizontal padding as the detail page's
       `.app-container` (inherited from the global layout) so the sidebar
       on the list page aligns with the sidebar on the detail page — i.e.
       both hug the container's inner right edge, not the viewport edge. */
    gap: 20px;
    align-items: flex-start;
}

/* ---------- Article list (left column) ---------- */

.News-box {
    flex: 1 1 0;
    min-width: 0;
    /* No max-width here: `gap` on the parent already reserves space
       between the two columns, and `.right` is a fixed 314px column,
       so `flex:1` naturally fills the remaining horizontal space and
       the sidebar hugs the container's right edge. */
    margin: 0;
    box-sizing: border-box;
    color: #4b5563;
}

.News-box .item {
    position: relative;
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    gap: 20px;
    padding: 0;
    margin-bottom: 22px;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.News-box .item:first-child {
    border: 1px solid #eef0f4;
}

.News-box .item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    border-color: rgba(64, 102, 184, .22);
}

/* ---- Thumbnail ---- */
.News-box .item .imgBox {
    position: relative;
    flex: 0 0 280px;
    width: 280px;
    padding: 0;
    height: auto;
    align-self: stretch;
    overflow: hidden;
    background: #f1f3f7;
}

.News-box .item .imgBox a,
.News-box .item .imgBox {
    display: block;
}

.News-box .item .imgBox img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate(0, 0);
    transition: transform .45s ease;
}

.News-box .item:hover .imgBox img {
    transform: scale(1.06);
}

/* ---- Right content ---- */
.News-box .item .right_box {
    flex: 1;
    width: auto;
    padding: 20px 24px;
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ---- Date badge (month over day) ---- */
.News-box .item .time {
    position: static;
    transform: none;
    box-shadow: none;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    background: transparent;
    color: var(--primary-color, #4066b8);
    padding: 0;
    border-radius: 0;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 10px;
    letter-spacing: .02em;
}

.News-box .item .time > div {
    margin: 0;
    font-weight: 700;
}

.News-box .item .time > div:first-child {
    font-size: 13px;
    margin-right: 6px;
    color: #9ca3af;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.News-box .item .time > div:last-child {
    font-size: 13px;
    margin-left: 0;
    font-weight: 500;
    color: #9ca3af;
}

.News-box .item .time > div:first-child::after {
    content: ' /';
    color: #d1d5db;
}

/* ---- Title ---- */
.News-box .item .right_box .title {
    line-height: 1.35;
    font-size: 18px;
    margin: 0 0 10px;
    color: #111827;
    font-weight: 700;
    position: relative;
    letter-spacing: .01em;
}

.News-box .item .right_box .title a {
    color: inherit;
    text-decoration: none;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .2s ease;
}

.News-box .item:hover .right_box .title a {
    color: var(--primary-color, #4066b8);
}

/* ---- Description ---- */
.News-box .item .right_box .msg {
    line-height: 1.6;
    color: #6b7280;
    font-size: 13.5px;
    margin: 0;
    flex: 1;
}

.News-box .item .right_box .msg a {
    color: inherit;
    text-decoration: none;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Meta row (share + views) ---- */
.News-box .item .right_box > .flex.flex-wrap {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #eef0f4;
    align-items: center !important;
}

/* Publication date (replaces the old share block in the meta row). */
.News-box .item .right_box .date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #9ca3af;
    line-height: 1;
    letter-spacing: .02em;
}

.News-box .item .right_box .date .iconfont {
    font-size: 14px;
    color: var(--primary-color, #4066b8);
}

.News-box .item .right_box .date span {
    font-weight: 500;
}

/* Legacy .share / .time styles kept as no-op to avoid regressions if any
   cached markup still references them. */
.News-box .item .right_box .share {
    display: none !important;
}

.News-box .item .right_box .num {
    display: flex !important;
    align-items: center;
    font-size: 12.5px;
    color: #9ca3af;
    gap: 4px;
}

.News-box .item .right_box .num .iconfont {
    font-size: 14px;
    margin-right: 0 !important;
}

/* ---- Legacy single-article leftover rules (unchanged fallback) ---- */
.News-box > .title-image-box {
    width: 100%;
    padding: calc(25%) 0;
    position: relative;
    overflow: hidden;
}

.News-box > .title-image-box img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
}

.News-box > .title_box > h2 {
    line-height: 1.3;
    font-size: 24px;
    margin: 30px 0 16px;
    color: #111827;
    font-weight: 700;
    position: relative;
}

.News-box > .title_box > .info {
    margin-bottom: 30px;
    font-size: 14px;
    color: #6b7280;
}

.News-box > .content {
    font-size: 15px;
    overflow: hidden;
    overflow-x: auto;
    color: #1f2937;
    line-height: 1.75;
}

/* ---------- Right sidebar ---------- */

.app-container > .right {
    width: 314px;
    flex: 0 0 314px;
}

.app-container > .right > div {
    padding: 22px 22px;
    background-color: #fff;
    margin-bottom: 20px;
    border: 1px solid #eef0f4;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.app-container > .right > div:last-child {
    margin-bottom: 0;
}

.app-container > .right > div > .title {
    color: #111827;
    line-height: 1.3;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color, #4066b8);
    display: inline-block;
    min-width: 100px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* ---- Search box ---- */
.search-box {
    height: 44px;
    width: 100%;
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #f9fafb;
    transition: border-color .2s ease, background .2s ease;
    overflow: hidden;
}

.search-box:focus-within {
    border-color: var(--primary-color, #4066b8);
    background: #fff;
}

.search-box input {
    border: none !important;
    width: 100%;
    height: 100%;
    padding: 8px 48px 8px 18px;
    background: transparent;
    color: #1f2937;
    font-size: 14px;
    outline: none;
}

.search-box input::placeholder {
    color: #9ca3af;
}

.search-box i {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    cursor: pointer;
    width: 44px;
    height: 100%;
    justify-content: center;
    align-items: center;
    color: #9ca3af;
    transition: color .2s ease;
}

.search-box:focus-within i,
.search-box i:hover {
    color: var(--primary-color, #4066b8);
}

.app-container > .right > div:has(.search-box) {
    padding: 14px 14px;
}

/* Fallback for browsers without :has() – slimmer padding when a
   form occupies the block. */
.app-container > .right > div > form.search-box {
    margin: 0;
}

/* ---- Category list ---- */
.category-list {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}

.category-list .item {
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    transition: padding-left .2s ease;
}

.category-list .item:last-child {
    border: 0;
}

.category-list .item a {
    color: #374151;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color .2s ease;
}

.category-list .item a::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #d1d5db;
    flex-shrink: 0;
    transition: background .2s ease;
}

.category-list .item:hover {
    padding-left: 4px;
}

.category-list .item:hover a {
    color: var(--primary-color, #4066b8);
}

.category-list .item:hover a::before {
    background: var(--primary-color, #4066b8);
}

/* ---- Recent news list ---- */
.newsList .item {
    width: 100%;
    margin-bottom: 14px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.newsList .item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.newsList .item .left {
    width: 70px;
    height: 70px;
    overflow: hidden;
    margin-right: 12px;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f1f3f7;
}

.newsList .item .left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.newsList .item:hover .left img {
    transform: scale(1.06);
}

.newsList .item .right {
    flex: 1;
    color: #9ca3af;
    min-width: 0;
}

.newsList .item .right .name {
    color: #111827;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    transition: color .2s ease;
}

.newsList .item:hover .right .name {
    color: var(--primary-color, #4066b8);
}

.newsList .item .right .time {
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.3;
}

/* ---- Tag list (legacy, kept for any usage) ---- */
.tagList .item {
    margin: 0 8px 8px 0;
    display: inline-block;
    background-color: #f9fafb;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12.5px;
    transition: all .2s ease;
    cursor: pointer;
}

.tagList .item:hover {
    background: var(--primary-color, #4066b8);
    color: #fff;
    border-color: var(--primary-color, #4066b8);
}

/* ---- Recommend image grid ---- */
.right-imageList {
    gap: 10px;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    margin-bottom: 20px !important;
}

.right-imageList .item {
    width: calc((100% - 20px) / 3);
    margin: 0 !important;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f3f7;
    transition: transform .25s ease;
}

.right-imageList .item:hover {
    transform: translateY(-2px);
}

.right-imageList .item .box {
    position: relative;
    overflow: hidden;
    padding: 50% 0;
}

.right-imageList .item img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform .35s ease;
}

.right-imageList .item:hover img {
    transform: translate(-50%, -50%) scale(1.06);
}

/* ---- Legacy CTA button (kept in case present) ---- */
.info-btn {
    background-color: var(--primary-color, #4066b8);
    width: 100%;
    border-radius: 8px;
    padding: 0 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 44px;
    color: #fff !important;
    margin-top: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    transition: background .2s ease, transform .15s ease;
}

.info-btn:hover {
    background-color: var(--primary-color-hover, var(--primary-color, #4066b8));
    transform: translateY(-1px);
}

/* ---------- Pagination (the include uses layout.page) ---------- */
#News .page-box {
    margin-top: 30px;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    #News > .py-\[10px\].p_y40 {
        padding-top: 24px;
        padding-bottom: 40px;
    }

    #News > .py-\[10px\].p_y40 > .app-container {
        gap: 22px;
    }

    .News-box {
        margin: 0;
        max-width: none;
        width: 100%;
        flex: 1 1 100%;
    }

    .News-box .item {
        flex-direction: column !important;
        margin-bottom: 18px;
    }

    .News-box .item .imgBox {
        flex: 0 0 auto;
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    .News-box .item .right_box {
        padding: 16px 18px;
    }

    .News-box .item .right_box .title {
        font-size: 17px;
    }

    .app-container > .right {
        width: 100%;
        flex: 1 1 100%;
    }

    .right-imageList .item {
        width: calc((100% - 20px) / 3);
    }
}

@media (max-width: 620px) {
    .News-box .item .right_box {
        padding: 14px 14px;
    }

    .News-box .item .right_box .title {
        font-size: 16px;
    }

    .News-box .item .right_box .msg {
        font-size: 13px;
    }

    .newsList .item .left {
        width: 60px;
        height: 60px;
    }

    .right-imageList .item {
        width: calc((100% - 10px) / 2);
    }

    .app-container > .right > div {
        padding: 16px 16px;
    }
}
