:root {
  color: #17252b;
  background: #f4f6f7;
  font-family: Inter, "Noto Sans SC", system-ui, sans-serif;
  --teal: #087f70;
  --teal-dark: #06675c;
  --line: #d9e1e2;
  --muted: #718087;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at 20% 0%, #e2f1ee 0, transparent 38%), #f3f6f6;
}

.login-box {
  width: min(390px, 100%);
  padding: 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(26, 53, 54, .09);
}

h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 18px; }
h2 { font-size: 22px; }
.login-box > p { margin: 7px 0 18px; color: var(--muted); font-size: 13px; }

label { display: grid; gap: 6px; color: #53636a; font-size: 12px; font-weight: 700; }
input {
  min-height: 40px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #c7d3d4;
  border-radius: 5px;
  background: #fbfcfc;
  outline: none;
}
input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 127, 112, .12); }

button, .link-button {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-weight: 750;
}
.primary { color: #fff; background: var(--teal); }
.primary:hover { background: var(--teal-dark); }
.login-box .primary { width: 100%; margin-top: 18px; }
.secondary { color: #395058; background: #fff; border-color: #c5d1d2; }
.secondary:hover { background: #f1f6f5; }

.error { color: #b42318; font-size: 13px; }
.banner, .notice { margin: 0 0 18px; padding: 10px 12px; border-radius: 5px; font-size: 13px; }
.banner { background: #fff1f0; }
.notice { color: var(--teal-dark); background: #e4f2ec; }

.manage-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 64px;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 10px max(24px, calc((100vw - 1240px) / 2));
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand-block { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  background: #18383a;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}
.manage-header p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.back-link { color: var(--teal); font-size: 13px; font-weight: 750; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

main { width: min(1240px, 100%); margin: auto; padding: 28px 24px 44px; }
.library-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 18px; }
.image-count { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.manage-upload-panel { margin-bottom: 22px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.upload-panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 14px; }
.upload-panel-heading h3 { margin: 0; font-size: 17px; }
.upload-panel-hint { color: var(--muted); font-size: 12px; }
.manage-upload-form { display: grid; gap: 14px; }
.upload-mode { display: flex; gap: 18px; margin: 0; padding: 0; border: 0; }
.upload-mode legend { margin-bottom: 7px; color: #53636a; font-size: 12px; font-weight: 700; }
.upload-mode label { display: inline-flex; grid-template-columns: auto 1fr; align-items: center; gap: 6px; color: #395058; font-size: 13px; font-weight: 600; }
.upload-mode input { width: 16px; min-height: 16px; }
.upload-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.upload-file-field small { color: var(--muted); font-size: 11px; font-weight: 500; }
.upload-submit { justify-self: start; }
.manage-upload-progress { display: grid; gap: 7px; max-width: 560px; color: var(--muted); font-size: 12px; }
.manage-upload-progress > div { display: flex; justify-content: space-between; gap: 12px; }
.manage-upload-progress small { color: var(--muted); font-size: 11px; }
.manage-upload-progress strong { color: var(--teal); }
.manage-upload-progress progress { width: 100%; height: 9px; accent-color: var(--teal); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
}
.breadcrumb a { color: var(--teal); font-weight: 700; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.task-list { display: grid; gap: 12px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.project-card { position: relative; display: grid; min-height: 190px; align-content: end; gap: 8px; padding: 22px; overflow: hidden; color: inherit; background: linear-gradient(145deg, #e6f2ef, #f7fbfa); border: 1px solid #cbdedb; border-radius: 12px; text-decoration: none; box-shadow: 0 5px 18px rgba(26, 53, 54, .06); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.project-card:hover { border-color: var(--teal); box-shadow: 0 12px 28px rgba(26, 53, 54, .13); transform: translateY(-3px); }
.project-card-index { position: absolute; top: 14px; right: 18px; color: #8eaaa5; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.project-card-icon { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 22px; color: var(--teal); background: rgba(255, 255, 255, .7); border: 1px solid #c8ded9; border-radius: 10px; font-size: 24px; }
.project-card-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.project-card strong { overflow: hidden; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
.project-card-summary, .project-card-images { color: var(--muted); font-size: 12px; }
.project-card-tasks { overflow: hidden; color: #58736f; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.project-card-images { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.project-card-images b { display: inline-flex; align-items: center; gap: 5px; color: var(--teal); font-size: 12px; }
.project-card-images b svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scene-list { display: grid; gap: 20px; }
.scene-panel { padding: 16px; background: #eef5f3; border: 1px solid var(--line); border-radius: 9px; }
.scene-panel-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.scene-panel-heading h3 { margin: 0; font-size: 17px; }
.scene-panel-heading span { color: var(--muted); font-size: 12px; }
.project-group { padding: 18px; background: #eef5f3; border: 1px solid var(--line); border-radius: 8px; }
.project-title { margin: 0 0 16px; font-size: 19px; }
.scene-group { display: grid; gap: 10px; }
.scene-title { margin: 0; color: #395058; font-size: 15px; }
.scene-title span { color: var(--muted); font-size: 11px; font-weight: 500; }
.task-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  color: inherit;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 4px 16px rgba(26, 53, 54, .045);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.task-card-link { display: flex; flex: 1; justify-content: space-between; align-items: center; gap: 16px; min-width: 0; color: inherit; text-decoration: none; }
.danger-button { color: #b42318; background: #fff; border: 1px solid #efc4c0; white-space: nowrap; }
.danger-button:hover { background: #fff1f0; }
.task-card:hover {
  border-color: #bbcaca;
  box-shadow: 0 8px 24px rgba(26, 53, 54, .08);
  transform: translateY(-1px);
}
.task-card-main { display: grid; gap: 4px; min-width: 0; }
.task-card-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}
.task-card-main span { color: var(--muted); font-size: 12px; }
.task-card-meta {
  display: grid;
  gap: 6px;
  justify-items: end;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.task-card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}
.task-card-arrow svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.task-toolbar {
  margin-bottom: 18px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.task-rename-form { align-items: end; }

.batch-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.batch-select-all {
  display: flex;
  align-items: center;
  gap: 16px;
}
.select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #17252b;
  user-select: none;
}
.select-all-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
  cursor: pointer;
}
.selected-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.batch-download-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}
.batch-download-target {
  display: grid;
  gap: 4px;
  color: #53636a;
  font-size: 11px;
  font-weight: 700;
}
.batch-download-target select {
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid #c7d3d4;
  border-radius: 5px;
  background: #fbfcfc;
  color: #17252b;
}
#batch-download-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  background: #94a3a8;
}

.records { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.record {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 4px 16px rgba(26, 53, 54, .045);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.record-select {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  display: block;
  cursor: pointer;
}
.record-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.checkbox-indicator {
  display: block;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 5px;
  background: rgba(23, 37, 43, .45);
  backdrop-filter: blur(4px);
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.record-select:hover .checkbox-indicator {
  background: rgba(23, 37, 43, .7);
  transform: scale(1.05);
}
.record-checkbox:checked + .checkbox-indicator {
  background: var(--teal);
  border-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
}
.record:hover { border-color: #bbcaca; box-shadow: 0 8px 24px rgba(26, 53, 54, .08); transform: translateY(-2px); }
.record-preview { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #edf1f2; }
.record-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.record:hover .record-preview img { transform: scale(1.02); }
.record-body { padding: 12px; }
.record-info { display: grid; gap: 4px; min-width: 0; margin-bottom: 10px; }
.record-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.record-info span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.record-actions { display: flex; align-items: center; gap: 8px; }
.record-actions > .link-button { flex: 1; }
.record-delete-form { display: flex; margin: 0; }
.record-delete-form .danger-button { min-width: 66px; }

.empty {
  display: grid;
  gap: 8px;
  place-items: center;
  padding: 72px 20px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed #bdcccd;
  border-radius: 7px;
}
.empty strong { color: #53636a; }
.empty .link-button { margin-top: 8px; }

@media (max-width: 640px) {
  .manage-header { align-items: stretch; flex-direction: column; gap: 10px; padding: 12px 16px; }
  .header-actions { justify-content: space-between; }
  main { padding: 20px 16px 32px; }
  .records { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .library-heading { align-items: center; }
  .upload-panel-heading { align-items: start; flex-direction: column; gap: 5px; }
  .upload-fields { grid-template-columns: 1fr; }
  .task-card { align-items: stretch; flex-direction: column; }
  .task-card-meta { justify-items: start; }
}

.rename-form { display: flex; min-width: 0; flex-wrap: wrap; align-items: end; gap: 8px; }
.rename-form label { min-width: 220px; flex: 1; }
.rename-form input { min-width: 0; min-height: 38px; }

@media (max-width: 400px) {
  .records { grid-template-columns: 1fr; }
  .rename-form { align-items: stretch; flex-direction: column; }
  .rename-form label { width: 100%; }
}
.nav-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-drawer { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 240px; padding: 18px 14px; background: #102c2b; box-shadow: 3px 0 16px rgba(0,0,0,.12); }.drawer-heading { padding: 8px 8px 24px; color: #fff; font-size: 15px; }.drawer-nav { display: grid; gap: 6px; }.drawer-nav a { display: flex; align-items: center; gap: 10px; padding: 12px; color: #d5e5e2; border-radius: 6px; font-size: 13px; font-weight: 700; text-decoration: none; }.drawer-nav a:hover { background: #1b4d47; }.drawer-nav svg { width: 18px; height: 18px; flex: none; fill: none; stroke: #8fe0c7; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
body { padding-left: 240px; }
/* Persistent navigation drawer: keep it visible across pages. */
.app-drawer { transform: none !important; }
/* Neutral admin navigation */
.app-drawer { background: #f7f8fa; border-right: 1px solid #e2e6ea; box-shadow: none; }.drawer-heading { color: #1f2933; }.drawer-nav a { color: #46515b; }.drawer-nav a:hover { background: #e9edf0; }.drawer-nav svg { stroke: #6b7780; }

.drawer-nav a.active { color: #1f2933; background: #e3e8ec; box-shadow: inset 3px 0 #6b7780; }.drawer-nav a.active svg { stroke: #34414b; }
.drawer-nav .nav-rule { display: block; width: auto; height: 1px; margin: 9px 12px; background: #e2e0df; }

/* Account administration */
.signed-account { color: var(--muted); font-size: 12px; }
.accounts-main { width: min(1320px, 100%); }
.account-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.account-metrics article { display: grid; gap: 6px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.account-metrics span { color: var(--muted); font-size: 11px; font-weight: 750; }
.account-metrics strong { font-size: 26px; line-height: 1; }
.account-metrics small { color: #98a2a6; font-size: 10px; }
.account-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.account-create-card, .account-list-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 5px 18px rgba(26, 53, 54, .045); }
.account-create-card { padding: 22px; }
.account-section-heading { display: flex; gap: 12px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid #edf0f0; }
.account-section-icon { display: grid; width: 42px; height: 42px; flex: none; place-items: center; color: var(--teal); background: #e9f5f2; border-radius: 10px; }
.account-section-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.account-section-heading h3, .account-list-card h3, .password-dialog h3 { margin: 0; font-size: 16px; }
.account-section-heading p, .account-list-card header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.account-create-form { display: grid; gap: 15px; padding-top: 18px; }
.account-create-form label small, .password-dialog label small { color: #929da1; font-size: 10px; font-weight: 500; }
.account-permission-note { display: grid; gap: 4px; padding: 12px; color: #4d6664; background: #f0f7f5; border: 1px solid #d7e9e5; border-radius: 7px; font-size: 10px; line-height: 1.5; }
.account-permission-note strong { color: var(--teal-dark); }
.account-create-form > .primary { width: 100%; }
.account-list-card > header { display: flex; min-height: 74px; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid #edf0f0; }
.account-list-card > header > span { padding: 5px 9px; color: var(--teal); background: #e9f5f2; border-radius: 999px; font-size: 10px; font-weight: 800; }
.account-table { min-width: 760px; }
.account-list-card { overflow-x: auto; }
.account-row { display: grid; grid-template-columns: minmax(170px, 1.4fr) 90px 130px 95px 150px; gap: 14px; min-height: 72px; align-items: center; padding: 10px 18px; border-bottom: 1px solid #edf0f0; }
.account-row:last-child { border-bottom: 0; }
.account-row:not(.account-head):hover { background: #fafcfc; }
.account-head { min-height: 38px; color: #929da1; background: #f8fafa; font-size: 9px; font-weight: 750; letter-spacing: .04em; }
.account-identity { display: flex; min-width: 0; align-items: center; gap: 10px; }
.account-identity > b { display: grid; width: 34px; height: 34px; flex: none; place-items: center; color: #fff; background: #55736f; border-radius: 50%; font-size: 12px; }
.account-identity > span { display: grid; min-width: 0; gap: 3px; }
.account-identity strong, .account-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-identity strong { font-size: 12px; }
.account-identity small, .account-time { color: var(--muted); font-size: 10px; }
.account-status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-style: normal; font-weight: 750; }
.account-status::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.account-status.enabled { color: #087f70; background: #e7f5f1; }
.account-status.disabled { color: #7d8588; background: #eef0f1; }
.account-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.account-actions form { margin: 0; }
.account-text-button { min-height: 30px; padding: 4px 7px; color: var(--teal); background: transparent; border: 0; font-size: 10px; }
.account-text-button:hover { background: #edf6f4; }
.account-text-button.danger-text { color: #b42318; }
.account-text-button.danger-text:hover { background: #fff1f0; }
.account-empty { display: grid; min-height: 280px; place-content: center; gap: 7px; color: var(--muted); text-align: center; font-size: 12px; }
.account-empty strong { color: #526267; font-size: 14px; }
.password-dialog { width: min(420px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 12px; box-shadow: 0 24px 70px rgba(18, 33, 36, .25); }
.password-dialog::backdrop { background: rgba(18, 33, 36, .48); backdrop-filter: blur(2px); }
.password-dialog > form { position: relative; display: grid; gap: 15px; padding: 25px; }
.password-dialog p { margin: -6px 0 2px; color: var(--muted); font-size: 12px; }
.password-dialog p strong { color: #34484e; }
.dialog-close { position: absolute; top: 12px; right: 12px; min-width: 32px; min-height: 32px; padding: 0; color: #78868a; background: #f3f5f5; border-radius: 50%; font-size: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 5px; }

@media (max-width: 980px) {
  .account-layout { grid-template-columns: 1fr; }
  .account-create-card { max-width: none; }
}
@media (max-width: 640px) {
  .account-metrics { grid-template-columns: 1fr; }
  .signed-account { display: none; }
}

.upload-tab-count { display: inline-grid; min-width: 18px; height: 18px; margin-left: 6px; place-items: center; color: #8b8988; background: #e3e1e0; border-radius: 999px; font-size: 9px; }
.upload-existing-empty { display: grid; min-height: 272px; place-items: center; align-content: center; gap: 9px; padding: 28px 20px; text-align: center; background: #fafafa; border: 1px dashed #ddd9d7; border-radius: 12px; }
.upload-existing-empty-icon { display: grid; width: 42px; height: 42px; place-items: center; color: #6973c7; background: #eff0fb; border-radius: 11px; }
.upload-existing-empty-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.upload-existing-empty strong { color: #4e4744; font-size: 14px; }
.upload-existing-empty p { max-width: 230px; margin: 0; color: #96908d; font-size: 11px; line-height: 1.6; }
.upload-existing-empty button { min-height: 34px; margin-top: 4px; padding: 0 14px; color: #fff; background: #5968cf; border-radius: 8px; font-size: 11px; }
.upload-existing-empty button:hover { background: #4b59bd; }

/* Task gallery */
.task-gallery-page {
  --gallery-accent: #535fbc;
  --gallery-accent-soft: #eeeff9;
  --gallery-text: #473e3b;
  --gallery-muted: #8d8784;
  --gallery-line: #e5e2e0;
  min-height: 100vh;
  padding-left: 232px;
  color: var(--gallery-text);
  background: #f6f6f6;
}
.task-gallery-page .app-drawer { width: 232px; padding: 26px 18px; background: #fff; border-right: 1px solid var(--gallery-line); }
.task-gallery-page .drawer-heading { display: flex; align-items: center; gap: 11px; padding: 0 10px 30px; color: var(--gallery-text); font-size: 18px; }
.task-gallery-page .drawer-heading::before { content: "CV"; display: grid; width: 38px; height: 38px; place-items: center; color: #fff; background: var(--gallery-accent); border-radius: 11px; box-shadow: 0 6px 16px rgba(83,95,188,.2); font-size: 14px; }
.task-gallery-page .drawer-heading strong::after { content: "DATA COLLECTION"; display: block; margin-top: 2px; color: #9b9693; font-size: 9px; letter-spacing: .11em; }
.task-gallery-page .drawer-nav { gap: 5px; }
.task-gallery-page .drawer-nav::before { content: "工作空间"; padding: 0 12px 8px; color: #b6b1af; font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.task-gallery-page .drawer-nav a { min-height: 44px; padding: 0 12px; color: #6f6966; border-radius: 10px; font-size: 14px; }
.task-gallery-page .drawer-nav a:hover { background: #f5f4f4; }
.task-gallery-page .drawer-nav a.active { color: var(--gallery-accent); background: var(--gallery-accent-soft); box-shadow: none; }
.task-gallery-page .drawer-nav a.active svg { stroke: var(--gallery-accent); }
.task-gallery-topbar { display: flex; height: 72px; align-items: center; justify-content: space-between; gap: 18px; padding: 0 32px; background: #fff; border-bottom: 1px solid var(--gallery-line); }
.task-gallery-topbar nav { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--gallery-muted); font-size: 12px; }
.task-gallery-topbar nav a { color: inherit; text-decoration: none; }
.task-gallery-topbar nav strong { overflow: hidden; color: var(--gallery-text); text-overflow: ellipsis; white-space: nowrap; }
.task-gallery-top-actions { display: flex; align-items: center; gap: 9px; }
.task-gallery-top-actions form { margin: 0; }
.task-upload-link, .task-logout { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 0 15px; border-radius: 9px; font-size: 12px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.task-upload-link { color: #fff; background: var(--gallery-accent); box-shadow: 0 6px 16px rgba(83,95,188,.18); }
.task-upload-link svg { width: 15px; height: 15px; margin-right: 7px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.task-logout { color: #766f6c; background: #fff; border: 1px solid #dedad8; }
.task-gallery-main { width: 100%; max-width: none; margin: 0; padding: 22px 30px 26px; }
.task-title-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.task-breadcrumb { display: flex; gap: 8px; margin-bottom: 9px; color: var(--gallery-muted); font-size: 11px; }
.task-breadcrumb a { color: var(--gallery-accent); text-decoration: none; }
.task-title-row h1 { max-width: 720px; overflow: hidden; color: var(--gallery-text); font-size: 26px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.task-title-row p { margin: 7px 0 0; color: var(--gallery-muted); font-size: 11px; }
.task-summary { display: flex; gap: 26px; margin: 0 0 2px; }
.task-summary div { display: flex; flex-direction: column-reverse; gap: 4px; }
.task-summary dt { color: var(--gallery-muted); font-size: 10px; }
.task-summary dd { margin: 0; color: var(--gallery-text); font-size: 14px; font-weight: 750; white-space: nowrap; }
.task-workspace { display: grid; min-height: calc(100vh - 174px); grid-template-columns: 260px minmax(0, 1fr); gap: 14px; margin-top: 18px; }
.project-tree, .task-gallery { overflow: hidden; background: #fff; border: 1px solid var(--gallery-line); border-radius: 14px; }
.project-tree { max-height: calc(100vh - 156px); padding: 18px 14px; overflow-y: auto; }
.project-tree-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 14px; border-bottom: 1px solid #eceae9; font-size: 13px; }
.project-tree-heading span { color: #9a9491; font-size: 10px; }
.project-tree-root { display: flex; align-items: center; gap: 8px; height: 42px; padding: 8px 6px 0; color: #4d4845; border-radius: 7px; font-size: 12px; text-decoration: none; }
.project-tree-root:hover, .project-tree-scene-heading:hover { color: var(--gallery-accent); background: #f6f5ff; }
.project-tree-root small { margin-left: auto; color: #aaa4a1; font-size: 9px; font-weight: 500; }
.tree-folder { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--gallery-accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.project-tree-project + .project-tree-project { margin-top: 8px; padding-top: 8px; border-top: 1px solid #f0eeed; }
.project-tree-project:not(.current) .project-tree-root { color: #756f6b; }
.project-tree-scenes { margin-left: 15px; padding-left: 12px; border-left: 1px solid #ddd9d7; }
.project-tree-scene-heading { display: flex; height: 32px; align-items: center; justify-content: space-between; margin: 2px 0; padding: 0 8px; color: #6f6966; border-radius: 7px; font-size: 11px; text-decoration: none; }
.project-tree-scene-heading b, .project-tree-task b { color: #aaa4a1; font-size: 9px; font-weight: 500; }
.project-tree-task { display: flex; height: 34px; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0; padding: 0 8px; color: #776f6c; border-radius: 7px; font-size: 10px; text-decoration: none; }
.project-tree-task span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-tree-task.active { color: var(--gallery-accent); background: var(--gallery-accent-soft); font-weight: 750; }
.project-tree-task.active b { color: var(--gallery-accent); }
.project-tree-task-branch.active { margin: 2px 0 7px; border-radius: 8px; }
.project-tree-task-branch .project-tree-task { margin: 0; }
.project-tree-task.active.selected { box-shadow: inset 3px 0 0 var(--gallery-accent); }
.project-task-directory-tree { margin: 4px 0 8px 10px; padding-left: 8px; border-left: 1px solid #d9dcec; }
.project-task-folder { display: block; }
.project-task-folder > summary { display: grid; min-height: 30px; grid-template-columns: 13px 18px minmax(0, 1fr) auto; align-items: center; gap: 4px; padding: 0 7px 0 calc(2px + var(--tree-depth) * 13px); color: #6f6966; border-radius: 6px; cursor: pointer; list-style: none; }
.project-task-folder > summary::-webkit-details-marker { display: none; }
.project-task-folder > summary:hover, .project-task-folder.selected > summary { color: var(--gallery-accent); background: #f2f3fd; }
.project-task-folder-chevron { display: grid; place-items: center; transition: transform .15s ease; }
.project-task-folder-chevron svg, .project-task-folder-icon svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.project-task-folder[open] > summary .project-task-folder-chevron { transform: rotate(90deg); }
.project-task-folder-icon { display: grid; place-items: center; color: var(--gallery-accent); }
.project-task-folder > summary a { overflow: hidden; color: inherit; font-size: 10px; font-weight: 650; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.project-task-folder > summary small { color: #aaa4a1; font-size: 8px; }
.project-task-folder-children { padding: 2px 0 4px; }
.project-task-file { display: grid; min-height: 27px; grid-template-columns: 25px minmax(0, 1fr); align-items: center; gap: 5px; padding: 0 7px 0 calc(20px + var(--tree-depth) * 13px); color: #79726f; border-radius: 5px; text-decoration: none; }
.project-task-file:hover { color: var(--gallery-accent); background: #f5f5fb; }
.project-task-file > span { display: grid; width: 23px; height: 18px; place-items: center; color: #6572c7; background: #eef0fc; border-radius: 4px; font-size: 6px; font-weight: 800; }
.project-task-file > strong { overflow: hidden; font-size: 8px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.project-tree-foot { margin: 14px 0 0; padding: 13px 4px 0; color: #9b9592; border-top: 1px solid #eceae9; font-size: 10px; line-height: 1.6; }
.task-gallery { display: flex; min-width: 0; flex-direction: column; }
.task-file-browser { padding: 14px 16px 12px; border-bottom: 1px solid #e9e7e6; background: #fcfcfb; }
.task-file-browser-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.task-file-browser-head > div { display: flex; align-items: baseline; gap: 8px; }
.task-file-browser-head strong { color: var(--gallery-text); font-size: 14px; }
.task-file-browser-head span, .task-file-browser-head p { margin: 0; color: var(--gallery-muted); font-size: 10px; }
.task-file-tree { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 8px; }
.task-file-tree-row { display: grid; min-height: 50px; grid-template-columns: 38px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px; padding: 7px 11px; color: var(--gallery-text); background: #fff; border: 1px solid #e1dfdd; border-radius: 9px; text-decoration: none; }
.task-file-tree-row:hover { border-color: #bcc2ea; box-shadow: 0 4px 14px rgba(71,62,59,.06); }
.task-file-tree-row .task-file-icon { grid-row: 1 / span 2; }
.task-file-tree-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.task-file-tree-row > span:not(.task-file-icon) { color: #898381; font-size: 10px; }
.task-file-tree-row small { color: #aaa4a1; font-size: 9px; }
.task-file-icon { display: grid; width: 34px; height: 34px; place-items: center; flex: none; color: var(--gallery-accent); background: #f0f1fc; border-radius: 8px; font-size: 9px; font-weight: 800; letter-spacing: .03em; }
.task-file-icon.folder svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.file-row .task-file-icon { color: #287866; background: #eaf5f1; }
.asset-directory-tree { display: block; max-height: 330px; overflow: auto; padding: 6px; background: #fff; border: 1px solid #e1dfdd; border-radius: 10px; scrollbar-gutter: stable; }
.asset-tree-folder { display: block; }
.asset-tree-folder-row, .asset-tree-file-row { display: grid; min-height: 38px; align-items: center; padding-left: calc(8px + var(--tree-depth) * 20px); color: var(--gallery-text); border-radius: 7px; }
.asset-tree-folder-row { grid-template-columns: 16px 28px minmax(0, 1fr) auto; gap: 7px; padding-right: 10px; cursor: pointer; list-style: none; }
.asset-tree-folder-row::-webkit-details-marker { display: none; }
.asset-tree-folder-row:hover, .asset-tree-file-row:hover { background: #f4f5fb; }
.asset-tree-folder-row .task-file-icon { width: 28px; height: 28px; background: transparent; }
.asset-tree-folder-row .task-file-icon svg { width: 17px; height: 17px; }
.asset-tree-folder-row strong, .asset-tree-file-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.asset-tree-folder-row small, .asset-tree-file-row small { color: #99938f; font-size: 9px; white-space: nowrap; }
.asset-tree-chevron { display: grid; width: 16px; height: 16px; place-items: center; color: #8e8885; transition: transform .15s ease; }
.asset-tree-chevron svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.asset-tree-folder[open] > .asset-tree-folder-row .asset-tree-chevron { transform: rotate(90deg); }
.asset-tree-file-row { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 7px; padding-right: 10px; text-decoration: none; }
.asset-tree-file-row .task-file-icon { width: 26px; height: 26px; color: #287866; background: #eaf5f1; border-radius: 6px; font-size: 8px; }
.task-gallery-toolbar { padding: 14px 16px 10px; border-bottom: 1px solid #e9e7e6; }
.task-gallery-toolbar-top, .task-gallery-toolbar-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.task-gallery-toolbar-bottom { flex-wrap: wrap; }
.task-gallery-toolbar-top { margin-bottom: 12px; }
.task-gallery-toolbar-top strong { font-size: 14px; }
.task-gallery-toolbar-top > div:first-child > span { margin-left: 8px; color: #9a9491; font-size: 10px; }
.clear-directory-filter { margin-left: 9px; color: var(--gallery-accent); font-size: 9px; font-weight: 700; text-decoration: none; }
.gallery-view-switch { display: flex; align-items: center; gap: 3px; padding: 3px; background: #f4f3f2; border: 1px solid #e2dfde; border-radius: 10px; }
.gallery-view-switch > span { padding: 0 7px 0 8px; color: #817b78; font-size: 10px; white-space: nowrap; }
.gallery-view-switch button { display: inline-flex; min-height: 30px; align-items: center; gap: 5px; padding: 0 11px; color: #736e6b; background: transparent; border: 0; border-radius: 7px; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.gallery-view-switch button > svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gallery-view-switch button:hover { color: var(--gallery-accent); background: rgba(255,255,255,.72); }
.gallery-view-switch button.active { color: #fff; background: var(--gallery-accent); box-shadow: 0 2px 7px rgba(83,95,188,.24); }
.gallery-view-switch button:focus-visible { outline: 2px solid var(--gallery-accent); outline-offset: 2px; }
.task-selection-tools, .batch-download-actions { display: flex; align-items: center; gap: 9px; }
.task-selection-tools { flex: 1 1 390px; }
.batch-download-actions { flex: 1 1 470px; justify-content: flex-end; }
.gallery-select-all { display: inline-flex; grid-template-columns: none; align-items: center; gap: 6px; color: var(--gallery-text); font-size: 11px; cursor: pointer; }
.gallery-select-all input { width: 16px; min-height: 16px; padding: 0; accent-color: var(--gallery-accent); }
.selected-count { color: #6f6966; font-size: 11px; white-space: nowrap; }
.clear-selection { min-height: 30px; padding: 4px 8px; color: var(--gallery-accent); background: transparent; border: 0; font-size: 10px; }
.clear-selection[hidden] { display: none; }
.task-search { display: flex; width: 216px; height: 34px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #ddd9d7; border-radius: 8px; }
.task-search svg { width: 14px; height: 14px; flex: none; fill: none; stroke: #8d8784; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.task-search input { width: 100%; min-height: 0; padding: 0; background: transparent; border: 0; box-shadow: none; font-size: 10px; }
.batch-download-target { display: flex; grid-template-columns: none; height: 34px; align-items: center; gap: 6px; padding-left: 10px; color: #8d8784; border: 1px solid #ddd9d7; border-radius: 8px; font-size: 10px; white-space: nowrap; }
.batch-download-target select { height: 32px; padding: 0 8px 0 0; color: #6f6966; background: transparent; border: 0; outline: 0; font-size: 10px; }
.task-gallery-toolbar #batch-download-btn { min-height: 34px; padding: 0 12px; border-radius: 8px; background: var(--gallery-accent); font-size: 10px; }
.task-gallery-toolbar #batch-download-btn { white-space: nowrap; }
.task-gallery-toolbar #sync-yolo-btn { min-width: 96px; white-space: nowrap; }
.task-gallery-toolbar #batch-download-btn:disabled { color: #aaa4a1; background: #f6f6f6; border-color: #ddd9d7; opacity: 1; }
.selection-hint { margin: 9px 0 0; color: #aaa4a1; font-size: 9px; }
.task-records { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-content: start; padding: 14px 16px; }
.task-gallery-page .record { border-color: #e2dfde; border-radius: 10px; box-shadow: none; cursor: pointer; user-select: none; }
.task-gallery-page .record:hover { border-color: #c9c4d9; box-shadow: 0 6px 18px rgba(71,62,59,.08); transform: translateY(-1px); }
.task-gallery-page .record:focus-visible { outline: 2px solid var(--gallery-accent); outline-offset: 2px; }
.task-gallery-page .record.selected { border-color: var(--gallery-accent); box-shadow: 0 0 0 2px rgba(83,95,188,.16); }
.task-gallery-page .record-preview { aspect-ratio: 4 / 3; }
.record-file-preview { display: flex; width: 62px; height: 76px; align-items: stretch; justify-content: center; flex-direction: column; gap: 7px; margin: 18px auto; padding: 14px 11px 10px; color: #2b7767; background: #fff; border: 1px solid #cfd8d5; border-radius: 8px; box-shadow: 0 7px 18px rgba(47,72,68,.09); }
.record-file-preview b { margin-bottom: 3px; color: var(--gallery-accent); font-size: 11px; text-align: center; }
.record-file-preview i { display: block; height: 2px; background: #d9dfdd; border-radius: 9px; }
.record-file-preview i:last-child { width: 70%; }
.data-file-record .record-preview { display: grid; place-items: center; background: #f4f7f6; }
.task-records[data-view="list"] .record-file-preview { width: 24px; height: 29px; gap: 2px; margin: 2px auto; padding: 5px 4px; border-radius: 4px; box-shadow: none; }
.task-records[data-view="list"] .record-file-preview b { margin: 0; font-size: 6px; }
.task-records[data-view="list"] .record-file-preview i { height: 1px; }
.task-gallery-page .record-select { top: 9px; left: 9px; }
.task-gallery-page .checkbox-indicator { width: 19px; height: 19px; border-radius: 5px; }
.task-gallery-page .record-checkbox:checked + .checkbox-indicator { background-color: var(--gallery-accent); }
.task-gallery-page .record-body { display: flex; align-items: end; justify-content: space-between; gap: 8px; padding: 9px 10px 10px; }
.task-gallery-page .record-info { gap: 5px; margin: 0; }
.task-gallery-page .record-info strong { font-size: 10px; }
.task-gallery-page .record-info span { font-size: 9px; }
.task-gallery-page .record-actions { flex: 0 0 auto; gap: 5px; }
.task-gallery-page .record-actions a, .task-gallery-page .record-actions button { min-height: 0; padding: 2px 3px; color: var(--gallery-accent); background: transparent; border: 0; font-size: 9px; text-decoration: none; }
.task-gallery-page .record-actions button { color: #a55a55; opacity: 0; }
.task-gallery-page .record:hover .record-actions button, .task-gallery-page .record:focus-within .record-actions button { opacity: 1; }
.task-records[data-view="list"] { display: block; padding: 8px 16px 16px; }
.task-records[data-view="list"] .record { display: grid; grid-template-columns: 40px minmax(0, 1fr); min-height: 32px; margin-top: 5px; }
.task-records[data-view="list"] .record-preview { grid-column: 1; grid-row: 1; width: 40px; aspect-ratio: 4 / 3; border-right: 1px solid #e8e5e3; }
.task-records[data-view="list"] .record-body { grid-column: 2; grid-row: 1; align-items: center; padding: 5px 10px; }
.task-records[data-view="list"] .record-select { top: 5px; left: 5px; }
.task-records[data-view="list"] .checkbox-indicator { width: 14px; height: 14px; border-width: 1px; border-radius: 4px; }
.task-records[data-view="list"] .record-info strong { font-size: 12px; }
.task-records[data-view="list"] .record-info span { font-size: 10px; }
.task-records[data-view="list"] .record-actions { gap: 12px; }
.task-records[data-view="list"] .record-actions a, .task-records[data-view="list"] .record-actions button { padding: 5px 7px; font-size: 10px; }
.task-records[data-view="list"] .record-actions button { opacity: 1; }
.gallery-empty { display: grid; min-height: 380px; place-content: center; justify-items: center; gap: 8px; color: var(--gallery-muted); font-size: 12px; }
.gallery-empty strong { color: var(--gallery-text); font-size: 14px; }
.gallery-empty a { color: var(--gallery-accent); }
.task-gallery-footer { display: flex; min-height: 46px; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; padding: 0 16px; color: #9a9491; border-top: 1px solid #eceae9; font-size: 10px; }
.gallery-pagination { display: flex; align-items: center; gap: 4px; }
.gallery-pagination a, .gallery-pagination span { display: grid; min-width: 25px; height: 25px; place-items: center; color: #746e6b; border: 1px solid #e1dedd; border-radius: 6px; text-decoration: none; }
.gallery-pagination svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gallery-pagination a.active { color: #fff; background: var(--gallery-accent); border-color: var(--gallery-accent); }
.gallery-pagination span.disabled, .gallery-pagination span.ellipsis { color: #b8b3b0; background: #fafafa; }
.gallery-pagination span.ellipsis { border-color: transparent; background: transparent; }

.file-preview-modal { position: fixed; z-index: 300; inset: 0; display: grid; place-items: center; padding: 30px; }
.file-preview-backdrop { position: absolute; inset: 0; background: rgba(25,31,30,.52); backdrop-filter: blur(3px); }
.file-preview-window { position: relative; display: grid; width: min(1080px, calc(100vw - 60px)); height: min(760px, calc(100vh - 60px)); grid-template-rows: 68px minmax(0, 1fr) 60px; overflow: hidden; background: #fff; border-radius: 16px; box-shadow: 0 30px 90px rgba(19,25,24,.3); }
.file-preview-window > header { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid #e1e5e3; }
.file-preview-window > header > div { display: flex; align-items: center; gap: 12px; }
.file-preview-window > header > div > div { display: grid; gap: 4px; }
.file-preview-window > header strong { font-size: 15px; }
.file-preview-window > header small { color: #8b9591; font-size: 10px; }
.file-preview-window > header > a { display: grid; width: 34px; height: 34px; place-items: center; color: #6f7774; border: 1px solid #d9dddb; border-radius: 8px; }
.file-preview-window > header svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.file-preview-code { display: grid; min-height: 0; grid-template-columns: 54px minmax(0, 1fr); overflow: auto; color: #d7e5df; background: #17201d; }
.file-preview-gutter { position: sticky; left: 0; z-index: 1; display: flex; align-items: flex-end; flex-direction: column; padding: 18px 13px; color: #61706a; background: #131a18; border-right: 1px solid #27312e; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; user-select: none; }
.file-preview-gutter span { height: 1.65em; }
.file-preview-code pre { min-width: max-content; margin: 0; padding: 18px 20px; white-space: pre; tab-size: 2; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.file-preview-window > footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 0 20px; border-top: 1px solid #e1e5e3; }
.file-preview-window > footer a { display: inline-flex; min-height: 36px; align-items: center; padding: 0 16px; color: #565e5b; border: 1px solid #d7dcda; border-radius: 8px; font-size: 11px; font-weight: 700; text-decoration: none; }
.file-preview-window > footer a.primary { color: #fff; background: var(--gallery-accent); border-color: var(--gallery-accent); }

/* Image annotation preview */
.image-annotation-modal { position: fixed; z-index: 310; inset: 0; display: grid; place-items: center; padding: 24px; }
.image-preview-backdrop { position: absolute; inset: 0; background: rgba(22,27,26,.68); backdrop-filter: blur(5px); }
.image-preview-window { position: relative; display: grid; width: min(1280px, calc(100vw - 48px)); height: min(880px, calc(100vh - 48px)); grid-template-rows: 72px minmax(0, 1fr) 78px; overflow: hidden; color: #292f2d; background: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 16px; box-shadow: 0 34px 100px rgba(12,18,16,.38); }
.image-preview-header { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 20px; padding: 0 20px; border-bottom: 1px solid #e1e5e3; }
.image-preview-heading, .image-preview-controls { display: flex; min-width: 0; align-items: center; gap: 12px; }
.image-preview-heading > div { display: grid; min-width: 0; gap: 3px; }
.image-preview-heading strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.image-preview-heading small { color: #87918d; font-size: 10px; }
.image-preview-badge { display: grid; min-width: 54px; height: 32px; place-items: center; padding: 0 9px; color: var(--gallery-accent); background: #f0f1fb; border-radius: 8px; font-size: 10px; font-weight: 800; }
.annotation-visibility { display: flex; grid-template-columns: none; align-items: center; gap: 8px; color: #4f5b57; font-size: 11px; cursor: pointer; user-select: none; }
.annotation-visibility.disabled { color: #a9afac; cursor: not-allowed; }
.annotation-visibility input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.annotation-switch { position: relative; display: block; width: 34px; height: 20px; background: #c9cfcc; border-radius: 999px; transition: background .16s ease; }
.annotation-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(20,28,25,.25); transition: transform .16s ease; }
.annotation-visibility input:checked + .annotation-switch { background: var(--gallery-accent); }
.annotation-visibility input:checked + .annotation-switch::after { transform: translateX(14px); }
.annotation-visibility.disabled .annotation-switch, .annotation-visibility input:disabled + .annotation-switch { background: #d5d9d7; opacity: .72; }
.annotation-visibility input:focus-visible + .annotation-switch { outline: 2px solid var(--gallery-accent); outline-offset: 2px; }
.image-preview-close { display: grid; width: 34px; height: 34px; place-items: center; color: #69726f; border: 1px solid #d9dddb; border-radius: 8px; }
.image-preview-close svg, .image-preview-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.image-preview-body { position: relative; display: grid; min-height: 0; grid-template-columns: 54px minmax(0, 1fr) 54px; align-items: center; background: #151b19; }
.annotation-stage { display: grid; min-width: 0; min-height: 0; height: 100%; place-items: center; overflow: hidden; padding: 24px 8px; }
.annotation-canvas-wrap { position: relative; display: grid; max-width: 100%; max-height: 100%; place-items: stretch; overflow: hidden; background: #0d1210; box-shadow: 0 12px 42px rgba(0,0,0,.28); }
.annotation-canvas-wrap img { display: block; width: 100%; height: 100%; object-fit: fill; }
.annotation-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .16s ease; }
.annotation-canvas-wrap.annotations-hidden canvas { opacity: 0; }
.image-preview-arrow { z-index: 2; display: grid; width: 38px; height: 48px; place-self: center; place-items: center; color: #e5eeea; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 9px; transition: background .16s ease, transform .16s ease; }
.image-preview-arrow:not(.disabled):hover { color: #fff; background: rgba(255,255,255,.16); transform: translateY(-1px); }
.image-preview-arrow.disabled { color: rgba(255,255,255,.2); background: transparent; border-color: rgba(255,255,255,.06); }
.image-preview-footer { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 20px; padding: 0 20px; border-top: 1px solid #e1e5e3; }
.annotation-summary { display: grid; min-width: 0; gap: 5px; }
.annotation-summary-title { color: #646e6a; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.annotation-summary small { color: #a0a8a4; font-size: 9px; }
.annotation-legend { display: flex; max-width: min(720px, 58vw); align-items: center; gap: 7px 14px; overflow: auto; scrollbar-width: thin; }
.annotation-legend span { display: inline-flex; flex: none; align-items: center; gap: 6px; color: #444d4a; font-size: 10px; font-weight: 700; white-space: nowrap; }
.annotation-legend i { width: 9px; height: 9px; background: var(--legend-color); border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.annotation-empty { color: #8b9591; font-size: 11px; }
.image-preview-footer-actions { display: flex; flex: none; align-items: center; gap: 9px; }
.image-preview-footer-actions a { display: inline-flex; min-height: 36px; align-items: center; padding: 0 15px; color: #565e5b; border: 1px solid #d7dcda; border-radius: 8px; font-size: 11px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.image-preview-footer-actions a.primary { color: #fff; background: var(--gallery-accent); border-color: var(--gallery-accent); }

@media (max-width: 1260px) {
  .task-records { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .task-gallery-toolbar-bottom { align-items: flex-start; flex-direction: column; }
  .batch-download-actions { align-self: stretch; justify-content: flex-end; }
}
@media (max-width: 980px) {
  .task-gallery-page { padding-left: 196px; }
  .task-gallery-page .app-drawer { width: 196px; }
  .task-workspace { grid-template-columns: 1fr; }
  .project-tree { display: none; }
  .task-records { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .task-summary { gap: 14px; }
}
@media (max-width: 680px) {
  .task-gallery-page { padding-left: 0; }
  .task-gallery-page .app-drawer { display: none; }
  .task-gallery-topbar { height: auto; align-items: flex-start; padding: 14px 16px; }
  .task-gallery-topbar nav { display: none; }
  .task-gallery-main { padding: 18px 14px; }
  .task-title-row { align-items: flex-start; flex-direction: column; }
  .task-summary { width: 100%; justify-content: space-between; }
  .task-selection-tools { width: 100%; flex-wrap: wrap; }
  .task-search { order: 2; width: 100%; }
  .batch-download-actions { flex-wrap: wrap; justify-content: flex-start; }
  .task-records { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .gallery-view-switch > span { display: none; }
  .gallery-view-switch button { padding: 0 8px; }
  .task-records[data-view="list"] { padding: 6px 12px 12px; }
  .task-records[data-view="list"] .record { grid-template-columns: 40px minmax(0, 1fr); min-height: 32px; }
  .task-records[data-view="list"] .record-preview { width: 40px; }
  .task-records[data-view="list"] .record-body { padding: 5px 8px; }
  .task-gallery-footer { align-items: flex-start; flex-direction: column; padding: 12px; }
  .image-annotation-modal { padding: 0; }
  .image-preview-window { width: 100vw; height: 100dvh; border: 0; border-radius: 0; grid-template-rows: 64px minmax(0, 1fr) auto; }
  .image-preview-header { padding: 0 12px; }
  .image-preview-heading small, .annotation-visibility > span:last-child { display: none; }
  .image-preview-badge { min-width: 46px; }
  .image-preview-body { grid-template-columns: 42px minmax(0, 1fr) 42px; }
  .annotation-stage { padding: 12px 0; }
  .image-preview-arrow { width: 32px; height: 42px; }
  .image-preview-footer { align-items: flex-end; padding: 12px; }
  .annotation-summary small { display: none; }
  .annotation-legend { max-width: 54vw; }
}

/* Upload workbench */
.upload-page {
  --upload-accent: #535fbc;
  --upload-accent-soft: #eeeff9;
  --upload-text: #473e3b;
  --upload-muted: #8d8784;
  --upload-line: #e5e2e0;
  min-height: 100vh;
  padding-left: 232px;
  color: var(--upload-text);
  background: #f6f6f6;
}
.upload-page .app-drawer { width: 232px; padding: 26px 18px; background: #fff; border-right: 1px solid var(--upload-line); }
.upload-page .drawer-heading { display: flex; align-items: center; gap: 11px; padding: 0 10px 30px; color: var(--upload-text); font-size: 18px; }
.upload-page .drawer-heading::before { content: "CV"; display: grid; width: 38px; height: 38px; place-items: center; color: #fff; background: var(--upload-accent); border-radius: 11px; box-shadow: 0 6px 16px rgba(83,95,188,.2); font-size: 14px; }
.upload-page .drawer-heading strong::after { content: "DATA COLLECTION"; display: block; margin-top: 2px; color: #9b9693; font-size: 9px; letter-spacing: .11em; }
.upload-page .drawer-nav { gap: 5px; }
.upload-page .drawer-nav::before { content: "工作空间"; padding: 0 12px 8px; color: #b6b1af; font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.upload-page .drawer-nav a { min-height: 44px; padding: 0 12px; color: #6f6966; border-radius: 10px; font-size: 14px; }
.upload-page .drawer-nav a.active { color: var(--upload-accent); background: var(--upload-accent-soft); box-shadow: none; }
.upload-page-context { position: fixed; inset: 0 0 0 232px; background: #f6f6f6; }
.upload-page-context > header { display: flex; height: 72px; align-items: center; justify-content: space-between; padding: 0 32px; background: #fff; border-bottom: 1px solid var(--upload-line); color: #8d8784; font-size: 12px; }
.upload-page-context > main { width: 100%; max-width: none; padding: 32px; }
.upload-page-context p { margin: 0 0 7px; color: var(--upload-accent); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.upload-page-context h1 { margin: 0; font-size: 28px; }
.upload-context-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.upload-context-cards span { height: 140px; background: #fff; border: 1px solid var(--upload-line); border-radius: 14px; }
.upload-page-scrim { position: fixed; z-index: 35; inset: 0; background: rgba(45,42,40,.36); backdrop-filter: blur(2px); }
.upload-dialog { position: fixed; z-index: 40; top: 50%; left: 50%; display: flex; width: min(1110px, calc(100vw - 80px)); height: min(760px, calc(100vh - 64px)); flex-direction: column; overflow: hidden; background: #fff; border: 1px solid rgba(255,255,255,.8); border-radius: 18px; box-shadow: 0 30px 80px rgba(39,35,33,.25); transform: translate(-50%, -50%); }
.upload-dialog-header { display: flex; min-height: 86px; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 0 26px 0 28px; border-bottom: 1px solid #e8e5e4; }
.upload-dialog-heading { display: flex; align-items: center; gap: 14px; }
.upload-dialog-icon { display: grid; width: 42px; height: 42px; place-items: center; color: var(--upload-accent); background: var(--upload-accent-soft); border-radius: 12px; }
.upload-dialog-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.upload-dialog-heading h1 { margin: 0; color: var(--upload-text); font-size: 20px; letter-spacing: -.01em; }
.upload-dialog-heading p { margin: 5px 0 0; color: var(--upload-muted); font-size: 11px; }
.upload-dialog-close { display: grid; width: 34px; height: 34px; place-items: center; color: var(--upload-muted); background: #fff; border: 1px solid #e1dedd; border-radius: 9px; line-height: 1; text-decoration: none; }
.upload-dialog-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.upload-dialog-close:hover { color: var(--upload-text); background: #f8f7f7; border-color: #d6d2d0; }
#upload-workbench { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.upload-dialog-body { display: grid; min-height: 0; flex: 1; grid-template-columns: 390px minmax(0, 1fr); }
.upload-target-panel { padding: 24px 26px; overflow-y: auto; background: #fbfbfb; border-right: 1px solid #e8e5e4; }
.upload-section-kicker { color: var(--upload-accent); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.upload-target-panel h2, .upload-files-heading h2 { margin: 5px 0 0; color: var(--upload-text); font-size: 16px; }
.upload-mode-tabs { display: grid; height: 42px; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 20px; padding: 4px; background: #efeded; border-radius: 10px; }
.upload-mode-tabs button { min-height: 0; padding: 0 12px; color: #77706d; background: transparent; border: 0; border-radius: 7px; font-size: 12px; }
.upload-mode-tabs button.active { color: var(--upload-accent); background: #fff; box-shadow: 0 2px 8px rgba(71,62,59,.1); }
.upload-mode-tabs button:disabled { cursor: not-allowed; opacity: .45; }
.upload-existing-fields, .upload-new-fields { display: grid; gap: 14px; margin-top: 18px; }
.upload-existing-fields[hidden], .upload-new-fields[hidden] { display: none; }
.upload-existing-fields label, .upload-new-fields label { gap: 7px; color: var(--upload-text); font-size: 11px; }
.upload-select-control { position: relative; display: block; }
.upload-select-control svg { position: absolute; top: 50%; right: 12px; width: 15px; height: 15px; fill: none; stroke: #827c79; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; transform: translateY(-50%); }
.upload-existing-fields select, .upload-new-fields input { width: 100%; height: 42px; padding: 0 12px; color: var(--upload-text); background: #fff; border: 1px solid #dcd8d6; border-radius: 9px; outline: 0; font-size: 12px; }
.upload-existing-fields select { padding-right: 38px; appearance: none; -webkit-appearance: none; }
.upload-existing-fields select:focus, .upload-new-fields input:focus { border-color: var(--upload-accent); box-shadow: 0 0 0 3px rgba(83,95,188,.12); }
.upload-target-path { margin-top: 20px; padding: 15px; background: #f3f3fb; border: 1px solid #dedff0; border-radius: 11px; }
.upload-target-path span { display: block; color: #7b80b0; font-size: 10px; font-weight: 700; }
.upload-target-path strong { display: block; margin-top: 8px; color: var(--upload-accent); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.upload-target-help { margin: 14px 0 0; color: var(--upload-muted); font-size: 10px; line-height: 1.55; }
.upload-target-note { display: grid; gap: 3px; margin-top: 22px; padding-top: 18px; color: var(--upload-muted); border-top: 1px solid #e6e3e2; font-size: 10px; line-height: 1.6; }
.upload-target-note strong { color: #625b58; font-size: 11px; }
.upload-files-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; padding: 24px 26px 18px; }
.upload-files-heading { display: flex; flex: 0 0 auto; align-items: end; justify-content: space-between; gap: 14px; }
.upload-files-heading h2 span { margin-left: 8px; color: var(--upload-muted); font-size: 10px; font-weight: 600; }
.upload-files-heading button { min-height: 28px; padding: 3px 6px; color: var(--upload-muted); background: transparent; border: 0; font-size: 10px; }
.upload-dropzone { display: flex; min-height: 146px; flex: 0 0 auto; align-items: center; justify-content: center; flex-direction: column; margin-top: 16px; padding: 20px; text-align: center; background: #f8f8fd; border: 1.5px dashed #bfc3e3; border-radius: 13px; cursor: pointer; transition: border-color .16s ease, background-color .16s ease; }
.upload-dropzone.dragging, .upload-dropzone:hover { background: #f1f2fb; border-color: var(--upload-accent); }
.upload-dropzone > span, .upload-dropzone > strong, .upload-dropzone > small { display: block; }
.upload-drop-icon { display: grid !important; width: 42px; height: 42px; place-items: center; margin: 0 auto 10px; color: var(--upload-accent); background: var(--upload-accent-soft); border-radius: 12px; }
.upload-drop-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.upload-dropzone strong { color: var(--upload-text); font-size: 12px; }
.upload-picker-actions { display: flex !important; gap: 8px; margin-top: 12px; }
.upload-picker-actions button { min-height: 30px; padding: 5px 12px; color: var(--upload-accent); background: #fff; border: 1px solid #cfd2ea; border-radius: 7px; font-size: 10px; font-weight: 700; }
.upload-picker-actions button:hover { background: var(--upload-accent-soft); border-color: var(--upload-accent); }
.upload-dropzone small { margin-top: 5px; color: #9a9491; font-size: 10px; font-weight: 500; }
.upload-dropzone small.error { color: #ad4d47; }
.upload-dropzone.reading { cursor: wait; opacity: .78; }
.upload-queue-heading { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; margin: 17px 0 9px; }
.upload-queue-heading strong { font-size: 12px; }
.upload-queue-heading span { color: var(--upload-muted); font-size: 10px; }
.upload-file-queue { display: flex; min-height: 0; flex: 1 1 0; flex-direction: column; gap: 7px; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-gutter: stable; }
.upload-directory-heading { position: sticky; z-index: 2; top: 0; display: grid; min-height: 32px; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 4px 8px; color: #635d5a; background: rgba(248,248,248,.96); border: 1px solid #e5e2e0; border-radius: 7px; backdrop-filter: blur(6px); }
.upload-directory-heading svg { width: 16px; height: 16px; fill: none; stroke: var(--upload-accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.upload-directory-heading strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.upload-directory-heading span { color: #9a9491; font-size: 9px; white-space: nowrap; }
.upload-directory-heading + .upload-file-row, .upload-file-row + .upload-file-row { margin-left: 18px; }
.upload-queue-empty { display: grid; min-height: 90px; place-content: center; justify-items: center; gap: 5px; color: var(--upload-muted); border: 1px dashed #d9d5d3; border-radius: 10px; font-size: 10px; }
.upload-queue-empty strong { color: #625b58; font-size: 11px; }
.upload-file-row { display: grid; min-height: 58px; flex: 0 0 auto; grid-template-columns: 64px minmax(0, 1fr) auto 30px; align-items: center; gap: 10px; padding: 7px; border: 1px solid #e3e0df; border-radius: 10px; }
.upload-file-row > img { width: 64px; height: 42px; object-fit: cover; background: #eee; border-radius: 7px; }
.upload-file-type { display: grid; width: 48px; height: 42px; place-items: center; justify-self: center; color: #2e7a69; background: #edf6f3; border: 1px solid #ceded9; border-radius: 7px; font-size: 9px; font-weight: 800; letter-spacing: .03em; }
.upload-file-info { display: grid; min-width: 0; gap: 4px; }
.upload-file-info strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.upload-file-info span { color: #9a9491; font-size: 9px; }
.upload-file-info progress { width: 100%; height: 4px; accent-color: var(--upload-accent); }
.upload-file-status { padding: 4px 7px; color: #3f876b; background: #edf5f2; border-radius: 5px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.status-invalid .upload-file-status, .status-failed .upload-file-status { color: #ad4d47; background: #fff0ef; }
.status-uploading .upload-file-status { color: var(--upload-accent); background: var(--upload-accent-soft); }
.status-uploaded .upload-file-status { color: #3f876b; background: #edf5f2; }
.upload-file-remove { width: 30px; min-height: 30px; padding: 0; color: #aaa4a1; background: transparent; border: 0; font-size: 18px; }
.upload-file-remove svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.upload-file-remove:hover { color: #a55a55; background: #fff1ef; }
.upload-dialog-footer { display: flex; min-height: 76px; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 20px; padding: 0 26px; background: #fff; border-top: 1px solid #e8e5e4; }
.upload-dialog-footer p { margin: 0; color: var(--upload-muted); font-size: 11px; }
.upload-dialog-footer p strong { color: var(--upload-text); }
.upload-dialog-footer > div { display: flex; gap: 10px; }
.upload-dialog-footer a, .upload-dialog-footer button { display: inline-flex; height: 40px; min-height: 40px; align-items: center; justify-content: center; padding: 0 18px; border-radius: 9px; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.upload-dialog-footer a { color: #625b58; background: #fff; border: 1px solid #dcd8d6; }
.upload-dialog-footer button { color: #fff; background: var(--upload-accent); border: 0; box-shadow: 0 7px 18px rgba(83,95,188,.2); }
.upload-dialog-footer button svg { width: 16px; height: 16px; margin-right: 7px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.upload-dialog-footer button:disabled { cursor: not-allowed; box-shadow: none; opacity: .48; }
.upload-dialog-footer button:not(:disabled):active { transform: translateY(1px); }

@media (max-width: 900px) {
  .upload-dialog { width: calc(100vw - 32px); }
  .upload-dialog-body { grid-template-columns: 320px minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .upload-page { padding-left: 0; }
  .upload-page .app-drawer, .upload-page-context, .upload-page-scrim { display: none; }
  .upload-dialog { position: static; width: 100%; height: auto; min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; transform: none; }
  .upload-dialog-header { padding: 14px 16px; }
  .upload-dialog-body { display: flex; flex-direction: column; }
  .upload-target-panel { overflow: visible; border-right: 0; border-bottom: 1px solid #e8e5e4; }
  .upload-files-panel { min-height: 560px; overflow: visible; padding: 20px 16px; }
  .upload-file-row { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .upload-file-row > img { width: 52px; }
  .upload-file-status { display: none; }
  .upload-dialog-footer { position: sticky; bottom: 0; padding: 12px 16px; background: #fff; }
}
