/* ============================================================
   个人主页样式
   设计原则：CSS 变量集中管理颜色 → 想换配色只改 :root 一处；
   自动跟随系统深浅色模式；移动端优先，无框架、无构建步骤。
   ============================================================ */

/* ---------- 颜色与字体变量（浅色模式默认值） ---------- */
:root {
    --bg: #faf9f7;
    --bg-card: #ffffff;
    --text: #1a1a1a;
    --text-muted: #666666;
    --accent: #2f6f4f;          /* 主题色——链接、强调；换一个颜色整站跟着变 */
    --border: #e2e0dc;
    --max-width: 720px;         /* 正文栏宽；窄栏更好读 */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
}

/* 深色模式：跟随系统设置自动切换 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #17181a;
        --bg-card: #1f2124;
        --text: #e8e6e3;
        --text-muted: #9a9a9a;
        --accent: #6fbf94;
        --border: #33363a;
    }
}

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

html {
    scroll-behavior: smooth;    /* 点导航锚点时平滑滚动 */
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

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

a:hover {
    text-decoration: underline;
}

/* ---------- 顶部导航 ---------- */
.site-header {
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 10;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
}

.nav-links a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* ---------- Hero ---------- */
.hero {
    padding: 5rem 1.25rem 3rem;
}

.hero h1 {
    font-size: 2.25rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 34em;
}

/* ---------- 通用 section ---------- */
.section {
    padding-top: 3rem;
    padding-bottom: 3rem;
    border-top: 1px solid var(--border);
}

.section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

/* ---------- 项目卡片 ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
}

.card h3 {
    margin-bottom: 0.5rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.card-link {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ---------- 页脚 ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}
