/* ============================================
   HOME — 俯视桌面拼贴（参考 p1 / p2）
   键盘 + 奶油名片 + 手账笔记本 + 黄便签 + 格纹布
   ============================================ */

.home-page {
  position: relative;
  min-height: calc(100vh - var(--menu-bar-h));
  min-height: calc(100svh - var(--menu-bar-h));
  padding: var(--sp-4) var(--sp-5) 96px;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

/* 桌面底：奶油 + 草地边缘 */
.home-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(194, 214, 162, .34) 0%, rgba(250, 245, 233, 0) 22%),
    linear-gradient(0deg, rgba(157, 187, 120, .38) 0%, rgba(250, 245, 233, 0) 18%);
}

.home-scene {
  position: relative;
  width: 100%;
  max-width: 1120px;
  min-height: clamp(600px, 76vh, 840px);
  margin: 0 auto;
}

/* ———— 格纹布 ———— */
.scene-cloth {
  position: absolute;
  right: 1%;
  top: 6%;
  width: 38%;
  height: 54%;
  border-radius: 10px;
  transform: rotate(5deg);
  background-color: #FDF6F2;
  background-image:
    linear-gradient(90deg, rgba(214, 87, 78, .42) 50%, transparent 50%),
    linear-gradient(rgba(214, 87, 78, .42) 50%, transparent 50%);
  background-size: 54px 54px;
  box-shadow: 0 18px 44px rgba(90, 72, 48, .16);
  opacity: .9;
}

/* ———— 键盘 / MacBook ———— */
.scene-keyboard {
  position: absolute;
  left: 1%;
  top: -2%;
  width: 60%;
  z-index: 2;
  padding: 18px 20px 22px;
  border-radius: 16px;
  background: linear-gradient(160deg, #3A3A3C 0%, #2C2C2E 55%, #38383A 100%);
  box-shadow: 0 16px 40px rgba(50, 40, 30, .28), inset 0 1px 0 rgba(255,255,255,.10);
  transform: rotate(-4deg);
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med);
  display: block;
}
.scene-keyboard:hover {
  transform: rotate(-2.4deg) translateY(-4px);
  box-shadow: 0 24px 54px rgba(50, 40, 30, .32), inset 0 1px 0 rgba(255,255,255,.12);
}
.scene-keyboard:active { transform: rotate(-2deg) translateY(0) scale(.995); }

