/* The pause menu uses a bright selected row on a dark panel. The phone home uses circular app icons and a reminder widget. */
:root {
  --nav-width: 192px;
  --screen: #15151e;
  --screen-text: #fff9f4;
  --screen-dim: #c9c6d1;
  --screen-line: #4a4353;
  --screen-pink: #fab4cc;
}
body {
  background: var(--screen);
}
#main,
.handbook-desk {
  background: var(--screen);
}
.mast {
  background: #1e1d29;
  color: var(--screen-text);
}
#device-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
}
#device-nav a svg {
  flex: none;
}
#quick-search,
#open-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: #f9f4f8;
}
#quick-search {
  gap: 9px;
  font-weight: 650;
}
#quick-search kbd {
  border: 1px solid #77717e;
  color: #ddd8df;
  border-radius: 3px;
  font: 12px/18px monospace;
  min-width: 19px;
}
.handbook-desk {
  padding-top: 22px;
}
.device-landing {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
  grid-template-rows: minmax(165px, 1fr) auto;
  gap: 0 14px;
}
.device-landing .hero {
  grid-column: 1;
  grid-row: 1/3;
  height: 100%;
  min-height: 254px;
  border: 0;
  border-radius: 9px;
  background: #302631;
}
.device-landing .cover-title {
  inset: 20px auto auto 24px;
  align-items: flex-start;
}
.device-landing .cover-title h1 {
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}
.device-landing .cover-title h1 span {
  font-size: clamp(58px, 6.2vw, 90px);
  line-height: 0.9;
}
.device-landing .cover-title h1 b {
  font-size: clamp(25px, 2.3vw, 35px);
}
.device-landing .cover-control {
  right: 10px;
  bottom: auto;
  top: 8px;
}
.device-landing .cover-control > a,
.device-landing .cover-control button {
  border: 0;
  background: #18131cbb;
  color: #faf2f7;
}
.device-landing .lookup {
  grid-column: 1;
  grid-row: 2;
  z-index: 1;
  margin: 0 16px 16px;
}
.device-landing .lookup .search-box {
  background: #fbf8f4;
  border-radius: 6px;
  border: 1px solid #fff9;
  min-height: 48px;
  box-shadow: 0 4px 15px #14111e33;
}
.device-landing .lookup .submit {
  background: #35303d;
  border-radius: 3px;
}
.phone-launcher {
  grid-column: 2;
  grid-row: 1/3;
  isolation: isolate;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #626673;
  border-radius: 9px;
  padding: 16px 16px 11px;
  background:
    radial-gradient(
      ellipse at 8% 113%,
      transparent 34%,
      #adc2bd81 34.5%,
      #91aca733 35%,
      transparent 49%
    ),
    linear-gradient(149deg, #555269 0%, #354356 48%, #24454c 70%, #3a5450 100%);
}
.phone-launcher .resume-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  color: white;
  background: #131720d9;
  border: 1px solid #ffffff23;
  border-radius: 9px;
  min-height: 48px;
}
.resume-tile > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}
.resume-tile small,
.resume-tile b {
  display: block;
}
.resume-tile small {
  font-size: 11px;
  color: #e4b9d5;
  font-weight: 650;
}
.resume-tile b {
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.resume-icon {
  color: #efadcb;
  display: grid;
  place-items: center;
}
.phone-launcher .hub-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px 5px;
}
.phone-launcher .hub-tool {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
  gap: 3px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: transparent;
  padding: 2px;
  min-height: 61px;
  min-width: 0;
}
.phone-launcher .hub-tool:hover,
.phone-launcher .hub-tool:focus-visible {
  background: #ffffff19;
}
.phone-launcher .hub-tool .tool-icon {
  border-radius: 50%;
  width: 38px;
  height: 38px;
  box-shadow:
    inset 0 1px 1px #ffffff72,
    0 2px 4px #0004;
  background: linear-gradient(145deg, var(--app-top), var(--app-bottom));
  color: #fff;
}
.phone-launcher .hub-tool .tool-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.95;
}
.phone-launcher .hub-tool strong {
  font-size: 12px;
  line-height: 1.5;
  text-shadow: 0 1px 2px #192024;
  font-weight: 650;
  white-space: nowrap;
}
.app-log {
  --app-top: #7dbaee;
  --app-bottom: #206880;
}
.app-atlas {
  --app-top: #51baaa;
  --app-bottom: #086654;
}
.app-miss {
  --app-top: #e9ab61;
  --app-bottom: #ab5c3e;
}
.app-goals {
  --app-top: #b398e5;
  --app-bottom: #75519d;
}
.app-library {
  --app-top: #e4879b;
  --app-bottom: #a23a65;
}
.app-book {
  --app-top: #999fbb;
  --app-bottom: #555e81;
}
.handbook-desk .home-columns {
  margin-top: 22px;
  gap: 20px;
  grid-template-columns: minmax(0, 1.78fr) minmax(230px, 1fr);
}
.chapter-section,
.help-desk {
  background: #22212d;
  border: 1px solid #47414e;
  border-radius: 7px;
  padding: 16px;
}
.chapter-strip {
  gap: 0;
  background: #191822;
  border: 1px solid #48434f;
  border-radius: 4px;
  overflow: hidden;
}
.chapter-strip button {
  border: 0;
  border-radius: 0;
  color: #d9d2dc;
  background: transparent;
  min-height: 42px;
  padding-inline: 3px;
}
.chapter-strip button[aria-pressed="true"] {
  background: linear-gradient(110deg, #faf6f0, #cfcad1);
  color: #28232c;
}
.chapter-brief {
  padding: 1px 0 0;
  margin: 8px 0 0;
  background: none;
  border: 0;
}
.chapter-brief a small {
  min-width: 3.5em;
  color: #dfb5ca;
}
.chapter-brief a:hover,
.help-desk > a:hover {
  background: #39333f;
}
.library-mode .device-landing {
  display: block;
}
.library-mode .device-landing .lookup {
  margin: 6px 0 14px;
}
.library-mode #index-panel {
  color: #f6f1ed;
  background: #24212d;
  border: 1px solid #423c49;
}
.library-mode #result-count,
.library-mode #pager > span,
.library-mode .filters button,
.library-mode .filter-row a {
  color: #d9d2da;
}
.library-mode .filters button {
  background: #302d38;
  border-color: #574f60;
}
.library-mode .filters button[aria-pressed="true"] {
  color: #27212d;
  background: #eee6ec;
  border-color: #eee6ec;
}
.library-mode .filter-row select {
  background: #312c38;
  color: #f2eaf1;
  border-color: #645969;
}
.library-mode .entry-card {
  color: #27232a;
  border-radius: 5px;
}
#search-extra:empty,
#search-extra > div:empty {
  display: none;
}
.other-hits {
  padding: 12px 14px;
  margin-bottom: 11px;
  background: #193331;
  color: #f2fbf7;
  border: 1px solid #42756f;
  border-radius: 6px;
}
.other-hits > div,
.other-hits li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.other-hits > div a,
.other-hits small {
  color: #ade1d4;
  font-size: 13px;
}
.other-hits ul {
  list-style: none;
  padding: 4px 0 0;
}
.other-hits li a {
  min-height: 37px;
  border-top: 1px solid #41615a;
  font-size: 14px;
}
.other-hits li small {
  max-width: 53%;
  text-align: right;
}
#main:has(.saves-page) {
  background: #1b1924;
  color: #f9f4f2;
  min-height: 70vh;
}
.saves-page {
  padding-block: 25px 60px;
}
.saves-page h1 {
  font-size: clamp(30px, 4vw, 50px);
}
.saves-page > p {
  color: #d1c4d1;
  margin: 8px 0 18px;
}
.device-link,
.actions [data-save][aria-pressed="true"] {
  color: #f9b6ce;
}
.actions [data-save] {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #d5cddb;
  min-height: 40px;
}
.save-list {
  display: grid;
  gap: 10px;
  max-width: 830px;
}
.save-list > div {
  display: flex;
  gap: 5px;
  align-items: stretch;
}
.save-list .entry-card {
  flex: 1;
  min-width: 0;
  color: #24202a;
  margin: 0;
}
.save-list [data-save] {
  border-radius: 5px;
  border: 1px solid #5b4b5e;
  color: #f7bad4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  font-size: 12px;
}
.prefs-panel {
  color: #fff9ff;
  background: linear-gradient(145deg, #493751, #282431);
  border: 1px solid #76657f;
  border-radius: 8px;
  width: min(420px, calc(100% - 24px));
  padding: 20px;
}
.prefs-panel::backdrop {
  background: #080810a6;
}
.prefs-head,
.prefs-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.prefs-head {
  padding-bottom: 14px;
}
.prefs-head h2 {
  font-size: 24px;
}
.prefs-row {
  border-top: 1px solid #8271896b;
  min-height: 60px;
  font-size: 15px;
}
.prefs-row input {
  width: 21px;
  height: 21px;
  accent-color: #f1a9cc;
}
.prefs-panel button {
  border: 1px solid #8a798c;
  border-radius: 4px;
  color: #f6f0f7;
  min-height: 40px;
  padding: 4px 12px;
}
.prefs-panel button[aria-pressed="true"],
.prefs-head button {
  color: #231f28;
  background: #f4edf1;
}
html[data-read-size="large"]
  .reader
  :is(.lead, .answer p, .sources li, .reader-prereqs a),
html[data-read-size="large"] .reader-flow .flow-summary {
  font-size: 20px;
  line-height: 1.9;
}
html[data-read-size="large"] .library-mode .brief,
html[data-read-size="large"] .map-list .pin-link b {
  font-size: 17px;
}
@media (min-width: 1080px) {
  body {
    display: grid;
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    min-height: 100dvh;
  }
  .mast {
    grid-column: 1;
    grid-row: 1/3;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100dvh;
    border: 0;
    border-right: 1px solid #ffffff20;
    background: linear-gradient(170deg, #282735 2%, #201e30 58%, #383145 100%);
    z-index: 4;
  }
  .mast .mast-inner {
    width: auto;
    margin: 0;
    padding: 30px 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    height: 100%;
    max-height: 100%;
  }
  .mast .brand {
    align-self: flex-start;
    margin: 0 7px 28px;
    gap: 9px;
  }
  #device-nav {
    margin: 0 0 17px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  #device-nav a {
    min-height: 46px;
    padding: 7px 13px;
    border-radius: 3px;
    color: #ded8e4;
  }
  #device-nav a[aria-current="page"] {
    background: linear-gradient(95deg, #faf4ee, #c9c5ce);
    color: #251e2a;
  }
  #device-nav a[aria-current="page"]:after {
    display: none;
  }
  #device-nav a:hover:not([aria-current]) {
    background: #393242;
  }
  #quick-search {
    border-top: 1px solid #504956;
    justify-content: flex-start;
    padding: 14px 8px 10px;
  }
  #quick-search kbd {
    margin-left: auto;
  }
  .mast .spoiler-switch {
    margin-top: auto;
    padding-left: 8px;
    justify-content: flex-start;
  }
  #open-settings {
    justify-content: flex-start;
    gap: 9px;
    padding-left: 9px;
  }
  #open-settings:after {
    content: "阅读设置";
    font-size: 14px;
  }
  #main,
  footer {
    grid-column: 2;
    min-width: 0;
  }
  #main {
    grid-row: 1;
  }
  footer {
    grid-row: 2;
  }
  .hub-shell,
  .foot,
  .reader.shell,
  .reader-flow.shell,
  .atlas-page.shell,
  .actions.shell {
    width: calc(100% - 56px);
  }
  .handbook-desk {
    min-height: calc(100vh - 60px);
  }
}
@media (max-width: 1079px) {
  .mast {
    position: relative;
  }
  .mast .shell {
    gap: 10px;
    min-height: 49px;
    width: calc(100% - 28px);
  }
  .mast .brand {
    margin-right: auto;
  }
  .mast .brand span {
    display: block;
    font-size: 15px;
  }
  .mast nav#device-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    z-index: 11;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    background: #1b1924f5;
    border-top: 1px solid #65596d;
    padding: 2px max(5px, env(safe-area-inset-left))
      max(2px, env(safe-area-inset-bottom));
  }
  #device-nav a {
    min-height: 49px;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    font-size: 11px;
    line-height: 1.4;
  }
  #device-nav a svg {
    width: 18px;
    height: 18px;
  }
  #device-nav a[aria-current="page"] {
    color: #f8b1cf;
  }
  #device-nav a[aria-current="page"]:after {
    display: none;
  }
  body {
    padding-bottom: calc(55px + env(safe-area-inset-bottom));
  }
  #quick-search,
  #open-settings {
    min-width: 35px;
  }
  #quick-search span,
  #quick-search kbd {
    display: none;
  }
  #notice {
    bottom: calc(66px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 760px) {
  .handbook-desk {
    padding-top: 10px;
  }
  .device-landing {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 116px auto auto;
    gap: 0;
  }
  .device-landing .hero {
    min-height: 0;
    border-radius: 8px 8px 0 0;
  }
  .device-landing .cover-title {
    inset: 15px auto auto 15px;
  }
  .device-landing .cover-title h1 {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }
  .device-landing .cover-title h1 span {
    font-size: clamp(43px, 10vw, 68px);
  }
  .device-landing .cover-title h1 b {
    font-size: clamp(21px, 4.6vw, 28px);
  }
  .device-landing .cover-title p {
    font-size: 12px;
    margin-top: 7px;
  }
  .device-landing .cover-control {
    inset: auto 10px 60px auto;
  }
  .device-landing .cover-control button,
  .device-landing .cover-control a {
    min-height: 25px;
  }
  .device-landing .lookup {
    margin: 0 10px 10px;
  }
  .phone-launcher {
    grid-column: 1;
    grid-row: 3;
    gap: 11px;
    border: 0;
    border-radius: 0 0 8px 8px;
    padding: 10px 10px 6px;
  }
  .phone-launcher .hub-tools {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
  }
  .phone-launcher .hub-tool {
    min-height: 59px;
    gap: 3px;
  }
  .phone-launcher .hub-tool .tool-icon {
    width: 33px;
    height: 33px;
  }
  .phone-launcher .hub-tool strong {
    font-size: 11px;
  }
  .phone-launcher .resume-tile {
    min-height: 43px;
    padding: 5px 9px;
  }
  .resume-tile > span:nth-child(2) {
    display: flex;
    align-items: baseline;
    gap: 9px;
  }
  .handbook-desk .home-columns {
    display: flex;
    gap: 12px;
    margin-top: 15px;
  }
  .chapter-section,
  .help-desk {
    padding: 12px;
  }
  .library-mode .device-landing .lookup {
    margin: 4px 0 8px;
  }
  .actions [data-save] {
    padding-inline: 4px;
  }
}
@media (max-width: 360px) {
  .phone-launcher {
    padding-inline: 5px;
  }
  .phone-launcher .hub-tool strong {
    font-size: 10.5px;
  }
  .mast .shell {
    gap: 4px;
  }
}
@media (max-height: 480px) and (min-width: 600px) and (max-width: 1079px) {
  .mast nav#device-nav {
    position: static;
    display: flex;
    flex-direction: row;
    border: 0;
    background: none;
    gap: 13px;
  }
  #device-nav a {
    flex-direction: row;
  }
  #device-nav a svg {
    display: none;
  }
  body {
    padding-bottom: 0;
  }
}

