@font-face {
  font-family: "铺招";
  src: url(shop-sign.ttf) format("truetype");
  font-weight: 400;
  font-display: swap;
}
:root {
  --wood: linear-gradient(105deg,#20272c99,#322b2488), url(lacquer.webp) 34% 55% / cover;
  --gold: #c3a16b;
  --ink: #342e27;
  --paper: #f5edde;
  --photo: #f8e7d4;
  --muted: #6a5a48;
  --gutter: clamp(20px,3vw,52px);
}
html { scrollbar-gutter:stable; }
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
body { font: 18px/1.5 "Songti SC","Noto Serif CJK SC","SimSun",serif; color:var(--ink); background:var(--paper); }
::selection { background:#594836; color:#fff5df; }
a { color:inherit; text-decoration:none; touch-action:manipulation; -webkit-tap-highlight-color:#b4925433; }
a:focus-visible { outline:3px solid #85531f; outline-offset:-4px; }
.rail a:focus-visible { outline-color:#e8cb91; }
.skip { position:fixed; left:12px; top:10px; z-index:5; padding:9px 15px; background:var(--paper); transform:translateY(-160%); }
.skip:focus { transform:none; }
.shop { display:grid; grid-template-columns:clamp(160px,13vw,210px) minmax(0,1fr); }
.rail { position:sticky; top:0; height:100vh; height:100svh; display:grid; place-items:center; background:var(--wood); color:#f1e2c6; }
.word,.mark { font-family:"铺招","Kaiti SC","STKaiti",serif; font-weight:400; writing-mode:vertical-rl; line-height:1.1; }
.word { font-size:clamp(72px,min(6.5vw,14vh),98px); letter-spacing:.08em; }
.rail::after,.mark::after { content:""; position:absolute; top:0; bottom:0; right:0; width:8px; border-left:2px solid var(--gold); border-right:2px solid var(--gold); pointer-events:none; }
nav { display:flex; align-items:center; gap:clamp(12px,2vw,32px); }
nav a { min-width:44px; min-height:44px; display:inline-grid; place-items:center; text-underline-offset:.35em; }
nav a:hover { text-decoration:underline; }
.rail nav { display:grid; grid-template-columns:repeat(2,1fr); position:absolute; bottom:max(26px,env(safe-area-inset-bottom)); max-width:calc(100% - 16px); gap:4px 12px; flex-wrap:wrap; justify-content:center; font-size:18px; }
.mobile-head { display:none; }
.collection, .portrait { min-width:0; min-height:0; }
.look-link { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; height:auto; min-height:0; position:relative; }
.look-link:focus-visible { outline:0; }
.look-link:focus-visible::after { content:""; position:absolute; inset:4px; border:3px solid #845421; pointer-events:none; }
.portrait { background:var(--photo); }
.portrait img { display:block; width:100%; height:auto; aspect-ratio:4/5; object-fit:contain; }
.caption { background:var(--paper); display:flex; align-items:center; justify-content:space-between; gap:12px; padding:16px 0; }
.identity { display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; }
.caption h2 { font-size:clamp(23px,2vw,30px); line-height:1.13; font-weight:700; letter-spacing:.05em; text-wrap:balance; }
.tone { color:var(--muted); font-size:16px; line-height:1.5; }
.enter { min-height:44px; display:flex; align-items:center; gap:12px; font-size:17px; white-space:nowrap; text-underline-offset:.34em; }
.enter::after { content:""; width:8px; height:8px; border-top:1px solid; border-right:1px solid; transform:rotate(45deg); margin-right:3px; }
.look-link:hover .enter,.look-link:focus-visible .enter { text-decoration:underline; }
@media (min-width:721px) and (max-width:1099px) {
  .shop { grid-template-columns:clamp(124px,15vw,160px) minmax(0,1fr); }
  .word { font-size:clamp(64px,7vw,78px); }
  .rail nav { display:grid; grid-template-columns:repeat(2,1fr); gap:0 8px; font-size:16px; }
  .caption { padding-block:16px; }
}
@media (max-width:720px) {
  .shop { display:block; }
  .rail { display:none; }
  .mobile-head { position:relative; z-index:1; display:flex; justify-content:flex-end; align-items:center; min-height:72px; padding:env(safe-area-inset-top) max(16px,env(safe-area-inset-right)) 0 0; background:var(--photo); }
  .mobile-head nav { gap:9px; font-size:17px; }
  .mark { position:absolute; top:0; left:max(18px,env(safe-area-inset-left)); width:50px; height:100%; display:grid; place-content:center; padding-right:6px; background:var(--wood); color:#f1e2c6; font-size:22px; letter-spacing:.09em; }
  .look-link { height:auto; min-height:0; display:block; }
  .portrait img { height:auto; max-height:360px; object-fit:contain; }
  .caption { padding:12px 0 20px; }
  .identity { align-items:baseline; gap:10px; }
  .caption h2 { font-size:clamp(24px,7vw,33px); letter-spacing:.035em; }
  .tone { font-size:14px; }
  .enter { font-size:16px; gap:6px; }
}
@media (max-height:475px) and (min-width:721px) {
  .word { font-size:12vh; }
  .rail nav { bottom:4px; }
  .caption { padding-block:8px; }
}

.collection { display:flex; flex-direction:column; min-height:100svh; }
.collection > main { flex:1; }
.shop-footer { margin-top:auto; padding:14px var(--gutter); display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:20px; background:#30261e; color:#ead9bd; border-top:1px solid #9b7b50; box-shadow:0 -3px 14px #30261e18; }
.footer-brand { font-family:"铺招","Kaiti SC",serif; font-size:26px; line-height:1.2; }
.shop-footer nav { display:none; gap:clamp(12px,2vw,32px); }
.shop-footer nav a { position:relative; min-width:44px; min-height:48px; }
.shop-footer nav a[aria-current] { color:#ffe4b6; font-weight:700; text-decoration:none; }
.shop-footer nav a[aria-current]::after { content:""; position:absolute; bottom:4px; left:calc(50% - 10px); width:20px; height:2px; background:currentColor; }
.shop-footer a:focus-visible { outline-color:#ffe4b6; }
@media(max-width:720px) {
  html { scroll-padding-bottom:72px; scrollbar-gutter:auto; }
  .collection { padding-bottom:calc(56px + env(safe-area-inset-bottom)); min-height:100svh; }
  .shop-footer { position:fixed; z-index:4; inset:auto 0 0; padding:0 max(8px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px,env(safe-area-inset-left)); border-top:1px solid #9b7b50; }
  .footer-brand,.footer-contact { display:none; }
  .shop-footer nav { display:grid; width:100%; grid-template-columns:repeat(5,minmax(0,1fr)); gap:0; }
  .shop-footer nav a { min-height:48px; font-size:16px; isolation:isolate; }
  .shop-footer nav a[aria-current]::before { content:""; position:absolute; z-index:-1; inset:6px 5px; border:1px solid #9b7b50; border-radius:4px; background:#51402d; }
  .shop-footer nav a[aria-current]::after { display:none; }
  .shop-footer nav a:hover { text-decoration:none; color:#ffe4b6; }
}

/* Shared hierarchy and home composition. */
[hidden] { display:none !important; }
button,input,select { font:inherit; }
button { touch-action:manipulation; }
input,select { color:var(--ink); accent-color:#634b2c; caret-color:#634b2c; }
:focus-visible { outline:2px solid #85531f; outline-offset:3px; }
.mobile-return { display:inline-flex; align-items:center; min-height:44px; font-size:15px; text-decoration:underline; text-underline-offset:.3em; }
.footer-contact { display:flex; gap:12px 28px; flex-wrap:wrap; font:14px/1.6 system-ui,sans-serif; }
.footer-contact a { display:inline-flex; align-items:center; min-height:44px; }
.home-intro { padding:40px var(--gutter) 28px; display:flex; align-items:flex-end; justify-content:space-between; gap:24px; }
.home-intro h1 { font-size:clamp(30px,3.2vw,48px); line-height:1.25; }
.home-intro p,.home-help p { margin-top:12px; font:16px/1.8 "PingFang SC",sans-serif; color:var(--muted); }
.home-categories { display:flex; gap:12px; flex-shrink:0; }
.home-categories a { border:1px solid #a48c69; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:12px 18px; min-height:52px; font-size:19px; }
.home-categories a:hover { background:#eadcc5; }
.home-categories span { font:14px/1.5 system-ui,sans-serif; color:var(--muted); }
.featured-looks { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; padding:0 var(--gutter); }
.featured-looks .caption { display:block; }
.featured-looks .enter { margin-top:4px; min-height:36px; font-size:15px; }
.home-help { display:flex; align-items:center; gap:16px 32px; flex-wrap:wrap; margin:12px var(--gutter) 32px; padding-top:24px; border-top:1px solid #c8bba5; }
.home-help div { margin-right:auto; }
.home-help h2 { font-size:24px; }
.home-help p { margin-top:6px; }
.home-help > a { min-height:44px; display:flex; align-items:center; font-size:16px; text-decoration:underline; text-underline-offset:.3em; }
@media(max-width:1199px) { .home-intro { align-items:flex-start; flex-direction:column; gap:20px; } }
@media(max-width:720px) {
  .footer-contact { display:none; }
  .home-intro { padding:28px var(--gutter) 24px; gap:20px; }
  .home-intro h1 { font-size:32px; }
  .home-intro p { font-size:15px; margin-top:8px; }
  .home-categories { width:100%; }
  .home-categories a { flex:1; gap:8px; padding:10px 12px; font-size:18px; }
  .featured-looks { grid-template-columns:1fr; gap:12px; }
  .featured-looks .caption { display:flex; align-items:center; }
  .featured-looks .enter { margin:0; }
  .home-help { margin-top:16px; gap:8px 24px; }
}

/* A native dialog keeps focus and image inspection inside the current page. */
.viewer-open { overflow:hidden; }
.image-viewer { width:min(1200px,100%); max-width:100%; height:100dvh; max-height:100dvh; margin:auto; padding:0; border:0; background:var(--paper); color:var(--ink); }
.image-viewer[open] { display:flex; flex-direction:column; }
.image-viewer::backdrop { background:#211c16e6; }
.viewer-toolbar { display:flex; align-items:center; gap:12px; padding:12px max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left)); border-bottom:1px solid #baa788; }
.viewer-toolbar h2 { margin-right:auto; font-size:20px; line-height:1.4; }
.viewer-toolbar button { min-height:44px; padding:8px 12px; flex-shrink:0; border:1px solid #a48c69; border-radius:4px; color:var(--ink); background:#fcf7ed; cursor:pointer; font-size:15px; }
.viewer-stage { flex:1; min-height:0; overflow:auto; padding:16px; background:var(--photo); overscroll-behavior:contain; }
.viewer-stage img { display:block; width:100%; height:100%; object-fit:contain; }
.viewer-stage.original-size img { width:auto; height:auto; max-width:none; max-height:none; }
.viewer-status { padding:0 16px max(8px,env(safe-area-inset-bottom)); font-size:15px; }
.viewer-status:empty { padding-top:0; }
@media(max-width:720px) {
  .viewer-toolbar { flex-wrap:wrap; gap:8px; padding-top:max(12px,env(safe-area-inset-top)); }
  .viewer-toolbar h2 { flex-basis:100%; font-size:18px; }
  .viewer-toolbar .viewer-close { margin-left:auto; }
  .viewer-stage { padding:8px; }
}
