:root {
  --ink: #242e29;
  --sub: #68746d;
  --green: #29604a;
  --edge: #dce2db;
  --base: #f7f8f4;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font: 14px/1.55 var(--sans);
  color: var(--ink);
  background: var(--base);
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: none;
  border: 0;
  cursor: pointer;
}
button:hover {
  filter: brightness(0.96);
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #689780;
  outline-offset: 2px;
}
button svg {
  flex: none;
}
#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}
aside {
  background: #f0f3ec;
  border-right: 1px solid #dce2d8;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 30px 17px 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px 32px;
  font-weight: 730;
  letter-spacing: 0.04em;
  font-size: 20px;
}
.mark,
.profile > b {
  border-radius: 10px;
  background: var(--green);
  color: white;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
}
.mark svg {
  stroke-width: 1.7;
}
.side-body {
  flex: 1;
  overflow-y: auto;
}
.caption,
.date,
.eyeline,
.nav small,
.crumb,
.device,
.list-head small,
.list-head span,
.note time,
.citation,
.chip,
.quiet,
.activity small,
.metric span,
.help,
.profile small {
  font-size: 12px;
}
.caption {
  font-weight: 600;
  color: #738075;
  letter-spacing: 0.06em;
  padding: 12px 12px 8px;
}
.nav {
  width: 100%;
  justify-content: flex-start;
  padding: 11px 13px;
  gap: 12px;
  font-weight: 520;
  border-radius: 8px;
  line-height: 1.4;
  color: #48574d;
  margin: 2px 0;
}
.nav small {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: #647769;
}
.nav.active,
.tagrow.sel {
  background: #dce8da;
  color: #204c38;
}
.active span {
  font-weight: 650;
}
.nav:hover,
.tagrow:hover,
.iconbtn:hover {
  background: #e5ece1;
}
.tags-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 25px;
  border-top: 1px solid var(--edge);
  padding-top: 22px;
}
.tags-title .iconbtn {
  height: 22px;
  width: 22px;
}
.iconbtn {
  color: #6a766d;
  padding: 4px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
}
.tagrow {
  display: flex;
  align-items: center;
  border-radius: 6px;
}
.tree {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  padding: 0;
  flex: none;
  color: #78877b;
}
.tagname {
  display: block;
  padding: 7px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  color: #526258;
  font-size: 13px;
}
.tagname em,
.chip i {
  font-style: normal;
  color: #749280;
}
.profile {
  border-top: 1px solid var(--edge);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 7px 2px;
}
.profile > b {
  background: #e3d9ae;
  color: #504b34;
  width: 33px;
  height: 33px;
  font-size: 14px;
}
.profile strong,
.profile small {
  display: block;
}
.profile strong {
  font-size: 13px;
}
.profile small {
  font-size: 11px;
  color: var(--sub);
}
.profile .iconbtn {
  margin-left: auto;
}
main {
  min-width: 0;
}
.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(21px, 3.2vw, 55px);
  height: 62px;
  border-bottom: 1px solid var(--edge);
  background: #fbfcf8;
}
.crumb,
.device,
.eyeline {
  display: flex;
  align-items: center;
  gap: 9px;
}
.crumb {
  color: #68766c;
}
.crumb em {
  color: #b4bdb5;
  font-style: normal;
}
.crumb .iconbtn,
.scrim {
  display: none;
}
.device,
.secondary,
.lightbtn {
  border-radius: 7px;
  border: 1px solid var(--edge);
  padding: 7px 12px;
  background: #fff;
}
.workspace {
  padding: 30px clamp(21px, 3.2vw, 55px) 64px;
  max-width: 1540px;
  margin: auto;
}
.pagehead {
  margin-bottom: 20px;
}
.date {
  color: #6e7d71;
  letter-spacing: 0.045em;
}
.pagehead h1 {
  margin: 5px 0 0;
  font-weight: 690;
  font-size: clamp(27px, 2.7vw, 37px);
  letter-spacing: -0.04em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(205px, 20vw, 282px);
  gap: clamp(17px, 2vw, 32px);
  align-items: start;
}
.primarycol {
  min-width: 0;
}
.composer,
.note,
.activity,
.review-screen,
.connection {
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: white;
}
.composer {
  padding: 17px 20px 13px;
  box-shadow: 0 3px 10px #31473207;
}
.composer label,
.activity header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 620;
}
.composer label svg,
.activity header svg {
  color: var(--green);
}
.composer textarea {
  display: block;
  width: 100%;
  resize: vertical;
  min-height: 72px;
  height: 78px;
  border: 0;
  padding: 12px 0;
  background: transparent;
  font-size: 15px;
}
.composer textarea::placeholder,
.search input::placeholder {
  color: #8c978f;
}
.composer footer,
.note header,
.list-head,
.setting,
.steps,
.connection {
  display: flex;
  align-items: center;
}
.composer footer {
  border-top: 1px solid #edf0ea;
  justify-content: space-between;
  padding-top: 11px;
}
.quiet {
  color: #637668;
  padding: 4px 0;
}
.primary,
.lightbtn,
.secondary {
  font-size: 13px;
  font-weight: 550;
  min-height: 34px;
}
.primary {
  background: var(--green);
  color: white;
  border-radius: 7px;
  padding: 7px 13px;
}
.filters {
  display: flex;
  gap: 9px;
  margin: 20px 0 17px;
}
.search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: #fff;
  padding: 7px 10px;
  color: #829086;
}
.search input {
  width: 100%;
  border: 0;
  background: transparent;
  min-width: 0;
  font-size: 13px;
}
.filters select,
.setting select {
  background: white;
  border: 1px solid var(--edge);
  border-radius: 7px;
  font-size: 12px;
  padding: 0 8px;
}
.list-head {
  margin-bottom: 11px;
  gap: 8px;
}
.list-head strong {
  font-size: 16px;
}
.list-head small {
  color: var(--sub);
  background: #eaf0e8;
  border-radius: 5px;
  padding: 0 6px;
}
.list-head span {
  margin-left: auto;
  color: var(--sub);
}
.note {
  padding: 15px 20px 17px;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #57685a;
}
.source svg {
  color: #75926e;
}
.source.reading,
.source.reading svg {
  color: #91794a;
}
.note time {
  color: #89938b;
  margin-left: 12px;
  font-variant-numeric: tabular-nums;
}
.note header .iconbtn {
  margin-left: auto;
  width: 24px;
  height: 24px;
}
.note header .iconbtn svg {
  width: 14px;
}
.trash-tools {
  justify-content: space-between;
}
.recycled header {
  flex-wrap: wrap;
  gap: 8px;
}
.recycled time {
  margin-left: 0;
  margin-right: auto;
}
.note p,
blockquote {
  white-space: pre-wrap;
  line-height: 1.85;
  font-size: 14px;
}
.note p {
  margin: 11px 0;
}
.note p:last-child {
  margin-bottom: 0;
}
.chips,
.device-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  background: #edf3ea;
  border-radius: 5px;
  color: #44694f;
  padding: 2px 8px;
  gap: 3px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.chip:nth-child(2n) {
  background: #f3f0e7;
  color: #736b4c;
}
.chip:nth-child(2n) i {
  color: #998e6d;
}
blockquote {
  margin: 13px 0 5px;
  padding: 2px 0 2px 12px;
  border-left: 3px solid #bcab7f;
  color: #424b40;
}
.citation {
  color: #847e6f;
  margin: 4px 0 10px;
}
.rail {
  display: grid;
  gap: 18px;
}
.reviewbox {
  background: #234b3c;
  color: #f6f5de;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.illustration {
  height: 122px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 140%, #456e54, transparent 75%);
}
.orbit {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background: repeating-radial-gradient(
    ellipse at 105% -75%,
    transparent 0 16px,
    #93aa7e 17px 17.5px,
    transparent 18px 29px
  );
}
.paper {
  width: 116px;
  height: 72px;
  position: absolute;
  top: 36px;
  left: 50%;
  border-radius: 3px;
  box-shadow: 1px 5px 7px #142e243c;
}
.paper.back {
  background: #9eb08d;
  transform: translateX(-58%) rotate(-19deg);
}
.paper.mid {
  background: #ccd1a8;
  transform: translateX(-50%) rotate(-4deg);
}
.paper.front {
  background: repeating-linear-gradient(0deg, #e5dcb8 0 1px, #eee7c9 1px 13px);
  transform: translateX(-43%) rotate(10deg);
  padding: 7px 14px;
}
.paper.front span {
  font:
    36px/1 Georgia,
    serif;
  color: #627454;
  height: 26px;
  display: block;
}
.paper.front b {
  background: #919777;
  width: 75%;
  height: 2px;
  display: block;
  margin: 5px 0;
}
.paper.front b:last-child {
  width: 52%;
}
.review-inner {
  padding: 7px 21px 21px;
}
.review-inner .eyeline {
  color: #ccd8c2;
}
.review-inner h2 {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 26px;
  letter-spacing: 0.04em;
  margin: 7px 0 3px;
}
.review-inner p {
  margin: 0;
  color: #c7d4c6;
  font-size: 13px;
}
.lightbtn {
  margin-top: 17px;
  background: #f1f2df;
  color: #2b4c36;
  border: 0;
  width: 100%;
  justify-content: space-between;
  padding: 8px 12px;
}
.activity {
  padding: 17px 18px;
}
.activity header {
  font-size: 14px;
}
.metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 12px 0 6px;
}
.metric b {
  font-size: 26px;
  line-height: 1.2;
}
.metric span,
.activity small {
  color: var(--sub);
}
.bars {
  display: flex;
  gap: 7px;
  justify-content: space-between;
}
.bars > div {
  text-align: center;
  flex: 1;
}
.bar-track {
  height: 47px;
  display: flex;
  align-items: end;
  justify-content: center;
}
.bar-track i {
  background: #c6d7c4;
  width: 100%;
  max-width: 23px;
  border-radius: 3px 3px 1px 1px;
}
.bar-track i.last {
  background: #48765a;
}
.bars small {
  font-size: 10px;
}
.connection,
.review-screen {
  padding: 21px;
}
.connection {
  justify-content: space-between;
  gap: 10px;
}
.connection .primary {
  flex: none;
}
.eyeline {
  color: var(--green);
}
.connection strong {
  font-size: 19px;
  display: block;
  margin: 6px 0;
}
.connection p,
.help {
  color: var(--sub);
  margin: 5px 0;
}
.review-screen h2 {
  font-size: 20px;
}
.steps,
.setting {
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
}
.empty {
  padding: 36px;
  text-align: center;
  color: var(--sub);
}
dialog {
  width: min(460px, calc(100vw - 30px));
  max-height: 85dvh;
  padding: 23px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  color: var(--ink);
  box-shadow: 0 20px 75px #13281d25;
}
dialog::backdrop {
  background: #19291f65;
}
dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}
dialog h2 {
  font-size: 20px;
  margin: 0;
}
dialog label {
  display: grid;
  gap: 5px;
  margin: 14px 0;
}
dialog input,
dialog select,
dialog textarea {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--edge);
  width: 100%;
  background: white;
}
dialog textarea {
  min-height: 130px;
}
.delete-note {
  color: #993b36;
}
.device-options {
  margin-top: 16px;
}
.chosen {
  background: #e3eee0;
  border-color: #acc2ac;
}
.setting {
  padding: 10px 0;
  border-top: 1px solid var(--edge);
}
#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #254934;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
}
#toast.show {
  opacity: 1;
}
dialog:modal ~ #toast.show {
  z-index: 100;
}
@media (max-width: 1100px) {
  #app {
    grid-template-columns: 185px minmax(0, 1fr);
  }
  .workspace {
    padding-left: 22px;
    padding-right: 22px;
  }
  .columns {
    grid-template-columns: minmax(0, 1fr) 201px;
    gap: 15px;
  }
  aside {
    padding-left: 11px;
    padding-right: 11px;
  }
}
@media (max-width: 880px) {
  .columns {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    display: none;
  }
}
#app.android {
  display: block;
  position: relative;
  max-width: 430px;
  margin: auto;
  background: var(--base);
  box-shadow:
    0 0 0 1px var(--edge),
    0 0 70px #36573b12;
  overflow: clip;
}
#app.android .topline {
  height: 52px;
  padding: 0 15px;
}
#app.android .workspace {
  padding: 24px 15px 40px;
}
#app.android .columns {
  grid-template-columns: minmax(0, 1fr);
}
#app.android .rail {
  display: none;
}
#app.android .crumb .iconbtn {
  display: flex;
}
#app.android aside {
  display: none;
}
#app.android.menu-open aside {
  position: absolute;
  display: flex;
  left: 0;
  top: 0;
  width: 226px;
  z-index: 7;
  height: 100dvh;
}
#app.android.menu-open .scrim {
  display: block;
  position: absolute;
  inset: 0;
  background: #203c2e55;
  z-index: 6;
}
#app.android .connection {
  flex-wrap: wrap;
}
@media (max-width: 650px) {
  #app {
    display: block;
  }
  aside {
    display: none;
  }
  .menu-open aside {
    display: flex;
    position: fixed;
    z-index: 7;
    left: 0;
    top: 0;
    width: 226px;
  }
  .menu-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: #203c2e55;
    z-index: 6;
  }
  .crumb .iconbtn {
    display: flex;
  }
  .topline {
    padding: 0 12px;
    height: 52px;
  }
  .workspace {
    padding: 24px 14px 40px;
  }
  .composer,
  .note {
    padding: 14px;
  }
  .connection {
    flex-wrap: wrap;
  }
  .pagehead {
    margin-bottom: 15px;
  }
  .pagehead h1 {
    font-size: 29px;
  }
}
button.source {
  padding: 0;
}
.note[data-note] {
  cursor: pointer;
}
.fulltext {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.85;
}
dialog #toast {
  position: static;
  transform: none;
  display: none;
  margin-top: 12px;
  text-align: center;
}
dialog #toast.show {
  display: block;
}

