/* ========================================
 * article.css - 新闻内页样式
 * ======================================== */

/* ---- 文章布局 ---- */
.article-layout {
    max-width: var(--maxWidth);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.article-main {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    padding: 40px 48px;
    margin-bottom: 40px;
}

.article-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 136px;
}

/* ---- 文章头部 ---- */
.article-header {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 24px;
    margin-bottom: 32px;
}

.article-tag {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 13px;
    color: #fff;
    font-weight: 500;
    margin-bottom: 16px;
}

.article-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--color-text-dark);
    line-height: 1.4;
    margin-bottom: 20px;
}

.article-subtitle {
    font-size: 16px;
    color: var(--color-text-gray);
    line-height: 1.6;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 14px;
    color: var(--color-text-light);
}

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

.article-meta svg {
    width: 16px;
    height: 16px;
}

.article-meta .author {
    color: var(--color-text-dark);
    font-weight: 500;
}

.article-meta .share-buttons {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.share-btn:hover {
    background: var(--color-primary);
}

.share-btn:hover svg {
    color: #fff;
}

.share-btn:hover svg path,
.share-btn:hover svg circle {
    fill: #fff;
}

.share-btn svg {
    width: 18px;
    height: 18px;
    color: var(--color-text-gray);
    transition: color 0.2s;
}

/* ---- 文章内容 ---- */
.article-body {
    font-size: 16px;
    line-height: 2;
    color: #444;
}

.article-body p {
    margin-bottom: 24px;
    text-align: justify;
}

.article-body h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text-dark);
    margin: 36px 0 20px;
    padding-left: 16px;
    border-left: 4px solid var(--color-primary);
}

.article-body h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-dark);
    margin: 28px 0 16px;
}

.article-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 24px 0;
    display: block;
}

.article-body blockquote {
    background: #FFF6D4;
    border-left: 4px solid var(--color-primary);
    padding: 16px 24px;
    margin: 24px 0;
    border-radius: 0 8px 8px 0;
    color: var(--color-text-dark);
    font-size: 15px;
}

.article-body ul,
.article-body ol {
    margin: 16px 0 24px 20px;
}

.article-body ul li {
    list-style: disc;
    margin-bottom: 8px;
}

.article-body ol li {
    list-style: decimal;
    margin-bottom: 8px;
}

.article-body strong {
    font-weight: 600;
    color: var(--color-text-dark);
}

.article-body a {
    color: var(--color-primary);
    text-decoration: underline;
}

.article-body table {
    width: 100%;
    margin: 24px 0;
    border-radius: 8px;
    overflow: hidden;
}

.article-body table th {
    background: var(--color-card-bg);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--color-text-dark);
    border: 1px solid var(--color-border);
}

.article-body table td {
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    color: #555;
}

/* ---- 文章图片占位 ---- */
.article-image-block {
    margin: 32px 0;
    text-align: center;
}

.article-image-block .img-placeholder {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    font-size: 14px;
}

.article-image-block .img-caption {
    margin-top: 12px;
    font-size: 13px;
    color: var(--color-text-light);
    text-align: center;
}

/* ---- 文章底部 ---- */
.article-footer {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}

.article-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.article-tags .tag-label {
    font-size: 14px;
    color: var(--color-text-gray);
    font-weight: 500;
}

.article-tags .tag {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    color: var(--color-text-gray);
    background: var(--color-card-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.article-tags .tag:hover {
    color: #fff;
    background: var(--color-primary);
}

/* 点赞收藏 */
.article-actions {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 32px 0;
    border-top: 1px solid var(--color-border);
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: none;
}

.action-btn .action-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.action-btn:hover .action-icon {
    background: var(--color-primary);
    transform: scale(1.05);
}

.action-btn:hover .action-icon svg {
    color: #fff;
}

.action-btn.active .action-icon {
    background: var(--color-primary);
}

.action-btn.active .action-icon svg {
    color: #fff;
}

.action-btn .action-icon svg {
    width: 24px;
    height: 24px;
    color: var(--color-text-gray);
    transition: color 0.2s;
}

.action-btn .action-text {
    font-size: 13px;
    color: var(--color-text-light);
}

.action-btn:hover .action-text {
    color: var(--color-primary);
}

/* 上下篇导航 */
.article-nav {
    display: flex;
    gap: 20px;
    margin-top: 32px;
}

.article-nav .nav-item {
    flex: 1;
    padding: 20px 24px;
    border-radius: 12px;
    background: var(--color-card-bg);
    cursor: pointer;
    transition: all 0.2s;
}

.article-nav .nav-item:hover {
    background: #FFF6D4;
}

.article-nav .nav-label {
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-nav .nav-title {
    font-size: 15px;
    color: var(--color-text-dark);
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.article-nav .nav-item:hover .nav-title {
    color: var(--color-primary);
}

.article-nav .nav-next {
    text-align: right;
}

.article-nav .nav-next .nav-label {
    justify-content: flex-end;
}

/* ---- 侧边栏 ---- */
.sidebar-block {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    padding: 24px;
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--color-primary);
    border-radius: 2px;
}

/* 相关推荐 */
.related-list .related-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
}

.related-list .related-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.related-list .related-item:first-child {
    padding-top: 0;
}

.related-list .related-item:hover .related-title {
    color: var(--color-primary);
}

.related-thumb {
    width: 90px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-info {
    flex: 1;
    min-width: 0;
}

.related-title {
    font-size: 14px;
    color: var(--color-text-dark);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.related-date {
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 6px;
}

/* 热门排行 */
.hot-list .hot-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
}

.hot-list .hot-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hot-list .hot-item:first-child {
    padding-top: 0;
}

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

.hot-list .hot-item:hover .hot-title {
    color: var(--color-primary);
}

.hot-rank {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    background: var(--color-text-light);
}

.hot-rank.rank-1 { background: #E74C3C; }
.hot-rank.rank-2 { background: #E67E22; }
.hot-rank.rank-3 { background: #F1C40F; color: #333; }

.hot-title {
    font-size: 14px;
    color: var(--color-text-dark);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.hot-meta {
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 4px;
}

/* ---- 分享弹窗 ---- */
.share-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.share-toast.show {
    opacity: 1;
}

/* 微信分享弹窗 */
.wechat-share-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

.wechat-share-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    width: 360px;
    max-width: 90vw;
    z-index: 9999;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.wechat-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-dark);
}

.wechat-share-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    color: var(--color-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.wechat-share-close:hover {
    background: var(--color-card-bg);
    color: var(--color-text-dark);
}

.wechat-share-body {
    padding: 24px 20px;
    text-align: center;
}

.wechat-share-body > p {
    font-size: 14px;
    color: var(--color-text-gray);
    margin-bottom: 20px;
}

.wechat-share-qrcode {
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wechat-share-qrcode img {
    width: 100%;
    height: 100%;
}

.wechat-share-url {
    display: flex;
    gap: 8px;
}

.wechat-share-url input {
    flex: 1;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--color-text-gray);
    background: var(--color-card-bg);
}

.wechat-share-url button {
    padding: 0 16px;
    height: 38px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.wechat-share-url button:hover {
    background: #e8850e;
}

.wechat-share-url button.copied {
    background: #27ae60;
}
