/* ========================================
   Leslie 研究笔记 — Design System
   Inspired by Linear, Vercel, Apple
   ======================================== */

/* ---- Reset & Variables ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #fafafa;
    --bg-alt: #f2f2f5;
    --bg-card: #ffffff;
    --bg-hover: #f7f7fa;
    --text: #1a1a2e;
    --text-secondary: #6b6b80;
    --text-muted: #9a9ab0;
    --border: #e8e8ee;
    --border-hover: #d0d0da;
    --accent: #2d6cff;
    --accent-bg: #ebf0ff;
    --accent-text: #1a4ab8;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Noto Sans SC", sans-serif;
    --mono: "SF Mono", "JetBrains Mono", monospace;
    --max-w: 860px;
    --max-w-wide: 1040px;
}

/* ---- Base ---- */
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent); color: #fff; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: var(--max-w-wide); margin: 0 auto; padding: 0 24px; }

/* ---- Navigation ---- */
.nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(250,250,250,0.85);
    backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: var(--max-w-wide); margin: 0 auto; padding: 0 24px;
    height: 56px; display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
    width: 28px; height: 28px; border-radius: 6px;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; font-family: var(--mono);
}
.logo-text { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.3px; }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
    color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 450;
    transition: color .2s; position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
    content: ''; position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; }

/* ---- Hero ---- */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
}
.hero-badge {
    display: inline-block; padding: 4px 14px; border-radius: 20px;
    background: var(--accent-bg); color: var(--accent-text);
    font-size: 12px; font-weight: 500; letter-spacing: 0.3px;
    margin-bottom: 24px;
}
.hero h1 {
    font-size: 40px; font-weight: 700; line-height: 1.2; letter-spacing: -1px;
    margin-bottom: 16px; color: var(--text);
}
.hero-sub {
    font-size: 17px; color: var(--text-secondary); max-width: 560px;
    margin: 0 auto 32px; line-height: 1.6;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 22px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; text-decoration: none;
    transition: all .2s; cursor: pointer; border: none;
}
.btn-primary {
    background: var(--accent); color: #fff;
    box-shadow: 0 1px 3px rgba(45,108,255,0.3);
}
.btn-primary:hover { background: #1a5ae8; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(45,108,255,0.3); }
.btn-ghost {
    background: transparent; color: var(--text); border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-alt); border-color: var(--border-hover); }

/* ---- Section Headers ---- */
.section-header { text-align: center; margin-bottom: 48px; }
.section-header .label {
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px;
    color: var(--accent); margin-bottom: 8px;
}
.section-header h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 8px; }
.section-header p { color: var(--text-secondary); font-size: 15px; max-width: 480px; margin: 0 auto; }

/* ---- Section ---- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }

/* ---- Research Map ---- */
.research-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px; margin-top: 8px;
}
.research-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 24px;
    transition: all .25s; cursor: default;
}
.research-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.research-card .icon { font-size: 22px; margin-bottom: 12px; display: block; }
.research-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.research-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ---- Featured Notes ---- */
.notes-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.note-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 24px;
    transition: all .25s; cursor: pointer; text-decoration: none; color: inherit;
    display: block;
}
.note-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.note-card .meta {
    display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-muted); margin-bottom: 10px;
}
.note-card .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); }
.note-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; line-height: 1.4; }
.note-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.note-card .tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.note-card .tags span {
    font-size: 11px; padding: 2px 10px; border-radius: 12px;
    background: var(--bg-alt); color: var(--text-muted);
}

/* ---- Frameworks ---- */
.framework-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.framework-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 24px;
    transition: all .25s; cursor: default;
}
.framework-card:hover { border-color: var(--border-hover); }
.framework-card .num {
    font-family: var(--mono); font-size: 28px; font-weight: 700;
    color: var(--accent); opacity: 0.4; margin-bottom: 12px;
}
.framework-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.framework-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ---- Now Tracking ---- */
.tracking-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tracking-tag {
    padding: 8px 18px; border-radius: 20px; font-size: 13px;
    background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary);
    transition: all .2s;
}
.tracking-tag:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

