/* ==========================================================================
   极简三页版 · 一档滚轮一页
   这一个文件只负责覆盖旧版里多余的部分：整页布局、简化首页、教程和素材区。
   ========================================================================== */

/* 桌面端隐藏滚动条，靠滚轮与顶部导航翻页 */
@media (min-width: 921px) {
  html {
    scrollbar-width: none;
  }

  html::-webkit-scrollbar {
    display: none;
  }
}

/* 页面骨架 ---------------------------------------------------------------- */

.page {
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: calc(var(--header-h) + 28px) 0 54px;
  scroll-margin: 0;
}

.page.hero {
  padding-bottom: 54px;
}

@media (min-width: 921px) {
  .page {
    height: 100svh;
    min-height: 640px;
  }
}

.page-inner {
  position: relative;
  z-index: 2;
  opacity: 1;
  transform: none;
}

.page.is-upcoming .hero-name,
.page.is-upcoming .hero-lead,
.page.is-upcoming .page-head,
.page.is-upcoming .tutorial-card,
.page.is-upcoming .upload-panel,
.page.is-upcoming .library-panel {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
}

.page.is-revealing .hero-name,
.page.is-revealing .hero-lead,
.page.is-revealing .page-head,
.page.is-revealing .tutorial-card,
.page.is-revealing .upload-panel,
.page.is-revealing .library-panel {
  animation: textRise 620ms cubic-bezier(0.22, 0.61, 0.36, 1) backwards;
}

.page.is-revealing .hero-lead {
  animation-delay: 60ms;
}

.page.is-revealing .tutorial-card:nth-child(1) {
  animation-delay: 60ms;
}

.page.is-revealing .tutorial-card:nth-child(2) {
  animation-delay: 120ms;
}

.page.is-revealing .tutorial-card:nth-child(3) {
  animation-delay: 180ms;
}

.page.is-revealing .upload-panel {
  animation-delay: 60ms;
}

.page.is-revealing .library-panel {
  animation-delay: 120ms;
}

/* 右侧细横线分页 */
.page-rail {
  position: fixed;
  top: 50%;
  right: 23px;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
  transform: translateY(-50%);
}

.page-dash {
  display: block;
  width: 12px;
  height: 12px;
  padding-block: 5px;
  background: rgba(236, 233, 221, 0.24);
  background-clip: content-box;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.page-dash:hover {
  width: 18px;
  background-color: var(--gold);
}

.page-dash.is-active {
  width: 22px;
  background-color: var(--ivory);
}

/* 向下翻页提示 */
.page-cue {
  position: absolute;
  bottom: 15px;
  left: 50%;
  z-index: 3;
  width: 44px;
  color: var(--ivory);
  opacity: 0.68;
  pointer-events: none;
  transform: translateX(-50%);
}

.page-cue svg {
  display: block;
  width: 100%;
  height: auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  animation: cueBob 2.3s ease-in-out infinite;
}

/* 顶部导航的极简化 */
.nav-link {
  height: 34px;
  padding-inline: 14px;
}

.nav-link.is-active {
  background: transparent;
  color: var(--gold-light);
}

.nav-link.is-active::after {
  right: 14px;
  left: 14px;
  background: var(--gold);
}

.nav-bili {
  margin-left: 12px;
  padding-inline: 11px;
}

/* 首页 -------------------------------------------------------------------- */

.hero {
  padding-top: calc(var(--header-h) + 30px);
}

.hero-layout {
  flex: 1;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(44px, 7vw, 96px);
}

.hero-copy {
  max-width: 650px;
  animation: none;
}

.hero.is-intro .hero-name {
  animation: heroIntro 720ms cubic-bezier(0.16, 0.84, 0.44, 1) 80ms backwards;
}

.hero.is-intro .hero-lead {
  animation: heroIntro 720ms cubic-bezier(0.16, 0.84, 0.44, 1) 220ms backwards;
}

.hero h1 {
  margin: 0 0 25px;
}

.hero-name {
  font-size: clamp(4.2rem, 7.6vw, 6.6rem);
  letter-spacing: -0.075em;
}

.hero-latin {
  margin-top: 12px;
  padding-left: 0;
  font-size: clamp(1.55rem, 2.8vw, 2.3rem);
}

.hero-latin::before {
  display: none;
}

.hero-lead {
  max-width: 460px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.hero-portrait {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0;
  justify-self: end;
}

.hero-portrait::before {
  position: absolute;
  inset: 16% 5% 4% 8%;
  z-index: 0;
  background: var(--gold);
  content: "";
  filter: blur(38px);
  opacity: 0.1;
}

.portrait-panel {
  position: relative;
  z-index: 1;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  background:
    radial-gradient(circle at 50% 44%, rgba(214, 161, 59, 0.13), transparent 60%),
    linear-gradient(rgba(5, 7, 7, 0.72), rgba(5, 7, 7, 0.92)),
    url("../img/blocks/blackstone.png");
  background-size: auto, auto, 96px 96px;
  box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.28);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.portrait-panel::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--gold);
  content: "";
  opacity: 0.7;
}

