:root {
  --page-bg: #f6f7f8;
  --surface: #ffffff;
  --surface-soft: #fbfbfb;
  --text-primary: #111827;
  --text-muted: #6b7280;
  --line-color: #e5e7eb;
  --accent: #6b7280;
  --accent-hover: #4b5563;
  --action: #2563eb;
  --action-hover: #1d4ed8;
  --action-active: #1e40af;
  --action-shadow: rgba(37, 99, 235, 0.24);
}
body {
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.96), rgba(246, 247, 248, 0.96) 48%), var(--page-bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.navbar-clean {
  background-color: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.92);
}
.navbar-clean .navbar-brand {
  color: var(--text-primary);
}
.page-main {
  flex: 1 0 auto;
  padding-top: 5.4rem;
  padding-bottom: 4rem;
}
.page-shell {
  margin-top: 5rem;
  padding-bottom: 3rem;
  flex: 1 0 auto;
}
.section-card,
.card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(229, 231, 235, 0.88) !important;
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.06) !important;
}
.section-card {
  border-radius: 24px;
}
.section-muted,
.helper-text {
  color: var(--text-muted);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.section-card {
  padding: 1.35rem;
}
.page-icon {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #eff6ff;
  color: var(--action);
  font-size: 1.35rem;
}
.empty-404 {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
}
.footer-muted-link {
  color: var(--text-primary);
  text-decoration: none;
}
.footer-muted-link:hover {
  color: var(--action);
  text-decoration: none;
}
.bi {
  line-height: 1;
  vertical-align: -0.125em;
}
.card-header {
  background: transparent !important;
  border-bottom-color: var(--line-color) !important;
}
.card-header-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.upload-area {
  border: 1px dashed #cfd4dc;
  border-radius: 12px;
  padding: 0.85rem;
  min-height: 96px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}
.upload-area:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
}
.upload-area-inner {
  width: 100%;
}
.upload-icon {
  font-size: 1.5rem;
  color: var(--text-primary);
}
.action-btn,
.btn-dark {
  background-color: var(--action) !important;
  border-color: var(--action) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px var(--action-shadow);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
.action-btn:hover,
.btn-dark:hover {
  background-color: var(--action-hover) !important;
  border-color: var(--action-hover) !important;
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}
.action-btn:focus,
.action-btn:focus-visible,
.btn-dark:focus,
.btn-dark:focus-visible {
  background-color: var(--action-hover) !important;
  border-color: var(--action-hover) !important;
  color: #fff !important;
  box-shadow:
    0 0 0 0.2rem rgba(37, 99, 235, 0.2),
    0 10px 24px var(--action-shadow);
}
.action-btn:active,
.action-btn.active,
.btn-dark:active,
.btn-dark.active,
.show > .btn-dark.dropdown-toggle {
  background-color: var(--action-active) !important;
  border-color: var(--action-active) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(30, 64, 175, 0.24) !important;
  transform: translateY(1px);
}
.form-label {
  font-weight: 600;
  color: var(--text-primary);
}
.form-select,
.btn-outline-secondary,
.form-check-input {
  border-color: #d1d5db;
}
.form-select:focus,
.btn-outline-secondary:focus,
.form-check-input:focus {
  border-color: #9ca3af;
  box-shadow: 0 0 0 0.2rem rgba(17, 24, 39, 0.08);
}
.btn-outline-secondary {
  color: var(--text-primary);
  background: #fff;
}
.btn-outline-secondary:hover {
  color: var(--text-primary);
  background: #f3f4f6;
  border-color: #c7cdd4;
}
.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}
.file-input-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.file-preview-card {
  border: 1px solid var(--line-color);
  border-radius: 12px;
  background: var(--surface);
  padding: 0.6rem 0.7rem;
  overflow: hidden;
}
.file-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.file-preview-head > div {
  min-width: 0;
}
.file-preview-head .btn {
  flex-shrink: 0;
  padding: 0.22rem 0.42rem;
  line-height: 1.1;
  white-space: nowrap;
}
.file-preview-name {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-preview-meta,
.result-file-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.file-preview-meta {
  margin-top: 0.1rem;
}
.file-list {
  display: grid;
  gap: 0.5rem;
  max-height: 240px;
  overflow-y: auto;
}
.file-list-item {
  border: 1px solid var(--line-color);
  border-radius: 10px;
  background: #fff;
  padding: 0.55rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.file-list-item.is-processing {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.file-list-item.is-success {
  background: #ecfdf5;
  border-color: #bbf7d0;
}
.file-list-item.is-failed {
  background: #fef2f2;
  border-color: #fecaca;
}
.file-list-name {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-list-thumb-icon {
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1;
}
.file-list-item > .file-list-thumb-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #dbe3ee;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-list-body {
  min-width: 0;
  flex: 1 1 auto;
}
.file-list-meta {
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}
.file-list-meta .badge {
  vertical-align: baseline;
}
.file-list-side-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  flex: 0 0 auto;
  align-self: center;
  justify-content: flex-end;
}
.file-list-side-actions .btn {
  padding: 0.2rem 0.62rem;
  line-height: 1.25;
  border-radius: 999px;
  white-space: nowrap;
}
.file-list-side-actions .btn:disabled {
  pointer-events: none;
}
.result-box {
  border: 1px solid var(--line-color);
  border-radius: 14px;
  background: var(--surface);
  padding: 0.8rem;
  overflow: hidden;
}
.result-file-name {
  display: block;
  max-width: 100%;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.55rem;
}
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.1rem;
}
.progress-track {
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(90deg, #eceff3 0%, #e5e7eb 100%);
}
#progressBar {
  background-color: var(--accent) !important;
  transition: width 0.28s ease;
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
}
.progress-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  min-height: 1.4rem;
}
.promo-tip .alert {
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
}
@media (max-width: 576px) {
  .page-main {
    padding-top: 5rem;
  }
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .file-preview-head {
    align-items: center;
  }
  .file-list-item {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .file-list-side-actions {
    width: 100%;
    margin-left: 0;
    padding-left: 3.25rem;
    justify-content: flex-start;
  }
}
