/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary:   #2563eb;
  --color-primary-h: #1d4ed8;
  --color-bg:        #ffffff;
  --color-surface:   #f8fafc;
  --color-border:    #e2e8f0;
  --color-text:      #1e293b;
  --color-muted:     #64748b;
  --color-success:   #16a34a;
  --radius:          10px;
  --shadow:          0 1px 3px rgba(0,0,0,.08);
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 14px 0;
  background: #fff;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
}
.logo { font-weight: 700; font-size: 1.2rem; color: var(--color-primary); }
.site-header nav a {
  margin-left: 20px;
  font-size: .9rem;
  color: var(--color-muted);
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.tool-hero, .home-hero {
  text-align: center;
  padding: 48px 0 32px;
}
.tool-hero h1, .home-hero h1 { font-size: 2rem; font-weight: 700; }
.tool-desc, .home-hero p {
  margin-top: 10px;
  color: var(--color-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin-left: auto; margin-right: auto;
}

/* ── Converter Box ────────────────────────────────────────────────────────── */
.tool-box {
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  margin-bottom: 40px;
  transition: border-color .2s;
}
.tool-box.drag-over { border-color: var(--color-primary); }

.drop-inner svg { color: var(--color-muted); margin-bottom: 12px; }
.drop-inner p   { font-size: 1rem; color: var(--color-muted); margin-bottom: 8px; }
.drop-inner span { font-size: .85rem; color: var(--color-muted); display: block; margin: 6px 0; }
.hint { font-size: .8rem !important; margin-top: 8px !important; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-upload {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: .95rem;
  cursor: pointer;
  transition: background .15s;
}
.btn-upload:hover { background: var(--color-primary-h); text-decoration: none; }

.btn-download {
  display: inline-block;
  background: var(--color-success);
  color: #fff;
  padding: 12px 32px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
}
.btn-download:hover { opacity: .9; text-decoration: none; }

.btn-reset {
  display: block;
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  padding: 8px 20px;
  border-radius: var(--radius);
  font-size: .85rem;
  cursor: pointer;
  margin: 8px auto 0;
}
.btn-reset:hover { background: var(--color-border); }

/* ── Progress ─────────────────────────────────────────────────────────────── */
.progress-wrap { margin: 20px auto; max-width: 400px; }
.progress-bar {
  height: 6px;
  background: var(--color-primary);
  border-radius: 3px;
  width: 0%;
  transition: width .3s;
}
#progressMsg { margin-top: 10px; font-size: .9rem; color: var(--color-muted); }

/* ── Result ───────────────────────────────────────────────────────────────── */
.result-ok { color: var(--color-success); font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── SEO Content ──────────────────────────────────────────────────────────── */
.how-to, .faq, .related-tools, .all-tools {
  margin: 48px 0;
}
.how-to h2, .faq h2, .related-tools h2, .all-tools h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.how-to ol { padding-left: 24px; }
.how-to li { margin-bottom: 8px; }

/* FAQ */
details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
summary {
  padding: 14px 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary::after { content: '+'; font-size: 1.2rem; color: var(--color-muted); }
details[open] summary::after { content: '−'; }
details p { padding: 0 16px 14px; color: var(--color-muted); }

/* ── Tools Grid ───────────────────────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: box-shadow .15s, border-color .15s;
}
.tool-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.tool-card strong { font-size: 1rem; color: var(--color-text); }
.tool-card span   { font-size: .83rem; color: var(--color-muted); }

/* ── Ads ──────────────────────────────────────────────────────────────────── */
.ad-slot { margin: 32px 0; text-align: center; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  margin-top: 60px;
  font-size: .875rem;
  color: var(--color-muted);
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer nav a { margin-left: 16px; color: var(--color-muted); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .tool-hero h1, .home-hero h1 { font-size: 1.5rem; }
  .site-footer .container { flex-direction: column; text-align: center; }
  .site-footer nav a { margin: 0 8px; }
}
