:root {
  --bg: #f2f4f8;
  --sidebar: #eef1f6;
  --card: #ffffff;
  --line: #dde3ee;
  --text: #1f2b3d;
  --muted: #61708a;
  --primary: #2169f5;
  --primary-dark: #1454cd;
  --ok: #0f9960;
  --error: #d64545;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.global-lang-switch {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1200;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(221, 227, 238, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(18, 42, 80, 0.12);
  backdrop-filter: blur(10px);
}

.lang-switch--hidden {
  display: none !important;
}

.global-lang-switch__btn {
  width: auto;
  min-width: 42px;
  padding: 6px 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #355289;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.global-lang-switch__btn:hover {
  background: #edf3ff;
  color: #163e84;
}

.global-lang-switch__btn.is-active {
  background: #2169f5;
  color: #fff;
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid #d6deeb;
  padding: 20px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #2169f5;
  color: #fff;
  font-weight: 700;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
}

.brand p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.tool-nav {
  display: grid;
  gap: 10px;
}

.run-links {
  margin-bottom: 12px;
}

.run-links a {
  font-size: 14px;
  font-weight: 700;
}

.lang-switch {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.lang-switch label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.lang-switch select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
}

.tool-btn {
  width: 100%;
  border: 1px solid #d8e0ee;
  background: #f8fafe;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tool-btn:hover {
  background: #edf3ff;
  border-color: #c8d8f5;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(33, 105, 245, 0.12);
}

.tool-btn.is-active {
  background: linear-gradient(180deg, #e8f0ff 0%, #dce9ff 100%);
  border-color: #9ab7f1;
  color: #1146aa;
  box-shadow: 0 8px 18px rgba(20, 84, 205, 0.16);
}

.icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e4ecfb;
  font-size: 13px;
  font-weight: 800;
  color: #2b5fca;
  letter-spacing: 0.4px;
  flex: 0 0 auto;
}

.tool-btn.is-active .icon {
  background: #cfe0ff;
}

