* { box-sizing: border-box; margin: 0; padding: 0; }

/* 初始可见区块由 <html data-auth> 决定，避免刷新瞬间闪现登录页；
   JS 接管后会移除 data-auth 属性，改由内联 style 控制显示 */
html[data-auth="in"] #authCard { display: none; }
html[data-auth="in"] #appMain { display: block; }
html[data-auth="out"] #authCard { display: flex; }
html[data-auth="out"] #appMain { display: none; }

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6fa;
  color: #222;
  line-height: 1.6;
}

/* ===== 登录页 ===== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  background: linear-gradient(135deg, #667eea 0%, #5b47d6 45%, #7b2ff7 100%);
  position: relative;
  overflow: hidden;
}
.auth-screen::before,
.auth-screen::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.35;
}
.auth-screen::before {
  width: 420px; height: 420px;
  background: radial-gradient(circle, #a78bfa, transparent 70%);
  top: -120px; left: -100px;
}
.auth-screen::after {
  width: 360px; height: 360px;
  background: radial-gradient(circle, #38bdf8, transparent 70%);
  bottom: -120px; right: -80px;
}

.auth-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  padding: 40px 36px 32px;
  box-shadow: 0 20px 50px rgba(31, 20, 90, 0.35);
  animation: authIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes authIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-logo {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  border-radius: 18px;
  background: linear-gradient(135deg, #6366f1, #7b2ff7);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.45);
}
.auth-title { font-size: 22px; color: #1e1b4b; font-weight: 700; }
.auth-subtitle { font-size: 13px; color: #6b7280; margin-top: 6px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f6f7fb;
  border: 1.5px solid #e5e7f0;
  border-radius: 12px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.field:focus-within {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
.field-icon { font-size: 16px; opacity: 0.7; }
.field input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: #1f2937;
}

.btn-primary {
  margin-top: 6px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #7b2ff7);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(99, 102, 241, 0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-outline {
  padding: 12px;
  font-size: 14px;
  letter-spacing: 1px;
  color: #6366f1;
  background: transparent;
  border: 1.5px solid #d7d9f0;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-outline:hover { background: #f0f0ff; border-color: #6366f1; }
.btn-outline:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-footer { position: relative; z-index: 1; color: rgba(255,255,255,0.75); font-size: 12px; }

.container {
  max-width: 960px;
  margin: 32px auto;
  padding: 0 16px;
}

h1 {
  font-size: 26px;
  margin-bottom: 20px;
  color: #1a2b48;
}

.app-title { font-size: 22px; margin: 0; }

h2 { font-size: 18px; margin-bottom: 14px; color: #2b3a55; }
h3 { font-size: 15px; margin: 18px 0 8px; color: #3a4a66; }

.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.upload-row,.query-row, .status-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.upload-progress {
  width: 100%;
  height: 8px;
  margin-top: 10px;
  background: #e6ebf2;
  border-radius: 6px;
  overflow: hidden;
}
.upload-progress-bar {
  width: 0%;
  height: 100%;
  background: #2f7cf6;
  transition: width 0.2s ease;
}

/* ===== 视频截取面板 ===== */
.picked-name { font-size: 13px; color: #667; }

.trim-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #e2e8f2;
  border-radius: 8px;
  background: #fafbfe;
}
.trim-video {
  width: 100%;
  max-height: 320px;
  background: #000;
  border-radius: 6px;
}
.trim-range { margin-top: 14px; }
.trim-track {
  position: relative;
  height: 32px;
}
/* 统一的底色轨道：画在容器上，两条 range 自身轨道透明，
   从根本上避免“一条 range 的轨道背景盖住另一条的 thumb”。 */
.trim-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 4px;
  background: #d7deea;
  pointer-events: none;
}
/* 两个 range 叠放，共同构成起止双滑块 */
.trim-slider {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  height: 32px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
}
#trimStart { z-index: 3; }
#trimEnd { z-index: 4; }
/* 正在操作的滑块提到最上层 */
.trim-slider.trim-active { z-index: 5; }
/* 原生轨道全透明，仅用容器上的 ::before 显示进度条底色 */
.trim-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 4px;
  background: transparent;
}
.trim-slider::-moz-range-track {
  height: 6px;
  border-radius: 4px;
  background: transparent;
}
.trim-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: #2f6bff;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  cursor: pointer;
  pointer-events: auto;
}
.trim-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2f6bff;
  border: 2px solid #fff;
  cursor: pointer;
  pointer-events: auto;
}
.trim-times {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 13px;
  color: #556;
}
.trim-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

input[type="file"], input[type="number"] {
  padding: 8px 10px;
  border: 1px solid #ccd3df;
  border-radius: 6px;
  font-size: 14px;
}

input[type="number"] { width: 180px; }

button {
  padding: 8px 18px;
  background: #2f6bff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover { background: #1d54e0; }
button:disabled { background: #9db4e6; cursor: not-allowed; }

.msg { margin-top: 12px; font-size: 14px; min-height: 20px; }
.msg.error { color: #d64545; }
.msg.success { color: #1a9e5b; }

.status-row span { margin-right: 20px; font-size: 14px; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: #fff;
  background: #999;
}
.badge.pending { background: #b58b00; }
.badge.processing { background: #2f6bff; }
.badge.done { background: #1a9e5b; }
.badge.failed { background: #d64545; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 13px;
}

th, td {
  border: 1px solid #e3e8f0;
  padding: 8px 10px;
  text-align: left;
}

th { background: #f0f3fa; color: #3a4a66; font-weight: 600; }
tbody tr:nth-child(even) { background: #fafbfe; }

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

button.ghost {
  background: #fff;
  color: #2f6bff;
  border: 1px solid #2f6bff;
  padding: 5px 12px;
  font-size: 13px;
}
button.ghost:hover { background: #eef3ff; }
button.ghost:disabled { color: #aab; border-color: #ccd3df; background: #f7f8fb; cursor: not-allowed; }

button.danger {
  background: #fff;
  color: #d64545;
  border: 1px solid #d64545;
  padding: 5px 12px;
  font-size: 13px;
}
button.danger:hover { background: #fdeeee; }

button.small-btn {
  padding: 4px 10px;
  font-size: 12px;
}

td.empty { text-align: center; color: #99a; padding: 18px; }

.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e3e8f0;
}
.user-bar .app-title { color: #1a2b48; font-weight: 700; }
.user-bar-right { display: flex; align-items: center; gap: 14px; font-size: 14px; }