:root {
    color-scheme: light;
    --paper: #f3f0e9;
    --paper-light: #fbfaf6;
    --ink: #171815;
    --muted: #66675f;
    --line: rgba(23, 24, 21, 0.14);
    --accent: #8d2f2a;
    --moss: #30483a;
    --header-height: 68px;
    --page-gutter: clamp(20px, 4vw, 64px);
    --max-width: 1440px;
    --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

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

.skip-link {
    position: fixed;
    z-index: 999;
    top: 8px;
    left: 8px;
    padding: 10px 14px;
    background: var(--ink);
    color: #fff;
    text-decoration: none;
    transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
    position: sticky;
    z-index: 100;
    top: 0;
    height: var(--header-height);
    padding: 0 var(--page-gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    border-bottom: 1px solid transparent;
    backdrop-filter: blur(18px) saturate(130%);
    transition: border-color .25s ease, background .25s ease;
}

.site-header.scrolled { border-color: var(--line); }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: .08em;
    text-decoration: none;
}

.brand-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    font-family: "Songti SC", "STSong", serif;
    font-size: 17px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 13px;
}

.header-actions a { text-decoration: none; }
.header-count { color: var(--muted); }

.contact-button,
.sample-note button {
    padding: 10px 17px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #fff;
    cursor: pointer;
    transition: transform .25s var(--ease), background .25s ease;
}

.contact-button:hover,
.sample-note button:hover { transform: translateY(-2px); background: var(--accent); }

main { overflow: hidden; }

.catalog-hero,
.collection-section,
.browser-section,
.sample-note,
.site-footer {
    width: min(100%, var(--max-width));
    margin-inline: auto;
    padding-inline: var(--page-gutter);
}

.catalog-hero {
    min-height: min(720px, calc(100vh - var(--header-height)));
    padding-top: clamp(72px, 10vw, 144px);
    padding-bottom: clamp(70px, 9vw, 120px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: clamp(50px, 9vw, 160px);
    position: relative;
}

.catalog-hero::before {
    content: "纸";
    position: absolute;
    right: clamp(20px, 4vw, 64px);
    top: 20px;
    color: rgba(141, 47, 42, .055);
    font: 400 clamp(240px, 34vw, 520px)/.9 "Songti SC", "STSong", serif;
    pointer-events: none;
}

.hero-copy { position: relative; z-index: 1; }

.eyebrow,
.section-index {
    margin: 0;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
}

.catalog-hero h1 {
    max-width: 870px;
    margin: 22px 0 28px;
    font: 400 clamp(50px, 8vw, 112px)/.98 "Songti SC", "STSong", serif;
    letter-spacing: -.07em;
}

.catalog-hero h1 em {
    color: var(--accent);
    font-style: normal;
}

.hero-intro {
    max-width: 590px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.9;
}

.hero-stats {
    display: grid;
    gap: 24px;
    margin: 0 0 12px;
    min-width: 150px;
    position: relative;
    z-index: 1;
}

.hero-stats div {
    display: grid;
    grid-template-columns: 70px auto;
    align-items: baseline;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.hero-stats dt { font: 400 30px/1 Georgia, serif; }
.hero-stats dd { margin: 0; color: var(--muted); font-size: 12px; }

.collection-section,
.browser-section {
    padding-top: clamp(70px, 9vw, 120px);
    padding-bottom: clamp(80px, 10vw, 140px);
    border-top: 1px solid var(--line);
}

.section-heading,
.browser-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 32px;
    margin-bottom: 44px;
}

.section-heading h2,
.browser-heading h2,
.sample-note h2 {
    margin: 12px 0 0;
    font: 400 clamp(32px, 4vw, 56px)/1.08 "Songti SC", "STSong", serif;
    letter-spacing: -.04em;
}

.section-heading > p {
    max-width: 320px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.collection-grid {
    display: grid;
    grid-template-columns: 1.05fr 1.45fr .8fr;
    gap: 12px;
}

.collection-card {
    min-height: clamp(360px, 42vw, 580px);
    padding: 0;
    border: 0;
    background: #dedad0;
    color: #fff;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    isolation: isolate;
}

.collection-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s var(--ease), filter .45s ease;
}

.collection-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, .02) 30%, rgba(0, 0, 0, .72) 100%);
}

.collection-card:hover img { transform: scale(1.035); }
.collection-card[aria-selected="false"] img { filter: saturate(.68); }
.collection-card[aria-selected="true"]::before {
    content: "当前系列";
    position: absolute;
    z-index: 3;
    top: 20px;
    right: 20px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, .88);
    color: var(--ink);
    font-size: 10px;
    letter-spacing: .12em;
}

