@layer foundations, panels, content, motion;

@layer foundations {
  :root {
    color-scheme: dark;
    --ink: #15121c;
    --slate: #201a2b;
    --slate-high: #2a2235;
    --line: #3a3048;
    --paper: #fbf4ff;
    --muted: #c1b4cd;
    --purple: #d4afff;
    --peach: #ffc3ab;
    --gutter: clamp(1.125rem, 4.6vw, 4.75rem);
    --page: 76rem;
    --radius: 1.15rem;
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
    background: var(--ink);
    color: var(--paper);
    scroll-behavior: smooth;
    scroll-padding-top: 6.5rem;
  }

  *, *::before, *::after { box-sizing: border-box; }
  body { margin: 0; font-size: 1rem; line-height: 1.7; }
  figure, h1, h2, h3, ol, p, blockquote { margin: 0; }
  h1, h2, h3 { line-height: 1.24; text-wrap: balance; }
  h2 { font-size: clamp(1.45rem, 2.9vw, 2rem); }
  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; }
  [hidden] { display: none !important; }

  :focus-visible {
    outline: 2px solid var(--peach);
    outline-offset: 4px;
  }

  .f3x8vm2q {
    width: min(calc(100% - var(--gutter) * 2), var(--page));
    margin-inline: auto;
  }

  .u6r5kb2x {
    position: fixed;
    z-index: 20;
    inset: .65rem auto auto .65rem;
    padding: .5rem .8rem;
    transform: translateY(-180%);
    border-radius: .45rem;
    color: var(--ink);
    background: var(--peach);
  }

  .u6r5kb2x:focus { transform: none; }

  .y4xn9m8q {
    color: var(--peach);
    font-size: .875rem;
    font-weight: 720;
    letter-spacing: .14em;
  }

  .k8r2mn7v, .q4w7kx9b {
    display: inline-flex;
    min-height: 3.05rem;
    align-items: center;
    justify-content: center;
    padding: .55rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 730;
    text-align: center;
  }

  .k8r2mn7v {
    background: linear-gradient(112deg, #ffc9aa 5%, #e8b5fa 96%);
    color: #2a1737;
    box-shadow: 0 7px 25px #e0a1fb25;
  }

  .q4w7kx9b {
    background: #211929;
    border-color: #62506f;
    color: var(--paper);
  }

  .q4w7kx9b:hover { border-color: var(--purple); }
  .k8r2mn7v:hover { filter: brightness(1.12); }

  .m8k4nt6q, .z2m7qk8v { margin-bottom: 1.35rem; }
  .m8k4nt6q p, .z2m7qk8v p { margin-top: .45rem; color: var(--muted); }
}

