:root {
  --bg: #080b12;
  --bg-elev: #0f1420;
  --bg-card: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.13);
  --text-main: #f3f6ff;
  --text-sub: #aab4d6;
  --brand: #6ff2d2;
  --brand-strong: #2cdcb2;
  --warning: #ffb45f;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
  --card-height: 412px;
  --card-video-height: 172px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1100px 500px at 15% -10%, #1a2a4f 0%, transparent 60%),
    radial-gradient(900px 460px at 85% -20%, #1d3f45 0%, transparent 58%), var(--bg);
  color: var(--text-main);
  font-family: "Noto Sans SC", sans-serif;
}

body {
  position: relative;
  padding: 32px 16px 72px;
}

.bg-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  opacity: 0.48;
}

.bg-glow-left {
  left: -120px;
  top: 20%;
  background: #14f2c2;
}

.bg-glow-right {
  right: -100px;
  bottom: 8%;
  background: #417dff;
}

.app-shell {
  width: min(1160px, 100%);
  margin: 0 auto;
}

.hero {
  margin-bottom: 22px;
}

.hero-banner {
  position: relative;
  width: 100%;
  margin: 0;
  min-height: 500px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #08101f;
  box-shadow: var(--shadow);
}

.hero-carousel {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slides {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 520ms ease;
}

.hero-slide.is-active {
  opacity: 1;
}

.hero-slide-bg {
  position: absolute;
  inset: -8px;
  background-size: cover;
  background-position: center;
  filter: blur(16px);
  transform: scale(1.05);
  opacity: 0.4;
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 10, 24, 0.3) 0%, rgba(5, 10, 24, 0.5) 52%, rgba(5, 10, 24, 0.78) 100%);
}

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.hero-dots {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 24px;
  height: 6px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.42);
  transition: all 180ms ease;
}

.hero-dot.is-active {
  width: 34px;
  background: #6ff2d2;
}

.hero-banner.is-single .hero-dots {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  width: 100%;
  margin: 0;
  min-height: 500px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  padding: 22px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0.6px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.46);
}

.hero-desc {
  margin: 0;
  color: #deecff;
  font-size: 16px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.46);
}

.controls {
  display: flex;
  width: min(720px, 100%);
  gap: 10px;
  flex-wrap: wrap;
}

.search-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  background: rgba(10, 21, 42, 0.56);
  backdrop-filter: blur(10px);
}

.search-wrap svg {
  width: 20px;
  height: 20px;
  fill: var(--text-sub);
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text-main);
  font-size: 15px;
  background: transparent;
}

.search-wrap input::placeholder {
  color: #8c96b8;
}

.segment-nav {
  display: flex;
  width: 100%;
  margin-top: 14px;
  gap: 8px;
  align-items: center;
}

.segment-nav::-webkit-scrollbar {
  height: 0;
}

.segment-group {
  display: flex;
  flex: 1;
  gap: 8px;
  overflow-x: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.segment-group::-webkit-scrollbar {
  height: 0;
}

.segment-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  border-radius: 10px;
  padding: 8px 13px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  transition: all 180ms ease;
}

.segment-btn-all {
  flex-shrink: 0;
  border-radius: 14px;
  padding: 10px 14px;
}

.segment-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.segment-btn.is-active {
  color: #072219;
  background: linear-gradient(120deg, var(--brand), var(--brand-strong));
  border-color: transparent;
}

.chip-group {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 700;
  transition: all 180ms ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
}

.chip.is-active {
  color: #072219;
  background: linear-gradient(120deg, var(--brand), var(--brand-strong));
  border-color: transparent;
}

.count {
  margin: 14px 0 0;
  font-size: 14px;
  color: #dbe4ff;
  font-weight: 600;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: var(--card-height);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  transform: translateY(0);
  transition: transform 220ms ease, border-color 220ms ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(111, 242, 210, 0.55);
}

.card-video-wrap {
  height: var(--card-video-height);
  flex-shrink: 0;
  background: #111a2c;
}

.card-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.26);
  font-size: 12px;
  padding: 5px 10px;
  font-weight: 700;
}

.card-orientation {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.26);
  font-size: 12px;
  padding: 5px 10px;
  font-weight: 700;
}

.card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px;
}

.card-title {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
  min-height: 46px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
}

.card-summary {
  margin: 0;
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.5;
  min-height: 63px;
  max-height: 63px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
}

.card-footer {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  gap: 8px;
}

.btn {
  flex: 1;
  border: 0;
  border-radius: 10px;
  height: 38px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: transform 160ms ease, opacity 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-preview {
  background: #f2f7ff;
  color: #0d172f;
}

.btn-copy {
  background: linear-gradient(120deg, var(--brand), var(--brand-strong));
  color: #042217;
}

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

.prompt-modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(920px, calc(100% - 24px));
  width: 100%;
}

.prompt-modal::backdrop {
  background: rgba(4, 8, 16, 0.8);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
}

.close-backdrop {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.modal-panel {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  z-index: 2;
}

.modal-video-wrap {
  aspect-ratio: 16 / 9;
  background: #08111f;
}

.modal-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-content {
  padding: 16px;
}

.modal-tag {
  margin: 0;
  font-size: 12px;
  color: var(--warning);
  font-weight: 700;
}

.modal-content h2 {
  margin: 8px 0 8px;
  font-size: 22px;
  color: #f3f6ff;
}

.modal-content > p {
  margin: 0 0 16px;
  color: var(--text-sub);
}

.modal-content h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #f3f6ff;
}

.modal-content pre {
  margin: 0;
  white-space: pre-wrap;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  line-height: 1.55;
  color: #eaf1ff;
  max-height: 300px;
  overflow: auto;
}

#modal-title,
#modal-prompt {
  color: #f3f6ff;
}

.modal-content .btn-copy {
  margin-top: 12px;
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(24px);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 14px;
  padding: 9px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 760px) {
  :root {
    --card-height: 396px;
    --card-video-height: 162px;
  }

  body {
    padding-top: 20px;
  }

  .hero-banner {
    min-height: 340px;
    border-radius: 16px;
  }

  .hero-content {
    width: 100%;
    min-height: 340px;
    padding: 16px;
    gap: 10px;
  }

  .hero h1 {
    margin: 0;
    font-size: clamp(24px, 7.2vw, 34px);
  }

  .hero-desc {
    font-size: 14px;
  }

  .hero-dots {
    right: 12px;
    bottom: 12px;
  }

  .card-summary {
    min-height: 63px;
  }
}
