/* OCity Library — web archive. Measurements follow archive_screen.dart;
 * wide screens keep the same column and give the extra room to whitespace. */

@font-face {
  font-family: 'WatermarkGreatVibes';
  src: url('../assets/fonts/GreatVibes-Regular.woff') format('woff');
  font-display: swap;
}

#rain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
}

/* ------------------------------------------------------------ bar */

.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: var(--safe-t);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.bar-inner {
  max-width: 1240px;
  margin: 0 auto;
  height: var(--bar);
  padding: 18px var(--gutter) 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.bar-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-side.is-right {
  justify-content: flex-end;
}

.bar-spacer {
  width: 42px;
}

.bar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bar-nav[hidden] {
  display: flex;
  visibility: hidden;
}

.nav-item {
  display: grid;
  place-items: center;
  min-width: 71px;
  height: 48px;
  padding: 0 7px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--muted);
}

.nav-item:nth-child(2) {
  min-width: 62px;
}

.nav-item span {
  display: inline-block;
  transition: transform var(--t) var(--ease), color var(--t) var(--ease);
}

.nav-item.is-on {
  color: var(--accent);
}

.nav-item.is-on span {
  transform: scale(1.16);
}

.nav-item:not(.is-on):hover {
  color: var(--ink);
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-2);
  color: var(--accent);
  transition: background-color 140ms;
}

.icon-btn:hover {
  background: var(--accent-08);
}

.icon-btn .dot,
.dot {
  position: absolute;
  top: 8px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg);
}

.dot.is-compact {
  display: none;
}

@media (max-width: 719px) {
  .dot.is-compact {
    display: block;
  }
}

.main {
  outline: none;
  padding-bottom: calc(56px + var(--safe-b));
}

.is-bare .bar {
  display: none;
}

/* ------------------------------------------------------------ pages */

.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 22px var(--gutter) 40px;
}

.page.is-center {
  min-height: 70dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.empty-text {
  padding: 28px 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.empty-text.is-left {
  text-align: left;
  padding: 22px 0;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--r-2);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  transition: background-color 140ms;
}

.text-btn:hover:not(:disabled) {
  background: var(--accent-08);
}

.fill-btn {
  flex: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: var(--r-2);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 700;
  transition: filter 140ms, transform 140ms;
}

.fill-btn:hover:not(:disabled) {
  filter: brightness(0.96);
}

.fill-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.fill-btn.is-small {
  min-height: 34px;
  padding: 0 14px;
  font-size: 14px;
}

.fill-btn.is-wide {
  width: 100%;
}

/* _ArchivePlainInput: underline only */
.line-input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
}

.line-input:focus {
  border-bottom-color: var(--accent);
  box-shadow: 0 0.4px 0 var(--accent);
}

input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* _ArchiveInlineAction */
.inline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: var(--r-2);
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  transition: background-color 140ms;
}

.inline-action:hover {
  background: var(--accent-08);
}

.inline-action.is-on {
  background: var(--accent-14);
}

.redact-swatch {
  width: 16px;
  height: 11px;
  border-radius: 2px;
  background: var(--redact);
}

/* ------------------------------------------------------------ rows */

.rows,
.result-list {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  transition: background-color 140ms;
}

.row.is-selected {
  background: var(--accent-14);
}

.row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}

.row-icon {
  color: var(--muted);
}

.row.is-folder .row-icon {
  color: var(--accent);
}

.row-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.row-title {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-sub {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-excerpt {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row mark,
.row-title mark {
  background: transparent;
  color: var(--accent);
}

.row-more {
  color: var(--muted);
}

.row-main:hover .row-title {
  color: var(--accent);
}

/* ------------------------------------------------------------ search */

.search {
  padding-top: 72px;
}

.wordmark {
  text-align: center;
  font-family: var(--script);
  font-size: 42px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--accent);
  letter-spacing: 0;
}

.wordmark.is-small {
  font-size: 30px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  margin-bottom: 18px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  transition: border-color 140ms;
}

.search-field .ico {
  opacity: 0.76;
}

.search-field:focus-within {
  border-bottom-color: var(--accent);
  box-shadow: 0 0.4px 0 var(--accent);
}

.search-field.is-compact {
  margin: 0 0 8px;
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 52px;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.discovery-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.tpl-stage {
  position: relative;
  height: 250px;
}

.tpl-mosaic {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 10px;
  transition: opacity 700ms var(--ease), transform 700ms var(--ease), filter 700ms var(--ease);
}

.tpl-mosaic.is-2 {
  grid-template-columns: 1fr 1fr;
}

.tpl-mosaic.is-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.tpl-mosaic.is-3 > :first-child {
  grid-row: span 2;
}

.tpl-mosaic.is-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.tpl-mosaic.is-entering {
  opacity: 0;
  transform: scale(0.97);
}

.tpl-mosaic.is-entering .tpl-card,
.tpl-mosaic.is-leaving .tpl-card {
  border-radius: 22px;
}

.tpl-mosaic.is-leaving {
  opacity: 0;
  transform: scale(1.02);
  filter: blur(1.5px);
  pointer-events: none;
}

/* 从模板开始: a fixed shelf of template cards */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tpl-grid .tpl-card {
  justify-content: flex-start;
  min-height: 118px;
}

@media (min-width: 720px) {
  .tpl-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
  }
  .tpl-grid .tpl-card {
    min-height: 132px;
    padding: 18px;
  }
}

/* _ArchiveTemplateCard: one warm paper, square corners, some double ruled */
.tpl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--card-line);
  border-radius: var(--r);
  background: var(--card-paper);
  text-align: left;
  overflow: hidden;
  transition: border-radius 700ms var(--ease), transform 180ms var(--ease), box-shadow 180ms var(--ease);
}

