/* 程猿猿门户 · 明-3c 庭院风 · 进页展卷 + 梅花轻飘 */

:root {
  --ink: #1a1a18;
  --muted: #5a5a52;
  --paper: #f7f1e4;
  --paper-edge: #e8dcc8;
  --jade: #6b8f71;
  --jade-deep: #4a6b52;
  --gold: #c4a35a;
  --gold-light: #e2c97a;
  --blush: #e8b4b8;
  --sky-top: #eef3e8;
  --sky-mid: #e4ebe0;
  --hill: #9bb89a;
  --hill-deep: #7a9a78;
  --font-display: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-ui: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--sky-top);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* —— 庭院背景 —— */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% 0%, rgba(232, 180, 184, 0.18), transparent 55%),
    linear-gradient(180deg, #f3f6ef 0%, var(--sky-mid) 45%, #dfe8d8 100%);
  pointer-events: none;
}

.hills {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(42vh, 320px);
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 80% at 20% 100%, var(--hill) 0%, transparent 70%),
    radial-gradient(ellipse 70% 70% at 75% 110%, var(--hill-deep) 0%, transparent 65%),
    radial-gradient(ellipse 50% 50% at 50% 120%, #b7c9b0 0%, transparent 60%);
  opacity: 0.55;
}

.branch {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  width: min(42vw, 280px);
  height: min(42vw, 280px);
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.9;
}

.branch-tr {
  top: -2%;
  right: -2%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath d='M180 10 Q140 40 120 90 Q100 130 60 160' fill='none' stroke='%234a3a2a' stroke-width='3'/%3E%3Cpath d='M120 90 Q150 80 170 100' fill='none' stroke='%234a3a2a' stroke-width='2'/%3E%3Ccircle cx='105' cy='70' r='7' fill='%23e8b4b8'/%3E%3Ccircle cx='125' cy='55' r='6' fill='%23f0c4c8'/%3E%3Ccircle cx='95' cy='95' r='6' fill='%23e8b4b8'/%3E%3Ccircle cx='140' cy='95' r='5' fill='%23d49aa0'/%3E%3Ccircle cx='75' cy='120' r='6' fill='%23f0c4c8'/%3E%3Ccircle cx='55' cy='145' r='5' fill='%23e8b4b8'/%3E%3Ccircle cx='155' cy='45' r='5' fill='%23d49aa0'/%3E%3C/svg%3E");
}

.branch-bl {
  bottom: -4%;
  left: -4%;
  transform: scaleX(-1) rotate(8deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath d='M20 180 Q60 140 90 100 Q120 60 160 30' fill='none' stroke='%234a3a2a' stroke-width='3'/%3E%3Ccircle cx='70' cy='130' r='6' fill='%23e8b4b8'/%3E%3Ccircle cx='100' cy='95' r='7' fill='%23f0c4c8'/%3E%3Ccircle cx='130' cy='60' r='5' fill='%23d49aa0'/%3E%3Ccircle cx='85' cy='110' r='5' fill='%23e8b4b8'/%3E%3C/svg%3E");
}

.branch-br {
  bottom: -6%;
  right: -2%;
  width: min(36vw, 220px);
  height: min(36vw, 220px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath d='M190 190 Q150 150 110 120 Q70 90 40 50' fill='none' stroke='%234a3a2a' stroke-width='2.5'/%3E%3Ccircle cx='150' cy='160' r='6' fill='%23e8b4b8'/%3E%3Ccircle cx='120' cy='130' r='5' fill='%23f0c4c8'/%3E%3Ccircle cx='85' cy='100' r='6' fill='%23d49aa0'/%3E%3C/svg%3E");
}

/* —— 飘花 —— */
.petals {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -24px;
  width: 12px;
  height: 12px;
  border-radius: 70% 0 70% 0;
  background: radial-gradient(circle at 30% 30%, #f8d4d8, #e8a8ae 70%);
  opacity: 0.75;
  animation: petal-fall linear infinite;
  will-change: transform;
}

@keyframes petal-fall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0;
  }
  8% {
    opacity: 0.8;
  }
  100% {
    transform: translate3d(var(--drift, 40px), 110vh, 0) rotate(360deg);
    opacity: 0.15;
  }
}

/* —— 主内容 —— */
.page {
  position: relative;
  z-index: 3;
  max-width: 52rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
}

.hero {
  text-align: center;
}

.brand-mark {
  margin: 0 0 0.85rem;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.1;
}

.logo {
  display: block;
  width: min(42vw, 200px);
  height: auto;
  margin: 0 auto 0.65rem;
  filter: drop-shadow(0 6px 16px rgba(40, 50, 40, 0.12));
}

.name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: 0.18em;
}

