:root {
  --primary-600: #0f766e;
  --primary-700: #115e59;
  --accent: #7c3aed;
  --warn: #f97316;
  --danger: #dc2626;
  --success: #15803d;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-500: #6c757d;
  --gray-700: #495057;
  --gray-900: #212529;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--white);
  color: var(--gray-900);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

a {
  color: var(--primary-600);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-size: 1.15rem;
  line-height: 1.35;
}

.page-shell {
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 15px;
}

.navbar {
  align-items: center;
  background: #e3f2fd;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 8px;
  min-height: 66px;
  padding: 8px 16px;
}

.navbar-brand {
  align-items: center;
  color: var(--gray-900);
  display: inline-flex;
  font-size: 1.1rem;
  font-weight: 600;
  gap: 10px;
}

.navbar-brand:hover {
  text-decoration: none;
}

.brand-icon {
  align-items: center;
  background: var(--primary-600);
  border-radius: 8px;
  color: var(--white);
  display: inline-flex;
  font-weight: 700;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nav-links a {
  color: var(--gray-700);
  font-size: 0.95rem;
}

.intro-card,
.card {
  background: var(--gray-50);
  border: 1px solid #d8ecfb;
}

.intro-card {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
}

.intro-card p,
.sub-title {
  color: var(--gray-500);
  margin-bottom: 0;
}

.card,
.seo-copy {
  margin-top: 0.85rem;
}

.card-body {
  padding: 1rem;
}

.section-head {
  align-items: baseline;
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card h2,
.seo-copy h2 {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 0.45rem;
  margin-bottom: 0;
}

.badge {
  background: var(--accent);
  border-radius: 0.25rem;
  color: var(--white);
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.25em 0.45em;
}

.settings-grid {
  align-items: end;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(160px, 0.8fr) auto auto minmax(280px, 1.4fr);
}

label {
  display: grid;
  min-width: 0;
}

label > span,
.pane-head > span {
  color: var(--gray-700);
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

input,
select,
textarea,
output {
  background: var(--white);
  border: 1px solid var(--gray-300);
  color: var(--gray-900);
  display: block;
  font: inherit;
  min-height: 38px;
  min-width: 0;
  padding: 0.4rem 0.65rem;
  width: 100%;
}

select:focus,
textarea:focus {
  border-color: #5eead4;
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.16);
  outline: 0;
}

.check-field {
  align-items: center;
  display: flex;
  gap: 0.45rem;
  min-height: 38px;
}

.check-field input {
  min-height: auto;
  width: auto;
}

.check-field span {
  color: var(--gray-700);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0;
}

.toolbar-actions,
.pane-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.toolbar-actions {
  justify-content: flex-end;
}

button {
  background: var(--primary-600);
  border: 1px solid var(--primary-600);
  border-radius: 0.25rem;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  min-height: 38px;
  padding: 0.375rem 0.95rem;
  white-space: nowrap;
}

button:hover {
  background: var(--primary-700);
  border-color: var(--primary-700);
}

.button-light {
  background: #ecfdf5;
  border-color: #b7e4d8;
  color: var(--primary-700);
}

.button-light:hover {
  background: #ccfbf1;
  border-color: #99f6e4;
  color: var(--primary-700);
}

.button-secondary {
  background: var(--warn);
  border-color: var(--warn);
}

.button-secondary:hover {
  background: #ea580c;
  border-color: #ea580c;
}

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

.editor-pane {
  min-width: 0;
}

.pane-head {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.pane-head > span {
  margin-bottom: 0;
}

.textarea-shell {
  background: var(--white);
  border: 1px solid var(--gray-300);
  display: grid;
  grid-template-columns: 54px 1fr;
  min-height: 460px;
}

.textarea-shell:focus-within {
  border-color: #5eead4;
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.16);
}

.line-label {
  align-items: flex-start;
  background: var(--gray-200);
  border-right: 1px solid var(--gray-300);
  color: var(--gray-500);
  display: flex;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  justify-content: center;
  letter-spacing: 0;
  padding-top: 0.75rem;
  user-select: none;
}

textarea {
  border: 0;
  color: var(--gray-900);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.94rem;
  line-height: 1.65;
  min-height: 458px;
  padding: 0.75rem 0.85rem;
  resize: vertical;
  tab-size: 2;
}

textarea[readonly] {
  background: #fcfffd;
}

.result-toolbar {
  align-items: center;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  margin-top: 0.85rem;
}

.summary-strip {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--gray-300);
  display: flex;
  flex-wrap: wrap;
  min-height: 38px;
}

.summary-strip span {
  color: var(--gray-500);
  font-size: 0.92rem;
  padding: 0.35rem 0.7rem;
  white-space: nowrap;
}

.summary-strip span + span {
  border-left: 1px solid var(--gray-300);
}

.summary-strip strong {
  color: var(--primary-700);
  font-size: 1.02rem;
  margin-left: 0.25rem;
}

.message-box {
  color: var(--gray-700);
  font-weight: 600;
  text-align: left;
}

.message-box.is-success {
  color: var(--success);
}

.message-box.is-error {
  color: var(--danger);
}

.feature-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.8rem;
}

.feature-grid span {
  background: var(--white);
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  padding: 0.5rem 0.65rem;
}

.seo-copy {
  color: var(--gray-700);
  font-size: 0.95rem;
}

.seo-copy p {
  margin-bottom: 0;
}

.toast {
  background: var(--gray-900);
  border-radius: 0.25rem;
  bottom: 18px;
  color: var(--white);
  left: 50%;
  opacity: 0;
  padding: 0.65rem 0.9rem;
  pointer-events: none;
  position: fixed;
  transform: translateX(-50%);
  transition: opacity 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
}

@media (max-width: 1100px) {
  .settings-grid,
  .workspace-grid,
  .result-toolbar,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions,
  .pane-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .navbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions,
  .pane-actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .pane-head {
    align-items: stretch;
    flex-direction: column;
  }

  .textarea-shell {
    grid-template-columns: 42px 1fr;
    min-height: 320px;
  }

  textarea {
    min-height: 318px;
  }

  .summary-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-strip span + span {
    border-left: 0;
  }
}
