/* 
 * 内容格式化样式 - 公共样式文件
 * 用于文章页面和网站详情页面的内容格式化
 */

/* 内容区域基础样式 */
.website-detail-content,
.entry-content {
    line-height: 1.6;
    color: var(--text-secondary);
}

/* 多级标题样式 */
.website-detail-content h1,
.entry-content h1 {
    font-size: 1.5rem;
    margin: 1.8rem 0 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    padding-left: 15px;
    border-left: 4px solid var(--primary-color);
}

.website-detail-content h2,
.entry-content h2 {
    font-size: 1.3rem;
    margin: 1.6rem 0 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 8px;
    border-bottom: none;
}

.website-detail-content h3,
.entry-content h3 {
    font-size: 1.1rem;
    margin: 1.4rem 0 1rem;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
}

.website-detail-content h3:before,
.entry-content h3:before {
    content: "■";
    color: var(--primary-color);
    margin-right: 8px;
    font-size: 0.8rem;
    position: relative;
    top: -2px;
}

.website-detail-content h4,
.entry-content h4 {
    font-size: 1rem;
    margin: 1.2rem 0 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.website-detail-content h5,
.website-detail-content h6,
.entry-content h5,
.entry-content h6 {
    font-size: 0.95rem;
    margin: 1rem 0 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
}

.website-detail-content h1:first-child,
.website-detail-content h2:first-child,
.website-detail-content h3:first-child,
.website-detail-content h4:first-child,
.website-detail-content h5:first-child,
.website-detail-content h6:first-child,
.entry-content h1:first-child,
.entry-content h2:first-child,
.entry-content h3:first-child,
.entry-content h4:first-child,
.entry-content h5:first-child,
.entry-content h6:first-child {
    margin-top: 0;
}

/* 段落样式 */
.website-detail-content p,
.entry-content p {
    margin: 0 0 1.2rem;
    line-height: 1.8;
    font-size: 1rem;
    color: var(--content-p-color);
    text-align: justify;
}

/* 链接样式 */
.website-detail-content a,
.entry-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px dashed var(--primary-color);
}

.website-detail-content a:hover,
.entry-content a:hover {
    opacity: 0.8;
    border-bottom-style: solid;
}

/* 列表样式 */
.website-detail-content ul,
.website-detail-content ol,
.entry-content ul,
.entry-content ol {
    margin: 1rem 0 1.5rem;
    padding-left: 1.5rem;
}

/* 无序列表样式 */
.website-detail-content ul,
.entry-content ul {
    list-style-type: none;
}

.website-detail-content ul li,
.entry-content ul li {
    position: relative;
    padding-left: 1.2rem;
}

.website-detail-content ul li:before,
.entry-content ul li:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #808080;
}

/* 有序列表样式 */
.website-detail-content ol,
.entry-content ol {
    counter-reset: list-counter;
    list-style-type: none;
}

.website-detail-content ol li,
.entry-content ol li {
    counter-increment: list-counter;
    position: relative;
    padding-left: 1.8rem;
}

.website-detail-content ol li:before,
.entry-content ol li:before {
    content: counter(list-counter) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 600;
    color: #808080;
}

.website-detail-content li,
.entry-content li {
    margin-bottom: 0.7rem;
    line-height: 1.7;
}

/* 嵌套列表样式 */
.website-detail-content ul ul,
.website-detail-content ol ol,
.website-detail-content ul ol,
.website-detail-content ol ul,
.entry-content ul ul,
.entry-content ol ol,
.entry-content ul ol,
.entry-content ol ul {
    margin: 0.5rem 0 0.5rem 0.5rem;
}

.website-detail-content ul ul li:before,
.entry-content ul ul li:before {
    background-color: var(--text-secondary);
    width: 5px;
    height: 5px;
}

/* 强调文本样式 */
.website-detail-content strong,
.entry-content strong {
    color: var(--content-strong-color);
    font-weight: 600;
}

/* 引用样式 */
.website-detail-content blockquote,
.entry-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--primary-color);
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.light-mode .website-detail-content blockquote,
.light-mode .entry-content blockquote {
    background-color: rgba(0, 0, 0, 0.03);
}

/* 代码样式 */
.website-detail-content code,
.entry-content code {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

.light-mode .website-detail-content code,
.light-mode .entry-content code {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 代码块样式 */
.website-detail-content pre,
.entry-content pre {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.light-mode .website-detail-content pre,
.light-mode .entry-content pre {
    background-color: rgba(0, 0, 0, 0.03);
}

.website-detail-content pre code,
.entry-content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

/* 图片样式 */
.website-detail-content .content-img,
.entry-content .content-img {
    margin: 1.5rem 0;
}

.website-detail-content .content-img img,
.entry-content .content-img img,
.website-detail-content img,
.entry-content img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 移动端响应式调整 */
@media (max-width: 767px) {
    .website-detail-content h1,
    .entry-content h1 {
        font-size: 1.3rem;
    }
    
    .website-detail-content h2,
    .entry-content h2 {
        font-size: 1.2rem;
    }
    
    .website-detail-content h3,
    .entry-content h3 {
        font-size: 1.1rem;
    }
    
    .website-detail-content p,
    .entry-content p {
        font-size: 0.95rem;
    }
}
