* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
body {
    background: #ffffff;
    color: #1e293b;
    line-height: 1.6;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}
.flex { display: flex; }
.gap-4 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.justify-center { justify-content: center; }
.text-sm { font-size: 0.875rem; }
.text-slate-600 { color: #475569; }
.my-4 { margin: 1rem 0; }
.mt-12 { margin-top: 3rem; }

.site-header {
    padding: 2rem 0;
    text-align: center;
}
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0d9488;
    margin-bottom: 1rem;
}
h1 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    color: #0f172a;
}
.subtitle {
    font-size: 1.125rem;
    color: #475569;
    max-width: 700px;
    margin: 0 auto;
}
.trust-badges span {
    padding: 0.3rem 0.6rem;
    font-size: 1rem;
}

.upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    margin-bottom: 1.5rem;
}
.upload-zone:hover { border-color: #0d9488; }
.upload-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: #0d9488;
}
.upload-note {
    font-size: 0.95rem;
    color: #64748b;
    margin-top: 0.5rem;
}
.file-stats {
    text-align: center;
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 1rem;
}
.upload-error {
    color: #dc2626;
    text-align: center;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}
.target-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.control-panel {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}
.control-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.control-group label { font-weight: 500; font-size: 0.95rem; }
.control-group select, .control-group input {
    padding: 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
}
#qualitySlider { width: 100%; }

.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: #0d9488;
    width: 0%;
    transition: width 0.2s;
}

.progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0d9488;
    min-width: 40px;
    text-align: right;
}

.download-all-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}
.generating-text {
    color: #64748b;
    font-size: 0.95rem;
}
.clear-queue-btn,
.download-all-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 1.6rem;
    min-height: 42px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    box-sizing: border-box;
    transition: background 0.2s;
}
.clear-queue-btn {
    background: #ef4444;
    color: white;
}
.clear-queue-btn:hover { background: #dc2626; }
.download-all-btn {
    background: #0d9488;
    color: white;
}
.download-all-btn:hover { background: #0b7d74; }
.generating-text {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 0.5rem;
    border: 1px dashed #cbd5e1;
    box-sizing: border-box;
    min-height: 40px;
    line-height: 1.25;
    animation: pulse-opacity 1.2s ease-in-out infinite;
}
@keyframes pulse-opacity {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    vertical-align: middle;
}

.ad-slot {
    min-height: 90px;
    margin: 1.5rem auto;
    max-width: 728px;
    width: 100%;
    text-align: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}

.results-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}
.result-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}
.result-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
}
.result-preview-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.result-preview img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 6px;
}
.size-label-orig {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
}
.size-label-comp {
    font-size: 0.8rem;
    color: #059669;
    text-align: center;
    font-weight: 500;
}
.result-info {
    padding: 1rem;
    font-size: 0.95rem;
}
.result-info p { margin: 0.25rem 0; }
.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.75rem;
    background: #0d9488;
    color: white;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    margin-top: 0.5rem;
    transition: background 0.2s;
}
.download-btn:hover { background: #0b7d74; }

.how-it-works, .seo-content, .faq-section { margin-bottom: 3rem; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 2rem; }
.step h3 { color: #0d9488; margin-bottom: 0.5rem; }
details {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}
summary { cursor: pointer; font-weight: 500; }

.site-footer {
    text-align: center;
    padding: 2rem 0;
    color: #64748b;
    font-size: 0.875rem;
}
.footer-note { margin-top: 0.5rem; }

@media (max-width: 640px) {
    h1 { font-size: 1.75rem; }
    .upload-zone { padding: 1.2rem 1rem; }
    .control-row { grid-template-columns: 1fr; }
}
.clear-queue-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: #ef4444;
    color: white;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

/* Spinner动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
}
.clear-queue-btn:hover { background: #dc2626; }
/* Homepage tools directory */
.tools-directory {
  padding: 48px 0 64px;
  background: #ffffff;
}

.tools-directory .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.tool-group {
  margin-bottom: 34px;
}

.tool-group h2 {
  font-size: 28px;
  line-height: 1.25;
  color: #0f172a;
  margin-bottom: 8px;
  font-weight: 800;
}

.tool-group p {
  font-size: 16px;
  line-height: 1.7;
  color: #475569;
  margin-bottom: 18px;
}

.tool-link-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.tool-link-grid a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #dbeafe;
  color: #020617;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
}

.tool-link-grid a:hover {
  background: #14b8a6;
  border-color: #14b8a6;
  color: #ffffff;
  transform: translateY(-1px);
}

.blog-group {
  margin-top: 48px;
}

@media (max-width: 768px) {
  .tools-directory {
    padding: 36px 0 48px;
  }

  .tool-group {
    margin-bottom: 28px;
  }

  .tool-group h2 {
    font-size: 24px;
  }

  .tool-group p {
    font-size: 15px;
  }

  .tool-link-grid {
    gap: 10px;
  }

.tool-link-grid a {
    width: auto;
    justify-content: center;
    font-size: 15px;
    padding: 12px 16px;
    white-space: nowrap;
}
.faq-section .container,
.faq .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
/* Fine tune homepage tool directory alignment */
.tools-directory .container {
  padding-left: 0;
  padding-right: 0;
  transform: translateX(-16px);
}
.footer-links {
  margin: 10px 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  text-decoration: underline;
}
/* Back To Home Button */
.back-home {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 48px auto 28px;
  text-align: center;
}

.back-home a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: #f1f5f9;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  color: #0f766e;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: all 0.2s ease;
}

.back-home a:hover {
  background: #ccfbf1;
  transform: translateY(-1px);
}
/* Unify Related Tools buttons style */
.related-tools {
  padding: 48px 0;
  text-align: center;
}

.related-tools h2 {
  font-size: 36px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 36px;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.related-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 18px;

    border: 1px solid #14b8a6;
    border-radius: 14px;
    background: #ffffff;

    color: #0f9f9a;
    text-decoration: none;

    font-size: 16px;
    font-weight: 400;
    line-height: 1;

    white-space: nowrap;

    transition: all 0.2s ease;
}

.related-links a:hover {
  background: #ccfbf1;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .related-tools h2 {
    font-size: 28px;
  }

  .related-links {
    gap: 14px;
  }

.related-links a {
    width: auto;
    min-width: 0;
    min-height: auto;
    font-size: 14px;
    padding: 8px 16px;
    white-space: nowrap;
}
/* Auto-fit Popular Use Cases buttons */
.use-cases-grid,
.popular-use-cases-grid,
.use-case-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    align-items: center !important;
}

