:root {
  --bg: #0d1117;
  --bg-panel: #161b22;
  --bg-input: #0a0e14;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --accent: #58a6ff;
  --accent-2: #3fb950;
  --error: #f85149;
  --radius: 10px;
  --mono: ui-monospace, "Cascadia Code", "Fira Code", Menlo, Consolas, monospace;
  --sans: -apple-system, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

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

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.site-header nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.site-header nav a { color: var(--text-dim); font-size: .9rem; }
.site-header nav a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero { text-align: center; padding: 3rem 0 2rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0 0 .5rem; }
.accent { color: var(--accent); }
.sub { color: var(--text-dim); max-width: 620px; margin: 0 auto; }

/* Converter */
.converter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 860px) { .converter { grid-template-columns: 1fr; } }

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 340px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.panel-head label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  font-weight: 600;
}
.panel-actions { display: flex; gap: .5rem; align-items: center; }

textarea {
  flex: 1;
  width: 100%;
  resize: vertical;
  min-height: 260px;
  padding: 1rem;
  border: none;
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--mono);
  font-size: .88rem;
  line-height: 1.55;
  outline: none;
}

pre.code {
  flex: 1;
  margin: 0;
  padding: 1rem;
  overflow: auto;
  min-height: 260px;
  background: var(--bg-input);
  font-family: var(--mono);
  font-size: .88rem;
  line-height: 1.55;
  white-space: pre;
}

.status {
  padding: .35rem .9rem .55rem;
  font-size: .8rem;
  color: var(--text-dim);
  font-family: var(--mono);
}
.status.error { color: var(--error); }

/* Buttons & controls */
.btn {
  font: inherit;
  font-size: .85rem;
  padding: .38rem .85rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
  background: transparent;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: #238636; border-color: #2ea043; font-weight: 600; }
.btn-primary:hover { background: #2ea043; }
.btn-ghost:hover { color: var(--text); }
.btn-lg { font-size: 1rem; padding: .65rem 1.5rem; display: inline-block; }

select {
  font: inherit;
  font-size: .85rem;
  padding: .38rem .5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 3.5rem 0;
}
.feature {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.feature h3 { margin: 0 0 .5rem; font-size: 1rem; }
.feature p { margin: 0; color: var(--text-dim); font-size: .92rem; }

/* Pro */
.pro {
  text-align: center;
  background: linear-gradient(180deg, #161b22 0%, #0d1117 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
}
.pro ul {
  list-style: none;
  padding: 0;
  margin: 1rem auto 1.5rem;
  max-width: 420px;
  text-align: left;
}
.pro li { padding: .3rem 0; }
.pro .note { color: var(--text-dim); font-size: .85rem; margin-top: 1rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: .85rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: .75rem; }

/* Reference / article pages */
.article { max-width: 860px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.article h1 { margin-bottom: .5rem; }
.article .lede { color: var(--text-dim); font-size: 1.05rem; }
.article table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .9rem; }
.article th, .article td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--border); }
.article th { color: var(--text-dim); font-weight: 600; background: var(--bg-panel); position: sticky; top: 57px; }
.article td:first-child { font-family: var(--mono); color: var(--accent); white-space: nowrap; }
.article .table-wrap { max-height: 70vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.article .table-wrap table { margin: 0; }
.article code { font-family: var(--mono); background: var(--bg-panel); padding: .1rem .35rem; border-radius: 4px; font-size: .9em; }
