:root {
  --bg: #f4f4f4;
  --text: #222222;
  --sub: #8a8a8a;
  --line: #dddddd;
}

body.theme-dark {
  --bg: #0d0d0d;
  --text: #efefef;
  --sub: #9d9d9d;
  --line: #2b2b2b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "BIZ UDPMincho", serif;
}

button {
  font: inherit;
}

.topbar {
  width: min(1120px, calc(100% - 56px));
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 64px;
  padding: 16px 0 12px;
}

.toggle {
  border: none;
  background: transparent;
  color: var(--sub);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
}

.layout {
  width: min(1120px, calc(100% - 56px));
  margin: 32px auto 56px;
}

.reader-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 56px 18px 56px;
  scrollbar-width: auto;
  scrollbar-color: #8d8d8d transparent;
}

.reader-wrap::-webkit-scrollbar {
  height: 10px;
}

.reader-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.reader-wrap::-webkit-scrollbar-thumb {
  background: #8d8d8d;
  border-radius: 999px;
}

.reader {
  border: none;
  padding: 0;
  min-width: 760px;
}

.novel {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-feature-settings: "palt" 1, "pkna" 1, "vert" 1;
  line-height: 1.95;
  letter-spacing: 0.03em;
  font-size: 1rem;
  height: 85vh;
  overflow-x: visible;
  overflow-y: hidden;
  padding: 8px 0;
}

.novel p {
  margin: 0 0 0 2.2em;
}

.novel p:last-child {
  margin-left: 0;
}

.v-ellipsis,
.v-kuten {
  text-combine-upright: all;
  -webkit-text-combine: horizontal;
  display: inline-block;
}

.footer {
  position: fixed;
  left: 16px;
  bottom: 40px;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 0.7rem;
  border: none;
  padding: 0;
}

@media (max-width: 800px) {
  .topbar,
  .layout,
  .footer {
    width: calc(100% - 32px);
  }

  .topbar__inner {
    min-height: 56px;
    padding: 14px 0 10px;
  }

  .reader-wrap {
    padding: 0 24px 16px 16px;
  }

  .reader {
    min-width: 620px;
  }

  .novel {
    height: 60vh;
    font-size: 0.95rem;
  }
}

@media (max-width: 640px) {
  .topbar__inner {
    justify-content: flex-start;
    min-height: 135px;
    padding: 12px 0 10px;
  }

  .layout {
    margin: 20px auto 40px;
  }

  .reader-wrap {
    padding: 0 16px 14px 8px;
  }

  .reader {
    min-width: 540px;
  }

  .novel {
    height: 58vh;
    line-height: 1.85;
  }

  .footer {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    left: 16px;
    bottom: 16px;
    font-size: 0.7rem;
    opacity: 0.8;
  }
}