:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #14213d;
  --muted: #5f6b7a;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #dbe3ef;
  --success: #15803d;
  --danger: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.navbar {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.nav-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--primary);
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero {
  text-align: center;
  padding: 54px 0 28px;
}

h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  margin: 0 0 16px;
}

.subtitle {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 18px;
}

.converter-card,
.content-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(20, 33, 61, 0.06);
}

.converter-card {
  padding: clamp(20px, 4vw, 34px);
  margin: 24px 0 34px;
}

.converter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 24px;
  align-items: stretch;
}

.drop-zone {
  min-height: 245px;
  width: 100%;
  border: 2px dashed #bfd0ea;
  border-radius: 22px;
  padding: 36px 24px;
  text-align: center;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: #eff6ff;
  transform: translateY(-1px);
}

.upload-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #e8f0ff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
}

.drop-zone strong {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text);
}

.drop-zone span {
  color: var(--muted);
  font-size: 15px;
}

.browse-btn {
  margin-top: 18px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
}

input[type="file"] {
  display: none;
}

.side-panel {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fbfdff;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.side-panel h2 {
  font-size: 20px;
  margin: 0 0 6px;
}

.side-panel p,
.content-section p,
.content-section li {
  color: var(--muted);
}

.settings {
  display: grid;
  gap: 12px;
  color: var(--muted);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
}

.settings input {
  width: 100%;
  accent-color: var(--primary);
}

.quality-help {
  font-size: 13px;
  color: var(--muted);
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button,
.download-link,
.tool-link {
  border: none;
  border-radius: 999px;
  padding: 13px 22px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
}

.download-link,
.tool-link {
  background: var(--primary);
  color: #fff;
}

.download-link:hover,
.tool-link:hover {
  background: var(--primary-dark);
}

.secondary-btn {
  width: 100%;
  background: #eef2f7;
  color: var(--text);
}

.status {
  margin-top: 22px;
  text-align: center;
  min-height: 26px;
  font-weight: 700;
  white-space: pre-line;
}

.status.success {
  color: var(--success);
}

.status.error {
  color: var(--danger);
}

.status.info {
  color: var(--muted);
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.result-item {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}

.result-item img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #f5f7fb;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.file-name {
  margin: 12px 0;
  font-size: 14px;
  color: var(--muted);
  word-break: break-word;
}

.content-section {
  padding: 26px;
  margin: 24px 0;
}

.content-section h2 {
  margin-top: 0;
  font-size: 26px;
  line-height: 1.2;
}

.content-section h3 {
  margin-bottom: 6px;
}

.faq details {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}

.faq summary {
  font-weight: 700;
  cursor: pointer;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.tool-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: #fbfdff;
}

.site-footer {
  margin-top: 36px;
  padding: 36px 20px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.footer-nav a:hover {
  color: var(--primary);
}

.footer-note {
  max-width: 720px;
  margin: 0 auto;
}

@media (max-width: 760px) {
  .navbar {
    justify-content: center;
    text-align: center;
  }

  .nav-links {
    justify-content: center;
  }

  .converter-grid {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    min-height: 220px;
    padding: 30px 16px;
  }

  .side-panel {
    padding: 18px;
  }
}