:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --panel: #ffffff;
  --text: #172026;
  --muted: #66757f;
  --line: #d9e1e5;
  --primary: #176b5b;
  --primary-dark: #0e4d41;
  --accent: #b43f2b;
  --code-bg: #102027;
  --code-text: #d8f3e7;
  --shadow: 0 18px 50px rgba(18, 43, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(23, 107, 91, 0.12), transparent 360px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

.site-header,
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 44px 0 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.04;
}

h2 {
  font-size: 20px;
}

.subtitle,
.section-heading p {
  color: var(--muted);
}

.subtitle {
  max-width: 660px;
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.7;
}

.domain-link {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

main {
  display: grid;
  gap: 18px;
  padding-bottom: 40px;
}

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

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading p {
  margin-top: 6px;
  line-height: 1.6;
}

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

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
select,
button {
  min-height: 44px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfdfe;
  color: var(--text);
  padding: 10px 12px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(23, 107, 91, 0.22);
  outline-offset: 2px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 18px;
}

button {
  border: 0;
  background: var(--primary);
  color: #fff;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  background: #e9f2ef;
  color: var(--primary-dark);
}

.secondary-button:hover {
  background: #d9e9e4;
}

.result-list {
  display: grid;
  gap: 10px;
}

.result-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfc;
}

.result-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

code {
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
}

.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  justify-self: end;
  background: #eef3f5;
  color: var(--primary-dark);
}

.icon-button:hover {
  background: #dde8ec;
}

.snippet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

pre {
  min-height: 120px;
  margin: 0;
  overflow: auto;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 14px;
  line-height: 1.7;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--muted);
  padding: 10px 14px;
  font-weight: 700;
}

.toast:empty {
  display: none;
}

.toast[data-type="success"] {
  border-color: rgba(23, 107, 91, 0.35);
  color: var(--primary-dark);
}

.toast[data-type="error"] {
  border-color: rgba(180, 63, 43, 0.35);
  color: var(--accent);
}

@media (max-width: 860px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-grid,
  .snippet-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header,
  main {
    width: min(100% - 20px, 1120px);
  }

  .site-header {
    padding-top: 28px;
  }

  .panel {
    padding: 16px;
  }

  .result-row {
    grid-template-columns: 1fr 38px;
  }

  .result-label {
    grid-column: 1 / -1;
  }
}
