:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-alt: #eef4ff;
  --text: #0f172a;
  --muted: #475569;
  --line: #d6dfeb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, 0.09);
  --primary-soft-strong: rgba(37, 99, 235, 0.15);
  --primary-line: rgba(37, 99, 235, 0.34);
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --accent-line: rgba(15, 118, 110, 0.18);
  --shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 22px 48px rgba(37, 99, 235, 0.12);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: 1180px;
  --header-height: 60px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  padding-top: var(--header-height);
}

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

img {
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(214, 223, 235, 0.95);
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.94);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-badge {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #4f83f1);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.mobile-nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
}

.mobile-nav-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-nav-toggle.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.site-nav a,
.nav-trigger {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  transition: 0.2s ease;
  font-size: 0.92rem;
}

.nav-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item-row .nav-trigger {
  flex: 1 1 auto;
}

.nav-expand {
  display: none;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
}

.site-nav a:hover,
.site-nav a.is-active,
.nav-trigger:hover,
.nav-trigger.is-active {
  color: var(--text);
  background: var(--primary-soft);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 240px;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(214, 223, 235, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dropdown-menu a {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
}

.dropdown-menu a:hover {
  color: var(--text);
  background: var(--primary-soft);
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.hero {
  padding: 24px 0 24px;
}

.hero h1 {
  font-size: clamp(1.9rem, 2.8vw, 2.95rem);
  line-height: 1.15;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 24px;
  align-items: stretch;
}

.home-hero-layout {
  grid-template-columns: 1fr;
}

.home-hero-layout .hero-panel {
  width: 100%;
}

.home-hero-layout .lead {
  max-width: none;
}

.home-hero-layout .hero-side {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-panel,
.glass-card,
.tool-card,
.content-card,
.faq-item,
.stat-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(214, 223, 235, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 40px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.92rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0 0 12px;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2rem, 3vw, 3.4rem);
}

h2 {
  font-size: clamp(1.45rem, 2.1vw, 2.2rem);
}

h3 {
  font-size: 1.25rem;
}

.lead {
  max-width: 62ch;
  font-size: 1.05rem;
  color: var(--muted);
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #4f83f1);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--primary-dark);
  border: 1px solid #d7e4ff;
}

.btn-ghost {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid #d7e4ff;
}

.hero-list,
.content-list,
.mini-list {
  padding: 0;
  margin: 20px 0 0;
  list-style: none;
}

.hero-list li,
.content-list li,
.mini-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
  color: var(--muted);
}

.hero-side {
  display: grid;
  gap: 18px;
}

.glass-card {
  padding: 24px;
}

.stats-grid,
.grid-3,
.grid-2,
.tool-grid,
.faq-grid,
.footer-grid {
  display: grid;
  gap: 20px;
}

.stats-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 28px;
}

.stat-card {
  padding: 22px;
}

.stat-card strong {
  display: block;
  font-size: 1.9rem;
  margin-bottom: 4px;
}

.section {
  padding: 12px 0 34px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
}

.section-head p,
.muted {
  color: var(--muted);
}

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

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

.tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.tool-card,
.content-card {
  padding: 26px;
}

.tool-card h3,
.content-card h3 {
  margin-bottom: 8px;
}

.tag {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.tool-shell {
  display: grid;
  gap: 18px;
}

.tool-panel {
  display: grid;
  gap: 16px;
  padding: 26px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid #cfd9e8;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-strong);
}

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

.field,
.result-box {
  display: grid;
  gap: 8px;
}

.field label {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #c7d3e3;
  border-radius: 14px;
  background: #f8fbff;
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.field textarea {
  min-height: 160px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--primary-soft-strong);
  border-color: var(--primary-line);
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.08),
    inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.result-box {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f5f9ff, #ebf3ff);
  border: 1px solid #cfe0ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.result-box strong {
  font-size: 1.35rem;
}

.note {
  font-size: 0.92rem;
  color: var(--muted);
}

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

.faq-item {
  padding: 22px;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
}

.page-hero {
  padding: 10px 0 8px;
}

.page-hero .content-card {
  padding: 28px;
}

.page-hero .lead {
  max-width: none;
}

.site-footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.footer-grid {
  grid-template-columns: repeat(3, minmax(0, max-content));
  justify-content: center;
  align-items: start;
  text-align: center;
}

.footer-grid > div {
  display: grid;
  justify-items: center;
}

.site-footer .brand {
  justify-content: center;
}

.footer-links {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--text);
}

.tiny {
  font-size: 0.92rem;
}

.notice {
  padding: 14px 16px;
  border: 1px dashed var(--primary-line);
  background: rgba(45, 86, 200, 0.05);
  border-radius: 14px;
  color: var(--muted);
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.option-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.option-check input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.94rem;
}

.crumbs a {
  color: var(--primary-dark);
}

.directory-intro {
  display: grid;
  gap: 18px;
}

.tool-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}

