@layer base, structure, components, responsive, motion;

@layer base {
  :root {
    color-scheme: light;
    --paper: #fffaf4;
    --white: #fffefa;
    --ink: #242131;
    --soft: #655d6d;
    --violet: #7041b8;
    --plum: #4d297c;
    --edge: #e8dfe6;
    --reading: #fcf1e4;
    --radius: 1.35rem;
    --shadow: 0 18px 48px -28px #44306066;
    --gutter: clamp(1rem, 5vw, 4rem);
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
  }

  *, *::before, *::after { box-sizing: border-box; }
  [hidden] { display: none !important; }
  body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.65; }
  h1, h2, h3, p, figure, blockquote { margin: 0; }
  h1, h2, h3 { line-height: 1.2; }
  h2 { font-size: clamp(1.85rem, 3.8vw, 3rem); letter-spacing: -.05em; }
  h3 { font-size: 1.05rem; }
  a { color: inherit; text-decoration: none; }
  button { font: inherit; color: inherit; cursor: pointer; }
  img { display: block; width: 100%; height: 100%; object-fit: cover; color: transparent; }
  img[data-unavailable] { visibility: hidden; }
  p, h3 { overflow-wrap: anywhere; }
  :focus-visible { outline: 3px solid var(--violet); outline-offset: 4px; }
  ::selection { background: #ead9fd; color: #291343; }
}

