

/* =========== 基础变量定义 =========== */
:root {
  /* 主色调 */
  --primary: #0040f0;
  --primary-foreground: #ffffff;
  
  /* 背景色系 */
  --background: #ffffff;
  --foreground: #0f1419;
  
  /* 卡片和组件 */
  --card: #ffffff;
  --card-foreground: #0f1419;
  
  /* 中性色 */
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  

  
  /* 功能色 */
  --success: #22c55e;
  --warning: #f59e0b;
  --destructive: #ef4444;
  --destructive-foreground: #ffffff;
  
  /* 边框和阴影 */
  --border: #e2e8f0;
  --radius: 0.5rem;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  
  /* 原网站兼容性变量 */
  --tx-color: #0040f0;
  --tx-border: #e2e8f0;
  --tx-color2: #64748b;
  --tx-color3: fill: hsla(0,0%,100%,.7);
  --tx-bg2: #ffffff;
  --tx-bg3: #e5284d;
  --tx-pop-bg1:#ffffff;
  --tx-pop-bg2:#252632;
  --color-navigation-bg:#fff;
  --color-header-bg: #fff;
  --color-main-bg:#fff;
  --color-tx-wide-bg: #fff;
  --color-tx-bg1:#fff;
  --color-bg-0: #fff;
  --color-bg-1: #f8f9fd;
  --color-bg-2: #eff0f3;
  --color-bg-3: #ededed;
  --color-text-0: #2f3035;
  --color-text-1: rgba(47,48,53,.9);
  --color-text-2: hsla(0,0%,100%,.5);
  --color-text-3: rgba(47,48,53,.4);
  --color-text-4: rgba(47,48,53,.7);
  --color-text-5: #fff;
  --color-f-gray: #40424b;
  --color-f-green: #5fb878;
  --color-f-red: #012fb0;
  --color-a-header-user: #012fb0;
  --color-a-side-left: #2f3035;
  --color-list-sx-a-bg: rgba(0, 0, 0, 0.05);
  --color-list-sx-a-text: #2f3035;
  --color-search-box-text: #012fb0;
  --color-search-box-bg: transparent;
  --color-search-box-form: #f5f5f5;
  --color-search-box-form-border: #f5f5f5;
  --color-footer: #2f3035;
  --color-a-li-side-bg: #f2f8ff;
  --color-a-li-side-text: #2f3035;
  --color-side-li-h3: #000;
  --color-webkit-scrollbar-bg:#fff;
  --color-webkit-scrollbar-thumb-bg: #eee;
  --color-webkit-scrollbar-track-bg: #fff;
  --opacity-side-nav: 1;
  --overlay-bg-2: #dbdbdb;
  --overlay-bg-3: #d8d8d8;
  --color-border: hsla(0,0%,100%,.03);
  --shadow-2: 0 0 24px rgba(0,0,0,.2);
}

