@layer foundation, framing, content, adaptive;

@layer foundation {
  :root {
    color-scheme: dark;
    --page: #101319;
    --panel: #171c25;
    --raised: #202733;
    --ink: #f3f5fa;
    --muted: #b2bfd0;
    --cyan: #87e7f5;
    --violet: #bcb4ff;
    --rule: #333e4e;
    --wrap: 1200px;
    --edge: clamp(18px, 4vw, 48px);
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
    font-size: 16px;
    background: var(--page);
    color: var(--ink);
    scroll-behavior: smooth;
  }

  *, *::after, *::before { box-sizing: border-box; }
  [hidden] { display: none !important; }
  body { margin: 0; line-height: 1.65; }
  h1, h2, h3, p, figure, blockquote, ul, ol { margin: 0; }
  h1, h2, h3 { line-height: 1.24; }
  h2 { font-size: clamp(1.45rem, 3vw, 2.15rem); letter-spacing: -.035em; }
  h3 { font-size: 1.07rem; }
  a { color: inherit; text-decoration: none; }
  button { font: inherit; color: inherit; cursor: pointer; }
  summary { cursor: pointer; }
  img { display: block; max-width: 100%; }
  section[id], aside[id], article[id] { scroll-margin-top: 88px; }
  :focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
  [data-cover] { position: relative; overflow: hidden; }
  [data-cover] img { width: 100%; height: 100%; object-fit: cover; }
  [data-cover-note] { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; color: var(--muted); text-align: center; font-size: .72rem; }

  .g8m6c3sq {
    position: fixed;
    z-index: 10;
    inset: 10px auto auto var(--edge);
    padding: .65rem 1rem;
    background: var(--panel);
    transform: translateY(-180%);
  }

  .g8m6c3sq:focus { transform: translateY(0); }
}