.use-cases-grid a,
.popular-use-cases-grid a,
.use-case-list a,
.use-case-card {
    width: auto !important;
    min-width: 0 !important;
    min-height: auto !important;
    max-width: fit-content !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 10px 18px !important;
    white-space: nowrap !important;
}
/* Force auto-fit buttons for Popular Use Cases */
.popular-use-cases a,
.use-cases a,
.use-case-grid a,
.use-cases-grid a,
.tools-grid a,
.card-grid a,
.keyword-grid a,
.keyword-links a {
    width: auto !important;
    min-width: 0 !important;
    min-height: auto !important;
    max-width: fit-content !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 10px 18px !important;
    white-space: nowrap !important;
}
.popular-use-cases,
.use-cases,
.use-case-grid,
.use-cases-grid,
.tools-grid,
.card-grid,
.keyword-grid,
.keyword-links {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    align-items: center !important;
}
/* Unify footer layout */
footer,
.site-footer {
    text-align: center !important;
}

footer p:first-child,
.site-footer p:first-child {
    margin-bottom: 8px !important;
}

footer nav,
.site-footer nav,
footer .footer-links,
.site-footer .footer-links {
    margin: 8px 0 !important;
}

footer p:last-child,
.site-footer p:last-child {
    margin-top: 8px !important;
}

footer a,
.site-footer a {
    margin: 0 8px !important;
    color: inherit !important;
    text-decoration: none !important;
}
/* Footer links style - same as homepage */
.site-footer a,
footer a {
    color: blue !important;
    text-decoration: underline !important;
}

