:root {
  color-scheme: light;
  --ink: #151718;
  --muted: #5f6872;
  --line: #dce4e7;
  --surface: #ffffff;
  --soft: #f4f8f8;
  --charcoal: #20252b;
  --teal: #0d9488;
  --blue: #2563eb;
  --amber: #d97706;
  --rose: #be123c;
  --green: #16a34a;
  --cyan: #0891b2;
  --violet: #7c3aed;
  --orange: #ea580c;
  --purple: #9333ea;
  --slate: #334155;
  --shadow: 0 18px 50px rgba(26, 39, 48, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

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

button,
input,
select {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 20;
  border-radius: 8px;
  background: var(--charcoal);
  color: #fff;
  padding: 12px 16px;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  direction: ltr;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(220, 228, 231, 0.82);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--charcoal);
  color: #fff;
  font-size: 13px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--ink);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 4px;
}

.language-switcher button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.language-switcher button.active {
  background: var(--soft);
  color: #000;
  font-weight: 900;
}

.header-action,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 800;
}

.header-action,
.primary-button {
  background: var(--charcoal);
  color: #fff;
  padding: 0 18px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 18px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: 44px;
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: 58px 5vw 40px;
  background:
    linear-gradient(180deg, #f8fbfb 0%, #ffffff 72%),
    radial-gradient(circle at 12% 18%, rgba(13, 148, 136, 0.12), transparent 30%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: clamp(44px, 7vw, 84px);
  line-height: 1;
  letter-spacing: 0;
}

.hero-text,
.section-copy {
  max-width: 740px;
  color: var(--muted);
  line-height: 1.75;
}

.hero-text {
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 36px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 120px));
  gap: 18px;
  margin: 0;
}

.hero-stats div {
  border-left: 3px solid var(--line);
  padding-left: 14px;
}

.hero-stats dt {
  font-size: 28px;
  font-weight: 800;
}

.hero-stats dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.hero-visual {
  overflow: hidden;
  border: 1px solid rgba(220, 228, 231, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: #eef5f6;
  margin: 0;
}

.hero-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.catalog-section,
.category-hub,
.workflow-section,
.placeholder-section,
.faq-section {
  padding: 72px 5vw;
}

.category-hub,
.workflow-section,
.faq-section {
  background: var(--soft);
}

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

.section-heading h2 {
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 48px);
}

.section-heading.compact {
  align-items: start;
}

.catalog-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.search-box,
.select-box {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.search-box input,
.select-box select {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
}

.search-box input {
  width: min(330px, 70vw);
}

.catalog-status {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

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

.category-link-card {
  display: grid;
  min-height: 206px;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.category-link-card:hover {
  border-color: rgba(13, 148, 136, 0.55);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.category-link-card h3 {
  margin: 0;
  font-size: 20px;
}

.category-link-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.category-count {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

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

.tool-card {
  display: grid;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.tool-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.tool-card.hidden {
  display: none;
}

.tool-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.tool-logo {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
}

.logo-teal {
  background: var(--teal);
}

.logo-blue {
  background: var(--blue);
}

.logo-rose {
  background: var(--rose);
}

.logo-amber {
  background: var(--amber);
}

.logo-cyan {
  background: var(--cyan);
}

.logo-violet {
  background: var(--violet);
}

.logo-slate {
  background: var(--slate);
}

.logo-orange {
  background: var(--orange);
}

.logo-green {
  background: var(--green);
}

.logo-purple {
  background: var(--purple);
}

.badge {
  border-radius: 999px;
  background: #edf8f7;
  color: #08756c;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.tool-card h3 {
  margin-bottom: 8px;
  font-size: 22px;
}

.tool-summary,
.tool-card p {
  color: var(--muted);
  line-height: 1.65;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}

.feature-list li,
.tool-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 12px;
}

.offline-note {
  border-left: 3px solid rgba(13, 148, 136, 0.45);
  margin: 0 0 18px;
  padding-left: 12px;
  color: #314047;
  font-size: 14px;
  line-height: 1.6;
}

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.tool-actions {
  display: flex;
  gap: 10px;
  align-self: end;
  margin-top: auto;
}

.tool-actions button,
.tool-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}

.tool-actions button {
  background: var(--charcoal);
  color: #fff;
}

.tool-actions a {
  background: #fff;
}

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

.workflow-grid article {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 24px;
}

.step-number {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #fff4e5;
  color: var(--amber);
  font-weight: 800;
}

.workflow-grid h3 {
  margin: 18px 0 8px;
}

.workflow-grid p {
  color: var(--muted);
  line-height: 1.7;
}

.empty-slot {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfdfd;
  color: var(--muted);
  font-weight: 800;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px 20px;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 800;
}

.faq-list p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.site-footer {
  display: grid;
  gap: 24px;
  padding: 42px 5vw;
  background: var(--charcoal);
  color: #fff;
}

.footer-main {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: flex-end;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 800;
}

html[dir="rtl"] main,
html[dir="rtl"] footer {
  direction: rtl;
}

html[dir="rtl"] .hero-stats div,
html[dir="rtl"] .offline-note {
  border-left: 0;
  border-right: 3px solid rgba(13, 148, 136, 0.45);
  padding-left: 0;
  padding-right: 12px;
}

.site-footer p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.legal-policies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-top: 24px;
}

.legal-policies article {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 20px;
}

.legal-policies h2 {
  margin-bottom: 8px;
  font-size: 20px;
}

.legal-policies p {
  font-size: 14px;
  line-height: 1.75;
}

.tool-dialog {
  width: min(620px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.tool-dialog::backdrop {
  background: rgba(10, 14, 18, 0.46);
}

.dialog-panel {
  padding: 28px;
}

.dialog-panel h2 {
  margin-bottom: 10px;
}

.dialog-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.close-dialog {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.page-hero {
  display: grid;
  gap: 16px;
  padding: 72px 5vw 42px;
  background: linear-gradient(180deg, #f8fbfb 0%, #ffffff 100%);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs a {
  color: var(--teal);
  font-weight: 800;
}

.page-hero h1 {
  max-width: 940px;
  margin-bottom: 0;
  font-size: clamp(42px, 6vw, 72px);
}

.page-subtitle {
  max-width: 760px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.75;
}

.category-page-section {
  padding: 42px 5vw 72px;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.related-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.related-links a:hover {
  border-color: var(--charcoal);
  color: var(--ink);
}

@media (max-width: 1080px) {
  .hero,
  .tool-grid,
  .category-link-grid,
  .workflow-grid,
  .slot-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-copy {
    grid-column: 1 / -1;
  }

  .hero-visual {
    grid-column: 1 / -1;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .catalog-controls {
    justify-content: start;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .site-header {
    min-height: 64px;
    padding: 10px 5vw;
  }

  .nav-links {
    display: flex;
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding: 10px 0 2px;
    gap: 22px;
    white-space: nowrap;
  }

  .site-header .header-action { display: none; }
  .site-header .language-switcher { margin-left: auto; max-width: calc(100% - 135px); }

  .language-switcher {
    max-width: 52vw;
    overflow-x: auto;
  }

  .hero,
  .tool-grid,
  .category-link-grid,
  .workflow-grid,
  .slot-grid,
  .legal-policies {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 42px;
  }

  h1 {
    font-size: 42px;
  }

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

  .hero-actions,
  .catalog-controls,
  .tool-actions {
    display: grid;
  }

  .search-box input,
  .select-box select,
  .primary-button,
  .secondary-button,
  .header-action,
  .tool-actions button,
  .tool-actions a {
    width: 100%;
  }

  .footer-main {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}
