:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --panel: #ffffff;
  --ink: #24211c;
  --muted: #6f675c;
  --line: #ddd5c7;
  --accent: #206a5d;
  --accent-strong: #164a40;
  --warm: #b45f28;
  --soft: #eef4f1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

header {
  padding: 24px clamp(16px, 4vw, 48px) 18px;
  border-bottom: 1px solid var(--line);
  background: #fffaf1;
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
  letter-spacing: 0;
}

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

main {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(320px, 1fr);
  gap: 20px;
  padding: 20px clamp(16px, 4vw, 48px) 32px;
}

.tools,
.result {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.tabs button,
.actions button,
form button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}

.tabs button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.panel {
  padding: 16px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

label {
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  background: #fff;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

form button {
  width: 100%;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

form button:hover,
.actions button.primary:hover {
  background: var(--accent-strong);
}

.result {
  display: grid;
  grid-template-rows: auto 1fr;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.result h2 {
  margin: 0;
  font-size: 18px;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  min-width: 72px;
}

.actions .primary {
  background: var(--warm);
  border-color: var(--warm);
  color: #fff;
}

#output {
  min-height: 520px;
  border: 0;
  border-radius: 0 0 8px 8px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.7;
  background: var(--soft);
}

.note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 860px) {
  main {
    grid-template-columns: 1fr;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #output {
    min-height: 360px;
  }
}