.content {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.marketing-page {
  width: min(980px, calc(100% - 24px));
  margin: 16px auto;
  display: grid;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-brand h1 {
  margin: 0;
  font-size: 18px;
}

.topbar-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.topnav a {
  text-decoration: none;
  color: #173d7d;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: all 0.16s ease;
}

.topnav a:hover {
  color: #0e2f66;
  background: #eaf1ff;
}

.marketing-hero h2 {
  margin: 0;
}

.marketing-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.primary-link,
.ghost-link {
  text-decoration: none;
  padding: 9px 13px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
}

.primary-link {
  background: var(--primary);
  color: #fff;
}

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

.ghost-link {
  color: #1f4fb2;
  border: 1px solid #c9d9f7;
  background: #f3f7ff;
}

.ghost-link:hover {
  background: #e8f0ff;
}

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

.panel-grid article {
  border: 1px solid #d9e3f2;
  border-radius: 12px;
  padding: 12px;
  background: #f9fbff;
}

.panel-grid h4 {
  margin: 0;
}

.panel-grid p {
  margin: 8px 0;
  color: #41526f;
}

.panel-grid a {
  color: #2a4f90;
  font-weight: 600;
  text-decoration: none;
}

.panel-grid a:hover {
  text-decoration: underline;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2,
.section-head h3 {
  margin: 0;
}

.section-head a {
  text-decoration: none;
  font-weight: 700;
  color: #244f9c;
}

.section-head a:hover {
  text-decoration: underline;
}

.ad-block {
  border-color: #d2dff4;
  background: #fafcff;
}

.ad-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #5a6f95;
  letter-spacing: 0.2px;
}

.ad-placeholder {
  border: 1px dashed #a9bfdc;
  border-radius: 10px;
  min-height: 120px;
  display: grid;
  place-items: center;
  color: #5a6f95;
  font-size: 13px;
  background: #f2f7ff;
}

.article-card h2 {
  margin: 0;
  font-size: 22px;
}

.article-card p {
  margin: 10px 0 0;
  color: #3c4f70;
  line-height: 1.8;
}

.blog-page {
  width: min(1360px, calc(100% - 24px));
  margin: 16px auto;
  display: grid;
  gap: 14px;
}

.blog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.blog-head__brand h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.1;
}

.blog-head__brand p {
  margin: 8px 0 0;
  color: var(--muted);
}

.blog-featured h2 {
  margin: 0;
}

.blog-featured p {
  margin: 8px 0 0;
  color: #425572;
  line-height: 1.7;
}

.blog-grid-wrap {
  width: 100%;
}

.blog-grid {
  column-count: 4;
  column-gap: 16px;
}

.blog-grid--two {
  column-count: unset;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.blog-card {
  break-inside: avoid;
  margin-bottom: 16px;
  border: 1px solid #d8e2f1;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 24px rgba(21, 35, 60, 0.08);
}

.blog-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.blog-card--fixed {
  height: 620px;
}

.blog-card--text {
  height: auto;
  min-height: 280px;
}

.blog-card--fixed .blog-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card__cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.blog-card__cover--fixed {
  aspect-ratio: auto;
  height: 235px;
}

.blog-card__body {
  padding: 12px;
}

.blog-card__body--fixed {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card__cat {
  margin: 0;
  color: #3a5f9c;
  font-size: 12px;
  font-weight: 700;
}

.blog-card h3 {
  margin: 8px 0 0;
  font-size: 18px;
  line-height: 1.45;
}

.blog-card__summary {
  margin: 8px 0 0;
  color: #455879;
  line-height: 1.65;
}

.blog-card__summary--clamp {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__meta {
  margin: 10px 0 0;
  font-size: 12px;
  color: #7a879c;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  width: auto;
  border: 1px solid #c9d7ef;
  border-radius: 999px;
  background: #f4f8ff;
  color: #244b8f;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
}

.filter-btn:hover {
  background: #eaf1ff;
}

.filter-btn.is-active {
  background: #1f5fd0;
  border-color: #1f5fd0;
  color: #fff;
}

.tag-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #d3def0;
  background: #f6f9ff;
  padding: 2px 8px;
  font-size: 12px;
  color: #3d5683;
}

.blog-readmore {
  margin-top: auto;
  display: inline-block;
  color: #1c4fa8;
  font-weight: 700;
  font-size: 14px;
}

.post-article h2 {
  font-size: 34px;
  line-height: 1.25;
}

.post-article h3 {
  margin-top: 16px;
  margin-bottom: 6px;
  font-size: 22px;
}

.post-article p {
  color: #344967;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(18, 42, 80, 0.06);
}

.hero h2,
.tool-panel h3 {
  margin: 0;
}

.hero p,
.sub {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.guide-card h3,
.guide-card h4 {
  margin: 0;
}

.guide-card h4 {
  margin-top: 14px;
}

.section-title {
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 22px;
}

.guide-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #32435f;
  line-height: 1.7;
}

.guide-list li + li {
  margin-top: 4px;
}

details {
  border: 1px solid #dde5f3;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fafcff;
}

details + details {
  margin-top: 10px;
}

summary {
  cursor: pointer;
  font-weight: 700;
  color: #2d466f;
}

details p {
  margin: 10px 0 0;
  color: #435674;
  line-height: 1.7;
}

.ad-compliance-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d9e4f8;
  background: #f6f9ff;
  color: #2c4573;
}

.tool-panel {
  display: none;
}

.tool-panel.is-visible {
  display: block;
}

.tool-form {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  gap: 6px;
}

label {
  font-size: 14px;
  font-weight: 600;
}

select,
input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.tool-form button {
  width: 100%;
}

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

button:disabled {
  background: #a4bef5;
  border-color: #a4bef5;
  cursor: not-allowed;
}

#jobStatusText.status-done {
  color: var(--ok);
  font-weight: 700;
}

#jobStatusText.status-error {
  color: var(--error);
  font-weight: 700;
}

