.workspace-host iframe[hidden],
.task-center[hidden] {
  display: none;
}

.task-center:not([hidden]) {
  display: block;
}

.media-tabs { display: flex; gap: 10px; padding: 20px 30px 0; }
.media-tabs button { min-width: 86px; padding: 9px 18px; border: 1px solid #d6e3f5; border-radius: 10px; background: #f5f8fd; color: #44618d; font-weight: 700; }
.media-tabs button[aria-selected="true"] { border-color: #1768df; background: #1768df; color: #fff; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 16px; padding: 22px 30px 30px; }
.media-empty { grid-column: 1 / -1; margin: 40px 0; color: #7892bd; text-align: center; }
.media-card { min-width: 0; overflow: hidden; border: 1px solid #dde8f7; border-radius: 14px; background: #fafdff; }
.media-card-preview { position: relative; aspect-ratio: 1; overflow: hidden; background: #edf4ff; }
.media-card-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-card-preview[data-state] img { visibility: hidden; }
.media-card-preview[data-state="ready"] img { visibility: visible; }
.media-thumbnail-status { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 11px; pointer-events: none; }
.media-card-preview[data-state="loading"] .media-thumbnail-status::before { content: ""; width: 20px; height: 20px; box-sizing: border-box; border: 2px solid #cbd9ef; border-top-color: #0b6fff; border-radius: 50%; animation: media-thumbnail-spin .8s linear infinite; }
.media-card-preview[data-state="ready"] .media-thumbnail-status { display: none; }
.media-card-preview[data-state]:not([data-state="ready"]) .media-play { display: none; }
@keyframes media-thumbnail-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .media-card-preview[data-state="loading"] .media-thumbnail-status::before { animation: none; } }
.media-pending { display: grid; height: 100%; place-items: center; color: #7892bd; font-size: 12px; }
.media-play { position: absolute; inset: 50% auto auto 50%; display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: rgba(16, 51, 103, .78); color: #fff; transform: translate(-50%, -50%); }
.media-card strong { display: block; overflow: hidden; padding: 11px 12px 4px; color: #173b75; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.media-card a { display: inline-block; margin: 0 12px 12px; color: #1768df; font-size: 12px; font-weight: 700; text-decoration: none; }
.media-card a:hover { text-decoration: underline; }
.works-header-actions { display: flex; gap: 10px; }
.works-manage-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 30px 0; }
.works-manage-bar[hidden] { display: none; }
.works-manage-bar span { margin-right: auto; color: #44618d; font-size: 13px; font-weight: 700; }
.works-manage-bar button, .media-card-actions button { padding: 8px 12px; border: 1px solid #cfe0f7; border-radius: 9px; background: #fff; color: #245aab; font-size: 12px; font-weight: 700; cursor: pointer; }
.works-manage-bar button.is-danger, .media-card-actions button.is-danger { border-color: #f1cfd5; color: #b43b4d; }
.works-manage-bar button:disabled { opacity: .5; cursor: not-allowed; }
.media-card-actions button:disabled, .work-select:disabled { opacity: .45; cursor: not-allowed; }
.media-card.is-selected { border-color: #1768df; box-shadow: 0 0 0 2px #1768df33; }
.work-select { position: absolute; z-index: 2; top: 10px; left: 10px; width: 20px; height: 20px; margin: 0; accent-color: #1768df; cursor: pointer; }
.media-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 12px 12px; }
.media-card-actions a { margin: 0; }

.task-panel {
  height: calc(100vh - 84px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(35, 89, 165, .08);
}

.task-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 30px;
  border-bottom: 1px solid #e8eff9;
}

.task-panel > header small { color: #5685d3; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.task-panel > header h1 { margin: 5px 0; color: #0b2f70; font-size: 20px; }
.task-panel > header p { margin: 0; color: #7892bd; font-size: 12px; }
.task-panel > header button,
.task-actions button {
  padding: 10px 16px;
  border: 1px solid #cfe0f7;
  border-radius: 10px;
  background: #fff;
  color: #245aab;
  font-weight: 750;
}

.task-list { display: grid; gap: 14px; padding: 22px; }
.task-list > .task-empty { min-height: calc(100vh - 240px); border: 0; box-shadow: none; }
.task-list > .task-empty h2 { margin: 8px 0; color: #0b2f70; }
.task-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid #dde8f7;
  border-radius: 16px;
  background: #fafdff;
}
.task-card:has(.task-select) { grid-template-columns: 22px 82px minmax(0, 1fr) auto; }
.task-card.is-selected { border-color: #1768df; box-shadow: 0 0 0 2px #1768df33; }
.task-select { width: 19px; height: 19px; margin: 0; accent-color: #1768df; cursor: pointer; }
.task-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.task-actions button { white-space: nowrap; cursor: pointer; }
.task-actions button.is-danger { border-color: #f1cfd5; color: #b43b4d; }
.task-actions button:disabled { opacity: .5; cursor: not-allowed; }

.task-preview {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #edf4ff;
  color: #1768df;
  font-size: 28px;
}

.task-preview img { width: 100%; height: 100%; object-fit: cover; }
.task-preview { position: relative; }
.task-preview .task-video-badge { position: absolute; right: 5px; bottom: 5px; display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: rgba(12,42,90,.78); color: #fff; font-size: 11px; }
.task-feedback-dialog .dialog-content { display: grid; gap: 10px; }
.task-feedback-dialog .dialog-content p { margin: 0; }
.task-feedback-dialog label { color: #34527f; font-size: 13px; font-weight: 700; }
.task-feedback-dialog textarea { width: 100%; min-height: 115px; padding: 11px 12px; border: 1px solid #cfe0f7; border-radius: 10px; color: #173b75; font: inherit; resize: vertical; }
.task-feedback-dialog .task-feedback-hint { font-size: 12px; }
.task-feedback-dialog button:disabled { opacity: .55; cursor: not-allowed; }
.task-copy { min-width: 0; }
.task-heading { display: flex; align-items: center; gap: 12px; }
.task-heading strong { overflow: hidden; color: #173b75; text-overflow: ellipsis; white-space: nowrap; }
.task-heading span { flex: none; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.task-heading .is-success { background: #e8f8f1; color: #16805e; }
.task-heading .is-error { background: #fff0f2; color: #c53f55; }
.task-heading .is-warning { background: #fff6dc; color: #a66d00; }
.task-heading .is-running { background: #eaf3ff; color: #1768df; }
.task-copy p,
.task-copy small { display: block; margin: 7px 0 0; color: #728ab0; }
.task-copy small { color: #b04a5c; }

@media (max-width: 700px) {
  .task-card { grid-template-columns: 64px minmax(0, 1fr); }
  .task-card:has(.task-select) { grid-template-columns: 22px 64px minmax(0, 1fr); }
  .task-preview { width: 64px; height: 64px; }
  .task-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .task-panel > header { align-items: flex-start; padding: 20px; }
  .task-panel > header .works-header-actions { flex-wrap: wrap; justify-content: flex-end; }
  .task-list { padding: 14px; }
  .media-tabs { padding: 16px 18px 0; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; padding: 18px; }
  .works-manage-bar { padding: 14px 18px 0; }
}
