:root {
  --sidebar: #151716;
  --surface: #ffffff;
  --page: #f6f7f6;
  --line: #dfe5e1;
  --text: #26302b;
  --muted: #69756e;
  --green: #23a955;
  --green-dark: #168343;
  --amber: #c98b21;
  --red: #cf3f55;
  --blue: #2f83c5;
  --shadow: 0 10px 28px rgba(20, 30, 24, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  inline-size: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background: var(--page);
  font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr) minmax(0, 260px);
}

html[dir="rtl"] body {
  direction: rtl;
}

html[dir="rtl"] .tool-card,
html[dir="rtl"] .search,
html[dir="rtl"] label,
html[dir="rtl"] textarea,
html[dir="rtl"] input {
  text-align: right;
}

a {
  color: var(--green-dark);
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
  min-width: 0;
}

button {
  cursor: pointer;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10;
  transform: translateY(-160%);
  background: #fff;
  color: var(--green-dark);
  border: 2px solid var(--green);
  padding: 10px 12px;
}

.skip-link:focus {
  transform: translateY(0);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar);
  padding: 26px 18px;
  color: #d9e2dd;
}

.brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  margin-bottom: 22px;
}

.logo {
  width: 68px;
  height: 68px;
}

.brand-name {
  color: var(--green);
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
}

.brand-subtitle {
  color: #8c9891;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #d9e2dd;
  text-align: left;
  padding: 9px 10px;
  border-radius: 4px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--green);
  background: rgba(255, 255, 255, 0.05);
}