.portrait-panel img {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
  object-fit: contain;
  filter: drop-shadow(0 14px 13px rgba(0, 0, 0, 0.36));
}

/* 页面底部标记 ------------------------------------------------------------ */

.page-bottom {
  position: absolute;
  right: 0;
  bottom: 17px;
  left: 0;
  z-index: 3;
  display: flex;
  width: min(var(--shell), calc(100% - 80px));
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  margin-inline: auto;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.page-count {
  white-space: nowrap;
}

.credit {
  color: var(--dim);
  text-align: right;
}

.credit a {
  color: var(--muted);
  pointer-events: auto;
}

.credit a:hover {
  color: var(--gold);
}

.scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.scroll-hint i {
  position: relative;
  width: 54px;
  height: 1px;
  overflow: hidden;
  background: var(--line-strong);
}

.scroll-hint i::after {
  position: absolute;
  top: 0;
  left: -22%;
  width: 22%;
  height: 100%;
  background: var(--gold);
  content: "";
  animation: scanLine 2.3s ease-in-out infinite;
}

.scroll-hint .icon {
  width: 12px;
  height: 12px;
  transform: rotate(180deg);
}

/* 教程页 ------------------------------------------------------------------ */

.section-tutorials,
.section-downloads {
  justify-content: center;
  border-top: 1px solid var(--line);
}

.section-tutorials {
  background: #090c0c;
}

.section-downloads {
  background: #080a0a;
}

.section-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.section-tutorials .section-bg {
  background:
    linear-gradient(90deg, rgba(7, 9, 9, 0.93), rgba(7, 9, 9, 0.74) 56%, rgba(7, 9, 9, 0.9)),
    url("../img/blocks/polished_blackstone_bricks.png");
  background-size: auto, 112px 112px;
  opacity: 0.76;
}

.section-downloads .section-bg {
  background:
    linear-gradient(rgba(7, 9, 9, 0.9), rgba(7, 9, 9, 0.97)),
    url("../img/blocks/polished_blackstone.png");
  background-size: auto, 120px 120px;
  opacity: 0.82;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 27px;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: color 0.16s ease;
}

.page-link:hover {
  color: var(--gold-light);
}

.page-link .icon {
  width: 11px;
  height: 11px;
}

.page-num {
  padding-bottom: 7px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.page-head h2 {
  margin: 0;
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 4.5vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.tutorial-grid {
  gap: 14px;
}

.tutorial-card {
  min-height: 252px;
  padding: 21px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.035), transparent 58%),
    #0d1111;
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.tutorial-card::before {
  display: none;
}

.tutorial-card::after {
  right: 0;
  left: 0;
}

.tutorial-card h3 {
  margin: 22px 0 9px;
  color: var(--ivory);
  font-size: 19px;
}

.tutorial-summary {
  flex: 1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.tutorial-cat {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--gold);
  font-size: 8px;
}

.tutorial-cat::before {
  width: 4px;
  height: 4px;
}

.tutorial-number {
  color: var(--dim);
  font-size: 8px;
}

.tutorial-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.tutorial-open .icon {
  width: 12px;
  height: 12px;
}

.tutorial-open:hover {
  color: var(--gold-light);
}

/* 素材页 ------------------------------------------------------------------ */

.library-layout {
  height: clamp(340px, calc(100svh - 300px), 460px);
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  align-items: stretch;
  gap: 16px;
}

.upload-panel {
  height: 100%;
  padding: 0;
  background: transparent;
  box-shadow: none;
  clip-path: none;
}

.upload-panel.dropzone {
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 23px;
  border: 1px dashed var(--gold-line);
  background:
    linear-gradient(rgba(5, 7, 7, 0.84), rgba(6, 8, 8, 0.92)),
    url("../img/blocks/polished_blackstone_bricks.png");
  background-size: auto, 96px 96px;
  clip-path: none;
  text-align: center;
}

.upload-panel.dropzone:hover,
.upload-panel.dropzone.is-dragging {
  border-color: var(--gold);
  filter: brightness(1.08);
}

.upload-symbol {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--gold-line);
  background:
    linear-gradient(rgba(6, 8, 8, 0.74), rgba(6, 8, 8, 0.86)),
    url("../img/blocks/gilded_blackstone.png");
  background-size: auto, 44px 44px;
  color: var(--gold);
  image-rendering: pixelated;
}

.upload-symbol .icon {
  width: 22px;
  height: 22px;
}

.upload-panel h3 {
  margin: 0;
  color: var(--ivory);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.upload-panel > p {
  max-width: 240px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.upload-panel .btn {
  min-height: 42px;
  margin: 17px 0 13px;
  padding-inline: 17px;
  font-size: 11px;
}

.upload-limit {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.04em;
}

.upload-queue {
  width: 100%;
  max-width: 320px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.queue-head {
  display: none;
}

.queue-list {
  max-height: 90px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.queue-item {
  padding: 7px 0;
  border-bottom: 1px solid rgba(236, 233, 221, 0.06);
}

.queue-item:last-child {
  border-bottom: 0;
}

.queue-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.queue-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-state {
  flex: none;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 7px;
}

.queue-track {
  height: 2px;
  margin-top: 5px;
  background: rgba(236, 233, 221, 0.08);
}

.queue-fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
  transition: width 0.18s ease, background-color 0.2s ease;
}

.queue-item[data-state="done"] .queue-fill {
  background: #749264;
}

.queue-item[data-state="error"] .queue-fill {
  background: var(--danger);
}

.queue-item[data-state="done"] .queue-state {
  color: #829f73;
}

.queue-item[data-state="error"] .queue-state {
  color: var(--danger);
}

.upload-panel::before,
.library-panel::before {
  height: 2px;
  background: url("../img/blocks/gold_block.png") left top / 12px 12px repeat;
  image-rendering: pixelated;
  opacity: 0.4;
}

.library-panel {
  position: relative;
  min-height: 0;
  height: 100%;
  padding: 19px 20px 15px;
  background:
    linear-gradient(rgba(7, 9, 9, 0.84), rgba(7, 9, 9, 0.93)),
    url("../img/blocks/blackstone.png");
  background-size: auto, 104px 104px;
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%);
}

.library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.library-head h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--ivory);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1;
}

.file-count {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  padding: 0 6px;
  background: var(--gold);
  color: #0c0f0c;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
}

.file-list {
  max-height: calc(100% - 50px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.file-item {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.file-badge {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  background: #151a19;
  color: var(--muted);
  font-size: 7px;
}

.file-badge.type-image,
.file-badge.type-video,
.file-badge.type-audio,
.file-badge.type-archive,
.file-badge.type-doc,
.file-badge.type-code {
  border-color: var(--line-strong);
  color: var(--muted);
}

.file-name {
  font-size: 12.5px;
}

.file-meta {
  color: var(--dim);
  font-size: 8px;
}

.file-actions {
  gap: 2px;
}

.file-actions .icon-btn {
  width: 30px;
  height: 30px;
  color: var(--muted);
}

.file-actions .file-download {
  border-color: transparent;
  color: var(--gold);
}

.file-actions .file-download:hover {
  background: var(--gold);
  color: #0d100d;
}

.empty-state,
.error-state {
  min-height: 240px;
  border: 1px dashed rgba(236, 233, 221, 0.14);
}

.empty-state h4,
.error-state h4 {
  color: var(--ivory);
  font-size: 10px;
}

.empty-state p,
.error-state p {
  color: var(--dim);
}

.empty-state .text-link,
.error-state .text-link {
  color: var(--gold);
}

.library-foot {
  display: none;
}

/* 弹窗极简化 */
.tutorial-dialog {
  width: min(600px, calc(100vw - 32px));
  box-shadow: 14px 14px 0 rgba(0, 0, 0, 0.32);
}

.dialog-inner {
  padding: 28px 30px 25px;
}

.dialog-code,
.dialog-bottom {
  display: none;
}

.tutorial-dialog h2 {
  margin-top: 16px;
}

.dialog-rule {
  margin-top: 20px;
}

.dialog-notes {
  margin-top: 0;
}

@media (max-width: 1200px) {
  .page-rail {
    display: none;
  }
}

/* 移动端：恢复普通滚动，不再整页翻页 */
@media (max-width: 920px) {
  .page-cue {
    position: static;
    display: block;
    width: 38px;
    margin: 28px auto 0;
    opacity: 0.58;
    transform: none;
  }

  .page {
    height: auto;
    min-height: 100svh;
    justify-content: flex-start;
    padding: calc(var(--header-h) + 34px) 0 38px;
  }

  .page-inner {
    opacity: 1;
    transform: none;
  }

  .hero {
    padding-top: calc(var(--header-h) + 45px);
  }

  .hero-layout {
    flex: none;
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-copy {
    max-width: 680px;
  }

  .hero-name {
    font-size: clamp(3.8rem, 12vw, 6rem);
  }

  .hero-lead {
    max-width: 520px;
  }

  .hero-portrait {
    width: min(100%, 300px);
    max-width: 300px;
    justify-self: center;
  }

  .page-bottom {
    position: static;
    width: calc(100% - 40px);
    margin-top: 34px;
  }

  .page.hero .page-bottom {
    display: none;
  }

  .page-bottom-cue {
    display: none;
  }

  .scroll-hint {
    display: none;
  }

  .page-head {
    margin-bottom: 22px;
  }

  .page-link {
    flex-basis: 100%;
    margin: -3px 0 0;
  }

  .page-head h2 {
    font-size: clamp(2.45rem, 9vw, 3.5rem);
  }

  .tutorial-grid {
    grid-template-columns: 1fr;
  }

  .tutorial-card {
    min-height: 0;
    padding: 19px;
  }

  .tutorial-summary {
    flex: none;
  }

  .library-layout {
    height: auto;
    grid-template-columns: 1fr;
  }

  .upload-panel.dropzone {
    min-height: 290px;
  }

  .library-panel {
    min-height: 340px;
    max-height: 440px;
  }

  .page-head,
  .tutorial-grid,
  .library-layout {
    width: 100%;
  }

  .credit {
    max-width: 220px;
    text-align: right;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 480px) {
  .hero-name {
    font-size: clamp(3rem, 16.5vw, 4.35rem);
  }

  .hero-latin {
    font-size: 1.35rem;
  }

  .hero-lead {
    font-size: 13px;
  }

  .page-bottom {
    width: calc(100% - 32px);
    gap: 10px;
    font-size: 6px;
  }

  .credit {
    max-width: 175px;
    line-height: 1.5;
  }

  .tutorial-dialog {
    width: calc(100vw - 20px);
  }

  .dialog-inner {
    padding: 22px 19px 20px;
  }

  .dialog-notes li {
    grid-template-columns: 23px minmax(0, 1fr);
    gap: 8px;
    font-size: 11.5px;
  }
}

/* 矮屏桌面，避免一页内容塞不进视口 */
@media (min-width: 921px) and (max-height: 760px) {
  .page {
    padding-top: calc(var(--header-h) + 14px);
    padding-bottom: 42px;
  }

  .hero-name {
    font-size: clamp(3.7rem, 6.6vw, 5.4rem);
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .hero-portrait {
    max-width: 280px;
  }

  .page-head {
    margin-bottom: 18px;
  }

  .page-head h2 {
    font-size: clamp(2.3rem, 4vw, 3.3rem);
  }

  .tutorial-card {
    min-height: 220px;
    padding: 17px;
  }

  .library-layout {
    height: 360px;
  }
}

@keyframes cueBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

@keyframes textRise {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes heroIntro {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