/* 暗色模式变量 */
html[dark="true"] {
  --background: #121212;
  --foreground: #e2e8f0;
  --card: #1e1e1e;
  --card-foreground: #e2e8f0;
  --border: #2d2d2d;
  
  /* 原网站兼容性变量 */
  --tx-color: #fff;
  --tx-color2: #94a3b8;
  --tx-bg2: #252632;
  --tx-pop-bg1:#161722;
  --tx-pop-bg2:#252632;
  --color-navigation-bg:#060716;
  --color-header-bg: #161722;
  --color-main-bg:#161722;
  --color-tx-wide-bg: #161722;
  --color-tx-bg1:#161722;
  --color-bg-0: #252632;
  --color-bg-1: #2e2f3b;
  --color-bg-2:#292b35;
  --color-bg-3: #161722;
  --color-text-0: hsla(0,0%,100%,.9);
  --color-text-1: hsla(0,0%,100%,.8);
  --color-text-2: hsla(0,0%,100%,.7);
  --color-text-3: hsla(0,0%,100%,.5);
  --color-text-4: hsla(0,0%,100%,.7);
  --color-text-5: #000;
  --color-f-gray: hsla(0,0%,100%,.5);
  --color-f-green:hsla(0,0%,100%,.9);
  --color-f-red: hsla(0,0%,100%,.9);
  --color-a-header-user: hsla(0,0%,100%,.9);
  --color-a-side-left: #fff;
  --color-list-sx-a-bg: #161722;
  --color-list-sx-a-text: #fff;
  --color-search-box-text: hsla(0,0%,100%,.5);
  --color-search-box-bg: transparent;
  --color-search-box-form: hsla(0,0%,100%,.04);
  --color-search-box-form-border: hsla(0,0%,100%,.7);
  --color-footer: hsla(0,0%,100%,.9);
  --color-a-li-side-bg: #060716;
  --color-a-li-side-text: #fff;
  --color-side-li-h3: #fff;
  --color-webkit-scrollbar-bg:#161722;
  --color-webkit-scrollbar-thumb-bg: #363741;
  --color-webkit-scrollbar-track-bg: #161722;
  --opacity-side-nav: .6;
  --overlay-bg-2: rgba(54,55,65,.4);
  --overlay-bg-3: #31323a;
  --color-border: hsla(0,0%,100%,.03);
  --shadow-2: 0 0 24px #000;
}

/* =========== 基础重置 =========== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  /*font-family: 'Inter', 'PingFang SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;*/
  line-height: 1.5;
  color: var(--foreground);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
  vertical-align: middle;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
}

ul, ol, li {
  list-style: none;
}

::selection {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* =========== 布局组件 =========== */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

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

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

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

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.space-x-2 > :not([hidden]) ~ :not([hidden]) {
  margin-left: 0.5rem;
}

.space-y-2 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0.5rem;
}

/* =========== 组件样式 =========== */

/* 卡片 */
.card {
  position: relative;
  background-color: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: 600;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--foreground);
}

.btn-outline:hover {
  background-color: var(--muted);
}

/* 表单元素 */
.input {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--background);
  color: var(--foreground);
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 64, 240, 0.2);
}

.search-input {
  padding-left: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
  background-size: 1rem;
}

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  background-color: var(--muted);
  color: var(--muted-foreground);
}

.badge-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* 导航栏 */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4rem;
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

/* 侧边栏 */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  padding-top: 4rem;
  background-color: var(--background);
  border-right: 1px solid var(--border);
  z-index: 40;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
}

/* 主内容区 */
.main {
  padding-top: 4rem;
  padding-left: 240px;
  min-height: 100vh;
}

@media (max-width: 1024px) {
  .main {
    padding-left: 0;
  }
}

/* 视频容器 */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 宽高比 */
  overflow: hidden;
  background-color: #000;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 图片容器 */
.img-box {
  position: relative;
  overflow: hidden;
  padding-top: 56.25%; /* 16:9 宽高比 */
}

.img-box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

