:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC",sans-serif;color-scheme:light;--bg:#faf9f6;--panel:#fff;--soft:#efefea;--text:#262b29;--muted:#747c77;--line:#e0e3db;--accent:#176f63;--tint:#e4f0ea;--chip:#cdf0da;--chipink:#0d4f36;--shadow:0 18px 60px #14241a18}
:root[data-theme=dark]{color-scheme:dark;--bg:#141917;--panel:#1d2420;--soft:#242d27;--text:#edf0e9;--muted:#a0afa5;--line:#354039;--accent:#89d6b6;--tint:#263d30;--chip:#2e5a44;--chipink:#c4f2d6;--shadow:0 18px 60px #0005}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text)}button,input,select{font:inherit}button,a,input,select{touch-action:manipulation}button{min-height:44px;padding:9px 15px;background:var(--panel);border:1px solid var(--line);border-radius:10px;color:var(--text);cursor:pointer;transition:background .15s}button:hover{background:var(--soft)}button:disabled{opacity:.45;cursor:wait}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--accent);outline-offset:3px}.primary{background:var(--accent);color:var(--bg);border-color:var(--accent);font-weight:600}.primary:hover{filter:brightness(.94);background:var(--accent)}a{color:inherit;text-decoration:none}header{height:66px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px;padding:0 28px;background:var(--bg)}.brand{font-weight:750;font-size:23px;letter-spacing:-1px;display:flex;align-items:flex-end;gap:2px}.brand-dot{width:6px;height:6px;border-radius:50%;background:var(--accent);margin:0 1px 5px}.spacer{flex:1}#theme{border:0;background:transparent;font-size:24px;width:44px;padding:4px}.shell{display:grid;grid-template-columns:232px 1fr;min-height:calc(100vh - 66px)}aside{border-right:1px solid var(--line);padding:24px 14px;overflow:auto}.side-heading{display:flex;align-items:center;justify-content:space-between;font-size:13px;color:var(--muted);padding-left:12px}.side-heading button{border:0;background:none;font-size:22px}.nav-active{width:100%;text-align:left;background:var(--tint);border:0;margin:10px 0 16px;color:var(--accent);font-weight:600}#tree{font-size:13px}.tree-row{display:flex;align-items:center;min-height:44px;gap:3px}.tree-row a{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:10px 3px}.tree-row button{border:0;background:none;padding:6px;min-width:32px;opacity:.7}.tree-children{padding-left:12px;border-left:1px solid var(--line);margin-left:12px}#storage-note{padding:18px 12px;line-height:1.7}main{padding:0 48px;min-width:0;max-width:1440px;width:100%;margin:0 auto}.hero{padding:68px 0 58px;max-width:800px}h1{font-size:clamp(32px,3.7vw,53px);letter-spacing:-2px;font-weight:600;line-height:1.25;margin:20px 0}h2{font-weight:600;font-size:20px;margin:0 0 8px}h3{font-size:17px;font-weight:600}.hero p{color:var(--muted);font-size:16px;line-height:1.8;margin-bottom:24px}.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.section-heading{display:flex;gap:16px;justify-content:space-between;align-items:center}.section-heading p{font-size:13px;margin:0}.muted{color:var(--muted)}.small{font-size:12px}.filters{display:flex;gap:12px;margin:24px 0 18px}input,select{color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:9px;padding:11px 12px;min-height:44px;max-width:100%}#search{flex:1;min-width:0;max-width:400px}#status{color:var(--muted);font-size:13px}.resource-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:18px}.resource-card{border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--panel);position:relative}.resource-card.selected{outline:2px solid var(--accent);border-color:var(--accent)}.resource-card .thumbnail{width:100%;aspect-ratio:16/10;object-fit:cover;background:var(--soft);display:flex;align-items:center;justify-content:center;font-size:36px}.resource-card .resource-info{padding:12px 14px 14px}.resource-card h3{font-size:14px;margin:0 0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.resource-card .card-actions{display:flex;gap:6px;margin-top:12px}.resource-card .card-actions button{flex:1;font-size:12px;min-height:40px;padding:8px}.resource-card .select-resource{min-width:44px;padding:6px}.resource-card .metadata{color:var(--muted);font-size:12px}.empty{border:1px dashed var(--line);border-radius:16px;text-align:center;padding:42px 16px}.empty-icon{background:var(--tint);color:var(--accent);width:54px;height:54px;border-radius:16px;display:grid;place-items:center;margin:auto;font-size:26px}.empty p{color:var(--muted);font-size:14px;line-height:1.8}.empty button{margin-top:10px}#selection-bar{position:sticky;top:8px;z-index:2;padding:10px 14px;background:var(--tint);border:1px solid var(--line);border-radius:12px;display:flex;align-items:center;gap:12px;font-size:13px;margin-bottom:20px}#selection-count{flex:1}#recent-section{margin:42px 0}.recent-note{border-bottom:1px solid var(--line);display:flex;align-items:center;gap:8px;padding:8px 0}.recent-note a{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:44px;padding-top:12px}.recent-note button{border:0;background:none}.recent-note small{color:var(--muted)}footer{font-size:12px;color:var(--muted);border-top:1px solid var(--line);padding:24px 0 32px;line-height:1.7}dialog{border:1px solid var(--line);border-radius:18px;padding:28px;width:min(500px,calc(100% - 24px));background:var(--panel);color:var(--text);box-shadow:var(--shadow)}dialog::backdrop{background:#10221a66;backdrop-filter:blur(3px)}dialog h2{margin-bottom:16px}dialog .actions{justify-content:flex-end;margin-top:24px}label{display:flex;flex-direction:column;gap:8px;margin:18px 0;font-size:14px}progress{width:100%;accent-color:var(--accent)}[role=alert]{color:#d45f46}audio{width:100%;margin:12px 0}body.picker header,body.picker aside,body.picker .hero,body.picker #recent-section,body.picker footer{display:none}body.picker .shell{display:block;min-height:100vh}body.picker main{padding:20px}body.picker .resource-grid{grid-template-columns:repeat(auto-fill,minmax(185px,1fr))}[hidden]{display:none!important}
/* Home is a single entry point, never a dashboard. Space lives in the note. */
body.home aside,body.home #library-section,body.home #recent-section{display:none}
/* …and, until now, nowhere else. The ⊞ that opens 我的空间 is drawn by the
   editor in a note's top bar, and `/` has no note. Same glyph, same word, same
   aside: slid in over the page where the screen is narrow, docked beside it
   where there is room. */
#space-toggle{display:none}
body.home #space-toggle{display:grid;place-items:center;width:44px;height:44px;min-height:44px;padding:0;border:0;background:transparent;color:inherit}
body.home #space-toggle[aria-expanded=true]{background:var(--tint);color:var(--accent)}
.drawer-head{display:none}
body.home .drawer-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font-weight:600;margin:0 0 14px 12px}
.drawer-head button{border:0;background:none;font-size:26px;min-width:44px;padding:0 8px;line-height:1}
body.home #space-scrim{position:fixed;inset:0;z-index:8;background:#10221a66;backdrop-filter:blur(2px)}
body.home.space-open aside{display:block;position:fixed;inset:0 auto 0 0;z-index:9;width:min(300px,86vw);overflow:auto;background:var(--bg);border-right:1px solid var(--line);box-shadow:var(--shadow)}
/* Asking for your space is asking for what is in it: the 资源库 entry in the
   drawer is not a dead end, it shows the library on the page behind it. */