@layer framing {
  .h7x4m9ca, .z6p4c8mn, .v2m9h6ka, .q8v6r2hx, .m2v9j6ph, .a6m4w9kd,
  .k9u4d6ma, .g7m4q2vk, .s9b3w5gt, .u9a3j5kx {
    width: min(calc(100% - 2 * var(--edge)), var(--wrap));
    margin-inline: auto;
  }

  .d5k7n2rq {
    position: sticky;
    z-index: 5;
    top: 0;
    background: #11151ded;
    border-bottom: 1px solid var(--rule);
    backdrop-filter: blur(14px);
  }

  .h7x4m9ca { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
  .h7x4m9ca h1 { font-size: 1.23rem; white-space: nowrap; }
  .h7x4m9ca h1 a { display: inline-flex; align-items: center; gap: 10px; }

  .p2s8w5le {
    display: grid;
    place-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px 10px 10px 2px;
    background: #96edf5;
    color: #111826;
    font: 900 1.1rem/1 system-ui, sans-serif;
    letter-spacing: -.08em;
  }

  .p2s8w5le::before { content: "51"; }

  .r4n8b3ch, .w9c3q5fa { display: flex; align-items: center; gap: clamp(12px, 2.2vw, 31px); }
  .r4n8b3ch { color: var(--muted); font-size: .9rem; }
  .r4n8b3ch a:hover, .f6t9a2zm a:hover { color: var(--cyan); }
  .c9a5j3wf { position: relative; }
  .c9a5j3wf summary { list-style: none; padding: .48rem .74rem; border: 1px solid #46546b; border-radius: 8px; color: var(--ink); white-space: nowrap; }
  .c9a5j3wf summary::-webkit-details-marker { display: none; }
  .c9a5j3wf[open] summary { border-color: var(--cyan); }
  .c9a5j3wf > div {
    position: absolute;
    inset: calc(100% + 10px) 0 auto auto;
    width: min(295px, calc(100vw - 2 * var(--edge)));
    max-height: 72vh;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
    background: #1e2633;
    border: 1px solid #4a586d;
    border-radius: 12px;
    box-shadow: 0 16px 50px #05070baa;
  }

  .c9a5j3wf > div a { padding: .56rem .64rem; border-radius: 6px; }
  .c9a5j3wf > div a:hover { background: #303c4c; }

  .e7k5v3rw {
    background:
      radial-gradient(ellipse at 84% 38%, #34396d 0, transparent 57%),
      linear-gradient(112deg, #131924, #191f35);
    border-bottom: 1px solid #3e485d;
  }

  .z6p4c8mn {
    display: grid;
    grid-template-columns: 1fr minmax(0, .97fr);
    align-items: center;
    gap: clamp(24px, 5.6vw, 83px);
    min-height: clamp(470px, 44vw, 620px);
    padding-block: clamp(36px, 6vw, 82px);
  }

  .s2w9k3ev { color: var(--cyan); font-weight: 700; letter-spacing: .09em; font-size: clamp(.83rem, 1.5vw, 1rem); }
  .b3y8m6qd h2 { margin-block: .27em .24em; font-size: clamp(2.65rem, 6.5vw, 6rem); font-weight: 850; letter-spacing: -.07em; line-height: 1.05; }
  .b3y8m6qd h2 span { color: var(--cyan); }
  .l8k9a4td { max-width: 27em; color: #c1cde0; font-size: clamp(.97rem, 1.55vw, 1.14rem); line-height: 1.8; }
  .q5j8v3nw { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(22px, 3.05vw, 39px); }

  .i8m3p6ze, .o4w8u2gt {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: .75em;
    min-height: 46px;
    padding: .68rem 1rem;
    border-radius: 8px;
    font-weight: 750;
    font-size: .91rem;
    transition: transform .2s ease, box-shadow .2s ease;
  }

  .i8m3p6ze { background: linear-gradient(112deg, #99f0f7, #b8acf9); color: #121728; }
  .o4w8u2gt { border: 1px solid #707b96; }
  .i8m3p6ze:hover, .o4w8u2gt:hover { transform: translateY(-2px); box-shadow: 0 7px 24px #090a1855; }

  .j3r8k5xv { min-width: 0; }
  .u6d9e2nh {
    position: relative;
    padding: clamp(12px, 2vw, 23px);
    border: 1px solid #5c6787;
    background: repeating-linear-gradient(153deg, #a1aff015 0 1px, transparent 1px 15px), #1e2740;
    clip-path: polygon(0 0, calc(100% - 23px) 0, 100% 23px, 100% 100%, 0 100%);
  }

  .u6d9e2nh figure {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    min-height: clamp(305px, 28vw, 405px);
    overflow: hidden;
    background:
      radial-gradient(ellipse at 67% 48%, #475c84, transparent 60%),
      linear-gradient(144deg, #273a53, #111824 66%);
    border: 1px solid #607389;
  }

  .u6d9e2nh figure[data-enter] { animation: leaf-turn 350ms ease both; }

  @keyframes leaf-turn {
    from { opacity: .28; transform: translateX(11px); }
    to { opacity: 1; transform: translateX(0); }
  }

  .a3d9n6wp {
    grid-column: 2;
    grid-row: 1;
    min-height: 100%;
    background: #263b52;
    border-left: 1px solid #6a80a0;
    box-shadow: -18px 0 50px #090d1b88;
  }

  .a3d9n6wp img { position: absolute; inset: 0; object-position: 50% 42%; }
  .u6d9e2nh figcaption {
    grid-row: 1;
    grid-column: 1;
    align-self: end;
    position: relative;
    z-index: 1;
    padding: clamp(15px, 2.7vw, 33px) clamp(12px, 2.1vw, 24px);
    overflow-wrap: anywhere;
  }

  .u6d9e2nh figcaption > span { display: block; margin-bottom: 9px; color: var(--cyan); font-size: .78rem; }
  .u6d9e2nh figcaption a { display: inline-block; font-size: clamp(1.25rem, 2.16vw, 1.92rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.16; }
  .u6d9e2nh figcaption a:hover { color: var(--cyan); }
  .u6d9e2nh figcaption p { margin-top: 8px; color: #ccd6e6; font-size: .84rem; }

  .y2e7x5sp { display: flex; justify-content: flex-end; align-items: center; gap: 11px; margin-top: 13px; }
  .y2e7x5sp button {
    display: grid;
    place-items: center;
    width: 43px;
    height: 40px;
    border: 1px solid #73819f;
    border-radius: 7px;
    background: #1e2638;
    transition: background .2s ease, border-color .2s ease;
  }

  .y2e7x5sp button:hover { background: #374663; border-color: var(--cyan); }
  .n8s5a3eu { color: #d6deee; font-size: .88rem; font-variant-numeric: tabular-nums; }

  .f4j7e9bx { background: #161d27; border-bottom: 1px solid var(--rule); }
  .v2m9h6ka { display: grid; grid-template-columns: minmax(135px, .65fr) 3fr; align-items: center; padding-block: 22px; gap: 18px; }
  .v2m9h6ka h2 { font-size: 1.1rem; letter-spacing: 0; }
  .v2m9h6ka ol { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
  .v2m9h6ka li { display: flex; gap: 11px; align-items: baseline; padding: 3px 13px; border-left: 1px solid var(--rule); }
  .v2m9h6ka li > span { color: var(--violet); font: 650 .8rem/1 system-ui, sans-serif; }
  .v2m9h6ka a { color: var(--ink); font-weight: 750; }
  .v2m9h6ka a:hover { color: var(--cyan); }
  .v2m9h6ka p { color: var(--muted); font-size: .82rem; }
}

@layer content {
  .q8v6r2hx, .m2v9j6ph, .a6m4w9kd, .k9u4d6ma, .g7m4q2vk { padding-block: clamp(36px, 5.7vw, 74px); }
  .d6t3n5ya { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px 20px; margin-bottom: 21px; }
  .d6t3n5ya p, .x2k6c9dq > p, .p7x2h6vz > p { color: var(--muted); margin-top: 6px; font-size: .93rem; }
  .e9h4x7kg { display: flex; flex-wrap: wrap; gap: 6px; }

  .e9h4x7kg button, .u4m9g6ks button {
    min-height: 38px;
    padding: .38rem .76rem;
    background: var(--panel);
    border: 1px solid #455166;
    border-radius: 6px;
    color: var(--muted);
    font-size: .86rem;
  }

  .e9h4x7kg button[aria-pressed="true"], .u4m9g6ks button[aria-pressed="true"] { background: #a8eff4; border-color: #a8eff4; color: #111b28; font-weight: 750; }
  .e9h4x7kg button:hover, .u4m9g6ks button:hover { border-color: var(--cyan); }
  .t4b7p2sw { display: block; min-height: 1.55em; color: var(--muted); font-size: .82rem; margin-bottom: 9px; }
  .t4b7p2sw:empty { display: none; }
  .r9p6u4te { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }

  .r9p6u4te article {
    display: grid;
    grid-template-columns: clamp(70px, 9vw, 117px) minmax(0, 1fr);
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 10px;
    min-height: clamp(147px, 14vw, 175px);
    transition: border-color .18s ease, background-color .18s ease;
  }

  .r9p6u4te article:hover, .r9p6u4te article:target { background: var(--raised); border-color: #8fa0d5; }
  .c2h8q5fb { margin: 8px; border-radius: 5px; background: #293946; }
  .c2h8q5fb img { position: absolute; inset: 0; }
  .k7n4s2ua { display: grid; align-content: center; row-gap: 4px; padding: 10px clamp(8px, 1.35vw, 19px) 10px 5px; }
  .k7n4s2ua h3 { font-size: clamp(1rem, 1.6vw, 1.24rem); }
  .f9c6u2dz { color: #c1bafa; font-size: .76rem; line-height: 1.3; }
  .g5t2m8bk { color: var(--muted); font-size: .86rem; line-height: 1.55; }
  .m8r6x5cp { color: var(--cyan); font-size: .81rem; width: fit-content; text-underline-offset: 3px; }
  .m8r6x5cp:hover { text-decoration: underline; }

  .m2v9j6ph {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    border-top: 1px solid var(--rule);
    gap: clamp(23px, 4vw, 54px);
  }

  .g8k3m5vr { display: grid; gap: 8px; margin-top: 17px; }
  .g8k3m5vr article { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 11px; align-items: center; padding: 11px 12px; border: 1px solid var(--rule); border-left: 3px solid #847bd1; border-radius: 0 6px 6px 0; }
  .g8k3m5vr p { color: var(--muted); font-size: .85rem; }
  .g8k3m5vr a { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--cyan); font-size: .81rem; }
  .g8k3m5vr a:hover { text-decoration: underline; }

  .p7x2h6vz { padding: clamp(14px, 2.4vw, 28px); align-self: start; background: #1b2330; border: 1px solid #43506a; border-radius: 12px; }
  .p7x2h6vz h2 { font-size: 1.42rem; }
  .p7x2h6vz ol { list-style: none; padding: 0; margin-top: 10px; counter-reset: board; }
  .p7x2h6vz li { counter-increment: board; border-top: 1px solid var(--rule); }
  .p7x2h6vz a { position: relative; display: grid; padding: 9px 0 9px 33px; line-height: 1.44; }
  .p7x2h6vz a::before { content: counter(board, decimal-leading-zero); position: absolute; left: 0; top: 12px; color: var(--violet); font: 700 .86rem/1 system-ui, sans-serif; }
  .p7x2h6vz a:hover { color: var(--cyan); }
  .p7x2h6vz small { color: var(--muted); }

  .s8q4v2hz { background: linear-gradient(118deg, #171c27, #1d2435); border-block: 1px solid var(--rule); }
  .a6m4w9kd { display: grid; grid-template-columns: minmax(0, 1.43fr) minmax(0, 1fr); gap: clamp(22px, 4.3vw, 57px); align-items: start; }
  .a6m4w9kd h2 { margin-bottom: 16px; }
  .x7n6h2qd { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .x7n6h2qd article { min-height: 100px; background: #111722ad; border: 1px solid var(--rule); border-top-color: #6e73a9; border-radius: 7px; padding: 12px; }
  .x7n6h2qd p { margin-top: 6px; color: var(--muted); font-size: .85rem; }

  .n9k7b4rw { overflow: hidden; border: 1px solid #64738e; border-radius: 12px; background: #111721; box-shadow: 0 12px 0 -7px #6770906e; }
  .u4m9g6ks { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; padding: 10px 12px; background: #263044; font-weight: 750; }
  .n9k7b4rw ul { list-style: none; padding: 0; }
  .n9k7b4rw li { display: grid; grid-template-columns: 50px minmax(0, 1fr); align-items: baseline; gap: 4px 8px; padding: 8px 12px; }
  .n9k7b4rw li + li { border-top: 1px solid var(--rule); }
  .n9k7b4rw li > span { color: var(--violet); font-size: .79rem; }
  .n9k7b4rw a { width: fit-content; font-size: .9rem; }
  .n9k7b4rw a:hover { color: var(--cyan); }
  .n9k7b4rw p { grid-column: 2; color: var(--muted); font-size: .81rem; }
  .n9k7b4rw[data-layout="compact"] p { display: none; }

  .v8t5h3qk { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .v8t5h3qk figure { display: grid; gap: 10px; align-content: space-between; padding: clamp(13px, 2vw, 21px); border: 1px solid var(--rule); border-bottom-color: #665b9f; background: var(--panel); border-radius: 8px; }
  .v8t5h3qk blockquote { font-size: .92rem; }
  .v8t5h3qk figcaption { font-size: .8rem; color: var(--violet); }

  .g7m4q2vk { border-top: 1px solid var(--rule); }
  .j8g5p3uc { margin-top: 15px; }
  .j8g5p3uc details { border-bottom: 1px solid var(--rule); }
  .j8g5p3uc summary { padding: 12px 5px; font-weight: 650; }
  .j8g5p3uc summary:hover, .j8g5p3uc details[open] summary { color: var(--cyan); }
  .j8g5p3uc p { color: var(--muted); padding: 0 8px 12px 24px; font-size: .90rem; }

  .c6r8w3jx {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: clamp(26px, 4vw, 51px);
    padding: clamp(17px, 4vw, 42px);
    border: 1px solid #657498;
    border-radius: 12px;
    background: repeating-linear-gradient(133deg, #dae1ff0a 0 1px, transparent 1px 22px), linear-gradient(125deg, #203a4b, #353259);
  }

  .c6r8w3jx p { margin-top: 7px; color: #dee5f2; font-size: .93rem; }
  .f6t9a2zm { background: #151b25; border-top: 1px solid var(--rule); color: var(--muted); }
  .s9b3w5gt { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 54px); padding-block: clamp(26px, 4.2vw, 48px); }
  .s9b3w5gt h2 { color: var(--ink); font-size: 1.22rem; margin-bottom: 10px; }
  .s9b3w5gt p { font-size: .88rem; line-height: 1.82; }
  .b7e5x3zp > div { display: flex; flex-wrap: wrap; gap: 7px 16px; font-size: .85rem; }
  .u9a3j5kx { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 15px; padding-block: 11px; font-size: .81rem; border-top: 1px solid var(--rule); }
}

@layer adaptive {
  [data-reveal][data-arrived] { animation: rise-into-view 450ms ease-out both; }

  @keyframes rise-into-view {
    from { opacity: .55; transform: translateY(13px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @media (max-width: 800px) {
    .w9c3q5fa { display: none; }
    .m2v9j6ph, .a6m4w9kd { grid-template-columns: minmax(0, 1fr); }
    .v2m9h6ka { grid-template-columns: 1fr; gap: 8px; }
    .v2m9h6ka li:first-child { padding-left: 0; border-left: 0; }
    .g8k3m5vr article { padding-block: 13px; }
  }

  @media (max-width: 600px) {
    .h7x4m9ca { min-height: 58px; }
    .z6p4c8mn { grid-template-columns: 1fr; gap: 24px; padding-block: 32px 19px; }
    .b3y8m6qd h2 { font-size: clamp(2.6rem, 12vw, 4rem); }
    .u6d9e2nh figure { min-height: clamp(212px, 62vw, 333px); }
    .v2m9h6ka ol { grid-template-columns: 1fr; gap: 5px; }
    .v2m9h6ka li:first-child, .v2m9h6ka li { padding: 4px 0; border-left: 0; }
    .v2m9h6ka li + li { border-top: 1px solid var(--rule); }
    .v2m9h6ka li > span { min-width: 19px; }
    .r9p6u4te, .v8t5h3qk, .s9b3w5gt { grid-template-columns: minmax(0, 1fr); }
    .r9p6u4te article { grid-template-columns: 92px minmax(0, 1fr); }
    .g8k3m5vr article { grid-template-columns: 1fr; }
    .g8k3m5vr a { grid-area: auto; justify-self: start; }
    section[id], aside[id], article[id] { scroll-margin-top: 72px; }
  }

  @media (max-width: 360px) {
    .r9p6u4te article { grid-template-columns: 75px minmax(0, 1fr); }
    .u6d9e2nh figcaption { padding-inline: 9px; }
    .x7n6h2qd { grid-template-columns: 1fr; }
  }

  @media (prefers-reduced-motion: reduce) {
    :root { scroll-behavior: auto; }
    .u6d9e2nh figure[data-enter], [data-reveal][data-arrived] { animation: none; }
    .i8m3p6ze, .o4w8u2gt, .y2e7x5sp button, .r9p6u4te article { transition: none; }
    .i8m3p6ze:hover, .o4w8u2gt:hover { transform: none; }
  }
}
