:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --danger: #b91c1c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.04);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

.header {
  text-align: center;
  margin-bottom: 28px;
}

.header h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.convert-bar {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}

.url-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 1rem;
  box-shadow: var(--shadow);
}

.url-input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  border-color: var(--blue);
}

.convert-btn {
  height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.convert-btn:hover:not(:disabled) {
  background: var(--blue-hover);
}

.convert-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.status {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.95rem;
}

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

.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 420px;
}

.panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 420px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}

.panel-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.download-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.download-btn:hover:not(:disabled) {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.download-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.panel-body {
  flex: 1;
  margin: 0;
  padding: 16px 18px;
  overflow: auto;
}

.placeholder {
  color: var(--muted);
  margin: 0;
}

.markdown-source {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.prose :first-child {
  margin-top: 0;
}

.prose h1,
.prose h2,
.prose h3 {
  line-height: 1.25;
}

.prose pre {
  background: #f3f4f6;
  padding: 12px;
  border-radius: 8px;
  overflow: auto;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

.prose a {
  color: var(--blue);
}

@media (max-width: 840px) {
  .convert-bar {
    flex-direction: column;
  }

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