/* === INK 墨韵 — Tech Blog Dark Header === */
:root {
    --bg: #F1F5F9;
    --surface: #FFFFFF;
    --fg: #0F172A;
    --secondary: #64748B;
    --accent: #3B82F6;
    --accent-dark: #1E40AF;
    --accent-soft: #EFF6FF;
    --link: #2563EB;
    --border: #E2E8F0;
    --radius: 8px;
    --radius-lg: 12px;
    --header-bg: #0F172A;
    --header-surface: #1E293B;
    --footer-bg: #0F172A;
    --cta: #3B82F6;
    --cta-hover: #2563EB;
    --cta-text: #FFFFFF;
    --danger: #EF4444;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--fg);
    font-size: 15px;
    line-height: 1.7;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-dark); }
ul, ol { list-style: none; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--accent); color: #fff; padding: 8px 16px; border-radius: var(--radius); z-index: 9999; }

/* ---------- LAYOUT ---------- */
.wrap { max-width: 1140px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* ========== HEADER ========== */
.site-header { background: var(--header-bg); }
.header-inner {
    display: flex; align-items: center; height: 60px; gap: 24px;
}
.brand {
    display: flex; align-items: center; gap: 8px; color: #F8FAFC; flex-shrink: 0;
}
.brand:hover { color: var(--accent); }
.brand-icon { font-size: 1.3rem; color: var(--accent); }
.brand-name { font-weight: 800; font-size: 1.1rem; white-space: nowrap; }
.brand-tagline { display: none; font-size: .7rem; color: #94A3B8; white-space: nowrap; }

.nav-main { margin-left: auto; }
.nav-main ul { display: flex; gap: 4px; }
.nav-main a {
    display: block; padding: 6px 14px; border-radius: 6px;
    font-size: .88rem; font-weight: 500; color: #CBD5E1;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.nav-main a:hover,
.nav-main a.active {
    background: var(--header-surface); color: var(--accent);
}
.nav-main a .fas, .nav-main a .far { margin-right: 4px; font-size: .8rem; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.header-cta {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--cta); color: var(--cta-text);
    font-size: .82rem; font-weight: 600;
    padding: 7px 18px; border-radius: 6px;
    transition: background .15s; white-space: nowrap;
}
.header-cta:hover { background: var(--cta-hover); color: var(--cta-text); }
.nav-toggle {
    display: none; background: none; border: none; color: #CBD5E1;
    font-size: 1.2rem; cursor: pointer; padding: 6px;
}

/* ========== BREADCRUMBS ========== */
.breadcrumb-bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.breadcrumbs { padding: 10px 0; font-size: .82rem; color: var(--secondary); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumbs li:not(:last-child)::after { content: " ›"; margin-left: 4px; color: var(--border); }
.breadcrumbs a { color: var(--secondary); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current] { color: var(--fg); font-weight: 600; }

/* ========== HERO BANNER ========== */
.hero-banner {
    background: linear-gradient(135deg, var(--header-bg) 0%, var(--header-surface) 100%);
    color: #F8FAFC;
}
.hero-banner-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 28px 0; gap: 20px;
}
.hero-text h1 { font-size: 1.5rem; font-weight: 800; }
.hero-text h1 .fas { color: var(--accent); margin-right: 6px; }
.hero-text p { color: #94A3B8; font-size: .92rem; margin-top: 4px; }
.hero-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--cta); color: var(--cta-text);
    font-weight: 700; padding: 12px 28px; border-radius: 8px;
    font-size: .95rem; transition: background .15s; flex-shrink: 0;
}
.hero-btn:hover { background: var(--cta-hover); color: var(--cta-text); }

/* ========== FEATURES BAR ========== */
.features-bar {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 16px 0;
}
.features-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.feat-item {
    display: flex; align-items: center; gap: 10px;
    font-size: .88rem; font-weight: 600; color: var(--fg);
}
.feat-item .fas { font-size: 1.1rem; color: var(--accent); flex-shrink: 0; }
.feat-item small { display: block; font-weight: 400; color: var(--secondary); font-size: .78rem; }

/* ========== PAGE LAYOUT ========== */
.page-layout {
    display: grid; grid-template-columns: 1fr 300px; gap: 28px;
    padding-top: 28px; padding-bottom: 48px;
}

/* ========== SECTION HEAD ========== */
.section-head {
    background: var(--surface); border-radius: var(--radius-lg);
    padding: 20px 24px; margin-bottom: 20px;
    border: 1px solid var(--border);
}
.section-head h1,
.section-head h2 {
    font-size: 1.15rem; font-weight: 700;
}
.section-head h1 .fas,
.section-head h2 .fas { color: var(--accent); margin-right: 6px; }
.section-head p { color: var(--secondary); font-size: .88rem; margin-top: 4px; }

/* ========== POST CARDS ========== */
.article-list { display: flex; flex-direction: column; gap: 16px; }
.post-card {
    display: flex; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    overflow: hidden; transition: box-shadow .2s;
}
.post-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); }
.post-card-img {
    display: block; width: 220px; flex-shrink: 0;
    overflow: hidden;
}
.post-card-img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .3s;
}
.post-card:hover .post-card-img img { transform: scale(1.04); }
.post-card-body { padding: 18px 22px; flex: 1; display: flex; flex-direction: column; }
.post-card-body h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.post-card-body h3 a { color: var(--fg); }
.post-card-body h3 a:hover { color: var(--accent); }
.post-excerpt { color: var(--secondary); font-size: .88rem; flex: 1; margin-bottom: 10px; }
.post-meta {
    display: flex; flex-wrap: wrap; gap: 14px;
    font-size: .8rem; color: var(--secondary);
}
.post-meta a { color: var(--accent); font-weight: 500; }
.post-meta .fas, .post-meta .far { margin-right: 3px; }