body.home.library-open #library-section,body.home.library-open #recent-section{display:block}
body.home.library-open .show,body.home.library-open .tiles{display:none}
body.home.library-open main{max-width:1100px}
body.home.library-open .hero{margin:0 auto 32px}
@media(min-width:900px){
  body.home.space-open #space-scrim{display:none}
  body.home.space-open .shell{display:grid;grid-template-columns:260px 1fr}
  body.home.space-open aside{position:static;width:auto;box-shadow:none;min-height:calc(100dvh - 66px)}
}
/* The homepage says what this is before anyone has a file to drop. `.show` and
   `.tiles` start out hidden, so `?picker=1` and `?space=1` are untouched. */
/* Body copy here, not a metadata label: the shared #747c77 is 4.1:1 on it. */
body.home{--muted:#656c68}
.show,.tiles{display:none}
body.home header{border:0;background:none}
body.home .shell{display:block}
body.home main{max-width:880px;padding:16px 20px 0}
body.home .hero{max-width:620px;padding:0;margin:0 auto;text-align:center}
body.home #drop-zone{border:1.5px dashed transparent;border-radius:24px;padding:18px 12px 24px}
body.home #drop-zone.dragging{border-color:var(--accent);background:var(--tint)}
body.home h1{font-size:clamp(27px,7.6vw,42px);letter-spacing:-.5px;line-height:1.32;font-weight:700;margin:0 0 14px}
body.home .hero p{font-size:15px;line-height:1.75;margin:0 auto 22px}
body.home .hero p.small{margin:12px auto 0}
body.home #hero-upload{display:inline-flex;align-items:center;justify-content:center;gap:10px;width:min(100%,336px);min-height:56px;font-size:17px;border-radius:15px}
body.home #new-note{border:0;background:none;color:var(--accent);margin-top:12px}
body.home #status{margin-top:14px}
body.home footer{text-align:center;margin-top:36px}
.ic{display:block;width:15px;height:15px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#hero-upload .ic{width:21px;height:21px}
/* The product drawn, not photographed — log.video is not one sport. Keyframes
   only, no image and no timer, and all four sports share one viewBox, so the
   cycle moves nothing. A fifth: one more <g>, one more delay, 3s × count. */
body.home .show{display:grid;gap:14px;margin:26px auto 0;max-width:820px}
.frame{position:relative;border:1px solid var(--line);border-radius:18px;overflow:hidden;background:var(--tint)}
.stage{display:block;width:100%;fill:none;stroke:var(--accent);stroke-width:7;stroke-linecap:round;stroke-linejoin:round}
.stage circle{fill:var(--accent);stroke:none}
.gr{opacity:.3;stroke-width:5}.pd{stroke-width:26}.ge{stroke-width:9}.po{stroke-width:3.5}
.ar{stroke:var(--chipink);stroke-width:4}
.tag rect{fill:var(--chip);stroke:none}
.tag text{fill:var(--chipink);font-size:11px;font-weight:600;text-anchor:middle;stroke:none}
.stage>g{opacity:0;animation:sport 12s infinite}
.stage>g:nth-child(2){animation-delay:-9s}.stage>g:nth-child(3){animation-delay:-6s}.stage>g:nth-child(4){animation-delay:-3s}
@keyframes sport{0%,21%{opacity:1}25%,96%{opacity:0}100%{opacity:1}}
@media(prefers-reduced-motion:reduce){.stage>g{animation:none}.stage>g:first-child{opacity:1}}
.chip,.bar{position:absolute;left:10px;background:#1b2a23e0;color:#f2f7f3}
.chip{top:8px;padding:4px 9px;border-radius:8px;font-size:11px;font-weight:600}
.rate{left:auto;right:10px}
.bar{right:10px;bottom:8px;display:flex;align-items:center;gap:10px;padding:7px 11px;border-radius:11px}
.pz path{fill:currentColor;stroke:none}
.track{position:relative;flex:1;height:4px;border-radius:2px;background:#ffffff59}
.track i{position:absolute;inset:0 auto 0 0;width:52%;border-radius:2px;background:#8fe0a5}
.track i:after{content:"";position:absolute;right:-5px;top:-3px;width:10px;height:10px;border-radius:50%;background:#fff}
.chat{display:grid;gap:8px;align-content:start}
.bubble,.mock{margin:0;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:9px 11px;font-size:12px;line-height:1.65}
.bubble i{font-style:normal;color:var(--muted);margin-left:6px}
.bubble span{display:block;margin-top:5px}
.bubble.me span{background:var(--tint);border-radius:10px;padding:6px 8px}
.mock{display:flex;align-items:center;gap:8px;color:var(--muted)}
.mock .ic{margin-left:auto;color:var(--accent)}
body.home .tiles{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:28px auto 0;max-width:820px}
.tile{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:18px 14px;text-align:center}
.tile .ic{width:24px;height:24px;margin:0 auto;padding:9px;border-radius:50%;background:var(--tint);color:var(--accent);box-sizing:content-box}
.tile h2{font-size:15px;margin:10px 0 6px}
.tile p{color:var(--muted);font-size:12px;line-height:1.7;margin:0}
@media(min-width:480px){.show{grid-template-columns:minmax(0,1fr) clamp(148px,30%,240px);align-items:start}}
@media(min-width:700px){body.home .tiles{grid-template-columns:repeat(4,1fr);gap:16px}}
/* A narrow embedded navigation panel, including on touch screens. */
body.space header,body.space main{display:none}
body.space .shell{display:block;min-height:100dvh}
body.space aside{padding:8px 12px;border:0;display:flex;flex-direction:column;min-height:100dvh;overflow-x:hidden}
body.space #tree,body.space #storage-note,body.space .nav-active{display:block}
body.space #tree{flex:1;min-width:0}
body.space .side-heading{padding-left:8px;justify-content:space-between;cursor:default}
body.space .side-heading:before{display:none}
body.space .tree-row{min-width:0}
body.space .tree-row button{min-width:36px}
body.space .tree-row a[aria-current=page]{background:var(--tint);color:var(--accent);border-radius:7px}
body.space #storage-note{margin:16px 0 8px;padding:12px 4px 0;border-top:1px solid var(--line)}
body.space #account{width:100%;text-align:left}
body.space dialog{padding:16px;max-height:calc(100dvh - 24px);overflow:auto}
body.space .tree-children:empty{display:none}
button{transition:none}
@media(max-width:760px){header{padding:0 16px;height:58px}main{padding:0 20px}.section-heading{align-items:flex-start;flex-wrap:wrap}.section-heading .actions{gap:6px}.resource-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px}.filters{gap:8px}.filters select{max-width:140px}.resource-card .card-actions{flex-wrap:wrap}.resource-card .card-actions button{flex:1 1 100%}#selection-bar{flex-wrap:wrap}#selection-count{flex-basis:100%}}

/* Public pages: one profile for a person, their videos and their notes. */
body.profile,body.notice{min-height:100dvh}
.page{padding:22px 16px 40px;max-width:1080px;margin:0 auto;min-width:0}
.profile-head{padding:8px 0 4px}
.profile-head h1{font-size:27px;letter-spacing:-.5px;margin:0 0 6px;word-break:break-word}
.profile-head p{margin:0 0 14px}
.tabs{display:flex;gap:8px;border-bottom:1px solid var(--line);margin-bottom:22px;overflow-x:auto}
.tab{display:inline-block;padding:11px 4px;margin-right:14px;font-size:14px;color:var(--muted);border-bottom:2px solid transparent;white-space:nowrap}
.tab-on{color:var(--accent);border-bottom-color:var(--accent);font-weight:600}
.page section{margin-bottom:34px}
.page h2{font-size:15px;color:var(--muted);font-weight:600;letter-spacing:.4px;margin-bottom:12px}
ul.resource-grid,.post-list{list-style:none;margin:0;padding:0}
.resource-cell{min-width:0}
.resource-cell .resource-card{display:block;margin-bottom:8px}
.resource-cell .card-actions{display:flex;gap:6px}
.resource-cell .card-actions button{flex:1;min-height:40px;padding:7px;font-size:12px}
.badge{display:inline-block;margin-top:8px;padding:2px 8px;border-radius:999px;background:var(--soft);color:var(--muted);font-size:11px}
.post-row{border-bottom:1px solid var(--line);padding:4px 0}
.post-row>a{display:flex;align-items:center;gap:10px;min-height:48px;padding:6px 0}
.post-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px}
.post-row small{color:var(--muted);white-space:nowrap}
.post-row .badge{margin:0}
.post-row .card-actions{padding-bottom:10px}
.post-row .card-actions button{min-height:40px;padding:7px 12px;font-size:12px}
.post-row .share-choice{flex:0 1 auto;min-height:40px;font-size:12px}
.button-link{display:inline-block;padding:11px 18px;border-radius:10px;margin-top:16px;background:var(--accent);color:var(--bg);font-weight:600}
body.notice .empty{max-width:520px;margin:40px auto;border-style:solid}
body.notice h1{font-size:23px;letter-spacing:-.5px;margin:16px 0 8px}
#page-status{color:var(--muted);font-size:13px;min-height:20px;margin:0 0 12px;word-break:break-all}
@media(min-width:760px){.page{padding:30px 32px 56px}.profile-head h1{font-size:34px}}

/* Who may open this lives on the card and in the page dialog, also on a phone.
   The choice is a real <select>: three options in one 44px control, with the
   phone's own picker, rather than three buttons wrapping under a 160px card. */
.card-share{margin-top:8px}
.card-share button{font-size:12px;min-height:40px;padding:8px 6px}
.share-choice{flex:2 1 120px;min-width:0;font-size:12px;min-height:40px;padding:8px 6px}
.share-note{margin:6px 0 14px;line-height:1.7}
#page-share{display:block}
#page-share .share-choice{width:100%;font-size:14px;min-height:44px;padding:11px 12px}
#move-dialog .share-note{margin:-8px 0 12px}
.link-line{display:block;margin-top:9px;line-height:1.6;word-break:break-all;color:var(--muted);font-size:12px}
#page-link{margin:4px 0 0}
#move-dialog .actions{justify-content:flex-start;margin-top:12px}
#page-delete-title{word-break:break-word}
#move-dialog .actions:last-of-type{justify-content:flex-end;margin-top:20px}
@media(max-width:760px){
  .section-heading{flex-direction:column;align-items:stretch;gap:12px}
  .section-heading .actions button{flex:1 1 0;min-width:0}
  .filters{flex-wrap:wrap}
  #search{max-width:none;flex:1 1 100%}
  .filters select{max-width:none;flex:1}
  #selection-bar{position:sticky;top:4px;padding:10px 12px;gap:8px}
  #selection-bar button{flex:1 1 auto;min-width:0}
  .resource-card .card-actions button{flex:1 1 40%}
  body.picker .resource-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
  dialog{padding:18px;max-height:calc(100dvh - 20px);overflow:auto}
  dialog .actions button{flex:1 1 auto}
  body.home main{padding:12px 16px 0}
}
/* Rename, replace and delete: one ⋯ in the same corner of every card. It is the
   only way to delete a resource, so it shares the card header with the ＋ that
   selects — both over the thumbnail, neither of them below the fold. */
.resource-cell{position:relative}
.card-header{position:absolute;top:0;left:0;right:0;display:flex;justify-content:space-between;gap:8px;padding:10px;pointer-events:none}
.card-header button{pointer-events:auto}
.manage{min-width:44px;min-height:44px;padding:4px 6px;font-size:21px;line-height:1;font-weight:700;background:var(--panel)}
.resource-cell>.manage{position:absolute;top:10px;left:10px}
.card-manage{flex-wrap:wrap}
.card-manage button{flex:1 1 30%;min-width:96px}
/* A card whose file is not there yet. The badge is the whole state — a card
   that says nothing while ffmpeg works is a card that looks broken — and the
   bar under it only appears once ffmpeg has said how far along it is. */
.card-status{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:2px 0 4px}
.card-status .badge{margin:0;background:var(--tint);color:var(--accent)}
.card-status .badge.stalled{background:#f7e4de;color:#b23a22}
:root[data-theme=dark] .card-status .badge.stalled{background:#3a221b;color:#f0a893}
.card-status .reason{flex-basis:100%;line-height:1.6}
.card-progress{display:block;width:100%;height:4px;margin:2px 0 6px;border:0;background:var(--soft)}
.resource-card.waiting .thumbnail{opacity:.45}
.danger{color:#b23a22;border-color:#e0b3a8}
.danger:hover{background:#f7e4de}
:root[data-theme=dark] .danger{color:#f0a893;border-color:#6a3628}
:root[data-theme=dark] .danger:hover{background:#3a221b}
#resource-dialog .actions{justify-content:flex-start;margin-top:14px}
#resource-dialog .actions:last-of-type{justify-content:flex-end;margin-top:20px}
#resource-meta{margin:0 0 14px}
#delete-name{font-weight:600;word-break:break-all;margin:0 0 10px}
.page .profile-head{margin-bottom:0}
#page-status:empty{min-height:0;margin:0}
body.notice .empty-icon{width:fit-content;min-width:76px;padding:0 16px;font-size:21px;letter-spacing:1px}
