.tgw-root {
  font-family: var(--tgw-font, 'Inter', sans-serif);
  background: var(--tgw-bg, #f8fafc);
  color: var(--tgw-text, #0f172a);
  padding: 16px;
  border-radius: calc(var(--tgw-radius, 16px) + 8px);
  box-sizing: border-box;
  position: relative;
  container-type: inline-size;
  container-name: tgw;
}
.tgw-root, .tgw-root * { box-sizing: border-box; }
.tgw-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0 0 var(--tgw-gap, 16px);
}
.tgw-header-clickable { cursor: pointer; }
.tgw-header-cover {
  width: calc(100% + 32px);
  margin: -16px -16px 0;
  height: 64px;
  background: var(--tgw-header-bg, var(--tgw-accent, #2AABEE));
  border-radius: calc(var(--tgw-radius, 16px) + 8px) calc(var(--tgw-radius, 16px) + 8px) 0 0;
}
.tgw-header-avatar-wrap {
  position: relative;
  margin-top: calc(var(--tgw-header-avatar-size, 80px) / -2);
  z-index: 1;
}
.tgw-header-logo {
  width: var(--tgw-header-avatar-size, 80px);
  height: var(--tgw-header-avatar-size, 80px);
  border-radius: 50%; overflow: hidden;
  background: var(--tgw-accent, #2AABEE); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--tgw-header-avatar-size, 80px) * 0.35);
  font-weight: 700;
  border: var(--tgw-header-avatar-border-width, 4px) solid var(--tgw-header-avatar-border-color, var(--tgw-card-bg, #fff));
  box-shadow: var(--tgw-header-avatar-shadow, 0 4px 14px rgba(0,0,0,.15));
}
.tgw-header-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tgw-header-badge {
  position: absolute; right: -4px; bottom: -2px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--tgw-card-bg, #fff);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.tgw-header-text { margin-top: 10px; padding: 0 16px; max-width: 100%; }
.tgw-header-name {
  font-weight: 700; font-size: 16px; line-height: 1.3;
  color: var(--tgw-header-name-color, var(--tgw-text, #0f172a));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tgw-header-desc {
  margin-top: 2px;
  font-size: 13px; line-height: 1.35;
  color: var(--tgw-header-desc-color, var(--tgw-meta, #64748b));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tgw-root {
  --tgw-matrix-cols: 3;
  --tgw-matrix-rows: 2;
  --tgw-media-h: 168px;
  --tgw-card-rest: 202px;
  --tgw-matrix-card-h: calc(var(--tgw-media-h) + var(--tgw-card-rest));
  --tgw-matrix-pad-x: 6px;
  --tgw-matrix-pad-top: 6px;
  --tgw-matrix-pad-bottom: 20px;
}

.tgw-matrix { display: grid; gap: var(--tgw-gap, 16px); }
.tgw-matrix .tgw-card {
  margin: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden auto;
}
.tgw-matrix .tgw-card .tgw-media:not(.tgw-media-video_note) {
  flex: 0 0 var(--tgw-media-h, 168px);
  height: var(--tgw-media-h, 168px);
  min-height: 0;
}
.tgw-matrix .tgw-card .tgw-media:not(.tgw-media-video_note),
.tgw-matrix .tgw-card .tgw-media:not(.tgw-media-video_note) .tgw-media-item {
  position: relative;
  height: var(--tgw-media-h, 168px);
}
.tgw-matrix .tgw-card .tgw-media:not(.tgw-media-video_note) img,
.tgw-matrix .tgw-card .tgw-media:not(.tgw-media-video_note) video.tgw-hover-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tgw-matrix .tgw-card .tgw-card-text {
  flex: 0 0 auto;
  min-height: 0;
}
.tgw-matrix .tgw-card .tgw-card-text.tgw-clamped {
  -webkit-line-clamp: 4;
}

.tgw-matrix-v {
  grid-template-columns: repeat(var(--tgw-matrix-cols), 1fr);
  grid-auto-rows: var(--tgw-matrix-card-h);
  max-height: calc(var(--tgw-matrix-rows) * var(--tgw-matrix-card-h) + (var(--tgw-matrix-rows) - 1) * var(--tgw-gap, 16px) + var(--tgw-matrix-pad-top) + var(--tgw-matrix-pad-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--tgw-matrix-pad-top) var(--tgw-matrix-pad-x) var(--tgw-matrix-pad-bottom);
}
.tgw-matrix-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.tgw-matrix-h {
  flex: 1 1 auto;
  min-width: 0;
  grid-template-rows: repeat(var(--tgw-matrix-rows), 1fr);
  grid-auto-flow: column;
  grid-auto-columns: calc(100% / (var(--tgw-matrix-cols) + 0.18));
  height: calc(var(--tgw-matrix-rows) * var(--tgw-matrix-card-h) + (var(--tgw-matrix-rows) - 1) * var(--tgw-gap, 16px) + var(--tgw-matrix-pad-top) + var(--tgw-matrix-pad-bottom));
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: var(--tgw-matrix-pad-top) 0 var(--tgw-matrix-pad-bottom);
}
.tgw-matrix-h .tgw-card { scroll-snap-align: start; }
.tgw-matrix-arrow {
  flex: none;
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--tgw-card-bg, #fff); color: var(--tgw-text, #0f172a);
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tgw-matrix-arrow:hover { background: var(--tgw-accent, #2AABEE); color: #fff; }
@media (max-width: 768px) {
  .tgw-mlayout-carousel.tgw-grid {
    display: flex !important;
    column-count: initial !important;
    grid-template-columns: initial !important;
    grid-template-rows: initial !important;
    grid-auto-flow: initial !important;
    grid-auto-columns: initial !important;
    grid-auto-rows: initial !important;
    flex-wrap: nowrap;
    align-items: flex-start;
    height: auto !important;
    max-height: none !important;
    overflow-x: auto;
    overflow-y: visible !important;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: var(--tgw-gap, 16px);
    padding: 2px 2px 6px !important;
    margin: 0 -2px;
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 28px), transparent 100%);
  }
  .tgw-mlayout-carousel.tgw-grid .tgw-card {
    flex: 0 0 auto;
    width: 88%;
    max-width: 88%;
    margin: 0;
    scroll-snap-align: start;
    scroll-margin-left: 2px;
    display: flex;
    flex-direction: column;
    max-height: 74vh;
    overflow: hidden auto;
  }
  .tgw-mlayout-carousel.tgw-grid .tgw-card .tgw-more { display: block; }
  .tgw-mlayout-carousel.tgw-grid .tgw-card .tgw-media:not(.tgw-media-video_note),
  .tgw-mlayout-carousel.tgw-grid .tgw-card .tgw-media:not(.tgw-media-video_note) .tgw-media-item {
    height: 220px;
    max-height: 220px;
    flex: 0 0 auto;
  }
  .tgw-mlayout-carousel.tgw-grid .tgw-card .tgw-media:not(.tgw-media-video_note) img {
    position: static;
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
  }
  .tgw-mlayout-carousel.tgw-grid .tgw-card .tgw-media:not(.tgw-media-video_note) video.tgw-hover-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .tgw-matrix-wrap { display: block; }
  .tgw-matrix-arrow { display: none; }
}
@container tgw (max-width: 768px) {
  .tgw-mlayout-carousel.tgw-grid {
    display: flex !important;
    column-count: initial !important;
    grid-template-columns: initial !important;
    grid-template-rows: initial !important;
    grid-auto-flow: initial !important;
    grid-auto-columns: initial !important;
    grid-auto-rows: initial !important;
    flex-wrap: nowrap;
    align-items: flex-start;
    height: auto !important;
    max-height: none !important;
    overflow-x: auto;
    overflow-y: visible !important;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: var(--tgw-gap, 16px);
    padding: 2px 2px 6px !important;
    margin: 0 -2px;
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 28px), transparent 100%);
  }
  .tgw-mlayout-carousel.tgw-grid .tgw-card {
    flex: 0 0 auto;
    width: 88%;
    max-width: 88%;
    margin: 0;
    scroll-snap-align: start;
    scroll-margin-left: 2px;
    display: flex;
    flex-direction: column;
    max-height: 74vh;
    overflow: hidden auto;
  }
  .tgw-mlayout-carousel.tgw-grid .tgw-card .tgw-more { display: block; }
  .tgw-mlayout-carousel.tgw-grid .tgw-card .tgw-media:not(.tgw-media-video_note),
  .tgw-mlayout-carousel.tgw-grid .tgw-card .tgw-media:not(.tgw-media-video_note) .tgw-media-item {
    height: 220px;
    max-height: 220px;
    flex: 0 0 auto;
  }
  .tgw-mlayout-carousel.tgw-grid .tgw-card .tgw-media:not(.tgw-media-video_note) img {
    position: static;
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
  }
  .tgw-mlayout-carousel.tgw-grid .tgw-card .tgw-media:not(.tgw-media-video_note) video.tgw-hover-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .tgw-matrix-wrap { display: block; }
  .tgw-matrix-arrow { display: none; }
}

.tgw-card {
  background: var(--tgw-card-bg, #fff);
  border-radius: var(--tgw-radius, 16px);
  box-shadow: var(--tgw-shadow, none);
  margin: 0 0 var(--tgw-gap, 16px);
  break-inside: avoid;
  overflow: hidden;
  display: block;
}
.tgw-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
}
.tgw-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--tgw-accent, #2AABEE);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; overflow: hidden; flex: none;
}
.tgw-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tgw-head-text { display: flex; flex-direction: column; min-width: 0; }
.tgw-chan-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgw-date { font-size: 12px; color: var(--tgw-meta, #64748b); }

.tgw-media { position: relative; line-height: 0; background: #000; overflow: hidden; }
.tgw-media-item { position: relative; }
.tgw-media-photo .tgw-media-item,
.tgw-media-video .tgw-media-item,
.tgw-media-mixed .tgw-media-item {
  overflow: hidden;
}
.tgw-media-photo img, .tgw-media-video img, .tgw-media-video_note img, .tgw-media-mixed img {
  width: 100%; display: block; object-fit: cover;
}
.tgw-media-pending img { opacity: .55; filter: blur(1px); }

.tgw-media-video .tgw-media-item, .tgw-media-video_note .tgw-media-item, .tgw-media-mixed .tgw-media-item {
  cursor: pointer;
}
.tgw-media-video_note {
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tgw-media-video_note .tgw-media-item {
  position: relative;
  width: 76%;
  aspect-ratio: 1 / 1;
  margin: 16px 0;
}
.tgw-matrix .tgw-card .tgw-media-video_note {
  flex: 0 0 auto;
  padding: 18px 0;
}
.tgw-matrix .tgw-card .tgw-media-video_note .tgw-media-item {
  width: 78%;
  margin: 0;
}
.tgw-media-video_note .tgw-media-item img.tgw-video-poster,
.tgw-media-video_note .tgw-media-item video.tgw-hover-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.tgw-media-video_note .tgw-duration {
  right: auto;
  bottom: 6%;
  left: 50%;
  transform: translateX(-50%);
}
.tgw-play-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.tgw-media-item:hover .tgw-play-btn { background: var(--tgw-accent, #2AABEE); transform: translate(-50%, -50%) scale(1.06); }
.tgw-duration {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px;
}
.tgw-hover-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tgw-media-photo .tgw-media-item img,
.tgw-media-video .tgw-media-item img,
.tgw-media-video .tgw-media-item video.tgw-hover-preview,
.tgw-media-mixed .tgw-media-item img {
  transition: transform .25s ease;
}
.tgw-media-item:hover img,
.tgw-media-item:hover video.tgw-hover-preview {
  transform: scale(1.02);
}
.tgw-media-photo .tgw-media-item::after,
.tgw-media-video .tgw-media-item::after,
.tgw-media-mixed .tgw-media-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background-color .2s ease;
  pointer-events: none;
}
.tgw-media-item:hover::after {
  background-color: rgba(0,0,0,.06);
}

.tgw-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 2px; }
.tgw-carousel .tgw-media-item { flex: 0 0 100%; scroll-snap-align: start; }

.tgw-card-text {
  padding: 10px 14px 4px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.tgw-card-text.tgw-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tgw-card-text a { color: var(--tgw-accent, #2AABEE); text-decoration: none; }
.tgw-card-text a:hover { text-decoration: underline; }
.tgw-more {
  display: block;
  margin: 2px 14px 10px;
  background: none; border: none; color: var(--tgw-accent, #2AABEE);
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 0;
}

.tgw-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 14px 12px;
  font-size: 12px; color: var(--tgw-meta, #64748b);
  margin-top: auto;
}
.tgw-views { display: inline-flex; align-items: center; gap: 4px; }
.tgw-permalink { color: var(--tgw-meta, #64748b); text-decoration: none; }
.tgw-permalink:hover { color: var(--tgw-accent, #2AABEE); }

.tgw-load-more {
  display: block; margin: 4px auto 0;
  padding: 10px 22px; border-radius: 999px; border: 1px solid var(--tgw-accent, #2AABEE);
  background: transparent; color: var(--tgw-accent, #2AABEE); font-weight: 600; font-size: 14px;
  cursor: pointer;
}
.tgw-load-more:disabled { opacity: .6; cursor: default; }
.tgw-has-subscribe .tgw-grid,
.tgw-has-subscribe .tgw-matrix-wrap {
  margin-bottom: var(--tgw-sub-gap, 32px);
}
.tgw-subscribe {
  position: static; margin: 14px auto 0; width: max-content;
  display: flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  background: var(--tgw-sub-bg, var(--tgw-accent, #2AABEE));
  color: var(--tgw-sub-text, #fff);
  font-weight: 600; font-size: 14px; text-decoration: none;
  box-shadow: var(--tgw-sub-shadow, 0 6px 18px rgba(0,0,0,.18));
  border-style: solid;
  border-width: var(--tgw-sub-border-width, 0px);
  border-color: var(--tgw-sub-border-color, transparent);
}
.tgw-theme-dark { --tgw-scrollbar: #333; }
.tgw-theme-dark .tgw-permalink, .tgw-theme-dark .tgw-views { color: var(--tgw-meta, #94a3b8); }
.tgw-modal {
  position: fixed; inset: 0; background: rgba(10,12,16,.9);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
  z-index: 999999;
}
.tgw-modal.on { opacity: 1; pointer-events: auto; }
body.tgw-modal-open { overflow: hidden; }
.tgw-modal-inner { position: relative; max-width: min(92vw, 720px); max-height: 88vh; }
.tgw-modal-media img, .tgw-modal-media video { max-width: 100%; max-height: 88vh; border-radius: 12px; display: block; }
.tgw-modal-media video.tgw-modal-round { border-radius: 50%; aspect-ratio: 1/1; object-fit: cover; }
.tgw-modal-close {
  position: absolute; top: -40px; right: 0; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff; border: none; font-size: 16px; cursor: pointer;
}
.tgw-modal-close:hover { background: rgba(255,255,255,.25); }

.tgw-header-subs { margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--tgw-header-desc-color, var(--tgw-meta, #64748b)); font-variant-numeric: tabular-nums; }
.tgw-header-desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-width: 520px; margin-left: auto; margin-right: auto; }
.tgw-header-sub { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; margin-top: 12px; padding: 0 22px; border-radius: 999px; background: var(--tgw-sub-bg, var(--tgw-accent, #2AABEE)); color: var(--tgw-sub-text, #fff); font-weight: 600; font-size: 14px; text-decoration: none; position: relative; transition: transform .1s ease, filter .2s ease; }
.tgw-header-sub::after { content: ""; position: absolute; inset: -4px; }
.tgw-header-sub:hover { filter: brightness(1.07); }
.tgw-header-sub:active { transform: scale(.97); }
.tgw-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tgw-foot-left { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.tgw-foot-date { color: var(--tgw-meta, #64748b); font-size: 12px; white-space: nowrap; }
.tgw-permalink { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: -6px -6px -6px 0; border-radius: 50%; position: relative; transition: background .15s ease, color .15s ease; }
.tgw-permalink::after { content: ""; position: absolute; inset: -6px; }
.tgw-permalink:hover { background: color-mix(in srgb, var(--tgw-accent, #2AABEE) 12%, transparent); }
.tgw-card-textonly .tgw-card-text { font-size: 15.5px; line-height: 1.5; font-weight: 500; }
.tgw-media-video_note { width: 100%; max-width: 280px; margin-left: auto; margin-right: auto; }
.tgw-matrix .tgw-card .tgw-media-video_note { max-width: min(280px, 100%); }
.tgw-media-video_note .tgw-media-item { aspect-ratio: 1 / 1; height: auto !important; border-radius: 50%; overflow: hidden; }
.tgw-media-video_note .tgw-duration { bottom: 14%; }
.tgw-reacts { display: inline-flex; align-items: center; gap: 4px; color: #e5484d; font-variant-numeric: tabular-nums; }
.tgw-theme-dark .tgw-reacts { color: #ff6369; }
.tgw-header-nocover .tgw-header-avatar-wrap { margin-top: 0; }
.tgw-root.tgw-bg-none { padding-left: 0; padding-right: 0; border-radius: 0; }
.tgw-bg-none .tgw-header-cover { width: 100%; margin: 0; border-radius: var(--tgw-radius, 16px); }
.tgw-subscribe { transition: transform .1s ease, filter .2s ease; }
.tgw-subscribe:hover { filter: brightness(1.07); }
.tgw-subscribe:active { transform: scale(.97); }
@supports (width: 1cqw) {
  .tgw-root { --tgw-media-h: clamp(168px, calc((100cqw - 90px) / (var(--tgw-matrix-cols) + 0.18) * 0.58), 300px); }
}
.tgw-root { max-width: var(--tgw-max-w, none); margin-left: auto; margin-right: auto; }
.tgw-media-item video.tgw-video-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; pointer-events: none; }
.tgw-media-broken { background: linear-gradient(135deg, #eef1f5, #dfe4ea); }
.tgw-media-video .tgw-media-item:has(> video.tgw-video-poster), .tgw-media-mixed .tgw-media-item:has(> video.tgw-video-poster) { min-height: 180px; }