.kb-rows { display: flex; flex-direction: column; gap: 5px; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.kb-key {
  flex: 1 1 auto;
  height: 24px;
  min-width: 14px;
  border-radius: 4px;
  background: linear-gradient(180deg, #4A4A4C, #38383A);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.07);
}
.kb-key.is-wide { flex: 1.6 1 auto; }
.kb-key.is-space { flex: 4 1 auto; }
.kb-trackpad {
  margin: 14px auto 0;
  width: 42%;
  height: 52px;
  border-radius: 6px;
  background: linear-gradient(180deg, #46423D, #3C3833);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.4);
}
.kb-hint {
  position: absolute;
  left: 50%;
  bottom: -13px;
  transform: translateX(-50%) rotate(2deg);
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 11.5px;
  padding: 3px 12px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(120,100,72,.16);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

/* ———— 奶油名片（Creative Licence） ———— */
.licence-card {
  position: absolute;
  left: 25%;
  top: 25%;
  z-index: 6;
  width: clamp(280px, 32%, 372px);
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(145deg, #FFFDF6, #FFF6DC);
  border: 1px solid rgba(120, 100, 72, .18);
  box-shadow: 0 22px 50px rgba(90, 72, 48, .24), 0 3px 10px rgba(90,72,48,.10);
  transform: rotate(-4.5deg);
  transition: transform var(--dur-med) var(--ease-spring), box-shadow var(--dur-med);
  display: block;
  color: var(--ink);
}
.licence-card:hover {
  transform: rotate(-1.5deg) translateY(-8px) scale(1.015);
  box-shadow: 0 30px 64px rgba(90, 72, 48, .28), 0 6px 16px rgba(90,72,48,.12);
}
.licence-card:active { transform: rotate(-1deg) translateY(-2px) scale(.995); }

.lc-head {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 2px;
}
.lc-title {
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.1vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.15;
  margin-bottom: 2px;
}
.lc-sub {
  text-align: center;
  font-family: var(--font-hand);
  font-size: 13px;
  color: var(--olive);
  margin-bottom: 10px;
}
.lc-divider {
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(120,100,72,.35) 0 5px, transparent 5px 10px);
  margin: 0 6px 10px;
}
.lc-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.lc-photo-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 78px;
}
.lc-photo {
  width: 78px;
  height: 88px;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(90,72,48,.18);
  position: relative;
  z-index: 2;
  background: var(--blush-soft);
}
.lc-photo-wrap::before {
  content: "";
  position: absolute;
  inset: -3px -3px 5px -3px;
  background:
    repeating-linear-gradient(0deg, rgba(140,170,190,.35) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(90deg, rgba(140,170,190,.35) 0 1px, transparent 1px 14px),
    #FBF8EE;
  border-radius: 5px;
  z-index: 1;
}
.lc-fields { flex: 1; min-width: 0; }
.lc-field { margin-bottom: 7px; }
.lc-field .lf-label {
  display: block;
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 1px;
}
.lc-field .lf-value {
  display: block;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-mute);
}
.lc-field .lf-value::before {
  content: "▸ ";
  color: var(--sage);
  font-size: 9px;
}
.lc-script {
  font-family: var(--font-hand);
  font-size: 14px;
  color: var(--red);
  border-bottom: 2px solid rgba(214, 87, 78, .55);
  border-radius: 50%;
  padding-bottom: 6px;
  display: inline-block;
  line-height: 1;
}
.lc-stamp {
  position: absolute;
  right: -12px;
  top: -14px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(214, 87, 78, .5);
  background: rgba(253, 250, 242, .72);
  color: rgba(214, 87, 78, .82);
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.15;
  transform: rotate(12deg);
  box-shadow: 0 3px 10px rgba(90, 72, 48, .16);
}

/* ———— 手账笔记本 ———— */
.scene-notebook {
  position: absolute;
  left: -1%;
  bottom: 0;
  z-index: 4;
  width: 53%;
  padding: 26px 30px 24px;
  border-radius: 8px 14px 10px 8px;
  background:
    linear-gradient(180deg, #FFFDF7, #FBF6EA);
  border: 1px solid rgba(120,100,72,.15);
  box-shadow: 0 20px 46px rgba(90, 72, 48, .20);
  transform: rotate(-1.6deg);
}
.scene-notebook::before {
  content: "";
  position: absolute;
  inset: 12px 0 0 0;
  background: repeating-linear-gradient(180deg,
    transparent 0 27px,
    rgba(150, 175, 195, .28) 27px 28px);
  pointer-events: none;
  border-radius: inherit;
}
.scene-notebook::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(214, 87, 78, .28);
}
.nb-inner { position: relative; z-index: 2; }
.nb-hello {
  font-family: var(--font-sans);
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-weight: 800;
  color: var(--olive);
  letter-spacing: -.02em;
  line-height: 1.05;
  margin-bottom: 8px;
  transform: rotate(-1deg);
  display: inline-block;
}
.nb-text {
  font-family: var(--font-hand);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 34ch;
  margin-bottom: 14px;
}
.nb-text strong { color: var(--ink); }
.nb-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}
.nb-links .sticky {
  font-size: 13px;
  padding: 8px 14px;
  display: inline-block;
}
.nb-note {
  font-family: var(--font-hand);
  font-size: 12px;
  color: var(--ink-faint);
  transform: rotate(-2deg);
}

/* ———— 耳机 ———— */
.scene-earphones {
  position: absolute;
  right: clamp(0%, 2%, 4%);
  top: -4%;
  z-index: 5;
  width: clamp(120px, 19vw, 250px);
  transform: rotate(7deg);
  pointer-events: none;
}
.scene-earphones::before {
  /* 桌面投影：一个压扁的椭圆影子，放在耳机下方 */
  content: "";
  position: absolute;
  left: 6%;
  bottom: 4%;
  width: 68%;
  height: 22px;
  background: radial-gradient(ellipse at center, rgba(45, 38, 25, .26) 0%, rgba(45, 38, 25, 0) 70%);
  filter: blur(4px);
  z-index: -1;
}
.scene-earphones img { width: 100%; height: auto; display: block; }
.scene-earphones .with-bg   { mix-blend-mode: multiply; }  /* 带白底的 jpg 用 multiply 融合桌面 */
.scene-earphones .cutout    { filter: drop-shadow(0 10px 16px rgba(60, 50, 30, .18)); }

/* ———— 眼镜 ———— */
.scene-glasses {
  position: absolute;
  right: clamp(0%, 2%, 4%);
  bottom: 2%;
  z-index: 5;
  width: clamp(90px, 15vw, 190px);
  transform: rotate(-6deg);
  pointer-events: none;
}
.scene-glasses::before {
  content: "";
  position: absolute;
  left: 8%;
  bottom: 40%;
  width: 60%;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(50, 40, 22, .24) 0%, rgba(50, 40, 22, 0) 70%);
  filter: blur(3px);
  z-index: -1;
}
.scene-glasses img { width: 100%; height: auto; display: block; }
.scene-glasses .with-bg  { mix-blend-mode: multiply; }
.scene-glasses .cutout   { filter: drop-shadow(0 7px 12px rgba(60, 50, 30, .16)); }

/* ———— 鼠标 ———— */
.scene-mouse {
  position: absolute;
  right: clamp(3%, 6%, 10%);
  bottom: 30%;
  z-index: 5;
  width: clamp(70px, 12vw, 150px);
  transition: transform var(--dur-med) var(--ease-spring);
}
.scene-mouse::before {
  content: "";
  position: absolute;
  left: 10%;
  bottom: 10%;
  width: 60%;
  height: 14px;
  background: radial-gradient(ellipse at center, rgba(40, 32, 20, .30) 0%, rgba(40, 32, 20, 0) 72%);
  filter: blur(3px);
  z-index: -1;
}
.scene-mouse img { width: 100%; height: auto; display: block; }
.scene-mouse .with-bg  { mix-blend-mode: multiply; }
.scene-mouse .cutout   { filter: drop-shadow(0 10px 16px rgba(40, 32, 20, .22)); }
.scene-mouse:hover { transform: translateY(-8px) scale(1.08) rotate(-3deg); }
.scene-mouse:active { transform: translateY(-2px) scale(1.02); }

/* ———— 角落闪片 ———— */
.scene-spark-1 { right: 33%; top: 8%; width: 24px; height: 24px; color: var(--red); }
.scene-spark-2 { left: 63%; bottom: 34%; width: 16px; height: 16px; color: var(--purple); }

/* =========== 响应式：平板 =========== */
@media (max-width: 980px) {
  .home-scene { min-height: clamp(520px, 68vh, 700px); }
  .scene-keyboard { width: 66%; }
  .licence-card { left: 22%; top: 27%; width: clamp(240px, 38%, 330px); }
  .scene-notebook { width: 58%; }
  /* 物品不再硬改 width，clamp 连续缩放 */
}

/* =========== 响应式：手机 → 纵向流式 =========== */
@media (max-width: 720px) {
  .home-page { padding: var(--sp-4) var(--sp-4) 88px; overflow: visible; }
  .home-scene {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    min-height: 0;
    align-items: stretch;
  }
  .scene-cloth {
    position: absolute;
    inset: 0 -8% auto -8%;
    width: auto;
    height: 220px;
    transform: none;
    border-radius: 0 0 28px 28px;
    opacity: .8;
  }
  .scene-keyboard,
  .scene-earphones,
  .scene-glasses,
  .scene-spark-1,
  .scene-spark-2 { display: none; }

  .licence-card {
    position: relative;
    left: auto; top: auto;
    width: 100%;
    transform: rotate(-1.2deg);
    margin-top: 140px;
  }
  .licence-card:hover { transform: rotate(-.4deg) translateY(-4px); }

  .scene-notebook {
    position: relative;
    left: auto; bottom: auto;
    width: 100%;
    transform: rotate(.6deg);
    padding: 22px 20px;
  }
  .scene-mouse {
    position: absolute;
    right: 20px;
    top: 140px;
    bottom: auto;
    width: 70px;
    transform: none;
    z-index: 8;
  }
  .scene-mouse:hover { transform: translateY(-4px) scale(1.08); }
  .nb-text { font-size: 14px; max-width: none; }
  .nb-links { gap: 8px; }
  .nb-links .sticky { font-size: 12px; }
}

@media (max-width: 420px) {
  .lc-main { gap: 10px; }
  .lc-photo, .lc-photo-wrap { width: 64px; }
  .lc-photo { height: 76px; }
  .lc-shell { width: 64px; }
}