.download-btn {
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
  color: #fff;
  background: #0f9960;
  border-radius: 8px;
  padding: 8px 12px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  color: #355289;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.link-btn {
  width: auto;
  border: none;
  background: transparent;
  color: #355289;
  padding: 0;
  font-size: 13px;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

.legal-page {
  min-height: 100vh;
  width: min(920px, calc(100% - 24px));
  margin: 16px auto;
  display: grid;
  gap: 14px;
}

.legal-card h2 {
  margin-top: 20px;
  margin-bottom: 6px;
  font-size: 18px;
}

.legal-card p {
  margin: 6px 0;
  line-height: 1.7;
  color: #34445f;
}

.legal-footer {
  border-top: none;
  padding-top: 0;
}

.inline-btn {
  margin-left: 4px;
}

.consent-banner {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 1000;
  background: #1d2840;
  color: #fff;
  border-radius: 12px;
  border: 1px solid #2c3a5f;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.consent-banner a {
  color: #9dc0ff;
}

.consent-banner__text {
  font-size: 13px;
  line-height: 1.5;
}

.consent-banner__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.consent-btn {
  width: auto;
  border: 1px solid #4864a5;
  background: #2b3b63;
  color: #fff;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
}

.consent-btn--secondary {
  background: #354a79;
}

.consent-btn--primary {
  background: #2169f5;
  border-color: #2169f5;
}

.consent-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
}

.consent-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.consent-modal__panel {
  position: relative;
  width: min(520px, calc(100% - 24px));
  margin: 8vh auto 0;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.consent-modal__panel h3 {
  margin: 0;
}

.consent-modal__panel p {
  color: var(--muted);
  font-size: 13px;
}

.consent-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 14px;
}

.consent-note {
  margin-top: 10px;
}

.consent-modal__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid #d6deeb;
  }

  .tool-btn {
    font-size: 14px;
  }

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

  .topnav a {
    font-size: 17px;
    padding: 4px 6px;
  }

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

  .blog-head__brand h1 {
    font-size: 28px;
  }

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

  .blog-grid {
    column-count: 2;
  }

  .blog-grid--two {
    grid-template-columns: 1fr;
  }

  .consent-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .global-lang-switch {
    top: 10px;
    right: 10px;
  }
}

@media (max-width: 640px) {
  .blog-grid {
    column-count: 1;
  }
}

.topnav a.is-active {
  color: #0e2f66;
  background: #eaf1ff;
}

.eyebrow {
  margin: 0 0 8px;
  color: #2f5ca8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hub-hero {
  background:
    radial-gradient(circle at top right, rgba(33, 105, 245, 0.14), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.hub-hero--docs {
  background:
    radial-gradient(circle at top right, rgba(24, 132, 86, 0.14), transparent 35%),
    linear-gradient(180deg, #ffffff 0%, #f5fbf8 100%);
}

.hub-hero--blog {
  background:
    radial-gradient(circle at top right, rgba(184, 108, 41, 0.16), transparent 35%),
    linear-gradient(180deg, #ffffff 0%, #fff8f2 100%);
}

.hub-hero h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
}

.hub-hero p:not(.eyebrow) {
  margin: 10px 0 0;
  color: #425572;
  line-height: 1.75;
}

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: #526581;
  font-size: 13px;
}

.module-grid,
.content-grid,
.split-grid,
.article-layout {
  display: grid;
  gap: 14px;
}

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

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

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

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

.article-layout {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  align-items: start;
}

.content-card,
.module-card,
.profile-card {
  height: 100%;
}

.content-card {
  border: 1px solid #d9e3f2;
  border-radius: 14px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(18, 42, 80, 0.06);
}

.content-card--docs,
.module-card--docs {
  background: linear-gradient(180deg, #ffffff 0%, #f6fbf8 100%);
}

.content-card--blog,
.module-card--blog {
  background: linear-gradient(180deg, #ffffff 0%, #fff8f1 100%);
}

.module-card--tools {
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
}

.content-card__kicker {
  margin: 0;
  color: #3f6299;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.content-card h3,
.content-card h4,
.module-card h3 {
  margin: 10px 0 0;
}

.content-card p,
.module-card p,
.profile-card p {
  color: #425572;
  line-height: 1.7;
}

.content-card a,
.module-card a {
  color: #1e4ea7;
  font-weight: 700;
  text-decoration: none;
}

.content-card a:hover,
.module-card a:hover {
  text-decoration: underline;
}

.link-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #32435f;
  line-height: 1.7;
}

.link-list li + li {
  margin-top: 6px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #d2deef;
  background: #f7faff;
  color: #33507f;
  font-size: 13px;
  font-weight: 700;
}

.article-side {
  display: grid;
  gap: 14px;
}

.article-side .card h3 {
  margin-top: 0;
}

@media (max-width: 900px) {
  .module-grid,
  .content-grid,
  .content-grid--wide,
  .split-grid,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .hub-hero h2 {
    font-size: 26px;
  }
}
