/*
Theme Name: ZBY Origin 2026
Theme URI: https://www.zhengbuyuan.com
Author: ZBY
Description: Custom standalone theme rebuilt from current site behavior.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: zby-origin-2026
*/

:root {
  --zby-bg: #b7cf98;
  --zby-surface: #0b0b0b;
  --zby-text: #121212;
  --zby-text-light: #f2f2f2;
  --zby-muted: #7a7a7a;
  --zby-border: rgba(0, 0, 0, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Helvetica Neue", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  color: var(--zby-text);
  background: var(--zby-bg);
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 26px 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 300;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 17px;
}

.site-nav a {
  opacity: 0.82;
  transition: opacity 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.current {
  opacity: 1;
}

.site-content {
  flex: 1;
}

.content-wrap {
  width: min(1200px, 92vw);
  margin: 0 auto 48px;
}

.content-card {
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid var(--zby-border);
  border-radius: 18px;
  padding: 24px;
}

.content-full {
  width: 100%;
  margin: 0;
  padding: 0;
}

.entry-title {
  margin: 0 0 18px;
  font-weight: 300;
  letter-spacing: 0.01em;
  font-size: clamp(28px, 4.5vw, 56px);
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content > *:last-child {
  margin-bottom: 0;
}

.entry-content p,
.entry-content li {
  font-size: 18px;
}

.entry-content a {
  text-decoration: underline;
}

.site-footer {
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 18px 0 28px;
  display: flex;
  justify-content: flex-end;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.62);
}

.site-footer a {
  color: inherit;
}

@font-face {
  font-family: "DejaVu Sans Mono";
  src: url("./DejaVuSansMono.ttf") format("truetype");
  font-display: swap;
}

.archive-list {
  display: grid;
  gap: 16px;
}

.archive-item {
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid var(--zby-border);
  border-radius: 14px;
  padding: 14px 16px;
}

.archive-item h2 {
  margin: 0 0 8px;
  font-weight: 400;
}

body.zby-home-landing {
  overflow: hidden;
  background: #000;
}

body.zby-home-landing .site-content {
  width: 100%;
  margin: 0;
}

.zby-home-landing-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
  color: #f5f5f5;
}

.zby-home-landing-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
}

.zby-home-landing-bg picture,
.zby-home-landing-bg img {
  display: block;
  width: 100%;
  height: 100%;
}

.zby-home-landing-bg img {
  object-fit: cover;
  object-position: center center;
  filter: blur(0px) brightness(1) saturate(0.98);
  transform: scale(1);
  transition: filter 1.8s ease 0.95s, transform 1.8s ease 0.95s;
}

body.is-home-landing-blurred .zby-home-landing-bg img {
  filter: blur(5px) brightness(0.77) saturate(0.9);
  transform: scale(1.02);
}

.zby-home-landing-gradient {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
}

.zby-home-landing-gradient-top {
  top: 0;
  height: min(28vh, 220px);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.58) 44%, rgba(0, 0, 0, 0));
}

.zby-home-landing-gradient-bottom {
  bottom: 0;
  height: min(24vh, 200px);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.94), rgba(0, 0, 0, 0.62) 40%, rgba(0, 0, 0, 0));
}

.zby-home-landing-stage {
  position: relative;
  z-index: 2;
  width: min(1780px, calc(100vw - 28px));
  height: 100svh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 18px 0 14px;
}

.zby-home-landing-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px clamp(14px, 2.2vw, 34px);
  font-size: clamp(18px, 1.3vw, 22px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
  min-height: 36px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.zby-home-landing-nav a {
  color: #f5f5f5;
  text-decoration: none;
  font-weight: 300;
  white-space: nowrap;
}

.zby-home-landing-nav .sep {
  color: rgba(255, 255, 255, 0.76);
  user-select: none;
  transform: translateY(-1px);
}

.zby-home-landing-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  pointer-events: none;
}

.zby-home-landing-type {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.75s ease, transform 0.75s ease;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  width: max-content;
  max-width: calc(100vw - 64px);
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.58);
  font-family: "DejaVu Sans Mono", "Consolas", "Liberation Mono", monospace;
  letter-spacing: 0.01em;
}

body.is-home-landing-type-visible .zby-home-landing-type {
  opacity: 1;
  transform: translateY(0);
}

