/* triportal — 门户三栏 + 分类抽屉（无底部固定条） */

:root {
  --tp-bg: #0b1020;
  --tp-panel: rgba(255, 255, 255, 0.06);
  --tp-panel-2: rgba(255, 255, 255, 0.09);
  --tp-border: rgba(255, 255, 255, 0.12);
  --tp-text: #eef2ff;
  --tp-muted: rgba(238, 242, 255, 0.68);
  --tp-dim: rgba(238, 242, 255, 0.46);
  --tp-accent: #7c3aed;
  --tp-accent-2: #22c55e;
  --tp-top: rgba(6, 10, 20, 0.75);
  --tp-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --tp-radius: 16px;
  --tp-max: 1400px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body.tp-body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--tp-text);
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(124,58,237,0.30), transparent 55%),
    radial-gradient(900px 700px at 90% 10%, rgba(34,197,94,0.18), transparent 55%),
    linear-gradient(180deg, #060a14, var(--tp-bg));
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.tp-app { min-height: 100vh; display: flex; flex-direction: column; }

/* ===== 顶栏 ===== */
.tp-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--tp-top);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tp-border);
}

.tp-topbar-inner {
  max-width: var(--tp-max);
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tp-menu-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--tp-border);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.tp-menu-btn span {
  width: 16px;
  height: 2px;
  background: rgba(238, 242, 255, 0.85);
  display: block;
  border-radius: 2px;
}
.tp-menu-btn span:nth-child(2) { opacity: 0.85; }

.tp-brand { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.tp-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, rgba(124,58,237,0.95), rgba(34,197,94,0.65));
  box-shadow: 0 10px 28px rgba(124,58,237,0.20);
}
.tp-brand-text { font-weight: 700; }

