:root {
    color-scheme: light;
    --ink: #17231f;
    --muted: #68756f;
    --paper: #ffffff;
    --canvas: #f3f6f4;
    --soft: #e7efea;
    --line: #d7dfda;
    --accent: #176b50;
    --accent-dark: #0e4d39;
    --blue: #285d8f;
    --shadow: 0 14px 34px rgba(22, 45, 36, 0.08);
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
    line-height: 1.65;
    letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.shell {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(215, 223, 218, 0.9);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
}

.header-inner {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 750;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 7px;
    color: white;
    background: var(--accent);
    font-family: Georgia, serif;
    font-size: 20px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-nav a {
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
    color: var(--accent-dark);
    background: var(--soft);
}

.hero-band {
    border-bottom: 1px solid var(--line);
    background: var(--paper);
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 80px;
    align-items: end;
    padding-block: 76px 68px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

h1, h2, h3, p { margin-top: 0; }

.hero-copy h1 {
    max-width: 760px;
    margin-bottom: 20px;
    font-family: Georgia, "Noto Serif SC", serif;
    font-size: clamp(38px, 6vw, 64px);
    font-weight: 700;
    line-height: 1.13;
}

@media (min-width: 1100px) {
    .hero-layout {
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: 48px;
    }

    .hero-copy h1 {
        max-width: none;
        font-size: 56px;
        white-space: nowrap;
    }
}

.hero-text {
    max-width: 700px;
    margin-bottom: 28px;
    color: var(--muted);
    font-size: 17px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font-size: 14px;
    font-weight: 750;
}

.button.primary { border-color: var(--accent); color: white; background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.quiet:hover { border-color: var(--accent); color: var(--accent-dark); }

.journal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.journal-stats div { padding: 18px 10px; text-align: center; }
.journal-stats div + div { border-left: 1px solid var(--line); }
.journal-stats dt { font-family: Georgia, serif; font-size: 30px; font-weight: 700; }
.journal-stats dd { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.section { padding-block: 64px; }
.section-tint { border-block: 1px solid var(--line); background: #eaf0ed; }

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.section-heading h2,
.related-section h2 {
    margin-bottom: 0;
    font-family: Georgia, "Noto Serif SC", serif;
    font-size: 30px;
    line-height: 1.2;
}

.text-link,
.back-link {
    color: var(--accent);
    font-size: 14px;
    font-weight: 750;
}

.text-link:hover, .back-link:hover { color: var(--accent-dark); text-decoration: underline; }

.record-list { border-top: 1px solid var(--line); }

.record-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 26px;
    padding-block: 26px;
    border-bottom: 1px solid var(--line);
}

.record-row.has-cover {
    grid-template-columns: 88px 150px minmax(0, 1fr);
}

.record-cover {
    display: block;
    overflow: hidden;
    align-self: start;
    aspect-ratio: 4 / 3;
    border-radius: 7px;
    background: var(--soft);
}

.record-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease;
}

.record-cover:hover img { transform: scale(1.025); }

.record-row > time {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.record-row > time span {
    display: block;
    color: var(--ink);
    font-family: Georgia, serif;
    font-size: 22px;
    font-weight: 700;
}

.record-main h2,
.record-main h3 { margin-bottom: 8px; line-height: 1.3; }
.record-main h2 { font-size: 22px; }
.record-main h3 { font-size: 20px; }
.record-main h2 a:hover,
.record-main h3 a:hover { color: var(--accent); }
.record-main p { max-width: 780px; margin-bottom: 13px; color: var(--muted); }

.meta-line,
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.tag {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    color: var(--accent-dark);
    background: var(--soft);
    font-size: 12px;
    font-weight: 700;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.project-card {
    display: block;
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: var(--shadow);
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(22, 45, 36, 0.12);
}

.project-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 12px;
}

.status { padding: 3px 8px; border-radius: 999px; font-weight: 750; }
.status-active { color: #0e6247; background: #dff3e9; }
.status-complete { color: #245d8a; background: #e2edf7; }
.status-paused { color: #6c6250; background: #eeeae2; }
.project-card h2, .project-card h3 { margin-bottom: 10px; line-height: 1.3; }
.project-card h2 { font-size: 22px; }
.project-card h3 { font-size: 19px; }
.project-card p { color: var(--muted); }
.project-card .text-link { display: inline-block; margin-top: 18px; }
.project-card-footer { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; color: var(--accent); font-size: 13px; font-weight: 750; }
.project-card:hover .project-card-footer { color: var(--accent-dark); }

.tech-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tech-list span { padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 11px; }

.page-intro { padding-block: 68px 36px; }
.page-intro h1 { margin-bottom: 12px; font-family: Georgia, "Noto Serif SC", serif; font-size: 46px; line-height: 1.15; }
.page-intro > p:last-child { max-width: 670px; color: var(--muted); font-size: 16px; }

.records-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 54px;
    padding-top: 18px;
}

.filter-panel { position: sticky; top: 94px; align-self: start; }
.search-form label, .tag-filter > p { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.search-row { display: flex; }
.search-row input { width: 100%; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-right: 0; border-radius: 6px 0 0 6px; background: white; color: var(--ink); }
.search-row button { height: 40px; padding-inline: 12px; border: 1px solid var(--accent); border-radius: 0 6px 6px 0; color: white; background: var(--accent); cursor: pointer; }
.search-row input:focus { outline: 2px solid rgba(23, 107, 80, 0.22); outline-offset: 1px; }

.tag-filter { display: grid; gap: 4px; margin-top: 28px; }
.tag-filter a { display: flex; justify-content: space-between; padding: 7px 9px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.tag-filter a:hover, .tag-filter a[aria-current="true"] { color: var(--accent-dark); background: var(--soft); }
.tag-filter a span { font-size: 11px; }
.record-list-large .record-row:first-child { padding-top: 0; }

.article-shell { max-width: 850px; padding-block: 58px 30px; }
.article-header { padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.article-header h1 { margin: 18px 0 14px; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(34px, 6vw, 54px); line-height: 1.18; }
.article-header > p { color: var(--muted); font-size: 17px; }
.article-cover { margin: 34px 0 0; }
.article-cover a { display: block; overflow: hidden; border-radius: 8px; background: var(--soft); }
.article-cover img { display: block; width: 100%; max-height: 680px; object-fit: contain; }
.article-cover figcaption,
.article-gallery figcaption { margin-top: 9px; color: var(--muted); font-size: 12px; text-align: center; }
.prose { padding-block: 34px; font-size: 16px; }
.prose h2 { margin: 2.2em 0 0.6em; font-size: 26px; line-height: 1.3; }
.prose h3 { margin: 1.8em 0 0.5em; font-size: 20px; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.2em; }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { margin: 1.5em 0; padding: 12px 18px; border-left: 3px solid var(--accent); color: var(--muted); background: var(--soft); }
.prose code { padding: 2px 5px; border-radius: 4px; background: #e7ece9; font-family: "Cascadia Code", Consolas, monospace; font-size: 0.9em; }
.prose pre { overflow-x: auto; margin: 1.5em 0; padding: 18px; border-radius: 7px; color: #e9f2ed; background: #17231f; }
.prose pre code { padding: 0; color: inherit; background: transparent; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.prose th, .prose td { padding: 9px 12px; border: 1px solid var(--line); text-align: left; }
.prose th { background: var(--soft); }

.article-gallery { padding: 12px 0 38px; border-top: 1px solid var(--line); }
.article-gallery-heading { padding: 30px 0 18px; }
.article-gallery-heading h2 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: 28px; }
.article-gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
.article-gallery figure { min-width: 0; margin: 0; }
.article-gallery figure:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.article-gallery a { display: block; overflow: hidden; border-radius: 8px; background: var(--soft); }
.article-gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }

.related-section { max-width: 920px; padding-top: 24px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.related-grid a { display: grid; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.related-grid a:hover { border-color: var(--accent); }
.related-grid time, .related-grid span { color: var(--muted); font-size: 12px; }

.project-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.project-detail { max-width: 850px; padding-block: 58px 72px; }
.project-detail-header { margin-top: 18px; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.project-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.project-detail-header h1 { margin: 18px 0 14px; font-family: Georgia, "Noto Serif SC", serif; font-size: 50px; line-height: 1.18; }
.project-detail-header > p { max-width: 720px; color: var(--muted); font-size: 17px; }
.project-detail-tech { margin-top: 22px; }
.project-external-link { margin-top: 28px; }
.project-prose { padding-bottom: 12px; }
.project-empty-detail { margin-top: 34px; padding: 24px; border: 1px dashed var(--line); border-radius: 7px; color: var(--muted); background: var(--paper); }
.project-empty-detail p { margin: 6px 0 0; }
.about-intro { padding-bottom: 28px; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 70px; padding-top: 20px; }
.about-copy { padding-top: 0; }
.about-note { align-self: start; padding: 24px; border-left: 3px solid var(--accent); background: var(--paper); }
.about-note p, .about-note span { color: var(--muted); font-size: 12px; }
.about-note strong { display: block; margin: 8px 0 18px; font-family: Georgia, "Noto Serif SC", serif; font-size: 22px; line-height: 1.4; }

.empty-state { padding: 40px 20px; border: 1px dashed var(--line); border-radius: 7px; color: var(--muted); text-align: center; background: rgba(255,255,255,0.5); }
.site-footer { border-top: 1px solid var(--line); background: var(--paper); }
.footer-inner { display: flex; min-height: 86px; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; }
.footer-inner p { margin: 0; }
.footer-meta { display: flex; align-items: center; gap: 16px; }
.footer-meta a { color: inherit; text-decoration: none; }
.footer-meta a:hover { color: var(--ink); text-decoration: underline; }
.public-security-filing { display: inline-flex; align-items: center; gap: 6px; }
.public-security-filing img { width: 20px; height: 20px; flex: 0 0 auto; }

.music-player {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 30;
    display: grid;
    grid-template-columns: auto minmax(130px, 1fr) auto 62px auto;
    gap: 8px;
    align-items: center;
    width: min(480px, calc(100% - 36px));
    padding: 8px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.music-player.is-collapsed {
    grid-template-columns: auto auto;
    width: auto;
    padding: 6px;
}

.music-player.is-collapsed .music-details,
.music-player.is-collapsed .music-mute-button,
.music-player.is-collapsed .music-volume-label {
    display: none;
}

.music-player button {
    min-height: 36px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--accent-dark);
    background: var(--soft);
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
}

.music-player button:hover { border-color: var(--accent); }
.music-player button:disabled { cursor: not-allowed; opacity: 0.6; }
.music-transport { display: flex; gap: 4px; }
.music-transport button { min-width: 40px; padding-inline: 8px; }
.music-transport .music-play-button { min-width: 46px; }
.music-details { min-width: 0; }
.music-details strong,
.music-details > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-details strong { font-size: 12px; }
.music-details > span { color: var(--muted); font-size: 10px; }
.music-progress-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: center; margin-top: 5px; }
.music-progress-row input,
.music-volume-label input { width: 100%; accent-color: var(--accent); }
.music-progress-row time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.music-volume-label { display: flex; align-items: center; }
.music-collapse-button { color: var(--muted) !important; background: transparent !important; }

@media (max-width: 820px) {
    .hero-layout { grid-template-columns: 1fr; gap: 38px; padding-block: 58px 50px; }
    .project-grid, .project-grid-wide { grid-template-columns: 1fr 1fr; }
    .records-layout { grid-template-columns: 1fr; gap: 34px; }
    .filter-panel { position: static; }
    .tag-filter { display: flex; flex-wrap: wrap; align-items: center; }
    .tag-filter > p { width: 100%; }
    .tag-filter a { gap: 8px; }
    .about-grid { grid-template-columns: 1fr; gap: 20px; }
    .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .shell { width: min(100% - 28px, 1120px); }
    .header-inner { min-height: 62px; align-items: flex-start; padding-block: 12px 10px; }
    .brand span:last-child { display: none; }
    .main-nav { overflow-x: auto; gap: 0; }
    .main-nav a { padding: 8px 9px; white-space: nowrap; font-size: 13px; }
    .hero-copy h1 { font-size: 40px; }
    .journal-stats dt { font-size: 26px; }
    .section { padding-block: 48px; }
    .section-heading h2 { font-size: 27px; }
    .record-row { grid-template-columns: 1fr; gap: 12px; }
    .record-row.has-cover { grid-template-columns: 112px minmax(0, 1fr); }
    .record-row.has-cover > time { grid-column: 1 / -1; }
    .record-row > time { display: flex; align-items: baseline; gap: 6px; }
    .record-row > time span { font-size: 18px; }
    .project-grid, .project-grid-wide { grid-template-columns: 1fr; }
    .page-intro { padding-block: 50px 24px; }
    .page-intro h1 { font-size: 38px; }
    .article-shell { padding-top: 42px; }
    .project-detail { padding-top: 42px; }
    .project-detail-header h1 { font-size: 38px; }
    .article-gallery-grid { grid-template-columns: 1fr; }
    .article-gallery figure:first-child:nth-last-child(odd) { grid-column: auto; }
    .footer-inner { flex-direction: column; justify-content: center; gap: 5px; text-align: center; }
    .footer-meta { flex-direction: column; gap: 3px; }
    .music-player {
        right: 10px;
        bottom: 10px;
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        width: calc(100% - 20px);
    }
    .music-volume-label { display: none; }
    .music-mute-button { padding-inline: 8px !important; }
    .music-player.is-collapsed { grid-template-columns: auto auto; width: auto; }
}