.tpl-card.is-double::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 0.7px solid color-mix(in srgb, var(--card-line) 45%, transparent);
  border-radius: 2px;
  pointer-events: none;
}

.tpl-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.tpl-kind {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--accent);
}

.tpl-title {
  margin-top: 7px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tpl-hint {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--ink) 82%, transparent);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tpl-mosaic.is-4 .tpl-hint {
  -webkit-line-clamp: 1;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.pager-count {
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 全部模板 */
.templates .search-field {
  margin-top: 6px;
}

.tpl-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.tpl-tab {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  color: var(--ink);
  font-size: 15px;
}

.tpl-tab.is-on {
  border-color: var(--accent);
  font-weight: 700;
}

.tpl-masonry {
  columns: 2;
  column-gap: 12px;
}

.tpl-card.is-full {
  width: 100%;
  min-height: var(--h, 170px);
  margin-bottom: 12px;
  break-inside: avoid;
  justify-content: flex-start;
}

.tpl-card.is-full .tpl-hint {
  -webkit-line-clamp: 4;
}

.tpl-detail-kind {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-top: -6px;
}

.check-list {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 2px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.check-box {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1.6px solid var(--muted);
  border-radius: 3px;
  color: transparent;
}

.check-row.is-on .check-box {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.check-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.check-title {
  font-size: 15px;
  font-weight: 700;
}

.check-sub {
  font-size: 13px;
  color: var(--muted);
}

/* ------------------------------------------------------------ library */

.display-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.bar-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: var(--r-2);
  color: var(--accent);
  font-size: 13px;
}

.bar-chip.is-strong {
  font-weight: 700;
}

.bar-chip:hover {
  background: var(--accent-08);
}

.library-tools {
  display: flex;
  flex-direction: column;
}

.library-tools > .inline-action {
  width: 100%;
}

.inline-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.library-body {
  margin-top: 18px;
}

/* cabinet: stacked paper sleeves */
.cabinet,
.cabinet-folders,
.cabinet-papers {
  display: flex;
  flex-direction: column;
}

.cabinet-papers {
  margin-top: 4px;
}

.sleeve {
  position: relative;
  isolation: isolate;
  color: var(--sleeve-ink);
  transition: transform 260ms var(--ease);
}

/* _ArchiveFolderOverlap: each sleeve tucks over the one before it. */
.cabinet .sleeve + .sleeve {
  margin-top: -34px;
}

.sleeve-art {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: visible;
  pointer-events: none;
}

.sleeve-rim {
  transform-box: view-box;
  transition: transform 420ms var(--ease);
}

.sleeve-face {
  display: block;
  width: calc(100% - 6px);
  padding: 59px 16px 12px;
  text-align: left;
  border-radius: 6px;
}

.sleeve-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--sleeve-ink);
}

.sleeve-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 32px;
  padding: 0 10px 54px 16px;
}

.sleeve-stat {
  font-size: 11px;
  color: color-mix(in srgb, var(--sleeve-ink) 75%, transparent);
}

.sleeve-tools {
  display: flex;
  align-items: center;
}

.sleeve-more,
.paper-more {
  width: 38px;
  height: 38px;
  color: var(--sleeve-ink);
}

.drag-handle {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 38px;
  color: color-mix(in srgb, var(--sleeve-ink) 60%, transparent);
  cursor: grab;
  opacity: 0;
  transition: opacity 140ms;
}

.sleeve:hover .drag-handle,
.paper:hover .drag-handle {
  opacity: 1;
}

.sleeve.is-feature {
  aspect-ratio: 224 / 190;
  display: flex;
  flex-direction: column;
}

.sleeve.is-feature .sleeve-foot {
  margin-top: auto;
}

.sleeve.is-feature .sleeve-face {
  padding-top: 52px;
  padding-bottom: 6px;
}

.sleeve.is-feature .sleeve-foot {
  margin-top: 10px;
  padding-bottom: 24px;
  min-height: 40px;
}

