/* Shared navigation and story-workshop styling across the main and dream routes. */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 205px;
  min-height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

main {
  min-width: 0;
  margin-left: 205px;
}

.dream main {
  margin-left: 205px;
}

.rail nav a {
  min-height: 43px;
  white-space: nowrap;
}

.rail nav a.active {
  background: linear-gradient(100deg, #f0e2e2, #f5ebea);
  box-shadow: inset 2px 0 #a45e72;
}

.brandmark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.dream-hall {
  padding-bottom: 44px;
}

.dream-setup {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
  gap: 20px;
  align-items: stretch;
  margin: 12px 0 28px;
}

.dream-cover,
.dream-setup > form {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #eadbd9;
  border-radius: 20px;
  background: #fffdfa;
  box-shadow: 0 9px 28px #603b460b;
}

.dream-cover {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: end;
  isolation: isolate;
  padding: clamp(22px, 4vw, 42px);
  background: linear-gradient(145deg, #eee0de, #f5e9df);
}

.dream-cover img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 36%;
}

.dream-cover::after {
  content: "";
  position: absolute;
  inset: 25% 0 0;
  z-index: -1;
  background: linear-gradient(0deg, #382a31c9, #382a3100);
}

.dream-cover > div {
  max-width: 35em;
  color: #fffaf6;
}

.dream-cover small {
  color: #f6dedc;
  font-size: 12px;
  letter-spacing: .08em;
}

.dream-cover h1 {
  margin: 6px 0 10px;
  font-family: Georgia, "Songti SC", SimSun, serif;
  font-size: clamp(28px, 3.3vw, 40px);
  letter-spacing: .02em;
}

.dream-cover p {
  display: -webkit-box;
  max-width: 32em;
  overflow: hidden;
  color: #fff5f0;
  font-size: 14px;
  line-height: 1.8;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.dream-setup > form {
  align-content: start;
  padding: clamp(18px, 2.5vw, 28px);
}

.dream-setup > form h2 {
  margin-bottom: 1px;
  color: #563b48;
  font-family: Georgia, "Songti SC", SimSun, serif;
  font-size: 25px;
}

.dream-setup > form::before {
  content: "把此刻想说的话，慢慢写进故事里。";
  margin: -5px 0 7px;
  color: #95828a;
  font-size: 12px;
}

.dream-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.dream-modes legend {
  margin-bottom: 8px;
  color: #5f4b55;
  font-size: 13px;
}

.dream-modes label {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #eadbd9;
  border-radius: 18px;
  background: #fbf4f1;
  color: #765c68;
  font-size: 12px;
}

.dream-modes input {
  width: auto;
  accent-color: #955267;
}

.custom-story {
  gap: 12px;
  padding: 13px;
  border: 1px solid #eee1df;
  border-radius: 13px;
  background: #fcf7f4;
}

.route-entry {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #eee3df;
  border-radius: 14px;
  background: #fffdfa;
  box-shadow: 0 3px 12px #54313a05;
}

.route-entry:hover {
  border-color: #dfc7ca;
  background: #fffaf8;
}

.route-entry img {
  width: 112px;
  height: 76px;
  border-radius: 9px;
  object-fit: cover;
}

.route-entry div {
  min-width: 0;
}

.route-entry small,
.route-entry p,
.route-entry time {
  color: #8b7880;
  font-size: 11px;
}

.route-entry b {
  display: block;
  overflow: hidden;
  margin: 3px 0;
  color: #503943;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-entry p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1050px) {
  .rail { width: 176px; }
  main { margin-left: 176px; }
  .dream main { margin-left: 176px; }
  .dream-setup { grid-template-columns: minmax(0, 1fr) minmax(280px, .95fr); }
}

@media (max-width: 760px) {
  .rail {
    inset: 0 auto 0 0;
    width: 64px;
    height: 100dvh;
    min-height: 100dvh;
    padding: 14px 7px;
    border: 0;
    border-right: 1px solid #eadeda;
    background: #fcf7f3f7;
  }

  .rail .brand {
    justify-content: center;
    margin: 0 0 24px;
  }

  .rail .brand > span,
  .rail-note {
    display: none;
  }

  .rail .brandmark {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 13px;
    font-size: 21px;
  }

  .rail nav {
    display: grid;
    justify-content: stretch;
    gap: 7px;
  }

  .rail nav a {
    position: relative;
    display: grid;
    min-height: 44px;
    place-items: center;
    gap: 0;
    padding: 4px;
    border-radius: 12px;
  }

  .rail nav a span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .rail nav a.active {
    background: #f0e2e2;
    box-shadow: inset 0 0 0 1px #e7d1d3;
  }

  .rail nav i {
    width: auto;
    font-size: 21px;
  }

  main {
    min-height: 100dvh;
    margin: 0 0 0 64px;
  }

  .dream main { margin: 0 0 0 64px; }

  .top,
  #view {
    padding-right: 12px;
    padding-left: 12px;
  }

  .top { height: 58px; }
  .top-left { gap: 0; }
  .home-shortcut { display: none; }
  .mobile-brand { display: block; }

  .dream-setup {
    grid-template-columns: 1fr;
    gap: 11px;
    margin-top: 5px;
  }

  .dream-cover { min-height: 250px; border-radius: 15px; }
  .dream-setup > form { padding: 17px; border-radius: 15px; }

  .route-entry {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 9px;
    padding: 8px;
  }

  .route-entry img { width: 78px; height: 67px; }
  .route-entry time { display: none; }
  .dream-hall { padding-bottom: 20px; }
}
