.factory-main-content {
  --portal-bg: #f6f8fb;
  --portal-surface: #ffffff;
  --portal-text: #0f172a;
  --portal-muted: #64748b;
  --portal-border: #dbe3ee;
  --portal-red: #ff2a2a;
  --portal-red-dark: #d91f1f;
  --portal-chip: #eef2f8;
  --portal-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  background:
    radial-gradient(circle at 15% -10%, #d9f1ff 0%, rgba(217, 241, 255, 0) 45%),
    radial-gradient(circle at 90% 0%, #ffe7df 0%, rgba(255, 231, 223, 0) 40%),
    var(--portal-bg);
  padding: 24px 24px 42px;
  min-height: calc(100vh - 70px);
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.hero-copy {
  background: linear-gradient(125deg, #0f172a 0%, #1e293b 48%, #253a67 100%);
  color: #fff;
  border-radius: 18px;
  padding: 30px;
  box-shadow: var(--portal-shadow);
  position: relative;
  overflow: hidden;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -80px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 65%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 16px 0 12px;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hero-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  max-width: 620px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 18px;
  transition: all 0.18s ease;
}

.hero-btn.primary {
  background: var(--portal-red);
  color: #fff;
  box-shadow: 0 10px 20px rgba(255, 42, 42, 0.25);
}

.hero-btn.primary:hover {
  transform: translateY(-2px);
  background: var(--portal-red-dark);
  color: #fff;
}

.hero-btn.ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-btn.ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.hero-feature {
  display: block;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--portal-shadow);
  min-height: 340px;
  background: #0f172a;
  color: #fff;
  text-decoration: none;
}

.hero-feature img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.hero-feature:hover img {
  transform: scale(1.04);
}

.hero-feature::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 15%, rgba(15, 23, 42, 0.88) 100%);
  z-index: 1;
}

.hero-play {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  color: var(--portal-red);
  font-size: 22px;
  z-index: 2;
}

.hero-meta {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 2;
}

.hero-kicker {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 6px;
}

.hero-meta h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
  color: #fff;
}

.hero-meta div {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

.topic-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--portal-chip);
  color: #334155;
  border: 1px solid #dde6f1;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 13px;
  text-decoration: none;
  transition: all 0.18s ease;
}

.topic-chip:hover,
.topic-chip.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(320px, 1fr);
  gap: 20px;
  align-items: start;
}

.surface-card {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: 16px;
  box-shadow: var(--portal-shadow);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 18px 10px;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 20px;
  color: var(--portal-text);
  letter-spacing: -0.01em;
}

.section-sub {
  color: var(--portal-muted);
  font-size: 13px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 8px 18px 22px;
}

.video-card {
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.12);
}

.video-thumbnail {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  background: #e2e8f0;
  overflow: hidden;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.video-card:hover .video-thumbnail img {
  transform: scale(1.05);
}

.video-info {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  position: relative;
}

.channel-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
}

.video-details h6 {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
}

.video-details h6 a {
  color: #0f172a;
  text-decoration: none;
}

.video-details h6 a:hover {
  color: var(--portal-red);
}

.video-meta {
  font-size: 12px;
  color: var(--portal-muted);
  line-height: 1.65;
}

.wiki-panel {
  margin-bottom: 18px;
}

.wiki-list {
  padding: 0 14px 14px;
}

.wiki-entry {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.wiki-entry:last-child {
  margin-bottom: 0;
}

.wiki-title {
  margin: 0;
  color: #0f172a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  display: block;
}

.wiki-title:hover {
  color: var(--portal-red);
}

.wiki-entry p {
  margin: 8px 0;
  color: #334155;
  line-height: 1.65;
  font-size: 13px;
}

.wiki-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 12px;
}

.glossary-list {
  display: grid;
  gap: 10px;
  padding: 0 14px 16px;
}

.glossary-item {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 12px;
}

.glossary-item strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
  margin-bottom: 6px;
}

.glossary-item span {
  color: #475569;
  font-size: 12px;
  line-height: 1.6;
}

.knowledge-stream {
  margin-top: 22px;
}

.stream-wrap {
  padding: 0 18px 20px;
}

.stream-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 12px;
}

.stream-card:last-child {
  margin-bottom: 0;
}

.stream-image {
  position: relative;
  min-height: 152px;
  display: block;
  background: #e2e8f0;
}

.stream-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stream-content {
  padding: 14px 16px 12px 0;
}

.stream-type {
  display: inline-flex;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b91c1c;
  background: #fee2e2;
  padding: 4px 10px;
  margin-bottom: 8px;
}

.stream-content h3 {
  margin: 0;
  line-height: 1.45;
  font-size: 18px;
}

.stream-content h3 a {
  text-decoration: none;
  color: #0f172a;
}

.stream-content h3 a:hover {
  color: var(--portal-red);
}

.stream-content p {
  margin: 10px 0;
  color: #334155;
  font-size: 14px;
  line-height: 1.7;
}

.stream-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #64748b;
}

.stream-footer a {
  color: #b91c1c;
  text-decoration: none;
  font-weight: 700;
}

.stream-footer a:hover {
  color: #7f1d1d;
}

.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 18px;
}

.loading-indicator.hidden {
  display: none;
}

.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--portal-red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-text {
  font-size: 12px;
  color: #64748b;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1400px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .portal-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991px) {
  .factory-main-content {
    padding: 16px 14px 28px;
  }

  .portal-hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 24px 20px;
  }

  .hero-copy h1 {
    font-size: 28px;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .stream-card {
    grid-template-columns: 1fr;
  }

  .stream-image {
    min-height: 200px;
  }

  .stream-content {
    padding: 0 14px 12px;
  }
}
