:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #1b2521;
  --muted: #66736d;
  --line: #dce3df;
  --line-strong: #c5d0ca;
  --brand: #167a55;
  --brand-strong: #0d6041;
  --brand-soft: #e8f5ef;
  --blue: #2865a8;
  --blue-soft: #eaf2fb;
  --amber: #9a6700;
  --amber-soft: #fff5d8;
  --red: #b33b32;
  --red-soft: #fcecea;
  --shadow: 0 12px 32px rgba(22, 42, 33, 0.08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(22, 122, 85, 0.42);
  outline-offset: 2px;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 14px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.btn-primary:hover {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}

.btn-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
}

.btn-secondary:hover,
.icon-btn:hover {
  border-color: #9eada6;
  background: var(--surface-soft);
}

.btn-ghost {
  color: var(--muted);
}

.btn-ghost:hover {
  background: #edf1ef;
  color: var(--ink);
}

.btn-danger {
  border-color: #ecc3be;
  background: var(--surface);
  color: var(--red);
}

.btn-danger:hover {
  background: var(--red-soft);
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: 228px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #18231e;
  color: #dbe7e0;
}

.brand {
  display: flex;
  height: 68px;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 20px;
}

.brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  content: "";
}

.brand-mark::before {
  inset: 6px;
  border: 2px solid #7ad6ae;
  border-radius: 50%;
}

.brand-mark::after {
  top: 13px;
  left: 3px;
  width: 22px;
  border-top: 1px solid #ffffff;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  color: #ffffff;
  font-size: 16px;
}

.brand-copy span {
  margin-top: 2px;
  color: #90a69b;
  font-size: 11px;
}

.side-nav {
  flex: 1;
  padding: 18px 12px;
}

.side-label {
  margin: 0 8px 8px;
  color: #71877c;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  padding: 0 12px;
  color: #b9c9c0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 620;
}

.nav-item.active,
.nav-item:hover {
  background: #27362f;
  color: #ffffff;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 12px;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 6px;
  padding: 9px 10px;
  color: #90a69b;
  font-size: 13px;
  text-decoration: none;
}

.sidebar-footer a:hover {
  background: #27362f;
  color: #ffffff;
}

.app-main {
  min-height: 100vh;
  margin-left: 228px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 30px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.mobile-menu {
  display: none;
}

.crumbs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.crumbs strong {
  overflow: hidden;
  color: var(--ink);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-wrap {
  position: relative;
}

.account-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 6px;
  padding: 6px 8px;
  background: transparent;
  color: var(--ink);
}

.account-trigger:hover {
  background: var(--surface-soft);
}

.avatar-sm {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #d9eee4;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 750;
}

.account-name {
  font-size: 13px;
  font-weight: 650;
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 190px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dropdown-info {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.dropdown-info strong,
.dropdown-info span {
  display: block;
}

.dropdown-info strong {
  font-size: 13px;
}

.dropdown-info span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.dropdown button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 11px 14px;
  background: transparent;
  color: var(--red);
  font-size: 13px;
  text-align: left;
}

.dropdown button:hover {
  background: var(--red-soft);
}

.page {
  width: min(100% - 60px, 1240px);
  margin: 0 auto;
  padding: 34px 0 64px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-title h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 720;
  line-height: 1.25;
}

.page-title p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 22px;
  background: var(--surface);
}

.stat-item {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 17px 20px;
}

.stat-item:last-child {
  border-right: 0;
}

.stat-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat-item strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.field-shell {
  position: relative;
  min-width: 0;
}

.field-shell .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  color: #84918b;
  pointer-events: none;
  transform: translateY(-50%);
}

