:root {
  --blue: #2458d3;
  --blue-dark: #173b9c;
  --blue-soft: #edf3ff;
  --ink: #13213a;
  --muted: #66738a;
  --line: #dbe3f0;
  --surface: #ffffff;
  --bg: #f6f8fc;
  --success: #15936d;
  --danger: #c83d4b;
  --shadow: 0 18px 50px rgba(35, 63, 121, 0.11);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  line-height: 1.65;
}

button, textarea { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.shell {
  width: min(1080px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(219, 227, 240, 0.85);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #3474f3, #173da8);
  font-size: 23px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(36, 88, 211, 0.25);
}

.brand strong, .brand small { display: block; line-height: 1.2; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }

nav { display: flex; align-items: center; gap: 28px; }
nav a { color: #56627a; text-decoration: none; font-size: 14px; transition: color .2s; }
nav a:hover, nav a.active { color: var(--blue); }

.hero {
  padding: 78px 0 34px;
  text-align: center;
}

.eyebrow, .section-kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1.13;
  letter-spacing: -.045em;
}

.hero p {
  max-width: 670px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 17px;
}

.ad-slot {
  margin-top: 22px;
  margin-bottom: 22px;
  overflow: hidden;
}

.ad-frame-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
}

.ad-frame {
  flex: 0 0 auto;
  width: calc(var(--ad-width) * 1px);
  height: calc(var(--ad-height) * 1px);
  transform-origin: top center;
}

.ad-frame[data-ad-width="728"] { --ad-width: 728; --ad-height: 90; }
.ad-frame[data-ad-width="468"] { --ad-width: 468; --ad-height: 60; }

.panel {
  border: 1px solid rgba(219, 227, 240, .9);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.converter { padding: 10px 0 26px; }
.converter-card { padding: 34px; }

.panel-heading, .result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.panel h2, .section-heading h2 { margin: 0; line-height: 1.25; font-size: 28px; letter-spacing: -.025em; }
.privacy-badge { flex: none; padding: 8px 12px; border-radius: 999px; color: #187356; background: #e9f8f1; font-size: 12px; font-weight: 650; }

.drop-zone {
  width: 100%;
  min-height: 224px;
  margin-top: 25px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  border: 1.5px dashed #9db4e8;
  border-radius: 17px;
  color: var(--ink);
  background: #f8faff;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}

.drop-zone:hover, .drop-zone.dragging { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-1px); }
.drop-zone strong { font-size: 17px; }
.drop-zone small { color: var(--muted); }

.upload-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 17px;
  color: var(--blue);
  background: #e5edff;
}

.upload-icon svg { width: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.file-card {
  margin-top: 18px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.file-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 800; }
.file-meta { min-width: 0; flex: 1; }
.file-meta strong, .file-meta span { display: block; }
.file-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta span { color: var(--muted); font-size: 13px; }

.icon-button { width: 36px; height: 36px; border: 0; border-radius: 50%; color: #7b879b; background: #f0f3f8; cursor: pointer; font-size: 22px; }
.icon-button:hover { color: var(--danger); background: #fff0f1; }

.primary-button, .secondary-button {
  border-radius: 11px;
  padding: 12px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  transition: transform .18s, box-shadow .18s, opacity .18s;
}

.primary-button { color: #fff; background: linear-gradient(135deg, #306cec, #1d49bb); box-shadow: 0 10px 24px rgba(36, 88, 211, .22); }
.primary-button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 13px 30px rgba(36, 88, 211, .3); }
.primary-button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
.converter-card > .primary-button { width: 100%; margin-top: 18px; }
.primary-button.compact, .secondary-button { padding: 10px 16px; font-size: 13px; }
.secondary-button { color: var(--blue); border-color: #cbd8f5; background: #fff; }
.secondary-button:hover { background: var(--blue-soft); }

.compatibility-note { margin: 14px 0 0; text-align: center; color: #8490a4; font-size: 12px; }
.status { margin-top: 17px; padding: 11px 14px; border-radius: 10px; background: #edf3ff; color: #244eaa; font-size: 13px; }
.status.error { background: #fff0f1; color: var(--danger); }
.status.success { background: #eaf8f3; color: var(--success); }

.result-panel { margin-top: 24px; padding: 30px; }
.section-kicker.success { color: var(--success); }
.result-actions { display: flex; gap: 10px; }
.result-tabs { display: flex; gap: 20px; margin-top: 24px; border-bottom: 1px solid var(--line); }
.tab-button { padding: 10px 2px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; cursor: pointer; }
.tab-button.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 700; }
.tab-content { margin-top: 18px; }
#preview-frame { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
#html-code { width: 100%; min-height: 520px; padding: 18px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; color: #23324d; background: #f7f9fc; font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.info-section { padding: 86px 0 92px; }
.section-heading { text-align: center; }
.feature-grid { margin-top: 36px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { position: relative; overflow: hidden; min-height: 220px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.feature-card h3 { margin: 31px 0 9px; font-size: 18px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 14px; }
.feature-number { position: absolute; right: 20px; top: 14px; color: #e7edfa; font-size: 52px; font-weight: 800; line-height: 1; }

.steps-section { padding: 82px 0; color: #fff; background: #122858; }
.section-heading.light h2 { color: #fff; }
.section-heading.light .section-kicker { color: #94b5ff; }
.steps-grid { margin: 42px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; list-style: none; }
.steps-grid li { display: flex; align-items: flex-start; gap: 15px; }
.steps-grid li > span { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #bdd0ff; background: rgba(255,255,255,.11); font-weight: 800; }
.steps-grid strong { font-size: 17px; }
.steps-grid p { margin: 4px 0 0; color: #b9c6e3; font-size: 14px; }

footer { border-top: 1px solid var(--line); background: #fff; }
.footer-wrap { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 24px; color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1080px); }
  .nav-wrap { min-height: 64px; }
  nav a:not(.active) { display: none; }
  .hero { padding-top: 56px; }
  .hero p { font-size: 15px; }
  .converter-card, .result-panel { padding: 20px; border-radius: 17px; }
  .panel-heading, .result-header { align-items: flex-start; flex-direction: column; }
  .privacy-badge { align-self: flex-start; }
  .drop-zone { min-height: 196px; padding: 22px 14px; }
  .drop-zone strong { text-align: center; font-size: 15px; }
  .result-actions { width: 100%; }
  .result-actions button { flex: 1; }
  #preview-frame, #html-code { min-height: 420px; height: 420px; }
  .info-section { padding: 64px 0; }
  .feature-grid, .steps-grid { grid-template-columns: 1fr; }
  .steps-section { padding: 64px 0; }
  .footer-wrap { padding: 22px 0; align-items: flex-start; flex-direction: column; gap: 4px; }
  .footer-wrap p { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
