:root {
  --primary-600: #0f766e;
  --primary-700: #115e59;
  --accent: #7c3aed;
  --warn: #f97316;
  --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;
}

.workspace-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
}

.control-panel,
.result-panel {
  min-width: 0;
}

.control-panel {
  display: grid;
  gap: 0.8rem;
}

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

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

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

input,
select,
textarea {
  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%;
}

textarea {
  min-height: 260px;
  resize: vertical;
}

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

.rule-panel {
  background: var(--white);
  border: 1px solid var(--gray-300);
  padding: 0.75rem;
}

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

.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;
}

.button-row,
.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

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,
.example-grid button {
  background: #ecfdf5;
  border-color: #b7e4d8;
  color: var(--primary-700);
}

.button-light:hover,
.example-grid button: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;
}

.result-toolbar {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}

.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;
}

.export-row {
  justify-content: flex-end;
}

.table-wrap {
  margin-top: 0.75rem;
  max-height: 260px;
  overflow: auto;
}

table {
  border-collapse: collapse;
  min-width: 460px;
  width: 100%;
}

th,
td {
  background: var(--white);
  border: 1px solid var(--gray-300);
  padding: 0.48rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--gray-200);
  color: var(--gray-700);
  font-weight: 700;
  position: sticky;
  top: 0;
}

.example-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 0.8rem;
}

.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) {
  .workspace-grid,
  .control-grid,
  .two-col,
  .three-col,
  .example-grid {
    grid-template-columns: 1fr;
  }

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

  .table-wrap {
    max-height: none;
  }
}

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

  .button-row,
  .export-row {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

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

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