:root {
  --ink:#23392d; --muted:#5a6b60; --forest:#2e563d; --soft:#eaf1e5;
  --line:#d8e0d6; --paper:#f5f7f2; --white:#fff; --danger:#993b30;
  --sans:"DM Sans","Segoe UI","Microsoft YaHei UI","Microsoft YaHei","PingFang SC",sans-serif;
  color:var(--ink); background:var(--paper); font:14px/1.55 var(--sans); font-variant-numeric:tabular-nums;
}
* { box-sizing:border-box }
body { margin:0 }
button,input,select,textarea { font:inherit }
button { color:inherit; cursor:pointer; border:0; background:transparent }
button:disabled { opacity:.48; cursor:default }
button:focus-visible,select:focus-visible,textarea:focus-visible,input:focus-visible,a:focus-visible,[tabindex="-1"]:focus-visible { outline:2px solid #648a51; outline-offset:2px }
h1,h2,h3,p { margin:0; overflow-wrap:anywhere }
h1,h2,h3 { text-wrap:balance }
[hidden] { display:none!important }
.icon { flex:none; vertical-align:middle }
.boot { padding:28px; text-align:center; color:var(--muted) }
.mark { position:relative; display:inline-block; width:30px; height:30px; flex:none; border-radius:7px; background:#274531 }
.mark i { position:absolute; left:7px; width:16px; height:10px; transform:rotate(-28deg) skewX(26deg); border:1.5px solid #274531; border-radius:1.5px; background:#d9ecb4 }
.mark i:first-child { top:15px; background:#839878 }
.mark i:nth-child(2) { top:11px; background:#aec39c }
.mark i:nth-child(3) { top:7px }
.login-screen { min-height:100dvh; display:grid; align-items:center; justify-items:center; padding:22px }
.login-card { width:min(100%,388px); padding:32px; border:1px solid var(--line); border-radius:12px; background:white; box-shadow:0 6px 24px #1b332609 }
.login-brand,.wordmark { display:flex; gap:9px; align-items:center; font-size:21px; font-weight:720 }
.login-card h1 { font-size:24px; margin:29px 0 20px }
.field { display:grid; gap:6px; margin-bottom:13px }
.field>span { font-weight:650; font-size:13px }
input:not([type=file]),textarea,select { border:1px solid #c7d2c5; color:var(--ink); background:white; border-radius:6px; max-width:100% }
input:not([type=file]),textarea { padding:9px 11px; width:100% }
textarea { resize:vertical }
select { padding:6px 9px }
.button,.mini,.link,.icon-button,.pill,.chip { display:inline-flex; align-items:center; justify-content:center; gap:6px }
.button { min-height:35px; padding:6px 13px; border:1px solid #cad5c7; border-radius:6px; background:white; font-size:13px; font-weight:600 }
.button:hover,.icon-button:hover,.link:hover,.mini:hover { background:#edf3e9 }
.button.primary { color:white; background:var(--forest); border-color:var(--forest) }
.button.primary:hover { background:#23452f }
.button.small { min-height:28px; padding:3px 9px; font-size:12px }
.wide-button { width:100%; margin-top:8px; min-height:39px }
.link,.mini { color:#4e6751; border-radius:5px; padding:4px 6px; font-size:12px }
.icon-button { flex:none; width:30px; height:30px; border-radius:5px; color:#59715a }
.bar { background:white; border-bottom:1px solid var(--line) }
.bar-inner,.layout { max-width:1696px; padding-inline:clamp(16px,3.2vw,54px); margin:auto }
.bar-inner { display:flex; align-items:center; min-height:60px; gap:14px }
.identity { display:flex; align-items:center; gap:8px; margin-left:auto; color:var(--muted); font-size:13px }
.role-label { background:#e4eedc; color:#365638; border-radius:4px; padding:1px 6px; font-size:11px }
#member-avatar { display:flex }
.divider { width:1px; height:14px; background:var(--line); margin-left:4px }
.layout { display:grid; grid-template-columns:clamp(202px,17vw,246px) minmax(0,1fr); align-items:start; gap:clamp(20px,2.8vw,48px); padding-top:25px; padding-bottom:54px }
.sidebar { position:sticky; top:18px; max-height:calc(100dvh - 40px); overflow:auto; padding-right:15px; border-right:1px solid var(--line); min-height:200px }
.side-head,.upload-zone { display:flex; align-items:center }
.side-head { justify-content:space-between; padding:0 4px 9px 9px }
.side-head h2 { font-size:13px; color:var(--muted); font-weight:650 }
.add-project { font-size:21px }
.project-list { display:grid; gap:4px; grid-template-columns:minmax(0,1fr) }
.project-entry { position:relative; min-width:0; border-radius:6px }
.project-link { display:block; width:100%; padding:7px 9px; min-height:47px; text-align:left; border-radius:6px; color:var(--muted) }
.project-title { display:flex; align-items:center; gap:7px; padding-right:29px; min-width:0 }
.project-title>span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.project-created { display:block; margin:2px 0 0 23px; color:var(--muted); font-size:11px; font-weight:400 }
.project-link:hover,.project-entry:focus-within { background:#edf2e9 }
.project-link[aria-current=page] { color:#2d5337; background:#e1ebdc; font-weight:650 }
.project-delete,.project-pin { position:absolute; top:4px; width:27px; height:27px }
.project-pin { right:4px; color:#718372 }
.project-delete { right:32px; color:var(--danger) }
.project-delete:hover,.file-delete:hover { background:#fff0ec }
.project-entry:has(.project-delete) .project-title { padding-right:57px }
.project-pin[aria-pressed=true] { color:var(--forest) }
.project-pin[aria-pressed=true] path:first-child { fill:currentColor }

.main { min-width:0 }
.mobile-projects { display:none }
.project-row { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap }
.rename-project { display:inline-flex; align-items:center; gap:8px; padding:2px 4px 2px 0; max-width:100%; text-align:left; border-radius:5px }
.rename-project span { min-width:0; overflow-wrap:anywhere }
.rename-project .icon { color:var(--muted) }
.rename-project:hover { color:var(--forest); background:var(--soft) }
.profile-button { display:flex; align-items:center; min-width:0; gap:6px; padding:3px 5px; border-radius:6px }
.profile-button:hover { background:#edf3e9 }
#member-name { max-width:clamp(52px,15vw,180px); overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
#profile-pencil { display:inline-flex; color:var(--muted) }
.field .avatar-input { width:6em }
.project-row h1 { font-size:clamp(21px,2.2vw,29px); font-weight:680; line-height:1.35; letter-spacing:-.025em }
.upload-zone { flex-shrink:0; padding:8px 13px; gap:8px; border:1px dashed #91aa86; border-radius:7px; background:#fafcf8; color:var(--forest); font-size:13px }
.upload-zone span { font-size:12px; color:var(--muted) }
.upload-zone:hover,.upload-zone.drag,.upload-drop.drag { border-color:#467549; background:#e6f1df }
.upload-drop { display:grid; justify-items:center; gap:8px; padding:20px 12px; border:1px dashed #a3b49b; border-radius:7px; background:#f7faf5; color:var(--forest); text-align:center }
.upload-pickers { display:flex; flex-wrap:wrap; justify-content:center; gap:8px }
.upload-queue { list-style:none; margin:10px 0 0; padding:0; max-height:32dvh; overflow:auto }
.upload-queue li { display:flex; align-items:center; gap:6px; border-bottom:1px solid var(--line); padding:3px 0 3px 4px }
.upload-queue li span { flex:1; min-width:0; overflow-wrap:anywhere; font-size:13px }
.upload-status { margin-right:auto; color:var(--muted); font-size:12px }
.material-choice { display:flex; align-items:center; gap:6px; margin-top:9px; color:var(--muted); font-size:12px }
.material-choice input[type=checkbox] { width:auto; margin:0; accent-color:var(--forest) }
.button.destructive { color:white; background:#953e32; border-color:#953e32 }
.danger { color:var(--danger) }

.items { display:flex; gap:9px; align-items:stretch; overflow-x:auto; margin:17px 0 18px; border-bottom:1px solid var(--line); scrollbar-width:thin }
.items:empty { display:none }
.items:empty+#detail { margin-top:12px }
.item { border-bottom:2px solid transparent; display:flex; align-items:center; gap:6px; min-height:39px; padding:5px 9px; color:var(--muted); white-space:nowrap; max-width:270px; flex:none; font-size:13px }
.item span { overflow:hidden; text-overflow:ellipsis }
.item.active { color:var(--forest); border-color:#5d8050; font-weight:680 }
.item-tab { display:flex; align-items:center; max-width:min(300px,90%); flex:none }
.item-tab>.item { min-width:0; flex:1 1 auto }
.file-delete { width:26px; height:28px; color:#806a63 }
.card { border:1px solid var(--line); border-radius:9px; background:white; min-width:0 }
.preview { overflow:hidden; margin-bottom:16px }
.card-head,.modal-head,.section-head { display:flex; align-items:center; gap:8px }
.card-head { padding:11px 15px; flex-wrap:wrap }
.card-head h2,.section-head h2,.note h2 { font-size:16px; line-height:1.4 }
.card-head .tools,.tools { display:flex; align-items:center; gap:7px }
.card-head .tools { margin-left:auto }
.version { font-size:12px; padding:3px 5px; max-width:175px }
.frame-wrap { background:#edf1e9; padding:9px 13px; border-block:1px solid var(--line) }
iframe { display:block; width:100%; background:white; border:1px solid #d7dfd2; border-radius:4px }
#preview { height:clamp(250px,41dvh,480px) }
.meta { display:flex; align-items:baseline; gap:5px; flex-wrap:wrap; color:var(--muted); font-size:11px }
.preview .meta { padding:7px 14px }
.notes { display:grid; grid-template-columns:minmax(0,1fr); gap:10px; margin-bottom:14px }
.note { padding:0 15px; scroll-margin:14px }
.note-header { display:flex; align-items:center; gap:7px; min-height:48px }
.note-header h2 { flex:1; min-width:0 }
.note-toggle { display:flex; gap:8px; align-items:center; text-align:left; width:100%; min-height:44px; padding:3px 0; font-weight:inherit }
.note-toggle .icon { color:#59744d }
.note-toggle .icon:last-child { opacity:.75 }
.note-toggle[aria-expanded=false] .icon:last-child { transform:rotate(-90deg) }
.note-header .tools { gap:2px }
.note-body { padding:0 0 13px }
.note-body .meta { margin-top:7px }
.note-text>.link { padding:0 }

.note-text,.comment-text { overflow-wrap:anywhere; font-size:14px; line-height:1.65 }
.muted,.subtle { color:var(--muted) }
.subtle { font-size:12px }
.empty { text-align:center; padding:55px 15px; background:white; border:1px dashed #bdccba; border-radius:9px }
.empty h1 { font-size:22px; margin-bottom:13px }
.empty p { margin-bottom:15px; color:var(--muted) }
.discussion { padding:15px 17px }
.section-head { margin-bottom:12px }
.pill { background:var(--soft); color:#546c51; font-size:11px; min-width:22px; border-radius:6px; padding:1px 6px }
.composer { border:1px solid #cad6c6; border-radius:7px; padding:8px 10px }
.composer:focus-within { border-color:#7c9a6f }
.compose-foot { display:flex; align-items:center; gap:6px }
.edit-buttons { margin-left:auto; display:flex; gap:6px; align-items:center }
.inline-editor { margin-top:7px }
.compose-foot .button { margin-left:auto }
.context-row { display:flex; align-items:start; justify-content:space-between; gap:7px; margin-bottom:7px }
.quote { display:flex; align-items:center; gap:4px; width:fit-content; max-width:100%; min-width:0; text-align:left; color:#52634f; background:#eff4eb; border-left:2px solid #91a787; border-radius:0 4px 4px 0; padding:2px 7px; font-size:12px; line-height:1.55 }
.quote:hover { background:#e4eedc }
.quote b { flex:none; max-width:min(38vw,14em); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:550 }
.quote b::after { content:"：" }
.quote span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
#comments { display:grid; grid-template-columns:minmax(0,1fr) }
#comments:not(:empty) { margin-bottom:7px }
#comments>.comment { padding:6px 0; border-top:1px solid #e5eae2 }
.context-row>.quote { min-width:0 }
.range-toggle { margin-bottom:4px }

.located { animation:locate 1.5s ease-out }
@keyframes locate { from,35% { background:#e0edce; box-shadow:0 0 0 2px #91ac78 } to { background:transparent; box-shadow:0 0 0 0 transparent } }
@media(prefers-reduced-motion:reduce) { .located { animation:none; outline:2px solid #91ac78 } }
.comment { display:flex; min-width:0; gap:8px; scroll-margin:15px }
.avatar { display:grid; place-items:center; flex:none; width:26px; height:26px; border-radius:50%; color:#456345; background:#e0ead7; font-size:12px; font-weight:650 }
.tone-0 { background:#e0ecd8; color:#365e40 }.tone-1 { background:#dceaf8; color:#315b82 }
.tone-2 { background:#f0e1f3; color:#794878 }.tone-3 { background:#f5e5cd; color:#795727 }
.tone-4 { background:#dceeea; color:#32655c }.tone-5 { background:#f5e0dd; color:#814844 }
.tone-6 { background:#e4e4f7; color:#565385 }.tone-7 { background:#efeacb; color:#716826 }
.comment-main { min-width:0; flex:1 }
.author { display:flex; align-items:center; gap:7px; flex-wrap:wrap; font-size:13px }
.author .meta { margin-left:3px }
.comment-main>.quote { margin:1px 0 3px }
.comment-actions { margin-left:auto }
.comment-actions .mini { padding:2px 5px }
.comment-actions .icon-button { width:25px; height:25px }
.reaction-strip { display:flex; gap:4px; flex-wrap:wrap; margin-top:3px }
.withdrawn { color:var(--muted); font-size:12px }
.comment-actions { display:flex; gap:2px; align-items:center; flex-wrap:wrap }
.chip { border:1px solid var(--line); background:#f6f8f3; border-radius:13px; font-size:12px; padding:1px 7px; min-height:24px }
.chip.mine { border-color:#a7c39a; background:#e9f2de }
dialog { width:min(480px,calc(100vw - 30px)); max-width:100%; max-height:calc(100dvh - 30px); overflow:auto; color:var(--ink); border:1px solid var(--line); padding:0; border-radius:10px; box-shadow:0 12px 50px #1e322326 }
dialog::backdrop { background:#172a1b65 }
dialog.wide { width:min(780px,calc(100vw - 30px)) }
dialog.full { width:min(1450px,calc(100vw - 24px)) }
.modal-head { padding:13px 16px; border-bottom:1px solid var(--line) }
.modal-head h2 { font-size:17px; overflow-wrap:anywhere }
.modal-head .icon-button { margin-left:auto }
.modal-body { padding:15px 17px }
.modal-foot { display:flex; justify-content:flex-end; gap:8px; align-items:center; flex-wrap:wrap; margin-top:14px }
.modal-foot .left { margin-right:auto }
.dialog-preview { height:min(40dvh,380px); margin-top:8px }
.full .dialog-preview { height:calc(100dvh - 130px); margin:0 }
.error { color:var(--danger); white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px }
.error:not(:empty) { margin:8px 0; padding:6px 8px; border-radius:4px; background:#fff0eb }
#notice { position:fixed; bottom:max(16px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); border-radius:6px; padding:9px 15px; background:#294333; color:white; max-width:min(90vw,620px); width:max-content; z-index:2 }
#notice.bad { background:#793d32 }
.emoji-set { display:flex; gap:6px; flex-wrap:wrap }
.emoji-set button { background:#f0f4ec; border-radius:6px; padding:5px 8px; font-size:22px }
@media(max-width:780px) {
  .layout { display:block; padding-top:14px }
  .sidebar { display:none }
  .mobile-projects { display:inline-flex; padding:3px 9px; min-height:28px; font-size:12px; margin-bottom:12px }
  .bar-inner { min-height:50px; gap:8px }
  .identity { gap:4px }
  .project-row { gap:9px }
  .items { margin:10px 0 12px }
  .card-head,.discussion { padding:10px 12px }
  .note { padding-inline:12px }
  .card-head .tools { gap:3px; flex-wrap:wrap }
  .card-head { gap:6px }
  .frame-wrap { padding:5px }
  .notes { gap:8px }
  .modal-body { padding:12px }
}
@media(max-width:450px) {
  .layout,.bar-inner { padding-inline:12px }
  .upload-zone { padding:5px 8px; gap:5px }
  .project-row h1 { font-size:21px }
  .card-head .tools { margin-left:0 }
  .version { max-width:90px }
  .author { gap:3px 6px }
}
@media(max-width:365px) {
  .card-head>.icon { display:none }
}

.excerpt { --clip-limit:198px; min-width:0; white-space:normal }
.excerpt-comment { --clip-limit:154px }
.excerpt[data-open=false]>.clip { overflow:hidden; max-height:var(--clip-limit) }
.rich-body { display:flow-root }
.rich-body p { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.55; margin:0 }
.rich-flow { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.65 }
.rich-flow .picture { display:inline-block; vertical-align:middle; margin:2px; line-height:0 }

.show-all { padding:1px 0; font-weight:600; color:var(--forest) }
.picture { max-width:100%; padding:0; display:block; border:0; cursor:zoom-in; border-radius:5px; overflow:hidden }
.picture img { display:block; width:auto; height:auto; max-width:min(100%,640px); max-height:180px; object-fit:contain; border:1px solid var(--line); border-radius:5px }
.excerpt-comment .picture img { max-height:138px }
.rich-editor { position:relative; min-width:0; width:100%; min-height:46px; max-height:58dvh; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.65; padding:3px 2px; font-size:14px; cursor:text; outline:none }
.rich-editor[data-empty=true]::before { content:attr(data-placeholder); color:#728075; position:absolute; pointer-events:none }
.note-editor .rich-editor { min-height:9em; border:1px solid #c7d2c5; padding:8px 10px; border-radius:6px }
.note-editor .rich-editor:focus { border-color:#7c9a6f }
.edit-picture { position:relative; display:inline-block; vertical-align:middle; max-width:calc(100% - 4px); margin:2px; line-height:0; white-space:normal }
.edit-picture img { max-width:min(100%,280px); max-height:140px }
.edit-picture>.icon-button { position:absolute; right:3px; top:3px; height:24px; width:24px; border:1px solid var(--line); background:white; border-radius:50% }

.note-editor .modal-foot>.icon-button { margin-right:auto }
#image-viewer { width:fit-content; min-width:min(320px,90vw); max-width:94vw; max-height:94dvh; overflow:hidden }
#image-viewer .modal-head { gap:10px }
#image-viewer h2 { margin-right:auto }
.image-scroll { overflow:auto; max-height:calc(94dvh - 60px); max-width:94vw }
#viewer-image { display:block; width:auto; height:auto; max-width:100%; max-height:calc(94dvh - 60px); margin:auto }
#image-viewer.actual #viewer-image { max-width:none; max-height:none }
#image-viewer.actual { width:94vw }
@media(max-width:480px) {
  #comments>.comment { gap:5px }
  .author { gap:2px 4px }
  .comment-actions { gap:0 }
  .comment-actions .mini { font-size:11px; padding:2px 3px }
  .comment-actions .icon-button { width:22px; height:22px }
}
