.tf-topic .gt-nav,
.tf-topic-layout .gt-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tf-lab {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.tf-select-label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-weight: 900;
}

.tf-select-label select {
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 12px;
  padding: 0 10px;
  color: #0f172a;
  font-weight: 900;
  background: #fff;
}

.tf-model-visual,
.tf-exp-visual {
  display: grid;
  place-items: center;
  min-height: 330px;
  padding: 16px;
  border: 1px solid rgba(190, 202, 222, 0.82);
  border-radius: 16px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)),
    repeating-linear-gradient(0deg, rgba(37, 99, 235, 0.055) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg, rgba(20, 184, 166, 0.055) 0 1px, transparent 1px 30px);
  overflow: hidden;
}

.tf-exp-workbench {
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.tf-exp-story {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(190, 202, 222, 0.82);
  border-radius: 16px;
  background: #fff;
}

.tf-exp-story span {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: #075985;
  background: #e0f2fe;
  font-weight: 950;
}

.tf-exp-story strong {
  color: #0f172a;
  font-size: 1.15rem;
  line-height: 1.24;
}

.tf-exp-story p {
  margin: 0;
  color: #475569;
  line-height: 1.55;
}

.tf-exp-board {
  display: grid;
  gap: 12px;
}

.tf-exp-svg,
.tf-model-svg {
  width: min(100%, 560px);
  min-height: 280px;
}

.tf-exp-svg .grid line,
.tf-model-svg .grid line {
  stroke: rgba(148, 163, 184, 0.28);
  stroke-width: 1;
}

.tf-original {
  fill: rgba(14, 165, 233, 0.35);
  stroke: #0369a1;
  stroke-width: 4;
  stroke-linejoin: round;
}

.tf-image {
  fill: rgba(245, 158, 11, 0.35);
  stroke: #b45309;
  stroke-width: 4;
  stroke-linejoin: round;
}

.tf-image.is-on,
.tf-guide.is-on,
.tf-axis.is-on,
.tf-arc.is-on,
.tf-center-ring.is-on,
.tf-dot.is-on {
  opacity: 1;
}

.tf-exp-svg .tf-image,
.tf-exp-svg .tf-guide,
.tf-exp-svg .tf-axis,
.tf-exp-svg .tf-arc,
.tf-exp-svg .tf-center-ring,
.tf-exp-svg .tf-dot {
  opacity: 0.22;
}

.tf-axis {
  stroke: #db2777;
  stroke-width: 4;
  stroke-dasharray: 8 8;
}

.tf-guide {
  stroke: #334155;
  stroke-width: 3;
  stroke-dasharray: 6 6;
}

.tf-arc {
  fill: none;
  stroke: #7c3aed;
  stroke-width: 5;
  stroke-linecap: round;
}

.tf-center-ring {
  fill: none;
  stroke: rgba(124, 58, 237, 0.38);
  stroke-width: 4;
}

.tf-center-dot,
.tf-dot {
  fill: #7c3aed;
}

.pt-label,
.tf-exp-svg text,
.tf-model-svg text {
  fill: #334155;
  font-size: 15px;
  font-weight: 900;
  text-anchor: start;
}

.tf-case-grid {
  grid-template-columns: repeat(3, minmax(270px, 1fr));
}

.tf-case {
  display: grid;
  gap: 12px;
  min-height: 540px;
  padding: 14px;
  border: 1px solid rgba(190, 202, 222, 0.76);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(30, 41, 59, 0.05);
}

.tf-case-head {
  display: grid;
  gap: 4px;
}

.tf-case-head span {
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 950;
}

.tf-case-head strong {
  color: #0f172a;
  font-size: 1.14rem;
  line-height: 1.2;
}

.tf-case p {
  margin: 0;
  color: #64748b;
  line-height: 1.55;
}

.tf-case-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tf-case-controls label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #334155;
  font-weight: 900;
}

.tf-case-controls input {
  width: 100%;
}

.tf-case-scene {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 16px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(248, 250, 252, 0.94), rgba(240, 253, 250, 0.88)),
    repeating-linear-gradient(0deg, rgba(15, 23, 42, 0.035) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(15, 23, 42, 0.035) 0 1px, transparent 1px 24px);
  overflow: hidden;
}

.tf-case-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tf-case-metrics span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 12px;
  color: #64748b;
  background: #f8fafc;
  font-size: 0.74rem;
  font-weight: 900;
}

.tf-case-metrics b {
  color: #0f172a;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.tf-case-result {
  min-height: 78px;
  padding: 12px;
  border-radius: 14px;
  color: #254155;
  background: rgba(236, 253, 245, 0.9);
  font-weight: 850;
  line-height: 1.45;
}

.tf-object {
  position: relative;
  width: min(100%, 250px);
  min-height: 175px;
}

