.skip-link {
  position: absolute;
  z-index: 3;
  inset: 1rem auto auto 1rem;
  padding: .7rem 1rem;
  background: var(--ink);
  color: white;
  transform: translateY(-180%);
}

.skip-link:focus { transform: none; }
.detail-main a:focus-visible, .site-header a:focus-visible, footer a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

.detail-main { max-width: 72rem; margin: 0 auto; padding: 2rem 6% 4rem; }
.detail-breadcrumb { margin: 0 0 1.75rem; font-size: .85rem; }
.detail-breadcrumb ol { display: flex; flex-wrap: wrap; gap: .45rem .7rem; margin: 0; padding: 0; list-style: none; }
.detail-breadcrumb li + li::before { content: "/"; display: inline-block; color: #72786e; margin-right: .7rem; }
.detail-breadcrumb a, .detail-back { text-decoration: underline; text-underline-offset: .18em; }

.detail-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(1.5rem, 5vw, 4.5rem); align-items: center; }
.detail-copy h1 { font-size: clamp(2.25rem, 5.2vw, 4.25rem); letter-spacing: -.04em; margin: .9rem 0 1rem; overflow-wrap: anywhere; }
.detail-intro { font-size: 1rem; line-height: 1.7; max-width: 35rem; margin-bottom: 1.2rem; }
.detail-sample { padding: .95rem 1rem 1.1rem; max-width: 35rem; border-left: 3px solid var(--red); background: #f3ebe0; }
.detail-sample-label { margin: 0; font-size: .85rem; color: #4a5c52; }
.detail-note { margin: .4rem 0 .8rem; line-height: 1.5; color: #495a50; font-size: .925rem; }
.detail-visual {
  --stage: #e8dacc;
  --stage-highlight: #f3e7d6;
  --stage-border: #d6c4af;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: clamp(17rem, 31vw, 24rem);
  margin: 0;
  padding: clamp(1.35rem, 4vw, 2.75rem);
  overflow: hidden;
  border: 1px solid var(--stage-border);
  border-radius: .4rem;
  background: radial-gradient(ellipse at 27% 19%, var(--stage-highlight), transparent 73%), var(--stage);
}

.detail-visual--mid-autumn-moon-festival { --stage: #d8ab91; --stage-highlight: #f2d3b3; --stage-border: #c9957c; }
.detail-visual--mandarin-numbers { --stage: #c6d1bf; --stage-highlight: #e7e9d8; --stage-border: #b6c4b0; }
.detail-visual--lantern-riddle-night { --stage: #b77761; --stage-highlight: #e2aa8b; --stage-border: #a66550; }
.detail-visual--chinese-idiom-studio { --stage: #c1cdbb; --stage-highlight: #e5e4d1; --stage-border: #aab9a5; }
.detail-visual--solar-terms-journal { --stage: #d3cfad; --stage-highlight: #eee5c9; --stage-border: #c5bf9e; }
.detail-visual--chinese-color-studio { --stage: #a8b6ad; --stage-highlight: #dce2d7; --stage-border: #98a99c; }
.detail-visual--chinese-character-studio { --stage: #d9b79b; --stage-highlight: #ecd7bf; --stage-border: #c9a98e; }

.detail-visual--image { gap: .7rem; padding-block: clamp(1.35rem, 3vw, 2rem) 1.2rem; }
.detail-preview-frame {
  padding: .35rem;
  max-width: 100%;
  background: #fff9ef;
  border: 1px solid rgb(72 44 36 / 22%);
  box-shadow: 0 1rem 2rem rgb(55 35 22 / 15%), 0 .2rem .4rem rgb(55 35 22 / 12%);
}
.detail-preview-frame img { display: block; width: auto; height: auto; max-width: 100%; max-height: 23rem; }
.detail-visual figcaption {
  color: #382e26;
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 1rem;
  background: #f8eedb;
}

.detail-paper {
  position: relative;
  min-width: 0;
  background: #fff9ed;
  border: 1px solid rgb(89 65 45 / 28%);
  border-radius: .2rem;
  box-shadow: 0 .9rem 1.9rem rgb(55 35 22 / 16%), 0 .2rem .45rem rgb(55 35 22 / 12%);
}
.detail-visual [lang="zh-Hans"] { font-family: "Noto Serif SC", "Songti SC", SimSun, serif; }
.detail-card-pair { display: grid; width: min(100%, 20rem); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
.detail-card-pair > :first-child { transform: translate(.2rem, -.55rem) rotate(-7deg); }
.detail-card-pair > :last-child { transform: translate(-.15rem, .55rem) rotate(6deg); }
.detail-word-card {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .25rem;
  min-height: clamp(9rem, 15vw, 12rem);
  padding: .7rem;
  border-top: .34rem solid #9f433e;
  text-align: center;
}
.detail-word-card:last-child { border-top-color: #306252; background: #edf0df; }
.detail-word-card > span { color: #963a35; font-size: clamp(3rem, 6.4vw, 5rem); line-height: 1.15; }
.detail-word-card:last-child > span { color: #254e43; }
.detail-word-card b { font-family: Georgia, serif; font-size: 1.032rem; }
.detail-word-card small, .detail-idiom-card small { color: #536459; font-size: .75rem; line-height: 1.4; }

.detail-idiom-card {
  display: grid;
  align-content: center;
  gap: .44rem;
  min-height: clamp(8.75rem, 14vw, 11.25rem);
  padding: .8rem .65rem;
  text-align: center;
}
.detail-idiom-card:last-child { background: #e8efe4; }
.detail-idiom-card > span { font-size: clamp(1.2rem, 2vw, 1.7rem); color: #863b36; }
.detail-idiom-card:last-child > span { color: #284e44; }
.detail-idiom-card p { padding-top: .45rem; border-top: 1px solid #d6cbbb; font-size: .72rem; line-height: 1.4; }

.detail-visual--tang-poetry-studio {
  --stage-border: #274348;
  background: radial-gradient(ellipse at 80% 25%, #4c6664, transparent 70%), #203d45;
}
.detail-visual--tang-poetry-studio::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 13%;
  right: 8%;
  width: clamp(4.6rem, 11vw, 7.5rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f4ddb0;
  box-shadow: 0 0 1.7rem rgb(242 215 172 / 22%);
}
.detail-poem {
  display: grid;
  gap: .85rem;
  width: min(82%, 16rem);
  padding: clamp(1rem, 3vw, 1.75rem);
  transform: translateX(-5%) rotate(-3deg);
}
.detail-poem b { color: #963b35; font-size: .92rem; }
.detail-poem p { font-size: clamp(1.1rem, 2.1vw, 1.75rem); line-height: 1.65; white-space: nowrap; }
.detail-poem small { color: #5b5247; font-size: .69rem; line-height: 1.4; }

.detail-notebook {
  width: min(100%, 16rem);
  padding: 1rem 1.05rem 1.2rem 1.35rem;
  border-left: .35rem solid #6c7d4f;
  transform: rotate(-4deg);
}
.detail-notebook-date { color: #59614a; font-size: .72rem; }
.detail-notebook-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; margin: .55rem 0 .95rem; }
.detail-notebook-title b { color: #435735; font-size: clamp(1.65rem, 3.3vw, 2.4rem); }
.detail-notebook-title span { font: .95rem Georgia, serif; }
.detail-notebook p { font-size: .75rem; font-weight: 600; }
.detail-notebook-lines {
  min-height: 3.7rem;
  background: repeating-linear-gradient(to bottom, transparent 0 calc(1.25rem - 1px), #cdd0b8 calc(1.25rem - 1px) 1.25rem);
}

.detail-palette { width: min(100%, 20rem); padding: 1.1rem .85rem .85rem; }
.detail-palette-title { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .35rem .7rem; margin-bottom: .85rem; }
.detail-palette-title b { font: 1.08rem Georgia, serif; }
.detail-palette-title span { color: #36584d; font-size: .85rem; }
.detail-swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.detail-swatches span { min-width: 0; }
.detail-swatches span::before {
  content: "";
  display: block;
  height: clamp(3rem, 8vw, 5.4rem);
  background: var(--swatch);
  border-block: 1px solid rgb(54 52 36 / 14%);
}
.detail-swatches code { display: block; padding-block: .32rem; font-size: clamp(.5rem, 1vw, .66rem); text-align: center; }

.detail-practice { width: min(100%, 19rem); padding: .85rem clamp(.7rem, 2.6vw, 1.15rem) 1.1rem; }
.detail-practice-title { display: flex; align-items: baseline; gap: .55rem; margin-bottom: .55rem; }
.detail-practice-title span { color: #8f3d37; font-size: 1.3rem; }
.detail-practice-title b { font: .88rem Georgia, serif; }
.detail-practice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #b98170; }
.detail-practice-grid > div {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: linear-gradient(90deg, transparent calc(50% - .5px), #d5ae9e calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px)),
              linear-gradient(0deg, transparent calc(50% - .5px), #d5ae9e calc(50% - .5px) calc(50% + .5px), transparent calc(50% + .5px));
}
.detail-practice-grid > div + div { border-left: 1px solid #b98170; }
.detail-practice-grid span { color: #303a2f; font-size: clamp(1.75rem, 4vw, 3.3rem); line-height: 1; }
.detail-practice-grid > :nth-child(2) span { color: #c3a091; }

.detail-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; border-block: 1px solid var(--line); margin: 2.3rem 0; padding: 1.2rem 0; }
.detail-facts dt { color: #56645c; font-size: .8rem; font-weight: bold; }
.detail-facts dd { margin: .35rem 0 0; line-height: 1.45; }
.detail-guide { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; }
.detail-guide h2, .detail-related h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); letter-spacing: -.025em; margin: 0 0 .7rem; }
.detail-guide p, .detail-guide ul { margin: 0; line-height: 1.7; }
.detail-guide ul { padding-left: 1.2rem; }
.detail-back { display: inline-block; margin-top: 2rem; }

.detail-related { margin-top: 2.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.detail-related ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 0; }
.detail-related li { min-width: 0; padding: .95rem 1rem; background: #f5eee2; border: 1px solid var(--line); }
.detail-related a { display: inline-flex; align-items: center; min-height: 44px; font-weight: bold; text-decoration: underline; text-underline-offset: .18em; }
.detail-related span { display: block; color: #56645c; font-size: .875rem; line-height: 1.5; }

@media (max-width: 700px) {
  .detail-hero, .detail-guide, .detail-related ul { grid-template-columns: minmax(0, 1fr); }
  .detail-visual { min-height: 15rem; }
  .detail-preview-frame img { max-height: min(56vh, 20rem); }
  .detail-facts { grid-template-columns: 1fr; }
}

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