/* ========== SIDEBAR ========== */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.widget {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
}
.widget-title {
    font-size: .95rem; font-weight: 700; margin-bottom: 16px;
    padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.widget-title .fas, .widget-title .far { margin-right: 6px; }

/* CTA Widget */
.cta-widget {
    background: linear-gradient(135deg, var(--header-bg), var(--header-surface));
    border: none; color: #F8FAFC; text-align: center; padding: 28px 20px;
}
.cta-widget-icon { margin-bottom: 12px; color: var(--accent); }
.cta-widget h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 6px; }
.cta-widget p { font-size: .85rem; color: #94A3B8; margin-bottom: 16px; }
.cta-stats {
    display: flex; justify-content: center; gap: 20px;
    margin-bottom: 18px;
}
.cta-stats div { text-align: center; }
.cta-stats strong { display: block; font-size: 1.2rem; color: var(--accent); }
.cta-stats span { font-size: .72rem; color: #94A3B8; }
.cta-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--cta); color: var(--cta-text);
    font-size: .88rem; font-weight: 700;
    padding: 10px 24px; border-radius: 8px;
    transition: background .15s;
}
.cta-btn:hover { background: var(--cta-hover); color: var(--cta-text); }

/* Hot List */
.hot-list { display: flex; flex-direction: column; gap: 12px; counter-reset: hotlist; }
.hot-list li { display: flex; gap: 12px; align-items: flex-start; }
.hot-rank {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0;
    font-size: .75rem; font-weight: 800; margin-top: 2px;
    background: var(--bg); color: var(--secondary);
}
.hot-rank-top { background: var(--danger); color: #fff; }
.hot-list a { font-size: .88rem; font-weight: 500; color: var(--fg); line-height: 1.4; }
.hot-list a:hover { color: var(--accent); }
.hot-list time { font-size: .75rem; color: var(--secondary); display: block; margin-top: 2px; }

/* Cat List */
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-list a {
    display: flex; align-items: center; gap: 6px;
    color: var(--fg); font-size: .88rem; padding: 6px 8px;
    border-radius: 6px; transition: background .15s;
}
.cat-list a:hover { background: var(--accent-soft); color: var(--accent); }
.cat-list .fas { color: var(--secondary); font-size: .8rem; }

/* Tag Cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
    display: inline-block; padding: 4px 12px; border-radius: 4px;
    font-size: .8rem; font-weight: 500;
    background: var(--accent-soft); color: var(--accent);
    transition: background .15s, color .15s;
}
.tag-pill:hover { background: var(--accent); color: #fff; }

/* ========== ARTICLE DETAIL ========== */
.article-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 32px; margin-bottom: 20px;
}
.article-header { margin-bottom: 24px; }
.article-header h1 { font-size: clamp(1.4rem, 3.5vw, 1.8rem); font-weight: 800; line-height: 1.35; margin-bottom: 12px; }
.article-header .post-meta { margin-top: 0; }

