:root {
    --paper: #f3efe6;
    --ink: #1f1b16;
    --mute: #6a6258;
    --rule: #d8d0c4;
    --rule-soft: #e3dccf;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC", "Source Han Serif SC", serif;
    font-size: 19px;
    line-height: 1.65;
}

.wrap {
    width: min(42rem, calc(100% - 48px));
    margin: 0 auto;
    padding: 28px 0 64px;
}

.top {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 56px;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mute);
}

.top a {
    color: inherit;
    text-decoration: none;
}

.top a:hover,
.top a[aria-current="page"] {
    color: var(--ink);
}

.langs {
    display: flex;
    gap: 14px;
}

h1.brand {
    margin: 0 0 26px;
    line-height: 0;
}

h1.brand img {
    display: block;
    width: clamp(220px, 46vw, 320px);
    height: auto;
}

.lead {
    font-size: 1.2rem;
    color: var(--mute);
    margin: 0 0 4px;
}

.works {
    margin-top: 56px;
    padding-top: 26px;
    border-top: 1px solid var(--rule);
}

.works h2 {
    margin: 0 0 22px;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mute);
}

.work {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    color: inherit;
    text-decoration: none;
    padding: 4px 0 8px;
}

/* between entries: deliberately fainter and shorter than the section rule */
.work + .work {
    position: relative;
    margin-top: 24px;
    padding-top: 26px;
}

.work + .work::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 44px;
    height: 1px;
    background: var(--rule-soft);
}

.shot {
    flex: 0 0 auto;
    width: 76px;
    height: 76px;
    border-radius: 14px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 1px 2px rgba(31, 27, 22, 0.1);
}

.meta {
    display: block;
    min-width: 0;
}

.work strong {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.work .desc {
    display: block;
    margin-top: 6px;
    color: var(--mute);
    font-size: 1rem;
}

.work em {
    display: block;
    margin-top: 8px;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    font-style: normal;
    letter-spacing: 0.02em;
}

.work:hover strong { text-decoration: underline; text-underline-offset: 3px; }

footer {
    margin-top: 64px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 32px;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    color: var(--mute);
}

footer a {
    color: inherit;
    text-decoration: none;
}

footer a:hover { color: var(--ink); }

footer .pub, footer .links { display: flex; flex-wrap: wrap; gap: 8px; }

/* wide screens: brand on the left, the lists beside it */
@media (min-width: 900px) {
    .wrap {
        width: min(66rem, calc(100% - 96px));
        padding: 40px 0 88px;
    }

    .top { margin-bottom: 64px; }

    main {
        display: grid;
        grid-template-columns: minmax(14rem, 19rem) minmax(0, 1fr);
        column-gap: 80px;
        align-items: start;
    }

    .intro {
        position: sticky;
        top: 40px;
    }

    h1.brand img { width: 100%; max-width: 264px; }

    .lead { margin-bottom: 0; }

    .works { margin-top: 0; }
    .works + .works { margin-top: 46px; }

    .work { gap: 22px; }

    .shot {
        width: 92px;
        height: 92px;
        border-radius: 16px;
    }

    .work .desc { max-width: 34rem; }

    footer { margin-top: 56px; }
}

@media (max-width: 640px) {
    body { font-size: 17px; }
    .wrap { width: min(42rem, calc(100% - 36px)); padding-top: 22px; }
    .top { margin-bottom: 44px; }
    .works { margin-top: 44px; }
    .work { gap: 14px; }
    .shot { width: 62px; height: 62px; border-radius: 12px; }
}

/* ── books.src.studio 追加（底下这些只在图书站用） ───────────────── */
.top { justify-content: space-between; }
.top .home { color: var(--ink); }
.langs a { white-space: nowrap; }
h1.title {
    margin: 0 0 18px;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.bookshot {
    flex: 0 0 auto;
    width: 76px;
    height: 114px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(31, 27, 22, 0.18);
}
.work .desc + .desc { margin-top: 4px; }

.book .cover img {
    display: block;
    width: min(100%, 300px);
    height: auto;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(31, 27, 22, 0.22);
}
.book .info { margin-top: 32px; min-width: 0; }
.book h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.book .subtitle { margin: 10px 0 0; font-size: 1.1rem; color: var(--mute); }
.book .authors { margin: 14px 0 0; }
.book .authors a { color: inherit; text-underline-offset: 3px; }
.book .facts {
    margin: 6px 0 0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    letter-spacing: 0.04em;
    color: var(--mute);
}
.block {
    margin-top: 40px;
    padding-top: 22px;
    border-top: 1px solid var(--rule);
}
.block h2 {
    margin: 0 0 16px;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mute);
}
.blurb p { margin: 0 0 14px; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; }
.store {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--ink);
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.25;
}
a.store:hover { background: var(--ink); color: var(--paper); }
.store.soon { border-color: var(--rule); color: var(--mute); cursor: default; }
.store small { font-size: 12px; letter-spacing: 0.04em; }
.editions { display: flex; flex-wrap: wrap; gap: 22px; }
.edition { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.edition img { width: 44px; height: 66px; border-radius: 3px; object-fit: cover; box-shadow: 0 1px 4px rgba(31, 27, 22, 0.2); }
.edition strong { display: block; font-weight: 600; }
.edition em {
    display: block;
    font-style: normal;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    color: var(--mute);
}
.edition:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.nf { display: block; }
.nf a { color: inherit; }

@media (min-width: 900px) {
    main.book {
        grid-template-columns: minmax(14rem, 19rem) minmax(0, 1fr);
    }
    .book .cover { position: sticky; top: 40px; }
    .book .info { margin-top: 0; }
    .bookshot { width: 92px; height: 138px; }
}
@media (max-width: 640px) {
    .book h1 { font-size: 1.8rem; }
    .bookshot { width: 62px; height: 93px; }
}

.top { flex-wrap: wrap; row-gap: 8px; }
