:root {
  color-scheme: light;
  --ink:#172e2b; --muted:#5a706a; --line:#d8e2dd; --paper:#fbfcf9; --wash:#f0f4ee;
  --forest:#12483e; --deep:#103c35; --lime:#d5ef85;
  font:16px/1.55 "DM Sans","Microsoft YaHei UI","PingFang SC",system-ui,sans-serif;
  color:var(--ink); background:var(--wash)
}
* { box-sizing:border-box }
[hidden] { display:none!important }
body { margin:0 }
button,input,textarea { font:inherit }
button { cursor:pointer; color:inherit; border:0; background:none; touch-action:manipulation }
button:disabled { cursor:default; opacity:.48 }
button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline:3px solid #579f89; outline-offset:2px }
input,textarea { width:100%; min-width:0; border:1px solid #c9d6cd; padding:11px 13px; border-radius:9px; color:var(--ink); background:#fff }
input::placeholder,textarea::placeholder { color:#73817b }
label { display:grid; gap:6px; margin:17px 0; font-size:.88rem; font-weight:650 }
input,textarea { font-size:1rem; font-weight:400 }
h1,h2,p { margin:0 }
.primary { color:white; background:var(--forest); border-radius:10px; padding:10px 20px; font-weight:650 }
.primary:hover:enabled { background:#20634f }
.wide { width:100% }
.soft,small { color:var(--muted) }
small { font-size:.78rem }
.error { color:#a02c29; font-size:.88rem; margin:10px 0 }
.error:empty { display:none }
.entrance { min-height:100vh; min-height:100dvh; display:grid; grid-template-columns:minmax(300px,1.08fr) 1fr }
.cover { background:var(--deep); color:#fff; display:flex; flex-direction:column; justify-content:space-between; gap:30px; padding:clamp(30px,5vw,84px); position:relative; overflow:hidden; isolation:isolate }
.cover::before { content:""; position:absolute; inset:0; z-index:-1; opacity:.23; background-image:radial-gradient(#89baa3 .9px,transparent 1px); background-size:16px 16px; mask-image:linear-gradient(145deg,transparent 8%,#000 75%) }
.brand { display:flex; align-items:center; gap:10px; font-weight:750; letter-spacing:-.035em; font-size:1.08rem }
.brand b { font-weight:450; opacity:.7 }
.mark { width:29px; height:24px; background:var(--lime); display:inline-block; border-radius:8px 8px 8px 2px; position:relative; flex:none }
.mark::after { content:""; position:absolute; width:45%; height:3px; border-radius:8px; left:26%; top:44%; background:var(--deep); box-shadow:0 5px var(--deep) }
.art { width:min(100%,410px); aspect-ratio:1.35; margin:auto; position:relative }
.orbit { position:absolute; inset:0 9%; border-radius:50%; border:1px solid #4e7765; transform:rotate(-30deg); box-shadow:0 0 0 24px #aac8af0b,0 0 0 50px #aac8af08 }
.bubble { position:absolute; display:flex; align-items:center; justify-content:center; gap:8%; border-radius:26% 26% 26% 5%; box-shadow:0 22px 28px #092e3040 }
.bubble.back { width:55%; height:51%; top:13%; left:13%; transform:rotate(-13deg); background:#91bbab }
.bubble.back i { width:9%; aspect-ratio:1; background:#254e44; border-radius:50% }
.bubble.front { width:52%; height:48%; right:9%; bottom:7%; background:var(--lime); transform:rotate(9deg); border-radius:25% 25% 4% 25%; flex-direction:column; align-items:flex-start; padding-left:12% }
.bubble.front i { height:6%; width:68%; border-radius:12px; background:#346349 }
.bubble.front i+i { width:46% }
.cover-caption h1 { font-size:clamp(3.3rem,6vw,6rem); font-weight:650; line-height:1.1; letter-spacing:-.07em }
.cover-caption h1 span { color:var(--lime) }
.cover-caption p { margin-top:14px; color:#d3e4db }
.auth-panel { background:var(--paper); display:grid; place-items:center; padding:32px }
.auth-form { width:min(100%,360px) }
.switch,.filters { display:flex; gap:4px }
.switch { width:fit-content; padding:4px; background:#e6ede7; border-radius:10px; margin-bottom:22px }
.switch button { padding:6px 20px; border-radius:7px; font-size:.9rem }
.switch [aria-pressed=true] { background:white; box-shadow:0 1px 5px #123e3917; font-weight:700 }
.auth-form h2 { font-size:2rem; letter-spacing:-.045em }
.auth-form .soft { margin:4px 0 22px }
.auth-form .primary { margin-top:8px }
.admin-link { display:block; margin-top:18px; text-align:center; color:var(--forest); font-size:.9rem }
.admin-head { background:var(--deep); color:white; display:flex; justify-content:space-between; align-items:center; padding:16px clamp(16px,5vw,72px); gap:12px }
.admin-head nav { display:flex; align-items:center; gap:12px; font-size:.9rem }
.admin-head a { color:inherit }
.admin-main { max-width:1020px; margin:32px auto; padding:0 16px }
.admin-main .auth-form { margin:10vh auto; width:min(100%,400px) }
.admin-card { padding:clamp(16px,3vw,28px); background:var(--paper); border:1px solid var(--line); border-radius:16px }
#dashboard { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,345px),1fr)); gap:20px; align-items:start }
.admin-list { list-style:none; margin:16px 0 0; padding:0 }
.admin-list li { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-top:1px solid var(--line); overflow-wrap:anywhere }
.admin-list small { display:block }
.admin-list button { flex:none }
#invites li { flex-wrap:wrap }
.invite-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:2px; margin-left:auto }
#editForm .invite-actions { margin-top:16px }
.workspace { display:grid; grid-template-columns:clamp(280px,29vw,390px) 1fr; height:100vh; height:100dvh; overflow:hidden; max-width:1760px; margin:auto; background:var(--paper) }
.sidebar,.conversation { display:flex; flex-direction:column; min-width:0; min-height:0 }
.sidebar { border-right:1px solid var(--line); background:var(--paper) }
.side-head { background:var(--deep); color:white; padding:22px; display:flex; align-items:center; justify-content:space-between; gap:12px }
.status { font-size:.76rem; color:#e6eede; display:flex; align-items:center; gap:7px }
.status::before { content:""; width:7px; height:7px; background:#e8b976; border-radius:50% }
.status.online::before { background:var(--lime) }
.side-tools { padding:22px 19px 12px }
.row-title,.thread-head,.dialog-head,.compose-actions,.account { display:flex; align-items:center; gap:12px }
.row-title,.dialog-head { justify-content:space-between; margin-bottom:14px }
.row-title h1 { font-size:1.65rem }
.round,.close { width:40px; height:40px; border-radius:50%; padding:0; font-size:1.4rem }
.side-tools input { background:var(--wash); border-color:transparent }
.filters { margin-top:13px; flex-wrap:wrap }
.filters button { font-size:.83rem; color:var(--muted); padding:6px 12px; border-radius:20px }
.filters [aria-pressed=true] { background:#dce9dc; color:var(--forest); font-weight:700 }
.room-list { flex:1; overflow:auto; padding:0 9px }
.room { width:100%; text-align:left; display:flex; gap:12px; align-items:center; padding:13px 10px; border-radius:12px }
.room:hover,.plain:hover,.image-btn:hover,.close:hover { background:#e6eee7 }
.room[aria-current=true] { background:#e3eddd }
.avatar { flex:none; display:grid; place-items:center; width:43px; height:43px; background:#dce8d2; color:#30583e; border-radius:15px; font-weight:700 }
.avatar.group { color:#445b78; background:#dce8ef }
.room-copy,.heading,.account>div { flex:1; min-width:0 }
.room strong,.room small,.heading h2,.account strong,.account small,.attachment span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.room-meta { display:grid; gap:5px; justify-items:end }
.room time { font-size:.72rem; color:var(--muted) }
.badge { background:var(--forest); color:white; padding:0 6px; min-width:20px; text-align:center; border-radius:20px; font-size:.74rem }
.account { padding:14px 19px max(14px,env(safe-area-inset-bottom)); border-top:1px solid var(--line) }
.plain,.image-btn,.older { padding:8px 12px; border-radius:8px; color:var(--forest); font-size:.9rem }
.thread { min-width:0; min-height:0; background:#f1f4ee }
.empty-thread { height:100%; display:flex; flex-direction:column; gap:14px; justify-content:center; align-items:center; text-align:center; padding:24px }
.big { transform:rotate(-7deg); width:70px; height:58px; margin-bottom:8px; border-radius:17px 17px 17px 3px }
.big::after { height:5px; box-shadow:0 9px var(--deep) }
.conversation { height:100% }
.thread-head { padding:14px clamp(16px,3vw,48px); border-bottom:1px solid var(--line); background:var(--paper) }
.thread-head h2 { font-size:1.12rem }
.back-btn { display:none; font-size:1.7rem; padding:0 10px }
.timeline { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:18px clamp(14px,4vw,62px); overflow-anchor:none }
.older { display:block; margin:0 auto; background:white }
.date,.placeholder { text-align:center; color:var(--muted); font-size:.85rem; margin:18px auto }
.message { display:flex; flex-direction:column; align-items:flex-start; margin:13px 0 }
.message.mine { align-items:flex-end }
.message small { margin:0 4px 4px; font-size:.73rem }
.balloon { max-width:min(82%,640px); min-width:0; white-space:pre-wrap; overflow-wrap:anywhere; border:1px solid var(--line); border-radius:3px 15px 15px; background:white; padding:9px 13px }
.mine .balloon { background:#d9edc8; border-color:#cce1bf; border-radius:15px 3px 15px 15px }
.balloon button { display:block; padding:0; max-width:100% }
.balloon img { display:block; max-width:100%; width:220px; height:156px; object-fit:contain; border-radius:6px; background:#143d3210 }
.balloon img+p,.balloon button+p { margin-top:6px }
.composer { margin:0 clamp(12px,3vw,48px) max(15px,env(safe-area-inset-bottom)); background:white; border:1px solid #c5d3c9; border-radius:15px; padding:10px; flex:none }
.composer textarea { resize:none; border:0; padding:4px 6px; display:block; background:transparent }
.compose-actions { justify-content:space-between; gap:8px; padding-top:5px }
.key-hint { color:var(--muted); margin-left:auto; font-size:.72rem }
.image-btn { display:flex; gap:7px; align-items:center }
.image-btn i { width:16px; height:14px; border:1.5px solid currentColor; border-radius:3px; background:linear-gradient(145deg,transparent 51%,currentColor 53% 58%,transparent 60%) }
.attachment { display:flex; gap:9px; align-items:center; padding:5px 7px; background:var(--wash); border-radius:8px; font-size:.8rem }
.attachment img { width:44px; height:44px; object-fit:cover; border-radius:6px }
.attachment span { flex:1 }
dialog { width:min(420px,calc(100% - 28px)); max-height:90dvh; color:var(--ink); background:var(--paper); border:1px solid var(--line); border-radius:18px; padding:24px; box-shadow:0 20px 100px #163b352a }
dialog::backdrop { background:#0d2c286b }
.dialog-head h2 { font-size:1.25rem }
.close { background:var(--wash) }
.member { display:flex; gap:12px; align-items:center; padding:10px 0; border-bottom:1px solid var(--line) }
.member small { display:block }
.found { padding:12px 0; border-bottom:1px solid var(--line) }
.found p { white-space:pre-wrap; overflow-wrap:anywhere }
#photoDialog { width:fit-content; max-width:95vw }
#fullPhoto { display:block; max-width:100%; max-height:70dvh; margin:auto; object-fit:contain }
#notice { position:fixed; bottom:max(18px,env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); z-index:10; color:white; background:#203c36; border-radius:12px; padding:10px 18px; max-width:90vw; width:max-content }
@media(max-width:700px) {
  .entrance { grid-template-columns:1fr; grid-template-rows:auto 1fr }
  .cover { padding:max(20px,env(safe-area-inset-top)) 24px 24px; gap:23px }
  .cover-caption h1 { font-size:2.6rem }
  .cover-caption p { font-size:.85rem; margin-top:6px }
  .art { position:absolute; width:108px; right:14px; top:18px; opacity:.84 }
  .auth-panel { padding:25px 23px max(24px,env(safe-area-inset-bottom)); align-items:start }
  .workspace { display:block }
  .sidebar,.thread { height:100% }
  .thread,.workspace.in-room .sidebar { display:none }
  .workspace.in-room .thread { display:block }
  .back-btn { display:block }
  .thread-head,.side-head { padding-top:max(13px,env(safe-area-inset-top)) }
  .thread-head { padding-inline:8px 14px }
  .key-hint { display:none }
  .composer { margin-inline:8px; margin-bottom:max(8px,env(safe-area-inset-bottom)) }
  .balloon { max-width:90% }
  .compose-actions button { min-height:40px }
}
