:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #17201b;
  --muted: #66726b;
  --line: #d9ded7;
  --accent: #176b64;
  --accent-dark: #104f4a;
  --warn: #9f5b1e;
  --error: #b42318;
  --soft: #eef4f2;
  --shadow: 0 18px 48px rgba(28, 38, 33, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 16px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto;
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 18px;
  align-items: start;
}

.toolbar,
.result-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toolbar {
  padding: 18px;
  position: sticky;
  top: 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.25;
}

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

.brand p,
.result-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.config-form,
.search-form {
  display: grid;
  gap: 12px;
}

.config-form {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-head h2 {
  font-size: 15px;
}

.form-head button {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 10px;
  background: var(--soft);
  color: var(--accent-dark);
  border: 1px solid #c4ddd8;
}

.config-summary {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin-top: -4px;
}

.config-fields {
  display: grid;
  gap: 9px;
}

.config-fields[hidden] {
  display: none;
}

.config-fields button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--accent);
  color: #fff;
}

.config-fields button:hover {
  background: var(--accent-dark);
}

.config-fields button:disabled {
  cursor: not-allowed;
  background: #a8b6b2;
}

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

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(23, 107, 100, 0.2);
  border-color: var(--accent);
}

.input-row button,
.actions button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
}

.input-row button:hover,
.actions button:hover {
  background: var(--accent-dark);
}

.input-row button:disabled,
.actions button:disabled {
  cursor: not-allowed;
  background: #a8b6b2;
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quick-row button {
  height: 36px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent-dark);
  border: 1px solid transparent;
}

.quick-row button.active {
  border-color: var(--accent);
  background: #dcefeb;
}

.result-panel {
  min-height: calc(100vh - 56px);
  padding: 20px;
}

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

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status {
  margin: 16px 0;
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fafbf9;
  color: var(--muted);
}

.status.loading {
  color: var(--warn);
  background: #fff8ed;
  border-color: #f1d5ad;
}

.status.ready {
  color: var(--accent-dark);
  background: var(--soft);
  border-color: #c4ddd8;
}

.status.error {
  color: var(--error);
  background: #fff1ef;
  border-color: #f6c3bd;
}

.sections {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.section-title {
  font-size: 17px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.item-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.item p {
  line-height: 1.68;
}

.item a {
  display: block;
  margin-top: 8px;
  color: var(--accent-dark);
  word-break: break-all;
  text-decoration: none;
}

.item a:hover {
  text-decoration: underline;
}

textarea {
  width: 100%;
  min-height: 420px;
  resize: vertical;
  padding: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(100% - 20px, 720px);
    margin: 10px auto;
  }

  .toolbar {
    position: static;
  }

  .result-panel {
    min-height: auto;
  }

  .result-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    justify-content: flex-start;
  }
}
