
.cp-tools { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; min-width: 0; }
.cp-search { height: 42px; }
.cp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-chips:empty { display: none; }
.cp-empty { color: var(--color-text-muted); font-size: var(--font-size-sm); margin: 10px 2px; }

.cp-group { margin: 14px 0 6px; min-width: 0; }
.cp-group__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; min-width: 0; }
.cp-group__title { margin: 0; font-size: var(--font-size-md); font-weight: 800; color: var(--color-text); overflow-wrap: anywhere; min-width: 0; flex: 1 1 180px; }
.cp-group__acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cp-group__acts--bare { justify-content: flex-end; margin-bottom: 6px; }
.cp-group__acts .btn { min-height: 34px; padding: 4px 10px; font-size: 12px; }
.cp-group__acts:empty { display: none; }
.cp-group__hint { font-size: var(--font-size-sm); color: var(--color-text-muted); margin: 0 0 6px; }
.cp-chip { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--color-primary); color: #fff; font-size: 11px; line-height: 18px; vertical-align: middle; font-weight: 700; }
.cp-group--next .cp-group__title { color: var(--color-primary); }

.cp-shelf { display: flex; flex-direction: column; gap: 6px; }
.cp-row {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 4px 6px; transition: transform .12s ease, box-shadow .12s ease;
}
.cp-row--main { border-color: var(--color-primary); }
.cp-row--mine { border-style: dashed; }
.cp-row--drag { position: relative; z-index: 2; box-shadow: 0 6px 18px var(--color-shadow); transition: none; opacity: .95; }
.cp-row--gap { box-shadow: 0 -3px 0 var(--color-primary); }
.cp-row--gap-end { box-shadow: 0 3px 0 var(--color-primary); }
.cp-row__main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left;
  background: none; border: 0; padding: 6px 4px; color: inherit; font: inherit; cursor: pointer; min-height: 44px;
}
.cp-row__icon { font-size: 22px; flex-shrink: 0; width: 28px; text-align: center; }
.cp-row__body { display: flex; flex-direction: column; min-width: 0; }
.cp-row__title { font-weight: 700; color: var(--color-text); overflow-wrap: anywhere; }
.cp-row__meta { font-size: var(--font-size-sm); color: var(--color-text-secondary); overflow-wrap: anywhere; }
.cp-row__drag {
  flex-shrink: 0; width: 32px; min-height: 44px; border: 0; background: none; color: var(--color-text-muted);
  font-size: 18px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.cp-row__drag:active { cursor: grabbing; }
.cp-row__more { flex-shrink: 0; width: 40px; min-height: 40px; border: 0; background: none; color: var(--color-text-secondary); font-size: 20px; cursor: pointer; border-radius: var(--radius-sm); }
.cp-row__more:hover, .cp-row__drag:hover { background: var(--color-primary-light); }
.cp-row__assign { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 400px) {
  .cp-row { flex-wrap: wrap; }
  .cp-row__main { flex-basis: calc(100% - 90px); }
  .cp-row__assign { margin-left: 38px; }
}

.cp-ov { z-index: 100003; }
.cp-sheet { width: 100%; max-width: 480px; }
.cp-sheet--wide { max-width: 620px; }
.cp-sheet__p { color: var(--color-text-secondary); margin: 0 0 12px; overflow-wrap: anywhere; }
.cp-lbl { display: flex; flex-direction: column; gap: 4px; font-size: var(--font-size-sm); font-weight: 700; color: var(--color-text-secondary); margin-bottom: 10px; }
.cp-sel { height: 44px; }
.cp-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  border: 2px dashed var(--color-border); border-radius: var(--radius-md); padding: 16px 10px; margin-bottom: 10px;
  color: var(--color-text-secondary); cursor: pointer;
}
.cp-drop--over { border-color: var(--color-primary); background: var(--color-primary-light); }
.cp-drop__big { font-size: 28px; }
.cp-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.cp-item { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 8px; min-width: 0; }
.cp-item--bad { border-color: var(--red); }
.cp-item__icon { font-size: 22px; flex-shrink: 0; }
.cp-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cp-item__title { height: 38px; }
.cp-item__meta { font-size: var(--font-size-sm); color: var(--color-text-secondary); overflow-wrap: anywhere; }
.cp-item__an { font-size: var(--font-size-sm); display: flex; align-items: center; gap: 6px; }
.cp-item__rm { border: 0; background: none; font-size: 18px; color: var(--color-text-muted); cursor: pointer; min-width: 36px; min-height: 36px; }
.cp-link { margin: 6px 0 10px; }
.cp-link summary { cursor: pointer; font-weight: 700; color: var(--color-text-secondary); padding: 6px 0; }
.cp-link .modal-input { margin-top: 6px; }
.cp-check { display: flex; align-items: center; gap: 8px; font-size: var(--font-size-sm); margin: 6px 0; }
.cp-limits { font-size: var(--font-size-xs); color: var(--color-text-muted); margin: 6px 0 0; }
.cp-menu { display: flex; flex-direction: column; gap: 2px; }
.cp-menu__title { margin-bottom: 10px; overflow-wrap: anywhere; font-size: var(--font-size-lg); }
.cp-menu__item {
  text-align: left; background: none; border: 0; border-radius: var(--radius-sm); padding: 12px 10px; min-height: 44px;
  font: inherit; color: var(--color-text); cursor: pointer; overflow-wrap: anywhere;
}
.cp-menu__item:hover:not(:disabled) { background: var(--color-primary-light); }
.cp-menu__item:disabled { opacity: .45; cursor: default; }
.cp-danger { background: var(--red); color: #fff; border-color: var(--red); }
.cp-summary { max-height: 60vh; overflow-y: auto; }
.cp-nw { margin: 6px 0; }

body.pv-open { overflow: hidden; }
.pv {
  position: fixed; inset: 0; z-index: 1200; display: flex; flex-direction: column;
  background: var(--cp-bg, #111); color: var(--color-text);
  background-color: var(--color-bg);
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  outline: none;
}
.pv__bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; min-height: 52px; border-bottom: 1px solid var(--color-border); min-width: 0; }
.pv__title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.pv__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv__count { font-size: var(--font-size-sm); color: var(--color-text-secondary); }
.pv__tools { display: flex; gap: 2px; flex-shrink: 0; }
.pv__slot { display: flex; align-items: center; gap: 4px; flex-shrink: 0; min-width: 0; }
.pv__slot:empty { display: none; }
.pv__btn {
  min-width: 44px; min-height: 44px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--color-text); font: inherit; font-size: 18px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.pv__btn[aria-pressed="true"] { background: var(--color-primary); color: #fff; }
.pv__btn:hover:not([aria-pressed="true"]) { background: var(--color-primary-light); }
.pv__lbl { font-size: var(--font-size-sm); }
@media (max-width: 380px) { .pv__lbl { display: none; } }
.pv__body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; grid-template-areas: "stage" "panel" "rail"; }
.pv__stage { grid-area: stage; position: relative; overflow: hidden; touch-action: none; background: #000; user-select: none; -webkit-user-select: none; }
.pv__frame { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pv__img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; will-change: transform; -webkit-user-drag: none; }
.pv--zoomed .pv__stage { cursor: grab; }
.pv__nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: var(--radius-md);
  background: rgba(0,0,0,.35); color: #fff; font-size: 34px; line-height: 1; cursor: pointer; opacity: .75;
}
.pv__nav:disabled { opacity: .15; cursor: default; }
.pv__nav--prev { left: 6px; }
.pv__nav--next { right: 6px; }
.pv__nav.hidden { display: none; }
@media (hover: none) { .pv__nav { width: 36px; height: 52px; font-size: 26px; opacity: .45; } }
.pv__big, .pv__projexit { display: none; }
.pv__empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px; text-align: center; color: #fff; max-width: 520px; overflow-wrap: anywhere; }
.pv__empty-icon { font-size: 48px; }
.pv__empty-sub { font-size: var(--font-size-sm); opacity: .7; }
.pv__empty .btn { max-width: 100%; white-space: normal; }

.pv__rail { grid-area: rail; display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 6px 8px; border-top: 1px solid var(--color-border); scrollbar-width: thin; }
.pv__rail.hidden { display: none; }
.pv__thumb { position: relative; flex: 0 0 auto; width: 72px; height: 50px; padding: 0; border: 2px solid transparent; border-radius: 6px; background: #222; cursor: pointer; overflow: hidden; }
.pv__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv__thumb[aria-selected="true"] { border-color: var(--color-primary); }
.pv__tn { position: absolute; left: 2px; bottom: 1px; font-size: 11px; color: #fff; text-shadow: 0 0 3px #000; }
.pv__tnote { position: absolute; right: 2px; top: 0; font-size: 11px; }

.pv__panel { grid-area: panel; max-height: 42vh; overflow-y: auto; padding: 10px 12px; border-top: 1px solid var(--color-border); background: var(--color-surface); background-color: var(--cp-bg-2, var(--color-surface)); overscroll-behavior: contain; }
.pv__panel.hidden { display: none; }
.pv-text__zh { font-size: 20px; line-height: 1.9; }
.pv-text__zh p { margin: 0 0 6px; }
.pv-w { cursor: pointer; border-radius: 4px; padding: 0 1px; border-bottom: 1px dotted var(--color-text-muted); }
.pv-w:hover, .pv-w:focus-visible { background: var(--color-primary-light); outline: none; }
.pv-w--tapped { background: var(--gold-light, #fef9ec); color: var(--color-text); }
.pv-text__hint { font-size: var(--font-size-sm); color: var(--color-text-muted); margin: 4px 0 8px; }
.pv-text__all { margin: 0 0 8px; }
.pv-notes { display: flex; flex-direction: column; gap: 6px; }
.pv-notes__lbl { font-weight: 700; font-size: var(--font-size-sm); color: var(--color-text-secondary); }
.pv-notes__ta { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; font: inherit; line-height: 1.5; }
.pv-notes__st { font-size: var(--font-size-xs); color: var(--color-text-muted); }

@media (min-width: 900px) {
  .pv__body { grid-template-columns: 124px minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); grid-template-areas: "rail stage panel"; }
  .pv__rail { flex-direction: column; overflow-x: hidden; overflow-y: auto; border-top: 0; border-right: 1px solid var(--color-border); padding: 8px; }
  .pv__thumb { width: 104px; height: 72px; }
  .pv__panel { width: 340px; max-height: none; border-top: 0; border-left: 1px solid var(--color-border); }
}

.pv--proj { background: #000; padding: 0; }
.pv--proj .pv__bar, .pv--proj .pv__rail, .pv--proj .pv__panel, .pv--proj .pv__nav { display: none !important; }
.pv--proj .pv__body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); grid-template-areas: "stage"; }
.pv--proj .pv__big { display: block; position: absolute; right: 18px; bottom: 12px; color: rgba(255,255,255,.75); font-size: 28px; font-weight: 800; text-shadow: 0 0 6px #000; pointer-events: none; }
.pv--proj .pv__projexit {
  display: block; position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff; font-size: 18px; cursor: pointer; opacity: .35;
}
.pv--proj .pv__projexit:hover, .pv--proj .pv__projexit:focus-visible { opacity: 1; }
