/* Homepage: full fantasy background, left action rail, bottom dock. */

html:has(body.landing-page) {
  height: 100%;
  overflow: hidden;
}

.landing-page {
  box-sizing: border-box;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  color: #17345f;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  background: #dceafa url("assets/images/backgrounds/home/home-main-bg-title.jpg?v=20260819-bg-compress-v1") center center / cover fixed no-repeat !important;
  overflow: hidden;
}

.landing-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(90deg, rgba(12, 20, 35, 0.22), transparent 26%, transparent 74%, rgba(12, 20, 35, 0.12));
  pointer-events: none;
}

.landing-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(12, 20, 35, 0.18));
  pointer-events: none;
}

.landing-page *,
.landing-page *::before,
.landing-page *::after {
  box-sizing: border-box;
  text-shadow: none !important;
}

.landing-rail {
  position: fixed;
  left: 0;
  top: 50%;
  z-index: 20;
  width: 92px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 8px;
  max-height: calc(100vh - 196px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  border: 2px solid rgba(54, 72, 101, 0.42);
  border-left: 0;
  border-radius: 0 20px 20px 0;
  background: linear-gradient(180deg, rgba(41, 55, 78, 0.88), rgba(31, 44, 65, 0.9));
  box-shadow:
    0 14px 26px rgba(23, 43, 70, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  pointer-events: auto;
  transform: translateY(-50%);
}

.landing-rail-btn {
  display: grid;
  grid-template-rows: 38px auto;
  place-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 74px;
  padding: 8px 5px 7px;
  border: 2px solid rgba(12, 20, 34, 0.3);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(70, 88, 119, 0.92), rgba(36, 51, 76, 0.96));
  box-shadow:
    0 3px 0 rgba(10, 17, 31, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.landing-rail-btn img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.2));
}

.landing-rail-btn strong {
  max-width: 100%;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.landing-rail-btn:hover,
.landing-rail-btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
  filter: brightness(1.04);
}

body.home-update-open {
  overflow: hidden;
}

.landing-update-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 18px;
}

.landing-update-modal[hidden] {
  display: none !important;
}

.landing-update-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 20, 38, 0.44);
  backdrop-filter: blur(10px);
}

.landing-update-card {
  position: relative;
  z-index: 1;
  width: min(580px, calc(100vw - 28px));
  padding: 18px;
  border: 2px solid rgba(117, 145, 194, 0.46);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 243, 251, 0.96)),
    #f7fbff;
  box-shadow:
    0 20px 40px rgba(15, 24, 41, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.landing-update-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.landing-update-head p {
  margin: 0;
  color: #4e7fcb;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.landing-update-head h2 {
  margin: 6px 0 0;
  color: #17345f;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1;
  font-weight: 1000;
}

.landing-update-close {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(117, 145, 194, 0.42);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #e9f1fb);
  color: #17345f;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.landing-update-text {
  margin: 14px 0 0;
  color: #496b9a;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
}

.landing-update-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.landing-update-list div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid rgba(117, 145, 194, 0.28);
  border-radius: 14px;
  background: rgba(235, 243, 251, 0.76);
}

