/* 
 * article.css - 文章详情页独有样式
 * 依赖：需在 HTML 中先加载 style.css
 */

/* ==================== 防止图片放大时页面抖动（独有处理） ==================== */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
	 scroll-behavior: smooth;
}

/* ==================== 文章详情模块 ==================== */
.article-detail {
    background: #fff;
    border-radius: 8px;
    padding: 24px 28px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    margin-bottom: 14px;
}

/* 文章头部 */
.article-header {
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 18px;
}
.article-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 14px;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-light);
    flex-wrap: wrap;
}
.article-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.article-meta-icon {
    color: var(--primary-red);
    font-size: 14px;
}
.article-meta-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.article-meta-tag {
    background: #fff1f1;
    color: var(--primary-red);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    transition: all 0.2s;
}
.article-meta-tag:hover {
    background: var(--primary-red);
    color: #fff;
}

/* 文章内容 */
.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
}
.article-content p {
    margin-bottom: 2px;
    text-align: justify;
}
.article-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
	background: url(/soft/loading.svg) no-repeat center/contain;
}
.article-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.article-content h2 {
    font-size: 20px;
    font-weight: bold;
    margin: 28px 0 14px;
    color: var(--primary-red);
    padding-left: 10px;
    border-left: 4px solid var(--primary-red);
}
.article-content h3 {
    font-size: 18px;
    font-weight: bold;
    margin: 24px 0 12px;
    color: #333;
}

/* ==================== VIP特权区域 ==================== */
.privilege-section {
    background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
    border: 2px solid var(--premium-gold);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
	scroll-margin-top: 70px; 

}
.privilege-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--premium-gradient);
}
.privilege-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    justify-content: flex-start;
    text-align: left;
}
.privilege-icon {
    width: 48px;
    height: 48px;
    background: var(--premium-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
    flex-shrink: 0;
}
.privilege-title {
    flex: initial;
}
.privilege-title h3 {
    font-size: 18px;
    font-weight: bold;
    color: var(--premium-gold);
    margin: 0 0 4px 0;
}
.privilege-title p {
    font-size: 13px;
   background:var(--primary-red);
   padding-left:10px;
    padding-top:1px;
	padding-right:10px;
    margin: 0;
	color:#fff;
}

/* ==================== 资源免责声明区域 ==================== */
.disclaimer-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    margin-bottom: 14px;
    border-left: 4px solid var(--primary-red);
}
.disclaimer-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.disclaimer-title::before {
    content: '⚠️';
    font-size: 18px;
}
.disclaimer-content {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-light);
}
.disclaimer-content ol {
    margin: 0;
    padding-left: 22px;
}
.disclaimer-content li {
    margin-bottom: 4px;
    text-align: justify;
}
.disclaimer-content li:last-child {
    margin-bottom: 0;
}

/* ==================== 二维码提示区域 ==================== */
.qr-code-tip {
    display: flex;
    gap: 24px;
    background: #fafafa;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    align-items: center;
}
.qr-code-placeholder {
    width: 130px;
    height: 130px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid #ddd;
}
/* 二维码提示区域 - 修复图片变形 */
.qr-icon {
    font-size: 40px;
    /* margin-bottom: 6px; */
    /* 新增：让内部元素居中对齐 */
    display: flex;
    align-items: center;
    justify-content: center;
    /* 新增：限制容器尺寸，避免图片撑破 */
    width: 100%;
    height: auto;
    max-height: 120px; /* 与原字体大小匹配，保持视觉一致 */
}

/* 新增：强制图片自适应容器，不拉伸变形 */
.qr-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 保持图片宽高比，不裁剪、不拉伸 */
    display: block; /* 消除图片默认行内间隙 */
}

.qr-text {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    line-height: 1.4;
}
.qr-instructions {
    flex: 1;
}
.qr-instructions p {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 12px;
}
.qr-instructions ol {
    margin: 0;
    padding-left: 22px;
}
.qr-instructions li {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
    line-height: 1.6;
}

/* ==================== 验证码区域 ==================== */
.verification-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    margin-bottom: 14px;
}
.verification-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.verification-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary-red);
    border-radius: 2px;
}
.verification-box {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}
.verification-input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.2s;
    outline: none !important;
}

.verification-btn-group {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.verification-btn {
    background: var(--primary-red);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.verification-btn:hover {
    background: #a00000;
    transform: translateY(-1px);
}
.verification-btn.reset-btn {
    background: #666;
}
.verification-btn.reset-btn:hover {
    background: #444;
    transform: translateY(-1px);
}
.verification-tip {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-light);
}
.verification-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
    padding: 12px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

/* ==================== 下载列表区域 ==================== */
.download-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    margin-bottom: 14px;
}
.download-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.download-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary-red);
    border-radius: 2px;
}
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.download-empty {
    display: none;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 14px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
}
.download-grid:empty + .download-empty {
    display: block;
}
.download-item {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0;
    transition: all 0.2s;
    display: flex;
}
.download-item:hover {
    border-color: var(--primary-red);
    box-shadow: 0 4px 12px rgba(192,0,0,0.1);
    transform: translateY(-2px);
}
.download-item-btn {
    background: var(--primary-red);
    color: #fff;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.download-item-btn:hover {
    background: #a00000;
}

/* 专属下载区特殊样式 */
.premium-download-section {
    background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
    border: 2px solid var(--premium-gold);
}
.premium-download-section .download-title::before {
    background: var(--premium-gold);
}
.premium-badge {
    display: inline-block;
    background: var(--premium-gold);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 8px;
    vertical-align: middle;
}
.premium-item {
    border-color: var(--premium-gold);
    background: #fff9e6;
}
.premium-item:hover {
    border-color: var(--premium-gold);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}