.tag-tools {
  display: inline-flex;
  gap: 4px;
}
.tagrow .iconbtn {
  margin-left: auto;
  flex: none;
  width: 24px;
  height: 26px;
}
.tagrow .iconbtn svg {
  width: 14px;
}
@media (hover: hover) and (min-width: 651px) {
  .tagrow:not(:hover):not(:focus-within) .iconbtn {
    opacity: 0;
  }
  #app.android .tagrow .iconbtn {
    opacity: 1;
  }
}

.composer-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.composer .pick-picture,
dialog .pick-picture {
  display: inline-flex;
  position: relative;
  cursor: pointer;
  font-size: 13px;
  color: var(--green);
  align-items: center;
  min-height: 32px;
  margin: 0 10px 0 0;
}
.pick-picture:focus-within {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.pick-picture input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  padding: 0;
  border: 0;
}
.picture-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.picture-cell {
  position: relative;
  max-width: 100%;
}
.picture-cell ao-picture {
  display: block;
}
.picture-cell img {
  display: block;
  width: 100px;
  height: 82px;
  object-fit: cover;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: var(--base);
}
.picture-cell .iconbtn {
  position: absolute;
  right: 3px;
  top: 3px;
  color: white;
  background: #223b2ccc;
  width: 26px;
  height: 26px;
}
dialog .picture-grid:not([data-gallery] .picture-grid) {
  display: grid;
}
dialog .picture-grid:not([data-gallery] .picture-grid) img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}
.picture-preview {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 7px;
}
dialog.picture-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  width: min(1120px, 96vw);
  height: 92dvh;
  max-height: 96dvh;
  background: #16211c;
  color: #f6f8f5;
  border: 0;
  padding: 16px;
  overflow: hidden;
}
.picture-viewer::backdrop {
  background: #101812dc;
}
.picture-viewer header {
  margin: 0;
  gap: 14px;
}
.picture-viewer strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.picture-viewer button {
  background: #35463c;
  color: inherit;
  border-radius: 8px;
  min-height: 42px;
  padding: 7px 17px;
  flex-shrink: 0;
}
.viewer-stage {
  min-height: 0;
  min-width: 0;
  touch-action: none;
  overflow: hidden;
  overscroll-behavior: contain;
  user-select: none;
}
.viewer-stage ao-picture,
.viewer-stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.picture-viewer footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-variant-numeric: tabular-nums;
}
.viewer-stage.long-picture {
  margin-inline: -12px;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  align-items: center;
}
.viewer-stage.long-picture ao-picture,
.viewer-stage.long-picture img {
  height: auto;
}
@media (max-width: 650px), (pointer: coarse) and (max-height: 650px) {
  dialog.picture-viewer[open] {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    padding: 12px 12px max(12px, env(safe-area-inset-bottom));
  }
}

.viewer-stage.zoomed {
  cursor: grab;
}
.viewer-stage.zoomed:active {
  cursor: grabbing;
}
.picture-viewer .zoom-reset {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.picture-viewer .zoom-reset:disabled {
  opacity: 0.6;
  cursor: default;
}
