/* ============================================
   GlobalSpeed - Articles & Article Page Styles
   ============================================ */

/* Main Content */
.main-content {
    padding-top: 90px;
    padding-bottom: 60px;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-muted);
}

/* Back Link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 1rem;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--accent);
}

/* Article List */
.article-list {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

/* 文章列表项 - 每条文章作为一个整体块 */
.article-list > a.article-main-link,
.article-list > .article-meta {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* 文章主链接（标题+摘要） */
.article-main-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding-top: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: none;
    transition: all 0.3s;
}

.article-main-link:hover h3 {
    color: var(--accent);
}

.article-main-link h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
    line-height: 1.5;
}

/* 置顶标签 */
.top-badge {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    font-size: 0.75rem;
    border: 1px solid var(--accent);
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    line-height: 1;
}

/* 摘要 */
.article-main-link p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* 元信息区：日期 + 标签 */
.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

/* 最后一条文章不需要底部边框 */
.article-list > .article-meta:last-of-type {
    border-bottom: none;
}

.meta-date {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* 标签 */
.tag.secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.78rem;
    text-decoration: none;
    transition: all 0.3s;
    line-height: 1;
    vertical-align: middle;
}

.tag.secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Article Content */
.article-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
}

.article-header {
    margin-bottom: 1.5rem;
}

.article-meta-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.article-meta-top .date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.article-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.article-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--accent);
}

.article-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

.article-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.article-content ul,
.article-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
    color: var(--text-muted);
}

.article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.article-content code {
    background: rgba(6, 182, 212, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    color: var(--accent);
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9rem;
}

.article-content pre {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: var(--text);
    white-space: pre;
}

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.9rem;
}

.article-content th,
.article-content td {
    padding: 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

.article-content th {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
    font-weight: 600;
}

.article-content td {
    color: var(--text-muted);
}

/* Sidebar Card */
.sidebar-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* CTA Card */
.cta-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.cta-card h4 {
    margin-bottom: 0.5rem;
}

.cta-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Single Article Mode */
.single-article-mode {
    padding: 2rem;
    text-align: center;
}

.single-article-mode .article-icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.single-article-mode h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.single-article-mode p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}


/* 标签链接 - 默认边框样式 */
/* 标签链接 - 默认：半透明灰色背景（第二个按钮的样子） */
.tag-link {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 4px;  /* 和你现有的 tag 一致 */
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s;
    line-height: 1;
    vertical-align: middle;
    background: rgba(148, 163, 184, 0.1);
}

/* Hover 状态 - 青色背景（第一个按钮的样子） */
.tag-link:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.2);
    color: var(--accent);
}

/* 文章内容区 - 限制内部元素不溢出 */
.article-body {
    /* 确保容器本身有边界 */
    overflow-x: hidden;
    word-wrap: break-word;
}

/* 图片最大100%宽度，高度自适应 */
.article-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem 0;
}

/* 表格允许横向滚动，不撑破容器 */
.article-body table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

/* 代码块允许横向滚动 */
.article-body pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre;
    word-wrap: normal;
}

/* 长链接/纯文本自动换行 */
.article-body a {
    word-break: break-all;
}

/* iframe 视频等嵌入内容 */
.article-body iframe,
.article-body video,
.article-body embed {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 列表项过长时换行 */
.article-body li {
    word-wrap: break-word;
}