/* —— 卷轴入口 —— */
.scrolls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  width: 100%;
  max-width: 40rem;
}

.scroll {
  --open-w: 11.5rem;
  position: relative;
  display: flex;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
  min-height: 3.4rem;
  flex: 1 1 11rem;
  max-width: 17rem;
}

.scroll:nth-child(2) {
  --open-w: 15.5rem;
  max-width: 20rem;
}

.scroll-roller {
  position: relative;
  z-index: 2;
  flex: 0 0 1.15rem;
  width: 1.15rem;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--gold) 0%,
    var(--gold-light) 25%,
    var(--jade) 50%,
    var(--gold-light) 75%,
    var(--gold) 100%
  );
  box-shadow:
    inset 2px 0 3px rgba(255, 255, 255, 0.35),
    inset -2px 0 3px rgba(0, 0, 0, 0.15),
    0 2px 6px rgba(0, 0, 0, 0.12);
}

.scroll-roller::before,
.scroll-roller::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1.45rem;
  height: 0.45rem;
  transform: translateX(-50%);
  border-radius: 3px;
  background: linear-gradient(90deg, #a88840, var(--gold-light), #a88840);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.scroll-roller::before {
  top: -0.2rem;
}

.scroll-roller::after {
  bottom: -0.2rem;
}

.scroll-paper {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0;
  overflow: hidden;
  margin-left: -2px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent 40%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 18px,
      rgba(180, 160, 120, 0.04) 18px,
      rgba(180, 160, 120, 0.04) 19px
    ),
    var(--paper);
  border: 1px solid var(--gold);
  border-left: none;
  border-radius: 0 6px 6px 0;
  box-shadow: 2px 3px 10px rgba(60, 50, 30, 0.08);
}

.scroll-label {
  padding: 0.85rem 1.1rem;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink);
  opacity: 0;
}

/* 进页自动展开一次 */
body.is-ready .scroll-paper {
  animation: unroll 1.15s cubic-bezier(0.22, 0.7, 0.25, 1) forwards;
  animation-delay: calc(0.25s + var(--i, 0) * 0.22s);
}

body.is-ready .scroll-label {
  animation: fade-in 0.45s ease forwards;
  animation-delay: calc(0.75s + var(--i, 0) * 0.22s);
}

@keyframes unroll {
  from {
    width: 0;
  }
  to {
    width: var(--open-w);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.scroll:hover .scroll-paper,
.scroll:focus-visible .scroll-paper {
  background-color: #faf6ec;
  border-color: var(--jade-deep);
}

.scroll:focus-visible {
  outline: 2px solid var(--jade-deep);
  outline-offset: 4px;
  border-radius: 8px;
}

/* 无动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .petal {
    animation: none !important;
    display: none;
  }

  body.is-ready .scroll-paper {
    animation: none;
    width: var(--open-w);
  }

  body.is-ready .scroll-label {
    animation: none;
    opacity: 1;
  }
}

@media (max-width: 560px) {
  .page {
    padding-top: 2rem;
    justify-content: flex-start;
  }

  .scrolls {
    flex-direction: column;
    align-items: center;
  }

  .scroll,
  .scroll:nth-child(2) {
    max-width: 100%;
    width: 100%;
  }

  .scroll:nth-child(2) {
    --open-w: min(15.5rem, 78vw);
  }

  .scroll {
    --open-w: min(11.5rem, 70vw);
  }

  .branch-bl,
  .branch-br {
    opacity: 0.55;
  }
}