.tf-object em {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  z-index: 8;
  max-width: 90%;
  padding: 6px 10px;
  border-radius: 999px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 950;
  text-align: center;
}

.tf-butterfly {
  display: grid;
  place-items: center;
}

.tf-butterfly b {
  position: absolute;
  z-index: 4;
  width: 18px;
  height: 112px;
  border-radius: 999px;
  background: #334155;
}

.tf-butterfly::before,
.tf-butterfly::after {
  content: "";
  position: absolute;
  width: var(--wing);
  height: 110px;
  border: 5px solid #7c3aed;
  background: linear-gradient(135deg, #f0abfc, #bfdbfe);
}

.tf-butterfly::before {
  right: 50%;
  border-radius: 70% 20% 70% 30%;
  transform: rotate(-18deg);
}

.tf-butterfly::after {
  left: 50%;
  border-radius: 20% 70% 30% 70%;
  transform: rotate(18deg);
}

.tf-butterfly .left-wing,
.tf-butterfly .right-wing {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.tf-butterfly i {
  position: absolute;
  top: var(--spot-y);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff7ed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.26);
}

.tf-butterfly .left-wing i {
  right: calc(50% + var(--spot-offset));
}

.tf-butterfly .right-wing i {
  left: calc(50% + var(--spot-offset));
}

.tf-paper {
  display: grid;
  place-items: center;
}

.tf-paper b {
  position: absolute;
  width: 150px;
  height: 130px;
  border: 3px solid #0f766e;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(20, 184, 166, 0.18) 50%, rgba(14, 165, 233, 0.16) 50%),
    #ffffff;
}

.tf-paper b::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  bottom: 8px;
  border-left: 3px dashed #db2777;
}

.tf-paper span {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.tf-paper i {
  position: absolute;
  top: var(--cut-y);
  left: var(--cut-x);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
}

.tf-lake b {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 34px;
  height: 72px;
  clip-path: polygon(0 100%, 18% 34%, 32% 100%, 52% 12%, 76% 100%, 100% 42%, 100% 100%);
  background: linear-gradient(135deg, #166534, #84cc16);
}

.tf-lake span {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 108px;
  height: 70px;
  clip-path: polygon(0 0, 18% 66%, 32% 0, 52% 88%, 76% 0, 100% 58%, 100% 0);
  background: linear-gradient(135deg, rgba(22, 101, 52, 0.34), rgba(14, 165, 233, 0.25));
  transform: scaleY(var(--reflection-scale));
  transform-origin: top;
}

.tf-lake::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 106px;
  height: 6px;
  border-radius: 999px;
  background: #0284c7;
}

.tf-logo {
  display: grid;
  place-items: center;
}

.tf-logo b {
  position: absolute;
  width: var(--badge);
  height: 134px;
  clip-path: polygon(50% 0, 92% 14%, 86% 70%, 50% 100%, 14% 70%, 8% 14%);
  background:
    linear-gradient(90deg, rgba(59, 130, 246, 0.28) 50%, rgba(245, 158, 11, 0.28) 50%),
    #f8fafc;
  border: 4px solid #1d4ed8;
}

.tf-logo b::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  bottom: 8px;
  border-left: 3px dashed #db2777;
}

.tf-logo span {
  position: absolute;
  inset: 0;
}

.tf-logo span i,
.tf-logo span .star {
  position: absolute;
  left: calc(50% - 5px);
  top: calc(50% - 4px);
  width: 10px;
  height: 10px;
  clip-path: polygon(50% 0, 61% 36%, 98% 36%, 68% 57%, 79% 92%, 50% 70%, 21% 92%, 32% 57%, 2% 36%, 39% 36%);
  background: #facc15;
  transform: rotate(var(--rot)) translateY(-46px);
}

