:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --surface: #fffdf8;
  --surface-strong: #fff7df;
  --ink: #24211d;
  --muted: #70695f;
  --line: #ded5c6;
  --accent: #0b7a75;
  --accent-dark: #075f5a;
  --accent-soft: #d8efea;
  --orange: #c46a2b;
  --shadow: 0 24px 70px rgba(76, 61, 42, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(11, 122, 117, 0.11), transparent 38%),
    linear-gradient(315deg, rgba(196, 106, 43, 0.12), transparent 34%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0;
}

.intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

.intro-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: 0;
}

.dialect-status {
  max-width: 780px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.75;
}

.dialect-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 78px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.dialect-note span {
  display: inline-flex;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.phrase {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.75;
}

.converter {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

label {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

textarea,
output {
  display: block;
  width: 100%;
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fffefa;
  font-size: 18px;
  line-height: 1.8;
}

textarea {
  resize: vertical;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(11, 122, 117, 0.14);
}

output {
  min-height: 190px;
  white-space: pre-wrap;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 22px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.primary-button {
  padding: 0 22px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(11, 122, 117, 0.22);
}

.secondary-button {
  padding: 0 18px;
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.ghost-button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

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

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

.ghost-button:hover {
  color: var(--ink);
  background: rgba(36, 33, 29, 0.06);
}

button:focus-visible {
  outline: 3px solid rgba(196, 106, 43, 0.32);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
  box-shadow: none;
}

.result-head {
  margin-top: 4px;
}

#status {
  min-height: 20px;
  color: var(--orange);
  font-size: 14px;
  font-weight: 700;
}

.intro-panel,
.source-panel {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(222, 213, 198, 0.76);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.64);
  font-size: 12px;
  line-height: 1.6;
}

.intro-panel {
  align-items: flex-start;
  flex-direction: column;
  margin-top: 14px;
  padding: 14px 16px;
  background: rgba(255, 247, 223, 0.62);
  font-size: 13px;
}

.source-panel {
  align-items: center;
}

.intro-panel p {
  margin: 0;
}

.intro-panel strong,
.source-panel strong {
  color: var(--ink);
  white-space: nowrap;
}

.source-panel a {
  color: var(--accent-dark);
  font-weight: 800;
}

.seo-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.related-panel {
  margin-top: 22px;
  padding: 16px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.7);
}

.related-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 12px;
  border-bottom: 1px solid rgba(222, 213, 198, 0.72);
}

.related-head h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.related-head a {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}

.related-link {
  min-height: 58px;
  padding: 12px 14px;
  border-right: 1px solid rgba(222, 213, 198, 0.72);
  background: transparent;
}

.related-link:hover {
  background: var(--accent-soft);
}

.related-link strong,
.related-link span {
  display: block;
}

.related-link strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

.related-link span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.site-footer {
  margin-top: 16px;
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--accent-dark);
  font-weight: 800;
}

.page-share {
  margin-left: auto;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 22px, 640px);
    padding: 24px 0;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }

  .dialect-note {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: auto;
    padding: 18px;
  }

  .converter {
    padding: 16px;
  }

  .intro-panel,
  .source-panel {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  textarea,
  output {
    min-height: 190px;
    padding: 14px;
    font-size: 16px;
  }

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

  .primary-button,
  .secondary-button {
    width: 100%;
  }

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

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

  .related-link {
    border-top: 1px solid rgba(222, 213, 198, 0.72);
    border-right: 0;
  }

  .page-share {
    margin-left: 0;
  }

}