.field-shell input,
.select-control,
.text-control {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.field-shell input {
  width: 260px;
  padding: 0 12px 0 38px;
}

.select-control {
  min-width: 148px;
  padding: 0 34px 0 12px;
}

.list-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.role-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(160px, 0.85fr) 110px 156px 100px 38px;
  align-items: center;
  gap: 18px;
  min-height: 98px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.role-row:last-child {
  border-bottom: 0;
}

.role-row:hover {
  background: #fbfcfb;
}

.role-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.role-cover {
  position: relative;
  width: 66px;
  height: 66px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 6px;
  background: #d8dfdb;
}

.role-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.role-cover::after {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 8px;
  height: 8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--brand);
  content: "";
}

.role-copy {
  min-width: 0;
}

.role-copy a {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 680;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-copy a:hover {
  color: var(--brand-strong);
}

.role-copy span,
.data-copy span,
.data-copy small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.role-copy span {
  overflow: hidden;
  margin-top: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-copy {
  min-width: 0;
}

.data-copy strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-copy span,
.data-copy small {
  margin-top: 5px;
}

.mini-meter {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  margin-top: 8px;
  background: #e8edeb;
}

.mini-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
}

.badge::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.badge-success {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.badge-progress {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-error {
  background: var(--red-soft);
  color: var(--red);
}

.more-btn {
  border-color: transparent;
  background: transparent;
}

.empty-state {
  padding: 70px 20px;
  text-align: center;
}

.empty-state .empty-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 50%;
  margin: 0 auto 14px;
  background: var(--brand-soft);
  color: var(--brand);
}

.empty-state h3 {
  margin: 0;
  font-size: 16px;
}

.empty-state p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(250px, 1fr);
  gap: 26px;
  align-items: start;
}

.form-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.form-section {
  border-bottom: 1px solid var(--line);
  padding: 24px;
}

.form-section:last-child {
  border-bottom: 0;
}

.form-section h2 {
  margin: 0 0 5px;
  font-size: 16px;
}

.form-section > p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.form-field + .form-field {
  margin-top: 20px;
}

.form-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 650;
}

.required {
  margin-left: 3px;
  color: var(--red);
}

.text-control {
  height: 42px;
  padding: 0 12px;
}

textarea.text-control {
  min-height: 94px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}

.field-hint,
.field-error {
  margin: 7px 0 0;
  font-size: 12px;
}

.field-hint {
  color: var(--muted);
}

.field-error {
  color: var(--red);
}

.upload-zone {
  position: relative;
  display: grid;
  min-height: 210px;
  place-items: center;
  border: 1px dashed #9fb1a8;
  border-radius: 8px;
  padding: 24px;
  background: var(--surface-soft);
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.upload-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  margin: 0 auto 12px;
  background: #dcece4;
  color: var(--brand);
}

.upload-zone strong {
  display: block;
  font-size: 14px;
}

.upload-zone p {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.selected-file {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: var(--surface);
  text-align: left;
}

.selected-file .file-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
}

.selected-file-copy {
  min-width: 0;
  flex: 1;
}

.selected-file-copy strong,
.selected-file-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-copy strong {
  font-size: 13px;
}

.selected-file-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 18px 24px;
  background: #fbfcfb;
}

.flow-note {
  position: sticky;
  top: 92px;
  border-left: 2px solid var(--brand);
  padding: 2px 0 2px 18px;
}

.flow-note h2 {
  margin: 0 0 14px;
  font-size: 14px;
}

.flow-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.flow-list b {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand-strong);
  font-size: 11px;
}

.flow-list strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 13px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  padding-bottom: 26px;
}

.detail-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.detail-avatar {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background: #d8dfdb;
}

.detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-title {
  min-width: 0;
}

.detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.detail-title h1 {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 25px;
}

.detail-title p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}

.workflow-step {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 18px 6px 18px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  border: 0;
  background: transparent;
}

.workflow-step::after {
  position: absolute;
  right: 12px;
  left: 34px;
  bottom: -1px;
  height: 2px;
  background: var(--line);
  content: "";
}

.workflow-step:last-child::after {
  right: 0;
}