@layer panels {
  .r8q2m7vk {
    position: sticky;
    z-index: 5;
    top: 0;
    background: #15121cf5;
    border-bottom: 1px solid #312838;
  }

  .h9q2mz7w {
    display: flex;
    min-height: 4.35rem;
    gap: 1.25rem;
    align-items: center;
    justify-content: space-between;
  }

  .t4p9mc6x {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: .6rem;
    color: var(--paper);
    font-weight: 800;
  }

  .c5n8xq2w {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: .6rem;
    background: linear-gradient(150deg, #ffd0ad, #dcb0fc);
    color: #2b1734;
    font: 850 1.12rem/1 system-ui, sans-serif;
    letter-spacing: -.11em;
    padding-right: .1em;
  }

  .a2x8mg5r {
    display: flex;
    gap: clamp(.55rem, 3vw, 2rem);
    align-items: center;
    color: var(--muted);
    font-weight: 650;
    font-size: .875rem;
  }

  .a2x8mg5r a { padding-block: .45rem; }
  .a2x8mg5r a:last-child { color: var(--peach); }
  .a2x8mg5r a:hover, .m3x8kn7q a:hover, .n6q2xm8k a:hover { color: var(--paper); }

  .e7x4pn3q {
    display: inline-flex;
    width: fit-content;
    padding: .4rem .75rem;
    min-height: 2.75rem;
    align-items: center;
    gap: .65rem;
    border: 1px solid var(--line);
    border-radius: .6rem;
    background: var(--slate);
  }

  .n2w5j9qk {
    width: .6rem;
    height: .6rem;
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
  }

  [aria-expanded="true"] .n2w5j9qk { transform: translateY(2px) rotate(225deg); }

  .m9q6w2nx {
    position: relative;
    isolation: isolate;
    background:
      radial-gradient(ellipse at 82% 18%, #60406145, transparent 58%),
      linear-gradient(110deg, #15111c 10%, #201725 68%, #22192c);
    border-bottom: 1px solid var(--line);
  }

  .k5n3vq8j {
    display: grid;
    min-height: 30rem;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(1.5rem, 4.3vw, 4.25rem);
    padding-block: clamp(2.25rem, 5.5vw, 4.5rem);
  }

  .p5nb8k3w h1 {
    width: fit-content;
    margin-top: .7rem;
    color: #fff7fa;
    font-size: clamp(2.75rem, 6vw, 5.45rem);
    font-weight: 900;
    letter-spacing: -.055em;
  }

  .p5nb8k3w h1 a { display: block; }
  .p5nb8k3w h1 a:hover { color: #ffe1d4; }

  .b4p2kx9m {
    color: #f0cfed;
    font-size: clamp(1.55rem, 3.45vw, 3rem);
    font-weight: 760;
    line-height: 1.29;
    letter-spacing: -.035em;
    margin-top: .4rem;
  }

  .v8m3qh7t { max-width: 29rem; margin-top: 1.15rem; color: var(--muted); }
  .d7q2mv8k { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.5rem; }

  .x5m2q8kn {
    display: grid;
    position: relative;
    isolation: isolate;
    min-height: 23rem;
    grid-template-columns: minmax(0, 1.35fr) minmax(6.75rem, .67fr);
    align-items: end;
    gap: clamp(.7rem, 2.4vw, 1.5rem);
    padding: 1.3rem;
    border-radius: 1.35rem;
    border: 1px solid #635248;
    background: radial-gradient(ellipse at 30% 80%, #aa677461, transparent 80%), linear-gradient(148deg, #342941, #2c2237);
    overflow: hidden;
  }
  
  .x5m2q8kn::before, .x5m2q8kn::after {
    content: "";
    position: absolute;
    z-index: -1;
    border: 1px solid #fac0ac36;
    border-radius: 52%;
    pointer-events: none;
  }

  .x5m2q8kn::before { width: 105%; height: 97%; inset: -20% auto auto 18%; transform: rotate(-26deg); }
  .x5m2q8kn::after { width: 91%; height: 92%; inset: 26% auto auto 20%; transform: rotate(-26deg); }

  .n6p7xc2j {
    width: min(100%, 15rem);
    align-self: center;
    justify-self: center;
    padding: .42rem;
    border-radius: .85rem;
    border: 1px solid #ffdbc5a6;
    background: #180f1b70;
    box-shadow: .65rem .9rem 2.3rem #0b0611aa;
    transform: rotate(-5deg);
  }

  .n6p7xc2j a {
    display: block;
    aspect-ratio: 10 / 14;
    overflow: hidden;
    border-radius: .55rem;
    background: #422d43;
  }

  .n6p7xc2j img { object-position: center 42%; }
  .x5m2q8kn figcaption { display: grid; justify-items: start; gap: .22rem; padding: 1rem 0 .15rem; }
  .x5m2q8kn figcaption strong { font-size: clamp(1.22rem, 2.4vw, 1.85rem); line-height: 1.22; }
  .x5m2q8kn figcaption span:last-child { color: #eedce7; font-size: .875rem; }

  .p8m3xd6n, .w2k9nm4t, .c5k8mq2x, .d2p7mx9q { margin-top: clamp(2.6rem, 6vw, 4.75rem); }

  .z2m7qk8v { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .8rem; }
  .b7d2qn9m { display: flex; align-items: center; gap: .42rem; }
  .b7d2qn9m button {
    min-width: 2.65rem;
    min-height: 2.65rem;
    padding-inline: .7rem;
    border: 1px solid var(--line);
    border-radius: .6rem;
    background: var(--slate);
    font-size: .875rem;
  }
  .b7d2qn9m button[data-carousel-move] { font-size: 1.65rem; line-height: 1; }
  .b7d2qn9m button:hover { border-color: var(--purple); color: var(--purple); }

  .t6qx4m8j {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 2rem) / 3);
    gap: 1rem;
    overflow-x: auto;
    padding: .24rem .18rem .65rem;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: .18rem;
    scrollbar-color: #735787 #251f2d;
  }

  .g3m9q2xt {
    overflow: clip;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--slate);
    scroll-snap-align: start;
  }

  .g3m9q2xt a { display: block; padding: .48rem; }
  .g3m9q2xt a:focus-visible { outline-offset: -3px; }
  .g3m9q2xt:hover, .g3m9q2xt:focus-within { border-color: #9771a6; }
  .s8m2q7kf {
    display: block;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    border-radius: .74rem;
    background: #352641;
  }
  .s8m2q7kf img { object-position: center 41%; }
  .v2q7f8nr { display: grid; gap: .26rem; padding: .75rem .55rem .48rem; }
  .v2q7f8nr p { color: var(--muted); font-size: .875rem; }

  .v3p7q2rm {
    width: 1px;
    height: 1px;
    overflow: hidden;
    position: absolute;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@layer content {
  .w2k9nm4t {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
    gap: clamp(1.25rem, 4vw, 3.5rem);
    align-items: start;
  }

  .u2q6xn8p {
    border-top: 1px solid var(--line);
  }

  .q7t2mx9p { border-bottom: 1px solid var(--line); }
  .q7t2mx9p:target { background: #2b2236; }

  .q7t2mx9p summary {
    display: grid;
    grid-template-columns: 2.7rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .6rem;
    padding: .8rem .7rem;
    cursor: pointer;
    list-style: none;
  }

  .q7t2mx9p summary::-webkit-details-marker, .w8j3nq6m summary::-webkit-details-marker { display: none; }
  .q7t2mx9p summary:hover, .w8j3nq6m summary:hover { color: var(--purple); }
  .x6v2t9pn { color: #b79ac6; font: 600 .85rem/1.4 ui-monospace, monospace; }
  .w6r4qn8b { display: grid; gap: .1rem; }
  .w6r4qn8b small { color: var(--muted); font-size: .875rem; }

  .m2t7nz4k {
    width: .65rem;
    height: .65rem;
    margin-inline: .3rem;
    border-bottom: 2px solid var(--purple);
    border-right: 2px solid var(--purple);
    transform: translateY(-2px) rotate(45deg);
  }

  .q7t2mx9p [open] .m2t7nz4k { transform: translateY(2px) rotate(225deg); }
  .q7t2mx9p details p { padding: 0 1rem .85rem 4rem; color: var(--muted); }
  .k7q5nx2p { color: var(--peach); text-decoration: underline; text-underline-offset: .2em; }
  .k7q5nx2p:hover { color: var(--paper); }

  .h2m8q7nb {
    padding: clamp(1rem, 3vw, 1.65rem);
    border: 1px solid #56405f;
    border-radius: var(--radius);
    background: linear-gradient(155deg, #32233b, #241b2d);
  }

  .h2m8q7nb ol { display: grid; gap: .8rem; padding-left: 1.6rem; }
  .h2m8q7nb li::marker { color: var(--peach); font-weight: 750; }
  .h2m8q7nb li + li { border-top: 1px solid #54435d; padding-top: .75rem; }
  .h2m8q7nb a { display: grid; padding-left: .3rem; }
  .h2m8q7nb a:hover strong { color: var(--peach); }
  .h2m8q7nb a span { color: var(--muted); font-size: .875rem; }

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

  .j7m4qn8r article {
    padding: 1.15rem 1.05rem;
    border: 1px solid var(--line);
    border-left: 3px solid #c695ec;
    border-radius: .75rem;
    background: #1c1724;
  }

  .j7m4qn8r article:nth-child(2) { border-left-color: #ffad9a; }
  .j7m4qn8r article:nth-child(3) { border-left-color: #b2a6ff; }
  .j7m4qn8r p { margin-top: .4rem; color: var(--muted); }

  .y2b6qm8v {
    margin-top: clamp(2.6rem, 6vw, 4.75rem);
    padding-block: clamp(2rem, 5.8vw, 4.4rem);
    border-block: 1px solid var(--line);
    background: #1c1623;
  }

  .n7q2xk5m {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(1.6rem, 5.5vw, 5rem);
  }

  .v8q2mx7d { display: grid; align-content: start; }
  .h5n9qv2m {
    display: grid;
    justify-items: center;
    padding: 1.25rem .75rem;
    background: radial-gradient(ellipse at 54% 100%, #4e2c51, #241c2e 73%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .j4x8qm5d {
    position: relative;
    width: min(100%, 19rem);
    padding: 2rem 1rem 1rem;
    border: 2px solid #79627f;
    border-radius: 1.5rem;
    background: #191323;
    box-shadow: .75rem .65rem 1.6rem #100a17a0;
  }

  .j4x8qm5d::before {
    content: "";
    position: absolute;
    width: 2.8rem;
    height: .25rem;
    top: .63rem;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 999px;
    background: #594765;
  }

  .j4x8qm5d h3 { margin-block: .4rem .85rem; font-size: 1.22rem; }
  .n8m3qv6k { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .7rem; }
  .n8m3qv6k button {
    min-height: 2.3rem;
    padding: .2rem .59rem;
    border: 1px solid #584463;
    border-radius: 999px;
    background: #241b2e;
    font-size: .875rem;
  }
  .n8m3qv6k button[aria-pressed="true"] { color: var(--ink); background: var(--purple); border-color: transparent; }
  .n8m3qv6k button:hover { border-color: var(--peach); }
  .p3q7xn6v { min-height: 7.3rem; padding: .75rem; border-radius: .65rem; background: #2d2238; }
  .p3q7xn6v p { color: var(--muted); margin-block: .1rem .25rem; font-size: .875rem; }
  .p3q7xn6v a, .g7n2xk8q a { color: var(--peach); text-decoration: underline; text-underline-offset: .2em; }

  .g7n2xk8q {
    list-style: none;
    counter-reset: guide;
    padding: 0;
    margin-left: .92rem;
    border-left: 1px solid #755a81;
  }

  .g7n2xk8q li {
    counter-increment: guide;
    position: relative;
    padding: .17rem 0 1.55rem 1.65rem;
  }

  .g7n2xk8q li:last-child { padding-bottom: 0; }

  .g7n2xk8q li::before {
    content: counter(guide);
    position: absolute;
    top: 0;
    left: -.94rem;
    display: grid;
    width: 1.8rem;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 50%;
    background: var(--purple);
    color: var(--ink);
    font: 750 .875rem system-ui, sans-serif;
  }

  .g7n2xk8q p { margin-top: .34rem; color: var(--muted); }

  .d2p7mx9q {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.17fr);
    gap: clamp(1.6rem, 5.5vw, 5rem);
  }

  .c2q9vm6n { display: grid; gap: .62rem; }
  .c2q9vm6n blockquote {
    padding: .78rem .9rem;
    border-radius: .65rem;
    background: #261d31;
    color: #ebdef2;
  }

  .w8j3nq6m { border-top: 1px solid var(--line); }
  .w8j3nq6m details { border-bottom: 1px solid var(--line); }
  .w8j3nq6m summary {
    display: flex;
    min-height: 3.1rem;
    align-items: center;
    justify-content: space-between;
    gap: .9rem;
    padding: .68rem .1rem;
    list-style: none;
    cursor: pointer;
    font-weight: 660;
  }

  .w8j3nq6m summary::after { content: "+" / ""; color: var(--purple); font-size: 1.25rem; line-height: 1; }
  .w8j3nq6m [open] summary::after { content: "−" / ""; }
  .w8j3nq6m details p { padding: 0 .55rem .85rem .1rem; color: var(--muted); }

  .b9q2xk7m {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.7rem;
    align-items: center;
    justify-content: space-between;
    margin-block: clamp(2.6rem, 6vw, 4.75rem);
    padding: clamp(1.25rem, 4vw, 2.35rem);
    border: 1px solid #60476b;
    border-radius: var(--radius);
    background: radial-gradient(ellipse at 90% 10%, #583651, transparent 72%), #2a2035;
  }

  .b9q2xk7m p { color: #e5d3e8; margin-top: .45rem; max-width: 39rem; }

  .r6m4qx9n {
    background: #1a1521;
    border-top: 1px solid var(--line);
  }

  .z7v2nq8m {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1.8rem clamp(2rem, 7vw, 5.5rem);
    padding-block: 2.2rem;
  }

  .z7v2nq8m h2 { font-size: 1.13rem; margin-bottom: .65rem; }
  .z7v2nq8m p { color: var(--muted); }
  .m3x8kn7q {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .48rem 1rem;
    align-items: start;
    color: var(--muted);
    font-size: .875rem;
  }

  .m3x8kn7q a { width: fit-content; padding-block: .15rem; }

  .n6q2xm8k {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .4rem 1rem;
    border-top: 1px solid var(--line);
    padding-block: 1rem;
    color: var(--muted);
    font-size: .875rem;
  }

  @media (max-width: 54rem) {
    .k5n3vq8j { min-height: 0; }
    .x5m2q8kn { min-height: 19rem; padding: 1rem; }
    .t6qx4m8j { grid-auto-columns: calc((100% - 1rem) / 2); }
  }

  @media (max-width: 46rem) {
    :root { scroll-padding-top: 5rem; }
    .r8q2m7vk { position: relative; }
    .r8q2m7vk[data-menu-ready] { position: sticky; }
    .h9q2mz7w { position: relative; flex-wrap: wrap; gap: .5rem; min-height: 3.8rem; padding-block: .52rem; }
    .a2x8mg5r { width: 100%; flex-wrap: wrap; gap: .2rem .8rem; padding-top: .25rem; }
    [data-menu-ready] .a2x8mg5r {
      position: absolute;
      top: calc(100% + 1px);
      right: 0;
      display: grid;
      width: min(100%, 24rem);
      padding: .35rem;
      gap: .1rem;
      border: 1px solid var(--line);
      border-radius: .7rem;
      background: #21192a;
      box-shadow: 0 .85rem 1.25rem #110a18a0;
    }
    [data-menu-ready] .a2x8mg5r a { padding: .52rem .72rem; border-radius: .35rem; }
    [data-menu-ready] .a2x8mg5r a:hover { background: #332640; }
    .k5n3vq8j, .w2k9nm4t, .n7q2xk5m, .d2p7mx9q, .z7v2nq8m { grid-template-columns: minmax(0, 1fr); }
    .b4p2kx9m br { display: none; }
    .x5m2q8kn { min-height: 0; }
    .n6p7xc2j { width: min(100%, 12rem); }
  }

  @media (max-width: 32rem) {
    .k5n3vq8j { padding-block: 2rem; }
    .x5m2q8kn { grid-template-columns: minmax(0, 1.15fr) minmax(5.6rem, .8fr); }
    .t6qx4m8j { grid-auto-columns: 82%; }
    .j7m4qn8r { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
    .d7q2mv8k .k8r2mn7v, .d7q2mv8k .q4w7kx9b { padding-inline: .95rem; }
  }
}

@layer motion {
  @media (prefers-reduced-motion: no-preference) {
    .k8r2mn7v, .q4w7kx9b, .g3m9q2xt, .n6p7xc2j, .s8m2q7kf img {
      transition: transform 200ms ease, border-color 200ms ease, filter 200ms ease;
    }
    .k8r2mn7v:hover, .q4w7kx9b:hover { transform: translateY(-2px); }
    .n6p7xc2j:hover, .n6p7xc2j:focus-within { transform: translateY(-3px) rotate(-2deg); }
    .g3m9q2xt:hover img { transform: scale(1.045); }
    [data-arrived] { animation: w9n5qp2v 390ms ease-out both; }
    @keyframes w9n5qp2v {
      from { opacity: .62; transform: translateY(11px); }
      to { opacity: 1; transform: translateY(0); }
    }
  }

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