/* YYDS Download — 品牌配色与组件。黄色只用于品牌、主要操作与选中状态；青色只做少量状态点缀。 */
@font-face { font-family: "Chakra Petch"; font-weight: 500; font-display: swap; src: url("../fonts/chakra-petch-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url("../fonts/chakra-petch-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-display: swap; src: url("../fonts/chakra-petch-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #101214;
  --panel: #111820;
  --line: #262e37;
  --yellow: #F4D43B;
  --cyan: #26DFDD;
  --text: #ECE7DA;
  --text-2: #A9B0B6;
  --text-3: #858D95;
  --cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --display: "Chakra Petch", var(--cjk);
  --cut: 14px;
  --pad: clamp(16px, 3vw, 40px);
  --max: 1560px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--cjk); }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--text-3); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 10px 16px; background: var(--yellow); color: #101214; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* 页头 */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; min-height: 60px; padding: 8px var(--pad); background: rgba(16, 18, 20, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.brand__name { font: 700 20px/1 var(--display); letter-spacing: .02em; color: var(--yellow); }
.brand__name span { color: var(--text); font-weight: 500; }
.nav { display: flex; gap: 4px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--text-2); text-decoration: none; font-size: 15px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="true"] { color: var(--yellow); border-bottom-color: var(--yellow); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 1px solid var(--line); background: none; color: var(--text); font: 600 15px/1 var(--cjk); text-decoration: none; cursor: pointer; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px)); transition: background-color .15s, color .15s; }
.btn--main { background: var(--yellow); border-color: var(--yellow); color: #101214; }
.btn--main:hover { background: #ffe35c; }
.btn--ghost { background: var(--panel); }
.btn--ghost:hover { background: #18212b; }
.btn:focus-visible { outline-offset: 4px; clip-path: none; }
.ico { width: 12px; height: 12px; flex: none; }
.ico--pause { border-left: 4px solid currentColor; border-right: 4px solid currentColor; }
.ico--play { border-left: 11px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; height: 0; }

/* 首页简介行 */
.intro { display: flex; align-items: end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; max-width: var(--max); margin: 0 auto; padding: clamp(24px, 4vw, 44px) var(--pad) clamp(18px, 2.4vw, 28px); }
.intro h1 { font: 700 clamp(26px, 3.2vw, 40px)/1.2 var(--display); letter-spacing: .01em; }
.intro p { margin-top: 8px; max-width: 46em; color: var(--text-2); font-size: 15px; }
.intro__act { display: flex; gap: 10px; flex-wrap: wrap; }

/* 海报组件 */
.poster { position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; background: var(--panel); clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))); }
.poster__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: filter .25s; }
.poster::before { content: ""; position: absolute; inset: 0 0 auto; height: 72px; background: linear-gradient(rgba(12, 14, 16, .72), transparent); z-index: 1; }
.poster__mark { position: absolute; z-index: 2; left: 10px; top: 10px; width: 26px; height: 26px; }
.poster__no { position: absolute; z-index: 2; right: 18px; top: 10px; font: 600 14px/26px var(--display); letter-spacing: .08em; color: var(--text); }
.poster__body { position: absolute; z-index: 2; inset: auto 0 0; display: flex; flex-direction: column; gap: 3px; padding: 56px 14px 14px 18px; background: linear-gradient(transparent, rgba(12, 14, 16, .9) 46%); }
.poster__tag { font-size: 12px; line-height: 1.4; letter-spacing: .04em; color: var(--text-2); }
.poster__title { font: 700 clamp(17px, 1.35vw, 21px)/1.3 var(--cjk); color: var(--text); }
.poster__more { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .28s ease, opacity .28s ease; }
.poster__more > span { overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.poster__sum { padding-top: 6px; font-size: 13px; line-height: 1.55; color: var(--text); }
.poster__cta { font-size: 13px; font-weight: 700; color: var(--yellow); }
.poster__cta::after { content: " →"; }

/* 海报墙 */
.wall { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; height: clamp(520px, 76vh, 820px); padding: 0 var(--pad); overflow: clip; -webkit-mask-image: linear-gradient(transparent, #000 9%, #000 91%, transparent); mask-image: linear-gradient(transparent, #000 9%, #000 91%, transparent); }
.wall__col:nth-child(n+5) { display: none; }
.wall__track { position: relative; will-change: transform; }
.wall__set { display: grid; gap: 16px; padding-bottom: 16px; }
/* 未启用动画时（无脚本或减少动态效果）的静态错位 */
.wall:not(.is-live) .wall__col:nth-child(odd) .wall__track { transform: translateY(-22%); }
.wall:not(.is-live) .wall__col:nth-child(even) .wall__track { transform: translateY(-9%); }
.card { position: relative; display: block; text-decoration: none; transition: transform .25s ease; }
.card .poster::after { content: ""; position: absolute; z-index: 3; inset: auto 0 0; height: 2px; background: var(--yellow); transform: scaleX(0); transform-origin: left; transition: transform .28s ease; }
.card:hover, .card:focus-visible { transform: scale(1.025); z-index: 2; }
.card:hover .poster__art, .card:focus-visible .poster__art { filter: brightness(1.1); }
.card:hover .poster::after, .card:focus-visible .poster::after { transform: scaleX(1); }
.card:hover .poster__more, .card:focus-visible .poster__more { grid-template-rows: 1fr; opacity: 1; }
@media (min-width: 1180px) { .wall { grid-template-columns: repeat(5, minmax(0, 1fr)); } .wall__col:nth-child(5) { display: block; } }
@media (min-width: 1500px) { .wall { grid-template-columns: repeat(6, minmax(0, 1fr)); } .wall__col:nth-child(6) { display: block; } }

/* 全部作品 */
.all { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 6vw, 80px) var(--pad) clamp(48px, 6vw, 88px); scroll-margin-top: 60px; }
.all__head { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.all h2 { font: 700 clamp(22px, 2.2vw, 28px)/1.3 var(--display); }
.count { margin-left: 6px; font: 500 15px var(--display); color: var(--text-3); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); background: none; color: var(--text-2); font: 500 14px/1 var(--cjk); cursor: pointer; }
.chip:hover { color: var(--text); border-color: #3a444f; }
.chip[aria-pressed="true"] { border-color: var(--yellow); color: var(--yellow); }
.all__note { margin-top: 10px; color: var(--text-3); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 28px 20px; margin-top: 28px; }
.item__poster { display: block; text-decoration: none; }
.item__poster:hover .poster__art { filter: brightness(1.1); }
.item__sum { margin-top: 12px; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.item__links { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; font-size: 14px; }
.item__links a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 4px; }
.item__links .hot { color: var(--yellow); font-weight: 700; }
.item__links .muted { display: inline-flex; align-items: center; min-height: 44px; }

/* 详情页与 Demo 页 */
.detail, .demo, .nf { max-width: 1120px; margin: 0 auto; padding: 20px var(--pad) 80px; }
.back a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-2); text-decoration: none; }
.back a:hover { color: var(--yellow); }
.detail__grid { display: grid; grid-template-columns: minmax(220px, 340px) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); margin-top: 12px; align-items: start; }
.detail__cover { position: sticky; top: 84px; }
.detail__cover .poster__title { font-size: 22px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tag { padding: 3px 10px; border: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.tag--warn { border-color: rgba(244, 212, 59, .55); color: var(--yellow); }
.tag--ok { border-color: rgba(38, 223, 221, .5); color: var(--cyan); }
.detail h1, .demo h1, .nf h1 { font: 700 clamp(28px, 3.4vw, 40px)/1.25 var(--cjk); }
.lead { margin: 10px 0 22px; font-size: 18px; color: var(--text-2); max-width: 34em; }
.detail h2, .demo h2 { margin: 34px 0 10px; font: 700 18px/1.4 var(--cjk); padding-left: 12px; border-left: 3px solid var(--yellow); }
.detail__main > p, .demo > p { max-width: 42em; }
.list { display: grid; gap: 6px; max-width: 42em; }
.list li { position: relative; padding-left: 18px; color: var(--text); }
.list li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 6px; height: 6px; background: var(--text-3); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin-top: 22px; font-size: 15px; }
.facts dt { color: var(--text-3); }
.facts code { word-break: break-all; font-size: 13px; }
.ver { font: 600 15px var(--display); color: var(--text); margin-bottom: 4px; }
.state, .dl { max-width: 42em; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); display: grid; gap: 6px; font-size: 15px; }
.state__title { font-weight: 700; color: var(--text); }
.state p:not(.state__title):not(.muted) { color: var(--text-2); }

