/* 侧边栏专用样式 */

/* 确保基础布局类存在 */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.hidden { display: none; }
.fixed { position: fixed; }
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-50 { z-index: 50; }

/* 变换类 */
.transform { transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }
.-translate-x-full { --tw-translate-x: -100%; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-300 { transition-duration: 300ms; }
.ease-in-out { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* 宽度和高度 */
.w-32 { width: 8rem; }
.w-36 { width: 9rem; }
.w-40 { width: 10rem; }
.w-48 { width: 12rem; }
.w-56 { width: 14rem; }
.w-64 { width: 16rem; }
.w-72 { width: 18rem; }
.w-80 { width: 20rem; }
.w-96 { width: 24rem; }
.w-full { width: 100%; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-4 { width: 1rem; }
.h-full { height: 100%; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-4 { height: 1rem; }
.max-w-sm { max-width: 24rem; }
.min-w-0 { min-width: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* 宽高比 */
.aspect-\[3\/4\] { aspect-ratio: 3/4; }

/* Flexbox */
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* 间距 */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

/* 间距工具 */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* 边框 */
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-r { border-right-width: 1px; }
.border-gray-200 { border-color: rgb(229 231 235); }
.border-gray-300 { border-color: rgb(209 213 219); }

/* 圆角 */
.rounded-lg { border-radius: 0.5rem; }

/* 阴影 */
.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); }

/* 背景色 */
.bg-white { background-color: rgb(255 255 255); }
.bg-gray-50 { background-color: rgb(249 250 251); }
.bg-gray-800 { background-color: rgb(31 41 55); }
.bg-primary { background-color: var(--c-primary); }
.bg-primary\/10 { background-color: rgba(0, 120, 238, 0.1); }
.bg-primary\/20 { background-color: rgba(0, 120, 238, 0.2); }
.bg-secondary { background-color: var(--c-secondary); }
.bg-green-50 { background-color: rgb(240 253 244); }
.bg-green-600 { background-color: rgb(22 163 74); }
.bg-black { background-color: rgb(0 0 0); }
.bg-opacity-50 { background-color: rgb(0 0 0 / 0.5); }

/* 文字颜色 */
.text-white { color: rgb(255 255 255); }
.text-gray-200 { color: rgb(229 231 235); }
.text-gray-300 { color: rgb(209 213 219); }
.text-gray-400 { color: rgb(156 163 175); }
.text-gray-600 { color: rgb(75 85 99); }
.text-gray-700 { color: rgb(55 65 81); }
.text-gray-900 { color: rgb(17 24 39); }
.text-primary { color: var(--c-primary); }
.text-secondary { color: var(--c-secondary); }
.text-green-500 { color: rgb(34 197 94); }
.text-green-600 { color: rgb(22 163 74); }

/* 文字大小和字重 */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }

/* 其他 */
.text-center { text-align: center; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.cursor-pointer { cursor: pointer; }

/* 网格布局 */
.grid { display: grid; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.grid-cols-10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }

/* 悬停效果 */
.hover\:text-primary:hover { color: var(--c-primary); }
.hover\:bg-primary:hover { background-color: var(--c-primary); }
.hover\:bg-primary\/10:hover { background-color: rgba(0, 120, 238, 0.1); }
.hover\:bg-primary\/80:hover { background-color: rgba(0, 120, 238, 0.8); }
.hover\:text-primary\/80:hover { color: rgba(0, 120, 238, 0.8); }
.hover\:bg-green-50:hover { background-color: rgb(240 253 244); }
.hover\:text-green-500:hover { color: rgb(34 197 94); }
.hover\:text-green-600:hover { color: rgb(22 163 74); }
.hover\:text-gray-200:hover { color: rgb(229 231 235); }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* Group 悬停 */
.group:hover .group-hover\:text-green-500 { color: rgb(34 197 94); }

/* 响应式 */
@media (min-width: 640px) {
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sm\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:flex-row { flex-direction: row; }
  .md\:w-48 { width: 12rem; }
  .md\:mx-0 { margin-left: 0; margin-right: 0; }
  .md\:gap-8 { gap: 2rem; }
  .md\:p-6 { padding: 1.5rem; }
  .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
  .md\:text-base { font-size: 1rem; line-height: 1.5rem; }
  .md\:space-y-4 > * + * { margin-top: 1rem; }
  .md\:space-y-3 > * + * { margin-top: 0.75rem; }
  .md\:w-16 { width: 4rem; }
  .md\:mt-6 { margin-top: 1.5rem; }
  .md\:block { display: block; }
  .md\:hidden { display: none; }
  .md\:text-left { text-align: left; }
  .md\:w-44 { width: 11rem; }
  .md\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .md\:grid-cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg\:hidden { display: none; }
  .lg\:flex { display: flex; }
  .lg\:flex-row { flex-direction: row; }
  .lg\:flex-shrink-0 { flex-shrink: 0; }
  .lg\:block { display: block; }
  .lg\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .lg\:w-56 { width: 14rem; }
  .lg\:w-80 { width: 20rem; }
  .lg\:gap-5 { gap: 1.25rem; }
  .lg\:max-w-none { max-width: none; }
  .lg\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
  .lg\:grid-cols-10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  .xl\:w-64 { width: 16rem; }
  .xl\:w-80 { width: 20rem; }
  .xl\:max-w-none { max-width: none; }
}

/* 焦点 */
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); }
.focus\:ring-primary:focus { --tw-ring-color: var(--c-primary); }
.focus\:border-primary:focus { border-color: var(--c-primary); }
.focus\:ring-green-500:focus { --tw-ring-color: rgb(34 197 94); }
.focus\:border-green-500:focus { border-color: rgb(34 197 94); }

/* 自定义变量 */
:root {
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-ring-inset: ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
}

/* 文本截断 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
    text-overflow: ellipsis;
    max-height: 2.4em;
    line-height: 1.2em;
}

/* 统一导航样式 */
.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgb(75 85 99);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    border-radius: 0;
}