.sleeve-kind {
  color: var(--accent);
}

@media (hover: hover) {
  .sleeve:hover {
    transform: translateY(-4px);
  }
  .sleeve:hover .sleeve-rim.is-right {
    transform: rotate(4deg);
  }
  .sleeve:hover .sleeve-rim.is-left {
    transform: rotate(-4deg);
  }
}

.sleeve.is-opening {
  transform: translateY(-14px) scale(1.01);
  transition-duration: 170ms;
}

/* entries in 文件夹 mode: small paper sheets */
.paper {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
  padding: 12px 6px 3px 10px;
  border: 1px solid color-mix(in srgb, var(--sleeve-ink) 18%, transparent);
  border-radius: var(--r);
  background: var(--sheet);
  color: var(--sleeve-ink);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}


.paper-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

.paper-tools {
  display: flex;
  justify-content: flex-end;
}

.paper:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -12px rgba(105, 88, 86, 0.45);
}

.is-dragging {
  opacity: 0.4;
}

.is-drop-before {
  box-shadow: 0 -2px 0 var(--accent);
}

.is-drop-after {
  box-shadow: 0 2px 0 var(--accent);
}

.sleeve.is-drop-into {
  transform: translateY(-6px);
  filter: drop-shadow(0 0 0.5px var(--accent));
}

.friend-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

/* ------------------------------------------------------------ reader */

.reader-page {
  position: relative;
  padding-top: 22px;
  padding-bottom: 48px;
}

.reader-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.reader-title {
  flex: 1;
  font-size: 32px;
  line-height: 1.08;
  font-weight: 900;
  color: var(--ink);
  word-break: break-word;
}

.reader-edit {
  margin-top: -4px;
}

.reader-source {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
}

.reader-tags {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.reader .md {
  margin-top: 18px;
}

.dimension-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  color: var(--muted);
  font-size: 13px;
}

.outline {
  display: none;
}

@media (min-width: 1240px) {
  .outline {
    display: block;
    position: fixed;
    top: calc(var(--bar) + 64px);
    left: calc(50% + 360px + 48px);
    width: 200px;
    max-height: calc(100dvh - var(--bar) - 120px);
    overflow: auto;
  }
  .outline ol {
    list-style: none;
    margin: 0;
    padding: 0 0 0 14px;
    border-left: 1px solid var(--line);
  }
  .outline li {
    margin: 0 0 10px;
  }
  .outline li.is-l3 {
    padding-left: 12px;
  }
  .outline a {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
    transition: color 140ms;
  }
  .outline a:hover,
  .outline a.is-on {
    color: var(--accent);
  }
}

/* ------------------------------------------------------------ markdown */

.md {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  word-break: break-word;
}

.md > * + * {
  margin-top: 0.9em;
}

.md h1 {
  font-size: 25px;
  font-weight: 900;
  line-height: 1.3;
  margin-top: 1.4em;
}

.md h2 {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.35;
  margin-top: 1.5em;
}

.md h3 {
  font-size: 17px;
  font-weight: 900;
  margin-top: 1.3em;
}

.md h4,
.md h5,
.md h6 {
  font-size: 15px;
  font-weight: 900;
}

.md > :first-child {
  margin-top: 0;
}

.md strong {
  font-weight: 800;
}

.md a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  font-weight: 600;
}

.md .md-broken,
.md .md-module-link {
  color: var(--muted);
  font-weight: 600;
}

.md blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.md ul,
.md ol {
  padding-left: 1.4em;
}

.md li + li {
  margin-top: 0.3em;
}

.md .md-tasks {
  list-style: none;
  padding-left: 0.2em;
}

.md code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--accent);
  font-weight: 700;
}

.md pre {
  padding: 12px 14px;
  border: 1px solid var(--line);
  overflow: auto;
  font-size: 13px;
  line-height: 1.6;
}

.md pre code {
  color: var(--ink);
  font-weight: 400;
}

.md hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.6em 0;
}

.md .md-table {
  overflow-x: auto;
}

.md table {
  border-collapse: collapse;
  min-width: 60%;
  font-size: 14px;
}

.md th,
.md td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.md th {
  font-weight: 800;
  border-bottom-color: var(--line-strong);
}

.md img {
  max-height: 520px;
  border-radius: var(--r);
}

.md figure {
  margin: 1.2em 0;
}

.md figcaption {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.md br.soft {
  content: '';
}

/* 涂黑: shown as text, covered as solid bars (_ArchiveRedactionBuilder). */
.md-redact {
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--line);
}

