* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.page.page-narrow {
  max-width: 520px;
}

.hero {
  margin-bottom: 20px;
}

.hero h1 {
  margin-bottom: 8px;
}

.tab-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  background: #e5e7eb;
  color: #111827;
  white-space: nowrap;
}

.tab-btn.active {
  background: #2563eb;
  color: #ffffff;
}

.panel,
.result-card,
.domain-card,
.step-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.panel {
  padding: 20px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.toolbar,
.domain-card-header,
.step-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.actions {
  margin-top: 24px;
}

.section-gap {
  margin-top: 24px;
}

.section-gap-sm {
  margin-top: 12px;
}

.full-width {
  width: 100%;
}

.search-field {
  position: relative;
}

.search-tip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.domain-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  padding: 6px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.domain-search-results.active {
  display: grid;
  gap: 6px;
}

.search-result-item {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #111827;
  text-align: left;
}

.search-result-item.empty {
  cursor: default;
  color: #6b7280;
}

.align-end {
  align-items: end;
}

.fixed-config-panel {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
}

.fixed-config-panel summary {
  cursor: pointer;
  font-size: 24px;
  font-weight: 700;
  list-style: none;
}

.fixed-config-panel summary::-webkit-details-marker {
  display: none;
}

.fixed-config-panel summary::after {
  content: "展开";
  margin-left: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
}

.fixed-config-panel[open] summary::after {
  content: "收起";
}

.fixed-config-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.fixed-config-item {
  display: grid;
  gap: 6px;
}

.fixed-config-label {
  font-size: 14px;
  font-weight: 700;
}

.readonly-box {
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #374151;
  line-height: 1.6;
}

.grid.two-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

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

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
}

button {
  cursor: pointer;
  border: none;
}

.primary-btn,
.secondary-btn,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
}

.primary-btn {
  background: #2563eb;
  color: #ffffff;
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.secondary-btn,
.secondary-link {
  background: #e5e7eb;
  color: #111827;
  flex-shrink: 0;
}

.text-btn {
  padding: 0;
  background: transparent;
  color: #dc2626;
}

.domain-card,
.result-card {
  padding: 18px;
  margin-top: 16px;
}

.dns-section {
  margin-top: 20px;
}

.dns-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.dns-status-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

.status-line + .status-line {
  margin-top: 2px;
}

.dns-status-box.success {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
}

.dns-status-box.pending {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.dns-status-box.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.dns-records-box {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.dns-records-title {
  font-size: 14px;
  font-weight: 700;
}

.dns-records-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.dns-records-list.empty {
  color: #6b7280;
  font-size: 14px;
}

.dns-record-item {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e5e7eb;
  color: #111827;
  text-align: left;
}

.dns-record-item:hover {
  background: #dbeafe;
}

.dns-update-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.dns-update-row {
  display: grid;
  grid-template-columns: 100px 1fr 1.2fr 1.2fr 64px;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.dns-row {
  display: grid;
  grid-template-columns: 120px 1fr 1.2fr 110px 64px;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.checkbox-label {
  align-self: center;
  gap: 6px;
}

.checkbox-label input {
  width: auto;
  min-height: auto;
}

.message-box,
.info-block,
.error-banner {
  padding: 14px 16px;
  border-radius: 10px;
  margin-top: 16px;
}

.ns-block {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #86efac;
  border-radius: 12px;
  background: #f0fdf4;
}

.ns-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ns-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ns-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
}

.copy-btn {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: #16a34a;
  color: #ffffff;
}

.error-box,
.error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.result-list,
.steps {
  display: grid;
  gap: 16px;
}

.step-card {
  padding: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.success {
  background: #dcfce7;
  color: #166534;
}

.status-pill.error {
  background: #fee2e2;
  color: #991b1b;
}

.muted,
.summary-meta {
  color: #6b7280;
}

.summary-meta {
  display: grid;
  gap: 6px;
  text-align: right;
  font-size: 14px;
}

pre {
  margin: 12px 0 0;
  padding: 12px;
  overflow-x: auto;
  border-radius: 10px;
  background: #111827;
  color: #f9fafb;
  font-size: 12px;
}

@media (max-width: 800px) {
  .dns-update-row,
  .dns-row {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .domain-card-header,
  .step-title,
  .ns-block-header,
  .ns-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-meta {
    text-align: left;
  }
}