.nav-item:hover {
    background-color: rgba(0, 120, 238, 0.1);
    color: var(--c-primary);
}

.nav-item.nav-active {
    background-color: rgba(0, 120, 238, 0.1);
    color: var(--c-primary);
    border-right: 2px solid var(--c-primary);
}

/* 顶级导航项 */
.nav-top-level {
    font-size: 0.875rem;
    font-weight: 500;
}

/* 子级导航项 */
.nav-sub-level {
    font-size: 0.75rem;
    font-weight: 400;
    padding-left: 2.5rem;
    position: relative;
}

/* 导航图标 */
.nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* 子级项目前的小圆点 */
.nav-bullet {
    width: 0.25rem;
    height: 0.25rem;
    background-color: rgb(156 163 175);
    border-radius: 50%;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* 可展开按钮样式 */
.nav-expandable {
    background: none;
    border: none;
    justify-content: space-between;
}

.nav-item-content {
    display: flex;
    align-items: center;
    flex: 1;
}

.nav-arrow {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease-in-out;
    flex-shrink: 0;
}

.nav-arrow.rotated {
    transform: rotate(180deg);
}

/* 子菜单容器 */
.nav-submenu {
    background-color: rgb(249 250 251);
    border-left: 2px solid rgb(229 231 235);
    margin-left: 1rem;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.nav-submenu.collapsed {
    max-height: 0;
}

.nav-submenu.expanded {
    max-height: 500px;
}

/* 分组标题 */
.nav-section-title {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(156 163 175);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 移动端导航样式调整 */
@media (max-width: 1024px) {
    .nav-item {
        padding: 0.875rem 1rem;
    }
    
    .nav-top-level {
        font-size: 0.875rem;
        border-bottom: 1px solid rgb(243 244 246);
    }
    
    .nav-sub-level {
        padding-left: 2rem;
        background-color: rgb(249 250 251);
        border-bottom: 1px solid rgb(243 244 246);
    }
    
    .nav-submenu {
        background-color: rgb(249 250 251);
        border-left: none;
        margin-left: 0;
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .mobile-grid {
        gap: 6px !important;
        grid-template-columns: repeat(5, 1fr) !important;
    }
    
    .mobile-item {
        font-size: 10px !important;
        line-height: 1.1 !important;
    }
    
    .mobile-recommend-poster {
        margin-bottom: 2px !important;
    }
}

@media (max-width: 640px) {
    .mobile-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 4px !important;
    }
    
    .mobile-item {
        font-size: 9px !important;
    }
}