.premium-item .download-item-btn {
    background: var(--premium-gold);
}
.premium-item .download-item-btn:hover {
    background: #f57c00;
}

/* ==================== 上下篇导航 ==================== */
.article-pagination {
    background: #fff;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    overflow: hidden;
}
.article-pagination-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    background: #fff;
    position: relative;
    min-height: 90px;
}
.article-pagination-item:hover {
    background: #fafafa;
}
.article-pagination-item.prev {
    border-right: 1px solid var(--border-color);
}
.article-pagination-item.next {
    justify-content: flex-end;
}
.article-pagination-item.next .article-pagination-text {
    text-align: right;
}
.article-pagination-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-red) 0%, #a00000 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(192, 0, 0, 0.25);
}
.article-pagination-item:hover .article-pagination-icon {
    transform: scale(1.12);
    box-shadow: 0 6px 16px rgba(192, 0, 0, 0.35);
}
.article-pagination-item.prev:hover .article-pagination-icon {
    transform: translateX(-4px) scale(1.12);
}
.article-pagination-item.next:hover .article-pagination-icon {
    transform: translateX(4px) scale(1.12);
}
.article-pagination-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.article-pagination-label {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.article-pagination-label::before {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--primary-red);
    border-radius: 50%;
}
.article-pagination-item.next .article-pagination-label {
    justify-content: flex-end;
}
.article-pagination-item.next .article-pagination-label::before {
    display: none;
}
.article-pagination-item.next .article-pagination-label::after {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--primary-red);
    border-radius: 50%;
}
.article-pagination-title {
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
    font-weight: 500;
}
.article-pagination-item:hover .article-pagination-title {
    color: var(--primary-red);
}
.article-pagination-item:only-child {
    grid-column: 1 / -1;
}
.article-pagination-item.empty {
    opacity: 0.5;
    pointer-events: none;
    background: #fafafa;
}
.article-pagination-item.empty .article-pagination-icon {
    background: #ddd;
    box-shadow: none;
}

/* ==================== 图片查看器 ==================== */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.3s ease;
    padding-right: calc(100vw - 100%); 
}
.image-viewer.active {
    display: flex;
}
.image-viewer img {
    max-width: 88%;
    max-height: 88%;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    cursor: default;
    animation: zoomIn 0.3s ease;
    object-fit: contain;
    z-index: 10;
}
.image-viewer-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    z-index: 20;
}
.image-viewer-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}
.image-viewer-tip {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    z-index: 20;
}
.image-viewer-nav {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 15;
}
.image-viewer-nav-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    pointer-events: auto;
}
.image-viewer-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes zoomIn {
    from { 
        opacity: 0; 
        transform: scale(0.85);
    }
    to { 
        opacity: 1; 
        transform: scale(1);
    }
}

/* ==================== 移动端适配（文章模块独有） ==================== */
@media (max-width: 768px) {
    html {
        scrollbar-gutter: auto;
    }
    .article-detail, .verification-section, .download-section, .privilege-section, .disclaimer-section {
        padding: 14px 16px;
        margin-bottom: 10px;
        border-radius: 6px;
    }
    .article-title {
        font-size: 18px;
    }
    .article-meta {
        gap: 10px;
        font-size: 12px;
    }
    .article-content {
        font-size: 15px;
        line-height: 1.7;
    }
    .article-content h2 {
        font-size: 17px;
        margin: 22px 0 12px;
    }
    .article-content h3 {
        font-size: 16px;
        margin: 18px 0 10px;
    }
    .privilege-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        justify-content: center;
    }
    .disclaimer-title {
        font-size: 15px;
        margin-bottom: 10px;
    }
    .disclaimer-content {
        font-size: 12px;
    }
    .disclaimer-content ol {
        padding-left: 20px;
    }
    .verification-box {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .verification-btn-group {
        width: 100%;
        justify-content: space-between;
    }
    .verification-btn {
        flex: 1;
        padding: 11px 0;
        font-size: 14px;
    }
    .verification-btn.reset-btn {
        margin-left: 8px;
    }
    .download-empty {
        padding: 30px 16px;
        font-size: 13px;
    }
    .download-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    .image-viewer {
        padding-right: 0;
    }
    .image-viewer img {
        max-width: 92%;
        max-height: 92%;
    }
    .image-viewer-close {
        top: 16px;
        right: 16px;
        width: 38px;
        height: 38px;
        font-size: 22px;
    }
    .image-viewer-tip {
        bottom: 16px;
        font-size: 12px;
        padding: 6px 12px;
    }
    .image-viewer-nav {
        padding: 0 10px;
    }
    .image-viewer-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .qr-code-tip {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    .qr-code-placeholder {
        width: 110px;
        height: 110px;
    }
    .qr-icon {
        font-size: 34px;
        max-height: 120px; /* 与移动端字体大小匹配 */
    }
    .qr-instructions p {
        text-align: center;
    }
    .verification-input {
        min-width: auto;
        padding: 11px 14px;
    }
    .download-item-btn {
        padding: 11px 12px;
        font-size: 13px;
    }
    .article-pagination {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .article-pagination-item {
        padding: 16px 18px;
        min-height: 80px;
    }
    .article-pagination-item.prev {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .article-pagination-item.next {
        justify-content: flex-start;
    }
    .article-pagination-item.next .article-pagination-text {
        text-align: left;
    }
    .article-pagination-item.next .article-pagination-label {
        justify-content: flex-start;
    }
    .article-pagination-item.next .article-pagination-label::after {
        display: none;
    }
    .article-pagination-item.next .article-pagination-label::before {
        display: block;
    }
    .article-pagination-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    .article-pagination-title {
        font-size: 14px;
    }
}