:root {
  color-scheme: light;
  --paper: #f8f6f0;
  --white: #fffdfa;
  --ink: #292822;
  --muted: #69675e;
  --red: #833d36;
  --line: #d7d2c5;
  --serif:
    "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun",
    Georgia, serif;
  --sans: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font: 16px/1.6 var(--sans);
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 288px;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #a46448;
  outline-offset: 3px;
}
h1,
h2,
h3,
p,
figure {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.35;
}
h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.85rem);
  font-weight: 650;
  letter-spacing: -0.055em;
}
h2 {
  font-size: 1.55rem;
}
h3 {
  font-size: 1.18rem;
}
time,
small,
.text-link,
.back {
  color: var(--muted);
  font-size: 0.88rem;
}
.ico {
  display: inline-block;
  vertical-align: middle;
  width: 1.12em;
  height: 1.12em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.loading {
  padding: 3rem;
}
.public-head,
.mast,
.content,
.site-foot,
.login-main {
  width: min(1220px, 90%);
  margin: auto;
}
.public-head,
.mast-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--ink);
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font: 700 clamp(1.2rem, 2.1vw, 1.75rem) / 1.3 var(--serif);
  letter-spacing: 0.02em;
}
.brand .ico,
.tiny-book .ico {
  background: var(--red);
  color: #fff8e8;
  padding: 0.35em;
  width: 1.35em;
  height: 1.35em;
  border-radius: 4px;
}
.locktag,
.mast-right,
.site-foot span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.locktag {
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
}
.login-main {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(305px, 0.8fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: center;
  padding: clamp(2rem, 5vh, 4rem) 0;
}
.login-cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 550px;
  height: clamp(550px, 71vh, 800px);
  background: #536052;
}
.login-cover img,
.feature > a > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.login-cover img {
  position: absolute;
  inset: 0;
  object-position: 49% 50%;
}
.login-cover:after,
.feature > a:after {
  content: "";
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(transparent, rgba(18, 22, 15, 0.72));
  pointer-events: none;
}
.login-cover figcaption,
.feature-caption {
  position: absolute;
  z-index: 1;
  left: 7%;
  bottom: 7%;
  color: #fffbed;
}
.login-cover figcaption span {
  display: block;
  font: 600 clamp(2.6rem, 4.45vw, 4.6rem) / 1.2 var(--serif);
  letter-spacing: -0.04em;
}
.login-cover i {
  display: block;
  margin-top: 0.5rem;
  font:
    italic 1.25rem/1.3 Georgia,
    serif;
}
.login-panel {
  width: min(100%, 375px);
}
.tiny-book {
  margin-bottom: 1.3rem;
  font-size: 1.45rem;
}
.login-panel h1 {
  font-size: clamp(2rem, 3.9vw, 3.3rem);
}
.intro {
  margin: 0.6rem 0 1.8rem;
  color: var(--muted);
}
fieldset {
  border: 1px solid var(--line);
  padding: 0.75rem 1rem;
  margin: 0.9rem 0;
  min-width: 0;
}
legend,
.field {
  font-size: 0.9rem;
  font-weight: 550;
}
.account {
  padding: 0;
  border: 0;
  margin: 0 0 1.2rem;
  display: flex;
  gap: 0.6rem;
}
.account legend {
  margin-bottom: 0.55rem;
}
.account label {
  flex: 1;
  position: relative;
  cursor: pointer;
}
.account input {
  position: absolute;
  opacity: 0;
}
.account span {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.6rem 1rem;
  display: block;
  text-align: center;
}
.account input:checked + span {
  border-color: var(--red);
  color: var(--red);
  background: #f1e7df;
}
.account input:focus-visible + span {
  outline: 3px solid #a46448;
}
.field {
  display: grid;
  gap: 0.4rem;
  margin: 0.85rem 0;
}
.field input,
.field select,
.field textarea,
.tools select {
  border: 1px solid #bbb5a9;
  border-radius: 3px;
  padding: 0.64rem 0.8rem;
  background: var(--white);
  width: 100%;
  min-width: 0;
  font-weight: 400;
  font-size: 1rem;
}
.field textarea {
  resize: vertical;
}
.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.7rem 0;
  font-size: 0.9rem;
}
.check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--red);
}
.primary,
.quiet,
.danger,
.iconbtn,
.active-chip,
.tabs button,
.tick {
  border-radius: 3px;
  display: inline-flex;
  gap: 0.45rem;
  justify-content: center;
  align-items: center;
  font-size: 0.9rem;
  line-height: 1.4;
  min-height: 38px;
  padding: 0.5rem 0.87rem;
  background: transparent;
  border: 1px solid transparent;
}
.primary {
  background: var(--red);
  color: #fffaf1;
  border-color: var(--red);
  font-weight: 600;
  min-height: 42px;
}
.primary:hover {
  background: #70322d;
}
.quiet {
  border-color: var(--line);
  background: var(--white);
}
.quiet:hover,
.nav a:hover {
  color: var(--red);
  border-color: var(--red);
}
.wide {
  width: 100%;
  padding: 0.85rem;
}
.danger {
  color: #922e26;
}
.error {
  color: #9b2925;
  font-size: 0.93rem;
  white-space: pre-line;
}
.error:not(:empty) {
  margin: 0.65rem 0;
}
.login-panel .wide {
  margin-top: 0.6rem;
}
.mast-top {
  border-bottom: 0;
}
.mast-right {
  gap: 1.2rem;
}
.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.95rem, 3vw, 2.5rem);
  overflow-x: auto;
  white-space: nowrap;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--ink);
  scrollbar-width: thin;
}
.nav a {
  padding: 0.7rem 0.05rem;
  border-bottom: 2px solid transparent;
  font-size: 0.95rem;
}
.nav a.active {
  border-color: var(--red);
  color: var(--red);
  font-weight: 700;
}
.content {
  min-height: 65vh;
  padding: 2rem 0 3rem;
}
.page-title,
.section-title,
.actions,
.tools,
.tabs {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.page-title,
.section-title {
  justify-content: space-between;
}
.page-title {
  margin: 0 0 1.6rem;
}
.section-title {
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 0;
  margin-bottom: 0.85rem;
}
.text-link {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.home-spread {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(240px, 0.8fr);
  gap: 2.5rem;
  margin-bottom: 2.1rem;
}
.feature {
  position: relative;
  isolation: isolate;
  min-height: 325px;
  aspect-ratio: 1.85;
  background: #657461;
  overflow: hidden;
}
.feature > a {
  display: block;
  height: 100%;
}
.feature-caption {
  left: 5%;
  right: 5%;
  bottom: 8%;
}
.feature-caption span {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}
.feature-caption h2 {
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.side section + section {
  margin-top: 1.5rem;
}
.side .section-title {
  margin: 0;
}
.side .empty {
  padding: 1rem 0;
  text-align: left;
  border: 0;
}
.empty {
  border: 1px dashed var(--line);
  padding: 2.4rem 1.2rem;
  text-align: center;
  color: var(--muted);
}
.empty p + * {
  margin-top: 0.7rem;
}
.quickwish,
.reminder,
.listrow,
.order-row,
.site-foot {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.quickwish,
.reminder {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.reminder {
  justify-content: space-between;
}
.reminder div {
  display: grid;
}
.red,
.tick {
  color: var(--red);
}
.tick {
  font-size: 1.4rem;
  line-height: 1;
}
.cards,
.photowall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 205px), 1fr));
  gap: 1.8rem 1.2rem;
}
.cards img,
.type-cover,
.photowall img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.5;
  object-fit: cover;
  background: #e6e3d7;
}
.story-card time {
  display: block;
  margin-top: 0.5rem;
}
.story-card h3 {
  margin-top: 0.12rem;
  overflow-wrap: anywhere;
}
.type-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #5d6352;
  background: #e8e9df;
  padding: 1rem;
  font: 1.4rem var(--serif);
  gap: 0.8rem;
  overflow: hidden;
}
.type-cover span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tools,
.tabs {
  margin-bottom: 1.4rem;
}
.tools label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
}
.tools select {
  width: auto;
}
.tabs {
  border-bottom: 1px solid var(--line);
  gap: 1rem;
}
.tabs button {
  border: 0;
  border-radius: 0;
  padding: 0.5rem 0;
}
.tabs .selected {
  color: var(--red);
  border-bottom: 2px solid;
}
.listrow,
.order-row {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.listrow > div:not(.datebox) {
  flex: 1;
  min-width: 0;
}
.listrow h3,
.listrow p,
.prose,
.voice {
  overflow-wrap: anywhere;
}
.listrow p,
.city-list p,
.stops p {
  color: var(--muted);
}
.listrow .text-link {
  margin-left: 0.7rem;
}
.datebox {
  font-family: Georgia, serif;
  color: var(--red);
  font-size: 1.15rem;
}
.back {
  display: inline-block;
  margin: 0 0 1rem;
}
.timeline {
  max-width: 780px;
}
.timeline h2 {
  color: var(--red);
  margin: 1.5rem 0 0.65rem;
}
.timeline article {
  display: grid;
  grid-template-columns: 75px 1fr;
  gap: 1rem;
  border-left: 1px solid #a39a88;
  padding: 0 0 1.5rem 1.3rem;
  margin-left: 6px;
  position: relative;
}
.timeline article:before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
}
.timeline p {
  white-space: pre-line;
}
.nodepic,
.stop-img {
  width: 110px;
  height: 72px;
  object-fit: cover;
  margin: 0.5rem 0.4rem 0.5rem 0;
}
.actions {
  margin: 0.8rem 0;
}
.photowall a {
  position: relative;
  min-width: 0;
}
.photowall span {
  display: block;
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0.35rem 0;
}
.article {
  max-width: 850px;
  margin: auto;
}
.article h1 {
  margin: 0.4rem 0 1rem;
  overflow-wrap: anywhere;
}
.prose {
  white-space: pre-wrap;
}
.long {
  font-size: 1.1rem;
  line-height: 1.95;
  margin: 1.5rem 0;
}
.article .section-title {
  margin-top: 2rem;
}
.voice {
  background: #efede5;
  padding: 1rem;
  margin: 1rem 0;
}
.paging {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding: 1rem 0;
  margin-top: 2rem;
}
.viewer {
  text-align: center;
  background: #e9e7df;
}
.viewer img,
.viewer video {
  max-width: 100%;
  max-height: 78vh;
  vertical-align: middle;
}
.atlas-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}
.globe-box,
.position-picker {
  background: #e9eee7;
  text-align: center;
}
.globe-box span {
  display: block;
  color: #5c665a;
  font-size: 0.85rem;
  padding-bottom: 1rem;
}
canvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
  cursor: grab;
}
.city-list {
  display: flex;
  align-items: start;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.active-chip {
  background: #e8e3d7;
  border-color: var(--red);
}
.stops li {
  padding: 0 0 1rem 0.5rem;
}
.site-foot {
  border-top: 1px solid var(--line);
  justify-content: space-between;
  padding: 1rem 0 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}
dialog {
  border: 1px solid #b8b2a5;
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  width: min(620px, 95vw);
  max-height: 90dvh;
  padding: 0;
  box-shadow: 0 18px 60px #25221538;
}
dialog::backdrop {
  background: #23251fcc;
}
dialog form {
  padding: 1.25rem 1.5rem;
}
dialog header,
dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}
dialog header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.7rem;
}
dialog footer {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 1.3rem;
  justify-content: flex-end;
}
dialog footer .danger {
  margin-right: auto;
}
.iconbtn {
  font-size: 1.3rem;
  padding: 0.2rem 0.6rem;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
.filepick {
  position: relative;
  cursor: pointer;
}
.filepick input {
  position: absolute;
  inset: 0;
  opacity: 0;
  max-width: 100%;
  cursor: pointer;
}
.media-chip,
.order-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.media-chip img {
  width: 45px;
  height: 36px;
  object-fit: cover;
}
.media-chip span {
  flex: 1;
  word-break: break-all;
  font-size: 0.9rem;
}
.order-row {
  justify-content: space-between;
  padding: 0.35rem 0;
}
.order-row button {
  font-size: 0.78rem;
  min-height: 32px;
  padding: 0.3rem;
}
.order-row button + button {
  margin-left: 0.4rem;
}
#libraryPicker {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
#libraryPicker .quiet {
  max-width: 100%;
  overflow-wrap: anywhere;
}
#conflict pre {
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
}
#toast {
  pointer-events: none;
  position: fixed;
  z-index: 5;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #332e25;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  opacity: 0;
  max-width: 90vw;
}
#toast.show {
  opacity: 1;
}
@media (max-width: 800px) {
  .login-main {
    gap: 2rem;
    grid-template-columns: 1fr 1fr;
  }
  .login-cover {
    min-height: 460px;
    height: 64vh;
  }
  .home-spread {
    gap: 1.3rem;
    grid-template-columns: 1.4fr 1fr;
  }
  .feature {
    aspect-ratio: auto;
  }
  .atlas-grid {
    grid-template-columns: 1.3fr 1fr;
  }
  .mast-right time {
    display: none;
  }
}
@media (max-width: 620px) {
  .public-head,
  .mast,
  .content,
  .site-foot,
  .login-main {
    width: 92%;
  }
  .public-head,
  .mast-top {
    padding: 0.8rem 0;
  }
  .brand {
    font-size: 1.25rem;
  }
  .login-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 0 2rem;
    gap: 1.3rem;
  }
  .login-cover {
    height: clamp(150px, 25vh, 230px);
    min-height: 0;
  }
  .login-cover figcaption {
    left: 5%;
    bottom: 12%;
  }
  .login-cover figcaption span {
    font-size: 2rem;
  }
  .login-cover i {
    font-size: 1rem;
    margin-top: 0.1rem;
  }
  .login-panel {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
  }
  .tiny-book {
    display: none;
  }
  .intro {
    margin: 0.3rem 0 1rem;
  }
  .account {
    margin-bottom: 0.7rem;
  }
  .content {
    padding: 1.3rem 0 2rem;
  }
  .home-spread,
  .atlas-grid {
    grid-template-columns: 1fr;
  }
  .feature {
    min-height: 0;
    aspect-ratio: 1.55;
  }
  .side section + section {
    margin-top: 0.6rem;
  }
  .cards,
  .photowall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 0.65rem;
  }
  .nav {
    gap: 1.25rem;
  }
  .nav a {
    font-size: 0.91rem;
  }
  .page-title {
    margin-bottom: 1rem;
  }
  .globe-box {
    margin-bottom: 0.5rem;
  }
  dialog form {
    padding: 1rem;
  }
  .pair {
    gap: 0.45rem;
  }
  .listrow {
    gap: 0.5rem;
  }
  .section-title h2 {
    font-size: 1.3rem;
  }
  .timeline article {
    grid-template-columns: 55px 1fr;
  }
  .site-foot {
    padding-bottom: 1rem;
  }
}
