/* MacClean 本地零依赖现代圆角自适应样式表 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-body: #0f1115;
  --bg-card: #1a1d24;
  --bg-card-hover: #252932;
  --bg-panel: #161920;
  --bg-ep: #20242e;
  --bg-ep-hover: #2a2f3c;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --text-main: #f3f4f6;
  --text-sub: #9ca3af;
  --text-muted: #6b7280;
  --border-light: rgba(255, 255, 255, 0.08);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.hidden {
  display: none !important;
}

/* 布局容器 */
.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 12px;
}

.container-narrow {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 12px;
}

@media (min-width: 640px) {
  .container, .container-narrow {
    padding: 0 24px;
  }
}

.main-content {
  flex: 1;
  padding-top: 20px;
  padding-bottom: 32px;
}

/* 顶部粘性毛玻璃导航栏 */
.site-header {
  background-color: #13161c;
  border-bottom: 1px solid var(--border-light);
  padding: 14px 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(90deg, #60a5fa, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media (min-width: 640px) {
  .site-logo {
    font-size: 1.5rem;
  }
}

.btn-top-home {
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.08);
  color: #d1d5db;
  transition: background-color 0.2s, color 0.2s;
}

.btn-top-home:hover {
  background-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* 一级栏目网格：严格一行4个，约8行（32个） */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 640px) {
  .nav-grid {
    gap: 10px;
  }
}

.nav-item {
  display: block;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 6px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--bg-card);
  color: #d1d5db;
  border: 1px solid rgba(255, 255, 255, 0.45); /* 柔和白色边框 */
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: var(--bg-card-hover);
  border-color: #ffffff;
  color: #ffffff;
}

.nav-item.active {
  background-color: var(--primary);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.5);
}

@media (min-width: 640px) {
  .nav-item {
    font-size: 0.875rem;
    padding: 9px 10px;
  }
}

.nav-item:hover {
  background-color: var(--bg-card-hover);
  color: #ffffff;
}

.nav-item.active {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.5);
}

/* 区块标题栏 */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-indicator {
  width: 6px;
  height: 20px;
  border-radius: 9999px;
  background-color: var(--primary);
}

.section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
}

@media (min-width: 640px) {
  .section-title {
    font-size: 1.25rem;
  }
}

.section-meta {
  font-size: 0.75rem;
  color: var(--text-sub);
}

/* 视频卡片自适应网格：手机2列 / 小平板3列 / 平板4列 / 桌面6列 */
.vod-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (min-width: 640px) {
  .vod-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (min-width: 768px) {
  .vod-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .vod-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
}

.vod-card {
  display: block;
  transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.vod-card:hover {
  transform: translateY(-4px);
}

.poster-box {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background-color: #1c1f26;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.vod-card:hover .poster-box {
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.65);
}

.poster-box img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.35s ease, opacity 0.25s ease;
}

.vod-card:hover .poster-box img {
  transform: scale(1.05);
}

.vod-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(4px);
  color: #e5e7eb;
}

.vod-title {
  margin-top: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.vod-card:hover .vod-title {
  color: #60a5fa;
}

.vod-sub {
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 圆角分页器 */
.pagination {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.875rem;
}

.page-btn {
  padding: 8px 16px;
  border-radius: 12px;
  background-color: var(--bg-card);
  color: #d1d5db;
  transition: all 0.2s;
}

.page-btn:hover {
  background-color: var(--primary);
  color: #ffffff;
}

.page-info {
  padding: 8px 16px;
  border-radius: 12px;
  background-color: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
  font-weight: 600;
}

/* 播放页专属布局 */
.player-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border-light);
}

.player-wrapper video {
  width: 100%;
  height: 100%;
  outline: none;
  background: #000;
}

.vod-info-bar {
  margin-top: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.vod-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.btn-inline-home {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 9999px;
  background-color: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-inline-home:hover {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-inline-home svg {
  width: 14px;
  height: 14px;
}

.play-vod-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

@media (min-width: 640px) {
  .play-vod-name {
    font-size: 1.5rem;
  }
}

.play-vod-meta {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-sub);
}

.play-vod-meta a {
  color: #60a5fa;
}

.play-vod-meta a:hover {
  text-decoration: underline;
}

/* 播放线路与选集面板 */
.playlist-section {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.playlist-box {
  background-color: var(--bg-panel);
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (min-width: 640px) {
  .playlist-box {
    padding: 20px;
  }
}

.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.playlist-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #60a5fa;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot-blue {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background-color: var(--primary);
}

.playlist-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ep-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 640px) {
  .ep-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .ep-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.ep-btn {
  display: block;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  background-color: var(--bg-ep);
  color: #d1d5db;
  transition: all 0.2s;
}

.ep-btn:hover {
  background-color: var(--bg-ep-hover);
  color: #ffffff;
}

.ep-btn.active {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.45);
}

/* 底部版权 */
.site-footer {
  padding: 24px 0;
  text-align: center;
  font-size: 0.75rem;
  color: #4b5563;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
/* 顶部搜索框与站内搜索结果面板 */
.search-bar-wrap {
  margin-bottom: 12px;
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 14px;
  padding: 0 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-box:focus-within {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-sub);
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 0.875rem;
  padding: 10px 10px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #d1d5db;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.search-clear:hover {
  background: var(--primary);
  color: #ffffff;
}

.search-result-panel {
  padding-top: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* 搜索结果网格：手机端一行1个，电脑端一行2个 */
#mac-search-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
}

@media (min-width: 640px) {
  #mac-search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }
}

/* 纯文字搜索结果列表项 */
.search-text-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background-color: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  min-width: 0;
}

.search-text-item:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.search-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: var(--primary);
  flex-shrink: 0;
}

.search-item-name {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  font-weight: 500;
  color: #e5e7eb;
  white-space: normal;
  word-break: break-all;
}

@media (min-width: 640px) {
  .search-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.search-text-item:hover .search-item-name {
  color: #ffffff;
}

.search-item-play {
  font-size: 0.75rem;
  color: #60a5fa;
  flex-shrink: 0;
}