.landing-update-list span {
  color: #4e7fcb;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.landing-update-list strong {
  min-width: 0;
  color: #17345f;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

@media (max-width: 700px) {
  .landing-page {
    background-position: center center !important;
  }

  .landing-rail {
    width: 78px;
    max-height: calc(100vh - 174px - env(safe-area-inset-bottom, 0px));
    gap: 6px;
    padding: 6px;
    border-radius: 0 16px 16px 0;
  }

  .landing-rail-btn {
    grid-template-rows: 30px auto;
    min-height: 62px;
    padding: 6px 3px 5px;
    border-radius: 12px;
  }

  .landing-rail-btn img {
    width: 30px;
    height: 30px;
  }

  .landing-rail-btn strong {
    font-size: 10px;
  }

  .landing-update-card {
    width: calc(100vw - 16px);
    padding: 14px;
    border-radius: 18px;
  }

  .landing-update-list div {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 8px;
    padding: 9px 10px;
  }

  .landing-update-list span {
    font-size: 11px;
  }

  .landing-update-list strong {
    font-size: 12px;
  }

}

@media (orientation: landscape) {
  .landing-page {
    background-image: url("assets/images/backgrounds/home/home-main-bg-landscape.jpg?v=20260819-bg-compress-v1") !important;
  }
}

@media (min-width: 1180px) {
  .landing-rail {
    width: 104px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-rail-btn {
    transition: none;
  }
}


/* Blocking account-expiry prompt. It intentionally has no close path. */
body.landing-expired-open { overflow: hidden; }
.landing-expired-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
}
.landing-expired-modal[hidden] { display: none !important; }
.landing-expired-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 17, 31, 0.30);
  backdrop-filter: blur(8px);
}
.landing-expired-card {
  position: relative;
  z-index: 1;
  width: min(430px, calc(100vw - 32px));
  padding: 28px 22px 22px;
  border: 3px solid #d6a64e;
  border-radius: 18px;
  text-align: center;
  color: #17345f;
  background: linear-gradient(180deg, #fffdf5, #edf5ff);
  box-shadow: 0 22px 48px rgba(5, 14, 30, 0.42), inset 0 0 0 2px rgba(255, 255, 255, 0.84);
}
.landing-expired-card h2 { margin: 0; font-size: 24px; }
.landing-expired-card p { margin: 12px 0 20px; font-size: 15px; font-weight: 800; }
.landing-expired-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.landing-expired-card button {
  flex: 1 1 0;
  width: auto;
  max-width: 180px;
  min-height: 46px;
  border: 2px solid #9c6d20;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(180deg, #eab84f, #b97518);
  box-shadow: 0 3px 0 #75480d;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}/* Two-column quick actions: learning modes on the left, tools and account on the right. */
.landing-rail{
  width:190px;
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-template-areas:
    "sentence textbook"
    "adventure catalog"
    "home update"
    ". account";
}
.landing-rail-btn:nth-child(1){grid-area:textbook}
.landing-rail-btn:nth-child(2){grid-area:sentence}
.landing-rail-btn:nth-child(3){grid-area:adventure}
.landing-rail-btn:nth-child(4){grid-area:home}
.landing-rail-btn:nth-child(5){grid-area:catalog}
.landing-rail-btn:nth-child(6){grid-area:update}
.landing-rail-btn:nth-child(7){grid-area:account}
@media(max-width:700px){
  .landing-rail{
    width:166px;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px;
    padding:6px;
  }
  .landing-rail-btn{min-height:62px;padding:6px 3px 5px}
}/* Split quick actions into independent left and right rails. */
.landing-rail{
  width:92px;
  grid-template-columns:1fr;
  grid-template-areas:none;
}
.landing-rail-btn:nth-child(1),
.landing-rail-btn:nth-child(2),
.landing-rail-btn:nth-child(3),
.landing-rail-btn:nth-child(4),
.landing-rail-btn:nth-child(5),
.landing-rail-btn:nth-child(6),
.landing-rail-btn:nth-child(7){grid-area:auto}
.landing-rail-right{
  left:auto;
  right:0;
  border-left:2px solid rgba(54,72,101,.42);
  border-right:0;
  border-radius:20px 0 0 20px;
}
@media(max-width:700px){
  .landing-rail{width:78px}
}
@media(min-width:1180px){
  .landing-rail{width:104px}
}

.home-guide-hidden { display: none !important; }
.home-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}
.home-guide-dim {
  position: fixed;
  z-index: 5000;
  pointer-events: auto;
  background: rgba(16, 44, 78, 0.48);
}
.home-guide-spotlight {
  position: fixed;
  z-index: 5001;
  pointer-events: none;
  border: 2px solid rgba(255, 222, 99, 0.98);
  border-radius: 12px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.72), 0 0 18px rgba(255, 222, 99, 0.72);
  animation: homeGuideSpotlightPulse 0.95s ease-in-out infinite alternate;
}
@keyframes homeGuideSpotlightPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.18); }
}
.home-guide-arrow {
  position: fixed;
  z-index: 5003;
  width: 28px;
  height: 28px;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(35, 92, 155, 0.28));
}
.home-guide-arrow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
}
.home-guide-arrow.up::before { border-bottom: 27px solid #6bb6ff; }
.home-guide-arrow.down::before { border-top: 27px solid #6bb6ff; }
.home-guide-card {
  position: fixed;
  z-index: 5004;
  max-width: calc(100vw - 28px);
  padding: 16px;
  border: 2px solid rgba(117, 174, 235, 0.92);
  border-radius: 14px;
  color: #21476f;
  background: linear-gradient(180deg, #ffffff, #eaf6ff);
  box-shadow: 0 18px 34px rgba(37, 92, 150, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.92);
  pointer-events: auto;
}
.home-guide-step { margin: 0 0 4px; color: #3b82d6; font-size: 12px; font-weight: 900; }
.home-guide-title { margin: 0 0 7px; color: #1f5ea9; font-size: 20px; line-height: 1.2; }
.home-guide-text { margin: 0; color: #21476f; font-size: 14px; font-weight: 800; line-height: 1.5; }
.home-guide-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.home-guide-actions button {
  min-height: 36px;
  padding: 7px 14px;
  border: 2px solid rgba(96, 151, 216, 0.9);
  border-radius: 10px;
  color: #275b96;
  background: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.home-guide-actions .home-guide-next { color: #ffffff; background: #3b82d6; }
@media (max-width: 540px) {
  .home-guide-card { padding: 14px; }
  .home-guide-title { font-size: 18px; }
  .home-guide-text { font-size: 13px; }
}