.tp-search {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--tp-border);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}
.tp-search-ico { color: rgba(238, 242, 255, 0.75); display: flex; }
.tp-search-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--tp-text);
  font-size: 14px;
}
.tp-search-input::placeholder { color: rgba(238, 242, 255, 0.45); }
.tp-search-btn,
.tp-search-magic {
  border: 1px solid var(--tp-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--tp-text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}
.tp-search-magic { border-color: rgba(124,58,237,0.55); }
.tp-search-btn:hover,
.tp-search-magic:hover { background: rgba(255, 255, 255, 0.10); }

.tp-toplinks { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tp-toplinks a {
  padding: 8px 10px;
  border-radius: 10px;
  color: rgba(238, 242, 255, 0.8);
}
.tp-toplinks a:hover { background: rgba(255, 255, 255, 0.06); }
.tp-toplinks a.is-active { background: rgba(124, 58, 237, 0.25); color: #fff; }

/* 二级横向分类条 */
.tp-subnav {
  border-top: 1px solid var(--tp-border);
  background: rgba(255, 255, 255, 0.03);
}
.tp-subnav-inner {
  max-width: var(--tp-max);
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  overflow: auto;
  scrollbar-width: none;
}
.tp-subnav-inner::-webkit-scrollbar { display: none; }
.tp-chip {
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--tp-border);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(238, 242, 255, 0.82);
  font-size: 13px;
}
.tp-chip:hover { background: rgba(255, 255, 255, 0.08); }
.tp-chip.is-active { background: rgba(34,197,94,0.22); border-color: rgba(34,197,94,0.55); color: #fff; }

/* ===== 抽屉 ===== */
.tp-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 180;
}
.tp-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(380px, 92vw);
  background: rgba(10, 14, 26, 0.92);
  border-right: 1px solid var(--tp-border);
  z-index: 190;
  transform: translateX(-102%);
  transition: transform 0.22s ease;
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
}
.tp-drawer.is-open { transform: translateX(0); }
.tp-drawer-head {
  padding: 14px 14px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--tp-border);
}
.tp-drawer-title { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.tp-drawer-icon { color: rgba(238, 242, 255, 0.75); display: flex; }
.tp-drawer-close {
  border: 1px solid var(--tp-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--tp-text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
}
.tp-drawer-close:hover { background: rgba(255, 255, 255, 0.10); }
.tp-drawer-body {
  padding: 10px 10px 14px;
  overflow: auto;
}
.tp-drawer-sep { height: 1px; background: var(--tp-border); margin: 10px 6px; }
.tp-drawer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  color: rgba(238, 242, 255, 0.86);
}
.tp-drawer-link:hover { background: rgba(255, 255, 255, 0.06); }
.tp-drawer-link.is-active { background: rgba(124, 58, 237, 0.25); color: #fff; }
.tp-drawer-link-ico { display: flex; color: rgba(238, 242, 255, 0.7); }
.tp-drawer-empty { padding: 14px 10px; color: var(--tp-muted); }

/* ===== 三栏框架 ===== */
.tp-frame {
  max-width: var(--tp-max);
  margin: 0 auto;
  padding: 18px 14px 32px;
  width: 100%;
  display: grid;
  grid-template-columns: 260px 1fr 360px;
  gap: 16px;
  align-items: start;
  flex: 1;
}
.tp-col { min-width: 0; }
.tp-col-left { grid-column: 1; }
.tp-col-main { grid-column: 2; min-height: 1px; align-self: start; }
.tp-col-right { grid-column: 3; position: sticky; top: 92px; align-self: start; }

/* ===== 抗“伪原创/注入占位”======
   有些功能会在主栏/右栏顶部注入空容器（仅空白/换行），会把内容整体顶下去。
   这里仅折叠“空节点”，不影响真实有内容的模块。 */
.tp-frame > :not(.tp-col):not(script):not(style):not(.tp-keep) {
  display: none !important;
}
.tp-col-main > :not(.tp-main-wrap):empty,
.tp-col-right > :empty {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* 如果你能控制注入块的 class，给它加 tp-ignore 更稳 */
.tp-ignore {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* 更强兜底：triportal 只期望 main 内渲染 .tp-main-wrap。
   任何“伪原创/插件/广告”往 .tp-col-main 直接插入的占位块，全部从文档流里移除，避免顶出大空白。
   如果你确实要保留某个注入块，在它上面加 class="tp-keep" 即可。 */
.tp-col-main { position: relative; }
.tp-col-main > :not(.tp-main-wrap):not(script):not(style):not(.tp-keep) {
  display: none !important;
}

/* 右栏同理：只保留卡片结构 */
.tp-col-right > :not(.tp-card):not(script):not(style):not(.tp-keep) {
  display: none !important;
}

.tp-card {
  border: 1px solid var(--tp-border);
  background: var(--tp-panel);
  border-radius: var(--tp-radius);
  box-shadow: var(--tp-shadow);
}
.tp-card + .tp-card { margin-top: 16px; }
.tp-card-pad { padding: 16px; }
.tp-card-title { font-weight: 700; margin-bottom: 12px; }

.tp-kicker {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(34, 197, 94, 0.9);
  margin-bottom: 6px;
}
.tp-h1 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.tp-muted { color: var(--tp-muted); font-size: 13px; }

.tp-actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.tp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124,58,237,0.95), rgba(124,58,237,0.65));
  border: 1px solid rgba(124,58,237,0.55);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.tp-btn:hover { filter: brightness(1.05); }
.tp-btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--tp-border);
  color: rgba(238, 242, 255, 0.9);
  font-weight: 600;
}
.tp-btn-ghost:hover { background: rgba(255, 255, 255, 0.10); }

.tp-quick { display: flex; flex-wrap: wrap; gap: 10px; }
.tp-quick-item {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--tp-border);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(238, 242, 255, 0.82);
  font-size: 13px;
}
.tp-quick-item:hover { background: rgba(255, 255, 255, 0.08); }

/* ===== 主内容通用 ===== */
.tp-main-wrap { display: flex; flex-direction: column; gap: 16px; }
.tp-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tp-title { font-size: 18px; font-weight: 800; margin: 0; }
.tp-meta { color: var(--tp-muted); font-size: 13px; }

