:root {
  --bg: #0b1020;
  --bg-soft: #121a33;
  --card: rgba(17, 24, 39, 0.72);
  --card-border: rgba(255, 255, 255, 0.1);
  --text: #e5ecff;
  --muted: #a7b1d4;
  --accent: #3aa4ff;
  --accent-2: #61ffd8;
  --ring: rgba(58, 164, 255, 0.45);
  --shadow: 0 14px 42px rgba(2, 8, 20, 0.5);
}

:root[data-color-mode='light'] {
  --bg: #eef4ff;
  --bg-soft: #dfe8ff;
  --card: rgba(255, 255, 255, 0.82);
  --card-border: rgba(20, 40, 90, 0.12);
  --text: #0f1a35;
  --muted: #435178;
  --accent: #1366d6;
  --accent-2: #0a9b8f;
  --ring: rgba(19, 102, 214, 0.26);
  --shadow: 0 10px 30px rgba(20, 40, 90, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
    'Segoe UI Symbol', 'Noto Color Emoji';
  color: var(--text);
  background:
    radial-gradient(circle at 5% -10%, rgba(58, 164, 255, 0.24), transparent 35%),
    radial-gradient(circle at 90% 10%, rgba(97, 255, 216, 0.12), transparent 30%),
    linear-gradient(165deg, var(--bg) 0%, #0f1731 55%, var(--bg-soft) 100%);
  min-height: 100%;
}

body {
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-2);
}

.tpb-shell {
  width: 100%;
  max-width: 1280px;
  padding-left: 1rem;
  padding-right: 1rem;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .tpb-shell {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .tpb-shell {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.tpb-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(24, 24, 27, 0.95);
  border-bottom: 1px solid #27272a;
}

:root[data-color-mode='light'] .tpb-header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: #e5e7eb;
}

.tpb-header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tpb-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  color: var(--text);
}

.tpb-logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a, #1e293b 55%, #1d4ed8);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.35);
}

.tpb-logo-text {
  font-size: 1.1rem;
  line-height: 1;
}

