/* TuTu 转换工具 · 页面样式 */

/* ========== 整页无滚动条 ========== */
body.convert-page {
  overflow: hidden;
}

body.convert-page .admin-main {
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.convert-page .admin-main::-webkit-scrollbar {
  display: none;
}

body.convert-page .admin-content {
  flex: 1;
  min-height: 0;
  max-width: none;
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.convert-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

@media (max-width: 960px) {
  body.convert-page .admin-main {
    overflow-y: auto;
    scrollbar-width: none;
  }
  body.convert-page .admin-main::-webkit-scrollbar {
    display: none;
  }
  body.convert-page .admin-content {
    overflow: visible;
    height: auto;
  }
  .convert-layout {
    grid-template-columns: 1fr;
    flex: none;
  }
}

/* ========== 卡片 ========== */
.convert-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.convert-card-head {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.convert-card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding-left: 0;
  border-left: none;
}

.convert-card-head p {
  margin: 0.25rem 0 0;
  font-size: 12px;
  color: var(--muted-foreground);
}

.convert-card-body {
  padding: 1.25rem;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.convert-card-body::-webkit-scrollbar {
  display: none;
}

.convert-card--side .convert-card-body {
  padding: 1rem 1.25rem 1.25rem;
  overflow: hidden;
}

/* ========== 上传区 ========== */
.convert-dropzone {
  border: 1.5px dashed var(--input);
  border-radius: calc(var(--radius) - 2px);
  padding: 2rem 1.25rem;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(180deg, var(--muted) 0%, rgba(245, 245, 243, 0.4) 100%);
  transition:
    border-color 0.25s var(--ease-out-expo, ease),
    background 0.25s ease,
    box-shadow 0.25s ease;
  flex-shrink: 0;
}

.convert-dropzone:hover,
.convert-dropzone.is-dragover {
  border-color: hsl(221 83% 53%);
  background: hsl(221 83% 53% / 0.05);
  box-shadow: 0 8px 24px hsl(221 83% 53% / 0.08);
}

.convert-dropzone.has-file {
  border-style: solid;
  border-color: hsl(142 72% 36% / 0.35);
  background: hsl(142 76% 96% / 0.6);
}

.convert-dropzone-icon {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: var(--background);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  transition: transform 0.3s ease, color 0.2s ease, background 0.2s ease;
}

.convert-dropzone.has-file .convert-dropzone-icon {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.convert-dropzone-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.convert-dropzone strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--foreground);
  word-break: break-all;
}

.convert-dropzone p {
  font-size: 12px;
  color: var(--muted-foreground);
  margin: 0;
}

.convert-dropzone input[type="file"] {
  display: none;
}

.convert-actions {
  display: flex;
  gap: 0.625rem;
  margin-top: 1rem;
  flex-shrink: 0;
}

.convert-actions .btn {
  flex: 1;
  min-width: 0;
}

/* ========== 进度 ========== */
.convert-progress {
  display: none;
  margin-top: 1.25rem;
  flex-shrink: 0;
}

.convert-progress.is-active {
  display: block;
  animation: convertFadeIn 0.35s ease;
}

@keyframes convertFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.convert-overall {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.convert-overall strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.convert-bar {
  height: 6px;
  background: var(--muted);
  border-radius: 999px;
  overflow: hidden;
}

.convert-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  transition: width 0.35s ease;
}

.convert-bar-fill.is-done {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.convert-bar-fill.is-error {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

/* ========== 横向步骤条 ========== */
.convert-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 1.125rem;
  position: relative;
  gap: 0.25rem;
}

.convert-stepper::before {
  content: "";
  position: absolute;
  top: 0.875rem;
  left: 12%;
  right: 12%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.convert-stepper-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  position: relative;
  z-index: 1;
  opacity: 0.4;
  transition: opacity 0.25s ease;
}

.convert-stepper-item.is-active,
.convert-stepper-item.is-done,
.convert-stepper-item.is-failed {
  opacity: 1;
}

.convert-stepper-dot {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--background);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-foreground);
  transition: all 0.25s ease;
}

.convert-stepper-item.is-active .convert-stepper-dot {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 0 0 4px hsl(221 83% 53% / 0.15);
}

.convert-stepper-item.is-done .convert-stepper-dot {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}

.convert-stepper-item.is-failed .convert-stepper-dot {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}

.convert-stepper-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
  text-align: center;
  line-height: 1.3;
}

.convert-stepper-item.is-active .convert-stepper-label {
  color: #2563eb;
  font-weight: 600;
}

.convert-stepper-item.is-done .convert-stepper-label {
  color: #16a34a;
}

.convert-status-line {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 12px;
  color: var(--muted-foreground);
  background: var(--muted);
  border-radius: calc(var(--radius) - 4px);
  text-align: center;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.convert-status-line.is-active {
  color: hsl(221 50% 35%);
  background: hsl(221 83% 53% / 0.08);
}

.convert-status-line.is-done {
  color: hsl(142 50% 28%);
  background: hsl(142 76% 96%);
}

.convert-status-line.is-error {
  color: hsl(0 60% 40%);
  background: hsl(0 86% 97%);
}

/* 兼容旧 JS：隐藏步骤内嵌元素 */
.convert-stepper-item [data-bar],
.convert-stepper-item [data-pct],
.convert-stepper-item [data-desc] {
  display: none !important;
}

/* ========== 结果提示 ========== */
.convert-result {
  display: none;
  margin-top: 1rem;
  flex-shrink: 0;
}

.convert-result.alert-success {
  background: hsl(142 76% 96%);
  border-color: hsl(142 72% 36% / 0.25);
}

.convert-result .alert-body a {
  color: #16a34a;
  font-weight: 600;
}

/* ========== 右侧说明 ========== */
.convert-help-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  flex-shrink: 0;
}

.convert-help-steps li {
  display: flex;
  gap: 0.625rem;
  padding: 0.5rem 0;
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.55;
  border-bottom: 1px solid var(--border);
}

.convert-help-steps li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.convert-help-num {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--muted);
  color: var(--foreground);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.convert-help-steps code {
  font-size: 11px;
  background: var(--muted);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.convert-broadcast-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  padding-top: 0.875rem;
}

.convert-broadcast-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.convert-broadcast {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.convert-broadcast::-webkit-scrollbar {
  display: none;
}

.convert-broadcast.is-show {
  display: block;
}

.convert-broadcast-item {
  position: relative;
  padding: 0.4375rem 0.625rem 0.4375rem 1rem;
  margin-bottom: 0.25rem;
  font-size: 12px;
  color: var(--muted-foreground);
  background: transparent;
  border-radius: calc(var(--radius) - 4px);
  line-height: 1.45;
}

.convert-broadcast-item::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.72rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--input);
}

.convert-broadcast-item:last-child {
  color: var(--foreground);
  font-weight: 500;
  background: hsl(221 83% 53% / 0.06);
}

.convert-broadcast-item:last-child::before {
  background: #2563eb;
}

.convert-broadcast-empty {
  font-size: 12px;
  color: var(--muted-foreground);
  opacity: 0.65;
  padding: 0.25rem 0;
}
