@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Noto+Sans+SC:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --subtle: #f5f6f8;
    --ink: #16181d;
    --muted: #6b7280;
    --line: #e6e8ec;
    --line-strong: #d5d8dd;
    --accent: #2f6bff;
    --accent-hover: color-mix(in srgb, var(--accent) 86%, #000);
    --accent-light: color-mix(in srgb, var(--accent) 55%, #fff);
    --accent-soft: color-mix(in srgb, var(--accent) 8%, #fff);
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 34px rgba(20, 25, 40, .07);
    --shadow-sm: 0 2px 10px rgba(20, 25, 40, .05);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background: var(--bg);
    font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { max-width: 100%; }
.shell { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.mono { font-family: "DM Mono", monospace; }

/* NAV */
.nav-wrap {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(14px);
}
.nav {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; }
.brand img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text small { margin-top: 3px; color: var(--muted); font: 400 9px/1 "DM Mono", monospace; letter-spacing: .14em; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav-links a { padding: 9px 14px; border-radius: var(--radius-sm); color: var(--muted); font-size: 14px; font-weight: 500; transition: color .18s ease, background .18s ease; }
.nav-links a:hover { color: var(--ink); background: var(--subtle); }
.nav-cta { margin-left: 10px; padding: 9px 18px !important; color: #fff !important; font-weight: 600 !important; background: var(--accent) !important; }
.nav-cta:hover { background: var(--accent-hover) !important; }

/* HERO */
.hero { padding: 96px 0 80px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); align-items: center; gap: 72px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font: 500 12px/1 "DM Mono", monospace; letter-spacing: .05em; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .14); }
h1 { margin: 26px 0 22px; font-size: clamp(44px, 6.4vw, 78px); line-height: 1.05; letter-spacing: -.03em; font-weight: 800; }
h1 .accent { color: var(--accent); }
.lead { max-width: 600px; margin: 0; color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); line-height: 1.8; }
.hero-actions { margin-top: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn { min-height: 50px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-weight: 600; font-size: 15px; transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease; }
.btn-primary { color: #fff; border-color: var(--accent); background: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-sm); }
.btn-secondary { background: var(--surface); }
.btn-secondary:hover { border-color: var(--ink); }
.btn svg { width: 18px; height: 18px; }

.portrait { position: relative; display: grid; place-items: center; }
.portrait-card { position: relative; width: min(340px, 100%); aspect-ratio: .86; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--accent-soft); box-shadow: var(--shadow); }
.portrait-big { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 22px; color: var(--accent); font-size: 104px; font-weight: 800; line-height: .9; letter-spacing: -.06em; opacity: .9; text-align: center; }
.portrait-cap { position: absolute; left: 22px; right: 22px; bottom: 20px; padding-top: 13px; border-top: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); color: var(--accent); font: 500 11px/1 "DM Mono", monospace; letter-spacing: .16em; }
.orbit { position: absolute; padding: 10px 15px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); font: 500 11px/1 "DM Mono", monospace; letter-spacing: .04em; }
.orbit.one { top: 10%; left: -14px; }
.orbit.two { right: -10px; bottom: 14%; }

/* SECTIONS */
section { padding: 88px 0; }
section + section, .contact { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 46px; display: flex; align-items: end; justify-content: space-between; gap: 28px; }
.kicker { margin-bottom: 12px; color: var(--accent); font: 500 12px/1 "DM Mono", monospace; letter-spacing: .12em; }
h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.14; letter-spacing: -.025em; font-weight: 700; }
.section-note { max-width: 380px; color: var(--muted); font-size: 15px; line-height: 1.75; }

/* ARTICLES (最新文章) */
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.post-card { position: relative; display: flex; flex-direction: column; min-height: 230px; padding: 28px 26px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.post-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.post-card .post-tag { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font: 500 10px/1 "DM Mono", monospace; letter-spacing: .09em; }
.post-card h3 { margin: 18px 0 10px; font-size: 21px; line-height: 1.28; letter-spacing: -.01em; font-weight: 700; }
.post-card h3 a:hover { color: var(--accent); }
.post-card p { margin: 0; flex: 1; color: var(--muted); font-size: 14px; line-height: 1.65; }
.post-card .post-foot { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font: 500 11px/1 "DM Mono", monospace; letter-spacing: .05em; }
.post-card .post-arrow { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); transition: .18s ease; }
.post-card:hover .post-arrow { color: var(--accent); border-color: var(--accent); }
.posts-empty { padding: 56px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* PROJECTS */
.featured-grid { display: grid; grid-template-columns: 1.15fr .85fr; grid-template-rows: 1fr 1fr; gap: 16px; }
.project { position: relative; min-height: 240px; padding: 30px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; cursor: pointer; }
.project:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.project-main { grid-row: 1 / 3; min-height: 500px; color: #fff; border-color: var(--ink); background: var(--ink); }
.project-main:hover { border-color: var(--ink); }
.project-main::after { content: ""; position: absolute; width: 300px; height: 300px; right: -90px; bottom: -120px; border-radius: 50%; border: 44px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.project-top { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 14px; font: 500 11px/1 "DM Mono", monospace; letter-spacing: .1em; color: var(--muted); }
.project-main .project-top { color: rgba(255, 255, 255, .55); }
.project-index { opacity: .7; }
.project-copy { position: relative; z-index: 2; }
.project h3 { margin: 0 0 12px; font-size: clamp(24px, 3vw, 38px); line-height: 1.12; letter-spacing: -.03em; font-weight: 700; }
.project p { margin: 0; max-width: 440px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.project-main p { color: rgba(255, 255, 255, .6); }
.project-arrow { position: absolute; z-index: 3; right: 26px; bottom: 26px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--subtle); font-size: 18px; transition: transform .18s ease, background .18s ease; }
.project-main .project-arrow { color: #fff; background: rgba(255, 255, 255, .12); }
.project:hover .project-arrow { transform: translate(2px, -2px); }
.project-orange { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 20%, transparent); }
.project-lime { background: var(--subtle); }

/* TOOLS */
.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tool { position: relative; width: 100%; min-height: 168px; padding: 26px 24px; display: flex; flex-direction: column; color: inherit; text-align: left; font: inherit; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: background .16s ease; }
.tool:nth-child(3n) { border-right: none; }
.tool:hover { background: var(--subtle); }
.tool-meta { display: flex; justify-content: space-between; color: var(--muted); font: 500 10px/1 "DM Mono", monospace; letter-spacing: .09em; }
.tool h3 { margin: auto 0 6px; font-size: 19px; letter-spacing: -.01em; font-weight: 600; }
.tool p { margin: 0; color: var(--muted); font-size: 13px; }
.tool-icon { position: absolute; right: 22px; bottom: 22px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); opacity: 0; transform: translate(-4px, 4px); transition: .18s ease; }
.tool:hover .tool-icon { opacity: 1; transform: translate(0, 0); color: var(--accent); border-color: var(--accent); }

/* CONTACT */
.contact { padding-top: 88px; }
.contact-box { position: relative; min-height: 300px; padding: 56px; overflow: hidden; display: grid; align-items: center; grid-template-columns: 1fr auto; gap: 30px; color: #fff; border-radius: var(--radius); background: var(--ink); }
.contact-box .kicker { color: var(--accent-light); }
.contact-box h2 { max-width: 640px; color: #fff; }
.contact-link { position: relative; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 50%; color: #fff; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); transition: transform .2s ease, background .2s ease; }
.contact-link:hover { transform: translateY(-3px); background: var(--accent); border-color: var(--accent); }
.contact-link svg { width: 28px; height: 28px; }

footer { padding: 32px 0 44px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; }
footer .mono { letter-spacing: .06em; }

/* SINGLE POST / PAGE / ARCHIVE */
.inner { padding: 64px 0 80px; }
.inner-head { margin-bottom: 40px; }
.inner-head .kicker { color: var(--accent); }
.entry { padding: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.entry + .entry { margin-top: 20px; }
.entry-title { margin: 0 0 16px; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.2; letter-spacing: -.025em; font-weight: 700; }
.entry-title a:hover { color: var(--accent); }
.entry-meta { margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; list-style: none; color: var(--muted); font: 500 12px/1 "DM Mono", monospace; letter-spacing: .04em; }
.entry-meta a:hover { color: var(--accent); }
.fmt { font-size: 16px; line-height: 1.85; color: var(--ink); }
.fmt h1, .fmt h2, .fmt h3, .fmt h4 { margin: 1.6em 0 .6em; line-height: 1.3; font-weight: 700; }
.fmt h2 { font-size: 26px; }
.fmt h3 { font-size: 21px; }
.fmt p { margin: 0 0 1.1em; }
.fmt a { color: var(--accent); }
.fmt a:hover { text-decoration: underline; }
.fmt img { border-radius: var(--radius-sm); }
.fmt blockquote { margin: 1.4em 0; padding: 14px 22px; border-left: 3px solid var(--accent); background: var(--subtle); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); }
.fmt pre { padding: 18px; overflow: auto; border-radius: var(--radius-sm); background: var(--ink); color: #eef1f6; font-family: "DM Mono", monospace; font-size: 13px; line-height: 1.7; }
.fmt code { padding: 2px 6px; border-radius: 5px; background: var(--subtle); font-family: "DM Mono", monospace; font-size: .9em; }
.fmt pre code { padding: 0; background: none; }
.fmt ul, .fmt ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.fmt table { width: 100%; border-collapse: collapse; margin: 1.2em 0; }
.fmt th, .fmt td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; }
.fmt th { background: var(--subtle); }
.entry-tags { margin: 30px 0 0; color: var(--muted); font-size: 13px; }
.entry-tags a { color: var(--accent); }
.post-near { margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; list-style: none; color: var(--muted); font-size: 14px; }

/* PAGINATION */
.page-nav { margin: 40px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; justify-content: center; }
.page-nav li a, .page-nav li span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 15px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--muted); font-size: 14px; font-weight: 500; transition: .16s ease; }
.page-nav li a:hover { color: var(--ink); border-color: var(--line-strong); background: var(--subtle); }
.page-nav li.current span, .page-nav li .current { color: #fff; border-color: var(--accent); background: var(--accent); }

/* COMMENTS */
#comments { margin-top: 36px; padding: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
#comments h3 { margin: 0 0 20px; font-size: 20px; font-weight: 700; }
.comment-list, .comment-list ol { list-style: none; margin: 0; padding: 0; }
.comment-list ol.comment-children { margin-left: 26px; padding-left: 20px; border-left: 1px solid var(--line); }
.comment-list li { margin: 16px 0; }
.comment-body { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--subtle); }
.comment-meta { margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.comment-author cite { font-style: normal; font-weight: 600; color: var(--ink); }
.comment-reply a, .comment-meta a { color: var(--accent); }
.respond { margin-top: 28px; }
.respond h3 { margin-bottom: 16px; }
.respond label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; }
.respond .text, .respond .textarea { width: 100%; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; background: var(--surface); color: var(--ink); }
.respond .text:focus, .respond .textarea:focus { outline: none; border-color: var(--accent); }
.respond p { margin: 0 0 16px; }
.respond .submit { min-height: 46px; padding: 0 24px; color: #fff; border: 0; border-radius: var(--radius-sm); background: var(--accent); font-weight: 600; cursor: pointer; transition: background .16s ease; }
.respond .submit:hover { background: var(--accent-hover); }

/* MODAL */
.modal-mask { position: fixed; inset: 0; z-index: 100; padding: 20px; display: none; place-items: center; background: rgba(16, 18, 24, .5); backdrop-filter: blur(6px); }
.modal-mask.show { display: grid; animation: fade .18s ease; }
.modal { width: min(480px, 100%); padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 24px 70px rgba(0, 0, 0, .2); animation: rise .22s ease; }
.modal-head { padding: 22px 22px 16px; display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.modal-head h3 { margin: 0 0 5px; font-size: 22px; font-weight: 700; }
.modal-head p { margin: 0; color: var(--muted); font-size: 14px; }
.modal-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; cursor: pointer; transition: background .16s ease; }
.modal-close:hover { background: var(--subtle); }
.modal-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 8px 8px; }
.modal-option { min-height: 132px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--subtle); transition: .18s ease; }
.modal-option:hover { color: #fff; border-color: var(--accent); background: var(--accent); transform: translateY(-2px); }
.modal-option .mono { color: var(--muted); font-size: 10px; }
.modal-option:hover .mono { color: rgba(255, 255, 255, .75); }
.modal-option strong { font-size: 18px; font-weight: 600; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.99); } }

@media (max-width: 860px) {
    .nav-links a:not(.nav-cta) { display: none; }
    .hero { padding: 60px 0 64px; grid-template-columns: 1fr; gap: 56px; }
    .portrait { width: min(420px, 92%); margin: 0 auto; }
    .featured-grid { grid-template-columns: 1fr; }
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .project-main { grid-row: auto; min-height: 420px; }
    .tools-grid { grid-template-columns: repeat(2, 1fr); }
    .tool:nth-child(3n) { border-right: 1px solid var(--line); }
    .tool:nth-child(2n) { border-right: none; }
    .contact-box { grid-template-columns: 1fr; padding: 42px; }
    .entry { padding: 30px; }
}

@media (max-width: 560px) {
    .shell { width: min(100% - 28px, 1120px); }
    .nav { min-height: 60px; }
    .brand img { width: 32px; height: 32px; }
    .brand-text small { display: none; }
    .nav-cta { margin-left: 0; padding: 8px 14px !important; font-size: 13px; }
    .hero { padding-top: 44px; }
    h1 { font-size: clamp(38px, 12vw, 56px); }
    .lead { font-size: 16px; }
    .btn { width: 100%; }
    .portrait-big { font-size: 84px; }
    section { padding: 64px 0; }
    .section-head { align-items: start; flex-direction: column; }
    .posts-grid { grid-template-columns: 1fr; }
    .project { min-height: 220px; padding: 24px; }
    .project-main { min-height: 380px; }
    .tools-grid { grid-template-columns: 1fr; }
    .tool, .tool:nth-child(2n), .tool:nth-child(3n) { border-right: none; }
    .tool { min-height: 144px; }
    .contact-box { padding: 32px 26px; }
    .contact-link { width: 80px; height: 80px; }
    footer { align-items: start; flex-direction: column; }
    .entry { padding: 24px; }
    #comments { padding: 24px; }
    .modal-options { grid-template-columns: 1fr; }
    .modal-option { min-height: 108px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
