:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #363340;
  background: #f8f7fb;
  --ink: #363340; --muted: #77717e; --purple: #786294;
  --spring: cubic-bezier(.2, .8, .25, 1.16); --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background-image: linear-gradient(#a99bb012 1px, transparent 1px), linear-gradient(90deg, #a99bb012 1px, transparent 1px), radial-gradient(ellipse at 5% 10%, #f4e7eb88, transparent 55%), radial-gradient(ellipse at 100% 90%, #e8e0f088, transparent 55%); background-size: 28px 28px, 28px 28px, 100% 100%, 100% 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, [tabindex]:focus-visible { outline: 2px solid #69528b; outline-offset: -3px; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.doodle { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.topbar { position: fixed; z-index: 10000; top: 0; left: 0; right: 0; padding: calc(env(safe-area-inset-top) + 12px) 22px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; pointer-events: none; }
.topbar h1 { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 650; letter-spacing: 1.4px; margin: 0; }
.brand-symbol { width: 22px; height: 23px; position: relative; transform: rotate(-9deg); }
.brand-symbol i { position: absolute; width: 17px; height: 18px; border: 1px solid #8a759c; border-radius: 4px; background: #e8dff4; left: 0; top: 0; }
.brand-symbol i:nth-child(2) { left: 4px; top: 4px; background: #fcf9ff; }
.brand-symbol i:nth-child(3) { left: 8px; top: 10px; width: 9px; height: 4px; border-width: 0 0 1px; background: none; border-radius: 0; }
.brand-sub { color: var(--muted); font-size: 9px; font-weight: 450; letter-spacing: 1.6px; margin-left: 8px; }
.live-status { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 4px 0 10px; font-size: 11px; letter-spacing: .3px; color: #72647f; background: none; pointer-events: auto; }
.live-dot { width: 5px; height: 5px; background: #8d79a2; border-radius: 50%; box-shadow: 0 0 0 4px #9c84b211; }
body.paused .live-dot { background: #8b8790; box-shadow: none; }
#board { position: fixed; inset: calc(68px + env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) calc(122px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); isolation: isolate; }
.background-note { position: fixed; z-index: -1; left: 50%; top: 45%; transform: translate(-50%, -50%) rotate(-7deg); color: #9f94ac; display: flex; flex-direction: column; gap: 14px; align-items: center; font-size: 13px; letter-spacing: 3px; white-space: nowrap; }
.background-note .doodle { width: 45px; height: 45px; }
.note { position: absolute; top: 0; left: 0; width: var(--width, 236px); border-radius: 13px; border: 1px solid #51446220; background: var(--paper); box-shadow: 0 2px 4px #36244408, 0 9px 22px -9px #44325736, 0 22px 44px -24px #44325735; transform: translate3d(var(--x, 0px), var(--y, 0px), 0) rotate(var(--angle, 0deg)); transform-origin: 50% 50%; user-select: none; -webkit-user-select: none; transition: box-shadow 180ms, transform 400ms var(--ease); }
[data-color="rose"] { --paper: #f6dce4; --accent: #9b5d75; }
[data-color="lavender"] { --paper: #e7dcf5; --accent: #81639c; }
[data-color="blue"] { --paper: #dcecf9; --accent: #5a7e9c; }
[data-color="butter"] { --paper: #f9edc7; --accent: #937536; }
[data-color="mint"] { --paper: #ddefe5; --accent: #5b846c; }
[data-color="peach"] { --paper: #fae2cf; --accent: #a17556; }
.note-header { display: flex; height: 44px; align-items: center; background: #ffffff6b; border-bottom: 1px solid #ffffff85; border-radius: 12px 12px 0 0; padding-left: 1px; touch-action: none; cursor: grab; }
.window-controls { display: flex; flex-shrink: 0; }
.window-control { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; background: none; border-radius: 9px; }
.window-control span { display: grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; border: 1px solid #0000000c; transition: transform 120ms, filter 120ms; }
.window-control .icon { width: 10px; height: 10px; stroke-width: 2; opacity: .8; }
.control-close span { background: #f28b98; color: #85404d; }
.control-save span { background: #ecc46b; color: #805e1f; }
.control-expand span { background: #88c7a6; color: #396a50; }
.window-control:active span { transform: scale(.78); filter: saturate(1.4); }
.note-handle { height: 44px; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 0 11px 0 0; font-size: 12px; letter-spacing: .6px; color: #716777; background: transparent; cursor: grab; touch-action: none; white-space: nowrap; }
.note-body { width: 100%; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: left; padding: 18px 20px 20px; border-radius: 0 0 12px 12px; background: none; }
.note-text { font-size: 18px; line-height: 1.55; font-weight: 600; letter-spacing: .2px; white-space: pre-line; overflow-wrap: anywhere; }
.note-doodle { width: 23px; height: 23px; flex-shrink: 0; color: var(--accent); transform: rotate(8deg); }
.note-body:active { background: #ffffff24; }
.note.arriving { animation: window-arrive 430ms var(--spring) both; }
.note.leaving { pointer-events: none; animation: window-leave 220ms var(--ease) forwards; }
.note.storing { pointer-events: none; animation: window-store 300ms var(--ease) forwards; }
.note.dragging { transition: box-shadow 150ms; box-shadow: 0 18px 40px -12px #49325655; }
.note.dragging .note-header, .note.dragging .note-handle { cursor: grabbing; }
.note:focus-within { box-shadow: 0 0 0 2px #9c85b466, 0 14px 35px -14px #49325655; }
.note.heart-note { border-radius: 8px; box-shadow: 0 1px 2px #3624440c, 0 5px 12px -5px #44325738; }
.heart-note .note-header { height: 26px; border-radius: 7px 7px 0 0; }
.heart-note .window-control { width: 24px; height: 26px; border-radius: 4px; }
.heart-note .window-control span { width: 8px; height: 8px; }
.heart-note .window-control .icon { width: 7px; height: 7px; }
.heart-note .note-handle { height: 26px; padding: 0 4px 0 0; font-size: 9px; letter-spacing: 0; }
.heart-note .note-body { min-height: 0; height: 48px; padding: 5px 8px 7px; gap: 4px; border-radius: 0 0 7px 7px; }
.heart-note .note-text { font-size: 12px; line-height: 1.4; letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.heart-note .note-doodle { display: none; }
@keyframes window-arrive { from { opacity: 0; scale: .74; translate: 0 14px; rotate: var(--arrival-turn, -5deg); } to { opacity: 1; scale: 1; translate: 0 0; rotate: 0deg; } }
@keyframes window-leave { to { opacity: 0; scale: .8; } }
@keyframes window-store { to { opacity: 0; scale: .4; translate: 0 100px; } }
.bottom-bar { position: fixed; z-index: 10000; left: 12px; right: 12px; bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
#board-help { color: #7d7289; font-size: 10px; line-height: 1.6; margin: 0 0 13px; letter-spacing: .5px; text-align: center; }
.dock { pointer-events: auto; display: flex; align-items: center; padding: 7px; gap: 3px; border-radius: 22px; background: #ffffffdf; border: 1px solid #fff; outline: 1px solid #87709f17; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 4px 8px #57446706, 0 12px 36px -9px #5f427c25; }
.dock-button { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 70px; height: 46px; padding: 0 12px; font-size: 12px; border-radius: 15px; background: transparent; transition: background 150ms, transform 150ms; white-space: nowrap; }
.dock-button .icon { width: 18px; height: 18px; }
.add-button { background: #eee6f7; color: #6b517f; font-weight: 600; padding-inline: 16px; }
.dock-button:active { transform: scale(.95); background: #eee6f7; }
.dock-divider { width: 1px; height: 19px; background: #8675931a; margin-inline: 2px; }
.icon-only { min-width: 44px; width: 44px; padding: 0; color: #7a6e86; }
.pocket-icon { position: relative; display: flex; }
#pocket-count { position: absolute; right: -7px; top: -7px; border-radius: 8px; background: #8768a5; color: #fff; min-width: 14px; height: 14px; font-size: 8px; line-height: 14px; text-align: center; padding-inline: 3px; }
dialog { color: var(--ink); border: 1px solid #fff9; padding: 0; box-shadow: 0 30px 120px #33214333; }
dialog::backdrop { background: #38284638; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
dialog[open] { animation: dialog-arrive 300ms var(--ease); }
@keyframes dialog-arrive { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }
.reader { width: min(520px, calc(100vw - 32px)); height: min(560px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px); border-radius: 24px; background: var(--paper, #e7dcf5); }
.reader[open] { display: flex; flex-direction: column; }
.reader-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 12px 24px; border-bottom: 1px solid #fff6; background: #ffffff4a; flex-shrink: 0; }
.reader-caption { font-size: 12px; letter-spacing: 1.5px; color: #706179; }
.round-button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #ffffff65; flex-shrink: 0; }
.round-button:active { background: #ffffffb5; }
.reader-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; min-height: 0; text-align: center; }
.reader-doodle { width: 60px; height: 60px; color: var(--accent); transform: rotate(-9deg); flex-shrink: 0; }
#reader-text { font-size: clamp(28px, 5vw, 38px); line-height: 1.6; letter-spacing: 1px; white-space: pre-line; overflow-wrap: anywhere; margin: 26px 0; font-weight: 600; }
.reader-sign { color: #796682; font-size: 9px; letter-spacing: 1.7px; }
.reader-bottom { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 18px; gap: 10px; flex-shrink: 0; }
.plain-button, .save-button { display: flex; justify-content: center; align-items: center; gap: 7px; padding: 0 12px; min-height: 46px; font-size: 12px; background: none; border-radius: 14px; }
.save-button { background: #ffffff7a; }
.save-button:active { background: #ffffffbf; }
.pocket { width: min(430px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); background: #fbf9fe; border-radius: 24px; padding: 24px; }
.pocket-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.eyebrow { font-size: 9px; letter-spacing: 1.8px; color: #8a779b; }
.pocket h2 { margin: 8px 0 0; font-size: 21px; font-weight: 600; letter-spacing: .5px; }
.pocket-description { color: #776b81; font-size: 12px; line-height: 1.8; margin: 18px 0 20px; }
.pocket-list { display: flex; flex-direction: column; gap: 10px; }
.pocket-item { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; min-height: 68px; text-align: left; border-radius: 12px; background: var(--paper); padding: 14px 18px; font-size: 15px; line-height: 1.5; white-space: pre-line; }
.pocket-item .icon { color: var(--accent); transform: rotate(135deg); }
.pocket-item:active { filter: brightness(.97); }
.pocket-empty { padding: 22px 0 24px; text-align: center; color: #877394; }
.pocket-empty .doodle { width: 42px; height: 42px; }
.pocket-empty p { font-size: 13px; line-height: 1.8; }
.toast { position: fixed; z-index: 11000; left: 50%; bottom: calc(127px + env(safe-area-inset-bottom)); transform: translate(-50%, 10px); background: #4e405c; color: #fff; padding: 10px 16px; border-radius: 15px; width: max-content; max-width: calc(100vw - 32px); font-size: 12px; line-height: 1.7; display: flex; align-items: center; gap: 12px; opacity: 0; visibility: hidden; transition: opacity 180ms, transform 180ms, visibility 180ms; pointer-events: none; }
.toast.visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { min-width: 44px; min-height: 44px; color: #f3d69a; background: none; padding: 0; margin-block: -8px; }
.no-script { position: absolute; top: 30%; width: 100%; text-align: center; }
@media (hover: hover) { .window-control:hover span { filter: saturate(1.35); transform: scale(1.12); } .dock-button:hover { background: #eee6f7; } .note-body:hover { background: #ffffff20; } }
@media (max-width: 600px) {
  .topbar { padding: calc(env(safe-area-inset-top) + 9px) 18px 0; }
  .brand-sub { display: none; }
  .topbar h1 { font-size: 13px; }
  .live-status { font-size: 11px; }
  #board { inset: calc(60px + env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) calc(112px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .note { border-radius: 9px; }
  .note-header { height: 32px; border-radius: 8px 8px 0 0; }
  .window-control { width: 32px; height: 32px; border-radius: 6px; }
  .window-control span { width: 11px; height: 11px; }
  .window-control .icon { width: 9px; height: 9px; }
  .note-text { font-size: 14px; line-height: 1.5; letter-spacing: 0; }
  .note-body { padding: 10px 12px 12px; min-height: 52px; gap: 6px; border-radius: 0 0 8px 8px; }
  .note-handle { height: 32px; font-size: 10px; letter-spacing: .3px; padding-right: 8px; }
  .note-doodle { width: 16px; height: 16px; }
  .heart-note .note-header, .heart-note .window-control, .heart-note .note-handle { height: 24px; }
  .heart-note .window-control { width: 24px; }
  .heart-note .note-body { height: 40px; min-height: 0; padding: 4px 7px 5px; }
  .heart-note .note-text { font-size: 10px; line-height: 1.4; }
  .heart-note .note-handle { font-size: 8px; padding-right: 3px; }
  .heart-note .window-control span { width: 7px; height: 7px; }
  .bottom-bar { bottom: calc(17px + env(safe-area-inset-bottom)); }
  .dock { gap: 1px; padding: 6px; border-radius: 20px; }
  .dock-button { min-width: 64px; padding: 0 9px; gap: 6px; font-size: 11px; }
  .add-button { padding-inline: 13px; }
  .icon-only { min-width: 44px; padding: 0; }
  .dock-divider { margin-inline: 2px; }
  #board-help { font-size: 10px; letter-spacing: .25px; margin-bottom: 12px; }
  .reader { height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-height: 740px; border-radius: 20px; }
  .reader-top { padding-left: 21px; }
  #reader-text { font-size: 30px; }
  .reader-bottom { padding-inline: 12px; }
  .pocket { position: fixed; top: auto; bottom: 0; margin: 0 auto; width: 100%; max-width: 520px; max-height: calc(90dvh - env(safe-area-inset-top)); border-radius: 26px 26px 0 0; padding: 24px 24px calc(28px + env(safe-area-inset-bottom)); }
}
@media (max-height: 480px) and (orientation: landscape) {
  .topbar { padding-top: 2px; }
  #board { top: 48px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  #board-help { display: none; }
  .bottom-bar { bottom: calc(9px + env(safe-area-inset-bottom)); }
  .reader-top { padding-block: 3px; }
  .reader-content { flex-direction: row; gap: 24px; padding: 12px 24px; }
  .reader-sign { display: none; }
  #reader-text { font-size: 25px; margin-block: 8px; }
  .reader-doodle { width: 40px; height: 40px; }
  .reader-bottom { padding-block: 5px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