.collection-copy {
    position: absolute;
    z-index: 2;
    inset: auto 0 0;
    padding: clamp(22px, 3vw, 38px);
}

.collection-number { font: 400 12px/1 Georgia, serif; opacity: .72; }

.collection-title {
    display: block;
    margin: 12px 0 10px;
    font: 400 clamp(25px, 3vw, 40px)/1.1 "Songti SC", "STSong", serif;
}

.collection-copy p {
    max-width: 390px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
    line-height: 1.7;
}

.collection-meta {
    display: inline-block;
    margin-top: 20px;
    font-size: 11px;
    letter-spacing: .08em;
}

.browser-section {
    background: var(--paper-light);
    box-shadow: 0 0 0 100vmax var(--paper-light);
    clip-path: inset(0 -100vmax);
}

.search-wrap {
    width: min(100%, 430px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ink);
}

.search-wrap svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
}

.search-wrap input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
}

.search-wrap input::placeholder { color: #96968f; }

.search-wrap kbd {
    padding: 3px 6px;
    border: 1px solid var(--line);
    color: var(--muted);
    font: 10px/1.2 inherit;
}

.group-bar {
    margin-inline: calc(var(--page-gutter) * -1);
    padding-inline: var(--page-gutter);
    overflow: hidden;
}

.group-list {
    display: flex;
    gap: 8px;
    padding: 4px 0 18px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.group-filter {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.group-filter:hover,
.group-filter.active {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.result-meta {
    min-height: 30px;
    margin: 12px 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 12px;
}

.result-meta p { margin: 0; }

.clear-filter {
    padding: 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
}

.paper-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(12px, 1.6vw, 24px);
    outline: 0;
}

.paper-card {
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: zoom-in;
    text-align: left;
}

.paper-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: #e9e5dc;
    position: relative;
}

.paper-image::after {
    content: "查看细节 ↗";
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 6px 8px;
    background: rgba(23, 24, 21, .85);
    color: #fff;
    font-size: 9px;
    letter-spacing: .05em;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .25s ease, transform .25s ease;
}

.paper-card:hover .paper-image::after,
.paper-card:focus-visible .paper-image::after { opacity: 1; transform: translateY(0); }

.paper-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .55s var(--ease);
}

.paper-card:hover img { transform: scale(1.035); }

.paper-name {
    display: block;
    margin-top: 11px;
    font-size: 12px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.paper-group {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.empty-state {
    padding: 80px 20px;
    border: 1px solid var(--line);
    text-align: center;
}

.empty-state > span {
    width: 64px;
    height: 64px;
    margin: 0 auto 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e8e3da;
    color: var(--accent);
    font: 28px "Songti SC", serif;
}

.empty-state h3 { margin: 0 0 8px; font: 400 24px "Songti SC", serif; }
.empty-state p { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.empty-state button { border: 0; border-bottom: 1px solid; background: transparent; cursor: pointer; }

.load-more-wrap { padding-top: 48px; text-align: center; }

.load-more {
    min-width: 180px;
    padding: 13px 24px;
    border: 1px solid var(--ink);
    background: transparent;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.load-more:hover { background: var(--ink); color: #fff; }

.sample-note {
    padding-top: clamp(70px, 9vw, 120px);
    padding-bottom: clamp(70px, 9vw, 120px);
    display: grid;
    grid-template-columns: .55fr 1.5fr .55fr;
    gap: clamp(30px, 6vw, 90px);
    align-items: start;
    background: var(--moss);
    box-shadow: 0 0 0 100vmax var(--moss);
    clip-path: inset(0 -100vmax);
    color: #f2eee4;
}

.sample-note .section-index { color: #c9b999; }
.sample-note h2 { margin-top: 0; }

.sample-note p:not(.section-index) {
    max-width: 620px;
    margin: 24px 0 0;
    color: rgba(242, 238, 228, .68);
    font-size: 14px;
    line-height: 1.9;
}

.sample-note button {
    justify-self: end;
    border-color: rgba(255, 255, 255, .6);
    background: transparent;
}

.site-footer {
    padding-top: 36px;
    padding-bottom: 36px;
    display: flex;
    justify-content: space-between;
    gap: 30px;
    background: var(--ink);
    box-shadow: 0 0 0 100vmax var(--ink);
    clip-path: inset(0 -100vmax);
    color: rgba(255, 255, 255, .65);
    font-size: 11px;
}

.site-footer div { display: flex; gap: 16px; }
.site-footer strong { color: #fff; }
.site-footer p { margin: 0; }

dialog {
    padding: 0;
    border: 0;
    color: var(--ink);
}

dialog::backdrop { background: rgba(15, 15, 13, .72); backdrop-filter: blur(7px); }

.paper-dialog {
    width: min(1100px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    background: var(--paper-light);
}

.dialog-shell { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); }

.dialog-close {
    position: absolute;
    z-index: 5;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(23, 24, 21, .88);
    color: #fff;
    cursor: pointer;
    font-size: 23px;
    line-height: 1;
}

.dialog-image-wrap {
    min-height: min(72vh, 760px);
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #e7e2d8;
    position: relative;
}

.dialog-image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: min(85vh, 820px);
    object-fit: contain;
    opacity: 0;
    transition: opacity .25s ease;
}

.dialog-image-wrap img.loaded { opacity: 1; }

.dialog-loader {
    position: absolute;
    width: 34px;
    height: 34px;
    border: 2px solid rgba(23, 24, 21, .18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.dialog-loader.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.dialog-copy {
    padding: clamp(42px, 5vw, 72px) clamp(26px, 4vw, 54px) 34px;
    display: flex;
    flex-direction: column;
}

.dialog-path { margin: 0 0 18px; color: var(--accent); font-size: 10px; letter-spacing: .08em; }
.dialog-copy h2 { margin: 0; font: 400 clamp(27px, 3vw, 42px)/1.18 "Songti SC", "STSong", serif; overflow-wrap: anywhere; }
.dialog-disclaimer { margin: 22px 0; color: var(--muted); font-size: 12px; line-height: 1.7; }

.dialog-actions {
    margin-top: auto;
    padding-top: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid var(--line);
}

.dialog-actions button { padding: 6px 0; border: 0; background: transparent; cursor: pointer; }
.dialog-actions button:disabled { opacity: .25; cursor: default; }
.dialog-actions span { color: var(--muted); font-size: 11px; }

.contact-dialog {
    width: min(780px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    background: var(--paper-light);
}

.contact-shell { padding: clamp(34px, 6vw, 70px); }
.contact-shell > h2 { margin: 14px 0; font: 400 clamp(30px, 5vw, 52px)/1.08 "Songti SC", serif; letter-spacing: -.04em; }
.contact-shell > p:not(.eyebrow) { color: var(--muted); line-height: 1.7; }

.store-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 34px; }
.store-list article { padding: 20px; border: 1px solid var(--line); }
.store-list h3 { margin: 0 0 12px; font-size: 14px; }
.store-list p { min-height: 64px; margin: 0 0 16px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.store-list a { display: block; margin-top: 8px; color: var(--accent); font-size: 12px; text-decoration: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 1050px) {
    .paper-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .collection-grid { grid-template-columns: 1fr 1fr; }
    .collection-card:last-child { grid-column: 1 / -1; min-height: 360px; }
}

@media (max-width: 760px) {
    :root { --header-height: 60px; }
    .header-count { display: none; }
    .header-actions { gap: 14px; }
    .header-actions a { display: none; }
    .catalog-hero { min-height: auto; grid-template-columns: 1fr; align-items: start; }
    .catalog-hero::before { right: -50px; top: 60px; }
    .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .hero-stats div { grid-template-columns: 1fr; gap: 6px; }
    .section-heading, .browser-heading { align-items: start; flex-direction: column; }
    .search-wrap { width: 100%; }
    .collection-grid { grid-template-columns: 1fr; }
    .collection-card, .collection-card:last-child { min-height: 400px; grid-column: auto; }
    .paper-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sample-note { grid-template-columns: 1fr; }
    .sample-note button { justify-self: start; }
    .dialog-shell { grid-template-columns: 1fr; }
    .dialog-image-wrap { min-height: 0; height: min(62vw, 440px); }
    .dialog-copy { min-height: 240px; }
    .store-list { grid-template-columns: 1fr; }
    .store-list p { min-height: auto; }
}

@media (max-width: 500px) {
    .brand { font-size: 13px; }
    .brand-mark { width: 28px; height: 28px; }
    .contact-button { padding: 9px 12px; font-size: 12px; }
    .catalog-hero h1 { font-size: clamp(44px, 14vw, 64px); }
    .paper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 10px; }
    .paper-name { font-size: 11px; }
    .search-wrap kbd { display: none; }
    .site-footer { flex-direction: column; }
    .paper-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; }
    .dialog-image-wrap { height: 53dvh; }
    .dialog-copy { min-height: 47dvh; padding-bottom: 24px; }
}

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