:root {
  --ink: #172033;
  --muted: #5d687b;
  --soft: #f5f8fb;
  --surface: #ffffff;
  --line: #d7e0ea;
  --line-strong: #b8c6d6;
  --teal: #087f84;
  --teal-dark: #05666b;
  --teal-soft: #e7f8f7;
  --amber: #b56b08;
  --amber-soft: #fff4df;
  --danger: #a33a2f;
  --shadow: 0 18px 40px rgba(29, 43, 68, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #fbfcfe 0, #f6f9fc 520px, #ffffff 1000px);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto;
  align-items: center;
  gap: 28px;
  min-height: 66px;
  padding: 12px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: var(--muted);
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
}

.brand strong {
  color: var(--teal);
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.main-nav {
  display: flex;
  gap: 28px;
  color: #273449;
  font-weight: 650;
}

.main-nav a:hover {
  color: var(--teal);
}

.page-shell {
  width: min(1380px, calc(100vw - 44px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 32px;
  align-items: start;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.58;
}

.privacy-note {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.note-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 900;
}

.privacy-note strong {
  display: block;
  margin-bottom: 5px;
}

.privacy-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.converter-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.72fr);
  gap: 18px;
  align-items: stretch;
}

.tool-panel,
.results-panel,
.info-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tool-panel {
  padding: 18px;
}

.dropzone {
  position: relative;
  display: grid;
  min-height: 292px;
  place-items: center;
  padding: 28px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(8, 127, 132, 0.04), rgba(181, 107, 8, 0.035)),
    #fbfdff;
  text-align: center;
}

.dropzone.is-dragging {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal);
  font-size: 34px;
  font-weight: 500;
}

.dropzone h2 {
  margin: 0;
  font-size: 23px;
}

.dropzone p {
  max-width: 540px;
  margin: 8px 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.drop-meta {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.primary-button,
.secondary-button,
.download-button,
.remove-button {
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  padding: 0 18px;
  background: var(--teal);
  color: #fff;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.secondary-button,
.download-button,
.remove-button {
  padding: 0 14px;
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.secondary-button:disabled {
  cursor: not-allowed;
  color: #8995a7;
  background: #f1f4f7;
}

.download-button {
  color: var(--teal);
}

.remove-button {
  width: 38px;
  padding: 0;
  color: var(--danger);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
  gap: 18px;
  padding: 20px 4px 10px;
}

.range-field,
.color-field {
  display: grid;
  gap: 10px;
}

.range-field span,
.color-field span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

output {
  display: inline-grid;
  min-width: 42px;
  place-items: center;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 13px;
}

input[type="range"] {
  accent-color: var(--teal);
}

input[type="color"] {
  width: 86px;
  height: 42px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}

small {
  color: var(--muted);
  line-height: 1.45;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 12px;
}

.convert-button {
  min-width: 160px;
  background: var(--amber);
}

.convert-button:hover {
  background: #935604;
}

.status-line {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.results-panel {
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
  min-height: 520px;
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 24px;
}

#result-count {
  display: inline-grid;
  min-width: 28px;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 14px;
}

.output-format {
  display: inline-grid;
  min-width: 54px;
  min-height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 900;
}

.result-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.empty-state {
  display: grid;
  min-height: 230px;
  place-items: center;
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state span {
  display: grid;
  width: 62px;
  height: 46px;
  place-items: center;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.result-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.preview-thumb {
  display: block;
  inline-size: 86px;
  block-size: 62px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  object-fit: contain;
}

.result-meta {
  min-width: 0;
}

.result-meta strong,
.result-meta span {
  display: block;
  overflow-wrap: anywhere;
}

.result-meta span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.result-error {
  border-color: #e7b8b0;
  background: #fff7f6;
}

.limitation-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #ecd39b;
  border-radius: var(--radius);
  background: var(--amber-soft);
}

.limitation-box p {
  margin: 5px 0 0;
  color: #60440f;
  line-height: 1.5;
}

.support-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.converter-workspace > *,
.support-layout > * {
  min-width: 0;
}

.info-panel {
  padding: 22px;
}

.info-panel h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.info-panel p {
  color: var(--muted);
  line-height: 1.64;
}

.step-list {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.step-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
}

.step-list li > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.step-list p {
  margin: 4px 0 0;
}

.example-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.example-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1.2fr;
}

.example-row span {
  min-width: 0;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.example-row:last-child span {
  border-bottom: 0;
}

.example-head {
  background: #eef5f7;
  color: #314155;
  font-weight: 850;
}

.checklist {
  display: grid;
  gap: 9px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.faq-list {
  display: grid;
  gap: 8px;
}

.faq-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: auto;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
}

.faq-answer {
  display: none;
  margin: -4px 0 8px;
  padding: 0 14px 12px;
  color: var(--muted);
  line-height: 1.55;
}

.faq-answer.is-open {
  display: block;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 7px;
  background: #172033;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(8, 127, 132, 0.28);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .site-header,
  .hero,
  .converter-workspace,
  .support-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .main-nav {
    justify-content: start;
    flex-wrap: wrap;
  }

  .results-panel {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .site-header {
    position: static;
  }

  .brand {
    white-space: normal;
  }

  .main-nav {
    gap: 14px;
    font-size: 14px;
  }

  .page-shell {
    width: min(100vw - 24px, 1380px);
    padding-top: 22px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .tool-panel,
  .results-panel,
  .info-panel {
    padding: 14px;
  }

  .dropzone {
    min-height: 248px;
    padding: 20px 14px;
  }

  .action-row,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .download-button {
    width: auto;
  }

  .result-row {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .preview-thumb {
    inline-size: 74px;
    block-size: 58px;
  }

  .result-actions {
    grid-column: 1 / -1;
  }

  .example-table {
    overflow-x: auto;
  }

  .example-row {
    min-width: 680px;
  }
}
