/* ========================================
   文章详情页 & 列表页 样式优化
   ======================================== */

/* ---------- 文章卡片（新设计：封面图 + 分类 + 摘要） ---------- */
.article-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(4, 135, 249, 0.14);
}

.article-card-img {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    background: #F0F3F8;
}

.article-card-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.article-card:hover .article-card-img img {
    transform: scale(1.06);
}

.article-card-img .img-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E8F0FE 0%, #F4F7FF 100%);
}

.article-card-img .img-fallback i {
    font-size: 48px;
    color: #BDD4F8;
}

.article-card .card-category {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #0487F9;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    z-index: 2;
    letter-spacing: 0.5px;
}

.article-card-body {
    padding: 20px 22px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-card-body h4 {
    font-size: 17px;
    line-height: 1.5;
    margin-bottom: 10px;
    color: #2F2E41;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.article-card:hover .article-card-body h4 {
    color: #0487F9;
}

.article-card-body p {
    font-size: 14px;
    line-height: 1.65;
    color: #999;
    margin-bottom: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #F0F3F6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #B0B0B0;
}

.article-card-footer span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.article-card-footer i {
    font-size: 12px;
}

.article-card-footer .card-arrow {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F4F7FF;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0487F9;
    transition: all 0.3s ease;
    font-size: 12px;
}

.article-card:hover .card-arrow {
    background: #0487F9;
    color: #fff;
}

/* 整卡可点击 */
.article-card-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}


/* ---------- 旧版 about-item (文章详情页相关推荐保留使用) ---------- */

.about-item {
    background: #fff;
    border-radius: 8px;
    padding: 30px 25px;
    box-shadow: 0 4px 25px rgba(4, 135, 249, 0.06);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: flex-start;
    height: 100%;
    border: 1px solid rgba(4, 135, 249, 0.04);
}

.about-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(4, 135, 249, 0.14);
    border-color: rgba(4, 135, 249, 0.12);
}

.about-item .icon-box {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #F2F9FF 0%, #E8F4FD 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.35s ease;
}

