/* Article CSS - 文章相关样式 */

/* 文章列表项 */
.article-item {
    transition: all 0.3s ease;
}

.article-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* 文章内容样式 */
.article-content {
    line-height: 1.8;
    font-size: 15px;
    color: #1f2937;
}

.article-content img,
.article-content video,
.article-content iframe {
    max-width: 100%;
    height: auto;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.95em;
}

.article-content th,
.article-content td {
    border: 1px solid #e5e7ef;
    padding: 0.6em 0.75em;
}

.article-content th {
    background: #f5f7fb;
    font-weight: 600;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5 {
    margin: 1.4em 0 0.8em;
    padding: 0.45em 0.8em;
    border-left: 4px solid #165dff;
    background: rgba(22,93,255,0.06);
    border-radius: 10px;
    line-height: 1.4;
}

.article-content h1 { font-size: 1.25em; }
.article-content h2 { font-size: 1.16em; border-left-color: #0f62fe; background: rgba(15,98,254,0.07); }
.article-content h3 { font-size: 1.08em; }
.article-content h4 { font-size: 1.02em; border-left-color: #0f62fe; background: rgba(15,98,254,0.08); }
.article-content h5 { font-size: 0.96em; border-left-color: #2b2f36; background: rgba(43,47,54,0.06); }

.article-content blockquote {
    margin: 1em 0;
    padding: 0.75em 1em;
    border-left: 3px solid #14c9c9;
    background: rgba(20,201,201,0.07);
    border-radius: 8px;
}

.article-content pre {
    padding: 0.85em 1em;
    background: #0b1526;
    color: #e9edf5;
    border-radius: 10px;
    overflow: auto;
}

.article-content code {
    background: rgba(0,0,0,0.06);
    padding: 0.15em 0.35em;
    border-radius: 6px;
}

.article-content strong {
    color: #1f2633;
    background: rgba(255,165,0,0.12);
    padding: 0.1em 0.2em;
    border-radius: 6px;
}

.article-content hr {
    border: none;
    border-top: 1px dashed #d0d7e2;
    margin: 1.4em 0;
}

.article-content ul,
.article-content ol {
    padding-left: 1.3em;
    margin: 0.5em 0;
}

.article-content img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.article-content a {
    color: #165dff;
    text-decoration: underline;
    text-decoration-color: rgba(22,93,255,0.35);
}

/* 暗黑模式下的文章内容 */
.dark .article-content {
    color: #ffffff;
}

.dark .article-content * {
    color: inherit !important;
}

.dark .article-content pre {
    background: #0b1220;
    color: #e5e7eb;
    border-color: #1f2937;
}

.dark .article-content pre code {
    color: #e5e7eb;
    background: transparent;
}

/* Mac 风格代码块 */
.code-mac {
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 10px;
    overflow: hidden;
    margin: 14px 0;
    color: #24292e;
    box-shadow: 0 6px 14px rgba(31,35,41,0.08);
}

.dark .code-mac {
    border-color: #30363d;
    background: #0d1117;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    color: #c9d1d9;
}

.code-mac__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(246,248,250,0.9));
    border-bottom: 1px solid #d0d7de;
}

.dark .code-mac__header {
    background: linear-gradient(180deg, rgba(13,17,23,0.8), rgba(22,27,34,0.9));
    border-bottom-color: #30363d;
}

.code-dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    display: inline-block;
}

.code-dot.red { background: #ff5f56; }
.code-dot.yellow { background: #ffbd2f; }
.code-dot.green { background: #27c93f; }

.code-lang {
    margin-left: auto;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #57606a;
}

.dark .code-lang { color: #8b949e; }

.code-mac pre {
    margin: 0;
    border: none !important;
    border-radius: 0;
    background: transparent;
    color: inherit;
}

.code-mac pre code {
    color: inherit;
    background: transparent;
}

.code-copy {
    margin-left: 10px;
    padding: 3px 8px;
    font-size: 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: #f6f8fa;
    color: #24292e;
    cursor: pointer;
    transition: all 0.15s ease;
}

.code-copy:hover { background: #edf0f3; }

.dark .code-copy {
    border-color: #30363d;
    background: #161b22;
    color: #c9d1d9;
}

.dark .code-copy:hover { background: #1f242c; }

/* 复制提示 */
.copy-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    padding: 12px 18px;
    background: rgba(34, 197, 94, 0.95);
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
    pointer-events: none;
    transition: all 0.2s ease;
}

.copy-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.dark .copy-toast { background: rgba(34, 197, 94, 0.9); }

/* 代码包装器 */
.code-wrapper { position: relative; }
.copy-btn { position: absolute; top: 6px; right: 6px; background: #165DFF; color: #fff; border: none; border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
.copy-btn:hover { background: #0E48E5; }

/* 评论样式 */
.comment-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

/* 分页样式 */
.pagination-item {
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #4e5969;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-item.active {
    background: #165dff;
    color: white;
    border-color: #165dff;
}

.pagination-item:hover:not(.active) {
    border-color: #165dff;
    color: #165dff;
    background: rgba(22,93,255,0.05);
}