.nav-group {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.nav-heading {
  width: 100%;
  border: 0;
  background: transparent;
  color: #f1f5f2;
  padding: 6px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
}

.nav-heading::after {
  content: "+";
  color: var(--green);
  font-weight: 800;
}

.nav-heading[aria-expanded="true"]::after {
  content: "-";
}

.nav-heading small {
  color: #7f8c85;
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: 2ch;
  text-align: right;
}

.nav-heading span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-tools {
  display: grid;
  gap: 1px;
  margin-top: 2px;
}

.nav-tools[hidden] {
  display: none;
}

.nav-tool {
  border: 0;
  background: transparent;
  color: #aeb9b3;
  min-height: 28px;
  padding: 4px 6px;
  border-radius: 3px;
  text-align: left;
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: grid;
  grid-template-columns: minmax(24px, max-content) minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  min-width: 0;
}

.nav-tool-icon {
  width: auto;
  min-width: 24px;
  max-width: 100%;
  min-height: 20px;
  padding: 0 3px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(35, 169, 85, 0.35);
  border-radius: 3px;
  color: var(--green);
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: center;
  max-inline-size: 100%;
}

.nav-tool-name {
  overflow: hidden;
  overflow-wrap: anywhere;
}

.nav-tool:hover,
.nav-tool:focus {
  color: var(--green);
  background: rgba(255, 255, 255, 0.06);
}

.main {
  padding: 32px;
  width: 100%;
  inline-size: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.page-intro {
  margin-bottom: 22px;
}

.page-intro h1 {
  margin: 4px 0 8px;
  font-size: 34px;
  line-height: 1.15;
}

.page-intro p {
  max-width: 780px;
  color: var(--muted);
  margin: 0;
}

.notice,
.toolbar,
.tool-view,
.ad-strip {
  background: var(--surface);
  border: 1px solid var(--line);
}

.notice {
  padding: 14px 16px;
  margin-bottom: 28px;
}

.okx-ad a {
  color: inherit;
  text-decoration: none;
}

.ad-strip {
  margin: -10px 0 26px;
  padding: 0;
  overflow: hidden;
}

.ad-strip a {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(90deg, #101512, #153e2c);
  color: #f4fff8;
  min-width: 0;
}

.ad-strip strong,
.side-ad strong {
  color: #fff;
  letter-spacing: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ad-strip b,
.side-ad b {
  color: #111;
  background: #d6ff52;
  border-radius: 4px;
  padding: 7px 10px;
  white-space: nowrap;
}

.ad-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid rgba(214, 255, 82, 0.45);
  color: #d6ff52;
  border-radius: 3px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 700;
}

.side-ad {
  margin: 18px 0 6px;
}

.side-ad a {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #111712;
  color: #dce8df;
  border: 1px solid #233529;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 26px;
}

.search {
  display: grid;
  gap: 6px;
  width: min(430px, 100%);
  color: var(--muted);
}

.language-picker {
  width: min(230px, 100%);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd8d2;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  min-height: 44px;
}

input[type="checkbox"] {
  width: auto;
}

input[type="radio"] {
  width: auto;
  min-height: auto;
}

textarea {
  min-height: 150px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(35, 169, 85, 0.12);
}

.category {
  margin-bottom: 34px;
  min-width: 0;
}

.category h2 {
  font-size: 16px;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  min-width: 0;
  width: 100%;
}

.tool-card {
  min-height: 110px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 16px;
  text-align: left;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  align-content: space-between;
  border-radius: 3px;
  color: inherit;
  text-decoration: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.tool-card:hover {
  border-color: #b9d8c4;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.tool-card:focus {
  outline: 3px solid rgba(35, 169, 85, 0.28);
  outline-offset: 2px;
}

.tool-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.icon {
  display: inline-grid;
  place-items: center;
  width: auto;
  min-width: 26px;
  max-width: 100%;
  min-height: 26px;
  padding: 3px 5px;
  border: 1px solid #b9d8c4;
  color: var(--green-dark);
  border-radius: 4px;
  font-size: clamp(7px, 0.78em, 11px);
  line-height: 1;
  font-weight: 800;
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: center;
  min-inline-size: 0;
  max-inline-size: 100%;
  justify-self: start;
}

.tool-card strong {
  color: var(--green-dark);
  font-size: 15px;
  display: block;
  max-width: 100%;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  text-wrap: pretty;
}

.tool-card small,
.meta {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tool-card-body,
.tool-card-body > *,
.tool-card strong,
.tool-card small,
.icon,
.nav-tool-name,
.category h2 {
  min-width: 0;
}

.tool-card strong,
.tool-card small {
  max-width: 100%;
}

.rightbar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-left: 1px solid var(--line);
  background: #fafafa;
  padding: 32px 18px;
  overflow-y: auto;
}

.rightbar h2 {
  font-size: 15px;
  margin: 24px 0 8px;
}

.date-card {
  border: 1px dashed #ddc58f;
  background: #fffaf0;
  color: #9b6c16;
  padding: 16px;
  text-align: center;
  line-height: 1.8;
}

.favorites {
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  color: var(--muted);
}

.tool-view {
  padding: 20px;
}

.tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.tool-head h1 {
  font-size: 22px;
  margin: 0;
}

.panel {
  display: grid;
  gap: 14px;
}

.tool-note {
  border: 1px solid var(--line);
  background: #fbfcfb;
  color: var(--muted);
  padding: 12px 14px;
  overflow-wrap: anywhere;
}

.compact-note {
  padding: 9px 12px;
  font-size: 13px;
}

.tool-note strong {
  display: block;
  color: var(--text);
  margin-bottom: 3px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

.workflow-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
}

.workflow-layout h2,
.compact-head h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.workflow-menu,
.workflow-steps,
.workflow-fields {
  display: grid;
  gap: 8px;
}

.workflow-menu .ghost {
  justify-content: flex-start;
  text-align: left;
}

.workflow-step {
  background: #fff;
}

.workflow-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.empty-state {
  border: 1px dashed var(--line);
  color: var(--muted);
  padding: 14px;
}

.compact-head {
  margin-bottom: 8px;
  padding-bottom: 8px;
}

fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  margin: 0;
  display: grid;
  gap: 8px;
}

legend {
  color: var(--text);
  font-weight: 700;
  padding: 0 4px;
}

fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.counter-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.case-results {
  display: grid;
  gap: 12px;
}

.case-results label {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.primary,
.ghost,
.danger {
  border: 0;
  border-radius: 4px;
  padding: 10px 14px;
  min-height: 44px;
  color: #fff;
  background: var(--green);
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.ghost {
  background: #eef5f0;
  color: var(--green-dark);
  border: 1px solid #cce3d4;
}

.danger {
  background: var(--red);
}

.result {
  border: 1px solid var(--line);
  background: #fbfcfb;
  min-height: 56px;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.result table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  white-space: normal;
  table-layout: auto;
}

.result th,
.result td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}

.stats-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
}

.stats-table th,
.stats-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stats-table th {
  background: #f4f8f5;
  color: var(--text);
}

.stats-table td:last-child,
.stats-table th:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#counterBreakdownTable td:last-child,
#counterBreakdownTable th:last-child {
  text-align: left;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.table-scroll .stats-table {
  min-width: 480px;
  table-layout: auto;
}

.table-scroll .stats-table th,
.table-scroll .stats-table td {
  overflow-wrap: normal;
  word-break: normal;
}

.table-scroll .frequency-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 0.92rem;
}

.frequency-table th,
.frequency-table td {
  padding: 8px 6px;
  white-space: nowrap;
}

.frequency-table th:nth-child(1),
.frequency-table td:nth-child(1) {
  width: 42px;
}

.frequency-table th:nth-child(3),
.frequency-table td:nth-child(3) {
  width: 54px;
}

.frequency-table th:nth-child(4),
.frequency-table td:nth-child(4) {
  width: 62px;
}

.random-number-table {
  table-layout: fixed;
  font-size: 0.92rem;
}

.random-number-table th,
.random-number-table td {
  padding: 8px 6px;
  word-break: normal;
}

.random-number-table th:nth-child(1),
.random-number-table td:nth-child(1) {
  width: 44px;
}

.random-number-table th:nth-child(3),
.random-number-table td:nth-child(3) {
  width: 58px;
}

.highlight-box {
  min-height: 150px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.highlight-box mark {
  background: #fff1a8;
  color: inherit;
  padding: 0 2px;
}

.json-view[hidden],
textarea[hidden] {
  display: none;
}

.json-tree {
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  max-height: 420px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.json-tree details {
  margin-left: 14px;
}

.json-tree summary {
  cursor: pointer;
  min-height: 28px;
  overflow-wrap: anywhere;
}

.json-leaf {
  margin-left: 28px;
  min-height: 24px;
  overflow-wrap: anywhere;
}

.json-key {
  color: var(--green-dark);
  font-weight: 700;
}

.json-type {
  color: #5e6f66;
}

.json-value {
  color: #1b2a22;
}

.swatches,
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  padding: 7px 9px;
  border-radius: 4px;
}

.symbol-sections {
  display: grid;
  gap: 18px;
}

.symbol-group {
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
  border-radius: 4px;
}

.symbol-group h2 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--green-dark);
}

.symbol-chip {
  min-width: 38px;
  min-height: 38px;
  font-size: 18px;
  line-height: 1;
}

.swatch {
  width: 42px;
  height: 42px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.color-preview {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.color-main-swatch {
  width: 88px;
  height: auto;
  min-height: 88px;
}

.color-swatch {
  width: 76px;
  height: 56px;
  display: grid;
  place-items: end center;
  padding: 4px;
  font-size: 11px;
  color: #111;
  text-shadow: 0 1px 0 rgba(255,255,255,.65);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.crawler-links {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 18px;
  margin: 28px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.crawler-links h2 {
  width: 100%;
  margin: 0 0 4px;
  font-size: 16px;
}

.crawler-links a {
  border: 1px solid var(--line);
  padding: 9px 11px;
  border-radius: 4px;
  text-decoration: none;
  background: #fff;
}

@media (max-width: 1180px) {
  body {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .rightbar {
    display: none;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  }
}

@media (max-width: 760px) {
  body {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .brand {
    margin-bottom: 12px;
  }

  nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .main {
    padding: 18px;
  }

  .page-intro h1 {
    font-size: 28px;
  }

  .toolbar,
  .ad-strip a,
  .tool-head,
  .two-col,
  .option-grid,
  .workflow-layout,
  .workflow-fields {
    display: grid;
    grid-template-columns: 1fr;
  }

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

.seo-page {
  display: block;
  background: var(--page);
}

.seo-landing {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 60px;
}

.seo-breadcrumb {
  margin-bottom: 18px;
  color: var(--muted);
}

.seo-breadcrumb a,
.seo-link-grid a {
  color: var(--green-dark);
  text-decoration: none;
}

.seo-hero,
.seo-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 18px;
}

.seo-hero h1 {
  margin: 8px 0 10px;
  font-size: 48px;
  line-height: 1.08;
}

.seo-hero p,
.seo-content p {
  max-width: 760px;
  color: var(--muted);
}

.seo-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.seo-content h2 {
  margin: 22px 0 10px;
  font-size: 20px;
}

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

.seo-link-grid a {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  border-radius: 4px;
}

@media (max-width: 760px) {
  .seo-hero,
  .seo-content {
    padding: 18px;
  }

  .seo-hero h1 {
    font-size: 30px;
  }

  .seo-link-grid {
    grid-template-columns: 1fr;
  }
}