.article-cover { margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; }
.article-cover img { width: 100%; }

/* Inline CTA */
.inline-cta {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: var(--accent-soft); border: 1px solid #BFDBFE;
    border-radius: var(--radius); padding: 12px 18px; margin-bottom: 24px;
    font-size: .88rem;
}
.inline-cta .fas { color: var(--accent); }
.inline-cta span { color: var(--fg); font-weight: 500; }
.inline-cta a { font-weight: 700; color: var(--accent); margin-left: auto; }
.inline-cta a:hover { color: var(--accent-dark); }

/* Bottom CTA */
.bottom-cta {
    margin: 32px 0 24px; padding: 24px;
    background: linear-gradient(135deg, var(--header-bg), var(--header-surface));
    border-radius: var(--radius-lg); color: #F8FAFC;
}
.bottom-cta-inner { display: flex; align-items: center; gap: 20px; }
.bottom-cta .fas { color: var(--accent); flex-shrink: 0; }
.bottom-cta strong { display: block; font-size: 1rem; }
.bottom-cta p { font-size: .85rem; color: #94A3B8; margin-top: 2px; }
.bottom-cta .cta-btn { margin-left: auto; flex-shrink: 0; }

/* Category CTA Bar */
.category-cta-bar {
    background: var(--accent-soft); border-bottom: 1px solid #BFDBFE;
    padding: 10px 0; font-size: .88rem;
}
.category-cta-bar .wrap {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.category-cta-bar .fas { color: var(--accent); }
.category-cta-bar span { color: var(--fg); font-weight: 500; }
.category-cta-bar a { font-weight: 700; color: var(--accent); margin-left: auto; }
.category-cta-bar a:hover { color: var(--accent-dark); }

/* Article Body */
.article-body { line-height: 1.85; font-size: 1rem; }
.article-body h2 { font-size: 1.35rem; font-weight: 700; margin: 28px 0 12px; }
.article-body h3 { font-size: 1.15rem; font-weight: 700; margin: 22px 0 10px; }
.article-body p { margin-bottom: 14px; }
.article-body img { border-radius: var(--radius); margin: 16px 0; }
.article-body blockquote {
    border-left: 3px solid var(--accent); padding: 12px 20px; margin: 20px 0;
    background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--secondary);
}
.article-body ul, .article-body ol { margin: 12px 0 12px 24px; }
.article-body li { margin-bottom: 6px; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body code {
    background: var(--accent-soft); padding: 2px 6px; border-radius: 4px;
    font-size: .9em; color: var(--accent);
}
.article-body pre {
    background: var(--header-bg); color: #E2E8F0; padding: 20px;
    border-radius: var(--radius); overflow-x: auto; margin: 16px 0;
    font-size: .85rem; line-height: 1.6;
}
.article-body pre code { background: transparent; color: inherit; padding: 0; }

/* Article Tags */
.article-tags {
    margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.article-tags > .fas { color: var(--secondary); }

/* Article Nav */
.article-nav {
    display: flex; gap: 16px; margin-top: 24px;
    padding-top: 20px; border-top: 1px solid var(--border);
}
.nav-prev, .nav-next {
    flex: 1; padding: 14px; border: 1px solid var(--border);
    border-radius: var(--radius); transition: border-color .15s, background .15s;
}
.nav-prev:hover, .nav-next:hover { border-color: var(--accent); background: var(--accent-soft); }
.nav-next { text-align: right; }
.nav-prev small, .nav-next small { font-size: .75rem; color: var(--secondary); display: block; margin-bottom: 4px; }
.nav-prev span, .nav-next span { color: var(--fg); font-weight: 600; font-size: .9rem; }

/* Related Section */
.related-section {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
}
.related-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
.related-section .fas { color: var(--accent); margin-right: 6px; }
.related-grid { display: flex; flex-direction: column; gap: 10px; }
.related-item {
    display: block; padding: 10px 14px; border-radius: var(--radius);
    font-size: .9rem; color: var(--fg); font-weight: 500;
    background: var(--bg); transition: background .15s;
}
.related-item:hover { background: var(--accent-soft); color: var(--accent); }

/* ========== PAGINATION ========== */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
    font-size: .88rem; font-weight: 600; color: var(--fg);
    transition: border-color .15s, background .15s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ========== FOOTER ========== */
.site-footer {
    background: var(--footer-bg); color: #CBD5E1;
    margin-top: 0; padding: 48px 0 0;
}
.footer-grid {
    display: grid; gap: 32px; margin-bottom: 32px;
}
.footer-brand h2 { color: #F8FAFC; font-size: 1.1rem; font-weight: 800; margin-bottom: 10px; }
.footer-brand h2 .fas { color: var(--accent); margin-right: 6px; }
.footer-brand p { font-size: .85rem; line-height: 1.6; margin-bottom: 16px; }
.footer-cta {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--header-surface); color: var(--accent);
    padding: 8px 18px; border-radius: 6px;
    font-size: .85rem; font-weight: 600;
    transition: background .15s;
}
.footer-cta:hover { background: var(--accent); color: #fff; }
.footer-grid h3 { color: #F8FAFC; font-size: .95rem; font-weight: 700; margin-bottom: 14px; }
.footer-grid ul { display: flex; flex-direction: column; gap: 8px; }
.footer-grid li { font-size: .85rem; }
.footer-grid a { color: #94A3B8; transition: color .15s; }
.footer-grid a:hover { color: var(--accent); }
.footer-grid .fas { font-size: .8rem; }
.footer-grid .fa-check-circle { color: var(--accent); }
.footer-bottom {
    border-top: 1px solid var(--header-surface);
    padding: 16px 0; text-align: center; font-size: .78rem; color: #64748B;
}

/* ========== RESPONSIVE ========== */

@media (min-width: 768px) {
    .brand-tagline { display: block; }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

@media (max-width: 1023px) {
    .page-layout { grid-template-columns: 1fr; }
    .features-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
    .nav-main {
        position: absolute; top: 60px; left: 0; right: 0; z-index: 100;
        background: var(--header-bg); border-top: 1px solid var(--header-surface);
        padding: 12px 20px; display: none;
    }
    .nav-main.is-open { display: block; }
    .nav-main ul { flex-direction: column; gap: 4px; }
    .nav-toggle { display: block; }
    .header-cta { display: none; }

    .hero-banner-inner { flex-direction: column; text-align: center; padding: 24px 0; }
    .hero-btn { width: 100%; justify-content: center; }

    .features-row { grid-template-columns: 1fr 1fr; gap: 12px; }

    .post-card { flex-direction: column; }
    .post-card-img { width: 100%; height: 180px; }

    .article-card { padding: 20px; }
    .article-nav { flex-direction: column; }

    .bottom-cta-inner { flex-direction: column; text-align: center; }
    .bottom-cta .cta-btn { margin-left: 0; }

    .inline-cta { flex-direction: column; text-align: center; }
    .inline-cta a { margin-left: 0; }

    .category-cta-bar .wrap { flex-direction: column; text-align: center; }
    .category-cta-bar a { margin-left: 0; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
}