/* ---- Footer ---- */
.footer {
    border-top: 1px solid var(--border); padding: 32px 0;
    text-align: center; font-size: 13px; color: var(--text-muted);
}
.footer a { color: var(--text-secondary); text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ---- About page ---- */
.about-page { padding: 60px 0 80px; }
.about-page h1 { font-size: 30px; font-weight: 700; margin-bottom: 24px; letter-spacing: -0.5px; }
.about-content { max-width: 620px; }
.about-content p { font-size: 15px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.8; }
.about-content strong { color: var(--text); }

/* ---- Article page (kept from original) ---- */
.article-page { padding: 40px 0 80px; }
.article-page .back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 24px; color: var(--accent); text-decoration: none; font-size: 14px; }
.article-page .back:hover { text-decoration: underline; }
.article-page h1 { font-size: 28px; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.3px; }
.article-page .article-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 32px; display: flex; gap: 8px; align-items: center; }
.article-content { line-height: 1.9; font-size: 15px; }
.article-content h2 { font-size: 22px; font-weight: 700; margin: 36px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.article-content h3 { font-size: 18px; font-weight: 600; margin: 28px 0 12px; }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin: 8px 0 16px; padding-left: 24px; }
.article-content li { margin-bottom: 6px; }
.article-content strong { color: var(--text); }
.article-content em { color: var(--accent); }
.article-content blockquote {
    border-left: 3px solid var(--accent); padding: 12px 20px; margin: 16px 0;
    background: var(--bg-alt); border-radius: 0 8px 8px 0; color: var(--text-secondary);
}
.article-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.article-content th, .article-content td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }
.article-content th { background: var(--bg-alt); color: var(--text); font-weight: 600; }
.article-content td { color: var(--text-secondary); }
.article-content code { background: var(--bg-alt); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.article-content .highlight {
    background: linear-gradient(135deg, var(--accent-bg), transparent);
    border: 1px solid var(--accent); border-radius: 8px; padding: 16px 20px; margin: 16px 0;
}
.article-content .highlight p { margin: 0; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero h1 { font-size: 28px; }
    .hero { padding: 72px 0 56px; }
    .nav-links { display: none; }
    .nav-toggle { display: block; }
    .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 16px 24px; gap: 16px; }
    .nav-links a.active::after { display: none; }
    .research-grid { grid-template-columns: 1fr; }
    .notes-grid { grid-template-columns: 1fr; }
    .framework-grid { grid-template-columns: 1fr; }
    .section { padding: 56px 0; }
    .section-header h2 { font-size: 24px; }
}

/* ---- Contact ---- */
.contact-grid {
    display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
    max-width: 480px; margin: 0 auto;
}
.contact-card {
    flex: 1; min-width: 200px;
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; padding: 28px 24px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); text-decoration: none; color: inherit;
    transition: all .25s; position: relative;
}
.contact-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.contact-icon { font-size: 28px; }
.contact-label { font-size: 15px; font-weight: 600; }
.contact-desc { font-size: 12px; color: var(--text-secondary); }
.contact-arrow {
    position: absolute; top: 12px; right: 14px;
    font-size: 14px; color: var(--text-muted); transition: transform .2s;
}
.contact-card:hover .contact-arrow { transform: translateX(3px); color: var(--accent); }

/* ---- Note Categories ---- */
.note-categories {
    display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
    margin-bottom: 28px;
}
.cat-tag {
    padding: 6px 18px; border-radius: 20px; font-size: 13px; font-weight: 500;
    background: var(--bg-alt); color: var(--text-secondary); cursor: pointer;
    border: 1px solid transparent; transition: all .2s; user-select: none;
}
.cat-tag:hover { border-color: var(--accent); color: var(--text); }
.cat-tag.active {
    background: var(--accent); color: #fff; border-color: var(--accent);
}
.cat-tag:empty { display: none; }

/* Mobile responsive */
@media (max-width: 600px) {
    .note-categories { gap: 6px; }
    .cat-tag { padding: 5px 14px; font-size: 12px; }
}

/* ---- Empty state ---- */
.empty-notes {
    grid-column: 1 / -1; text-align: center;
    padding: 48px 20px; color: var(--text-muted); font-size: 14px;
    background: var(--bg-alt); border-radius: var(--radius-md);
    border: 1px dashed var(--border);
}
