:root {
  --radius-control: 14px;
  --radius-surface: 23px;
  --glass-border: rgba(234, 243, 250, .25);
  --glass-dark: rgba(29, 44, 54, .78);
}
body, button, select, input {
  font-family: Spectral, "STLiti", "华文隶书", Georgia, serif;
}
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline-offset: 4px;
}
button, .yellow-button { border-radius: var(--radius-control) }
@supports (mask-image: url("")) {
  .han-shape {
    position: relative;
    display: inline-block;
    overflow: hidden;
    vertical-align: -.33em;
    width: var(--han-width);
    height: 1.219em;
    text-indent: 0;
    letter-spacing: 0;
    pointer-events: none;
  }
  .han-shape::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: currentColor;
    mask: var(--han-image) center / 100% 100% no-repeat;
    forced-color-adjust: none;
  }
  .han-shape > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
[hidden] { display: none !important }

/* Cover and three-dimensional wardrobe */
body:has(#world) {
  --glass-dark: rgba(29, 44, 54, .8);
}
#world ~ header nav > a, #world ~ header nav > button, #back {
  border-radius: 999px;
}
#brand-name, .brand {
  font-family: Spectral, Georgia, serif;
  letter-spacing: -.055em;
}
#poster .brand-line h1 { font-family: Spectral, Georgia, serif; }
#poster .chips .entrance > span { border-radius: 6px }
#hero-foot .edition { font-size: 14px }
#tabs {
  height: auto;
  padding: 5px;
  gap: 4px;
  color: #15212b;
  border-radius: 999px;
  border: 1px solid #ffffffb0;
  background: rgba(224, 233, 240, .66);
  backdrop-filter: blur(24px) saturate(145%);
  box-shadow: 0 10px 30px #18283327, inset 0 1px 0 #ffffffa6;
  pointer-events: auto;
}
#tab-ink { display: none }
#tabs button, #tabs a, #tabs button[aria-selected=true] {
  border-radius: 999px;
  background: transparent;
  color: #17252d;
  min-width: 0;
  height: 36px;
  padding: 0 clamp(12px, 2vw, 28px);
  font-size: 17px;
  letter-spacing: 0;
}
#tabs button[aria-selected=true] {
  background: #29424cec;
  color: white;
  box-shadow: inset 0 1px 0 #fff2, 0 3px 8px #14243237;
}
#tabs a:hover, #tabs button:hover:not([aria-selected=true]) { background:#ffffff6e }
#caption {
  max-width:calc(100vw - 20px);
  border-radius: 999px;
  background: #ebf49de8;
  border: 1px solid #ffffffa6;
  backdrop-filter: blur(16px);
  box-shadow: 0 5px 18px #1f354b20;
}
.piece-picker {
  border: 1px solid var(--glass-border);
  border-radius: 17px;
  background: var(--glass-dark);
  backdrop-filter: blur(18px) saturate(135%);
  padding: 4px;
  gap: 4px;
  z-index: 2;
}
#garment-angles:not([hidden]) {
  position: absolute;
  left: 38px;
  top: 153px;
  display: grid;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--glass-border);
  border-radius: 17px;
  color: #f1f7fa;
  background: var(--glass-dark);
  backdrop-filter: blur(16px);
}
#garment-angles button {
  min-height: 36px;
  padding: 5px 12px;
  border-radius: 12px;
  white-space: nowrap;
  font-size: 14px;
}
#garment-angles button:hover { background:#ffffff24 }
#garment-angles button[aria-pressed=true] { background:#eaf2a5; color:#25353d }
@media(max-width:800px) {
  #garment-angles:not([hidden]) { left: 12px; top: 175px; gap: 2px }
  #garment-angles button { padding-inline: 8px }
}
.liti-picker { position:relative; min-width:0 }
.liti-picker summary {
  list-style: none;
  cursor: pointer;
  padding: 7px 23px 7px 10px;
  min-height: 34px;
  border-radius: 11px;
  white-space: nowrap;
  font-size: 15px;
}
.liti-picker summary::-webkit-details-marker { display: none }
.liti-picker summary::after {
  content: "";
  position: absolute;
  top: 13px;
  right: 11px;
  width: 5px;
  height: 5px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}
