:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #eef4f1;
  --text: #15211c;
  --muted: #62716a;
  --line: #d9e4de;
  --accent: #12735f;
  --accent-strong: #0b5747;
  --accent-soft: #d9f0ea;
  --warning: #a75518;
  --shadow: 0 20px 60px rgba(19, 43, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(18, 115, 95, 0.14), transparent 32%),
    linear-gradient(315deg, rgba(39, 88, 138, 0.14), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 0;
  display: grid;
  align-items: center;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.app-header,
.generator,
.results-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(217, 228, 222, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.app-header {
  grid-column: 1 / -1;
  border-radius: 8px;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 1.1;
}

h2 {
  font-size: 1rem;
}

.generator,
.results-panel {
  border-radius: 8px;
  padding: 20px;
}

.generator {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.field-group legend,
.field span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segmented-control label {
  min-width: 0;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.segmented-control input:checked + span {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: 0 8px 20px rgba(20, 71, 56, 0.12);
}

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

.field {
  min-width: 0;
}

.field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
  outline: none;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  color: #ffffff;
  background: var(--accent);
}

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

.secondary-button,
.ghost-button {
  color: var(--accent-strong);
  border-color: var(--line);
  background: var(--surface);
}

.secondary-button:hover,
.ghost-button:hover {
  background: var(--accent-soft);
  border-color: #afd8ce;
}

.status {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--warning);
  font-size: 0.92rem;
  font-weight: 700;
}

.results-panel {
  min-height: 468px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

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

.results-header span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.results-list {
  min-height: 320px;
  max-height: 56vh;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
}

.results-list:empty::before {
  content: "暂无结果";
  min-height: 320px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(238, 244, 241, 0.5);
}

.result-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 8px 8px 13px;
  background: var(--surface);
}

.domain-text {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
  font-size: 0.98rem;
  font-weight: 700;
}

.copy-one {
  min-width: 64px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--accent-strong);
  background: var(--surface-soft);
  font-size: 0.86rem;
  font-weight: 800;
}

.copy-one:hover {
  background: var(--accent-soft);
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 24px, 640px);
    padding: 24px 0;
    align-items: start;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .results-panel {
    min-height: 360px;
  }
}

@media (max-width: 520px) {
  .app-header {
    align-items: stretch;
    flex-direction: column;
  }

  .ghost-button {
    width: 100%;
  }

  .form-grid,
  .actions {
    grid-template-columns: 1fr;
  }

  .segmented-control {
    grid-template-columns: 1fr;
  }
}
