/* ===== 羊角快车文章站 v1.0 全局样式 ===== */

:root {
    /* 浅色主题 */
    --bg: #f9fafb;
    --text: #1f2937;
    --link: #3b82f6;
    --link-hover: #2563eb;
    --border: #e5e7eb;
    --card-bg: #ffffff;
    --btn-primary: #3b82f6;
    --btn-hover: #2563eb;
    --btn-outline: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111827;
        --text: #f3f4f6;
        --link: #60a5fa;
        --link-hover: #93c5fd;
        --border: #374151;
        --card-bg: #1f2937;
        --btn-primary: #3b82f6;
        --btn-hover: #60a5fa;
        --btn-outline: #374151;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 欢迎页 Hero 区域 */
.hero {
    position: relative;
    min-height: 100vh;
    background-image: url('/images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: white;
    padding: 2rem;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn-hero {
    display: inline-block;
    background: var(--btn-primary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
}

.btn-hero:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
}

/* 通用容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* 文章卡片（用于列表页） */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.article-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.article-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--border);
}

.article-card-content {
    padding: 1.25rem;
    flex: 1;
}

.article-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.article-card h3 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.article-card h3 a:hover {
    color: var(--link);
}

.article-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text);
    opacity: 0.7;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.category-badge {
    background: var(--btn-primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    display: inline-block;
}

.tag-badge {
    background: var(--btn-outline);
    color: var(--text);
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-left: 0.5rem;
    display: inline-block;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.pagination button {
    padding: 0.5rem 1.2rem;
    border: none;
    background: var(--btn-primary);
    color: white;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 文章详情页样式 */
.article-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.article-header {
    margin-bottom: 2rem;
    text-align: center;
}

.article-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.article-cover-full {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 1rem;
    margin: 1rem 0;
}

/* 目录样式 */
.toc {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    margin: 2rem 0;
}

.toc h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.toc ul {
    list-style: none;
    padding-left: 0;
}

.toc li {
    margin: 0.25rem 0;
}

.toc a {
    color: var(--link);
    text-decoration: none;
    font-size: 0.9rem;
}

.toc a:hover {
    text-decoration: underline;
}

/* 文章内容样式 */
.article-content {
    line-height: 1.8;
}

.article-content h2, .article-content h3 {
    margin-top: 2rem;
    scroll-margin-top: 2rem;
}

.article-content img {
    max-width: 100%;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.article-content pre {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
}

/* 页脚 */
footer {
    margin-top: auto;
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

footer a {
    color: var(--link);
    text-decoration: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-content p {
        font-size: 1rem;
    }
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .article-header h1 {
        font-size: 1.8rem;
    }
    .container {
        padding: 0 1rem;
    }
  }
