﻿:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e2ef;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --soft: #eef4ff;
  --code: #111827;
  --radius: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top left, #dbeafe 0, transparent 32rem), var(--bg);
  color: var(--text);
}

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0; }
.hero { display: grid; grid-template-columns: 1fr minmax(240px, 340px); gap: 20px; align-items: stretch; margin-bottom: 20px; }
.hero h1 { margin: 6px 0 10px; font-size: clamp(30px, 5vw, 52px); line-height: 1.05; }
.subtitle { margin: 0; color: var(--muted); font-size: 18px; max-width: 760px; }
.eyebrow { margin: 0; color: var(--primary); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.privacy-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--soft); border: 1px solid #bfdbfe; border-radius: var(--radius); color: #1e3a8a; }

.panel { background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 16px 40px rgba(15, 23, 42, .08); }
.upload-panel { margin-bottom: 20px; }
.drop-zone { display: grid; place-items: center; gap: 8px; min-height: 150px; padding: 22px; border: 2px dashed #9bb6dc; border-radius: 16px; background: #f8fbff; cursor: pointer; text-align: center; transition: .2s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--primary); background: #eff6ff; }
.drop-zone input { display: none; }
.drop-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: white; font-size: 24px; }
.drop-zone small { color: var(--muted); }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 16px 0; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
select, button, textarea { font: inherit; }
select { min-width: 150px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); }
button { border: 0; border-radius: 12px; padding: 11px 16px; color: #fff; background: var(--primary); cursor: pointer; font-weight: 700; }
button:hover:not(:disabled) { background: var(--primary-dark); }
button:disabled { cursor: not-allowed; background: #a9b6cc; }
textarea { width: 100%; min-height: 190px; resize: vertical; border: 1px solid var(--line); border-radius: 16px; padding: 14px; line-height: 1.55; color: var(--text); background: #fbfdff; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.panel-title { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 12px; }
.panel-title h2 { margin: 4px 0 0; font-size: 22px; }
.code-output { min-height: 280px; max-height: 520px; margin: 0; overflow: auto; padding: 16px; border-radius: 14px; background: var(--code); color: #f9fafb; line-height: 1.5; }
.preview { min-height: 280px; max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.empty { display: grid; place-items: center; color: var(--muted); padding: 24px; }
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #eef4ff; }
tr:nth-child(even) td { background: #fafcff; }
.markdown-preview { min-height: 320px; padding: 22px; line-height: 1.7; }
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 { line-height: 1.25; }
.markdown-preview code { background: #f2f4f7; padding: 2px 5px; border-radius: 6px; }
.markdown-preview pre { background: #111827; color: #f9fafb; padding: 16px; border-radius: 14px; overflow: auto; }
.markdown-preview pre code { background: transparent; padding: 0; }
.markdown-preview blockquote { margin-left: 0; padding-left: 16px; border-left: 4px solid #bfdbfe; color: #475467; }
footer { padding: 18px 4px 0; color: var(--muted); }

@media (max-width: 820px) {
  .hero, .grid { grid-template-columns: 1fr; }
  .panel-title { align-items: start; flex-direction: column; }
  button { width: 100%; }
}