/* Demo 工具表单 */
.tool { display: grid; gap: 18px; margin-top: 8px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; color: var(--text-2); }
.field--inline { max-width: 320px; }
.field--check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.field--check input { width: 20px; height: 20px; accent-color: var(--yellow); }
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 16px; align-items: end; }
textarea, input[type="text"], input[type="number"] { width: 100%; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font: 15px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, var(--cjk); border-radius: 0; }
input[type="text"], input[type="number"] { min-height: 44px; }
textarea { resize: vertical; }
textarea:focus-visible, input:focus-visible { outline-offset: 0; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); word-break: break-all; }
.tbl th { color: var(--text-3); font-weight: 500; white-space: nowrap; }
.tbl td:nth-child(2) { color: var(--text); }
.tbl .warn { color: var(--yellow); }

.nf { text-align: center; padding-top: 80px; display: grid; gap: 16px; justify-items: center; }

/* 页脚 */
.foot { border-top: 1px solid var(--line); background: var(--panel); }
.foot__in { max-width: var(--max); margin: 0 auto; padding: 28px var(--pad) 40px; display: grid; gap: 6px; font-size: 14px; color: var(--text-3); }
.foot__brand { display: flex; align-items: center; gap: 8px; font: 600 15px var(--display); color: var(--text-2); }

/* 平板以下：不显示漂移海报墙，改用稳定的两列海报网格 */
@media (max-width: 719px) {
  .wall { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; margin-top: 20px; }
  .poster__body { padding: 44px 10px 10px 14px; }
  .poster__title { font-size: 16px; }
  .detail__grid { grid-template-columns: 1fr; }
  .detail__cover { position: static; max-width: 260px; }
  .nav a { padding: 0 10px; }
}
@media (max-width: 339px) {
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover, .card:focus-visible { transform: none; }
}
