:root {
  color-scheme: light dark;
  --base: #f5f7f5;
  --card: #fff;
  --text: #192e28;
  --sub: #61726d;
  --line: #dce5e0;
  --accent: #116551;
  --on-accent: #fff;
  --wash: #e6f3ed;
  --warn: #aa372d;
  --shade: 0 2px 5px rgba(23,64,49,.03);
  font: 16px/1.6 system-ui, "PingFang SC", "Microsoft Yahei", sans-serif;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  :root {
    --base: #131b19;
    --card: #1b2623;
    --text: #e5efe9;
    --sub: #a1b5ad;
    --line: #364841;
    --accent: #9de2bd;
    --on-accent: #102b21;
    --wash: #294338;
    --warn: #ffa39a;
  }
}
* { box-sizing: border-box }
[hidden], .sprites { display: none !important }
body { margin: 0; background: var(--base); color: var(--text) }
h1,h2,h3,p { margin: 0 }
h1 { font-size: 1.45rem }
h2 { font-size: 1.21rem }
h3 { font-size: 1rem }
p { font-size: .9rem; color: var(--sub); line-height: 1.7 }
bdi { overflow-wrap: anywhere }
button, textarea, input { font: inherit; color: inherit; margin: 0 }
button {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  flex: none; gap: .45rem; min-height: 42px; padding: 0 16px;
  background: none; border: 1px solid transparent; border-radius: 11px;
  font-weight: 570; font-size: .9rem; cursor: pointer; touch-action: manipulation;
}
button:focus-visible, input:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
button:not(:disabled):active { transform: translateY(1px) }
.primary { color: var(--on-accent); background: var(--accent) }
.soft { color: var(--accent); background: var(--wash) }
.bordered { background: var(--card); border-color: var(--line) }
.ghost { padding: 0 10px; color: var(--sub) }
.icon { width: 42px; padding: 0 }
.link { color: var(--accent); padding: 0 4px }
.danger { background: var(--warn); color: var(--on-accent) }
button:disabled { opacity: .55; cursor: default }
input, textarea {
  display: block; width: 100%; padding: 10px 12px; min-width: 0;
  font-size: 1rem; border: 1px solid var(--line); border-radius: 11px;
  background: var(--card);
}
textarea { resize: vertical }
svg:not(.scene) {
  flex: none; width: 19px; height: 19px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.wrap {
  max-width: 1110px; margin: auto;
  padding-left: max(32px,env(safe-area-inset-left));
  padding-right: max(32px,env(safe-area-inset-right));
}
header { position: sticky; top: 0; background: var(--card); border-bottom: 1px solid var(--line); z-index: 2 }
.bar, .brand, .actions, .section-title, .dialog-title, .foot, .byline, li {
  display: flex; align-items: center; gap: 10px;
}
.bar { height: 76px }
.brand { margin-right: auto }
.brand img { border-radius: 10px }
.brand span { font-size: .94rem; color: var(--sub); border-left: 1px solid var(--line); padding-left: 14px; margin-left: 4px }
#sync { color: var(--accent); font-size: .82rem; font-weight: 500 }
#sync svg { width: 16px }
#sync.bad, #roster .link { color: var(--warn) }
@media (prefers-reduced-motion: no-preference) {
  .busy svg { animation: spin 1s infinite linear }
  @keyframes spin { to { transform: rotate(360deg) } }
}
#total { color: var(--sub) }
main.wrap { padding-top: 44px; padding-bottom: max(40px,env(safe-area-inset-bottom)) }
#problem, #over { color: var(--warn); text-align: center; margin-bottom: 14px }
.paperbox { border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shade) }
.scene { width: 188px; height: 92px; display: block; margin: 0 auto 22px }
.sea { fill: var(--wash) }
.drawing, .bubble, .paper, .fold, .lines, .route {
  fill: var(--card); stroke: var(--accent); stroke-linejoin: round; stroke-linecap: round; stroke-width: 2;
}
.route { fill: none; stroke-dasharray: 4 6 }
.paper, .fold { fill: #d8ee84; stroke: #116551 }
.bubble { fill: var(--accent) }
.lines { fill: none; stroke: var(--on-accent) }
.entry { width: min(100%,425px); padding: 34px 36px 22px; text-align: center; margin: 4vh auto 0 }
.entry h2 { font-size: 1.38rem; margin-bottom: 5px }
.entry label { display: block; font-size: .87rem; font-weight: 550; margin: 18px 0 6px; text-align: left }
.entry > .primary, #submit { width: 100%; min-height: 48px; margin: 20px 0 10px }
.entry .link { font-size: .84rem }
code { display: block; font: 600 clamp(1rem,4.9vw,1.38rem) ui-monospace, Menlo, Consolas, monospace; letter-spacing: .02em; color: var(--accent); user-select: all }
#code { margin: 22px 0 10px; padding: 16px 0; border-radius: 12px; background: var(--wash) }
#expires, time { font-variant-numeric: tabular-nums }
#desk { display: grid; align-items: start; grid-template-columns: .72fr 1fr; gap: 5% }
#desk > section { min-width: 0 }
#composer { position: sticky; top: 104px }
.section-title { min-height: 42px; margin-bottom: 14px; gap: 10px }
.section-title h2 { margin-right: auto; flex: none }
.section-title bdi, .byline bdi { overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
.limit, #me, .foot { color: var(--sub); font-size: .82rem }
.editor { overflow: hidden }
.editor:focus-within { border-color: var(--accent) }
#draft { height: 176px; min-height: 80px; border: 0; padding: 20px; outline: none }
.editor .actions { justify-content: space-between; padding: 16px; border-top: 1px solid var(--line) }
#post:disabled, #instant:disabled { color: var(--sub); background: var(--base); opacity: .78 }
.foot { padding: 14px 4px; gap: 5px }
.foot svg { width: 15px; height: 15px }
#shortcut { margin-left: auto }
#find,.dialog-title button { margin-right: -7px }
#feed h3 { color: var(--sub); font-size: .82rem; font-weight: 520; margin: 18px 0 8px }
#feed h3:first-child { margin-top: 0 }
#filter { margin-bottom: 16px }
.message { margin-bottom: 12px; padding: 15px 20px 18px }
.byline { font-size: .83rem; font-weight: 550; color: var(--accent) }
time { color: var(--sub); font-weight: 440; margin-right: auto }
.byline button { min-height: 36px }
.copy { font-size: .86rem; padding-inline: 12px }
.byline .icon { width: 36px; margin-right: -6px }
.byline svg { width: 16px }
.body { line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 8px }
.clip { max-height: 9.9em; overflow: hidden }
.more { margin-bottom: -10px; font-size: .83rem; padding: 0 }
.placeholder { text-align: center; border: 1px dashed var(--line); padding: 44px 16px; border-radius: 18px }
.placeholder h3 { margin-bottom: 4px }
dialog {
  border: 1px solid var(--line); border-radius: 20px; background: var(--card); color: var(--text);
  width: min(448px,calc(100% - 32px)); padding: 24px;
  box-shadow: 0 20px 65px #0002; max-height: 86vh; max-height: 86dvh;
  overscroll-behavior: contain;
}
dialog::backdrop { background: rgb(13 30 25 / .46) }
.dialog-title { margin: -6px 0 12px; justify-content: space-between }
dialog p { margin-top: 5px }
#details { margin-top: 16px; padding: 14px; text-align: center; border-radius: 12px; background: var(--base) }
#details code:not(:empty) { margin-top: 10px }
#ask .actions { justify-content: flex-end; margin-top: 24px }
#add .actions { margin: 12px 0 20px; align-items: stretch }
#verify { text-transform: uppercase }
#roster { list-style: none; padding: 0; margin: 0 }
li { border-top: 1px solid var(--line); padding: 7px 0; min-height: 56px; font-size: .94rem }
li span { color: var(--sub); font-size: .84rem; white-space: nowrap; margin-left: auto }
#roles { font-size: .81rem }
#helpbox h3:not(:first-of-type), #raw { margin-top: 16px }
#toast {
  position: fixed; z-index: 4; bottom: max(42px,env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%); padding: 11px 20px; border-radius: 14px; text-align: center;
  width: max-content; max-width: 90vw; color: var(--base); background: var(--text);
  box-shadow: 0 3px 18px #0001; font-size: .88rem; pointer-events: none;
}
@media (hover: hover) {
  button:not(:disabled):hover { filter: brightness(.93) }
  .ghost:hover { background: var(--wash); color: var(--accent) }
  .del:hover { color: var(--warn) }
  .link:hover { text-decoration: underline }
}
@media (max-width: 820px) {
  .wrap { max-width: 638px; padding-left: max(16px,env(safe-area-inset-left)); padding-right: max(16px,env(safe-area-inset-right)) }
  main.wrap { padding-top: 14px }
  .bar { height: 62px; gap: 4px }
  .bar button { padding-inline: 8px }
  .brand { gap: 7px }
  .brand span, #shortcut { display: none }
  #guide { margin-right: -8px }
  #desk { display: block }
  #composer { position: static }
  #draft { height: 96px; padding: 12px 15px; resize: none }
  .section-title { margin-bottom: 6px }
  h2 { font-size: 1.1rem }
  .entry { padding: 26px 22px 16px }
  .editor .actions { padding: 12px }
  .foot { padding: 9px 4px 15px }
  .message { padding: 12px 14px 15px }
  .byline { gap: 7px }
  .byline button { min-height: 40px }
  .byline .icon { width: 40px }
  .body { margin-top: 6px }
  .placeholder { padding: 24px 16px }
  dialog { padding: 20px }
}
@media (max-width: 360px) {
  #sync svg, #manage svg { display: none }
  .section-title { gap: 3px }
  .editor button { padding-inline: 8px }
}
