/**
 * 文章详情 — 对齐 demo/src/app/pages/ArticlePage.tsx
 */

.demo-article-page {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
    background: #f9fafb;
    padding: 40px 16px 80px;
    flex: 1;
}

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

.demo-article-page__inner {
    max-width: 1280px;
    margin: 0 auto;
}

/* 面包屑 */
.demo-article-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 32px;
}

.demo-article-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.demo-article-breadcrumb a:hover {
    color: #2563eb;
}

.demo-article-breadcrumb__sep {
    font-size: 12px;
    color: #9ca3af;
}

.demo-article-breadcrumb__current {
    color: #111827;
}

/* 主 + 侧栏 */
.demo-article-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

@media (min-width: 1024px) {
    .demo-article-layout {
        flex-direction: row;
        gap: 48px;
        align-items: flex-start;
    }

    .demo-article-main {
        flex: 1 1 0;
        min-width: 0;
        max-width: calc(66.666% - 16px);
    }

    .demo-article-aside {
        flex: 0 0 calc(33.333% - 16px);
        max-width: 400px;
    }
}

/* 正文卡片 */
.demo-article-card {
    background: #fff;
    border-radius: 24px;
    border: 1px solid #f3f4f6;
    padding: 32px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

@media (min-width: 768px) {
    .demo-article-card {
        padding: 48px;
    }
}

.demo-article-card__header {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid #f3f4f6;
}

.demo-article-card__cat {
    display: inline-block;
    padding: 4px 12px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    margin-bottom: 24px;
}

.demo-article-card__title {
    margin: 0 0 32px;
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.demo-article-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    font-size: 14px;
    color: #6b7280;
}

.demo-article-card__meta-dot {
    width: 4px;
    height: 4px;
    border-radius: 9999px;
    background: #d1d5db;
}

.demo-article-card__author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.demo-article-card__avatar {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #4b5563;
}

.demo-article-card__author-name {
    font-weight: 500;
    color: #374151;
}

.demo-article-card__meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.demo-article-card__meta-item i {
    font-size: 14px;
}

/* 正文区（CMS {$content}） */
.demo-article-body {
    font-size: 18px;
    line-height: 1.75;
    color: #4b5563;
    max-width: none;
}

.demo-article-body > p:first-child {
    font-size: 1.25rem;
    line-height: 1.75;
    color: #4b5563;
    font-weight: 300;
    margin-bottom: 2rem;
}

.demo-article-body p {
    margin: 0 0 1.5rem;
}

.demo-article-body h2,
.demo-article-body h3,
.demo-article-body h4 {
    color: #111827;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 12px;
}

.demo-article-body h2 {
    font-size: 1.5rem;
}

.demo-article-body h3 {
    font-size: 1.375rem;
}

.demo-article-body h2::before,
.demo-article-body h3::before {
    content: "";
    width: 32px;
    height: 4px;
    background: #2563eb;
    border-radius: 9999px;
    flex-shrink: 0;
}

.demo-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 24px;
    border: 1px solid #f3f4f6;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    margin: 2.5rem 0;
    display: block;
}

.demo-article-body blockquote {
    margin: 3rem 0 2rem;
    padding: 2rem;
    background: rgba(239, 246, 255, 0.5);
    border-left: 4px solid #2563eb;
    border-radius: 24px;
}

.demo-article-body blockquote p {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    font-weight: 500;
    color: #1e3a8a;
    line-height: 1.65;
}

.demo-article-body blockquote footer,
.demo-article-body blockquote cite {
    font-size: 14px;
    color: #1d4ed8;
    font-style: normal;
}

.demo-article-body ul,
.demo-article-body ol {
    margin: 0 0 1.5rem;
    padding-left: 1.5rem;
}

.demo-article-body a {
    color: #2563eb;
}

