:root {
  --paper: #F4EFE4;
  --ink: #161616;
  --red: #F40201;
  --hei: "Noto Sans SC", "Source Han Sans SC", "Source Han Sans CN", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "WenQuanYi Micro Hei", "Droid Sans Fallback", sans-serif;
  --song: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "PMingLiU", serif;
  --latin: "Source Sans 3", "Gothic A1", "Arial", "Helvetica Neue", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(22, 22, 22, 0.05) 0.5px, transparent 0.55px);
  background-size: 3px 3px;
  font-family: var(--song);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.85;
  line-break: strict;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

::selection {
  background: var(--ink);
  color: var(--paper);
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

a:hover { text-decoration-color: var(--red); }

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

img { border: 0; }

:lang(en) { font-family: var(--latin); }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 2;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 8px 12px;
  font-family: var(--latin), var(--hei);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus { top: 8px; }

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 28px 48px;
}

.kicker {
  display: flex;
  justify-content: space-between;
  gap: 8px 14px;
  margin: 0;
  padding: 3px 0 5px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-size: 0.78rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
}

.kicker span:nth-child(2) {
  text-align: center;
  flex: 1 1 auto;
}

.kicker span:last-child { text-align: right; }

.masthead {
  display: grid;
  grid-template-columns: 8.4rem minmax(0, 36rem) 8.4rem;
  justify-content: center;
  gap: 10px 16px;
  align-items: stretch;
  width: 100%;
  margin-top: 8px;
}

.ear {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  align-self: stretch;
  min-width: 0;
  padding: 10px 2px;
  border: 3px solid var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  background: linear-gradient(var(--ink), var(--ink)) center / 1px 100% no-repeat;
  container-type: inline-size;
  font-family: var(--hei), var(--latin);
  font-weight: 900;
  font-size: clamp(1.85rem, 40cqw, 3.35rem);
  line-height: 1;
}

.ear-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08em;
}

.ear b { font-weight: 900; }

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

.bao-yan {
  min-width: 0;
  padding: 8px 12px 7px;
  border-right: 1px solid var(--ink);
  text-align: center;
  font-size: 0.86rem;
  line-height: 1.5;
}

.bao-yan p,
.colophon p { margin: 0; }

.bao-date {
  font-variant-numeric: tabular-nums;
  min-height: 1.5em;
}

.bao-issue b { font-weight: 600; }

.info-row {
  display: grid;
  grid-template-columns: minmax(15.5rem, 1.35fr) repeat(3, minmax(0, 1fr));
  margin-top: 8px;
  border: 1px solid var(--ink);
}

.colophon {
  min-width: 0;
  padding: 8px 10px 7px;
  border-right: 1px solid var(--ink);
  font-size: 0.78rem;
  line-height: 1.45;
}

.colophon:last-child { border-right: 0; }

.colophon-label {
  font-family: var(--hei), var(--latin);
  font-weight: 900;
  font-size: 0.84rem;
  letter-spacing: 0.22em;
  line-height: 1.3;
}

.nameplate img {
  display: block;
  width: 100%;
  height: auto;
  background: transparent;
}

.nameplate-rules {
  height: 9px;
  margin-top: 8px;
  border-top: 2px solid var(--ink);
  border-bottom: 5px solid var(--red);
}

.shop-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 4;
  margin-top: 8px;
  padding: 10px 2px;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  font-family: var(--hei), var(--latin);
  font-weight: 700;
  letter-spacing: 0.18em;
}

.shop-bar a {
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding: 4px 0;
}

.shop-bar a:hover { border-bottom-color: var(--ink); }

.catalog {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px 22px;
  margin-top: 28px;
}

.catalog-status {
  margin: 28px 0 0;
  font-family: var(--song);
}

.listing {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--ink);
}

.listing img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--ink);
  padding: 4px;
  background: var(--paper);
}

.listing h3 {
  margin: 0;
  font-family: var(--hei), var(--latin);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  line-height: 1.35;
}

