/* finesse · targeted refinement · warm cat scrapbook · fan/row gallery · CSS transitions + WAAPI · 2026-10-31 */
:root {
  color-scheme: light;
  --page: #eeebe4;
  --paper: #faf6ef;
  --ink: #41392f;
  --muted: #716557;
  --accent: #ad6249;
  --accent-ink: #975039;
  --line: #dfd6c9;
  --sans: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --serif: "STSong", "SimSun", "Songti SC", Georgia, serif;

  --border-translucent: #ffffff80;
  --border-panel: #e9e2d7;
  --hover-surface: #e9e1d5;
  --on-accent: #fffdf7;
  --photo-white: #fffdf7;
  --input-surface: #fffcf640;
  --image-fallback: #c0b8aa;
  --shadow-close: #392b2020;
  --shadow-far: #392b2050;
  --photo-wash: #201c1a22;
  --photo-shade: #201c1ad9;
  --photo-shadow: #201c1a80;
  --shadow-lift: #392b2080;
  --scroll-thumb: #cbbb9f;
  --hover-warm: #f0e6d9;
  --switch-surface: #eae3d8b0;
  --switch-border: #dfd6ca;
  --switch-active: #fffdf8;
  --shadow-control: #4e3d2312;
  --border-subtle: #e6ddd0;
  --empty-muted: #716557;
  --shadow-modal: #17120a50;
  --backdrop: #30291f80;
  --close-surface: #faf6efed;
  --detail-fallback: #ddd4c4;
  --intro-ink: #756858;
  --body-ink: #675c4e;
  --input-border: #e6ddcf;
  --shadow-shell: #59472c09;
}
* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
html, body { overflow-x: clip; }
h1, h2 { overflow-wrap: anywhere; min-width: 0; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--sans); font-size: 14px; -webkit-font-smoothing: antialiased; }
body.dialog-open { overflow: hidden; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .38; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
button { touch-action: manipulation; }
[hidden] { display: none !important; }
.icon-definitions { width: 0; height: 0; position: absolute; overflow: hidden; }
.icon, .brand-mark, .empty-cat { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.gallery-shell { position: relative; max-width: 1680px; margin: 22px auto; width: calc(100% - 44px); min-height: calc(100svh - 44px); padding: 24px 48px 22px; border: 1px solid var(--border-translucent); border-radius: 28px; background: var(--paper); box-shadow: 0 12px 40px var(--shadow-shell); overflow: clip; }
.topbar { width: min(680px, 100%); height: 58px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 24px; background: var(--border-translucent); border: 1px solid var(--border-panel); border-radius: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: 1px; }
.brand-mark { width: 29px; height: 29px; color: var(--accent); stroke-width: 1.45; }
.brand-dot { color: var(--accent); }
.topbar-note { font-size: 11px; color: var(--muted); letter-spacing: 2px; }
.topbar-note span { margin: 0 7px; }
.intro { text-align: center; margin: 33px auto 23px; }
h1 { margin: 0; font-size: clamp(30px, 4.3vw, 66px); font-weight: 500; letter-spacing: -2px; line-height: 1.35; }
h1 span { font-family: var(--serif); font-weight: 500; }
.intro p { margin: 14px 0 0; color: var(--muted); font-size: 13px; letter-spacing: 1.8px; }
.browse-tools { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 0 8px; }
.category-tabs { display: flex; gap: 4px; }
.category-button { border: 0; background: transparent; border-radius: 30px; padding: 9px 17px; min-height: 44px; color: var(--muted); font-size: 13px; white-space: nowrap; transition: color .2s, background .2s; }
.category-button:hover { background: var(--hover-surface); color: var(--ink); }
.category-button.is-selected { color: var(--on-accent); background: var(--accent-ink); }
.category-button span { font-size: 10px; margin-left: 7px; opacity: .7; }
.search-box { display: flex; align-items: center; gap: 9px; width: 220px; min-height: 44px; padding: 8px 0 8px 15px; border-left: 1px solid var(--line); color: var(--muted); }
.search-box .icon { width: 16px; height: 16px; }
.search-box input { min-width: 0; width: 100%; background: transparent; border: 0; color: var(--ink); font-size: 13px; padding: 3px 0; }
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.gallery { position: relative; max-width: 1280px; margin: 0 auto; }
.stage { width: 100%; height: 500px; position: relative; overflow: hidden; isolation: isolate; }
.deck { height: 100%; position: relative; }
.cat-card { position: absolute; left: 0; top: 0; width: var(--card-width); height: var(--card-height); border: 0; background: transparent; padding: 0; border-radius: 10px; transform: translate3d(calc(var(--x) - 50%), calc(var(--y) - 50%), 0) rotate(var(--angle)); z-index: var(--z); transition: transform .65s cubic-bezier(.16,1,.3,1); text-align: left; -webkit-user-select: none; user-select: none; }
.card-face { display: block; position: relative; width: 100%; height: 100%; border-radius: 10px; overflow: hidden; background: var(--image-fallback); box-shadow: 0 3px 6px var(--shadow-close), 0 20px 28px -12px var(--shadow-far); border: 3px solid var(--photo-white); transition: transform .35s cubic-bezier(.16,1,.3,1); }
.card-face::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 42%, var(--photo-wash) 58%, var(--photo-shade) 100%); pointer-events: none; }
.card-face img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 42%; transition: transform .5s; }
.card-copy { position: absolute; bottom: 18px; left: 13px; right: 10px; z-index: 1; color: var(--photo-white); }
.card-category { display: block; font-size: 9px; letter-spacing: 2px; margin-bottom: 8px; opacity: .8; }
.card-title { display: block; font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1.4; padding-right: 14px; text-wrap: balance; text-shadow: 0 1px 8px var(--photo-shadow); }
.card-arrow { position: absolute; right: 1px; bottom: 4px; width: 15px; height: 15px; opacity: .9; }
.cat-card.is-active { z-index: 50; }
.cat-card.is-active .card-face { transform: translateY(-28px) rotate(calc(-1 * var(--angle))) scale(1.055); box-shadow: 0 4px 8px var(--shadow-close), 0 28px 34px -14px var(--shadow-lift); }
.cat-card:focus { outline: none; }
.cat-card:focus-visible .card-face { outline: 3px solid var(--accent); outline-offset: 5px; }
.stage[data-layout="row"] { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; scroll-padding-inline: 26px; }
.stage[data-layout="row"] .deck { min-width: 100%; }
.stage[data-layout="row"] .cat-card.is-active .card-face { transform: translateY(-14px) scale(1.025); }
.stage[data-layout="row"] .card-title { font-size: 20px; }
.below-deck { height: 32px; display: flex; align-items: center; justify-content: center; position: relative; margin-top: -1px; }
.deck-caption { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); letter-spacing: 1px; line-height: 1.6; }
.caption-dot { width: 4px; height: 4px; background: var(--accent); border-radius: 100%; }
.row-navigation { position: absolute; right: 4px; top: -4px; display: flex; gap: 8px; }
.round-button { width: 44px; height: 44px; background: transparent; border: 1px solid var(--line); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.round-button:hover:not(:disabled) { border-color: var(--accent); background: var(--hover-warm); }
.mode-switch { margin: 20px auto 0; display: flex; width: fit-content; padding: 5px; gap: 3px; background: var(--switch-surface); border: 1px solid var(--switch-border); border-radius: 100px; }
.mode-switch button { min-width: 88px; min-height: 44px; padding: 9px 15px; display: flex; align-items: center; justify-content: center; gap: 7px; background: transparent; border: 0; border-radius: 100px; color: var(--muted); font-size: 12px; white-space: nowrap; transition: background .2s, color .2s; }
.mode-switch .icon { width: 14px; height: 14px; }
.mode-switch button.is-selected { background: var(--switch-active); color: var(--ink); box-shadow: 0 2px 5px var(--shadow-control); }
.mode-switch button:hover:not(:disabled) { color: var(--ink); }
.mode-note { min-height: 16px; text-align: center; font-size: 11px; letter-spacing: 1.5px; color: var(--muted); margin: 12px 0 0; }
.page-footer { max-width: 1280px; margin: 26px auto 0; padding-top: 13px; border-top: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; letter-spacing: 1px; }
.page-footer a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; white-space: nowrap; }
.page-footer > span { padding-top: 15px; }
.page-footer a:hover { color: var(--accent); }
.page-footer .icon { width: 12px; height: 12px; }
.empty-state { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; color: var(--empty-muted); text-align: center; }
.empty-cat { width: 52px; height: 52px; stroke-width: 1; color: var(--accent); margin-bottom: 15px; }
.empty-state h2 { font-family: var(--serif); color: var(--ink); font-weight: 400; font-size: 26px; margin: 0 0 12px; }
.empty-state p { font-size: 12px; }
.text-button { border: none; background: transparent; padding: 10px; min-height: 44px; text-decoration: underline; text-underline-offset: 5px; color: var(--accent-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
dialog { width: min(1000px, calc(100% - 64px)); max-height: min(860px, calc(100svh - 64px)); padding: 0; border: 1px solid var(--on-accent); border-radius: 24px; background: var(--paper); color: var(--ink); overflow: auto; box-shadow: 0 30px 100px var(--shadow-modal); }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(7px); }
.detail-close { position: sticky; top: 18px; float: right; margin: 18px 18px -66px 0; width: 44px; height: 44px; z-index: 3; background: var(--close-surface); backdrop-filter: blur(8px); }
.detail-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 36px; padding: 28px; }
.detail-visual { min-width: 0; align-self: start; position: sticky; top: 28px; }
.detail-visual > img { width: 100%; height: 490px; object-fit: cover; object-position: center; border-radius: 13px; background: var(--detail-fallback); display: block; }
.detail-image-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; color: var(--muted); margin: 15px 3px 5px; font-size: 12px; }
.detail-image-note > span { min-width: 0; overflow-wrap: anywhere; }
#detail-category { color: var(--accent-ink); }
.detail-copy { min-width: 0; padding: 30px 16px 14px 0; }
.detail-heading h2 { font-family: var(--serif); font-size: 40px; line-height: 1.25; font-weight: 600; margin: 0 26px 12px 0; }
#detail-subtitle { font-size: 15px; color: var(--muted); line-height: 1.6; margin: 0 0 20px; }
.detail-intro { color: var(--intro-ink); font-size: 14px; line-height: 1.95; padding-bottom: 22px; margin: 0 0 23px; border-bottom: 1px solid var(--line); }
.detail-section { margin-bottom: 23px; }
.detail-section h3 { font-size: 13px; font-weight: 500; margin: 0 0 9px; color: var(--accent-ink); display: flex; align-items: center; gap: 8px; }
.detail-section h3::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.detail-section p { font-size: 14px; line-height: 1.95; margin: 0; color: var(--body-ink); }
.detail-sources { border-top: 1px solid var(--line); padding-top: 16px; }
.detail-sources > p { font-size: 11px; color: var(--muted); margin: 0 0 6px; letter-spacing: 2px; }
#detail-sources a { display: block; color: var(--accent-ink); font-size: 12px; line-height: 1.7; padding: 10px 0; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
#detail-sources .icon { width: 12px; height: 12px; margin-left: 6px; vertical-align: middle; }
.photo-source { display: inline-flex; align-items: center; color: var(--muted); font-size: 11px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 16px; padding: 14px 18px; border-radius: 8px; background: var(--ink); color: var(--paper); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
button:active:not(.cat-card):not(:disabled) { opacity: .8; }
.noscript { text-align: center; color: var(--accent); }
@media (min-width: 1500px) { .intro { margin-top: 48px; } .stage { height: 520px; } .gallery-shell { padding-top: 32px; } }
@media (max-width: 900px) {
 .gallery-shell { padding-inline: 24px; }
 .stage { height: 400px; }
 .card-title { font-size: 18px; }
 .detail-grid { gap: 25px; padding: 22px; }
 .detail-visual > img { height: 430px; }
 .detail-heading h2 { font-size: 32px; }
}
@media (max-width: 600px) {
 html { background: var(--paper); }
 body { background: var(--paper); }
 .gallery-shell { margin: 0; width: 100%; min-height: 100svh; border: 0; border-radius: 0; padding: 20px 0 22px; box-shadow: none; }
 .topbar { margin-inline: 20px; width: calc(100% - 40px); padding-inline: 15px; height: 52px; border-radius: 13px; }
 .brand { font-size: 18px; gap: 8px; }
 .brand-mark { width: 26px; height: 26px; }
 .topbar-note { font-size: 10px; letter-spacing: 0; }
 .topbar-note span { margin-inline: 4px; }
 .intro { margin: 35px 16px 23px; }
 h1 { font-size: clamp(27px, 6.5vw, 38px); letter-spacing: -1px; white-space: nowrap; }
 .intro p { font-size: 12px; letter-spacing: .4px; margin-top: 13px; }
 .browse-tools { flex-direction: column; gap: 14px; padding: 0 20px; }
 .category-button { padding: 8px 15px; font-size: 12px; }
 .search-box { width: 220px; border: 1px solid var(--input-border); border-radius: 30px; padding: 7px 13px; background: var(--input-surface); }
 .search-box input { font-size: 12px; }
 .stage { height: 365px; }
 .card-copy { bottom: 15px; left: 12px; }
 .card-title { font-size: 18px; }
 .card-category { letter-spacing: 1px; font-size: 8px; }
 .card-face { border-width: 3px; }
 .cat-card.is-active .card-face { transform: translateY(-12px) rotate(calc(-1 * var(--angle))) scale(1.02); }
 .stage[data-layout="fan"] .card-title { font-size: 15px; }
 .stage[data-layout="fan"] .card-copy { left: 7px; right: 7px; }
 .stage[data-layout="fan"] .card-arrow { display: none; }
 .below-deck { margin: 0 22px; height: 35px; justify-content: flex-start; }
 .deck-caption { font-size: 11px; letter-spacing: .3px; max-width: calc(100% - 104px); }
 .row-navigation { right: 0; top: -1px; }
 .round-button { width: 44px; height: 44px; }
 .mode-switch { margin-top: 17px; }
 .mode-switch button { padding: 8px 14px; min-width: 82px; font-size: 11px; }
 .mode-note { font-size: 10px; letter-spacing: .5px; }
 .page-footer { margin: 27px 22px 0; font-size: 10px; letter-spacing: 0; align-items: flex-start; gap: 10px; }
 .page-footer a { white-space: nowrap; }
 dialog { width: calc(100% - 20px); max-height: calc(100svh - 24px); border-radius: 18px; }
 .detail-close { width: 44px; height: 44px; top: 12px; margin-top: 12px; margin-right: 12px; }
 .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 16px; }
 .detail-visual { position: static; }
 .detail-visual > img { height: 250px; }
 .detail-image-note { font-size: 10px; margin-bottom: 0; }
 .detail-copy { padding: 24px 6px 10px; }
 .detail-heading h2 { font-size: 32px; }
 .detail-intro, .detail-section p { font-size: 14px; }
}
@media (min-width: 601px) and (max-width: 760px) {
 .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
 .detail-visual { position: static; }
 .detail-visual > img { height: 300px; }
 .detail-copy { padding: 26px 6px 10px; }
}
@media (prefers-reduced-motion: reduce) {
 html { scroll-behavior: auto; }
 *, *::before, *::after { animation: none !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