.zby-home-landing-line {
  min-height: 1.32em;
  display: flex;
  align-items: baseline;
  white-space: pre-wrap;
  text-align: left;
}

.zby-home-landing-line + .zby-home-landing-line {
  margin-top: 18px;
}

.zby-home-landing-line.domain {
  font-size: clamp(38px, 3.7vw, 50px);
  font-weight: 400;
}

.zby-home-landing-line.welcome {
  font-size: clamp(46px, 4.5vw, 58px);
  font-weight: 500;
}

.zby-home-landing-cursor {
  display: inline-block;
  width: 0.62em;
  margin-left: 4px;
  color: rgba(255, 255, 255, 0.96);
  animation: zby-home-landing-blink 1s steps(1, end) infinite;
}

@keyframes zby-home-landing-blink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

.zby-home-landing-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 0.45em;
  font-size: clamp(12px, 0.9vw, 15px);
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.85;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.64);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-weight: 200;
  text-align: center;
}

.zby-home-landing-footer-line {
  white-space: nowrap;
}

.zby-home-landing-footer a {
  color: #f5f5f5;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
}

body.zby-split-active {
  overflow: hidden;
  background: #000;
}

body.zby-split-active .site-content {
  width: 100%;
  margin: 0;
}

.zby-split-page {
  position: fixed;
  inset: 0;
  margin: 0;
  display: block;
  background: #000;
  color: #fff;
}

.zby-page-accent {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 20vw;
  min-width: 20vw;
  max-width: 20vw;
  overflow: hidden;
  isolation: isolate;
  background-color: #000;
  background-image: url("./split-accent-bg-desktop.webp");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 3;
}

.zby-page-accent::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.4));
  z-index: -1;
}

.zby-page-title {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 38px);
  font-family: "PingFang SC", "PingFang SC Thin", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-weight: 100;
  letter-spacing: 0.02em;
  line-height: 1.08;
  text-align: center;
  color: #ffffff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
  position: relative;
  z-index: 1;
  -webkit-font-smoothing: antialiased;
}

.zby-page-main {
  margin-left: 20vw;
  min-height: 100vh;
  padding: 8px clamp(14px, 1.5vw, 24px) 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #000;
}

.zby-page-domain {
  color: #a8aeb9;
  font-size: clamp(12px, 0.8vw, 14px);
  line-height: 1;
  text-align: right;
  margin: 0 0 6px;
}

.zby-page-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  flex-wrap: nowrap;
}

.zby-page-nav-item {
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
  line-height: 1;
  border: 0;
  padding: 2px 0;
}

.zby-page-nav-item.is-active {
  color: #d7dce3;
  font-weight: 700 !important;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.zby-page-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.zby-page-content > *:first-child {
  margin-top: 0 !important;
}

.zby-page-content > *:last-child {
  margin-bottom: 0 !important;
}

.zby-page-contact .zby-page-content,
.zby-page-about .zby-page-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.zby-page-about .zby-page-content {
  justify-content: flex-start;
  padding-top: clamp(12px, 3vh, 30px);
}

.zby-page-about .zby-page-content {
  overflow: auto;
}

.zby-page-contact .zby-page-content p,
.zby-page-about .zby-page-content p {
  color: #fff;
  margin: 0 0 8px !important;
  font-size: clamp(15px, 1.15vw, 20px) !important;
  line-height: 1.3 !important;
  text-align: center !important;
}

.zby-page-contact .zby-contact-layout {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  width: max-content;
  max-width: calc(100vw - 48px);
}

.zby-page-contact .zby-contact-email {
  margin: 0 !important;
  text-align: left !important;
  white-space: nowrap;
  line-height: 2 !important;
}

.zby-page-contact .zby-contact-social {
  text-align: left;
  white-space: nowrap;
}

.zby-page-contact .zby-contact-social p {
  margin: 0 !important;
  text-align: left !important;
  line-height: 2 !important;
}

.zby-about-shell {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vh, 56px) 0 clamp(42px, 7vh, 72px);
  display: grid;
  gap: clamp(28px, 5vh, 46px);
  align-content: start;
}

.zby-about-copy {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin-top: 0;
  transform: translateY(-34px);
}

.zby-talk-panel {
  width: min(860px, 100%);
  margin: 0 auto;
  transform: translateY(34px);
  text-align: left;
}