.tpb-nav-list {
  list-style: none;
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

.tpb-nav-list a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #a1a1aa;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

:root[data-color-mode='light'] .tpb-nav-list a {
  color: #6b7280;
}

.tpb-nav-list a.is-active {
  background: #09090b;
  border-color: rgba(99, 102, 241, 0.35);
  color: #818cf8;
}

:root[data-color-mode='light'] .tpb-nav-list a.is-active {
  background: #f9fafb;
}

.tpb-nav-list a:hover {
  background: #27272a;
}

:root[data-color-mode='light'] .tpb-nav-list a:hover {
  background: #f3f4f6;
}

.tpb-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tpb-theme-toggle,
.tpb-cta {
  min-height: 40px;
  border: 1px solid transparent;
  color: #a1a1aa;
  border-radius: 10px;
  padding: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

:root[data-color-mode='light'] .tpb-theme-toggle {
  color: #6b7280;
}

.tpb-theme-toggle:hover {
  background: #27272a;
}

:root[data-color-mode='light'] .tpb-theme-toggle:hover {
  background: #f3f4f6;
}

.tpb-theme-icon {
  display: block;
}

.tpb-theme-icon-sun {
  display: none;
}

:root[data-color-mode='dark'] .tpb-theme-icon-sun {
  display: block;
}

:root[data-color-mode='dark'] .tpb-theme-icon-moon {
  display: none;
}

.tpb-cta {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: #4f46e5;
  color: #fff;
  border: 0;
}

.tpb-cta:hover {
  background: #4338ca;
}

.tpb-mobile-toggle {
  min-height: 40px;
  border: 1px solid transparent;
  color: #a1a1aa;
  border-radius: 10px;
  padding: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

:root[data-color-mode='light'] .tpb-mobile-toggle {
  color: #6b7280;
}

.tpb-mobile-toggle:hover {
  background: #27272a;
}

:root[data-color-mode='light'] .tpb-mobile-toggle:hover {
  background: #f3f4f6;
}

.tpb-mobile-toggle.is-open .tpb-mobile-open {
  display: none;
}

.tpb-mobile-close {
  display: none;
}

.tpb-mobile-toggle.is-open .tpb-mobile-close {
  display: inline;
}

.tpb-mobile-nav {
  display: none;
  border-top: 1px solid var(--card-border);
  padding: 0.65rem 0 0.85rem;
}

.tpb-mobile-nav.is-open {
  display: block;
}

.tpb-mobile-nav-list {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

.tpb-mobile-nav-list a {
  display: block;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #a1a1aa;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

:root[data-color-mode='light'] .tpb-mobile-nav-list a {
  color: #6b7280;
}

.tpb-mobile-nav-list a.is-active {
  background: #09090b;
  border-color: rgba(99, 102, 241, 0.35);
  color: #818cf8;
}

:root[data-color-mode='light'] .tpb-mobile-nav-list a.is-active {
  background: #f9fafb;
}

.tpb-mobile-nav-list a:hover {
  background: #27272a;
}

:root[data-color-mode='light'] .tpb-mobile-nav-list a:hover {
  background: #f3f4f6;
}

.tpb-main {
  padding: 2rem 0 3rem;
}

.tpb-hero {
  margin: 0 auto 1.25rem;
  padding: 1.4rem;
  border: 1px solid var(--card-border);
  background: linear-gradient(145deg, rgba(58, 164, 255, 0.12), rgba(97, 255, 216, 0.08));
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.tpb-hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.12;
  font-weight: 700;
}

.tpb-hero p {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

.tpb-hero-cta {
  margin-top: 0.95rem;
}

:root[data-color-mode='light'] .tpb-hero {
  background: #fff;
  border-color: #e5e7eb;
  box-shadow: 0 8px 24px rgba(20, 40, 90, 0.08);
}

.tpb-months-wrap {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tpb-login-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 14px;
  padding: 0.7rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, #1366d6 0%, #1a7ff3 45%, #0fa9d8 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 14px 28px rgba(19, 102, 214, 0.33);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.tpb-login-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(19, 102, 214, 0.4);
  color: #fff;
}

.tpb-login-cta__label {
  position: relative;
  z-index: 2;
}

.tpb-login-cta__shine {
  position: absolute;
  z-index: 1;
  inset: -35% -50%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 12%,
    rgba(255, 255, 255, 0.35) 28%,
    rgba(255, 255, 255, 0) 42%
  );
  transform: translateX(-45%) rotate(10deg);
  animation: tpb-cta-shine 4s ease-in-out infinite;
}

.tpb-login-cta::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  pointer-events: none;
}

.tpb-single-cta {
  margin-top: 1.1rem;
}

@keyframes tpb-cta-shine {
  0%,
  55%,
  100% {
    transform: translateX(-45%) rotate(10deg);
  }
  72% {
    transform: translateX(48%) rotate(10deg);
  }
}

.tpb-month-link {
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.42rem 0.8rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.tpb-month-link:hover {
  color: var(--text);
  border-color: var(--ring);
}

.tpb-month-link.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), #2682f7);
}

.tpb-feed {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.tpb-highlights {
  margin-bottom: 0.8rem;
}

.tpb-highlights h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.tpb-older-head {
  margin: 0.1rem 0 0.4rem;
}

.tpb-older-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.tpb-older-head p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.tpb-highlights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
}

.tpb-card {
  border: 1px solid var(--card-border);
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tpb-card:hover {
  transform: translateY(-3px);
  border-color: var(--ring);
}

.tpb-card-link {
  display: block;
  color: inherit;
}

.tpb-card-thumb img,
.tpb-single-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.tpb-single-thumb {
  max-width: 760px;
  margin: 0 auto 0.95rem;
  border-radius: 16px;
  overflow: hidden;
}

.tpb-single-thumb img {
  aspect-ratio: 16 / 8.8;
  object-fit: cover;
}

.tpb-card-content {
  padding: 0.95rem 1rem 1.15rem;
}

.tpb-card h2,
.tpb-card h3 {
  margin: 0.3rem 0;
  line-height: 1.24;
  font-weight: 650;
}

.tpb-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

.tpb-list {
  display: grid;
  gap: 0.85rem;
}

.tpb-list-card .tpb-card-link {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  min-height: 128px;
}

/* If a list card has no thumbnail, let content use full width */
.tpb-list-card .tpb-card-link > .tpb-card-content:first-child {
  grid-column: 1 / -1;
}

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

.tpb-list-content h3 {
  margin: 0.2rem 0;
  font-size: 1.08rem;
  line-height: 1.28;
}

.tpb-list-content h2 {
  margin: 0.2rem 0;
  font-size: 1.16rem;
  line-height: 1.3;
}

.tpb-list-content p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tpb-meta {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.tpb-single-wrap {
  margin-bottom: 1.2rem;
}

.tpb-single {
  border: 1px solid var(--card-border);
  background: var(--card);
  border-radius: 20px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.tpb-single h1 {
  margin: 0.35rem 0 0.8rem;
  line-height: 1.18;
  font-weight: 700;
}

.tpb-content > *:first-child {
  margin-top: 0;
}

.tpb-content p,
.tpb-content li {
  color: var(--text);
  font-size: 1.04rem;
  line-height: 1.78;
}

.tpb-content .tpb-ai-summary,
.tpb-content .tpb-ai-toc {
  margin: 1rem 0 1.15rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--ring);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(58, 164, 255, 0.13), rgba(97, 255, 216, 0.07));
}

:root[data-color-mode='light'] .tpb-content .tpb-ai-summary,
:root[data-color-mode='light'] .tpb-content .tpb-ai-toc {
  background: rgba(255, 255, 255, 0.85);
}

.tpb-content .tpb-ai-summary p,
.tpb-content .tpb-ai-toc p {
  margin: 0 0 0.4rem;
  font-weight: 700;
}

.tpb-content .tpb-ai-summary ul,
.tpb-content .tpb-ai-toc ul {
  margin: 0;
  padding-left: 1.1rem;
}

.tpb-content strong {
  font-weight: 600;
}

.tpb-content h2,
.tpb-content h3 {
  font-weight: 700;
  margin: 1.1rem 0 0.4rem;
}

.tpb-content img {
  max-width: 100%;
  border-radius: 14px;
}

.tpb-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  border: 1px solid var(--card-border);
  background: rgba(8, 13, 25, 0.35);
  border-radius: 12px;
  overflow: hidden;
}

:root[data-color-mode='light'] .tpb-content table {
  background: rgba(255, 255, 255, 0.7);
}

.tpb-content th,
.tpb-content td {
  border-bottom: 1px solid var(--card-border);
  padding: 0.65rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

.tpb-content th {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-weight: 700;
}

.tpb-related {
  margin-top: 2.2rem;
}

.tpb-related .tpb-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
}

.tpb-related .tpb-card-content {
  padding: 0.95rem 1rem 1.05rem;
}

.tpb-related-card .tpb-card-link {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  min-height: 128px;
}

/* If a related card has no thumbnail, let content use full width */
.tpb-related-card .tpb-card-link > .tpb-card-content:first-child {
  grid-column: 1 / -1;
}

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

.tpb-related-content h3 {
  margin: 0.2rem 0;
  font-size: 1.08rem;
  line-height: 1.28;
}

.tpb-pagination {
  grid-column: 1 / -1;
  margin-top: 0.2rem;
}

.tpb-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tpb-pagination .page-numbers {
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
}

.tpb-pagination .page-numbers.current {
  background: linear-gradient(120deg, var(--accent), #2682f7);
  border-color: transparent;
  color: #fff;
}

.tpb-footer {
  border-top: 1px solid var(--card-border);
  margin-top: 2.5rem;
  background: var(--card);
}

.tpb-footer-inner {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.35rem;
  color: var(--text);
  font-size: 0.95rem;
  padding: 1rem 0;
}

.tpb-footer a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tpb-mobile-sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 0.55rem 0 calc(0.55rem + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.tpb-mobile-sticky-cta.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.tpb-login-cta--mobile {
  width: 100%;
  justify-content: center;
  box-shadow: 0 18px 34px rgba(19, 102, 214, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .tpb-login-cta {
    transition: none;
  }

  .tpb-login-cta:hover {
    transform: none;
  }

  .tpb-login-cta__shine {
    animation: none;
  }
}

@media (max-width: 900px) {
  .tpb-highlights-grid {
    grid-template-columns: 1fr;
  }

  .tpb-nav {
    display: none;
  }

  .tpb-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .tpb-list-card .tpb-card-link {
    grid-template-columns: 1fr;
  }

  .tpb-list-thumb img {
    aspect-ratio: 16 / 9;
    height: auto;
  }
}

@media (max-width: 640px) {
  .tpb-header-inner {
    min-height: 62px;
  }

  .tpb-theme-toggle,
  .tpb-cta,
  .tpb-mobile-toggle {
    padding: 0 0.65rem;
    font-size: 0.84rem;
  }

  .tpb-logo-text {
    display: none;
  }

  .tpb-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem 0 5.1rem;
  }
}

@media (min-width: 901px) {
  .tpb-mobile-sticky-cta {
    display: none;
  }
}
