.aivc-player {
  width: 100%;
  margin: 18px 0;
}

.aivc-watch {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.aivc-video-shell {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background: #101010;
  overflow: hidden;
}

.aivc-frame,
.aivc-frame iframe {
  width: 100%;
  height: 100%;
}

.aivc-frame iframe {
  border: 0;
  display: block;
}

.aivc-chat-panel {
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: #fff;
}

.aivc-chat-title {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  color: #111827;
  background: #f9fafb;
  font-weight: 700;
  line-height: 1.4;
}

.aivc-chat {
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
}

.aivc-chat-item {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 0;
  border-left: 4px solid transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  color: #111827;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.aivc-chat-item:hover,
.aivc-chat-item:focus-visible {
  background: rgba(37, 99, 235, 0.06);
}

.aivc-chat-item.is-active {
  border-left-color: var(--aivc-color, #2563eb);
  background: rgba(37, 99, 235, 0.1);
}

.aivc-chat-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.aivc-chat-time {
  color: #2563eb;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.aivc-chat-name {
  color: var(--aivc-color, #111827);
  font-size: 13px;
  line-height: 1.3;
}

.aivc-chat-text {
  font-size: 14px;
  line-height: 1.55;
}

.aivc-chat-empty {
  margin: 0;
  padding: 14px;
  color: #6b7280;
}

.aivc-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.aivc-player.is-muted .aivc-overlay {
  display: none;
}

.aivc-player.is-paused .aivc-bubble,
.aivc-player.is-paused .aivc-chip,
.aivc-player.is-paused .aivc-pop {
  animation-play-state: paused;
}

.aivc-side {
  position: absolute;
  top: 12px;
  right: 12px;
  width: min(36%, 320px);
  display: grid;
  gap: 8px;
}

.aivc-bubble {
  color: #fff;
  background: rgba(10, 10, 10, var(--aivc-bg-opacity, 0.42));
  border-left: 4px solid var(--aivc-color, #fff);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: clamp(12px, 1.6vw, 15px);
  line-height: 1.45;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  animation: aivcFade 4.8s ease forwards;
}

.aivc-name {
  color: var(--aivc-color, #fff);
  font-size: 0.78em;
  font-weight: 700;
}

.aivc-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.aivc-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.14);
}

.aivc-bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 18px;
  display: flex;
  justify-content: center;
}

.aivc-bottom .aivc-chip {
  max-width: min(92%, 760px);
  color: #fff;
  background: rgba(0, 0, 0, var(--aivc-bg-opacity, 0.42));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: clamp(13px, 2vw, 18px);
  line-height: 1.4;
  text-align: center;
  text-shadow: 0 1px 2px #000;
  animation: aivcSlideUp 3.8s ease forwards;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.aivc-pulse {
  position: absolute;
  inset: 0;
}

.aivc-pulse .aivc-pop {
  position: absolute;
  left: var(--aivc-left, 18%);
  top: var(--aivc-top, 22%);
  color: #fff;
  background: rgba(0, 0, 0, var(--aivc-bg-opacity, 0.42));
  border-left: 4px solid var(--aivc-color, #fff);
  border-radius: 6px;
  padding: 7px 10px;
  font-weight: 700;
  font-size: clamp(13px, 2.1vw, 20px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.58);
  animation: aivcPop 2.7s ease forwards;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.aivc-comment-list {
  display: grid;
  gap: 10px;
  padding-left: 0;
  list-style: none;
}

.aivc-comment-list-item {
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.aivc-comment-list-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.aivc-comment-list-time {
  font-variant-numeric: tabular-nums;
  color: #2563eb;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font: inherit;
}

.aivc-comment-list-time:hover,
.aivc-comment-list-time:focus-visible {
  color: #1d4ed8;
}

.aivc-comment-list-name {
  white-space: nowrap;
}

.aivc-toggle {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  border: 0;
  border-radius: 6px;
  padding: 6px 9px;
  color: #fff;
  background: rgba(0, 0, 0, 0.76);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.aivc-fullscreen {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 3;
  border: 0;
  border-radius: 6px;
  padding: 6px 9px;
  color: #fff;
  background: rgba(0, 0, 0, 0.76);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.aivc-player.is-fullscreen .aivc-overlay,
.aivc-player:fullscreen .aivc-overlay,
.aivc-player:-webkit-full-screen .aivc-overlay {
  z-index: 4;
}

.aivc-player.is-fullscreen .aivc-toggle,
.aivc-player.is-fullscreen .aivc-fullscreen,
.aivc-player:fullscreen .aivc-toggle,
.aivc-player:fullscreen .aivc-fullscreen,
.aivc-player:-webkit-full-screen .aivc-toggle,
.aivc-player:-webkit-full-screen .aivc-fullscreen {
  z-index: 5;
}

.aivc-link-card {
  margin: 20px 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.aivc-link-card:hover,
.aivc-link-card:focus-within {
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.aivc-link-card-inner {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  color: inherit;
  text-decoration: none;
}

.aivc-link-card-inner:hover,
.aivc-link-card-inner:focus {
  color: inherit;
  text-decoration: none;
}

.aivc-link-card-inner-no-image {
  grid-template-columns: 1fr;
}

.aivc-link-card-image {
  display: block;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  overflow: hidden;
  border-radius: 6px;
}

.aivc-link-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.aivc-link-card-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.aivc-link-card-label {
  width: fit-content;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 999px;
  padding: 2px 8px;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  font-size: 12px;
  line-height: 1.4;
}

.aivc-link-card-title {
  display: block;
  color: #111827;
  font-size: 18px;
  line-height: 1.45;
}

.aivc-link-card-description {
  display: block;
  color: #374151;
  line-height: 1.75;
}

.aivc-link-card-button {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 6px;
  padding: 8px 16px;
  color: #fff;
  background: #111827;
  font-weight: 700;
  line-height: 1.4;
}

.aivc-link-card-button-right .aivc-link-card-button {
  justify-self: end;
}

.aivc-link-card-button-full .aivc-link-card-button {
  justify-self: center;
  width: min(100%, 320px);
}

.aivc-link-card-button-inline .aivc-link-card-button {
  justify-self: start;
}

@keyframes aivcFade {
  0% { opacity: 0; transform: translateX(18px); }
  12% { opacity: 1; transform: translateX(0); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translateX(8px); }
}

@keyframes aivcSlideUp {
  0% { opacity: 0; transform: translateY(18px); }
  14% { opacity: 1; transform: translateY(0); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translateY(10px); }
}

@keyframes aivcPop {
  0% { opacity: 0; transform: scale(0.88); }
  18% { opacity: 1; transform: scale(1); }
  72% { opacity: 1; }
  100% { opacity: 0; transform: scale(0.96); }
}

@media (max-width: 640px) {
  .aivc-watch {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .aivc-chat {
    max-height: 250px;
  }

  .aivc-chat-item {
    padding: 8px 9px;
  }

  .aivc-chat-text {
    font-size: 13px;
    line-height: 1.5;
  }

  .aivc-side {
    top: 6px;
    right: 6px;
    left: 6px;
    width: auto;
    gap: 0;
  }

  .aivc-mobile-bubble {
    max-width: 72%;
    padding: 4px 7px;
    border-left-width: 3px;
    border-radius: 5px;
    font-size: 11px;
    line-height: 1.25;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    justify-self: end;
    animation-duration: 3.4s;
  }

  .aivc-mobile-bubble .aivc-head {
    margin-bottom: 0;
  }

  .aivc-mobile-bubble .aivc-name {
    font-size: 10px;
  }

  .aivc-mobile-bubble .aivc-icon {
    width: 16px;
    height: 16px;
  }

  .aivc-mobile-bubble .aivc-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .aivc-bottom,
  .aivc-pulse {
    display: none;
  }

  .aivc-link-card-inner {
    grid-template-columns: 88px 1fr;
    gap: 10px;
    padding: 10px;
  }

  .aivc-link-card-inner-no-image {
    grid-template-columns: 1fr;
  }

  .aivc-link-card-title {
    font-size: 16px;
  }

  .aivc-link-card-description {
    font-size: 14px;
    line-height: 1.65;
  }
}

.aivc-toggle,
.aivc-fullscreen,
.aivc-overlay {
  display: none;
}
