* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f4f5f7;
  color: #1c1e21;
}
.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 24px;
  margin-bottom: 20px;
}
.login-card {
  width: 360px;
}
h1 { margin: 0 0 4px; font-size: 24px; }
h2 { margin: 0 0 16px; font-size: 18px; }
.subtitle { color: #666; font-size: 13px; margin-bottom: 20px; }
label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 12px;
}
input, textarea {
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
button, .btn {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { background: #1d4ed8; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.alert {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-ok { background: #dcfce7; color: #166534; }
.nav {
  display: flex;
  align-items: center;
  background: #fff;
  padding: 12px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.nav-brand { font-weight: 700; margin-right: 32px; }
.nav-links a { margin-right: 16px; color: #333; text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: #2563eb; }
.nav-logout { margin-left: auto; }
.nav-logout button { background: #eee; color: #333; padding: 6px 12px; font-size: 13px; }
.container { max-width: 820px; margin: 24px auto; padding: 0 16px; }
.hint { color: #666; font-size: 13px; }
.video-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.video-table th, .video-table td { text-align: left; padding: 8px; border-bottom: 1px solid #eee; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eee;
  color: #444;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef9c3; color: #854d0e; }
.badge-skipped { background: #f1f1f1; color: #888; }
.err-msg { color: #dc2626; font-size: 12px; margin-left: 6px; cursor: help; }
.status-line { font-size: 13px; margin-bottom: 12px; }
details { margin-bottom: 16px; font-size: 13px; }
summary { cursor: pointer; font-weight: 600; color: #2563eb; margin-bottom: 8px; }
.guide { padding-left: 20px; line-height: 1.7; }
.guide code { background: #f1f1f1; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { flex: 1; min-width: 220px; }
.action-row { margin-top: 12px; display: flex; gap: 10px; }
.notice-card { background: #fffbeb; border: 1px solid #fde68a; }
.edit-panel { border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; margin-bottom: 12px; background: #fafafa; }
.preview-wrap { display: flex; justify-content: center; margin-bottom: 16px; }
.preview-frame { position: relative; width: 100%; max-width: 320px; background: #000; border-radius: 6px; overflow: hidden; }
.preview-frame video { display: block; width: 100%; max-height: 400px; }
.crop-overlay { position: absolute; border: 2px solid #22c55e; box-shadow: 0 0 0 2000px rgba(0,0,0,0.45); pointer-events: none; }
.timeline-wrap { margin-bottom: 16px; }
.timeline-time-label { display: flex; align-items: baseline; gap: 10px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.timeline-hint { font-weight: 400; color: #888; font-size: 12px; }
.filmstrip-wrap {
  position: relative;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.filmstrip-wrap canvas { display: block; width: 100%; height: 56px; }
.trim-overlay { position: absolute; inset: 0; }
.trim-shade { position: absolute; top: 0; bottom: 0; background: rgba(0, 0, 0, 0.55); }
.trim-shade-left { left: 0; }
.trim-shade-right { right: 0; }
.trim-window {
  position: absolute;
  top: 0;
  bottom: 0;
  border-top: 2px solid #fff;
  border-bottom: 2px solid #fff;
  box-sizing: border-box;
  cursor: grab;
}
.trim-window:active { cursor: grabbing; }
.trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  margin-left: -7px;
  background: #fff;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  z-index: 2;
}
.trim-handle span { width: 3px; height: 18px; background: #999; border-radius: 2px; }
.notice-card h2 { color: #92400e; }
.notice-card .guide li { margin-bottom: 8px; }
.notice-card code { background: #fff3c4; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
