/* P01 L2 — resource action affordance + responsive reachability authority.
 * Primary action stays on resource title / visual; management remains secondary.
 * Two or more secondary controls collapse into one shared ellipsis menu.
 */
.vf-functional-workspace .vf-asset-actions{
  opacity:.2;
  transform:none;
  transition:opacity .14s ease;
}
.vf-functional-workspace .vf-asset-card .vf-asset-actions{
  position:static;
  top:auto;
  right:auto;
  flex:0 0 auto;
  margin-left:auto;
  padding:0;
  background:transparent;
}
.vf-functional-workspace .vf-asset-row:hover .vf-asset-actions,
.vf-functional-workspace .vf-asset-row:focus-within .vf-asset-actions,
.vf-functional-workspace .vf-asset-card:hover .vf-asset-actions,
.vf-functional-workspace .vf-asset-card:focus-within .vf-asset-actions,
.vf-functional-workspace .vf-watch-card:hover .vf-asset-actions,
.vf-functional-workspace .vf-watch-card:focus-within .vf-asset-actions,
.vf-functional-workspace .vf-topic-card:hover .vf-asset-actions,
.vf-functional-workspace .vf-topic-card:focus-within .vf-asset-actions,
.vf-functional-workspace .vf-project-card:hover .vf-asset-actions,
.vf-functional-workspace .vf-project-card:focus-within .vf-asset-actions,
.vf-functional-workspace .vf-book-card:hover .vf-asset-actions,
.vf-functional-workspace .vf-book-card:focus-within .vf-asset-actions{
  opacity:1;
}
.vf-functional-workspace .vf-book-footer>.vf-asset-actions{
  opacity:1;
  transform:none;
}
.vf-functional-workspace .vf-icon-button{
  width:32px;
  height:32px;
  border-color:color-mix(in srgb,var(--ws-line) 72%,transparent);
  background:color-mix(in srgb,var(--ws-panel) 78%,transparent);
}
.vf-functional-workspace .vf-icon-button:hover{
  border-color:var(--ws-line-strong);
  background:var(--ws-panel);
}
.vf-functional-workspace .vf-icon-button:focus-visible,
.vf-functional-workspace [data-primary-open]:focus-visible{
  outline:2px solid var(--ws-teal);
  outline-offset:2px;
}
.vf-functional-workspace .vf-icon-button:focus-visible{
  border-color:var(--ws-teal);
  background:var(--ws-panel);
  color:var(--ws-teal);
}
.vf-functional-workspace [data-primary-open]:focus-visible{
  border-radius:6px;
}

@media (hover:none){
  .vf-functional-workspace .vf-asset-actions{opacity:1;transform:none}
}

@media(min-width:761px) and (max-width:1050px){
  .vf-functional-workspace .vf-category-search{display:flex}
}

@media(max-width:760px){
  .vf-functional-workspace .vf-toolbar-controls select[aria-label="排序"]{display:block}
  .vf-functional-workspace .vf-asset-actions{
    opacity:1;
    transform:none;
    gap:4px;
    margin-left:2px;
  }
  .vf-functional-workspace .vf-icon-button{
    width:40px;
    height:40px;
    border-color:var(--ws-line);
    border-radius:8px;
    background:var(--ws-panel);
    font-size:15px;
  }
  .vf-functional-workspace .vf-asset-actions [data-edit-id]{display:grid}
  .vf-functional-workspace .vf-asset-actions>a.vf-icon-button[href*="surface-open.php?id="]{display:none}
  .vf-functional-workspace .vf-asset-row .vf-asset-meta:has(>.vf-asset-actions){
    display:flex;
    max-width:none;
  }
  .vf-functional-workspace .vf-asset-row .vf-asset-meta:has(>.vf-asset-actions)>:not(.vf-asset-actions):not(.private){display:none}
  .vf-functional-workspace .vf-watch-card .vf-asset-actions,
  .vf-functional-workspace .vf-asset-card .vf-asset-actions{
    padding:2px;
  }
}

@media(max-width:520px){
  .vf-functional-workspace .vf-toolbar-controls{
    flex-wrap:nowrap;
    overflow:visible;
    gap:4px;
  }
  .vf-functional-workspace .vf-toolbar-controls select{
    min-width:0;
    flex:1 1 0;
  }
  .vf-functional-workspace .vf-toolbar-controls .vf-select-all-label{
    padding-inline:4px;
    gap:4px;
  }
  .vf-functional-workspace .vf-select-all-label,
  .vf-functional-workspace .vf-toolbar-controls>a[href*="density="]{
    flex:0 0 auto;
  }
  .vf-functional-workspace .vf-toolbar-controls>a[href*="density="]{display:inline-flex}
}