/* 标签和信息 */
.tag {
  display: inline-flex;
  align-items: center;
  background-color: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag:hover {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

/* 分页 */

/* 切换按钮 */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 3rem;
  height: 1.5rem;
  background-color: var(--muted);
  border-radius: 9999px;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.toggle::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  width: 1rem;
  height: 1rem;
  background-color: var(--background);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle.active {
  background-color: var(--primary);
}

.toggle.active::after {
  transform: translateX(1.5rem);
}

/* 加载状态 */
.loading {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--muted);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========== 工具类 =========== */
.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.font-medium {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--muted-foreground);
}

.text-primary {
  color: var(--primary);
}

.rounded {
  border-radius: var(--radius);
}

.rounded-full {
  border-radius: 9999px;
}

.border {
  border: 1px solid var(--border);
}

.shadow {
  box-shadow: var(--shadow);
}

.p-2 {
  padding: 0.5rem;
}

.p-4 {
  padding: 1rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.m-2 {
  margin: 0.5rem;
}

.m-4 {
  margin: 1rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mr-2 {
  margin-right: 0.5rem;
}

.ml-2 {
  margin-left: 0.5rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.hidden {
  display: none;
}

.opacity-75 {
  opacity: 0.75;
}

.overflow-hidden {
  overflow: hidden;
}

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

/* =========== 响应式工具类 =========== */
@media (min-width: 640px) {
  .sm\:block {
    display: block;
  }
  
  .sm\:flex {
    display: flex;
  }
  
  .sm\:hidden {
    display: none;
  }
  
  .sm\:text-lg {
    font-size: 1.125rem;
  }
}

@media (min-width: 768px) {
  .md\:block {
    display: block;
  }
  
  .md\:flex {
    display: flex;
  }
  
  .md\:hidden {
    display: none;
  }
  
  .md\:text-xl {
    font-size: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .lg\:block {
    display: block;
  }
  
  .lg\:flex {
    display: flex;
  }
  
  .lg\:hidden {
    display: none;
  }
  
  .lg\:text-2xl {
    font-size: 1.5rem;
  }
}

/* =========== 原网站特定样式 =========== */

/* 图标按钮 */
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  transition: background-color 0.2s ease;
}

.icon-button:hover {
  background-color: var(--muted);
}

/* 视频信息展开 */
.video-info {
  max-height: none;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.video-info.collapsed {
  max-height: 4.5rem;
}

.video-info-toggle {
  cursor: pointer;
  color: var(--primary);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--muted-foreground);
  border-radius: 3px;
}

::-webkit-scrollbar-track {
  background-color: var(--muted);
}

/* 移动端导航 */
.mobile-nav {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3.5rem;
  background-color: var(--background);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 40;
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  transition: color 0.2s ease;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
  color: var(--primary);
}

.mobile-nav-icon {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

@media (min-width: 1024px) {
  .mobile-nav {
    display: none;
  }
}

/* 弹出提示 */
.pop-tip {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.75rem 1.5rem;
  background-color: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 100;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Swiper 自定义样式 */
.swiper-pagination-bullet {
  background-color: var(--muted);
  opacity: 0.7;
}

.swiper-pagination-bullet-active {
  background-color: var(--primary);
  opacity: 1;
}

.swiper-button-next,
.swiper-button-prev {
  color: var(--foreground);
  background-color: var(--background);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 1rem;
}

/* 侧边导航样式 */
.side-nav li h3 > * {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  font-weight: 600;
}

.side-nav li h3 > *:hover,
.side-nav li.on h3 > * {
  background-color: var(--muted);
  color: var(--primary);
}

/* =========== 兼容原网站广告和插件样式 =========== */

/* 广告容器 */
.tx-gg-box img {
  display: block;
  line-height: 1;
  max-width: 100%;
  height: auto;
}

.tx-dlgg {
  position: fixed;
  z-index: 999;
  top: 50%;
  transform: translate(0, -50%);
  max-width: 120px;
}

.tx-dlgg-l {
  left: 0;
}

.tx-dlgg-r {
  right: 0;
}

/* 底部固定导航 */
.ad0624-bottom-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  font-size: 13px;
  z-index: 999;
  background-color: var(--background);
  border-top: 1px solid var(--border);
}

.ad0624-bottom-fixed > a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 18%;
  padding: 8px 1px;
  color: var(--muted-foreground);
  transition: color 0.2s ease;
}

.ad0624-bottom-fixed > a.on,
.ad0624-bottom-fixed > a:hover {
  color: var(--primary);
}

/* 媒体查询 */
@media (max-width: 768px) {
  :root {
    font-size: 14px;
  }
  
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .header {
    height: 3.5rem;
  }
  
  .main {
    padding-top: 3.5rem;
    padding-bottom: 4.5rem;
  }
  
  .sidebar {
    width: 80%;
    max-width: 300px;
  }
}

@media (max-width: 640px) {
  :root {
    font-size: 12px;
  }
  
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .grid {
    gap: 0.75rem;
  }
}