/* 文章页面优化样式 */
article {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    margin-bottom: 20px;
}

article h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.4;
    color: #141518;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #1890ff;
}

.article-meta {
    display: flex;
    gap: 20px;
    padding: 12px 0;
    margin: 10px 0 20px;
    border-bottom: 1px solid #ebeef0;
    color: #8c8c8c;
    font-size: 13px;
    flex-wrap: wrap;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #434343;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.article-cover {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

.article-cover img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    box-shadow: none;
}

/* 标签样式优化 */
.label-primary {
    background: #1890ff;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
    margin: 2px;
    transition: all .2s;
}

.label-primary:hover {
    background: #096dd9;
    transform: translateY(-1px);
}

/* 相关文章样式优化 */
.panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    border: none;
}

.panel-heading {
    background: #fafafa;
    border-bottom: 1px solid #ebeef0;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #141518;
}

.panel-body {
    padding: 20px;
}

/* 侧边栏卡片优化 */
.sidebar-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header-custom {
    background: #fafafa;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #141518;
    border-bottom: 1px solid #ebeef0;
}

.card-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    color: #434343;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    transition: all .2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-list a:hover {
    background: #f5f5f5;
    color: #1890ff;
    padding-left: 24px;
}

.card-list a:last-child {
    border-bottom: none;
}

/* 评论表单优化 */
.form-control {
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    transition: all .2s;
}

.form-control:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,.1);
    outline: none;
}

.btn-primary {
    background: #1890ff;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}

.btn-primary:hover {
    background: #096dd9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(24,144,255,.3);
}

/* ===== Related Articles Card Style ===== */
.related-articles-modern {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.related-articles-modern .section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    color: var(--dark);
}
.related-articles-modern .section-title i {
    color: var(--primary);
    margin-right: 8px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.related-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: all .3s;
    background: #fff;
}
.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    text-decoration: none;
    color: inherit;
}
.related-card-img {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: var(--gray-100);
}
.related-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.related-card:hover .related-card-img img {
    transform: scale(1.05);
}
.related-card-body {
    padding: 12px;
}
.related-card-body h4 {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0 0 8px 0;
    color: var(--dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-date {
    font-size: 12px;
    color: var(--gray-500);
}
.related-date i {
    margin-right: 4px;
}

@media (max-width: 768px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .related-card-img {
        height: 100px;
    }
}

/* ===== Comment Form Modern Style ===== */
.comment-form-modern {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    margin-top: 30px;
}
.comment-form-modern .section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    color: var(--dark);
}
.comment-form-modern .section-title i {
    color: var(--primary);
    margin-right: 8px;
}
.form-control-modern {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    transition: all .2s;
    background: #fff;
    box-sizing: border-box;
}
.form-control-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24,144,255,.1);
}
.form-control-modern::placeholder {
    color: var(--gray-400);
}
.comment-form-modern label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 13px;
}
.comment-form-modern label i {
    color: var(--primary);
    margin-right: 4px;
}
.comment-form-modern .required {
    color: var(--error);
}
.comment-form-modern .form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}
.comment-form-modern .form-row .form-group {
    flex: 1;
}
.comment-form-modern .form-group {
    margin-bottom: 16px;
}
.btn-submit-modern {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-submit-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24,144,255,.4);
}
.btn-submit-modern i {
    font-size: 13px;
}

@media (max-width: 768px) {
    .comment-form-modern .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ===== Article Typography Enhancement ===== */

/* 文章标题优化 */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    margin-top: 28px;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.4;
}
.article-content h2 {
    font-size: 22px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}
.article-content h3 {
    font-size: 18px;
}
.article-content h4 {
    font-size: 16px;
}

/* 段落优化 */
.article-content p {
    margin-bottom: 20px;
    line-height: 1.8;
    color: rgba(0,0,0,.85);
    font-size: 15px;
}

/* 首字下沉（可选，对第一篇段落） */
.article-content > p:first-of-type::first-letter {
    /* 暂时禁用，因为中文首字下沉效果不一定好 */
}

/* 引用块样式 */
.article-content blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    background: linear-gradient(to right, var(--primary), var(--primary)) no-repeat left top / 4px 100%;
    background-color: rgba(24,144,255,.04);
    border-radius: 0 8px 8px 0;
    color: var(--gray-700);
    font-style: italic;
    line-height: 1.8;
}
.article-content blockquote p:last-child {
    margin-bottom: 0;
}

/* 列表样式 */
.article-content ul,
.article-content ol {
    margin-bottom: 20px;
    padding-left: 24px;
}
.article-content li {
    margin-bottom: 8px;
    line-height: 1.8;
    color: rgba(0,0,0,.85);
}
.article-content ul li {
    list-style-type: none;
    position: relative;
    padding-left: 20px;
}
.article-content ul li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* 代码块样式 */
.article-content pre,
.article-content code {
    background: #f6f8fa;
    border-radius: 6px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.article-content code {
    padding: 2px 6px;
    font-size: 13px;
    color: #e83e8c;
}
.article-content pre {
    padding: 16px;
    overflow-x: auto;
    line-height: 1.6;
    margin-bottom: 20px;
}
.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* 链接样式 */
.article-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all .2s;
}
.article-content a:hover {
    border-bottom-color: var(--primary);
}

/* 图片优化 */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* 表格样式 */
.article-content table {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.article-content table th,
.article-content table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}
.article-content table th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 13px;
}
.article-content table tr:last-child td {
    border-bottom: none;
}
.article-content table tr:hover td {
    background: rgba(24,144,255,.02);
}

/* 分割线 */
.article-content hr {
    margin: 32px 0;
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gray-300), transparent);
}

/* 文章元信息优化 */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 16px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-500);
    font-size: 13px;
}
.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.article-meta i {
    color: var(--primary);
    font-size: 14px;
}

/* 标签优化 */
.article-tags {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}
.article-tags strong {
    font-size: 13px;
    color: var(--gray-600);
    margin-right: 8px;
}
.article-tags .label-primary {
    display: inline-block;
    padding: 4px 12px;
    margin: 4px 4px 4px 0;
    background: rgba(24,144,255,.08);
    color: var(--primary);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s;
}
.article-tags .label-primary:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

/* 响应式优化 */
@media (max-width: 768px) {
    .article-content {
        font-size: 15px;
    }
    .article-content h2 {
        font-size: 20px;
    }
    .article-content h3 {
        font-size: 17px;
    }
    .article-meta {
        gap: 12px;
        font-size: 12px;
    }
}
