:root {
  --ink: #1c2b46;
  --muted: #64748b;
  --line: #e2e8f2;
  --soft: #f3f6fb;
  --panel: #ffffff;
  --blue: #245bea;
  --blue-dark: #1741bd;
  --blue-soft: #eaf0ff;
  --teal: #1fa68a;
  --orange: #f49b3f;
  --danger: #d74747;
  --shadow: 0 18px 50px rgba(31, 45, 77, .09);
  --radius: 18px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--soft);
  font-synthesis: none;
  font-size: 16px;
  line-height: 1.6;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--soft); }
body { min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    radial-gradient(circle at 18% 15%, rgba(88, 149, 255, .42), transparent 30%),
    radial-gradient(circle at 86% 78%, rgba(43, 209, 190, .2), transparent 32%),
    linear-gradient(135deg, #0c1635 0%, #132e74 52%, #0d4e66 100%);
}

.auth-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  opacity: .26;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 48px 48px;
}

.auth-card {
  position: relative;
  width: min(440px, 100%);
  padding: 42px;
  border-radius: 26px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 35px 90px rgba(0,0,0,.3);
}

.auth-card h1 { margin: 7px 0 10px; font-size: 30px; }
.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  font-weight: 800;
  letter-spacing: .06em;
  background: linear-gradient(145deg, #3473ff, #173bb9);
  box-shadow: 0 12px 28px rgba(36,91,234,.32);
}
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; font-size: 13px; flex: none; }
.eyebrow { margin: 0; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.eyebrow.light { color: #b9d1ff; }
.muted { margin: 0 0 24px; color: var(--muted); line-height: 1.7; }

.stack-form { display: grid; gap: 17px; margin-top: 28px; }
label { display: grid; gap: 8px; color: #39445c; font-size: 15px; font-weight: 650; }
label > span { color: var(--danger); }
input, select, textarea {
  width: 100%;
  border: 1px solid #dce3ef;
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
textarea { resize: vertical; line-height: 1.65; }
input:focus, select:focus, textarea:focus { border-color: #7fa2ff; box-shadow: 0 0 0 4px rgba(36,91,234,.1); }
input[type="file"] { padding: 9px; background: #f8faff; }
input[type="file"]::file-selector-button { border: 0; border-radius: 7px; background: var(--blue-soft); color: var(--blue-dark); padding: 7px 10px; margin-right: 10px; font-weight: 700; }

button { border: 0; border-radius: 10px; padding: 11px 17px; font-weight: 750; transition: transform .15s, box-shadow .15s, opacity .15s; }
button:hover { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.primary { color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); box-shadow: 0 8px 20px rgba(36,91,234,.22); }
.primary.compact, .ghost.compact { padding: 9px 14px; font-size: 14px; }
.ghost { color: #43506a; background: #edf1f7; }
.full { width: 100%; }
.form-error { min-height: 19px; margin: 0; color: var(--danger); font-size: 13px; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  background:
    radial-gradient(circle at 14% 8%, rgba(65, 112, 225, .055), transparent 26%),
    var(--soft);
}
.sidebar {
  position: fixed;
  inset: 16px auto 16px 14px;
  z-index: 20;
  width: 184px;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  color: var(--ink);
  overflow: hidden;
  border: 1px solid rgba(218, 225, 238, .92);
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 50px rgba(35, 50, 82, .1);
  backdrop-filter: blur(14px);
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 92px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(36, 91, 234, .09), rgba(36, 91, 234, 0));
}
.brand { position: relative; display: flex; align-items: center; gap: 11px; padding: 4px 7px 22px; }
.brand strong { display: block; color: #17233d; font-size: 17px; }
.brand span { display: block; margin-top: 3px; color: #718098; font-size: 12px; }
.main-nav { position: relative; display: grid; gap: 6px; }
.main-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid transparent;
  color: #68758d;
  background: transparent;
  text-align: left;
  box-shadow: none;
}
.main-nav button:hover { color: #263a63; background: #f4f7fc; }
.main-nav button > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: #6b7891; background: #f0f3f8; font-size: 12px; }
.main-nav button.active { color: #1f4fca; border-color: #d9e4ff; background: linear-gradient(135deg, #eef3ff, #f7f9ff); box-shadow: inset 3px 0 0 #3268e8; }
.main-nav button.active > span { color: #fff; background: linear-gradient(145deg, #477cf1, #245bea); box-shadow: 0 6px 14px rgba(36,91,234,.22); }
.sidebar-foot { margin-top: auto; }
.portal-note { margin: 0 4px; padding: 14px 8px 3px; border-top: 1px solid #e8edf5; }
.portal-note strong, .portal-note span { display: block; }
.portal-note strong { color: #4b5972; font-size: 12px; }
.portal-note span { margin-top: 5px; color: #96a0b3; font-size: 11px; line-height: 1.45; }
.user-block { display: flex; align-items: center; gap: 11px; padding: 14px 8px; margin-bottom: 8px; border-top: 1px solid rgba(255,255,255,.1); }
.user-block strong { display: block; font-size: 13px; }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; color: #e4edff; background: rgba(101,143,255,.26); font-weight: 800; }
.sidebar .ghost { color: #5e6d87; background: #f0f3f8; }

.main-area { grid-column: 2; min-width: 0; padding: 0 16px 48px; }
.topbar { min-height: 110px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h1 { margin: 7px 0 0; font-size: 30px; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.security-pill { border: 1px solid #cfe5dd; border-radius: 999px; padding: 7px 11px; color: #18755f; background: #effaf6; font-size: 12px; font-weight: 700; }

.page { display: none; animation: fade .2s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: .35; transform: translateY(4px); } }

.hero-card {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 34px;
  padding: 42px 48px;
  border-radius: 22px;
  color: #fff;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 83% 15%, rgba(80,218,214,.45), transparent 24%),
    linear-gradient(120deg, #183eaa 0%, #245bea 54%, #1686a2 115%);
  box-shadow: var(--shadow);
}
.hero-card::after { content: ""; position: absolute; width: 360px; height: 360px; right: -130px; bottom: -230px; border: 50px solid rgba(255,255,255,.1); border-radius: 50%; }
.hero-card h2 { max-width: 720px; margin: 10px 0 13px; font-size: clamp(26px, 3vw, 38px); line-height: 1.25; letter-spacing: -.03em; }
.hero-card p:not(.eyebrow) { max-width: 690px; margin: 0; color: #dae6ff; line-height: 1.75; }
.hero-action { position: relative; z-index: 1; min-width: 190px; color: #1543b7; background: #fff; box-shadow: 0 12px 28px rgba(10,35,93,.23); }
.hero-action span { margin-left: 15px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.stats-grid article { padding: 22px 23px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); box-shadow: 0 8px 30px rgba(31,45,77,.04); }
.stats-grid span { display: block; color: #546079; font-size: 15px; font-weight: 700; }
.stats-grid strong { display: block; margin: 10px 0 5px; font-size: 31px; }
.stats-grid small { color: #929bb0; }

.content-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; margin-top: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 8px 30px rgba(30,44,77,.045); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
.panel-head h3 { margin: 6px 0 5px; font-size: 22px; letter-spacing: -.02em; }
.panel-head p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.content-grid > .panel { padding: 28px; }
.workflow { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.workflow li { display: flex; gap: 17px; padding: 15px 0; border-bottom: 1px solid #edf0f5; }
.workflow li:last-child { border-bottom: 0; }
.workflow b { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 12px; }
.workflow strong, .workflow span { display: block; }
.workflow strong { margin: 1px 0 5px; font-size: 16px; }
.workflow span { color: var(--muted); font-size: 14px; line-height: 1.7; }
.accent-panel { color: #fff; background: linear-gradient(155deg, #183c9c, #102867); border: 0; }
.accent-panel h3 { margin: 8px 0 20px; font-size: 23px; }
.score-ring { width: 142px; height: 142px; display: grid; place-content: center; margin: 5px auto 22px; border: 12px solid rgba(255,255,255,.13); border-top-color: #5be1d0; border-right-color: #77a8ff; border-radius: 50%; text-align: center; transform: rotate(8deg); }
.score-ring > * { transform: rotate(-8deg); }
.score-ring strong { font-size: 36px; line-height: 1; }
.score-ring span { margin-top: 5px; color: #c4d5ff; font-size: 13px; }
.simple-list { margin: 0; padding: 0; list-style: none; }
.simple-list li { padding: 10px 0; border-top: 1px solid rgba(255,255,255,.1); color: #d8e2ff; font-size: 14px; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.form-panel, .template-editor { padding: 30px; }
.form-section { padding: 22px 0; border-top: 1px solid var(--line); }
.form-section h4 { margin: 0 0 18px; font-size: 17px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.section-title-row span { color: var(--muted); font-size: 12px; }
.field-grid { display: grid; gap: 15px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-grid + .field-grid { margin-top: 15px; }
.metrics-grid { margin-bottom: 16px; }
.step-badge { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 800; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 20px; }
.context-card { position: sticky; top: 18px; padding: 25px; }
.context-card h3 { margin: 8px 0 22px; }
.preview-block { padding: 15px 0; border-top: 1px solid var(--line); }
.preview-block span { color: #6e7a92; font-size: 13px; font-weight: 750; letter-spacing: .03em; }
.preview-block p { margin: 8px 0 0; color: #3e4960; font-size: 15px; line-height: 1.75; white-space: pre-line; }
.privacy-note { margin-top: 18px; padding: 16px; border-radius: 13px; color: #285e50; background: #eef8f4; }
.privacy-note strong { font-size: 15px; }
.privacy-note p { margin: 7px 0 0; font-size: 14px; line-height: 1.75; }
.upload-status { margin-top: 15px; padding: 13px 15px; border-radius: 10px; color: #284f98; background: #eef4ff; font-size: 13px; line-height: 1.6; }

#page-tasks > .panel { padding: 24px; }
.task-list-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.task-list-controls .template-tabs { margin-bottom: 0; }
.task-delete-toggle { display: inline-flex; align-items: center; gap: 10px; color: #64748b; font-size: 14px; font-weight: 500; white-space: nowrap; }
.task-delete-toggle select { width: 76px; min-height: 42px; padding: 8px 10px; }
.task-filter-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 14px; padding: 16px; border: 1px solid #e3eaf5; border-radius: 12px; background: #f8faff; }
.template-filter-form { grid-template-columns: minmax(0, 1fr) auto; }
#task-filter-form { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.25fr) minmax(0, .9fr) minmax(0, .9fr) auto; }
.task-filter-field { min-width: 0; }
.task-filter-field > label { margin-bottom: 7px; font-size: 14px; }
.task-filter-field > select { min-width: 0; height: 44px; font-size: 14px; }
.searchable-select { position: relative; }
.searchable-select > input { height: 44px; padding-right: 44px; font-size: 14px; }
.searchable-select > [data-select-toggle] { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 36px; padding: 0; border-radius: 0 9px 9px 0; color: #65758c; background: #fff; }
.searchable-select > [data-select-toggle]:hover { transform: none; color: var(--blue); background: #f1f5ff; }
.select-options { position: absolute; z-index: 30; inset: calc(100% + 5px) 0 auto; max-height: 250px; overflow-y: auto; padding: 5px; border: 1px solid #dce3ef; border-radius: 10px; background: #fff; box-shadow: 0 10px 30px rgba(31,45,77,.15); }
.select-options[hidden] { display: none; }
.select-options [role="option"] { display: block; width: 100%; padding: 9px 11px; border-radius: 7px; color: #39445c; background: transparent; font-size: 14px; font-weight: 500; text-align: left; overflow-wrap: anywhere; }
.select-options [role="option"]:hover, .select-options [role="option"].active { transform: none; color: var(--blue); background: var(--blue-soft); }
.select-options [aria-selected="true"] { font-weight: 700; }
.select-empty { margin: 8px 10px; color: #718098; font-size: 13px; }
.task-filter-actions { display: flex; gap: 8px; }
.task-filter-actions button { height: 44px; min-width: 72px; }
.task-filter-summary { min-height: 20px; margin: 10px 2px; color: #718098; font-size: 13px; }
.toolbar { display: flex; gap: 8px; }
.toolbar select { min-width: 135px; padding: 8px 10px; }
#page-tasks .toolbar { align-items: stretch; flex-wrap: nowrap; }
#page-tasks .toolbar select, #refresh-tasks { height: 44px; }
#refresh-tasks { flex: 0 0 72px; min-width: 72px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.table-wrap { width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #b8c8e2 #f3f6fb; }
table { width: 100%; border-collapse: collapse; }
th { padding: 15px 12px; color: #52627b; background: #f3f6fb; font-size: 13px; font-weight: 700; letter-spacing: .02em; text-align: left; white-space: nowrap; }
td { padding: 18px 12px; border-bottom: 1px solid #e9eef6; color: #39445c; font-size: 15px; line-height: 1.6; vertical-align: middle; }
td strong, td span { display: block; }
td span { margin-top: 4px; color: #718098; font-size: 13px; }
.link-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 7px 11px; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-size: 14px; font-weight: 650; line-height: 1.5; text-decoration: none; }
.task-actions { display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.retry-task-btn { color: #fff; background: var(--blue); }
.delete-task-btn { color: #b42318; background: #fff0ef; }
.delete-task-btn:hover { color: #fff; background: #c9362b; box-shadow: 0 7px 16px rgba(201, 54, 43, .2); }
.retry-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.retry-actions > span { min-width: 0; flex: 1 1 240px; font-size: 14px; }
.report-ready-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; flex-shrink: 0; }
.cell-center { text-align: center; }
.task-table { min-width: 0; table-layout: fixed; }
.task-table .col-task { width: 15%; }
.task-table .col-anchor { width: 7%; }
.task-table .col-project { width: 10%; }
.task-table .col-model { width: 12%; }
.task-table .col-video { width: 7%; }
.task-table .col-data { width: 9%; }
.task-table .col-cycle { width: 9%; }
.task-table .col-status { width: 7%; }
.task-table .col-actions { width: 24%; }
.task-table th { height: 52px; }
.task-table td { height: 88px; overflow-wrap: anywhere; }
.task-table td:first-child { font-variant-numeric: tabular-nums; }
.task-table .model-cell { color: #5d6d86; font-size: 14px; }
.task-table .compact-task-meta { display: none; }
.task-table .task-actions { flex-direction: row; flex-wrap: nowrap; gap: 6px; }
.task-table .task-actions > * { flex: 0 0 auto; }
.task-table .link-btn { padding-inline: 10px; }
.task-table .database-status, .task-table .cycle-badge, .task-table .status { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.task-table tbody tr { transition: background .15s ease; }
.task-table tbody tr:nth-child(even) { background: #fbfcfe; }
.task-table tbody tr:hover { background: #f2f6ff; }
.task-table tbody tr:last-child td { border-bottom: 0; }
#self-task-table { container: review-tasks / inline-size; border: 1px solid var(--line); border-radius: 12px; }

@container review-tasks (max-width: 1240px) {
  .task-table th, .task-table td { padding-inline: 8px; }
}

@container review-tasks (max-width: 1240px) {
  .task-table .col-model, .task-table .col-video,
  .task-table th:nth-child(4), .task-table th:nth-child(5),
  .task-table td:nth-child(4), .task-table td:nth-child(5) { display: none; }
  .task-table .col-task { width: 18%; }
  .task-table .col-anchor { width: 8%; }
  .task-table .col-project { width: 14%; }
  .task-table .col-data { width: 10%; }
  .task-table .col-cycle { width: 10%; }
  .task-table .col-status { width: 9%; }
  .task-table .col-actions { width: 31%; }
  .task-table .compact-task-meta { display: block; margin-top: 6px; line-height: 1.65; }
}

@container review-tasks (max-width: 950px) {
  .task-table, .task-table tbody { display: block; }
  .task-table colgroup, .task-table thead { display: none; }
  .task-table tbody { padding: 12px; background: #f5f7fb; }
  .task-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  .task-table tbody tr:last-child { margin-bottom: 0; }
  .task-table td { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; min-width: 0; min-height: 72px; height: auto; padding: 12px; border: 0; text-align: left; }
  .task-table td::before { content: attr(data-label); color: #64748b; font-size: 13px; font-weight: 500; }
  .task-table td:first-child, .task-table td:nth-child(3), .task-table td:last-child { grid-column: 1 / -1; }
  .task-table td:nth-child(2) { border-top: 1px solid #edf1f7; }
  .task-table td:nth-child(3) { border-block: 1px solid #edf1f7; }
  .task-table td:last-child { border-top: 1px solid #edf1f7; }
  .task-table td:last-child::before { display: none; }
  .task-table td > span { margin-top: 0; }
  .task-table .task-actions { flex-direction: row; width: 100%; }
  .task-table .task-actions > * { flex: 1 1 0; min-width: 0; }
}
.report-link { display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--blue); text-decoration: none; }
.secondary-link { color: #66728a; background: #edf1f6; }
.status { display: inline-flex; align-items: center; justify-content: center; width: max-content; min-height: 32px; margin: 0; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.status.pending { color: #9b641a; background: #fff3da; }
.status.processing { color: #1c60b0; background: #e7f1ff; }
.status.review { color: #744bad; background: #f2eaff; }
.status.completed { color: #18735c; background: #e6f7f1; }
.status.failed { color: #a43d3d; background: #ffe9e9; }
.status.draft { color: #67728a; background: #edf0f5; }
.empty-state { display: grid; place-items: center; gap: 6px; min-height: 180px; color: var(--muted); }
.empty-state strong { color: #4f5b72; }
.empty-state span { font-size: 13px; }

.split-layout { display: grid; grid-template-columns: 365px minmax(0, 1fr); gap: 18px; align-items: start; }
.template-list-panel { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: auto; padding: 24px; }
.import-row { display: flex; gap: 8px; margin: -6px 0 18px; }
.import-row input { min-width: 0; padding: 6px; font-size: 11px; }
.template-list { display: grid; gap: 9px; }
.template-item { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 13px; border: 1px solid #e4e9f2; color: #33405a; background: #fff; text-align: left; }
.template-item:hover, .template-item.active { border-color: #89a7f6; background: #f1f5ff; }
.template-item strong, .template-item span { display: block; }
.template-item span { margin-top: 4px; color: #8791a7; font-size: 11px; }
.template-item b { color: var(--blue); font-size: 10px; }
.template-editor { display: grid; gap: 17px; }
.user-layout { grid-template-columns: minmax(0, 1fr) 370px; }
.user-list-panel, .user-editor { padding: 26px; }
.user-editor { display: grid; gap: 17px; position: sticky; top: 18px; }
.switch-row { display: flex; align-items: center; gap: 9px; }
.switch-row input { width: auto; }

.detail-dialog { width: min(1040px, calc(100vw - 30px)); max-height: 88vh; padding: 0; border: 0; border-radius: 20px; box-shadow: 0 35px 100px rgba(15,28,60,.35); }
.detail-dialog::backdrop { background: rgba(10,18,38,.58); backdrop-filter: blur(4px); }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 23px 27px; border-bottom: 1px solid var(--line); background: #fff; }
.dialog-head h2 { margin: 5px 0 0; font-size: 21px; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 50%; color: #66728a; background: #edf1f6; font-size: 23px; }
#task-detail-content { padding: 25px 27px 32px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.detail-grid > div, .metric-card { min-width: 0; padding: 16px; border: 1px solid #e8edf5; border-radius: 12px; background: #f7f9fc; }
.detail-grid span, .metric-card span { display: block; color: #64748b; font-size: 13px; }
.detail-grid strong, .metric-card strong { display: block; margin-top: 8px; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.detail-section { margin-top: 24px; }
.detail-section h4 { margin: 0 0 12px; }
.metric-cards { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 9px; }
.file-list { display: grid; gap: 8px; }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; }
.file-row a { color: var(--blue); font-size: 12px; font-weight: 700; text-decoration: none; }
.prompt-box { max-height: 260px; overflow: auto; padding: 16px; border-radius: 12px; color: #cdd9f6; background: #16213d; font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.report-box { max-height: 58vh; overflow: auto; padding: 22px; border: 1px solid #dfe6f1; border-radius: 14px; color: #26324a; background: #fbfcff; font-size: 13px; line-height: 1.85; white-space: pre-wrap; }
.analysis-progress { display: flex; align-items: center; gap: 15px; padding: 18px; border: 1px solid #dce7fb; border-radius: 13px; color: #34517f; background: #f3f7ff; }
.analysis-progress strong { display: block; font-size: 13px; }
.analysis-progress p { margin: 5px 0 0; color: #70809c; font-size: 12px; line-height: 1.55; }
.analysis-spinner { flex: 0 0 28px; width: 28px; height: 28px; border: 3px solid #d5e1fa; border-top-color: var(--blue); border-radius: 50%; animation: analysis-spin .8s linear infinite; }
.analysis-error { padding: 16px 18px; border: 1px solid #f2caca; border-radius: 12px; color: #9b3434; background: #fff2f2; font-size: 13px; line-height: 1.65; }
.report-ready { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px; border: 1px solid #cfe8df; border-radius: 13px; background: #f0faf6; }
.report-ready strong { display: block; color: #205f4d; font-size: 16px; }
.report-ready p { margin: 5px 0 0; color: #527469; font-size: 14px; line-height: 1.65; }
.report-open-btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; padding: 10px 15px; text-decoration: none; }
@keyframes analysis-spin { to { transform: rotate(360deg); } }

.toast { position: fixed; z-index: 100; right: 25px; bottom: 25px; max-width: 380px; padding: 13px 17px; border-radius: 11px; color: #fff; background: #1e2b47; box-shadow: 0 16px 40px rgba(0,0,0,.25); font-size: 13px; }

/* 自营主播复盘：保留原蓝白工作台布局，只呈现实际业务字段。 */
.compact-hero { min-height: 190px; }
.compact-hero .hero-copy { max-width: 720px; }
.compact-hero .hero-action { min-width: 190px; }
.simple-process-panel { margin-bottom: 18px; padding: 22px 26px; }
.horizontal-workflow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.horizontal-workflow li { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid #e6ebf3; border-radius: 13px; background: #fbfcff; }
.horizontal-workflow b { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: var(--blue-soft); font-size: 11px; }
.horizontal-workflow strong, .horizontal-workflow span { display: block; }
.horizontal-workflow strong { color: #26324a; font-size: 15px; }
.horizontal-workflow span { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.analysis-layout { grid-template-columns: minmax(0, 1fr) 310px; }
.analysis-form { padding: 28px; }
.analysis-form .first-section { padding-top: 4px; border-top: 0; }
.video-drop { min-height: 230px; display: grid; place-items: center; align-content: center; gap: 10px; padding: 28px; border: 1.5px dashed #b7c7e8; border-radius: 14px; color: #40506e; background: #f8faff; text-align: center; cursor: pointer; transition: .18s ease; }
.video-drop:hover, .video-drop.dragging { border-color: var(--blue); background: #f2f6ff; transform: translateY(-1px); }
.video-drop.has-file { border-color: #67b49e; background: #f0faf7; }
.video-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 2px; border-radius: 15px; color: var(--blue); background: var(--blue-soft); font-size: 24px; font-weight: 800; }
.video-drop strong, .video-drop small { display: block; }
.video-drop strong { font-size: 17px; }
.video-drop small { color: #6c7b92; font-size: 14px; font-weight: 500; line-height: 1.65; }
.analysis-fields { margin-top: 22px; }
.analysis-fields > label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 2px;
  row-gap: 0;
}
.analysis-fields > label > input,
.analysis-fields > label > select {
  flex: 0 0 100%;
  margin-top: 8px;
}
.session-field { grid-column: 1 / -1; display: grid; gap: 8px; }
.session-label { color: #39445c; font-size: 15px; font-weight: 650; }
.session-label span { color: var(--danger); }
.session-picker { display: grid; grid-template-columns: minmax(0, 1fr) 108px; gap: 10px; }
.session-picker button { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.session-field small { color: #64748b; font-size: 13px; line-height: 1.65; }
.database-field { margin-top: 20px; padding: 17px 18px; border: 1px solid #dceee7; border-radius: 13px; background: #f1f9f6; }
.database-field strong { display: block; color: #226c57; font-size: 15px; }
.database-field p { margin: 7px 0 0; color: #527269; font-size: 12px; line-height: 1.7; }
.centered-actions { justify-content: center; }
.start-analysis-btn { min-width: 230px; padding: 13px 24px; }

.template-table-panel { padding: 26px; }
.template-actions { flex: 0 0 auto; }
.template-tabs { display: inline-flex; gap: 4px; margin: 2px 0 12px; padding: 4px; border: 1px solid #dfe7f5; border-radius: 12px; background: #f3f6fc; }
.template-tabs button { min-height: 42px; padding: 9px 20px; border: 0; border-radius: 9px; background: transparent; color: #5a6880; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.template-tabs button.active { background: #fff; color: var(--blue); box-shadow: 0 2px 9px rgba(27,57,111,.1); }
.template-tab-note { margin: 0 0 16px; color: #64748b; font-size: 14px; line-height: 1.7; }
#new-template-btn { min-width: 88px; white-space: nowrap; }
.template-table-wrap { width: 100%; overflow: auto; border: 1px solid #e7ebf2; border-radius: 13px; }
.template-data-table { min-width: 1180px; table-layout: fixed; }
.template-data-table th:nth-child(1) { width: 150px; }
.template-data-table th:nth-child(2), .template-data-table th:nth-child(3), .template-data-table th:nth-child(4), .template-data-table th:nth-child(5) { width: 225px; }
.template-data-table th:last-child { width: 78px; }
.template-data-table td { vertical-align: top; }
.cell-preview { max-height: 90px; overflow: hidden; color: #58647b; font-size: 14px; line-height: 1.65; white-space: pre-line; }
.template-dialog { width: min(1120px, calc(100vw - 34px)); max-height: min(92vh, 980px); overflow: hidden; }
.template-dialog-head { position: relative; }
.template-dialog-head p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.template-editor-dialog { width: 100%; height: min(780px, calc(92vh - 98px)); display: flex; flex-direction: column; overflow: hidden; }
.template-form-body { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 30px 32px; background: #f8faff; }
.template-form-section { padding: 22px; border: 1px solid #e5eaf3; border-radius: 15px; background: #fff; box-shadow: 0 5px 18px rgba(31,45,77,.035); }
.template-form-section + .template-form-section { margin-top: 16px; }
.section-caption { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.section-caption b { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 11px; }
.section-caption strong, .section-caption span { display: block; }
.section-caption strong { color: #26324a; font-size: 16px; }
.section-caption span { margin-top: 3px; color: #718098; font-size: 13px; font-weight: 500; }
.template-basic-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; align-items: end; }
.template-active-card { min-height: 44px; display: flex; align-items: center; gap: 11px; padding: 10px 13px; border: 1px solid #dce3ef; border-radius: 10px; background: #f8faff; cursor: pointer; }
.template-active-card input { flex: 0 0 auto; width: 17px; height: 17px; margin: 0; accent-color: var(--blue); }
.template-active-card > span { color: inherit; }
.template-active-card strong, .template-active-card small { display: block; }
.template-active-card strong { color: #34415b; font-size: 12px; }
.template-active-card small { margin-top: 2px; color: #8a94a8; font-size: 10px; font-weight: 500; }
.template-field-skill textarea { min-height: 310px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, "Microsoft YaHei", monospace; font-size: 15px; }
.template-content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.template-content-grid textarea { min-height: 170px; resize: vertical; }
.template-field-product { grid-column: 1 / -1; }
.template-field-product textarea { min-height: 210px; }
.template-form-footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 24px; border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -8px 24px rgba(31,45,77,.06); }
.template-form-footer > span { color: #64748b; font-size: 13px; line-height: 1.65; }
.template-form-footer > div { display: flex; gap: 10px; }
.template-form-footer button { min-width: 96px; }
.database-status { display: inline-flex; align-items: center; justify-content: center; width: max-content; min-height: 32px; margin: 0; padding: 5px 10px; border-radius: 999px; color: #5d6b80; background: #edf1f7; font-size: 13px; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.database-status.pending { color: #94631d; background: #fff3d7; }
.database-status.matched { color: #18735c; background: #e6f7f1; }
.database-status.failed { color: #a43d3d; background: #ffe9e9; }
.database-status.missing { color: #956621; background: #fff4df; }
.database-status.partial { color: #94631d; background: #fff3d7; }
.cycle-badge { display: inline-flex; align-items: center; justify-content: center; width: max-content; min-height: 32px; margin: 0; padding: 5px 10px; border-radius: 999px; color: #53627d; background: #edf1f7; font-size: 13px; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.cycle-badge.idle { color: #68768c; background: #f0f3f8; }
.cycle-badge.tracking { color: #2259c8; background: #e9efff; }
.cycle-badge.improved { color: #18735c; background: #e6f7f1; }
.cycle-badge.supervisor_review { color: #976218; background: #fff1d5; }
.cycle-badge.closed { color: #5e687c; background: #e9edf3; }

.talent-panel { padding: 26px; }
.talent-intake-note { margin: 4px 0 18px; padding: 13px 16px; border: 1px solid #dce9ff; border-radius: 11px; background: #f3f7ff; color: #486181; font-size: 12px; line-height: 1.6; }
.talent-intake-form { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; align-items: end; margin-bottom: 18px; }
.talent-intake-form label, .talent-verify-form label, .talent-upload-row label { display: grid; gap: 6px; color: #39445c; font-size: 12px; font-weight: 650; }
.talent-intake-form label span { color: var(--danger); }
.talent-intake-form input, .talent-intake-form select, .talent-verify-form input, .talent-verify-form textarea, .talent-upload-row input { min-width: 0; width: 100%; padding: 10px 12px; border: 1px solid #dce3ef; border-radius: 9px; background: #fff; color: #26324a; font: inherit; }
.talent-intake-form button { min-height: 40px; white-space: nowrap; }
.talent-dialog { width: min(1040px, calc(100vw - 32px)); max-height: 92vh; }
.talent-dialog #talent-detail-content { max-height: calc(92vh - 86px); overflow: auto; padding: 22px 26px 32px; }
.talent-upload-row { display: grid; grid-template-columns: minmax(0,1fr) 110px; gap: 10px; align-items: end; margin: 12px 0; }
.talent-upload-row button { min-height: 40px; white-space: nowrap; }
.talent-verify-form { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; align-items: end; margin: 15px 0; }
.talent-verify-form .talent-full { grid-column: 1 / -1; }
.talent-verify-form button { min-height: 40px; white-space: nowrap; }
.talent-delivery-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: end; margin-top: 16px; }
.talent-delivery-form label { display: grid; gap: 6px; color: #39445c; font-size: 12px; font-weight: 650; }
.talent-delivery-form input { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid #dce3ef; border-radius: 9px; }
.talent-delivery-form button { min-height: 40px; white-space: nowrap; }
.talent-dialog details { margin-top: 12px; color: #526078; font-size: 12px; line-height: 1.7; }
.talent-dialog details ul { padding-left: 22px; }
.talent-template-dialog { width: min(920px, calc(100vw - 32px)); max-height: 92vh; }
.talent-template-form { display: grid; gap: 18px; max-height: calc(92vh - 94px); overflow: auto; padding: 24px 28px 30px; }
.talent-template-form > label { display: grid; gap: 8px; color: #39445c; font-size: 15px; font-weight: 650; }
.talent-template-form > label > span { color: var(--danger); }
.talent-template-form textarea { width: 100%; min-height: 110px; padding: 13px; border: 1px solid #dce3ef; border-radius: 10px; resize: vertical; font: inherit; line-height: 1.55; }
.talent-template-form input[name="name"] { width: 100%; min-height: 42px; padding: 10px 13px; border: 1px solid #dce3ef; border-radius: 10px; font: inherit; }
.talent-template-form .talent-enable { display: flex; align-items: center; gap: 10px; }
.talent-shared-info { padding: 15px 17px; border-radius: 11px; background: #f3f7ff; color: #445b79; }
.talent-shared-info p { max-height: 125px; overflow: auto; margin: 8px 0 0; white-space: pre-line; font-size: 12px; line-height: 1.6; }

@media (max-width: 1360px) {
  .app-shell { grid-template-columns: 104px minmax(0,1fr); }
  .sidebar { inset: 12px auto 12px 12px; width: 72px; padding: 14px 9px; border-radius: 18px; }
  .brand > div:last-child { display: none; }
  .main-nav button { justify-content: center; padding: 10px; font-size: 0; }
  .brand { justify-content: center; padding-inline: 0; }
  .main-nav button > span { font-size: 12px; }
  .portal-note { display: none; }
  .main-area { padding-inline: 18px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .field-grid.four { grid-template-columns: repeat(3, 1fr); }
  .form-layout { grid-template-columns: 1fr; }
  .analysis-layout { grid-template-columns: 1fr; }
  .context-card { position: static; }
}

@media (max-width: 1100px) {
  #task-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #task-filter-form .task-filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 900px) {
  .content-grid, .split-layout { grid-template-columns: 1fr; }
  .template-list-panel { position: static; max-height: none; }
  .field-grid.three, .field-grid.four { grid-template-columns: repeat(2, 1fr); }
  .metric-cards { grid-template-columns: repeat(3,1fr); }
  .horizontal-workflow { grid-template-columns: 1fr; }
  .template-basic-grid, .template-content-grid { grid-template-columns: 1fr; }
  .template-field-product { grid-column: auto; }
  .template-dialog { width: min(760px, calc(100vw - 24px)); }
  .talent-intake-form, .talent-verify-form { grid-template-columns: repeat(2, minmax(0,1fr)); }
  #page-tasks > .panel { padding: 22px; }
}

@media (max-width: 620px) {
  #task-filter-form { grid-template-columns: 1fr; }
  .task-filter-form { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .task-filter-actions button { flex: 1; }
  .app-shell { display: block; }
  .sidebar { position: static; width: auto; height: auto; margin: 10px 10px 0; flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 15px; }
  .sidebar::before { height: 100%; }
  .brand { padding: 0; }
  .brand > div:last-child { display: block; }
  .main-nav { display: flex; margin-left: auto; }
  .main-nav button { display: none; }
  .main-nav button.active { display: flex; }
  .sidebar-foot { margin: 0; }
  .portal-note { display: none; }
  .main-area { padding: 0 14px 35px; }
  .topbar { min-height: 94px; }
  .topbar-actions .security-pill { display: none; }
  .hero-card { align-items: flex-start; flex-direction: column; padding: 29px; }
  .hero-action { width: 100%; }
  .stats-grid, .field-grid.two, .field-grid.three, .field-grid.four, .detail-grid { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .metric-cards { grid-template-columns: repeat(2,1fr); }
  .simple-process-panel, .analysis-form, .template-table-panel { padding: 20px; }
  .video-drop { min-height: 175px; }
  .template-dialog { width: calc(100vw - 12px); max-height: 96vh; border-radius: 14px; }
  .template-editor-dialog { height: calc(96vh - 88px); }
  .template-form-body { padding: 16px; }
  .template-form-section { padding: 17px; }
  .template-form-footer { align-items: stretch; flex-direction: column; padding: 13px 16px; }
  .template-form-footer > div { display: grid; grid-template-columns: 1fr 1fr; }
  .session-picker { grid-template-columns: 1fr; }
  .auth-card { padding: 30px 24px; }
  .talent-intake-form, .talent-verify-form { grid-template-columns: 1fr; }
  .talent-panel { padding: 20px; }
  .talent-upload-row { grid-template-columns: 1fr; }
  .talent-delivery-form { grid-template-columns: 1fr; }
  #page-tasks > .panel { padding: 18px; }
  #page-tasks .panel-head { flex-direction: column; gap: 18px; }
  #page-tasks .toolbar { width: 100%; }
  #page-tasks .toolbar select { flex: 1; min-width: 0; }
  .report-ready { align-items: stretch; flex-direction: column; }
}

.review-access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.review-access-card { padding: 26px; }
.review-access-card form { margin-top: 20px; }
.review-access-card fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.review-access-card legend { color: var(--muted); font-size: 14px; }
.review-wide { grid-column: 1 / -1; }
.review-check { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 400; margin-bottom: 10px; }
.review-check input { width: auto; flex: 0 0 auto; }
.review-login-note { margin-top: 20px; }
.sidebar-foot > button { margin-top: 12px; white-space: nowrap; }
.talent-record-actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
@media (min-width: 621px) and (max-width: 1360px) {
  .talent-workspace .app-shell { grid-template-columns: 160px minmax(0,1fr); }
  .talent-workspace .sidebar { width: 144px; }
  .talent-workspace .main-nav button { justify-content: flex-start; gap: 7px; font-size: 14px; }
}
@media (max-width: 900px) { .review-access-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .sidebar { flex-wrap: wrap; }
  .sidebar .main-nav { display: flex; width: 100%; margin: 0; overflow-x: auto; }
  .sidebar .main-nav button { display: flex; flex: 0 0 auto; font-size: 12px; gap: 5px; }
  .sidebar-foot > button { margin: 0; }
  .review-access-card { padding: 18px; }
}
