/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #1f2937; background: #f8fafc; line-height: 1.6;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ===== Header ===== */
.site-header {
  background: #fff;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 20px;
}

/* 顶部品牌条 */
.header-brandbar {
  background: #0f172a; color: #94a3b8; font-size: .78rem;
}
.header-brandbar .header-inner { height: 32px; justify-content: space-between; }
.brand-tag { letter-spacing: .3px; }
.brand-right { display: flex; align-items: center; gap: 8px; }
.brand-right a { color: #cbd5e1; }
.brand-right .dot { color: #475569; }

/* 主 Logo 区 */
.header-main { background: #fff; border-bottom: 1px solid #e2e8f0; }
.header-main .header-inner { height: 68px; }
.logo {
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  text-decoration: none; flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-icon {
  width: 40px; height: 40px; background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text strong { font-size: 1.15rem; font-weight: 800; color: #0f172a; letter-spacing: -.5px; }
.logo-text small { font-size: .68rem; color: #94a3b8; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }

/* 搜索框 */
.search-box {
  position: relative; flex: 1; max-width: 560px; margin: 0 auto;
  display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 14px; color: #94a3b8; z-index: 1; pointer-events: none;
}
.search-box input {
  width: 100%; padding: 11px 16px 11px 42px; border: 1.5px solid #e2e8f0;
  border-radius: 10px; font-size: .92rem; outline: none; transition: all .2s;
  background: #f8fafc; color: #0f172a;
}
.search-box input:focus {
  border-color: #2563eb; background: #fff;
  box-shadow: 0 0 0 4px rgba(37,99,235,.08);
}
.search-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.14); max-height: 420px; overflow-y: auto;
  display: none; z-index: 300;
}
.search-dropdown.open { display: block; }
.search-dropdown a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 16px; color: #1f2937; font-size: .9rem;
  border-bottom: 1px solid #f1f5f9;
}
.search-dropdown a:hover { background: #eff6ff; text-decoration: none; }
.search-dropdown .cat { color: #2563eb; font-size: .76rem; white-space: nowrap; font-weight: 500; }
.search-empty { padding: 20px; color: #94a3b8; font-size: .88rem; text-align: center; }

/* 分类导航条 */
.header-nav { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.main-nav {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: flex; gap: 0; align-items: center; height: 46px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.main-nav a {
  padding: 8px 16px; color: #475569; font-weight: 500; font-size: .88rem;
  white-space: nowrap; transition: all .15s; flex-shrink: 0;
  border-bottom: 2px solid transparent; height: 46px; display: flex; align-items: center;
}
.main-nav a:hover {
  color: #2563eb; text-decoration: none; background: #eff6ff;
  border-bottom-color: #2563eb;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: #fff; padding: 60px 20px 80px; text-align: center;
}
.hero h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: 12px; }
.hero p { font-size: 1.1rem; opacity: .9; max-width: 640px; margin: 0 auto 32px; }

/* Upload dropzone */
.dropzone {
  max-width: 680px; margin: 0 auto; background: #fff; border-radius: 16px;
  padding: 36px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.18);
  border: 2px dashed #bfdbfe; transition: border .2s, background .2s;
  cursor: pointer;
}
.dropzone.dragover { border-color: #2563eb; background: #eff6ff; }
.dropzone-icon {
  width: 56px; height: 56px; margin: 0 auto 16px;
  background: #dbeafe; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.dropzone-icon svg { width: 28px; height: 28px; stroke: #2563eb; }
.dropzone h3 { color: #1f2937; font-size: 1.15rem; margin-bottom: 6px; }
.dropzone p { color: #6b7280; font-size: .9rem; margin-bottom: 16px; }
.dropzone .btn-browse {
  display: inline-block; background: #2563eb; color: #fff; padding: 10px 28px;
  border-radius: 8px; font-weight: 600; font-size: .95rem; border: none; cursor: pointer;
  transition: background .15s;
}
.dropzone .btn-browse:hover { background: #1d4ed8; text-decoration: none; }
.dropzone .hint { font-size: .8rem; color: #9ca3af; margin-top: 12px; }

/* ===== Container ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; flex: 1; }

/* ===== Section titles ===== */
.section { padding: 48px 0; }
.section-title {
  font-size: 1.6rem; font-weight: 700; color: #111827; margin-bottom: 8px;
}
.section-sub { color: #6b7280; margin-bottom: 28px; }

/* ===== Category cards ===== */
.cat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.cat-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 24px 20px; transition: transform .15s, box-shadow .15s;
  display: block; color: inherit;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(37,99,235,.1); text-decoration: none; border-color: #bfdbfe; }
.cat-card .cat-icon {
  width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; font-size: 1.3rem;
}
.cat-card h3 { font-size: 1.05rem; margin-bottom: 4px; color: #111827; }
.cat-card p { font-size: .82rem; color: #6b7280; }

/* ===== Popular conversions ===== */
.popular-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.popular-chip {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 20px;
  padding: 8px 18px; font-size: .88rem; color: #374151; transition: all .15s;
}
.popular-chip:hover { border-color: #2563eb; color: #2563eb; text-decoration: none; background: #eff6ff; }

/* ===== Features ===== */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: #fff; border-radius: 12px; padding: 24px; border: 1px solid #e5e7eb;
}
.feature .f-icon { font-size: 1.6rem; margin-bottom: 10px; }
.feature h4 { font-size: 1rem; margin-bottom: 6px; color: #111827; }
.feature p { font-size: .88rem; color: #6b7280; }

/* ===== Convert page ===== */
.convert-page { padding: 32px 0; }
.convert-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.convert-main {
  background: #fff; border-radius: 12px; padding: 28px; border: 1px solid #e5e7eb;
}
.convert-main h1 { font-size: 1.6rem; margin-bottom: 8px; color: #111827; }
.breadcrumb { font-size: .85rem; color: #6b7280; margin-bottom: 20px; }
.breadcrumb a { color: #6b7280; }

.format-pair {
  display: flex; align-items: center; gap: 16px; margin: 20px 0; flex-wrap: wrap;
}
.format-box {
  flex: 1; min-width: 160px;
}
.format-box label { display: block; font-size: .82rem; color: #6b7280; margin-bottom: 6px; font-weight: 600; }
.format-box select {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: .95rem; background: #fff; outline: none;
}
.format-box select:focus { border-color: #2563eb; }
.swap-btn {
  width: 40px; height: 40px; border-radius: 50%; background: #eff6ff; border: 1px solid #bfdbfe;
  cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
  color: #2563eb; flex-shrink: 0; margin-top: 22px;
}
.swap-btn:hover { background: #dbeafe; }

/* File list */
.file-list { margin: 16px 0; }
.file-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: #f9fafb; border-radius: 8px; margin-bottom: 8px; border: 1px solid #e5e7eb;
}
.file-item .f-icon {
  width: 36px; height: 36px; border-radius: 6px; background: #dbeafe; color: #1e40af;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .75rem;
  flex-shrink: 0;
}
.file-item .f-info { flex: 1; min-width: 0; }
.file-item .f-name { font-size: .9rem; font-weight: 500; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .f-meta { font-size: .78rem; color: #6b7280; }
.file-item .f-progress {
  height: 6px; background: #e5e7eb; border-radius: 3px; margin-top: 8px; overflow: hidden;
  position: relative;
}
.file-item .f-progress-bar {
  height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); width: 0;
  transition: width .3s ease; border-radius: 3px;
}
.file-item .f-progress-bar.animated {
  background: linear-gradient(90deg, #3b82f6, #2563eb, #3b82f6);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
.file-item .f-status { font-size: .78rem; padding: 2px 8px; border-radius: 4px; }
.f-status.done { background: #dcfce7; color: #166534; }
.f-status.error { background: #fee2e2; color: #991b1b; }
.f-status.converting { background: #dbeafe; color: #1e40af; }
.file-item .f-remove {
  background: none; border: none; color: #9ca3af; cursor: pointer; font-size: 1.1rem; padding: 4px;
}
.file-item .f-remove:hover { color: #ef4444; }

/* Convert button */
.btn-convert {
  width: 100%; padding: 14px; background: #2563eb; color: #fff; border: none;
  border-radius: 10px; font-size: 1.05rem; font-weight: 700; cursor: pointer; margin-top: 12px;
  transition: background .15s;
}
.btn-convert:hover:not(:disabled) { background: #1d4ed8; }
.btn-convert:disabled { background: #93c5fd; cursor: not-allowed; }

/* 按钮内转圈动画 */
.btn-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-download {
  display: inline-block; padding: 10px 24px; background: #16a34a; color: #fff;
  border-radius: 8px; font-weight: 600; margin-top: 8px;
}
.btn-download:hover { background: #15803d; text-decoration: none; }

/* Sidebar */
.convert-side { display: flex; flex-direction: column; gap: 16px; }
.side-box {
  background: #fff; border-radius: 12px; padding: 20px; border: 1px solid #e5e7eb;
}
.side-box h4 { font-size: .95rem; margin-bottom: 12px; color: #111827; }
.side-box ul { list-style: none; }
.side-box li { margin-bottom: 8px; }
.side-box li a { font-size: .88rem; color: #374151; }
.side-box li a:hover { color: #2563eb; }
.side-box .trust { font-size: .82rem; color: #6b7280; line-height: 1.8; }
.side-box .trust strong { color: #166534; }

/* SEO content */
.seo-content { margin-top: 32px; }
.seo-content h2 { font-size: 1.2rem; margin: 20px 0 10px; color: #111827; }
.seo-content p { color: #4b5563; margin-bottom: 12px; font-size: .95rem; }
.seo-content ol { margin: 12px 0 12px 24px; color: #4b5563; }
.seo-content ol li { margin-bottom: 8px; }
.faq { margin-top: 24px; }
.faq-item { border-bottom: 1px solid #e5e7eb; padding: 14px 0; }
.faq-item h4 { font-size: .95rem; color: #111827; margin-bottom: 6px; }
.faq-item p { font-size: .9rem; color: #6b7280; }

/* ===== Formats browser ===== */
.format-browser { padding: 32px 0; }
.format-group { margin-bottom: 28px; }
.format-group h2 {
  font-size: 1.2rem; padding-bottom: 8px; border-bottom: 2px solid #e5e7eb; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.format-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.format-tag {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; padding: 6px 14px;
  font-size: .85rem; color: #374151; transition: all .15s;
}
.format-tag:hover { border-color: #2563eb; color: #2563eb; text-decoration: none; background: #eff6ff; }

/* ===== Footer ===== */
.site-footer {
  background: #1f2937; color: #9ca3af; padding: 40px 20px 20px; margin-top: 48px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
}
.footer-inner h5 { color: #fff; font-size: .95rem; margin-bottom: 12px; }
.footer-inner ul { list-style: none; }
.footer-inner li { margin-bottom: 8px; }
.footer-inner a { color: #9ca3af; font-size: .85rem; }
.footer-inner a:hover { color: #fff; }
.footer-bottom {
  max-width: 1200px; margin: 24px auto 0; padding-top: 20px; border-top: 1px solid #374151;
  font-size: .8rem; text-align: center;
}

/* ===== Mobile ===== */
.mobile-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #374151; }
@media (max-width: 900px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: 1fr; }
  .convert-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .header-brandbar { display: none; }
  .search-box { display: none; }
  .mobile-toggle { display: block; margin-left: auto; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: #374151; }
  .main-nav { display: none; }
  .main-nav.open {
    display: flex; flex-direction: column; height: auto; padding: 8px 16px;
    overflow: visible; background: #fff;
  }
  .main-nav.open a { height: auto; padding: 12px 8px; border-bottom: 1px solid #f1f5f9; }
  .hero h1 { font-size: 1.7rem; }
}
@media (max-width: 560px) {
  .cat-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