.zby-talk-panel-header {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.zby-talk-title {
  margin: 0;
  color: #e7eeff;
  font-size: clamp(17px, 1.2vw, 21px);
  font-family: "DejaVu Sans Mono", "Consolas", "Liberation Mono", monospace;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.zby-talk-screen {
  border: 1px solid rgba(132, 156, 203, 0.28);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(15, 19, 28, 0.96), rgba(9, 12, 18, 0.96)),
    radial-gradient(circle at top left, rgba(64, 98, 164, 0.14), transparent 48%);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  padding: clamp(18px, 2vw, 26px);
}

.zby-talk-lines {
  display: grid;
  gap: 6px;
  min-height: 168px;
  align-content: start;
  grid-auto-rows: max-content;
}

.zby-talk-line {
  display: block;
  align-items: start;
  font-family: "DejaVu Sans Mono", "Consolas", "Liberation Mono", monospace;
  font-size: clamp(12px, 0.95vw, 14px);
  line-height: 1.45;
  letter-spacing: 0.01em;
  transition: opacity 0.42s ease, transform 0.42s ease;
  text-align: left;
}

.zby-talk-line.is-hidden {
  opacity: 0;
  transform: translateY(12px);
}

.zby-talk-line.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.zby-talk-line.is-latest {
  color: #f4f8ff;
}

.zby-talk-line:not(.is-latest) {
  opacity: 0.58;
}

.zby-talk-meta {
  display: block;
  text-align: left;
}

.zby-talk-time {
  color: #00ff00;
}

.zby-talk-prompt {
  color: #00ff00;
}

.zby-talk-text {
  color: #f4f8ff;
  word-break: break-word;
}

.zby-talk-line.is-latest .zby-talk-text {
  min-height: 1.45em;
}

.zby-talk-line:not(.is-latest) .zby-talk-time,
.zby-talk-line:not(.is-latest) .zby-talk-prompt {
  color: rgba(0, 255, 0, 0.58);
}

.zby-talk-line:not(.is-latest) .zby-talk-text {
  color: rgba(244, 248, 255, 0.58);
}

.zby-talk-cursor {
  display: inline-block;
  width: 0.8ch;
  margin-left: 2px;
  opacity: 0;
}

.zby-talk-line.is-complete .zby-talk-cursor,
.zby-talk-cursor.is-visible {
  opacity: 1;
  animation: zby-talk-cursor-blink 1s steps(1, end) infinite;
}

.zby-talk-empty {
  color: #00ff00;
  font-family: "DejaVu Sans Mono", "Consolas", "Liberation Mono", monospace;
  font-size: 14px;
}

@keyframes zby-talk-cursor-blink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

.zby-page-collection .zby-page-content {
  display: flex;
  align-items: stretch;
}

.zby-page-collection .collection-slider {
  margin: 0 auto !important;
  max-width: min(1120px, 100%) !important;
  width: 100%;
  height: 100%;
}

.zby-page-collection .collection-slider-stage {
  min-height: 0;
  flex: 1;
  padding-top: clamp(34px, 4.2vh, 52px) !important;
}

.zby-page-collection .collection-slider-figure img {
  max-height: min(82vh, calc(100vh - 150px)) !important;
}

.zby-page-collection .collection-slider-meta {
  position: absolute !important;
  right: 0 !important;
  top: 0 !important;
  left: auto !important;
  margin: 0 !important;
  text-align: right !important;
  justify-content: flex-end !important;
  pointer-events: auto !important;
  z-index: 160 !important;
}

.zby-page-collection .collection-slider-year {
  top: 0 !important;
  left: 0 !important;
  background: #000000 !important;
  color: #f4f4f4 !important;
  border: 1px solid #4d4d4d !important;
}

.zby-page-collection .collection-slider-btn.prev {
  left: clamp(8px, 1.2vw, 16px) !important;
  z-index: 220 !important;
  pointer-events: auto !important;
}

.zby-page-collection .collection-slider-btn.next {
  right: clamp(8px, 1.2vw, 16px) !important;
  z-index: 220 !important;
  pointer-events: auto !important;
}

.zby-page-icp {
  position: fixed;
  right: clamp(10px, 1.2vw, 18px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  color: #a8aeb9;
  font-size: clamp(11px, 0.75vw, 12px);
  line-height: 1;
  z-index: 30;
}

.zby-page-icp:hover,
.zby-page-icp:focus-visible {
  color: #c5cad3;
}

@media (max-width: 900px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 18px;
  }

  .site-nav {
    font-size: 16px;
    gap: 14px;
    flex-wrap: wrap;
  }

  .content-wrap {
    margin-bottom: 28px;
  }

  .content-card {
    border-radius: 14px;
    padding: 16px;
  }

  .zby-split-page {
    display: grid;
    grid-template-rows: 20% 80%;
  }

  .zby-page-accent {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: none;
    background-image: url("./split-accent-bg-mobile.webp");
    background-position: center center;
    justify-content: flex-start;
    align-items: flex-end;
    padding: 16px 20px;
  }

  .zby-page-title {
    text-align: left;
    font-size: clamp(46px, 13vw, 62px);
  }

  .zby-page-main {
    margin-left: 0;
    min-height: 0;
    padding: 8px 12px 14px;
  }

  .zby-page-nav {
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 4px;
  }

  .zby-page-domain {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .zby-page-nav-item {
    font-size: 13px;
  }

  .zby-home-landing-stage {
    width: calc(100vw - 12px);
    padding-top: 12px;
    padding-bottom: 10px;
  }

  .zby-home-landing-nav {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0 clamp(4px, 1.5vw, 10px);
    font-size: clamp(11px, 3.5vw, 16px);
    letter-spacing: clamp(0.01em, 0.18vw, 0.06em);
    min-height: 32px;
    width: 100%;
  }

  .zby-home-landing-nav a,
  .zby-home-landing-nav .sep {
    flex: 0 0 auto;
  }

  .zby-home-landing-type {
    max-width: calc(100vw - 34px);
  }

  .zby-home-landing-line.domain {
    font-size: clamp(28px, 7.6vw, 36px);
  }

  .zby-home-landing-line.welcome {
    font-size: clamp(36px, 9.6vw, 44px);
  }

  .zby-home-landing-line + .zby-home-landing-line {
    margin-top: 16px;
  }

  .zby-home-landing-gradient-top {
    height: 150px;
  }

  .zby-home-landing-gradient-bottom {
    height: 132px;
  }

  .zby-home-landing-footer {
    font-size: 12px;
    line-height: 1.75;
    gap: 0 0.35em;
  }

  .zby-page-content {
    overflow: auto;
  }

  .zby-page-collection .zby-page-content {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .zby-page-collection .zby-mobile-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 6px;
    position: relative;
    z-index: 180;
  }

  .zby-page-collection .zby-mobile-controls .collection-slider-year,
  .zby-page-collection .zby-mobile-controls .zby-nav-year {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    margin: 0 !important;
    background: #000000 !important;
    color: #f4f4f4 !important;
    border: 1px solid #4d4d4d !important;
    height: 34px !important;
  }

  .zby-page-collection .zby-mobile-controls .collection-slider-meta,
  .zby-page-collection .zby-mobile-controls .zby-nav-meta {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    margin: 0 !important;
    z-index: 181 !important;
    text-align: right !important;
    justify-content: flex-end !important;
    align-items: center !important;
    display: inline-flex !important;
  }

  .zby-page-collection .zby-mobile-controls .collection-slider-meta-jump {
    display: inline-flex !important;
  }

  .zby-page-collection .zby-mobile-controls .collection-slider-meta-jump input::placeholder {
    color: transparent;
  }

  .zby-page-collection .collection-slider {
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .zby-page-contact .zby-contact-layout {
    max-width: calc(100vw - 40px);
  }

  .zby-about-shell {
    width: 100%;
    gap: 28px;
    padding-bottom: 46px;
  }

  .zby-about-copy {
    margin-top: -20px;
    transform: none;
  }

  .zby-talk-panel {
    width: 100%;
    transform: none;
  }

  .zby-talk-line {
    display: block;
    font-size: 12px;
  }

  .zby-talk-time {
    font-size: 11px;
  }

  .zby-page-contact .zby-contact-email,
  .zby-page-contact .zby-contact-social,
  .zby-page-contact .zby-contact-social p {
    white-space: normal;
  }

  .zby-page-collection .collection-slider-btn {
    display: none !important;
  }

  .zby-page-collection .collection-slider-stage {
    min-height: 0 !important;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    padding-top: 0 !important;
  }
}

@media (max-width: 360px) {
  .zby-home-landing-nav {
    gap: 0 4px;
    font-size: 11px;
    letter-spacing: 0.01em;
  }
}