.tool-layout .tool-panel,
.tool-layout .content-card {
  height: 100%;
}

.text-tool-layout {
  grid-template-columns: 1fr;
}

.text-tool-main {
  gap: 20px;
}

.text-tool-support {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.text-tool-layout .field textarea {
  min-height: 280px;
}

.text-tool-layout .result-box + .field textarea,
.text-tool-layout #output-text {
  min-height: 220px;
}

.content-stack {
  display: grid;
  gap: 18px;
}

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

.compare-diff-list {
  display: grid;
  gap: 14px;
}

.compare-diff-row {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.compare-diff-row p {
  margin: 0;
}

.compare-diff-row .note {
  display: inline-block;
  margin-bottom: 8px;
}

.compare-text-block {
  padding: 14px;
  border-radius: 14px;
  background: #f8fbff;
  border: 1px solid #d9e4f2;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

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

.mini-stat {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.mini-stat strong {
  display: block;
  font-size: 1.45rem;
}

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

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

.tool-formula {
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #f8fbff, #edf4ff);
  border: 1px solid #d7e4ff;
}

.tool-formula p {
  margin: 0;
  color: var(--muted);
}

.article-copy {
  display: grid;
  gap: 12px;
}

.article-copy p {
  margin: 0;
  color: var(--muted);
}

.directory-note {
  padding: 18px;
  border-radius: var(--radius-md);
  background: #eef6ff;
  border: 1px solid #d6e5fb;
  color: #244169;
}

@media (max-width: 980px) {
  .hero-grid,
  .grid-3,
  .grid-2,
  .faq-grid,
  .faq-grid-3,
  .footer-grid,
  .field-grid,
  .stats-grid,
  .tool-layout,
  .metric-strip,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .header-row {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-nav {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 0 2px;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a,
  .nav-trigger {
    width: 100%;
    padding: 12px 0;
    border-radius: 0;
    background: transparent;
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-item-row {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .nav-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .dropdown-menu {
    position: static;
    display: none;
    min-width: 0;
    margin-top: 6px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    background: #f4f8ff;
  }

  .nav-dropdown.is-open .dropdown-menu {
    display: grid;
  }

  .nav-dropdown.is-open .nav-expand {
    background: var(--primary-soft);
  }

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

  .home-hero-layout .hero-side {
    grid-template-columns: 1fr;
  }


  .text-tool-support {
    grid-template-columns: 1fr;
  }

  .compare-editors,
  .compare-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero-panel,
  .glass-card,
  .tool-card,
  .content-card,
  .tool-panel,
  .faq-item,
  .stat-card {
    padding: 20px;
  }

  .hero {
    padding-top: 12px;
  }

  .section {
    padding: 10px 0 26px;
  }

  .page-hero {
    padding: 18px 0 8px;
  }

  h1 {
    font-size: 1.95rem;
  }
}