.workflow-step.done,
.workflow-step.active {
  color: var(--ink);
  font-weight: 650;
}

.workflow-step.done::after {
  background: var(--brand);
}

.workflow-step.active::after {
  background: linear-gradient(90deg, var(--brand) 0 72%, var(--line) 72%);
}

.step-dot {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
}

.workflow-step.done .step-dot,
.workflow-step.active .step-dot {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.detail-section {
  scroll-margin-top: 88px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 34px;
}

.detail-section + .detail-section {
  padding-top: 34px;
}

.detail-section:last-child {
  border-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
}

.section-title {
  display: flex;
  min-width: 0;
  gap: 12px;
}

.section-number {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #e7ece9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.section-title h2 {
  margin: 2px 0 0;
  font-size: 17px;
}

.section-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.65fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.media-frame {
  position: relative;
  height: 360px;
  min-height: 0;
  overflow: hidden;
  background: #121714;
}

.media-frame img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center 25%;
  opacity: 0.88;
}

.media-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.1);
}

.play-btn {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  background: rgba(12, 20, 16, 0.72);
  color: #ffffff;
  backdrop-filter: blur(8px);
}

.media-time {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border-radius: 4px;
  padding: 4px 7px;
  background: rgba(0, 0, 0, 0.68);
  color: #ffffff;
  font-size: 11px;
}

.source-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 22px;
}

.source-meta h3 {
  overflow: hidden;
  margin: 0;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-meta > p {
  margin: 7px 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.metadata-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 12px;
  margin: 0;
}

.metadata-list div {
  min-width: 0;
}

.metadata-list dt {
  color: var(--muted);
  font-size: 11px;
}

.metadata-list dd {
  overflow: hidden;
  margin: 5px 0 0;
  font-size: 13px;
  font-weight: 630;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding-top: 18px;
}

.source-status span {
  color: var(--muted);
  font-size: 12px;
}

.fixed-frame-band {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border: 1px solid #b9d9ca;
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  padding: 16px;
  background: #f5fbf8;
}

.fixed-frame-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #d8dfdb;
}

.fixed-frame-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.fixed-frame-copy h3 {
  margin: 0;
  font-size: 15px;
}

.fixed-frame-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.clip-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.clip-card.is-source {
  border-color: #65a98a;
  box-shadow: 0 0 0 1px #65a98a;
}

.clip-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1b2521;
}

.clip-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clip-preview.pos-1 img { object-position: center 12%; }
.clip-preview.pos-2 img { object-position: center 25%; transform: scale(1.07); }
.clip-preview.pos-3 img { object-position: center 37%; transform: scale(1.11); }
.clip-preview.pos-4 img { object-position: center 18%; transform: scale(1.05); }
.clip-preview.pos-5 img { object-position: center 29%; transform: scale(1.13); }
.clip-preview.pos-6 img { object-position: center 20%; transform: scale(1.09); }

.clip-preview::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.5));
  content: "";
  pointer-events: none;
}

.clip-index,
.clip-duration,
.frame-label {
  position: absolute;
  z-index: 2;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 10px;
  font-weight: 700;
}

.clip-index {
  top: 9px;
  left: 9px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.clip-duration {
  right: 9px;
  bottom: 9px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
}

.clip-play {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  margin: auto;
  background: rgba(14, 22, 18, 0.62);
  color: #ffffff;
  opacity: 0;
  transition: opacity 160ms ease;
}

.clip-card:hover .clip-play {
  opacity: 1;
}

.clip-body {
  padding: 12px;
}

.clip-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.clip-title-row strong {
  font-size: 13px;
}

.clip-body p {
  overflow: hidden;
  margin: 5px 0 11px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.clip-actions .btn {
  min-height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}

.source-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 680;
}

.generate-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  padding: 18px 20px;
  background: var(--surface);
}

.generate-summary {
  min-width: 0;
}

.generate-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.generate-title strong {
  font-size: 14px;
}

