/**
 * 资讯列表 / 栏目列表 — 对齐 demo/src/app/pages/CategoryPage.tsx
 */

.demo-news-list-page {
    width: 100%;
    flex: 1;
    background: #f9fafb;
}

/* 全宽 Hero */
.demo-news-hero {
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #0a0f1c;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .demo-news-hero {
        min-height: 360px;
    }
}

.demo-news-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    mix-blend-mode: luminosity;
}

.demo-news-hero__grad {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        90deg,
        #0a0f1c 0%,
        rgba(10, 15, 28, 0.88) 45%,
        rgba(30, 58, 138, 0.35) 100%
    );
}

.demo-news-hero__inner {
    position: relative;
    z-index: 2;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 48px 16px;
}

@media (min-width: 768px) {
    .demo-news-hero__inner {
        padding-left: 32px;
        padding-right: 32px;
    }
}

.demo-news-hero__crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(147, 197, 253, 0.85);
    margin-bottom: 24px;
}

.demo-news-hero__crumb a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.demo-news-hero__crumb a:hover {
    color: #fff;
}

.demo-news-hero__crumb i {
    font-size: 12px;
    opacity: 0.8;
}

.demo-news-hero__crumb span {
    color: #fff;
}

.demo-news-hero__title {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #fff;
    margin: 0 0 16px;
    line-height: 1.15;
}

@media (min-width: 768px) {
    .demo-news-hero__title {
        font-size: 3rem;
    }
}

.demo-news-hero__sub {
    font-size: 1.125rem;
    color: #d1d5db;
    font-weight: 300;
    line-height: 1.6;
    max-width: 42rem;
    margin: 0;
}

/* 主区域 */
.demo-news-list-page__main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px 16px 80px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

@media (min-width: 768px) {
    .demo-news-list-page__main {
        padding: 64px 32px 96px;
        flex-direction: row;
        align-items: flex-start;
        gap: 48px;
    }
}

@media (min-width: 1024px) {
    .demo-news-list-page__main {
        gap: 48px;
    }
}

/* 侧栏 */
.demo-news-aside {
    width: 100%;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .demo-news-aside {
        width: 256px;
        position: sticky;
        top: 112px;
    }
}

.demo-news-aside__card {
    background: #fff;
    border-radius: 24px;
    border: 1px solid #f3f4f6;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 24px;
}

.demo-news-aside__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.demo-news-aside__nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demo-news-aside__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.demo-news-aside__link:hover {
    background: #f9fafb;
    color: #111827;
}

.demo-news-aside__link--active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 700;
}

.demo-news-aside__link--active i {
    font-size: 12px;
    opacity: 0.9;
}

.demo-news-aside__cta-wrap {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid #f3f4f6;
}

.demo-news-aside__cta {
    position: relative;
    background: #0a0f1c;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    overflow: hidden;
}

.demo-news-aside__cta-glow {
    position: absolute;
    top: 0;
    right: 0;
    width: 128px;
    height: 128px;
    background: rgba(37, 99, 235, 0.3);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
}

.demo-news-aside__cta h4 {
    position: relative;
    z-index: 1;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
}

.demo-news-aside__cta p {
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.6;
    margin: 0 0 20px;
}

.demo-news-aside__cta a {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.2);
    transition: background 0.2s;
}

.demo-news-aside__cta a:hover {
    background: #1d4ed8;
    color: #fff;
}

/* 内容区 */
.demo-news-content {
    flex: 1;
    min-width: 0;
}

.demo-news-content__bar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

@media (min-width: 640px) {
    .demo-news-content__bar {
        flex-direction: row;
        align-items: center;
    }
}

.demo-news-content__heading {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.demo-news-content__heading h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.demo-news-content__badge {
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 9999px;
}

.demo-news-content__toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.demo-news-content__toggle button {
    border: none;
    background: transparent;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    color: #9ca3af;
    line-height: 0;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.demo-news-content__toggle button:hover {
    color: #111827;
    background: #f9fafb;
}

.demo-news-content__toggle button.is-active {
    background: #eff6ff;
    color: #2563eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* 列表根：网格 / 列表 */
#demo-news-list-root.demo-news-list--grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    #demo-news-list-root.demo-news-list--grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px;
    }
}

#demo-news-list-root.demo-news-list--list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 文章卡片 */
.demo-news-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 24px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.demo-news-card:hover {
    border-color: #dbeafe;
    box-shadow: 0 8px 40px rgba(37, 99, 235, 0.06);
}

#demo-news-list-root.demo-news-list--list .demo-news-card {
    flex-direction: column;
}

@media (min-width: 640px) {
    #demo-news-list-root.demo-news-list--list .demo-news-card {
        flex-direction: row;
        min-height: 224px;
    }
}

.demo-news-card__media {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

#demo-news-list-root.demo-news-list--grid .demo-news-card__media {
    aspect-ratio: 16 / 10;
    width: 100%;
}

#demo-news-list-root.demo-news-list--list .demo-news-card__media {
    height: 192px;
    width: 100%;
}

@media (min-width: 640px) {
    #demo-news-list-root.demo-news-list--list .demo-news-card__media {
        width: 288px;
        height: auto;
        min-height: 200px;
        align-self: stretch;
    }
}

@media (min-width: 1024px) {
    #demo-news-list-root.demo-news-list--list .demo-news-card__media {
        width: 320px;
    }
}

.demo-news-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.demo-news-card:hover .demo-news-card__media img {
    transform: scale(1.05);
}

.demo-news-card__media--empty {
    background: linear-gradient(135deg, #1e3a8a 0%, #0a0f1c 100%);
    min-height: 180px;
}

.demo-news-card__cat {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1;
}

.demo-news-card__cat span {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.demo-news-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 24px 32px;
}

#demo-news-list-root.demo-news-list--list .demo-news-card__body {
    justify-content: center;
}

.demo-news-card__date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    font-family: ui-monospace, monospace;
    margin-bottom: 12px;
}

.demo-news-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 12px;
}

.demo-news-card__title a {
    color: #111827;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.demo-news-card:hover .demo-news-card__title a {
    color: #2563eb;
}

.demo-news-card__excerpt {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.65;
    margin: 0 0 24px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.demo-news-card__more {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #2563eb;
    position: relative;
    z-index: 2;
    text-decoration: none;
    width: fit-content;
}

.demo-news-card__more-icon {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, color 0.3s;
}

.demo-news-card:hover .demo-news-card__more-icon {
    background: #2563eb;
    color: #fff;
}

.demo-news-card__more-icon i {
    font-size: 12px;
}

/* 分页 — 圆钮风格 */
.demo-news-pagination {
    margin-top: 64px;
    display: flex;
    justify-content: center;
}

.demo-news-pagination .xrpagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.demo-news-pagination .xrpagination li {
    margin: 0;
}

.demo-news-pagination .xrpagination li > a,
.demo-news-pagination .xrpagination li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: 9999px;
    border: 1px solid #e5e7eb !important;
    background: #fff !important;
    color: #4b5563 !important;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.demo-news-pagination .xrpagination li > a:hover,
.demo-news-pagination .xrpagination li > span:hover {
    background: #f9fafb !important;
    color: #111827 !important;
}

.demo-news-pagination .xrpagination .active > a,
.demo-news-pagination .xrpagination .active > span,
.demo-news-pagination .xrpagination li.active > a {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.demo-news-pagination .xrpagination li.disabled > span {
    opacity: 0.45;
    cursor: not-allowed;
}
