/* 纸上的手绘感：纯色、纸纹、手写字、不规则的圆角；没有渐变、投影和玻璃质感。 */
:root {
  --ink: #3d3528; --ink-soft: #6d6451; --paper: #f8f0dc; --paper-2: #efe4c8; --line: #3d3528;
  --blue: #bcd9ea; --yellow: #f6dc7a; --pink: #f0b4ad; --green: #7c9a55;
  --focus: #5f8f52; --rest: #4f93b4; --away: #b7a98f; --lost: #c0744c;
  --hand: "Hannotate SC", "HanziPen SC", "Yuanti SC", "Kaiti SC", "STKaiti", "KaiTi", "PingFang SC", "Microsoft YaHei", sans-serif;
  --digits: "Chalkboard SE", "Marker Felt", "Comic Sans MS", "Hannotate SC", "Kaiti SC", cursive;
  --wob: 255px 18px 225px 18px / 18px 225px 18px 255px;
  --wob2: 18px 225px 18px 255px / 255px 18px 225px 18px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 17px/1.5 var(--hand); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.defs { position: absolute; }
:focus-visible { outline: 2px dashed var(--ink); outline-offset: 3px; border-radius: 6px; }

#app { position: relative; height: 100dvh; display: flex; flex-direction: column; background: var(--paper); overflow: hidden; }
/* 整张纸的颗粒 */
#app::after { content: ""; position: absolute; inset: 0; z-index: 30; pointer-events: none; opacity: .3; mix-blend-mode: multiply;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .32  0 0 0 0 .26  0 0 0 0 .16  0 0 0 .9 -.34'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>"); }

/* ---------- 四角的小字 ---------- */
.top { position: absolute; z-index: 5; inset: 12px auto auto 14px; padding: 4px 14px 6px; display: flex; flex-direction: column; max-width: 26%; background: var(--paper); border-radius: var(--wob2); }
.brand strong { font-size: 22px; font-weight: 600; letter-spacing: .1em; }
.who { font-size: 15px; color: var(--ink-soft); }
.who b { color: var(--ink); }
.who .warn { color: var(--lost); }
.link { padding: 4px 8px; font-size: 16px; border-radius: 8px; white-space: nowrap; }
a.link { color: inherit; text-decoration: none; }
.link:hover, .link[aria-expanded="true"] { background: var(--yellow); border-radius: var(--wob); }
.grp { position: absolute; z-index: 6; display: flex; gap: 2px; margin: 12px 14px; padding: 2px 6px; background: var(--paper); border-radius: var(--wob); }
.grp.tr { top: 0; right: 0; } .grp.bl { bottom: 6px; left: 0; } .grp.br { bottom: 6px; right: 0; }
.filing { position: fixed; z-index: 30; bottom: 2px; left: 50%; transform: translateX(-50%); font: 10px/1.2 system-ui, sans-serif; white-space: nowrap; }
.filing a { color: #746d62; text-decoration: none; }
#app[data-seated="no"] #btn-away, #app[data-seated="no"] #btn-leave { display: none; }

/* ---------- 场景 ---------- */
.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.art { position: absolute; transition: opacity .35s ease; }
.art.swapping { opacity: 0; }
.layer { position: absolute; inset: 0; }
.layer > svg { display: block; width: 100%; height: 100%; overflow: visible; }

.fig, .desk { position: absolute; opacity: 0; transition: opacity .5s ease; pointer-events: none; }
.fig.on, .desk.on { opacity: 1; }
.fig svg, .desk svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fig .head { transition: transform .8s ease; transform-box: fill-box; transform-origin: 50% 100%; }
.fig[data-status="focus"] .head { transform: translateY(7px) rotate(-2deg); }
.fig .eyes-up, .fig[data-status="open"] .eyes-down, .fig[data-status="away"] .eyes-down { display: none; }
.fig[data-status="open"] .eyes-up, .fig[data-status="away"] .eyes-up { display: inline; }
.fig[data-status="away"].on, .fig[data-link="lost"].on { opacity: .3; }
.desk[data-status="away"] .lid, .desk[data-link="lost"] .lid { display: none; }

.tag { position: absolute; translate: -50% 0; width: 210px; min-width: 88px; padding: 5px 10px 7px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--wob); text-align: left; opacity: 0; transition: opacity .5s ease; pointer-events: none; }
.tag:nth-of-type(even) { border-radius: var(--wob2); }
.tag.on { opacity: 1; pointer-events: auto; }
.tag.me { background: var(--yellow); }
.tag-top { display: grid; grid-template-columns: minmax(0, 1fr) 64px; align-items: center; gap: 4px; white-space: nowrap; font-size: 15px; }
.tag-name { display: flex; align-items: baseline; gap: 3px; min-width: 0; }
.tag-name small { flex: none; font-size: 11px; color: var(--ink-soft); }
.tag-top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tag-top .st { display: flex; align-items: center; gap: 4px; font: 12px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; color: var(--ink-soft); }
.tag-top .st .dot { width: 8px; height: 8px; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--rest); }
[data-status="focus"] > .tag-top .dot, .row[data-status="focus"] .dot { background: var(--focus); }
[data-status="away"] > .tag-top .dot, .row[data-status="away"] .dot { background: none; box-shadow: inset 0 0 0 2px var(--away); }
[data-link="lost"] > .tag-top .dot, .row[data-link="lost"] .dot { background: none; box-shadow: inset 0 0 0 2px var(--lost); }
.tag-task { min-height: 2.6em; font-size: 14px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.tag-until { min-height: 1.3em; font-size: 12px; line-height: 1.3; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.sit-here { position: absolute; translate: -50% -50%; padding: 4px 14px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--wob); font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .4s ease; }
.sit-here.on { opacity: 1; pointer-events: auto; }
.sit-here.usual, .sit-here:hover { background: var(--blue); }

/* 场景里的共用便签入口 */
.note { position: absolute; translate: -50% 0; rotate: 2.5deg; width: 190px; min-height: 96px; padding: 10px 12px 8px; background: var(--yellow); border-radius: 3px 3px 14px 3px; text-align: left; font-size: 16px; line-height: 1.35; display: flex; flex-direction: column; gap: 4px; }
.note::before { content: ""; position: absolute; top: -9px; left: 50%; translate: -50% 0; width: 46px; height: 18px; background: var(--pink); opacity: .9; rotate: -3deg; }
.note .txt { flex: 1; overflow-wrap: anywhere; }
.note .txt.empty { color: var(--ink-soft); }
.note .meta { font-size: 12px; color: var(--ink-soft); text-align: right; }
.list .notes-board { margin: 12px 6px 8px; }
#pop-notes .notes-heading { padding-right: 22px; }

/* ---------- 正上方：计时与这会儿在做的事 ---------- */
.hub { position: absolute; z-index: 4; top: 8px; left: 50%; translate: -50% 0; width: min(440px, 44%); text-align: center; }
.join, .mine { display: flex; flex-direction: column; align-items: center; gap: 6px; }
#app[data-seated="no"] .mine, #app[data-seated="yes"] .join { display: none; }
.hello { margin: 8px 0 2px; font-size: 26px; letter-spacing: .06em; }
.digits { font: 700 clamp(48px, 9vh, 78px)/1 var(--digits); letter-spacing: .04em; color: #fbf6e6; -webkit-text-stroke: 3px var(--green); paint-order: stroke fill; font-variant-numeric: tabular-nums; padding: 2px 10px; }
#app[data-env="forest"] .digits { -webkit-text-stroke-color: #c8663c; }
#app[data-phase="break"] .digits { -webkit-text-stroke-color: var(--rest); }
.phase { margin: 0; font-size: 15px; color: var(--ink-soft); min-height: 1.4em; }
.line { display: flex; align-items: baseline; gap: 8px; width: 100%; max-width: 340px; border-bottom: 2px solid var(--line); border-radius: 0 0 40px 8px / 0 0 4px 3px; padding: 0 6px 1px; }
.line input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; text-align: center; height: 34px; }
.line input::placeholder { color: #9a917c; }
.line .lead { flex: none; font-size: 14px; color: var(--ink-soft); }
.acts { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.blob { padding: 5px 26px 7px; font-size: 22px; font-weight: 600; letter-spacing: .1em; background: var(--blue); border-radius: 62% 38% 55% 45% / 48% 60% 40% 52%; }
.blob:hover { background: #a6cbe2; }
.blob.small { font-size: 16px; padding: 4px 16px 5px; }
.chip { max-width: 260px; padding: 1px 10px; font-size: 14px; color: var(--ink-soft); border: 1.5px dashed var(--ink-soft); border-radius: var(--wob); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { color: var(--ink); background: var(--paper-2); }
#app[data-phase="idle"] #stop, #app[data-phase="done"] #stop { display: none; }
#app[data-phase="focus"] #go { display: none; }

/* ---------- 弹出的小纸片 ---------- */
.pop { position: absolute; z-index: 8; width: min(330px, calc(100% - 24px)); padding: 14px 16px; background: var(--paper); border: 2px solid var(--line); border-radius: 14px 18px 12px 20px / 18px 12px 20px 14px; font-size: 16px; max-height: calc(100% - 120px); overflow-y: auto; }
.pop.at-tr { top: 54px; right: 16px; } .pop.at-bl { bottom: 54px; left: 16px; } .pop.at-hub { top: 96px; left: 50%; translate: -50% 0; }
.pop-title { margin: 0 0 8px; font-weight: 600; font-size: 18px; }
.pop-title.second { margin-top: 16px; }
.pop-hint { margin: 10px 0 0; font-size: 13px; color: var(--ink-soft); }
.pop-title { padding-right: 24px; }
.pop-close { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; font: 24px/1 system-ui, sans-serif; border-radius: 8px; }
.pop-close:hover { background: var(--paper-2); }
.title-note { font-size: 12px; font-weight: 400; color: var(--ink-soft); white-space: nowrap; }
.more-help { margin-top: 16px; padding-top: 10px; border-top: 1px dashed var(--away); font-size: 13px; color: var(--ink-soft); }
.more-help summary { cursor: pointer; padding: 4px 0; }
.more-help p { margin: 8px 0; line-height: 1.7; }
.more-help .link { margin-left: -8px; font-size: 13px; }
.envs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.env-card { padding: 6px 6px 4px; border: 2px solid transparent; border-radius: var(--wob); }
.env-card[aria-pressed="true"] { border-color: var(--line); background: var(--yellow); }
.env-card.loading { opacity: .5; }
.thumb { display: block; height: 76px; border-radius: 6px; margin-bottom: 4px; }
.thumb.cafe { background: linear-gradient(#7c9a55, #7c9a55) 50% 62% / 78% 14% no-repeat, conic-gradient(#b9563f 25%, #f0d8b0 0 50%, #b9563f 0 75%, #f0d8b0 0) 0 100% / 26px 26px repeat-x, linear-gradient(#f1e2c2 0 66%, #b9563f 66%); }
.thumb.forest { background: linear-gradient(#d08a45, #d08a45) 50% 62% / 78% 14% no-repeat, radial-gradient(circle at 18% 30%, #3f7a4c 0 17%, transparent 18%), radial-gradient(circle at 84% 26%, #3f7a4c 0 15%, transparent 16%), linear-gradient(#dde9cc 0 60%, #5f8f52 60%); }
.looks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.looks button { height: 74px; padding: 4px 2px 0; border: 2px solid transparent; border-radius: var(--wob); overflow: hidden; }
.looks button svg { display: block; width: 100%; height: 130%; }
.looks button:hover { background: var(--paper-2); }
.looks button[aria-checked="true"] { border-color: var(--line); background: var(--yellow); }
.enter { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(380px, 100%); margin: 0 auto; }
.enter .line { max-width: none; }
.enter .line input { font-size: 20px; height: 40px; }
.enter .err { min-height: 1.4em; margin: 0; color: var(--lost); font-size: 14px; }
.gate .sub { font-size: 14px; }
.looks .fig { position: static; opacity: 1; }
#invite-link { text-align: left; font: 13px/1 ui-monospace, Menlo, monospace; }
.check, .range { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.range input { flex: 1; accent-color: var(--green); }
.check input { width: 18px; height: 18px; accent-color: var(--green); }
.seg { display: flex; gap: 6px; }
.seg button { padding: 2px 14px; border: 2px solid var(--line); border-radius: var(--wob); }
.seg button[aria-checked="true"] { background: var(--yellow); font-weight: 600; }
.nums { display: flex; gap: 14px; margin-top: 10px; }
.nums input { width: 58px; height: 32px; text-align: center; border: 0; border-bottom: 2px solid var(--line); background: none; font-family: var(--digits); font-size: 18px; }
.nums.off { opacity: .35; pointer-events: none; }
.slips { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 4px; }
.pop-sub { margin: 12px 0 0; font-size: 13px; color: var(--ink-soft); }
#pop-today { width: min(380px, calc(100% - 24px)); }
.tag.on:not(.me) { cursor: pointer; }
.tag.on:not(.me):hover { background: var(--blue); }
.row .wave, .row .row-action { grid-row: 1 / 3; grid-column: 3; width: 32px; height: 32px; }
.row .wave { display: grid; place-items: center; border-radius: var(--wob); }
.row .wave:hover { background: var(--blue); }
.recap .none { color: var(--ink-soft); font-size: 14px; }
.recap .sum { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.recap .tom { width: 16px; height: 16px; border-radius: 50% 50% 46% 54%; background: #d9553f; box-shadow: inset 0 3px 0 -1px #5f8f52; }
.recap ol { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; color: var(--ink-soft); }
.recap ol span { font-family: var(--digits); margin-right: 8px; }

.toast { position: absolute; z-index: 9; left: 50%; bottom: 64px; translate: -50% 0; max-width: 86%; padding: 6px 18px 8px; background: var(--ink); color: var(--paper); border-radius: var(--wob); font-size: 15px; }
.gate { position: absolute; z-index: 10; inset: 0; display: grid; place-content: center; gap: 12px; padding: 24px; background: var(--paper); text-align: center; }
.gate h1 { margin: 0; font-size: 30px; letter-spacing: .1em; }
.gate { overflow-y: auto; }
.gate p { margin: 0; color: var(--ink-soft); max-width: 420px; }
.gate .as { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.gate .as a { padding: 4px 18px 6px; border: 2px solid var(--line); border-radius: var(--wob); color: var(--ink); text-decoration: none; }
.gate .as a:hover { background: var(--yellow); }
.parked { height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-soft); }

/* ---------- 紧凑视图：同一份状态，收到屏幕一边 ---------- */
.list { display: none; }
#app[data-mode="compact"] { height: calc(100dvh - 20px); max-width: 420px; margin: 0 auto; overflow-y: auto; }
#app[data-mode="compact"] .stage { display: none; }
#app[data-mode="compact"] .top { position: static; background: none; border-radius: 0; flex-direction: row; align-items: baseline; justify-content: space-between; max-width: none; padding: 8px 14px 0; }
#app[data-mode="compact"] .brand strong { font-size: 18px; }
#app[data-mode="compact"] .hub { position: static; translate: none; width: auto; padding: 4px 14px 8px; border-top: 1px solid #cbbf9f; }
#app[data-mode="compact"] .hello { font-size: 20px; margin: 2px 0; }
#app[data-mode="compact"] .digits { font-size: 46px; }
#app[data-mode="compact"] .list { display: block; flex: none; padding: 4px 8px; }
#app[data-mode="compact"] .top, #app[data-mode="compact"] .hub, #app[data-mode="compact"] .nav { flex: none; }
.row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 32px 78px; grid-template-rows: 20px 20px; gap: 0 8px; align-items: center; padding: 6px; border-radius: var(--wob); }
.row.me { background: var(--paper-2); }
.row .face { grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--paper); }
.row .face svg, .row .face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.row[data-status="away"] .face, .row[data-link="lost"] .face { opacity: .4; }
.row .l1 { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 4px; font-size: 15px; min-width: 0; white-space: nowrap; }
.row .l1 b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row .you { flex: none; font-size: 11px; color: var(--ink-soft); }
.row .st { position: relative; grid-column: 4; grid-row: 1 / 3; height: 34px; padding-left: 14px; font: 12px/18px -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; color: var(--ink-soft); white-space: nowrap; }
.row .st .dot { position: absolute; left: 0; top: 5px; width: 8px; height: 8px; }
.row .st small { display: block; font-size: 11px; line-height: 14px; font-variant-numeric: tabular-nums; }
.row .l2 { grid-column: 2; grid-row: 2; min-width: 0; font: 12px/1.4 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.2em; }
.list .empty { padding: 18px 10px; font-size: 15px; color: var(--ink-soft); text-align: center; }
#app[data-mode="compact"] .nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 2px; padding: 4px 8px 16px; border-top: 2px dashed var(--ink-soft); }
#app[data-mode="compact"] .grp { position: static; display: contents; margin: 0; }
#app[data-mode="compact"] #btn-env { display: none; }
#app[data-mode="compact"] .link { font-size: 15px; padding: 3px 6px; }
#app[data-mode="compact"] .pop { top: auto; bottom: 80px; left: 8px; right: 8px; width: auto; translate: none; }

@media (prefers-reduced-motion: reduce) { .fig, .desk, .tag, .fig .head, .art { transition: none; } }

/* Quiet team updates: no pop-up, sound, or change to the collapsed companion. */
#btn-board[data-board-unread="true"]::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 5px; border-radius: 50%; background: #587b60; vertical-align: middle; }