.generate-summary p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  margin-top: 14px;
  background: #e8edeb;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 300ms ease;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.result-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.frame-compare {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  background: #e6ebe8;
}

.frame-shot {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #1c2521;
}

.frame-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.frame-shot:nth-child(2) img {
  transform: scale(1.04);
}

.frame-label {
  right: 5px;
  bottom: 5px;
  background: rgba(0, 0, 0, 0.67);
  color: #ffffff;
}

.result-body {
  padding: 12px;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-head strong {
  font-size: 13px;
}

.result-meta {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 11px;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.result-actions .btn,
.result-actions .icon-btn {
  min-height: 32px;
  height: 32px;
  padding: 5px 9px;
  font-size: 12px;
}

.result-actions .icon-btn {
  width: 32px;
}

.failed-preview {
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  background: #f8eeee;
  color: var(--red);
}

.failed-preview .icon {
  width: 28px;
  height: 28px;
}

.failed-copy {
  margin: 7px 0 11px;
  color: var(--red);
  font-size: 11px;
  line-height: 1.5;
}

.login-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(320px, 0.92fr) minmax(500px, 1.08fr);
  background: var(--surface);
}

.login-panel {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding: 56px clamp(32px, 7vw, 108px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 58px;
}

.login-brand .brand-mark {
  border-color: #65766e;
}

.login-brand .brand-copy strong {
  color: var(--ink);
}

.login-brand .brand-copy span {
  color: var(--muted);
}

.login-copy h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1.2;
}

.login-copy p {
  margin: 10px 0 28px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.password-shell {
  position: relative;
}

.password-shell .text-control {
  padding-right: 44px;
}

.password-shell button {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.login-footnote {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.login-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #18231e;
}

.login-visual img {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  object-fit: cover;
  object-position: center 20%;
  opacity: 0.73;
}

.login-visual::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14, 23, 19, 0.04), rgba(14, 23, 19, 0.8));
  content: "";
}

.visual-copy {
  position: absolute;
  z-index: 1;
  right: 48px;
  bottom: 48px;
  left: 48px;
  max-width: 520px;
  color: #ffffff;
}

.visual-copy span {
  display: block;
  margin-bottom: 10px;
  color: #a5d4bd;
  font-size: 12px;
  font-weight: 700;
}

.visual-copy h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.35;
}

.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 22, 18, 0.52);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(100%, 520px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.modal-wide {
  width: min(100%, 860px);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}

.modal-header h2 {
  margin: 0;
  font-size: 17px;
}

.modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.modal-close {
  flex: 0 0 auto;
  border-color: transparent;
  background: transparent;
}

.modal-body {
  padding: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding: 15px 20px;
  background: #fbfcfb;
}

.confirm-frame {
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 16px;
  background: #1b2521;
}

.confirm-frame img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  object-position: center 18%;
}

.confirm-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.confirm-meta div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.confirm-meta span,
.confirm-meta strong {
  display: block;
}

.confirm-meta span {
  color: var(--muted);
  font-size: 11px;
}

.confirm-meta strong {
  margin-top: 5px;
  font-size: 13px;
}

.warning-box {
  display: flex;
  gap: 10px;
  border: 1px solid #edcf8b;
  border-radius: 6px;
  margin-top: 14px;
  padding: 12px;
  background: var(--amber-soft);
  color: #6e4a00;
  font-size: 12px;
  line-height: 1.6;
}

.video-modal-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #151b18;
}

.video-modal-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.video-modal-frame .media-overlay {
  color: #ffffff;
}

