/* ============================================================
   王师傅的个人博客 — 全站样式（首页 + 文章页共用）
   风格：工坊 / 纸张编辑质感
   ============================================================ */
:root {
    --paper: #f7f2e9;
    --paper-2: #efe6d4;
    --cream: #fcf9f3;
    --ink: #2a2320;
    --ink-soft: #554942;
    --ink-muted: #6b5e51;
    --accent: #bc4b2c;
    --accent-deep: #9c3a20;
    --accent-soft: #d98a6a;
    --gold: #c08a4e;
    --line: #e5d9c6;
    --night: #211a14;
    --night-2: #2c231b;
    --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STZhongsong", "SimSun", serif;
    --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-num: "SFMono-Regular", "JetBrains Mono", "Roboto Mono", "Consolas", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.9;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    z-index: 1;
}
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.topbar { height: 4px; background: linear-gradient(90deg, var(--accent), var(--gold) 55%, transparent); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 28px; position: relative; z-index: 2; }

/* ---------- 导航 ---------- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 0;
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand a { text-decoration: none; display: flex; align-items: center; gap: 13px; }
.brand .seal {
    width: 42px; height: 42px;
    flex: 0 0 auto;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(188, 75, 44, .28);
}
.brand .txt .t1 { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: .02em; }
.brand .txt .t2 { font-size: 11px; letter-spacing: .28em; color: var(--ink-muted); margin-top: 1px; }
nav { display: flex; gap: 24px; }
nav a {
    font-size: 14px;
    letter-spacing: .12em;
    color: var(--ink-soft);
    text-decoration: none;
    position: relative;
    padding-bottom: 4px;
}
nav a::after {
    content: "";
    position: absolute; left: 0; bottom: 0;
    width: 100%; height: 2px;
    background: var(--accent);
    transform: scaleX(0); transform-origin: left;
    transition: transform .3s ease;
}
nav a:hover { color: var(--ink); }
nav a:hover::after, nav a:focus-visible::after { transform: scaleX(1); }

/* ---------- Hero（首页深色焦点区） ---------- */
.hero {
    position: relative;
    background:
        radial-gradient(900px 400px at 85% 10%, rgba(188, 75, 44, .16), transparent 60%),
        radial-gradient(700px 400px at 5% 90%, rgba(192, 138, 78, .12), transparent 55%),
        var(--night);
    color: #f3ead9;
    border-radius: 18px;
    overflow: hidden;
    padding: 54px 46px 58px;
    margin-top: 16px;
}
.hero .grain {
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
}
.hero .ring { position: absolute; right: -70px; bottom: -90px; width: 300px; height: 300px; opacity: .1; pointer-events: none; }
.hero .inner { position: relative; z-index: 2; max-width: 620px; }
.hero .kicker {
    display: inline-flex; align-items: center; gap: 12px;
    font-size: 12px; letter-spacing: .34em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 20px;
}
.hero .kicker::before { content: ""; width: 30px; height: 1px; background: var(--gold); }
.hero h1 { font-family: var(--font-display); font-size: clamp(26px, 4.4vw, 38px); font-weight: 700; line-height: 1.5; letter-spacing: .01em; }
.hero h1 em { font-style: normal; color: #e2a184; border-bottom: 2px solid rgba(217, 138, 106, .4); }
.hero p { margin-top: 18px; color: #cbc0b0; font-size: 15px; max-width: 34em; }
.hero .ctas { margin-top: 28px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero .ctas a {
    font-size: 14px; letter-spacing: .08em;
    text-decoration: none;
    padding: 11px 22px;
    border-radius: 999px;
    transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.hero .ctas a.primary { background: var(--accent); color: #fff; }
.hero .ctas a.primary:hover { background: var(--accent-deep); transform: translateY(-2px); }
.hero .ctas a.ghost { border: 1px solid rgba(243, 234, 217, .35); color: #f3ead9; }
.hero .ctas a.ghost:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }

/* ---------- 区块标题 ---------- */
section.block { padding: 60px 0; }
.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 30px; }
.sec-head .no { font-family: var(--font-num); font-size: 13px; letter-spacing: .1em; color: var(--accent); }
.sec-head h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: .06em; }
.sec-head .rule { flex: 1; height: 1px; background: var(--line); margin-left: 4px; }

/* ---------- 关于我（首页） ---------- */
.about-grid { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; }
.about-card {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 26px;
    position: sticky; top: 24px;
    box-shadow: 0 10px 30px rgba(76, 60, 42, .05);
}
.about-card .avatar { font-family: var(--font-display); font-size: 40px; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 6px; }
.about-card .who { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.about-card .where { font-size: 13px; color: var(--ink-muted); display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.about-card hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.about-card dl { font-size: 13px; }
.about-card dt { color: var(--ink-muted); letter-spacing: .1em; font-size: 11px; text-transform: uppercase; margin-bottom: 2px; }
.about-card dd { margin-bottom: 14px; }
.about-card dd:last-child { margin-bottom: 0; }
.about-card dd .loc { color: var(--accent); font-weight: 600; }
.about-main .lead { font-family: var(--font-display); font-size: 17px; line-height: 2; color: var(--ink); }
.about-main .lead b { color: var(--accent); font-weight: 600; }
.about-main p.body { margin-top: 16px; color: var(--ink-soft); font-size: 15px; }
.about-main .tags { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.about-main .tags span {
    font-size: 12px; letter-spacing: .08em;
    color: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 14px;
    background: var(--cream);
}
.about-main .note { margin-top: 24px; font-size: 13px; color: var(--ink-muted); display: flex; align-items: center; gap: 10px; }
.about-main .note::before { content: ""; width: 22px; height: 1px; background: var(--accent-soft); }

/* ---------- 特色文章（首页） ---------- */
.feature {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 300px;
    box-shadow: 0 12px 34px rgba(76, 60, 42, .06);
    transition: transform .35s ease, box-shadow .35s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: 0 20px 44px rgba(76, 60, 42, .1); }
.feature .f-body { padding: 34px; display: flex; flex-direction: column; }
.feature .f-tag { align-self: flex-start; font-size: 11px; letter-spacing: .2em; color: var(--accent); border: 1px solid var(--accent-soft); border-radius: 999px; padding: 3px 13px; background: rgba(188, 75, 44, .05); }
.feature h3 { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1.4; margin: 16px 0 12px; }
.feature h3 a { text-decoration: none; background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-size: 0 2px; background-position: 0 100%; transition: background-size .35s ease; }
.feature:hover h3 a { background-size: 100% 2px; }
.feature p { color: var(--ink-soft); font-size: 15px; }
.feature .f-date { margin-top: auto; padding-top: 18px; font-family: var(--font-num); font-size: 11px; color: var(--ink-muted); letter-spacing: .12em; }
.feature .f-art { position: relative; background: radial-gradient(120px 120px at 70% 30%, rgba(188,75,44,.18), transparent 70%), radial-gradient(140px 140px at 30% 80%, rgba(192,138,78,.16), transparent 70%), var(--night-2); }
.feature .f-art svg { position: absolute; inset: 24px; width: calc(100% - 48px); height: calc(100% - 48px); }

/* ---------- 文章列表（首页） ---------- */
article.post {
    display: grid;
    grid-template-columns: 58px 1fr auto;
    gap: 22px; align-items: baseline;
    padding: 24px 6px;
    border-bottom: 1px solid var(--line);
    transition: transform .3s ease;
}
article.post:last-child { border-bottom: none; }
article.post:hover { transform: translateX(6px); }
article.post .idx { font-family: var(--font-num); font-size: 24px; color: var(--accent-soft); transition: color .3s ease; }
article.post:hover .idx { color: var(--accent); }
article.post h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.45; margin-bottom: 5px; }
article.post h3 a { text-decoration: none; background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-size: 0 1px; background-position: 0 100%; transition: background-size .35s ease; padding-bottom: 2px; }
article.post:hover h3 a { background-size: 100% 1px; }
article.post p { font-size: 14px; color: var(--ink-soft); max-width: 46em; }
article.post .tag { justify-self: end; align-self: start; font-size: 11px; letter-spacing: .15em; color: var(--accent); border: 1px solid var(--accent-soft); border-radius: 999px; padding: 4px 12px; background: rgba(188, 75, 44, .04); }
article.post .date { grid-column: 2; font-family: var(--font-num); font-size: 11px; color: var(--ink-muted); letter-spacing: .12em; margin-top: -8px; }

/* ---------- FAQ（首页） ---------- */
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); padding: 20px 4px; }
.faq-item.q { display: flex; gap: 14px; align-items: baseline; }
.faq-item.q .qmark { font-family: var(--font-display); color: var(--accent); font-weight: 700; }
.faq-item.q h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.faq-item.a { padding: 6px 4px 22px 32px; color: var(--ink-soft); font-size: 15px; }
.faq-item .amark { color: var(--accent-soft); font-weight: 700; margin-right: 10px; }

/* ---------- 联系方式（首页） ---------- */
.contact {
    background: var(--night);
    color: #f3ead9;
    border-radius: 18px;
    padding: 42px 46px;
    display: flex;
    align-items: center; justify-content: space-between;
    gap: 32px; flex-wrap: wrap;
}
.contact .c-t1 { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.contact .c-t2 { color: #cbc0b0; font-size: 14px; margin-top: 6px; }
.contact a.mail { font-family: var(--font-num); font-size: 16px; color: #e2a184; text-decoration: none; border: 1px solid rgba(226, 161, 132, .45); border-radius: 999px; padding: 13px 26px; transition: background .3s ease, color .3s ease, transform .25s ease; }
.contact a.mail:hover { background: rgba(226, 161, 132, .12); transform: translateY(-2px); }

/* ---------- 面包屑（文章页） ---------- */
.breadcrumb { padding: 22px 0 6px; font-size: 12px; letter-spacing: .08em; color: var(--ink-muted); }
.breadcrumb a { text-decoration: none; color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 7px; color: var(--line); }
.breadcrumb .cur { color: var(--ink-muted); }

/* ---------- 文章主体（文章页） ---------- */
article.entry {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 44px 48px;
    margin: 26px 0 30px;
    box-shadow: 0 10px 34px rgba(76, 60, 42, .06);
}
.entry .kicker { display: inline-block; font-size: 11px; letter-spacing: .24em; color: var(--accent); border: 1px solid var(--accent-soft); border-radius: 999px; padding: 3px 14px; background: rgba(188, 75, 44, .05); margin-bottom: 18px; }
.entry h1 { font-family: var(--font-display); font-size: clamp(24px, 4.6vw, 34px); font-weight: 700; line-height: 1.45; margin-bottom: 16px; }
.entry .meta { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-family: var(--font-num); font-size: 12px; color: var(--ink-muted); letter-spacing: .08em; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.entry .meta .author { color: var(--accent); }
.entry .content { font-size: 16px; color: var(--ink-soft); max-width: 42em; }
.entry .content p { margin-bottom: 20px; }
.entry .content h2 { font-family: var(--font-display); font-size: 21px; font-weight: 700; color: var(--ink); margin: 34px 0 14px; padding-left: 14px; border-left: 3px solid var(--accent); }
.entry .content h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink); margin: 26px 0 10px; }
.entry .content ul, .entry .content ol { margin: 0 0 20px 22px; }
.entry .content li { margin-bottom: 8px; }
.entry .content strong { color: var(--ink); font-weight: 600; }
.entry .content blockquote { margin: 24px 0; padding: 16px 20px; background: rgba(192, 138, 78, .07); border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; color: var(--ink-soft); font-family: var(--font-display); }
.entry .content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry .content a:hover { color: var(--accent-deep); }
.entry .endnote { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-muted); display: flex; align-items: center; gap: 9px; }
.entry .endnote::before { content: ""; width: 20px; height: 1px; background: var(--accent-soft); }

/* ---------- 上一篇 / 下一篇（文章页） ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 30px; }
.pager a { text-decoration: none; background: var(--cream); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; transition: transform .3s ease, border-color .3s ease; display: block; }
.pager a:hover { transform: translateY(-3px); border-color: var(--accent-soft); }
.pager a.next { text-align: right; }
.pager .label { font-size: 11px; letter-spacing: .18em; color: var(--ink-muted); margin-bottom: 6px; }
.pager .title { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--ink); }
.pager a:hover .title { color: var(--accent); }
.back-home { text-align: center; margin-bottom: 10px; }
.back-home a { font-size: 13px; letter-spacing: .12em; color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); padding-bottom: 2px; }
.back-home a:hover { color: var(--accent-deep); }

/* ---------- 页脚 ---------- */
footer { padding: 36px 0 50px; text-align: center; color: var(--ink-muted); font-size: 13px; }
footer .f-mark { font-family: var(--font-display); font-size: 14px; letter-spacing: .32em; color: var(--accent); margin-bottom: 8px; }
footer .f-nav { margin: 12px 0 6px; display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; }
footer .f-nav a { text-decoration: none; font-size: 13px; color: var(--ink-soft); }
footer .f-nav a:hover { color: var(--accent); }
footer a { text-decoration: none; }
footer .beian { margin-top: 6px; }
footer .beian a:hover { color: var(--accent); }

/* ---------- 动画 ---------- */
[data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
    .about-grid { grid-template-columns: 1fr; gap: 26px; }
    .about-card { position: static; }
    .feature { grid-template-columns: 1fr; }
    .feature .f-art { min-height: 200px; order: -1; }
    .contact { justify-content: center; text-align: center; }
    .pager { grid-template-columns: 1fr; }
    .pager a.next { text-align: left; }
}
@media (max-width: 560px) {
    header { flex-direction: column; align-items: flex-start; gap: 16px; }
    nav { gap: 14px 20px; flex-wrap: wrap; }
    .hero { padding: 40px 26px 44px; }
    article.post { grid-template-columns: 40px 1fr; gap: 14px; }
    article.post .tag { grid-column: 2; justify-self: start; }
    article.post .date { margin-top: -6px; }
    article.entry { padding: 28px 22px; }
}