.is-covered .md-redact {
  background: var(--redact);
  color: transparent;
  box-shadow: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ------------------------------------------------------------ desk */

.desk-title {
  font-size: 27px;
  font-weight: 800;
  line-height: 1.3;
  margin: 4px 0 22px;
}

.desk-head {
  font-size: 18px;
  font-weight: 700;
  margin: 34px 0 12px;
}

.desk-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.desk-count {
  color: var(--accent);
  font-size: 14px;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.desk-file {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.desk-file-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 8px 4px;
  border-radius: var(--r-2);
}

.desk-file-main:hover {
  background: var(--accent-08);
}

.desk-file-icon {
  color: var(--accent);
  margin-top: 2px;
}

.desk-file-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.desk-file-title {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk-file-sub {
  font-size: 12px;
  color: var(--muted);
}

.desk-file-time {
  font-size: 11px;
  color: var(--muted);
}

.desk-file .icon-btn {
  width: 38px;
  height: 44px;
}

/* ------------------------------------------------------------ editor */

.edit-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.edit-pager-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--r-2);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 140ms;
}

.edit-pager-link small {
  font-size: 12px;
  color: var(--muted);
}

.edit-pager-link span {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-pager-link.is-next {
  text-align: right;
}

.edit-pager-link:hover {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.editor {
  max-width: 720px;
}

.ed-save {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ed-title {
  font-size: 17px;
  height: 52px;
}

.ed-status-row {
  display: flex;
  justify-content: flex-end;
  min-height: 34px;
  align-items: center;
}

.ed-status {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
  cursor: default;
}

.ed-status.is-failed {
  color: var(--accent);
  cursor: pointer;
}

.ed-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin: 0 -4px 12px;
}

.ed-area {
  display: block;
  width: 100%;
  min-height: 300px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: var(--r-3);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.75;
  resize: none;
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
}

.ed-area:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-08);
}

.ed-read {
  margin-top: 28px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ed-preview:empty {
  min-height: 1.5em;
}

@media (min-width: 1100px) {
  .editor {
    max-width: 1160px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 56px;
    align-items: start;
  }
  .ed-area {
    height: calc(100dvh - var(--bar) - 300px);
    min-height: 420px;
    resize: none;
  }
  .ed-read {
    position: sticky;
    top: calc(var(--bar) + 24px);
    margin-top: 60px;
    max-height: calc(100dvh - var(--bar) - 120px);
    overflow: auto;
    padding: 0 0 0 0;
    border: 0;
  }
}

/* ------------------------------------------------------------ friends & lists */

.add-friend {
  display: flex;
  align-items: center;
  gap: 14px;
}

.person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.person-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.person-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.person-name {
  font-size: 16px;
  font-weight: 800;
}

.person-sub {
  font-size: 12px;
  color: var(--muted);
}

.person.is-pending {
  opacity: 0.7;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--r-2);
  background: var(--sleeve-paper);
  color: var(--sleeve-ink);
  font-weight: 700;
}

.trash .row .text-btn {
  flex: none;
}

/* ------------------------------------------------------------ dialogs */

.dialog-back {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--scrim);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

.dialog-back.is-open {
  opacity: 1;
}

.dialog {
  width: min(460px, 100%);
  max-height: min(86dvh, 760px);
  display: flex;
  flex-direction: column;
  padding: 0 28px 22px;
  border-radius: var(--r-3);
  background: var(--dialog);
  box-shadow: 0 24px 60px -20px rgba(40, 30, 26, 0.45);
  transform: translateY(10px) scale(0.985);
  transition: transform 220ms var(--ease);
  overflow: hidden;
}

.dialog.is-wide {
  width: min(720px, 100%);
}

.dialog-back.is-open .dialog {
  transform: none;
}

/* bookmark ribbon, hairline and close, as in the App's sheets */
.dialog-top {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 58px;
  flex: none;
}

.dialog-ribbon {
  position: relative;
  width: 18px;
  height: 36px;
  margin-top: -14px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}

.dialog-ribbon::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 6px;
  width: 1.4px;
  height: 14px;
  background: color-mix(in srgb, var(--dialog) 70%, transparent);
}

.dialog-rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.dialog-close {
  margin-right: -10px;
}

.dialog-title {
  flex: none;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  margin: 6px 0 16px;
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  margin: 0 -28px;
  padding: 0 28px;
}

.dialog-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  position: sticky;
  bottom: 0;
  background: var(--dialog);
}

.pick-list {
  display: flex;
  flex-direction: column;
  margin: 6px -8px 0;
  max-height: 50dvh;
  overflow: auto;
}

.pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: var(--r-2);
  text-align: left;
  font-size: 15px;
}

.pick-row .ico {
  color: var(--accent);
}

.pick-row span {
  flex: 1;
  min-width: 0;
}

.pick-row:hover {
  background: var(--accent-08);
}

.pick-row.is-on {
  font-weight: 700;
}

.pick-text {
  display: flex;
  flex-direction: column;
}

.pick-title {
  font-weight: 700;
}

.pick-sub {
  font-size: 13px;
  color: var(--muted);
}