.site-footer a:hover,
footer a:hover {
    opacity: 0.85;
}
/* Unified Related Tools + Back Home layout */
.related-tools {
    padding: 56px 0 64px !important;
    text-align: center !important;
}

.related-tools h2 {
    font-size: 36px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-bottom: 36px !important;
}

.related-links {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 20px !important;
}

.related-links a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: auto !important;
    min-width: 0 !important;
    min-height: auto !important;

    padding: 10px 18px !important;

    border: 1px solid #14b8a6 !important;
    border-radius: 14px !important;
    background: #ffffff !important;

    color: #0f9f9a !important;
    text-decoration: none !important;

    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

.home-back-wrap {
    text-align: center !important;
    margin: 48px 0 32px !important;
}

.home-back-wrap .back-home-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;

    padding: 18px 32px !important;
    border-radius: 12px !important;
    border: 1px solid #dbe4ee !important;
    background: #f1f5f9 !important;

    color: #0f9f9a !important;
    text-decoration: none !important;

    font-size: 24px !important;
    font-weight: 400 !important;
}
.related-tools {
    padding: 56px 0 64px !important;
    text-align: center !important;
}

.related-tools h2 {
    font-size: 36px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-bottom: 36px !important;
}

.related-links,
.related-links-fixed {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 20px !important;
}

.related-links a,
.related-links-fixed a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: auto !important;
    padding: 10px 18px !important;
    border: 1px solid #14b8a6 !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: #0f9f9a !important;
    text-decoration: none !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    white-space: nowrap !important;
}
/* Fix KB pages Related Tools + Back to Home */
.related-tools h2 {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-bottom: 32px !important;
}

.related-links {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 20px !important;
}

.related-links a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: auto !important;
    min-width: 0 !important;
    min-height: auto !important;

    padding: 10px 18px !important;
    border: 1px solid #14b8a6 !important;
    border-radius: 14px !important;
    background: #ffffff !important;

    color: #0f9f9a !important;
    text-decoration: none !important;

    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

/* Force old Back to Home link into button style */
a[href="/"]:has(svg),
a[href="/"].back-home,
.back-home,
.back-home-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;

    padding: 18px 32px !important;
    border-radius: 12px !important;
    border: 1px solid #dbe4ee !important;
    background: #f1f5f9 !important;

    color: #0f9f9a !important;
    text-decoration: none !important;

    font-size: 24px !important;
    font-weight: 400 !important;
}

.home-back-wrap,
.home-back-wrap {
    text-align: center !important;
    margin: 48px 0 32px !important;
}{
    text-align: center !important;
    margin: 48px 0 32px !important;
}
/* ===== FINAL FORCE FIX ===== */

/* Related Tools 按钮最终样式 */
.related-tools {
    text-align: center !important;
    margin-top: 60px !important;
}

.related-tools h2 {
    font-size: 56px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-bottom: 36px !important;
}

.related-tools .related-links,
.related-links-fixed {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 24px !important;
}

.related-tools .related-links a,
.related-links-fixed a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 16px 30px !important;

    border: 1px solid #14b8a6 !important;
    border-radius: 12px !important;

    background: #ffffff !important;

    color: #0d9488 !important;
    text-decoration: none !important;

    font-size: 16px !important;
    font-weight: 500 !important;

    line-height: 1.2 !important;
    white-space: nowrap !important;

    transition: all .2s ease !important;
}

.related-tools .related-links a:hover,
.related-links-fixed a:hover {
    background: #f0fdfa !important;
}

/* Back to Home 最终样式 */
.home-back-wrap {
    text-align: center !important;
    margin: 56px 0 40px !important;
}

.home-back-wrap a,
.back-home-btn,
.back-home {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;

    padding: 18px 36px !important;

    border: 1px solid #dbe4ee !important;
    border-radius: 14px !important;

    background: #f1f5f9 !important;

    color: #0d9488 !important;
    text-decoration: none !important;

    font-size: 20px !important;
    font-weight: 500 !important;

    transition: all .2s ease !important;
}

.home-back-wrap a:hover,
.back-home-btn:hover,
.back-home:hover {
    background: #e2e8f0 !important;
}