/* Shared overflow menu: one compact trigger instead of a row of management icons. */
.vf-action-menu-enhanced{
  opacity:1!important;
  overflow:visible!important;
  display:flex;
  align-items:center;
  gap:6px;
  transition:opacity .14s ease;
}
@media (hover:hover) and (pointer:fine){
  .vf-action-menu-enhanced{opacity:.38!important}
  [data-asset-row]:hover .vf-action-menu-enhanced,
  .vf-action-menu-enhanced:focus-within{opacity:1!important}
}
.vf-action-menu-trigger{
  width:30px;
  height:30px;
  flex:0 0 30px;
  padding:0;
  display:grid;
  place-items:center;
  border:1px solid color-mix(in srgb,var(--ws-line) 68%,transparent);
  border-radius:7px;
  background:color-mix(in srgb,var(--ws-panel) 86%,transparent);
  color:var(--ws-muted);
  font:inherit;
  font-size:17px;
  font-weight:800;
  line-height:1;
  letter-spacing:.05em;
  cursor:pointer;
  transition:border-color .14s ease,background .14s ease,color .14s ease;
}
.vf-action-menu-trigger:hover,
.vf-action-menu-trigger[aria-expanded="true"]{
  border-color:var(--ws-line-strong);
  background:var(--ws-panel);
  color:var(--ws-text);
}
.vf-action-menu-trigger:focus-visible{
  outline:2px solid var(--ws-teal);
  outline-offset:2px;
  border-color:var(--ws-teal);
}
.vf-action-menu-popover{
  position:fixed;
  inset:auto;
  width:max-content;
  min-width:172px;
  max-width:min(240px,calc(100vw - 16px));
  margin:0;
  padding:6px;
  border:1px solid var(--ws-line-strong);
  border-radius:10px;
  background:var(--ws-panel);
  color:var(--ws-text);
  box-shadow:0 16px 38px rgba(15,23,42,.16),0 3px 10px rgba(15,23,42,.08);
  z-index:1200;
}
.vf-action-menu-popover::backdrop{background:transparent}
.vf-action-menu-popover .vf-action-menu-item{
  width:100%!important;
  min-width:0;
  height:36px!important;
  min-height:36px;
  margin:0;
  padding:0 10px;
  display:flex!important;
  align-items:center;
  justify-content:flex-start;
  gap:9px;
  border:0!important;
  border-radius:7px;
  background:transparent!important;
  color:var(--ws-text);
  font:inherit;
  font-size:12px;
  font-weight:650;
  line-height:1;
  text-decoration:none;
  text-align:left;
  cursor:pointer;
  white-space:nowrap;
}
.vf-action-menu-popover .vf-action-menu-item::after{content:none!important}
.vf-action-menu-popover .vf-action-menu-label{
  min-width:0;
  display:block;
  overflow:hidden;
  color:inherit!important;
  font-size:12px!important;
  font-weight:650!important;
  line-height:1.2!important;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.vf-action-menu-popover .vf-action-menu-item:hover,
.vf-action-menu-popover .vf-action-menu-item:focus-visible{
  background:var(--ws-soft)!important;
  color:var(--ws-teal);
}
.vf-action-menu-popover .vf-action-menu-item:focus-visible{
  outline:2px solid var(--ws-teal);
  outline-offset:-2px;
}
.vf-action-menu-popover .vf-action-menu-item[data-delete-id]{
  margin-top:5px;
  border-top:1px solid var(--ws-line)!important;
  border-radius:0 0 7px 7px;
  padding-top:4px;
  height:41px!important;
  color:#b42318;
}
.vf-action-menu-popover .vf-action-menu-item[data-favorite="1"],
.vf-action-menu-popover .vf-action-menu-item.active{color:var(--ws-teal)}

@media(max-width:760px){
  .vf-action-menu-trigger{
    width:40px;
    height:40px;
    flex-basis:40px;
    border-color:var(--ws-line);
    border-radius:8px;
    background:var(--ws-panel);
    font-size:19px;
  }
  .vf-action-menu-popover{min-width:184px;padding:7px}
  .vf-action-menu-popover .vf-action-menu-item{height:42px!important;min-height:42px;font-size:13px}
  .vf-action-menu-popover .vf-action-menu-label{font-size:13px!important}
  .vf-action-menu-popover .vf-action-menu-item[data-delete-id]{height:47px!important}
}

/* URL-first navigation add: progressive enhancement only; full form remains the no-JS fallback. */
.vf-functional-workspace .vf-add-quickbar{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:38px;
  padding:8px 10px;
  border:1px solid color-mix(in srgb,var(--ws-teal) 18%,var(--ws-line));
  border-radius:8px;
  background:color-mix(in srgb,var(--ws-teal-soft) 18%,var(--ws-panel));
}
.vf-functional-workspace .vf-add-quickbar[hidden]{display:none}
.vf-functional-workspace .vf-add-quickbar>span{color:var(--ws-muted-2);font-size:11px;line-height:1.45}
.vf-functional-workspace .vf-add-more-toggle{
  flex:0 0 auto;
  min-height:30px;
  padding:0 9px;
  border:1px solid var(--ws-line);
  border-radius:7px;
  background:var(--ws-panel);
  color:var(--ws-teal);
  font:inherit;
  font-size:11px;
  font-weight:750;
  cursor:pointer;
}
.vf-functional-workspace .vf-add-more-toggle:hover{border-color:var(--ws-line-strong);background:var(--ws-soft)}
.vf-functional-workspace .vf-add-more-toggle:focus-visible{outline:2px solid var(--ws-teal);outline-offset:2px}
@media(max-width:520px){
  .vf-functional-workspace .vf-add-quickbar{align-items:flex-start;flex-direction:column;gap:7px}
}

/* Display style and density are global settings, never per-page state. */
.vf-functional-workspace .vf-toolbar-controls>a[href*="density="],
.vf-functional-workspace .vf-toolbar-controls>a[href*="layout="]{
  display:none!important;
}