.tp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.tp-cardv {
  border: 1px solid var(--tp-border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.15s ease, background 0.15s ease;
}
.tp-cardv:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.06); }
.tp-thumb {
  position: relative;
  width: 100%;
  padding-top: 140%;
  background: rgba(255, 255, 255, 0.05);
}
.tp-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tp-badges {
  position: absolute;
  left: 10px;
  top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tp-badge {
  font-size: 11px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.tp-badge.tp-badge-new { background: rgba(34,197,94,0.26); border-color: rgba(34,197,94,0.55); }
.tp-badge.tp-badge-hd { background: rgba(124,58,237,0.22); border-color: rgba(124,58,237,0.55); }
.tp-time {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 11px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.tp-cardv-body { padding: 10px 10px 12px; }
.tp-cardv-title {
  font-size: 13px;
  font-weight: 650;
  margin: 0;
  color: rgba(238, 242, 255, 0.92);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
  min-height: 34px;
}
.tp-cardv-sub { color: rgba(238, 242, 255, 0.55); font-size: 12px; margin-top: 6px; }

/* 右侧：迷你列表 */
.tp-mini-list { display: flex; flex-direction: column; gap: 10px; }
.tp-mini { display: flex; gap: 10px; padding: 10px; border-radius: 14px; }
.tp-mini:hover { background: rgba(255, 255, 255, 0.06); }
.tp-mini-pic { width: 72px; height: 54px; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, 0.06); flex-shrink: 0; }
.tp-mini-pic img { width: 100%; height: 100%; object-fit: cover; }
.tp-mini-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tp-mini-title { font-size: 13px; font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tp-mini-sub { font-size: 12px; color: var(--tp-muted); }

.tp-news { display: flex; flex-direction: column; gap: 10px; }
.tp-news-item { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; }
.tp-news-item:hover { background: rgba(255, 255, 255, 0.06); }
.tp-news-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(34,197,94,0.95); box-shadow: 0 0 0 4px rgba(34,197,94,0.12); }
.tp-news-text { font-size: 13px; color: rgba(238, 242, 255, 0.86); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* 分页 */
.tp-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.tp-pager a, .tp-pager span {
  border: 1px solid var(--tp-border);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(238, 242, 255, 0.85);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
}
.tp-pager a:hover { background: rgba(255, 255, 255, 0.10); }
.tp-pager span { color: var(--tp-muted); }

/* 播放区（vodplay） */
.tp-player-shell {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--tp-radius);
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.tp-player {
  position: absolute;
  inset: 0;
}
.tp-episodes { display: flex; flex-wrap: wrap; gap: 10px; }
.tp-episodes a {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--tp-border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: rgba(238, 242, 255, 0.86);
}
.tp-episodes a:hover { background: rgba(255, 255, 255, 0.08); }
.tp-episodes a.is-active { background: rgba(124,58,237,0.25); border-color: rgba(124,58,237,0.55); color: #fff; }
.tp-lines { display: flex; flex-wrap: wrap; gap: 10px; }
.tp-lines a {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--tp-border);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: rgba(238, 242, 255, 0.86);
}
.tp-lines a.is-active { background: rgba(34,197,94,0.22); border-color: rgba(34,197,94,0.55); color: #fff; }

/* 页脚 */
.tp-footer {
  margin-top: 10px;
  border-top: 1px solid var(--tp-border);
  background: rgba(255, 255, 255, 0.03);
}
.tp-footer-inner {
  max-width: var(--tp-max);
  margin: 0 auto;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: rgba(238, 242, 255, 0.60);
  font-size: 13px;
}

@media (max-width: 1200px) {
  .tp-frame { grid-template-columns: 240px 1fr; }
  .tp-col-right { display: none; }
  .tp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .tp-toplinks { display: none; }
  .tp-brand { min-width: 0; }
  .tp-frame { grid-template-columns: 1fr; }
  .tp-col-left { grid-column: 1; order: 2; }
  .tp-col-main { grid-column: 1; order: 1; }
  .tp-col-right { grid-column: 1; display: block; order: 3; }
  .tp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .tp-topbar-inner { flex-wrap: wrap; }
  .tp-search { order: 3; width: 100%; }
  .tp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

