:root {
  color: #172033;
  background: #f6fbf8;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.6;
  letter-spacing: 0;
  --ink: #172033;
  --muted: #5b6678;
  --line: #d9e7df;
  --panel: #fffdf7;
  --mint: #12b886;
  --teal: #0f766e;
  --blue: #3b82f6;
  --gold: #f5b84b;
  --danger: #b42318;
  --shadow: 0 18px 44px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(18, 184, 134, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(59, 130, 246, 0.07) 1px, transparent 1px),
    linear-gradient(135deg, #f6fbf8 0%, #eef8f5 48%, #fff7ea 100%);
  background-size: 36px 36px, 36px 36px, auto;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  border: 0;
  cursor: pointer;
}

h1,
h2,
h3,
strong,
b {
  font-weight: 600;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 12px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(216, 231, 223, 0.9);
  background: rgba(255, 253, 247, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid #172033;
  border-radius: 8px;
  background: var(--mint);
  box-shadow: 4px 4px 0 var(--gold);
}

.brand-mark span {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: #fffdf7;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.top-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.top-link {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  color: #3f4b5f;
  font-size: 14px;
  font-weight: 600;
}

.layout {
  width: min(1240px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.58fr) minmax(320px, 1.24fr);
  gap: 16px;
  align-items: start;
}

.intro-panel,
.tool-panel,
.copy-section {
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.92);
  box-shadow: var(--shadow);
}

.intro-panel {
  padding: clamp(18px, 2.6vw, 30px);
}

.hero-title {
  margin: 0;
  font-size: clamp(34px, 4.8vw, 58px);
  line-height: 1.05;
}

.lead {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.tag-row,
.tool-actions,
.inline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row {
  margin-top: 18px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff;
  color: #3f4b5f;
  font-size: 12px;
  font-weight: 700;
}

.tool-panel {
  min-width: 0;
  padding: clamp(12px, 2vw, 18px);
}

.tool-app {
  display: grid;
  gap: 12px;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #3f4b5f;
  font-size: 13px;
  font-weight: 700;
}

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

.input,
.select {
  min-height: 42px;
  padding: 8px 10px;
}

.textarea,
.output {
  min-height: 170px;
  padding: 10px;
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.output {
  overflow: auto;
  white-space: pre-wrap;
}

.preview {
  min-height: 220px;
  padding: 14px;
  font-family: inherit;
}

.button {
  min-height: 38px;
  border: 1px solid #172033;
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: #172033;
  font-weight: 700;
  box-shadow: 3px 3px 0 rgba(23, 32, 51, 0.12);
}

.button.primary {
  background: var(--mint);
  color: #fff;
}

.button.warn {
  background: #fff4db;
}

.button.danger {
  background: #fff1f1;
  color: var(--danger);
}

.status {
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

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

.metric {
  min-height: 68px;
  border: 1px solid #eef2ea;
  border-radius: 8px;
  padding: 10px;
  background: #fbfefc;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.15;
}

.copy-section {
  margin-top: 16px;
  padding: clamp(18px, 3vw, 30px);
  background: rgba(255, 255, 255, 0.9);
}

.copy-section h2 {
  margin: 0 0 10px;
  font-size: clamp(22px, 3vw, 32px);
}

.copy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.copy-item {
  border-left: 4px solid var(--mint);
  padding: 6px 0 6px 12px;
}

.copy-item h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.copy-item p,
.copy-section p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .tool-shell,
  .copy-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .layout {
    width: min(100% - 18px, 1240px);
    padding-top: 14px;
  }

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