.toast-stack {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: min(360px, calc(100% - 44px));
  gap: 10px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 6px;
  padding: 13px 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.5;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  border-left-color: var(--red);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.prototype-ribbon {
  position: fixed;
  z-index: 60;
  right: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(24, 35, 30, 0.88);
  color: #ffffff;
  font-size: 11px;
  text-decoration: none;
  backdrop-filter: blur(8px);
}

.prototype-ribbon:hover {
  background: #18231e;
}

@media (max-width: 1100px) {
  .role-row {
    grid-template-columns: minmax(230px, 1.25fr) minmax(140px, 0.8fr) 100px 120px 38px;
  }

  .role-row .generated-column {
    display: none;
  }

  .video-grid,
  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(250px, 0.85fr);
  }
}

@media (max-width: 840px) {
  .sidebar {
    width: 212px;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.22);
  }

  .app-main {
    margin-left: 0;
  }

  .mobile-menu {
    display: inline-grid;
  }

  .topbar {
    padding: 0 18px;
  }

  .topbar-left {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
  }

  .page {
    width: min(100% - 36px, 1240px);
  }

  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-item:nth-child(2) {
    border-right: 0;
  }

  .stat-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .role-row {
    grid-template-columns: minmax(230px, 1fr) 128px 38px;
  }

  .role-row .video-column,
  .role-row .updated-column,
  .role-row .generated-column {
    display: none;
  }

  .form-layout {
    grid-template-columns: 1fr;
  }

  .flow-note {
    position: static;
    order: -1;
  }

  .source-layout {
    grid-template-columns: 1fr;
  }

  .media-frame,
  .media-frame img {
    height: 300px;
    min-height: 0;
  }

  .fixed-frame-band {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .fixed-frame-band .btn {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .login-view {
    grid-template-columns: 1fr;
  }

  .login-panel {
    min-height: 100vh;
  }

  .login-visual {
    display: none;
  }
}

@media (max-width: 620px) {
  .topbar {
    height: 60px;
  }

  .account-name,
  .account-trigger > .icon {
    display: none;
  }

  .page {
    width: min(100% - 28px, 1240px);
    padding-top: 24px;
  }

  .page-header,
  .detail-hero,
  .section-heading,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header,
  .detail-hero {
    display: flex;
  }

  .header-actions,
  .detail-actions,
  .section-actions {
    width: 100%;
  }

  .header-actions .btn,
  .detail-actions .btn,
  .section-actions .btn {
    flex: 1;
  }

  .toolbar-group {
    width: 100%;
  }

  .toolbar-group:first-child {
    align-items: stretch;
    flex-direction: column;
  }

  .field-shell,
  .field-shell input,
  .select-control {
    width: 100%;
  }

  .stats-strip {
    grid-template-columns: 1fr 1fr;
  }

  .stat-item {
    padding: 14px;
  }

  .stat-item strong {
    font-size: 20px;
  }

  .role-row {
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 10px;
    min-height: 88px;
    padding: 11px 12px;
  }

  .role-row .status-column,
  .role-row .video-column,
  .role-row .updated-column,
  .role-row .generated-column {
    display: none;
  }

  .role-cover {
    width: 58px;
    height: 58px;
  }

  .role-copy a,
  .role-copy span {
    white-space: normal;
  }

  .form-section,
  .form-actions {
    padding-right: 16px;
    padding-left: 16px;
  }

  .form-actions .btn {
    flex: 1;
  }

  .workflow {
    overflow: visible;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .fixed-frame-band {
    grid-template-columns: 1fr;
  }

  .fixed-frame-image {
    aspect-ratio: 16 / 8;
  }

  .fixed-frame-band .btn {
    grid-column: auto;
  }

  .generate-panel {
    grid-template-columns: 1fr;
  }

  .generate-panel .btn {
    width: 100%;
  }

  .media-frame,
  .media-frame img {
    height: 220px;
    min-height: 0;
  }

  .login-panel {
    padding: 36px 22px;
  }

  .login-brand {
    margin-bottom: 44px;
  }

  .login-copy h1 {
    font-size: 25px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 90vh;
    border-radius: 8px 8px 0 0;
  }

  .confirm-meta {
    grid-template-columns: 1fr;
  }

  .prototype-ribbon {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