.tf-chess {
  background:
    linear-gradient(45deg, #c7d2fe 25%, transparent 25% 75%, #c7d2fe 75%),
    linear-gradient(45deg, #c7d2fe 25%, transparent 25% 75%, #c7d2fe 75%);
  background-position: 0 0, 20px 20px;
  background-size: 40px 40px;
  border: 5px solid #475569;
  border-radius: 10px;
}

.tf-chess b,
.tf-chess span {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 42% 42%;
  background: #0f172a;
}

.tf-chess b {
  left: 38px;
  bottom: 42px;
}

.tf-chess span {
  left: calc(38px + var(--shift));
  bottom: calc(42px + var(--rise));
  background: #f97316;
}

.tf-chess::after,
.tf-conveyor span,
.tf-map::after {
  content: "";
  position: absolute;
  left: 82px;
  bottom: 58px;
  width: var(--shift);
  height: 4px;
  border-radius: 999px;
  background: #334155;
  transform: translateY(var(--arrow-lift)) rotate(-18deg);
}

.tf-conveyor {
  border-radius: 18px;
  background: linear-gradient(#e2e8f0 0 45%, #64748b 45% 58%, #e2e8f0 58%);
}

.tf-conveyor b {
  position: absolute;
  left: calc(var(--box-left) + var(--shift));
  top: 58px;
  width: 32px;
  height: 32px;
  border: 3px solid #92400e;
  border-radius: 6px;
  background: #fbbf24;
}

.tf-conveyor::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 107px;
  height: 22px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #475569 0 18px, #94a3b8 18px 30px);
}

.tf-tiles {
  display: grid;
  grid-template-columns: repeat(4, 42px);
  justify-content: center;
  align-content: center;
  gap: 5px;
  padding: 22px;
  background: #f8fafc;
  border: 4px solid #94a3b8;
  border-radius: 14px;
}

.tf-tiles b {
  width: 42px;
  height: 34px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 28% 34%, #f97316 0 6px, transparent 7px),
    linear-gradient(135deg, #bfdbfe 0 50%, #ccfbf1 50%);
  transform: translate(var(--tile-x), var(--tile-y));
}

.tf-map {
  background:
    linear-gradient(135deg, rgba(187, 247, 208, 0.76), rgba(219, 234, 254, 0.82)),
    repeating-linear-gradient(60deg, rgba(15, 23, 42, 0.1) 0 2px, transparent 2px 28px);
  border: 4px solid #22c55e;
  border-radius: 18px;
}

.tf-map b,
.tf-map span {
  position: absolute;
  left: 42px;
  top: 104px;
  width: 118px;
  height: 44px;
  border: 5px solid #ef4444;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 22px 0 0;
}

.tf-map span {
  left: calc(42px + var(--shift));
  top: calc(104px - var(--rise));
  border-color: #2563eb;
}

.tf-clock,
.tf-wheel {
  border-radius: 50%;
  background: #fff;
  border: 8px solid #0f172a;
  box-shadow: inset 0 0 0 6px #e2e8f0;
}

.tf-clock b,
.tf-clock span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 68px;
  border-radius: 999px;
  background: #0ea5e9;
  transform-origin: center bottom;
  transform: translate(-50%, -100%);
}

.tf-clock span {
  background: #f97316;
  transform: translate(-50%, -100%) rotate(var(--angle));
}

.tf-clock::after,
.tf-windmill b,
.tf-wheel b {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0f172a;
  transform: translate(-50%, -50%);
  z-index: 4;
}

.tf-windmill {
  display: grid;
  place-items: center;
}

.tf-windmill i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 68px;
  border-radius: 100% 10% 80% 10%;
  background: linear-gradient(#38bdf8, #f97316);
  transform-origin: center bottom;
  transform: translate(-50%, -100%) rotate(var(--rot));
}

.tf-wheel i.seat {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 18px;
  border: 3px solid #7c3aed;
  border-radius: 4px 4px 10px 10px;
  background: #ddd6fe;
  transform: translate(-50%, -50%) rotate(var(--rot)) translateY(-74px);
}

.tf-wheel::before {
  content: "";
  position: absolute;
  inset: 34px;
  border: 3px dashed rgba(15, 23, 42, 0.35);
  border-radius: 50%;
}

.tf-robot {
  display: grid;
  place-items: center;
}

.tf-robot b {
  position: absolute;
  width: 70px;
  height: 78px;
  border: 5px solid #334155;
  border-radius: 16px 16px 10px 10px;
  background:
    radial-gradient(circle at 35% 34%, #0f172a 0 5px, transparent 6px),
    radial-gradient(circle at 65% 34%, #0f172a 0 5px, transparent 6px),
    #a7f3d0;
  transform: rotate(var(--angle));
}

.tf-robot span {
  position: absolute;
  width: var(--robot-ray);
  height: 5px;
  border-radius: 999px;
  background: #f97316;
  transform: rotate(var(--angle)) translateX(64px);
}

html[lang="en"] .tf-case {
  min-height: 585px;
}

html[lang="en"] .tf-case-head strong {
  font-size: 1.02rem;
}

html[lang="en"] .tf-case-controls {
  grid-template-columns: 1fr;
}

html[lang="en"] .tf-case-metrics {
  grid-template-columns: 1fr;
}

html[lang="en"] .tf-exp-workbench,
html[lang="en"] .tf-lab {
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
}

@media (max-width: 980px) {
  .tf-case-grid {
    grid-template-columns: repeat(2, minmax(250px, 1fr));
  }

  .tf-lab,
  .tf-exp-workbench,
  html[lang="en"] .tf-exp-workbench,
  html[lang="en"] .tf-lab {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .tf-topic .gt-nav,
  .tf-topic-layout .gt-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .tf-case-controls,
  .tf-case-metrics {
    grid-template-columns: 1fr;
  }

  .tf-object {
    width: min(100%, 220px);
  }
}