#search-extra {
  grid-column: 1/-1;
  min-width: 0;
}
#search-extra:has(> div:empty):not(:has(a)) {
  display: none;
}
.saved-topic {
  flex: 1;
  display: grid;
  align-content: center;
  border-radius: 5px;
  padding: 12px 16px;
  min-height: 70px;
  background: #ede7ee;
  color: #282231;
}
.saved-topic small {
  color: #68566b;
}
.actions [data-save] + #share {
  margin-left: 0;
}
.actions [data-save] {
  margin-left: auto;
}
.library-mode .empty,
.library-mode .empty h3,
.library-mode .empty p {
  color: #292530;
}
@media (max-width: 600px) {
  .phone-launcher .hub-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }
  .phone-launcher .hub-tool {
    min-height: 57px;
  }
  .phone-launcher .hub-tool .tool-icon {
    width: 34px;
    height: 34px;
  }
  .phone-launcher .hub-tool strong {
    font-size: 12px;
  }
  .phone-launcher {
    gap: 8px;
    padding-bottom: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
  }
}

.topic-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.topic-tools > a,
.reference-search {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #d7b9d0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.topic-tools > a {
  padding: 4px 13px;
  color: #f5e9f3;
  border: 1px solid #62546a;
  border-radius: 4px;
  background: #302737;
  font-size: 14px;
}
.map-translation {
  margin: 9px 0 5px;
  line-height: 1.7;
}
.map-translation b {
  color: #f1aac7;
}

html[data-read-size="large"]
  :is(
    .shelf-answer p,
    .shelf-card p,
    .shelf-reads a p,
    .shelf-locals a,
    .ref-original,
    .ref-related a,
    .map-translation,
    .atlas-original-note p,
    .atlas-note,
    .reader-prereqs,
    .reader-checklist li label b,
    .reader-checklist li label small,
    .trophy-page p,
    .trophy-page label,
    .trophy-page .condition
  ) {
  font-size: 19px;
  line-height: 1.85;
}
html[data-read-size="large"]
  :is(.shelf-page, .references-page, .atlas-page, #reader-checklist) {
  overflow-wrap: anywhere;
}

.library-mode .empty {
  background: #f4edf2;
  border-color: #d2c5ce;
}
html[data-read-size="large"] .ref-page {
  overflow-wrap: anywhere;
}

.pad-sequence {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-block: 5px 7px;
}
.pad-group {
  display: inline-flex;
  gap: 3px;
}
.pad-group kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.5em;
  height: 1.5em;
  border: 1px solid #b6a1bd;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #352e42;
  color: #fff4fb;
  font:
    700 1.08em/1 system-ui,
    sans-serif;
}
