:root {
  --bg: #ffffff;
  --bg-sub: #f6f8fa;
  --fg: #1f2328;
  --muted: #656d76;
  --border: #d0d7de;
  --accent: #0969da;
  --accent-fg: #ffffff;
  --error-bg: #ffebe9;
  --error-fg: #cf222e;
  --code-bg: #f6f8fa;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-sub: #161b22;
    --fg: #e6edf3;
    --muted: #8b949e;
    --border: #30363d;
    --accent: #2f81f7;
    --accent-fg: #ffffff;
    --error-bg: #2d1418;
    --error-fg: #ff7b72;
    --code-bg: #161b22;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--bg-sub);
  position: sticky; top: 0; z-index: 10;
}
header.site .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 700; font-size: 1.15rem; color: var(--fg); }
.logo span { color: var(--accent); }
nav.site a { margin-left: 18px; color: var(--muted); font-size: 0.95rem; }
nav.site a:hover { color: var(--fg); text-decoration: none; }

main { padding: 36px 0 60px; }
h1 { font-size: 2rem; margin: 0 0 8px; }
.subtitle { color: var(--muted); margin: 0 0 28px; font-size: 1.05rem; }

.converter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.pane { display: flex; flex-direction: column; min-width: 0; }
.pane-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; font-size: 0.85rem; color: var(--muted);
}
.pane-head .actions { display: flex; gap: 6px; }
textarea {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  padding: 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  tab-size: 2;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
#output { background: var(--bg); }

.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-sub);
  color: var(--fg);
  padding: 8px 14px;
  border-radius: 8px;
}
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button:hover { filter: brightness(0.97); }
#error {
  background: var(--error-bg);
  color: var(--error-fg);
  border: 1px solid var(--error-fg);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--muted);
  background: var(--bg-sub); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 20px;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #2da44e; }

section.doc { margin-top: 44px; }
section.doc h2 { font-size: 1.4rem; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
section.doc h3 { font-size: 1.05rem; margin-top: 24px; }
section.doc code {
  background: var(--code-bg); padding: 2px 6px; border-radius: 6px;
  font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.9em;
}
.faq { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq details { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: none; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 10px 0 0; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--bg-sub); }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

footer.site { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88rem; padding: 24px 0; }
footer.site .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

@media (max-width: 720px) {
  .converter { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
}