/* settings */
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  font-size: 15px;
  text-align: left;
}

.setting.is-link {
  width: 100%;
  border-radius: var(--r-2);
  margin: 0 -8px;
  padding: 0 8px;
  width: calc(100% + 16px);
}

.setting.is-link:hover {
  background: var(--accent-08);
}

.setting.is-link .ico {
  color: var(--muted);
}

.setting-label {
  flex: 1;
}

.setting-extra {
  font-size: 13px;
  color: var(--muted);
}

.setting-sep {
  height: 1px;
  background: var(--line);
  margin: 6px 0;
}

.setting-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 6px;
}

.chip {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
}

.chip.is-on {
  border-color: var(--accent);
  background: var(--accent-14);
  color: var(--accent);
  font-weight: 700;
}

.switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  border-radius: 16px;
  background: var(--line-strong);
  transition: background-color 160ms;
}

.switch i {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 180ms var(--ease);
}

.switch.is-on {
  background: var(--accent);
}

.switch.is-on i {
  transform: translateX(20px);
}

/* share */
.share-subject {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
}

.choice-list {
  display: flex;
  flex-direction: column;
}

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 15px;
  color: var(--ink);
}

.choice > .ico:first-child {
  color: var(--muted);
}

.choice span {
  flex: 1;
}

.choice.is-on {
  font-weight: 700;
}

.choice.is-on > .ico:first-child,
.choice-check {
  color: var(--accent);
}

.share-link {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.share-link .line-input {
  font-weight: 400;
  font-size: 13px;
}

/* palette */
.palette-list {
  display: flex;
  flex-direction: column;
  max-height: 52dvh;
  overflow: auto;
  margin: 0 -8px;
}

.palette-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 10px;
  border-radius: var(--r-2);
  text-align: left;
}

.palette-item .ico {
  color: var(--accent);
}

.palette-item.is-on {
  background: var(--accent-08);
}

.palette-title {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-sub {
  font-size: 12px;
  color: var(--muted);
}

/* menus */
.menu {
  position: fixed;
  z-index: 70;
  min-width: 168px;
  padding: 6px 0;
  border-radius: var(--r-2);
  background: var(--dialog);
  box-shadow: 0 10px 30px -10px rgba(40, 30, 26, 0.35), 0 0 0 1px var(--line);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 140ms var(--ease), transform 140ms var(--ease);
}

.menu.is-open {
  opacity: 1;
  transform: none;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  text-align: left;
  font-size: 15px;
  color: var(--ink);
}

.menu-item:hover,
.menu-item:focus-visible {
  background: var(--accent-08);
  outline: none;
}

.menu-item.is-danger {
  color: var(--accent);
}

.menu-check {
  width: 18px;
  color: var(--accent);
}

.menu-sep {
  height: 1px;
  margin: 6px 0;
  background: var(--line);
}

/* SnackBar */
.toast-host {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 8px 0 18px;
  border-radius: var(--r-2);
  background: #323232;
  color: #f4f4f4;
  font-size: 14px;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  animation: toast-in 220ms var(--ease);
}

.toast span {
  flex: 1;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 200ms, transform 200ms;
}

.toast-action {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--r-2);
  color: #e9c3bf;
  font-weight: 700;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ------------------------------------------------------------ login & shared */

.login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(380px, 100% - 40px);
  margin: 0 auto;
  padding: 48px 0;
}

.login .wordmark {
  font-size: 48px;
  margin-bottom: 40px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-form .fill-btn {
  margin-top: 18px;
}

.form-error {
  min-height: 20px;
  font-size: 13px;
  color: var(--accent);
}

.login-preview {
  align-self: center;
  margin-top: 14px;
}

.shared-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
}

.shared-bar-end {
  justify-self: end;
}

/* ------------------------------------------------------------ wide screens */

@media (min-width: 900px) {
  .search {
    padding-top: 12vh;
  }
  .wordmark {
    font-size: 56px;
  }
  .tpl-stage {
    height: 280px;
  }
  .tpl-card {
    padding: 20px;
  }
  .tpl-title {
    font-size: 17px;
  }
  .tpl-hint {
    font-size: 12px;
  }
  .search {
    max-width: 680px;
  }
  .library {
    max-width: 1000px;
  }
  .library-tools {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .library-tools > .inline-action {
    width: auto;
    order: -1;
    margin-right: 8px;
  }
  .library-tools .inline-row {
    display: flex;
    gap: 8px;
  }
  .library-tools .display-bar {
    order: 2;
    margin-left: auto;
  }
  .library-body {
    margin-top: 28px;
  }
  .cabinet-folders,
  .cabinet-papers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 36px;
    align-items: start;
  }
  .cabinet-papers {
    gap: 16px 36px;
    margin-top: 40px;
  }
  .cabinet .sleeve + .sleeve {
    margin-top: 0;
  }
  .cabinet .paper {
    margin-top: 0;
  }
  .tpl-masonry {
    columns: 3;
  }
  .templates {
    max-width: 960px;
  }
}