.liti-picker[open] summary, .liti-picker summary:hover { background: #ffffff1a }
.picker-menu {
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  min-width: max-content;
  max-height: min(52vh, 370px);
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  color: #f1f7fa;
  background: #263d4af5;
  box-shadow: 0 12px 28px #101d2975;
}
.liti-picker:last-child .picker-menu { right: 0; left: auto }
.picker-menu button {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 5px 9px;
  border-radius: 9px;
  text-align: left;
  white-space: nowrap;
  color: inherit;
  font-size: 15px;
}
.picker-menu button:hover, .picker-menu button[aria-pressed=true] { background: #ffffff26 }
dialog {
  border-radius: var(--radius-surface);
  border: 1px solid var(--glass-border);
  background: #243641ed;
  backdrop-filter: blur(24px) saturate(125%);
}
.product-image, .product-image img, .cart-row img, #error-panel a { border-radius: var(--radius-control) }
.product-info #add-cart { border-radius: 0 }
.product-info #product-garment, .product-info #product-description { opacity:.92 }

/* Garment catalogue */
body:has(#pieces) {
  background: radial-gradient(ellipse at 74% 0%, #334952, transparent 42%), #1e2b32;
}
body:has(#pieces) header .brand { font-size: 34px; line-height: 1 }
body:has(#pieces) header .store-link {
  background: #e1f0ff13;
  backdrop-filter: blur(14px);
  border-radius: 999px;
}
body:has(#pieces) .intro h1 {
  font-size: clamp(33px,5.5vw,84px);
  line-height: 1.12;
  letter-spacing: 0;
}
body:has(#pieces) .intro .eyebrow { font-size:15px; margin-bottom:9px }
body:has(#pieces) .intro-note { font-size:20px; color:#d5e3e7 }
body:has(#pieces) .intro-title { min-width:0 }
body:has(#pieces) .style-counts { gap:8px }
body:has(#pieces) .style-counts a {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:39px;
  padding:4px 9px;
  border-radius:999px;
  background:#e3f3ff0c;
  border:1px solid #e3f3ff25;
}
body:has(#pieces) .style-counts a:hover { background:#e3f3ff2d }
.piece {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--radius-surface);
  border-color: #e1f2ff43;
  background: #2c3d46;
  box-shadow: 0 8px 20px #09121836;
}
.piece::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 25% -10% -6%;
  background: var(--piece-photo) center 84% / cover no-repeat;
  filter: blur(25px) saturate(.95);
  opacity: .55;
}
.piece-image.has-cover {
  margin: 6px 6px 0;
  border-radius: 17px;
  overflow: hidden;
  background: #647078;
}
.piece-image img { border-radius: inherit }
.piece-info {
  margin-top: -5px;
  position: relative;
  padding: 18px 16px 14px;
  border-radius: 0 0 var(--radius-surface) var(--radius-surface);
  background: linear-gradient(158deg,#6a85933d,#14232bd1 72%);
  box-shadow: inset 0 1px 0 #ffffff34;
  backdrop-filter: blur(20px) saturate(145%);
}
.piece-title {display:flex;align-items:flex-start;gap:8px}
.piece-title h2 {font-size:30px;line-height:1.25;font-weight:400}
.piece-english {margin:4px 0 0;color:#edf5fa;font-size:14px;line-height:1.2}
.piece-en {font-size:13px;color:#f0f6fa;margin-top:2px}
.piece-work-title {font-size:18px;margin:12px 0 0}
.piece-cue {font-size:14px;line-height:1.5;color:#ecf4f7;margin:8px 0 13px}
.piece-actions {gap:6px;flex-wrap:wrap}
.piece-actions a {
  border:1px solid #e9f5ff40;
  border-radius:999px;
  background:#e4f3ff16;
  padding:5px 10px;
  font-size:13px;
  line-height:1.4;
  min-height:32px;
  display:inline-flex;
  align-items:center;
}
.piece-actions a:hover { background:#e4f3ff44 }
.piece-actions .piece-video {color:#f4fbdb;background:#d2ec6d20}
.piece a:focus-visible {outline-offset:-3px}

/* Individual solar-term pages */
.term-english {font-family:Spectral,Georgia,serif;font-size:17px;letter-spacing:.025em}
body:has(.term-english) h1 {font-family:inherit;margin-bottom:0}
body:has(.term-english) figure > a {display:block;border-radius:18px;overflow:hidden}
body:has(.term-english) footer a {border-radius:999px;padding:4px 9px}
@media(max-width:760px) {
  .piece-info {padding:16px 12px 12px}
  .piece-en {max-width:46%;margin-left:auto;text-align:right}
  .liti-picker summary {font-size:13px}
  #tabs a,#tabs button,#tabs button[aria-selected=true] {font-size:15px;padding-inline:12px}
}
@media(max-width:470px) {
  body:has(#pieces) .intro h1 {font-size:clamp(27px,10vw,43px)}
  .piece-title {display:flex}
}
@media(max-width:360px) {
  body:has(#pieces) header .brand {font-size: 27px}
  body:has(#pieces) header .store-link {padding-inline: 10px}
  #tabs a,#tabs button,#tabs button[aria-selected=true] {padding-inline:10px}
}

/* The full sentence fits in a single line alongside the title on wide screens. */
@media(min-width:1320px) {
  body:has(#pieces) .intro-note {height:1px;margin-block-end:3px}
}

#caption-name{overflow:hidden;text-overflow:ellipsis;min-width:0}
#view-piece{flex-shrink:0}

@media(max-height:575px) {
  #garment-angles:not([hidden]) {top:118px;gap:2px}
  #garment-angles button {min-height:29px;padding-block:3px}
}

/* Saved works: white copy except the original yellow action. */
#cart-dialog,
#cart-dialog a:any-link,
#cart-dialog button:not(#continue-shopping),
#cart-dialog .cart-note,
#cart-dialog .cart-row small {
  color: #fff;
  opacity: 1;
}