.listing-price {
  margin: 2px 0 8px;
  font-family: var(--latin);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.size,
.qty button,
.remove,
.add-button,
.checkout,
.cart-close,
.cart-button {
  font-family: var(--latin), var(--hei);
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border-radius: 0;
}

.size,
.qty button,
.remove,
.add-button,
.checkout,
.cart-close {
  border: 1px solid var(--ink);
}

.size {
  min-width: 2.4em;
  min-height: 2.2em;
  padding: 0 0.45em;
  letter-spacing: 0.04em;
}

.size[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.size:disabled { opacity: 0.38; }

.add-button,
.checkout {
  display: block;
  width: 100%;
  min-height: 2.6em;
  letter-spacing: 0.14em;
}

.add-button:disabled,
.checkout:disabled {
  cursor: not-allowed;
  color: var(--ink);
  border-style: dashed;
  opacity: 1;
}

.cart-button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 4px 0 3px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.cart-button:hover { border-bottom-color: var(--ink); }

.cart-button span { font-variant-numeric: tabular-nums; }

.about {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 3px solid var(--ink);
}

.about h2 {
  margin: 0 0 10px;
  font-family: var(--hei), var(--latin);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 0.28em;
}

.about p {
  max-width: 40em;
  margin: 0 0 0.7em;
}

.about p[lang="en"] {
  font-size: 0.95rem;
  line-height: 1.55;
}

.footer {
  margin-top: 28px;
  border-top: 4px solid var(--red);
  padding-top: 4px;
}

.footer-line {
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  text-align: center;
  font-family: var(--song);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.12em;
  line-height: 1.6;
}

.footer-line a { text-decoration-thickness: 1px; }

.footer-address {
  margin: 8px 0 0;
  text-align: center;
  font-family: var(--latin);
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

#guanyu { scroll-margin-top: 64px; }

.cart-dialog {
  width: min(28rem, 100vw);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.cart-dialog::backdrop { background: rgba(22, 22, 22, 0.4); }

.cart-sheet {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 18px 16px 24px;
}

.cart-close {
  align-self: flex-end;
  min-height: 2.2em;
  padding: 0 0.8em;
  letter-spacing: 0.12em;
}

.cart-sheet h2 {
  margin: 8px 0 14px;
  font-family: var(--hei), var(--latin);
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: 0.28em;
  border-bottom: 3px solid var(--red);
  padding-bottom: 6px;
}

.cart-empty {
  margin: 12px 0 20px;
  font-family: var(--song);
}

.cart-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--ink);
}

.cart-line img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.cart-line h3 {
  margin: 0 0 4px;
  font-family: var(--hei), var(--latin);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cart-line p { margin: 0; font-size: 0.85rem; }

.qty {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.qty button {
  width: 2em;
  height: 2em;
  padding: 0;
}

.qty span {
  min-width: 1.2em;
  text-align: center;
  font-family: var(--latin);
}

.remove {
  margin-top: 8px;
  padding: 0.2em 0.5em;
  letter-spacing: 0.08em;
}

.cart-subtotal {
  margin: 16px 0 10px;
  font-family: var(--hei), var(--latin);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.cart-notice {
  margin: 10px 0 0;
  font-family: var(--song);
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: left;
}

.cart-status {
  min-height: 1.4em;
  margin: 8px 0 0;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .masthead { grid-template-columns: 4.15rem minmax(0, 1fr) 4.15rem; justify-content: stretch; gap: 6px; }
  .ear { align-self: center; border-width: 2px; box-shadow: inset 0 0 0 1px var(--ink); padding: 5px 0; font-size: 0.98rem; }
  .info-row { grid-template-columns: 1fr 1fr; }
  .info-row > * { border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
  .bao-yan,
  .colophon:last-child { grid-column: 1 / -1; }
  .info-row > :nth-child(odd) { border-right: 0; }
  .info-row > :last-child { border-right: 0; border-bottom: 0; }
  .kicker { letter-spacing: 0.04em; font-size: 0.72rem; }
}

@media (max-width: 640px) {
  .page { padding: 12px 14px 36px; }
  .catalog { grid-template-columns: 1fr; gap: 28px; }
  .cart-button { letter-spacing: 0.02em; font-size: 0.92rem; }
  .cart-dialog { width: 100vw; border-left: 0; }
  .footer-line { letter-spacing: 0.04em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  body { background: #fff; background-image: none; }
  .page { max-width: none; padding: 0; }
  .skip, .cart-dialog { display: none; }
}