@media (min-width: 1280px) {
  .cabinet-folders,
  .cabinet-papers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 719px) {
  .dialog-back {
    align-items: end;
    padding: 0;
  }
  .dialog {
    width: 100%;
    max-height: 88dvh;
    border-radius: var(--r-3) var(--r-3) 0 0;
    padding-bottom: calc(18px + var(--safe-b));
    transform: translateY(24px);
  }
  .nav-item {
    min-width: 64px;
  }
  .bar-btn.is-friends {
    display: none;
  }
  .nav-item:nth-child(2) {
    min-width: 56px;
  }
}

@media (max-width: 380px) {
  :root {
    --gutter: 16px;
  }
  .nav-item {
    min-width: 54px;
    font-size: 17px;
  }
}

/* empty pages: an abstract archive print, the App's own words, one action */
.empty-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 0 40px;
  text-align: center;
  animation: empty-in 700ms var(--ease) both;
}

.empty-art-print {
  width: 168px;
  height: 140px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.82;
  animation: empty-drift 9s ease-in-out infinite alternate;
}

:root[data-theme='night'] .empty-art-print {
  opacity: 0.5;
  filter: invert(1) hue-rotate(180deg) saturate(0.7);
}

.empty-art-text {
  font-size: 14px;
  color: var(--muted);
}

@keyframes empty-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes empty-drift {
  from {
    transform: translateY(0) rotate(-1.2deg);
  }
  to {
    transform: translateY(-6px) rotate(1.2deg);
  }
}

/* ------------------------------------------------------------ phone motion */