.demo-article-card__tags {
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.demo-article-card__tags a {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.demo-article-card__tags a:hover {
    background: #dbeafe;
}

/* 文章底部操作条 */
.demo-article-card__foot {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}

@media (min-width: 640px) {
    .demo-article-card__foot {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.demo-article-card__back {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.demo-article-card__back:hover {
    color: #2563eb;
}

.demo-article-card__back-icon {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    transition:
        background 0.2s,
        color 0.2s;
}

.demo-article-card__back:hover .demo-article-card__back-icon {
    background: #eff6ff;
    color: #2563eb;
}

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

.demo-article-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.demo-article-card__btn--muted {
    background: #f9fafb;
    color: #374151;
}

.demo-article-card__btn--muted:hover {
    background: #f3f4f6;
}

.demo-article-card__btn--primary {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 700;
}

.demo-article-card__btn--primary:hover {
    background: #dbeafe;
}

/* 上一篇 / 下一篇 */
.demo-article-navpn {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px dashed #e5e7eb;
    font-size: 14px;
    color: #6b7280;
}

.demo-article-navpn a {
    color: #2563eb;
    text-decoration: none;
}

.demo-article-navpn a:hover {
    text-decoration: underline;
}

/* 侧栏 */
.demo-article-aside {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.demo-article-widget-cta {
    position: relative;
    background: #0a0f1c;
    border-radius: 24px;
    padding: 32px;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

/* 覆盖主题/Metronic 里对 h3、p 的全局色（含 .text-gray-* 等），暗底必须用浅色字 */
.demo-article-page .demo-article-widget-cta h3 {
    color: #ffffff !important;
}

.demo-article-page .demo-article-widget-cta p {
    color: #9ca3af !important;
}

.demo-article-widget-cta::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 128px;
    height: 128px;
    background: rgba(37, 99, 235, 0.3);
    border-radius: 50%;
    filter: blur(48px);
    pointer-events: none;
}

.demo-article-widget-cta h3 {
    position: relative;
    z-index: 1;
    margin: 0 0 16px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.demo-article-widget-cta p {
    position: relative;
    z-index: 1;
    margin: 0 0 32px;
    font-size: 14px;
    line-height: 1.65;
    color: #9ca3af;
    font-weight: 300;
}

.demo-article-widget-cta a {
    position: relative;
    z-index: 1;
    display: block;
    text-align: center;
    width: 100%;
    padding: 16px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.3);
    transition: background 0.2s;
}

.demo-article-widget-cta a:hover {
    background: #3b82f6;
}

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

.demo-article-widget__title {
    margin: 0 0 24px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 12px;
}

.demo-article-widget__title-bar {
    width: 6px;
    height: 24px;
    background: #2563eb;
    border-radius: 9999px;
    flex-shrink: 0;
}

.demo-article-related__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 同栏目排除本篇后可能多于 4 条，仅显示前 4 条 */
.demo-article-related__list > li:nth-child(n + 5) {
    display: none;
}

.demo-article-related__list a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.demo-article-related__list h4 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.4;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.demo-article-related__list a:hover h4 {
    color: #2563eb;
}

.demo-article-related__date {
    font-size: 12px;
    color: #9ca3af;
    font-family: ui-monospace, monospace;
}

.demo-article-product {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(249, 250, 251, 0.8);
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
    transition:
        background 0.2s,
        box-shadow 0.2s,
        border-color 0.2s;
    margin-bottom: 16px;
}

.demo-article-product:last-child {
    margin-bottom: 0;
}

.demo-article-product:hover {
    background: #fff;
    border-color: #dbeafe;
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.06);
}

.demo-article-product__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    color: #2563eb;
    transition:
        transform 0.2s,
        background 0.2s,
        color 0.2s;
    flex-shrink: 0;
}

.demo-article-product--purple .demo-article-product__icon {
    color: #9333ea;
}

.demo-article-product:hover .demo-article-product__icon {
    transform: scale(1.1);
    background: #2563eb;
    color: #fff;
}

.demo-article-product--purple:hover .demo-article-product__icon {
    background: #9333ea;
    color: #fff;
}

.demo-article-product__text h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.demo-article-product:hover .demo-article-product__text h4 {
    color: #2563eb;
}

.demo-article-product--purple:hover .demo-article-product__text h4 {
    color: #9333ea;
}

.demo-article-product__text p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
}

.demo-article-product__chev {
    margin-left: auto;
    color: #d1d5db;
    font-size: 14px;
    transition:
        color 0.2s,
        transform 0.2s;
}

.demo-article-product:hover .demo-article-product__chev {
    color: #2563eb;
    transform: translateX(4px);
}

.demo-article-product--purple:hover .demo-article-product__chev {
    color: #9333ea;
}

.demo-article-related__empty {
    margin: 0;
    font-size: 14px;
    color: #9ca3af;
}
