:root {
  color-scheme: dark;
  --bg: #0e1113;
  --surface: #15191d;
  --surface-2: #101417;
  --line: #2a3136;
  --line-soft: #20272c;
  --text: #eef2f0;
  --muted: #a7b0ab;
  --faint: #74807a;
  --accent: #7cc7ad;
  --accent-strong: #a3e7cf;
  --danger: #f0a6a6;
  --warning: #e6c384;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 30;
  padding: 10px 14px;
  background: var(--accent);
  color: #07100d;
}

.skip-link:focus {
  left: 0;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(14, 17, 19, 0.86);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-size: 15px;
  font-weight: 700;
}

.brand .accent {
  color: var(--accent);
}

.brand .dot,
.header-status,
.site-footer {
  color: var(--faint);
}

.header-status {
  font-family: var(--mono);
  font-size: 12px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  padding: 58px 0 34px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  font-size: 46px;
  line-height: 1.08;
  font-weight: 720;
}

h2 {
  font-size: 21px;
  line-height: 1.25;
}

.lead {
  max-width: 760px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.truth-box,
.form-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.truth-box {
  padding: 22px;
}

.truth-box p,
.empty-state p {
  margin: 10px 0 0;
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 20px;
  align-items: start;
  padding-bottom: 42px;
}

.form-panel,
.result-panel {
  padding: 22px;
}

.panel-heading {
  margin-bottom: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field span {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.field input,
.field textarea,
#markdown-output {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  padding: 11px 12px;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--faint);
}

.field small {
  min-height: 16px;
  color: var(--danger);
  font-size: 12px;
}

.field[data-invalid="true"] input,
.field[data-invalid="true"] textarea {
  border-color: var(--danger);
}

.check-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 4px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.check-row input {
  margin-top: 3px;
}

.honeypot {
  display: none;
}

.form-error {
  margin-bottom: 14px;
  color: var(--danger);
  border: 1px solid rgba(240, 166, 166, 0.4);
  background: rgba(240, 166, 166, 0.08);
  border-radius: 6px;
  padding: 10px 12px;
}

.primary-action,
.result-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #07100d;
  font-weight: 720;
}

.primary-action {
  width: 100%;
}

.primary-action[disabled] {
  cursor: progress;
  opacity: 0.68;
}

.result-panel {
  position: sticky;
  top: 78px;
}

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 22px;
  text-align: center;
}

.submission-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  margin-bottom: 12px;
}

#markdown-output {
  min-height: 460px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.result-actions button {
  flex: 1;
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.result-actions button:hover {
  border-color: var(--accent);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line-soft);
  padding: 22px 0 30px;
  font-size: 13px;
}

@media (max-width: 900px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 28px, 1180px);
  }

  .header-inner,
  .site-footer,
  .submission-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    padding-top: 36px;
  }

  h1 {
    font-size: 34px;
  }

  .lead {
    font-size: 16px;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-panel,
  .result-panel,
  .truth-box {
    padding: 16px;
  }
}
