/* ============================================
   房颤康复分享网站 - 主样式表
   版本: 2.0
   作者: 重新优化版
   ============================================ */

/* ---------- 1. CSS重置与基础样式 ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    font-size: 17px;
    line-height: 1.8;
    color: #333;
    background-color: #e7e8eb;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 0 50px;
    overflow-x: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    border: 0;
    pointer-events: none;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
}

/* ---------- 2. 导航栏样式 ---------- */
.nav-bar {
    background-color: #f8f8f8;
    border-bottom: 1px solid #d8d8d8;
    padding: 10px 15px;
}

.nav-items {
    display: flex;
    gap: 20px;
}

.nav-items li a {
    font-size: 15px;
    color: #333;
    padding: 5px 0;
}

.nav-items li a:hover {
    color: #3990e6;
}

/* ---------- 3. 主容器样式 ---------- */
.main-container {
    background-color: #fff;
    padding: 15px;
}

/* ---------- 4. 文章头部样式 ---------- */
.article-header {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.article-title {
    font-size: 22px;
    font-weight: bold;
    line-height: 1.5;
    color: #333;
    margin-bottom: 15px;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #999;
}

.meta-source {
    color: #666;
}

.meta-views {
    color: #999;
}

/* ---------- 5. 文章正文样式 ---------- */
.article-content {
    font-size: 17px;
    line-height: 1.9;
    color: #444;
}

.article-content p {
    margin-bottom: 15px;
    text-align: justify;
}

/* 标题样式 */
.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 25px 0 15px;
    padding-left: 10px;
    border-left: 4px solid #F44336;
}

.subsection-title {
    font-size: 16px;
    font-weight: bold;
    color: #000;
    margin: 20px 0 10px;
}

/* 高亮样式 */
.highlight-red {
    color: #F44336;
    font-weight: bold;
}

.highlight-yellow {
    color: #F44336;
    background-color: #FFEB3B;
    padding: 2px 5px;
    font-weight: bold;
}

/* 图片样式 */
.article-image {
    margin: 20px 0;
    text-align: center;
}

.article-image img {
    width: 95%;
    border-radius: 4px;
}

.article-image figcaption {
    font-size: 14px;
    color: #888;
    margin-top: 8px;
}

/* 微信按钮样式 */
.wechat-btn-wrapper {
    display: inline-block;
    margin: 0 3px;
}

.wechat-btn {
    background-color: #FFD700;
    color: #F44336;
    font-weight: bold;
    font-size: 16px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wechat-btn:hover {
    background-color: #7edbf7;
}

/* ---------- 6. 评论区样式 ---------- */
.comments-section {
    margin-top: 40px;
    padding-top: 20px;
}

/* 分割线 */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background-color: #333;
    max-width: 40%;
}

.divider-title {
    font-size: 20px;
    font-weight: normal;
    padding: 0 15px;
    color: #333;
}

/* 评论列表 */
.comments-list {
    padding: 0;
}

.comment-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
}

.comment-info {
    display: flex;
    flex-direction: column;
}

.comment-name {
    font-size: 15px;
    color: #3364f7;
    font-weight: 500;
}

.comment-time {
    font-size: 12px;
    color: #777;
    margin-top: 2px;
}

.comment-content {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    margin-left: 52px;
    text-align: justify;
}

/* ---------- 7. 底部占位 ---------- */
.footer-spacer {
    height: 80px;
}

/* ---------- 8. 微信弹窗样式 ---------- */
.wechat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.wechat-modal.active {
    display: flex;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 320px;
    position: relative;
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    font-size: 22px;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

.modal-close:hover {
    color: #666;
}

.modal-body {
    padding: 20px;
}

.modal-title {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.wechat-display {
    background-color: #f7f7f7;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin-bottom: 15px;
}

.wechat-label {
    color: #666;
    font-size: 15px;
}

.wechat-number {
    font-weight: bold;
    background-color: #FFD700;
    padding: 2px 6px;
    border-radius: 3px;
    color: #F44336;
}

.copy-btn {
    display: block;
    width: 100%;
    background-color: #1aad17;
    color: #fff;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.copy-btn:hover {
    opacity: 0.9;
}

/* 复制成功步骤 */
.modal-step {
    transition: opacity 0.3s;
}

.modal-step-show {
    display: block;
}

.modal-step-hide {
    display: none;
}

.success-icon {
    text-align: center;
    margin-bottom: 10px;
}

.success-icon img {
    width: 50px;
    height: 50px;
}

.success-title {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.success-info {
    text-align: center;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.open-wechat-btn {
    display: block;
    width: 100%;
    background-color: #1aad17;
    color: #fff;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.open-wechat-btn:hover {
    opacity: 0.9;
}

.modal-footer {
    padding: 0 20px 20px;
    text-align: center;
}

.modal-footer img {
    max-width: 100%;
    border-radius: 4px;
}

/* ---------- 9. 复制提示样式 ---------- */
.copy-tooltip {
    position: absolute;
    background: rgba(82, 82, 82, 1);
    color: #fff;
    line-height: 40px;
    text-align: center;
    font-size: 14px;
    left: 50%;
    top: -50px;
    transform: translateX(-50%);
    width: 60px;
    border-radius: 5px;
    z-index: 100;
}

.copy-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(82, 82, 82, 1);
}

/* ---------- 10. 响应式适配 ---------- */
@media (max-width: 640px) {
    body {
        font-size: 16px;
    }
    
    .article-title {
        font-size: 20px;
    }
    
    .article-content {
        font-size: 16px;
    }
    
    .section-title {
        font-size: 17px;
    }
    
    .comment-content {
        font-size: 14px;
    }
}

/* ---------- 11. 动画效果 ---------- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.wechat-modal.active .modal-content {
    animation: fadeIn 0.3s ease-out;
}

/* ---------- 12. 辅助类 ---------- */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.clearfix::after {
    content: '';
    display: table;
    clear: both;
}