@layer structure {
  .ks8j3t6q { width: min(100% - var(--gutter) * 2, 74rem); margin-inline: auto; }
  .kq4s7j9v { padding-block: clamp(3rem, 7vw, 6rem); }

  .pv6y2g8c {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: .75rem 2rem;
    margin-bottom: 1.8rem;
  }

  .pv6y2g8c > p { max-width: 24rem; color: var(--soft); }

  .lt4a8f6m {
    margin-bottom: .6rem;
    color: var(--plum);
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .16em;
  }

  .va9n5c2y { color: var(--plum); font-size: .74rem; font-weight: 750; }

  .bj4t9w3m, .fu7k3p9m {
    display: inline-flex;
    width: fit-content;
    min-height: 2.8rem;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: .62rem 1rem;
    border: 1px solid transparent;
    border-radius: .7rem;
    font-size: .88rem;
    font-weight: 800;
    transition: translate 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  }

  .bj4t9w3m {
    background: linear-gradient(125deg, #6236b5, #9a3d82);
    box-shadow: 0 8px 18px #6b3daa35;
    color: #fff;
  }

  .fu7k3p9m { border-color: #e0d1e9; background: #fffafb; color: var(--plum); }
  .bj4t9w3m:hover, .fu7k3p9m:hover { translate: 0 -2px; box-shadow: var(--shadow); }
  .fu7k3p9m:hover { background: #f3e9fc; }

  [data-tone="rose"] { --tint: #dba9c6; --deep: #724b8b; }
  [data-tone="lilac"] { --tint: #c0b1ed; --deep: #5b4f9a; }
  [data-tone="mint"] { --tint: #b1ddd0; --deep: #2f645e; }
  [data-tone="sand"] { --tint: #f7deb5; --deep: #805e37; }
  [data-tone="peach"] { --tint: #f0c6b9; --deep: #9a615b; }
  [data-tone="blue"] { --tint: #bfcbec; --deep: #415881; }
}

@layer components {
  .zu2a7m8p {
    position: fixed;
    z-index: 5;
    top: .5rem;
    left: .75rem;
    translate: 0 -200%;
    padding: .65rem .9rem;
    background: var(--white);
  }

  .zu2a7m8p:focus { translate: 0; }

  .bx7z4h2q {
    position: sticky;
    top: 0;
    z-index: 4;
    border-bottom: 1px solid #eedfe9;
    background: #fffaf4f5;
    backdrop-filter: blur(14px);
  }

  .rp5g9k6n {
    position: relative;
    display: flex;
    min-height: 4.7rem;
    align-items: center;
    justify-content: space-between;
    gap: .55rem 1.5rem;
  }

  .dx3y9w7s, .pw7d5v3x { display: flex; align-items: center; gap: .65rem; }
  .dx3y9w7s { flex-shrink: 0; }
  .dx3y9w7s h1 { font-size: 1.6rem; font-weight: 850; letter-spacing: -.09em; }
  .uj5m8p2d { padding-left: .65rem; border-left: 1px solid #ddcfe0; color: var(--soft); font-size: .74rem; }

  .dl2p6t3w {
    display: grid;
    width: 1.7rem;
    aspect-ratio: 1;
    align-content: center;
    gap: 2px;
    padding: .34rem;
    border-radius: .48rem;
    rotate: -10deg;
    background: #8050c3;
  }

  .dl2p6t3w i { height: 2px; border-radius: 2px; background: #fff; }
  .dl2p6t3w i:nth-child(2) { width: 72%; }
  .dl2p6t3w i:nth-child(3) { width: 88%; }
  .pw7d5v3x { gap: clamp(.8rem, 2.8vw, 2rem); font-size: .88rem; font-weight: 680; }
  .pw7d5v3x a:hover { color: var(--violet); }
  .pw7d5v3x .fu7k3p9m { min-height: 2.35rem; padding-block: .4rem; }
  .mv6u2a9t { display: none; }

  .vg5n8q2r {
    display: grid;
    grid-template-columns: .95fr 1.05fr;
    align-items: center;
    gap: clamp(1.8rem, 5vw, 5rem);
    min-width: 0;
    padding-block: clamp(2.4rem, 6.3vw, 5.75rem);
  }

  .ey2b6s4j > .lt4a8f6m { display: inline-block; padding: .28rem .65rem; border-radius: .35rem; background: #f1e4fa; }

  .ey2b6s4j h2 {
    margin-block: .6rem 1.05rem;
    font-size: clamp(3.1rem, 6.3vw, 6rem);
    line-height: 1.04;
    letter-spacing: -.09em;
    font-weight: 900;
  }

  .ey2b6s4j h2 span { color: #8447b3; }
  .ey2b6s4j .qd6k8n2a { margin-bottom: .5rem; color: var(--ink); font-size: clamp(.95rem, 2vw, 1.18rem); font-weight: 800; }
  .ey2b6s4j > p:not([class]) { max-width: 27rem; color: var(--soft); }
  .rc8d5l2u { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.5rem; }

  .ts9m3y6v {
    min-width: 0;
    padding: .8rem;
    border: 1px solid #e8d9ed;
    border-radius: 1.65rem;
    background: #fffdfb;
    box-shadow: var(--shadow);
  }

  .ig3k7r5b, .uw3r6m9y { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding-inline: .3rem; }
  .ig3k7r5b { padding-bottom: .55rem; color: var(--plum); font-size: .71rem; font-weight: 780; letter-spacing: .09em; }

  .se4p3w8x {
    display: grid;
    grid-auto-columns: 100%;
    grid-auto-flow: column;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    border-radius: 1rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  .ts9m3y6v[data-enhanced] .se4p3w8x { scrollbar-width: none; }
  .se4p3w8x > li { min-width: 0; scroll-snap-align: start; }

  .ar4j9e7m {
    position: relative;
    isolation: isolate;
    display: grid;
    min-height: clamp(17rem, 28vw, 23rem);
    align-items: end;
    overflow: hidden;
    border-radius: 1rem;
    background:
      radial-gradient(ellipse at 92% 5%, #fff8 0, transparent 42%),
      repeating-linear-gradient(126deg, #fff2 0 1px, transparent 1px 21px),
      linear-gradient(120deg, var(--deep), var(--tint));
    color: white;
  }

  .ar4j9e7m::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(to top, #181224e8, #24162d70 38%, transparent 74%);
    content: "";
  }

  .ar4j9e7m img { position: absolute; z-index: -2; inset: 0; object-position: 50% 36%; }
  .ar4j9e7m figcaption { display: grid; gap: .25rem; padding: clamp(1rem, 3.5vw, 2rem); }
  .ar4j9e7m figcaption span { color: #fdf3ff; font-size: clamp(.75rem, 1.5vw, .89rem); }
  .ar4j9e7m figcaption span:first-child { letter-spacing: .09em; }
  .ar4j9e7m strong { font: 700 clamp(1.78rem, 4.6vw, 3.6rem)/1.02 Georgia, serif; overflow-wrap: anywhere; }

  .uw3r6m9y { min-height: 2.95rem; padding-top: .55rem; }
  .gh9p5w3t, .wi7r4p9x { display: flex; gap: .35rem; align-items: center; }
  .gh9p5w3t button, .wi7r4p9x button { padding: 0; border: 0; border-radius: .45rem; background: #f6ecfa; color: var(--plum); }

  .gh9p5w3t button { display: grid; width: 1.55rem; height: 1.65rem; place-items: center; background: transparent; }
  .gh9p5w3t button::before { width: .45rem; height: .45rem; border-radius: 50%; background: #af95c5; content: ""; }
  .gh9p5w3t button[aria-current="true"]::before { width: .95rem; border-radius: 1rem; background: var(--violet); }
  .wi7r4p9x button { width: 2.4rem; height: 2.2rem; font-size: 1.05rem; }
  .wi7r4p9x button:hover { background: #ead9f5; }
  .xj2u8a5s { color: var(--soft); font: .77rem/1.2 ui-monospace, monospace; }

  .cc4s8m3y { border-block: 1px solid #e8dced; background: #f4ebfa; }
  .ic5t2x7b { display: grid; grid-template-columns: .78fr repeat(3, 1fr); gap: .55rem; padding-block: 1.3rem; }
  .ic5t2x7b h2 { align-self: center; font-size: clamp(1.18rem, 2.4vw, 1.72rem); }
  .ic5t2x7b article { padding: .75rem; border: 1px solid #e8d9ef; border-radius: .8rem; background: #fffafaaf; }
  .ic5t2x7b article p { margin-top: .35rem; color: var(--soft); font-size: .85rem; }

  .mh2b6q7f { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }

  .mr7c8v5n {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    background: var(--white);
    transition: translate 180ms ease, box-shadow 180ms ease;
  }

  .mr7c8v5n:hover, .mr7c8v5n:focus-within { translate: 0 -4px; box-shadow: var(--shadow); }

  .sw8a3y5h, .mo6b1z8q {
    overflow: hidden;
    background:
      repeating-linear-gradient(135deg, #fff4 0 1px, transparent 1px 17px),
      linear-gradient(135deg, var(--tint), color-mix(in srgb, var(--deep) 58%, var(--tint)));
  }

  .sw8a3y5h { aspect-ratio: 2.45; }
  .sw8a3y5h img { object-position: center 38%; }

  .mr7c8v5n > div + div {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: .45rem;
    min-width: 0;
    padding: 1rem 1rem 1.1rem;
  }

  .mr7c8v5n p:not([class]), .fh4r9w2e p { color: var(--soft); font-size: .9rem; }
  .mr7c8v5n a, .fh4r9w2e a { width: fit-content; color: var(--plum); font-size: .81rem; font-weight: 750; }
  .mr7c8v5n a:hover, .fh4r9w2e a:hover { text-decoration: underline; text-underline-offset: .22em; }

  .uq9p4t7j { padding-block: clamp(2.8rem, 6vw, 5rem); border-block: 1px solid #eee1de; background: #fbf1eb; }
  .ky2u5m9w { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, .39fr); gap: clamp(1.1rem, 3vw, 2.7rem); align-items: start; }
  .ky2u5m9w .pv6y2g8c { margin-bottom: 1.1rem; }
  .dg3v8q5a { display: flex; flex-wrap: wrap; align-items: center; gap: .37rem; }

  .dg3v8q5a button {
    min-height: 2.3rem;
    padding: .25rem .7rem;
    border: 1px solid #e8dce9;
    border-radius: .55rem;
    background: var(--white);
    color: var(--plum);
    font-size: .82rem;
  }

  .dg3v8q5a button:hover { border-color: #b593cf; }
  .dg3v8q5a button[aria-pressed="true"] { border-color: #7147a0; background: #ead9fa; font-weight: 800; }
  .dg3v8q5a output { margin-inline-start: auto; color: var(--soft); font-size: .78rem; }

  .fh4r9w2e {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    margin: .85rem 0 0;
    padding: 0;
    list-style: none;
  }

  .fh4r9w2e li { min-width: 0; overflow: hidden; border: 1px solid #eddfdc; border-radius: .95rem; background: #fffdfa; }
  .fh4r9w2e li:target { outline: 2px solid #8950b7; outline-offset: 2px; }
  .fh4r9w2e article { display: grid; grid-template-columns: clamp(3.7rem, 5.7vw, 5.3rem) minmax(0, 1fr); gap: .65rem; height: 100%; padding: .55rem; }
  .mo6b1z8q { min-height: 6.7rem; border-radius: .48rem; }
  .fh4r9w2e article > div:last-child { display: grid; align-content: start; gap: .25rem; padding: .2rem .05rem; overflow-wrap: anywhere; }
  .fh4r9w2e h3 { font-size: .98rem; }
  .fh4r9w2e p { font-size: .81rem; }

  .xn4s7j6c { padding: clamp(1rem, 2.6vw, 1.8rem); border: 1px solid #ebd9f2; border-radius: var(--radius); background: #f6ecfc; }
  .xn4s7j6c h2 { font-size: clamp(1.6rem, 2.8vw, 2.25rem); }
  .xn4s7j6c > p:not([class]) { margin-top: .6rem; color: var(--soft); font-size: .88rem; }
  .xn4s7j6c ol { margin: 1rem 0 1.1rem; padding-left: 1.6rem; }
  .xn4s7j6c li { border-top: 1px solid #e5d4ed; padding: .55rem 0 .55rem .3rem; }
  .xn4s7j6c li::marker { color: #7641a5; font: 800 1.2rem Georgia, serif; }
  .xn4s7j6c li a { display: grid; gap: .05rem; overflow-wrap: anywhere; }
  .xn4s7j6c li a:hover strong { color: var(--violet); }
  .xn4s7j6c li span, .ns5b2d8q { color: var(--soft); font-size: .76rem; }

  .yy6d2w7p {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(15rem, .9fr);
    align-items: center;
    gap: 1.5rem;
    padding: clamp(1.2rem, 5.5vw, 4rem);
    border: 1px solid #e8dcec;
    border-radius: var(--radius);
    background: radial-gradient(ellipse at 90% 10%, #e9d7f8 0, transparent 60%), #f6eef9;
  }

  .ju3p5z9s p:not([class]) { max-width: 23rem; margin-block: .85rem 1.1rem; color: var(--soft); }
  .yy6d2w7p[data-paper="cool"] { --reading: #edf0f8; }

  .mj4c9f2s {
    width: min(100%, 18rem);
    justify-self: center;
    padding: .45rem;
    border: .35rem solid #282139;
    border-radius: 1.35rem;
    background: var(--reading);
    box-shadow: 10px 12px 0 #d5bfeb;
    transition: background-color 160ms ease;
  }

  .fu6s3e8a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .4rem; padding: .45rem .4rem .55rem; border-bottom: 1px solid #b9a9c8; color: #4b2c69; font-size: .82rem; }
  .zf4u8p6g { display: grid; gap: .5rem; height: 13.75rem; margin: .5rem 0 0; padding: 0 .25rem .25rem; list-style: none; overflow-y: auto; scrollbar-width: thin; }

  .zf4u8p6g li {
    display: grid;
    align-content: center;
    gap: .55rem;
    min-height: 8.2rem;
    padding: .8rem;
    border: 1px solid #c4aecd;
    border-radius: .54rem;
    background: #fff9f6;
    font-size: .83rem;
  }

  .zf4u8p6g li:nth-child(2) { background: #f1e4fb; }
  .zf4u8p6g li:nth-child(3) { background: #ffefce; }
  .zf4u8p6g li span { color: #553775; font-size: .72rem; font-weight: 750; }

  .tr8j5a3m { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1rem, 5vw, 4rem); margin-bottom: clamp(2.6rem, 7vw, 5.5rem); }
  .as2f6d9x { margin: 1rem 0 0; padding-inline-start: 1.75rem; }
  .as2f6d9x li { padding: .65rem .5rem .65rem .25rem; border-bottom: 1px solid var(--edge); }
  .as2f6d9x li::marker { color: var(--violet); font: 700 1.2rem Georgia, serif; }
  .as2f6d9x p { margin-top: .25rem; color: var(--soft); font-size: .9rem; }
  .om7g2x5f { display: grid; gap: .5rem; margin-top: 1rem; }
  .om7g2x5f blockquote { padding: .55rem .7rem .55rem .9rem; border-left: 3px solid #c6a4e0; border-radius: 0 .42rem .42rem 0; background: #f6eef9; font-size: .9rem; }

  .sd9c5t2q { padding-block: clamp(2.1rem, 6vw, 4.5rem); border-block: 1px solid #f0e2d9; background: #fff5e9; }
  .td4k8m7p { display: grid; grid-template-columns: .48fr 1fr; gap: 1.3rem; }
  .em2p8y5s details { border-bottom: 1px solid #e9d9cd; }
  .em2p8y5s details:first-child { border-top: 1px solid #e9d9cd; }
  .em2p8y5s summary { padding: .82rem .25rem; cursor: pointer; font-weight: 750; }
  .em2p8y5s summary:hover, .em2p8y5s details[open] summary { color: var(--plum); }
  .em2p8y5s details p { padding: 0 .35rem .85rem 1.3rem; color: var(--soft); font-size: .9rem; }

  .wc3n7v5e {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.8rem;
    padding: clamp(1.1rem, 5vw, 3rem);
    border: 1px solid #e9d7ed;
    border-radius: var(--radius);
    background: linear-gradient(118deg, #f2e4fc, #ffdfe9 99%);
  }

  .wc3n7v5e p:not([class]) { margin-top: .65rem; color: #584363; }
  .wc3n7v5e .bj4t9w3m { flex: 0 0 auto; }

  .hw8c2d4q { padding-top: 2.6rem; border-top: 1px solid var(--edge); background: #f9f1f6; }
  .ar7s2b9f { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1rem, 5vw, 4rem); padding-bottom: 1.8rem; }
  .ar7s2b9f h2 { margin-bottom: .7rem; font-size: 1.28rem; }
  .ar7s2b9f p { max-width: 39rem; color: var(--soft); font-size: .91rem; }
  .ar7s2b9f ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem .7rem; margin: 0; padding: 0; list-style: none; font-size: .83rem; }
  .hw8c2d4q a:hover { color: var(--plum); text-decoration: underline; text-underline-offset: .22em; }
  .vw4q6j8e { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .45rem 1rem; padding-block: 1rem; border-top: 1px solid var(--edge); color: var(--soft); font-size: .8rem; }
}

@layer responsive {
  @media (max-width: 58rem) {
    .ky2u5m9w { grid-template-columns: minmax(0, 1fr); }
    .xn4s7j6c ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1.4rem; }
  }

  @media (max-width: 46rem) {
    :root { scroll-padding-top: 5.3rem; }
    .rp5g9k6n { flex-wrap: wrap; min-height: 3.6rem; }
    .mv6u2a9t:not([hidden]) {
      display: inline-flex;
      align-items: center;
      gap: .42rem;
      min-height: 2.4rem;
      padding: .35rem .65rem;
      border: 1px solid #e5d7eb;
      border-radius: .5rem;
      background: var(--white);
      font-size: .84rem;
    }

    .rp5g9k6n[data-nav] .pw7d5v3x {
      position: absolute;
      top: calc(100% + .43rem);
      right: 0;
      left: 0;
      display: none;
      flex-direction: column;
      align-items: stretch;
      gap: .25rem;
      padding: .55rem;
      border: 1px solid #e8dbea;
      border-radius: .8rem;
      background: var(--white);
      box-shadow: var(--shadow);
    }

    .rp5g9k6n[data-open] .pw7d5v3x { display: flex; }
    .rp5g9k6n[data-nav] .pw7d5v3x a { width: auto; min-height: 2.6rem; padding: .55rem .7rem; }
    .rp5g9k6n[data-nav] .pw7d5v3x .fu7k3p9m { justify-content: space-between; }
    .rp5g9k6n:not([data-nav]) .pw7d5v3x { width: 100%; flex-wrap: wrap; padding-bottom: .55rem; }

    .vg5n8q2r { grid-template-columns: minmax(0, 1fr); gap: 1.3rem; }
    .ey2b6s4j h2 { font-size: clamp(2.9rem, 12.6vw, 5rem); }
    .ar4j9e7m { min-height: clamp(14.5rem, 56vw, 23rem); }
    .ic5t2x7b { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ic5t2x7b h2 { grid-column: 1 / -1; margin-bottom: .25rem; }
    .ic5t2x7b h2 br { display: none; }
    .mh2b6q7f { grid-template-columns: minmax(0, 1fr); }
    .mr7c8v5n { grid-template-columns: minmax(5rem, .48fr) minmax(0, 1fr); grid-template-rows: auto; }
    .sw8a3y5h { aspect-ratio: auto; min-height: 7rem; }
    .td4k8m7p, .tr8j5a3m, .ar7s2b9f { grid-template-columns: minmax(0, 1fr); }
    .tr8j5a3m { gap: 2rem; }
    .wc3n7v5e { flex-wrap: wrap; }
  }

  @media (max-width: 34rem) {
    .pv6y2g8c { flex-wrap: wrap; }
    .fh4r9w2e, .yy6d2w7p { grid-template-columns: minmax(0, 1fr); }
    .xn4s7j6c ol { display: block; }
    .ic5t2x7b { grid-template-columns: minmax(0, 1fr); }
    .ic5t2x7b article { display: grid; grid-template-columns: minmax(5.5rem, auto) 1fr; gap: .45rem; align-items: start; }
    .ic5t2x7b article p { margin: 0; }
    .ar7s2b9f ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
}

@layer motion {
  @media (prefers-reduced-motion: no-preference) {
    [data-reveal="waiting"] { opacity: .6; translate: 0 .85rem; }
    [data-reveal="shown"] { transition: opacity .45s ease-out, translate .45s ease-out; }
  }

  @media (prefers-reduced-motion: reduce) {
    :root { scroll-behavior: auto; }
    *, *::before, *::after {
      animation-duration: .01ms !important;
      transition-duration: .01ms !important;
    }
  }
}