.about-item:hover .icon-box {
    background: linear-gradient(135deg, #0487F9 0%, #066ACC 100%);
    box-shadow: 0 8px 20px rgba(4, 135, 249, 0.25);
}

.about-item .icon-box i {
    font-size: 22px;
    color: #0487F9;
    transition: color 0.35s ease;
}

.about-item:hover .icon-box i {
    color: #fff;
}

.about-item .icon-box:before {
    display: none;
}

.about-item .about-item-content {
    overflow: hidden;
    margin-left: 20px;
    flex: 1;
    min-width: 0;
}

.about-item .about-item-content h4 {
    font-size: 18px;
    line-height: 1.5;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.about-item .about-item-content h4 a {
    color: #2F2E41;
    transition: color 0.3s ease;
}

.about-item .about-item-content h4 a:hover {
    color: #0487F9;
}

.about-item .about-item-content p {
    font-size: 14px;
    line-height: 1.7;
    color: #888;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.about-item .about-item-content .text-muted {
    font-size: 13px;
    color: #B0B0B0;
    margin-top: 8px;
}

.about-item:hover .about-item-content h4 a {
    color: #0487F9;
}


/* ---------- 文章元信息栏 ---------- */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    font-size: 14px;
    color: #888;
    padding: 0 0 18px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(4, 135, 249, 0.15);
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-meta span i {
    color: #0487F9;
    font-size: 14px;
}


/* ---------- 文章正文排版 ---------- */
.article-body {
    color: #555;
    font-size: 16px;
    line-height: 1.9;
    word-break: break-word;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    color: #2F2E41;
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    line-height: 1.4;
}

.article-body h1 { font-size: 28px; }
.article-body h2 { font-size: 24px; }
.article-body h3 { font-size: 20px; }
.article-body h4 { font-size: 18px; }

.article-body h2:first-child,
.article-body h3:first-child,
.article-body h4:first-child {
    margin-top: 0;
}

.article-body p {
    margin-bottom: 1.2em;
    opacity: 0.92;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 16px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.article-body ul,
.article-body ol {
    padding-left: 1.5em;
    margin-bottom: 1.2em;
}

.article-body li {
    margin-bottom: 0.5em;
}

.article-body blockquote {
    border-left: 4px solid #0487F9;
    background: #F4F7FF;
    padding: 16px 24px;
    margin: 20px 0;
    border-radius: 0 6px 6px 0;
    color: #555;
    font-style: italic;
}

.article-body blockquote p {
    margin-bottom: 0;
}

.article-body code {
    background: #F4F7FF;
    color: #0487F9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-body pre {
    background: #F4F7FF;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin: 16px 0;
}

.article-body pre code {
    background: none;
    padding: 0;
    color: #555;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.article-body table th,
.article-body table td {
    border: 1px solid #E8ECF0;
    padding: 10px 14px;
    text-align: left;
}

.article-body table th {
    background: #F4F7FF;
    color: #2F2E41;
    font-weight: 600;
}

.article-body table tr:nth-child(even) td {
    background: #FAFBFF;
}

.article-body a {
    color: #0487F9;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-body a:hover {
    color: #066ACC;
}

.article-body hr {
    border: none;
    border-top: 1px solid #EEF2F6;
    margin: 28px 0;
}


/* ---------- 加载动画 ---------- */
.article-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #888;
}

.article-loading .spinner {
    width: 44px;
    height: 44px;
    border: 3px solid #E8F0FE;
    border-top-color: #0487F9;
    border-radius: 50%;
    animation: article-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes article-spin {
    to { transform: rotate(360deg); }
}

.article-loading p {
    font-size: 14px;
    margin: 0;
}

/* 加载骨架屏 */
.article-skeleton {
    background: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.article-skeleton .sk-line {
    height: 16px;
    border-radius: 8px;
    background: linear-gradient(90deg, #F0F3F8 25%, #E2E7F0 50%, #F0F3F8 75%);
    background-size: 200% 100%;
    animation: sk-shimmer 1.5s infinite;
    margin-bottom: 14px;
}

.article-skeleton .sk-line:last-child { width: 60%; }
.article-skeleton .sk-line:nth-child(2) { width: 85%; }
.article-skeleton .sk-line:nth-child(4) { width: 72%; }

.article-skeleton .sk-title {
    height: 28px;
    border-radius: 8px;
    width: 55%;
    background: linear-gradient(90deg, #E2E7F0 25%, #D0D6E0 50%, #E2E7F0 75%);
    background-size: 200% 100%;
    animation: sk-shimmer 1.5s infinite;
    margin-bottom: 20px;
}

@keyframes sk-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* ---------- 错误状态 ---------- */
.article-error {
    border-radius: 8px;
    padding: 50px 30px;
    text-align: center;
}

.article-error i {
    font-size: 48px;
    color: #D0D0D0;
    margin-bottom: 16px;
}

.article-error p {
    color: #999;
    font-size: 15px;
    margin-bottom: 20px;
}

.article-error .btn-retry {
    display: inline-block;
    padding: 10px 28px;
    background: #0487F9;
    color: #fff;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.article-error .btn-retry:hover {
    background: #066ACC;
    color: #fff;
}




/* ---------- 文章详情页：左侧内容 + 右侧侧边栏 ---------- */
.article-detail-section {
    position: relative;
    overflow: hidden;
}

.article-detail-section .container {
    max-width: 1290px;
}

/* 侧边栏 */
.article-sidebar {
    background: #F2F6FC;
    border-radius: 10px;
    padding: 28px 24px 24px;
    border: 1px solid #E4EAF3;
    position: sticky;
    top: 30px;
}

.sidebar-heading {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #DCE3EF;
    position: relative;
}

.sidebar-heading h3 {
    font-size: 17px;
    font-weight: 600;
    color: #2F2E41;
}

.sidebar-heading::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 36px;
    height: 2px;
    background: #0487F9;
    border-radius: 1px;
}

/* 侧边栏文章列表项 */
.sidebar-article-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #E2E8F1;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.sidebar-article-item:last-child {
    border-bottom: none;
}

.sidebar-article-item:hover {
    transform: translateX(4px);
}

.sidebar-article-item:hover .sidebar-article-title {
    color: #0487F9;
}

.sidebar-article-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 54px;
    border-radius: 6px;
    overflow: hidden;
    background: #F0F3F8;
}

.sidebar-article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-article-thumb .thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E8F0FE, #F4F7FF);
    color: #BDD4F8;
    font-size: 20px;
}

.sidebar-article-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sidebar-article-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    color: #2F2E41;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
    margin-bottom: 4px;
}

.sidebar-article-date {
    font-size: 12px;
    color: #B0B0B0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sidebar-article-date i {
    font-size: 11px;
}

.sidebar-more {
    padding-top: 4px;
}

.sidebar-more .btn-sm {
    padding: 8px 22px;
    font-size: 13px;
}

/* 侧边栏加载/空状态 */
.sidebar-list .article-loading {
    padding: 30px 0;
}

.sidebar-list .article-error {
    padding: 24px 0 8px;
    box-shadow: none;
    background: none;
}

.sidebar-list .article-error i {
    font-size: 28px;
    color: #BCC7D6;
}

.sidebar-list .article-error p {
    font-size: 13px;
}

.sidebar-list .article-error .btn-retry {
    padding: 6px 18px;
    font-size: 12px;
}


/* ---------- 相关推荐区域 ---------- */
.related-articles-section .section-heading h2 {
    font-size: 32px;
}

.related-articles-section .about-item {
    margin-bottom: 0;
}


/* ---------- 订阅区域增强 (articleList) ---------- */
.pricing-box {
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.pricing-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(4, 135, 249, 0.12);
}

.subscribe-form .sub-form {
    position: relative;
    max-width: 360px;
}

.subscribe-form .form-control {
    height: 50px;
    border-radius: 30px;
    border: 1px solid #E0E6F0;
    padding: 0 130px 0 22px;
    font-size: 14px;
    background: #fff;
    transition: all 0.3s ease;
}

.subscribe-form .form-control:focus {
    border-color: #0487F9;
    box-shadow: 0 0 0 3px rgba(4, 135, 249, 0.08);
}

.subscribe-form .sub-form a {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 40px;
    height: 40px;
    background: #0487F9;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.subscribe-form .sub-form a:hover {
    background: #066ACC;
    color: #fff;
    transform: scale(1.05);
}


/* ---------- 面包屑优化 ---------- */
.page-banner-content ul.list-inline li,
.page-banner-content ul.list-inline li a {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.3s ease;
}

.page-banner-content ul.list-inline li a:hover {
    color: #fff;
}

.page-banner-content ul.list-inline li i {
    font-size: 12px;
    margin: 0 6px;
    color: rgba(255, 255, 255, 0.5);
}


/* ---------- 列表工具栏：搜索 + 刷新 ---------- */
.article-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.article-search-box {
    position: relative;
    flex: 1;
    max-width: 420px;
    min-width: 240px;
}

.article-search-box input {
    width: 100%;
    height: 48px;
    border-radius: 28px;
    border: 1px solid #DEE5F0;
    padding: 0 100px 0 20px;
    font-size: 14px;
    color: #2F2E41;
    background: #fff;
    outline: none;
    transition: all 0.3s ease;
}

.article-search-box input:focus {
    border-color: #0487F9;
    box-shadow: 0 0 0 3px rgba(4, 135, 249, 0.08);
}

.article-search-box input::placeholder {
    color: #BFBFBF;
}

.article-search-box .search-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    height: 40px;
    padding: 0 22px;
    border-radius: 24px;
    background: #0487F9;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.article-search-box .search-btn:hover {
    background: #066ACC;
}

.article-search-box .search-clear {
    position: absolute;
    right: 106px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: #E8ECF2;
    color: #999;
    font-size: 10px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.article-search-box .search-clear:hover {
    background: #CCC;
    color: #666;
}

.article-search-box .search-clear.visible {
    display: flex;
}

.article-toolbar .btn-refresh {
    height: 48px;
    width: 48px;
    border-radius: 50%;
    border: 1px solid #DEE5F0;
    background: #fff;
    color: #0487F9;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.article-toolbar .btn-refresh:hover {
    background: #0487F9;
    color: #fff;
    border-color: #0487F9;
}

.article-toolbar .btn-refresh.spinning i {
    animation: btn-spin 0.6s linear;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}


/* ---------- 分页器 ---------- */
.article-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.article-pagination .page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid #E0E6F0;
    background: #fff;
    color: #2F2E41;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.article-pagination .page-btn:hover:not(:disabled) {
    background: #0487F9;
    color: #fff;
    border-color: #0487F9;
}

.article-pagination .page-btn.active {
    background: #0487F9;
    color: #fff;
    border-color: #0487F9;
}

.article-pagination .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.article-pagination .page-ellipsis {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #B0B0B0;
    font-size: 14px;
    user-select: none;
}

.article-pagination .page-info {
    margin-left: 12px;
    font-size: 13px;
    color: #B0B0B0;
}


/* ---------- 响应式 ---------- */
@media (max-width: 991px) {
    .about-item {
        padding: 22px 18px;
    }

    .about-item .icon-box {
        width: 48px;
        height: 48px;
    }

    .about-item .icon-box i {
        font-size: 18px;
    }

    .about-item .about-item-content {
        margin-left: 16px;
    }

    .article-body {
        font-size: 15px;
        line-height: 1.8;
    }

    .article-body h1 { font-size: 24px; }
    .article-body h2 { font-size: 20px; }
    .article-body h3 { font-size: 18px; }

    .article-meta {
        padding-bottom: 14px;
        gap: 14px;
        font-size: 13px;
    }

    .article-card-body {
        padding: 16px 18px 14px;
    }

    .article-card-body h4 {
        font-size: 15px;
    }

    .article-card-body p {
        font-size: 13px;
    }

    .article-toolbar {
        flex-direction: column;
    }

    .article-search-box {
        max-width: 100%;
    }

    .article-sidebar {
        position: static;
        margin-top: 20px;
    }

    .sidebar-article-thumb {
        width: 60px;
        height: 48px;
    }

    .sidebar-article-title {
        font-size: 13px;
    }
}

@media (max-width: 767px) {
    .about-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px 16px;
    }

    .about-item .icon-box {
        margin-bottom: 14px;
    }

    .about-item .about-item-content {
        margin-left: 0;
    }

    .about-item .about-item-content h4 {
        white-space: normal;
        font-size: 16px;
    }

    .article-body {
        font-size: 14px;
        line-height: 1.7;
    }

    .article-body h1 { font-size: 22px; }
    .article-body h2 { font-size: 18px; }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .article-card-body h4 {
        font-size: 14px;
    }

    .article-card-body p {
        -webkit-line-clamp: 3;
    }

    .article-pagination .page-info {
        display: none;
    }

    .article-search-box .search-btn {
        padding: 0 14px;
        font-size: 13px;
    }

    .article-search-box .search-btn span,
    .article-search-box .search-btn i + span {
        display: none;
    }

    .article-search-box .search-clear {
        right: 92px;
    }

    .article-sidebar {
        padding: 18px 14px;
    }

    .sidebar-article-item {
        gap: 10px;
        padding: 10px 0;
    }
}
