body {
  min-height: 100vh;
  overflow-x: hidden;
}

.home-shell {
  width: 100%;
  min-height: 100vh;
  padding: 86px 16px 34px;
}

.home-dashboard {
  display: grid;
  gap: 18px;
  width: min(1440px, 100%);
  margin: 0 auto;
}

.hero-carousel {
  position: relative;
  min-height: clamp(300px, 42vw, 520px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08131c;
  box-shadow:
    var(--shadow),
    inset 0 0 44px rgba(62, 219, 211, 0.12);
}

.carousel-track,
.carousel-slide {
  position: absolute;
  inset: 0;
}

.carousel-slide {
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition:
    opacity 520ms ease,
    transform 900ms ease;
  transform: scale(1.035);
}

.carousel-slide.is-active {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
  transform: scale(1);
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-slide::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(3, 12, 20, 0.78), rgba(3, 12, 20, 0.2) 48%, rgba(3, 12, 20, 0.62)),
    linear-gradient(180deg, rgba(3, 12, 20, 0.12), rgba(3, 12, 20, 0.54));
}

.carousel-dots {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.carousel-dots button {
  width: 36px;
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
}

.carousel-dots button.is-active {
  background: var(--accent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 58%, transparent);
}

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

.feed-card {
  position: relative;
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 42%),
    linear-gradient(315deg, color-mix(in srgb, var(--accent-strong) 8%, transparent), transparent 48%),
    var(--panel);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.video-card {
  grid-column: 1 / -1;
}

.live-card {
  grid-column: 1 / -1;
}

.feed-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feed-head h2 {
  margin: 0;
  font-size: 22px;
}

.feed-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #04242a;
  background: linear-gradient(135deg, var(--accent), #87d8ff);
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(24, 198, 181, 0.22);
}

.feed-more {
  margin-left: auto;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-soft);
  font-weight: 900;
  text-decoration: none;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.feed-more:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 20px rgba(24, 198, 181, 0.16);
  transform: translateY(-1px);
}

.feed-list {
  display: grid;
  gap: 9px;
}

.feed-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: color-mix(in srgb, var(--panel-solid) 72%, transparent);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.feed-item:hover,
.video-item:hover,
.live-item:hover,
.quick-links a:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 24px rgba(24, 198, 181, 0.16);
  transform: translateY(-2px);
}

.feed-date {
  display: grid;
  place-items: center;
  min-width: 76px;
  min-height: 34px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-solid));
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.feed-copy {
  min-width: 0;
}

.feed-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.feed-summary {
  display: none;
}

.video-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.video-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  min-height: 210px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: color-mix(in srgb, var(--panel-solid) 72%, transparent);
  text-decoration: none;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.video-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent-strong) 18%, transparent)),
    var(--panel-soft);
}

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

.video-thumb.is-broken {
  display: grid;
  place-items: center;
}

.video-thumb.is-broken::after {
  content: "BILIBILI";
  color: var(--accent-strong);
  font-weight: 900;
}

.video-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-weight: 900;
  line-height: 1.35;
}

.video-meta {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.live-icon {
  width: 52px;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, #ff4f8b, var(--accent));
}

.live-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.live-item {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 100px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: color-mix(in srgb, var(--panel-solid) 74%, transparent);
  text-decoration: none;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.live-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 79, 139, 0.28), color-mix(in srgb, var(--accent) 20%, transparent)),
    var(--panel-soft);
}

.live-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.live-thumb.is-broken {
  display: grid;
  place-items: center;
}

.live-thumb.is-broken::after {
  content: "LIVE";
  color: #ff8ab4;
  font-weight: 900;
}

.live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: #ff3f77;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 0 16px rgba(255, 63, 119, 0.45);
}

.live-copy {
  min-width: 0;
}

.home-dialog {
  width: min(1120px, calc(100vw - 24px));
  max-height: min(840px, calc(100vh - 24px));
  border: 0;
  padding: 0;
  background: transparent;
}

.home-dialog::backdrop {
  background: rgba(2, 9, 14, 0.58);
  backdrop-filter: blur(5px);
}

.home-dialog-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 42%),
    var(--panel-solid);
  box-shadow:
    var(--shadow),
    inset 0 0 32px color-mix(in srgb, var(--accent) 7%, transparent);
}

.home-dialog-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.home-dialog-card h2 {
  margin: 0;
}

.dialog-content {
  max-height: min(700px, calc(100vh - 150px));
  overflow: auto;
  padding: 18px;
  line-height: 1.75;
}

.dialog-body,
.dialog-rich {
  display: grid;
  gap: 12px;
  white-space: normal;
}

.rich-heading {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 20px;
}

.rich-heading.level-3 {
  font-size: 17px;
}

.rich-text {
  margin: 0;
}

.rich-mention {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  margin: 0 2px;
  padding: 2px 7px 2px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-solid));
  font-weight: 900;
  line-height: 1.2;
  vertical-align: baseline;
}

.rich-mention img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
}

.rich-color-gray {
  color: #9ca3af;
}

.rich-color-brown {
  color: #c08457;
}

.rich-color-orange {
  color: #fb923c;
}

.rich-color-yellow {
  color: #facc15;
}

.rich-color-green {
  color: #4ade80;
}

.rich-color-blue {
  color: #60a5fa;
}

.rich-color-purple {
  color: #c084fc;
}

.rich-color-pink {
  color: #f472b6;
}

.rich-color-red {
  color: #f87171;
}

.rich-mention.rich-color-gray,
.rich-mention.rich-color-brown,
.rich-mention.rich-color-orange,
.rich-mention.rich-color-yellow,
.rich-mention.rich-color-green,
.rich-mention.rich-color-blue,
.rich-mention.rich-color-purple,
.rich-mention.rich-color-pink,
.rich-mention.rich-color-red {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 12%, var(--panel-solid));
}

.rich-quote,
.rich-callout {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 9%, var(--panel-solid));
}

.rich-image {
  display: grid;
  gap: 7px;
  margin: 4px 0;
}

.rich-image img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #06151c;
}

.rich-caption {
  color: var(--muted);
  font-size: 12px;
}

.rich-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rich-table {
  width: 100%;
  min-width: 520px;
  border: 0 !important;
  border-radius: 0 !important;
}

.rich-table th,
.rich-table td {
  padding: 9px 10px;
  vertical-align: top;
}

.dialog-source {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  width: fit-content;
  margin: 0 0 14px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-solid));
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.feed-empty {
  min-height: 96px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (min-width: 1280px) {
  .video-list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .home-grid {
    grid-template-columns: 1fr;
  }

  .video-card {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .video-list {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
}

@media (max-width: 760px) {
  .home-shell {
    width: 100%;
    padding-inline: 10px;
    padding-top: 126px;
  }

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

  .hero-carousel {
    min-height: 340px;
  }

  .carousel-dots {
    left: 20px;
    right: auto;
  }

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

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

  .home-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