@media (prefers-reduced-motion: no-preference) {
  .app:not(.is-workspace) .main {
    view-transition-name: page;
  }
  .app:not(.is-workspace) .bar {
    view-transition-name: bar;
  }
  ::view-transition-old(bar),
  ::view-transition-new(bar) {
    animation-duration: 200ms;
  }
  html[data-vt-dir='next']::view-transition-old(page) {
    animation: vt-out-left 260ms cubic-bezier(0.4, 0, 0.2, 1) both;
  }
  html[data-vt-dir='next']::view-transition-new(page) {
    animation: vt-in-right 380ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  html[data-vt-dir='prev']::view-transition-old(page) {
    animation: vt-out-right 260ms cubic-bezier(0.4, 0, 0.2, 1) both;
  }
  html[data-vt-dir='prev']::view-transition-new(page) {
    animation: vt-in-left 380ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  html[data-vt-dir='deeper']::view-transition-old(page) {
    animation: vt-sink 220ms cubic-bezier(0.4, 0, 1, 1) both;
  }
  html[data-vt-dir='deeper']::view-transition-new(page) {
    animation: vt-surface 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@keyframes vt-out-left {
  to {
    opacity: 0;
    transform: translateX(-36px);
  }
}

@keyframes vt-in-right {
  from {
    opacity: 0;
    transform: translateX(48px);
  }
}

@keyframes vt-out-right {
  to {
    opacity: 0;
    transform: translateX(36px);
  }
}

@keyframes vt-in-left {
  from {
    opacity: 0;
    transform: translateX(-48px);
  }
}

@keyframes vt-sink {
  to {
    opacity: 0;
    transform: scale(0.985);
  }
}

@keyframes vt-surface {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* "/" insert menu */
.slash {
  position: fixed;
  z-index: 75;
  min-width: 188px;
  max-height: 340px;
  overflow: auto;
  padding: 6px;
  border-radius: var(--r-2);
  background: var(--dialog);
  box-shadow: 0 14px 36px -12px rgba(40, 30, 26, 0.4), 0 0 0 1px var(--line);
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transform-origin: top left;
  transition: opacity 140ms var(--ease), transform 160ms var(--ease);
}

.slash.is-open {
  opacity: 1;
  transform: none;
}

.slash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 5px;
  font-size: 14px;
  color: var(--ink);
  text-align: left;
}

.slash-item .ico {
  color: var(--accent);
}

.slash-item.is-on {
  background: var(--accent-08);
}

/* 检索: what has been written, under the templates */
.search-recent {
  margin-top: 36px;
}

.search-recent-head {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-recent-head .desk-head {
  margin: 0;
}

.desk-starters {
  margin-top: 8px;
}

/* ------------------------------------------------------------ 星空 / 纸面 */

.pull-hint {
  display: flex;
  justify-content: center;
  margin: 2px auto -6px;
  padding: 6px 12px;
  color: var(--accent);
  border-radius: var(--r-2);
}

.pull-hint svg {
  animation: pull-bob 1.8s ease-in-out infinite alternate;
}

@keyframes pull-bob {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(7px);
  }
}

.universe {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.universe.is-star {
  background: #000;
  color: #fff;
}

.uni-stage,
.uni-canvas,
.uni-paper {
  position: absolute;
  inset: 0;
}

.uni-canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}

.uni-canvas:active {
  cursor: grabbing;
}

.uni-paper {
  background: #faf4ea url(../assets/paper_texture.jpg) center / cover no-repeat;
}

.uni-paper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(250, 244, 234, 0.3);
  mix-blend-mode: screen;
}

:root[data-theme='night'] .uni-paper {
  filter: grayscale(1);
}

.uni-bar {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  padding: 18px max(20px, env(safe-area-inset-right, 0px)) 10px max(20px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}

.uni-bar > * {
  pointer-events: auto;
}

.uni-spacer {
  flex: 1;
}

.uni-btn.icon-btn {
  width: 42px;
  height: 42px;
  color: var(--accent);
  transition: opacity 300ms var(--ease);
}

.universe.is-star .uni-btn.icon-btn {
  color: rgba(255, 255, 255, 0.86);
}

.universe.is-focused .uni-btn[aria-label='统计'] {
  opacity: 0;
  pointer-events: none;
}

.uni-generating {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: rgba(50, 50, 50, 0.62);
}

.universe.is-star .uni-generating {
  color: rgba(255, 255, 255, 0.72);
}

/* 当你再思考创作的起点是…… */
.uni-origin {
  position: absolute;
  left: 0;
  right: 0;
  top: 32%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  opacity: 0;
  transition: opacity 360ms var(--ease);
}

.uni-origin.is-on {
  opacity: 1;
}

.uni-origin-text {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 900;
  text-align: center;
}

.uni-choices {
  display: flex;
  gap: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms var(--ease);
}

.uni-choices.is-on {
  opacity: 1;
  pointer-events: auto;
}

.uni-choice {
  padding: 10px 18px;
  font-size: 18px;
  font-weight: 900;
  color: var(--accent);
  border-radius: var(--r-2);
}

.uni-choice:hover {
  background: var(--accent-08);
}

/* the page a star unfolds into */
.uni-intro-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 72px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}

.uni-intro-layer.is-on {
  pointer-events: auto;
}

.uni-intro {
  width: min(760px, 100%);
  max-height: min(82dvh, 900px);
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 18px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: scale(0.04);
  opacity: 0;
  filter: blur(6px);
  transition: transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 360ms var(--ease), filter 420ms var(--ease);
  touch-action: pan-y;
  user-select: text;
  -webkit-user-select: text;
}

.uni-intro.is-open {
  transform: none;
  opacity: 1;
  filter: none;
}

.universe.is-paper .uni-intro {
  box-shadow: 0 24px 70px rgba(60, 40, 20, 0.22), 0 0 0 1px var(--line);
}

.uni-wiki .banner.is-mini {
  height: 150px;
  margin-top: 0;
}

.uni-wiki-body {
  padding: 0 32px;
}

.uni-wiki .wiki-article {
  padding-top: 30px;
}

.uni-intro-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding: 14px 24px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

@media (max-width: 719px) {
  .uni-intro-layer {
    padding: 70px 12px 14px;
  }
  .uni-intro {
    max-height: calc(100dvh - 90px);
  }
  .uni-wiki .banner.is-mini {
    height: 110px;
  }
  .uni-wiki-body {
    padding: 0 18px;
  }
  .uni-wiki .wiki-article .infobox {
    float: none;
    width: auto;
    margin: 0 0 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pull-hint svg {
    animation: none;
  }
  .uni-intro {
    transition: none;
  }
}

html.is-universe,
html.is-universe body {
  overflow: hidden;
}

/* 分享卡片 */
.sharecard {
  min-height: 200px;
}

.sharecard-wait {
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
}

.sharecard-count {
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

.sharecard-strip {
  display: flex;
  gap: 16px;
  max-height: 62vh;
  overflow: auto;
  padding: 4px 2px 12px;
  overscroll-behavior: contain;
}

.sharecard-item {
  flex: 0 0 min(300px, 74vw);
  margin: 0;
}

.sharecard-strip:has(.sharecard-item:only-child) {
  justify-content: center;
}

.sharecard-item:only-child {
  flex-basis: min(420px, 86vw);
}

.sharecard-item img {
  display: block;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
}

.sharecard-item figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* ------------------------------------------------------------ 机密 */

:root {
  --seal-friends: #557596;
  --seal-password: #b4473c;
  --seal-self: #7c2b25;
}

:root[data-theme='night'] {
  --seal-friends: #8fb0d2;
  --seal-password: #e2867b;
  --seal-self: #f0a39a;
}

.seal {
  --c: var(--seal-password);
  display: inline-flex;
  align-items: center;
  margin-left: 14px;
  padding: 3px 3px;
  border: 1.5px solid var(--c);
  border-radius: 3px;
  color: var(--c);
  vertical-align: middle;
  transform: rotate(-6deg);
  opacity: 0.88;
  font: inherit;
  line-height: 1;
  cursor: default;
  transition: transform 180ms var(--ease), opacity 180ms;
}

button.seal {
  cursor: pointer;
}

button.seal:hover {
  transform: rotate(-2deg) scale(1.06);
  opacity: 1;
}

.seal-text {
  display: block;
  padding: 3px 6px 3px 8px;
  border: 1px solid color-mix(in srgb, var(--c) 70%, transparent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.22em;
  white-space: nowrap;
}

.seal.is-friends {
  --c: var(--seal-friends);
}

.seal.is-self {
  --c: var(--seal-self);
  border-width: 2.5px;
}

.seal.is-small {
  margin: 0;
  transform: rotate(-6deg) scale(0.86);
}

.tree-lock,
.card-lock {
  margin-left: 6px;
  color: var(--faint);
  flex: none;
  vertical-align: -1px;
}

/* the 机密 dialog */
.choice.is-tall {
  min-height: 64px;
}

.choice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.choice-label {
  font-size: 15px;
}

.choice-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.choice > .seal,
.choice > .ico:first-child {
  flex: none;
}

.choice .seal span {
  flex: none;
}

.choice > .ico:first-child {
  width: 52px !important;
  padding: 0 14px;
}

.choice > .seal.is-small {
  width: 52px;
  justify-content: center;
  padding: 2px;
}

.choice-text {
  flex: 1;
}

.secret-friends {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
}

.secret-friends .avatar {
  flex: none;
}

.secret-pw {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.secret-empty {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.secret .dialog-actions {
  align-items: center;
}

.secret-preview {
  font-size: 13px;
}

/* what a visitor sees in place of a sealed entry */
.sealed-page {
  display: grid;
  place-items: center;
  min-height: 56vh;
  padding: 40px 0;
}

.sealed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(420px, 100%);
  margin: 0 auto;
  padding: 36px 28px 30px;
  text-align: center;
  transition: opacity 400ms var(--ease), transform 400ms var(--ease);
}

.sealed-stamp {
  --c: var(--seal-password);
  padding: 4px;
  margin-bottom: 12px;
  border: 2.5px solid var(--c);
  border-radius: 4px;
  color: var(--c);
  transform: rotate(-8deg);
  opacity: 0.86;
}

.sealed.is-friends .sealed-stamp {
  --c: var(--seal-friends);
}

.sealed-stamp span {
  display: block;
  padding: 8px 14px 8px 20px;
  border: 1px solid color-mix(in srgb, var(--c) 70%, transparent);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.32em;
}

.sealed-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
}

.sealed-sub {
  font-size: 14px;
  color: var(--muted);
}

.sealed-hint {
  font-size: 13px;
  color: var(--faint);
}

.sealed-form {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

.sealed-form .line-input {
  flex: 1;
  min-width: 0;
}

.sealed.is-shake {
  animation: sealed-shake 360ms var(--ease);
}

@keyframes sealed-shake {
  20% {
    transform: translateX(-7px);
  }
  45% {
    transform: translateX(6px);
  }
  70% {
    transform: translateX(-3px);
  }
}

.sealed.is-opening .sealed-stamp {
  transition: transform 420ms var(--ease), opacity 420ms;
  transform: rotate(-20deg) translateY(-16px) scale(1.12);
  opacity: 0;
}

.uni-wiki .sealed {
  padding-top: 44px;
}

.shared-sky {
  font-size: 14px;
}
.login-help {font-size: .9rem; line-height: 1.7; opacity: .8; margin: 1rem 0;}
.login-agreement {display:flex; gap:.6rem; align-items:flex-start; font-size:.9rem; line-height:1.6; margin:1rem 0;}
.login-agreement input {margin-top:.3rem; flex-shrink:0;}
.login-agreement a {text-decoration:underline;}
.sync-notice {position:fixed;left:1rem;right:1rem;bottom:1rem;z-index:10000;padding:.8rem 1rem;background:var(--paper,#faf4ea);color:var(--ink,#222);border:1px solid currentColor;border-radius:.6rem;display:flex;gap:1rem;align-items:center;flex-wrap:wrap;font-size:1rem;box-shadow:0 4px 20px #0002;}
.sync-notice[hidden] {display:none;}
.sync-notice[data-status=error] {border-color:#a43c30;}
.slider-box {padding:.5rem 0 1rem;}
.slider-box[hidden] {display:none;}
.slider-track {position:relative;padding:.6rem 0;}
.slider-track input {width:100%;min-height:2.75rem;position:relative;background:transparent;accent-color:var(--ink,#333);}
.slider-marker {position:absolute;top:0;bottom:0;width:6px;background:#4f9177;border-radius:4px;transform:translateX(-50%);}
