/* NinanACG NEW 主题样式 */

:root {
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-heavy-bg: rgba(0, 0, 0, 0.8);
    --glass-heavy-border: rgba(255, 255, 255, 0.08);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 基础样式 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #000;
    color: #fff;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 毛玻璃效果 - 修复hover效果 */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.4s ease,
                border-color 0.4s ease;
}

/* 更自然的hover效果 */
.glass:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.025);
    border-color: rgba(255, 255, 255, 0.08);
}

.glass-heavy {
    background: var(--glass-heavy-bg);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--glass-heavy-border);
    transition: var(--transition-base);
}

/* 流光边框 */
.flow-border {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-base);
}

.flow-border::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(0deg);
    animation: flow 3s linear infinite;
}

.flow-border:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

@keyframes flow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 噪点纹理 */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.015;
    z-index: 1;
    pointer-events: none;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48ZmlsdGVyIGlkPSJhIj48ZmVUdXJidWxlbmNlIGJhc2VGcmVxdWVuY3k9Ii45IiBudW1PY3RhdmVzPSI0IiBzZWVkPSIyIi8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsdGVyPSJ1cmwoI2EpIiBvcGFjaXR5PSIxIi8+PC9zdmc+');
}

/* 通用动画类 */
.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 文章页面进入动画 */
article {
    animation: articleEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes articleEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 文章列表项hover效果 */
.post-item {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease;
}

.post-item:hover {
    transform: translateX(4px);
    opacity: 0.9;
}

/* Hover效果 - 更柔和 */
.hover-lift {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.06);
}

.hover-scale {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* 超级弹出提示动画 */
.super-popup {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease-out;
}

.super-popup.show {
    opacity: 1;
    transform: translateY(0);
}

.super-popup.hide {
    opacity: 0;
    transform: translateY(20px);
}

/* 验证码弹窗 */
.captcha-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.captcha-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.captcha-header {
    text-align: center;
    margin-bottom: 25px;
}

.captcha-header h3 {
    font-size: 24px;
    font-weight: 300;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.captcha-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.captcha-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.captcha-image {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.captcha-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.captcha-image:hover img {
    transform: scale(1.1);
}

.captcha-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(139, 92, 246, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.captcha-image.selected::after {
    opacity: 1;
}

.captcha-image.selected::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 36px;
    font-weight: bold;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.captcha-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.captcha-actions button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.captcha-cancel {
    background: rgba(255, 255, 255, 0.1);
}

.captcha-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.captcha-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-weight: 500;
}

.captcha-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.captcha-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 响应式 */
@media (max-width: 640px) {
    .captcha-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .captcha-content {
        padding: 20px;
    }
}

/* 音乐播放器 */
.music-player {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 300px;
    transform: translateX(calc(100% + 40px));
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.music-player.show {
    transform: translateX(0);
}

/* 搜索框动画 */
.search-box {
    position: relative;
    overflow: hidden;
}

.search-box::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-box:focus-within::after {
    width: 100%;
    animation: searchGlow 2s ease-in-out infinite;
}

@keyframes searchGlow {
    0%, 100% { 
        opacity: 0.3;
        transform: translateX(-100%);
    }
    50% { 
        opacity: 1;
        transform: translateX(0);
    }
}

/* 关键帧动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* 页面加载动画 */
.page-enter {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* 页面内容容器动画 */
main {
    animation: pageEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 搜索模态框 */
#search-modal {
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#search-modal.show {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(20px);
}

#search-modal.show input {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

/* 按钮涟漪效果 */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease-out, height 0.6s ease-out;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* 页面切换过渡 */
.page-transition {
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition-enter {
    opacity: 0;
    transform: translateX(20px);
}

.page-transition-active {
    opacity: 1;
    transform: translateX(0);
}

/* 标签样式 */
.tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tag:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* 菜单项间距修复 */
.menu-item {
    position: relative;
}

nav .menu-item:not(:last-child) {
    margin-right: 0.5rem;
}

/* 主菜单项样式 */
nav > ul > li > a {
    display: block;
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

/* 二级菜单样式 */
.has-children {
    position: relative;
}

.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    min-width: 200px;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(-10px);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.has-children:hover .sub-menu {
    transform: translateY(0);
}

.sub-menu li {
    position: relative;
}

.sub-menu a {
    white-space: nowrap;
    transition: background-color 0.2s ease, padding-left 0.2s ease;
}

.sub-menu a:hover {
    padding-left: 1.5rem;
}

/* 分页样式 */
.pagination {
    margin-top: 2rem;
    text-align: center;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}

/* 加载动画延迟 */
.animate-fade-in:nth-child(1) { animation-delay: 0.1s; }
.animate-fade-in:nth-child(2) { animation-delay: 0.2s; }
.animate-fade-in:nth-child(3) { animation-delay: 0.3s; }
.animate-fade-in:nth-child(4) { animation-delay: 0.4s; }
.animate-fade-in:nth-child(5) { animation-delay: 0.5s; }

/* 链接过渡效果 */
a {
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* 头像样式优化 */
.avatar {
    object-fit: cover;
    border-radius: 9999px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar:hover {
    transform: scale(1.05);
}

/* 移动端优化 */
@media (max-width: 1024px) {
    .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        margin-left: 1rem;
        margin-top: 0;
        box-shadow: none;
    }
    
    .hover-lift:hover {
        transform: none;
    }
    
    .glass:hover {
        transform: none;
        box-shadow: none;
    }
    
    .menu-item {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* 文章图片hover效果 */
article img {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease;
}

article img:hover {
    transform: scale(1.02);
    opacity: 0.95;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 触摸反馈 */
.tap-feedback {
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.tap-feedback:active {
    background-color: rgba(255, 255, 255, 0.05);
}

/* 侧边栏widget hover效果 */
aside .glass {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

aside .glass:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.04);
}

/* 头像上传按钮样式 */
.group:hover label[for="avatar-upload"] {
    opacity: 1;
}

label[for="avatar-upload"] {
    opacity: 0.8;
    transition: all 0.3s ease;
}

label[for="avatar-upload"]:hover {
    transform: scale(1.1);
}

/* 自定义轮播指示器 - 线条风格 */
.featured-swiper .swiper-pagination {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    left: auto;
    width: auto;
    display: flex;
    gap: 0.25rem;
    z-index: 10;
}

@media (min-width: 1024px) {
    .featured-swiper .swiper-pagination {
        bottom: 1rem;
        right: 1rem;
        gap: 0.5rem;
    }
}

/* 隐藏默认的圆点 */
.featured-swiper .swiper-pagination-bullet {
    width: 1.5rem;
    height: 0.125rem;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 9999px;
    opacity: 1;
    margin: 0 !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .featured-swiper .swiper-pagination-bullet {
        width: 2rem;
        height: 0.25rem;
    }
}

/* 激活状态 */
.featured-swiper .swiper-pagination-bullet-active {
    width: 2.5rem;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

@media (min-width: 1024px) {
    .featured-swiper .swiper-pagination-bullet-active {
        width: 3rem;
    }
}

/* 进度条效果 */
.featured-swiper .swiper-pagination-bullet-active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        rgba(255, 255, 255, 0.3) 100%);
    animation: progressLine var(--swiper-duration, 5000ms) linear forwards;
}

@keyframes progressLine {
    from { width: 0; }
    to { width: 100%; }
}

/* 微光效果 */
.featured-swiper .swiper-pagination-bullet-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

/* 悬停效果 */
.featured-swiper .swiper-pagination-bullet:hover:not(.swiper-pagination-bullet-active) {
    background: rgba(255, 255, 255, 0.5);
    width: 2rem;
}

@media (min-width: 1024px) {
    .featured-swiper .swiper-pagination-bullet:hover:not(.swiper-pagination-bullet-active) {
        width: 2.5rem;
    }
}

/* 点击动画 */
.featured-swiper .swiper-pagination-bullet:active {
    transform: scale(0.95);
}

/* 移除默认的动态圆点样式 */
.featured-swiper .swiper-pagination-bullets-dynamic {
    overflow: visible;
}

.featured-swiper .swiper-pagination-bullet-active-main,
.featured-swiper .swiper-pagination-bullet-active-prev,
.featured-swiper .swiper-pagination-bullet-active-prev-prev,
.featured-swiper .swiper-pagination-bullet-active-next,
.featured-swiper .swiper-pagination-bullet-active-next-next {
    transform: scale(1) !important;
}
    
/* 移动端分类下拉菜单样式 */
#mobile-category-dropdown {
    position: absolute;
    right: 1rem;
    top: 100%;
    margin-top: 0.5rem;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-height: 400px;
    overflow-y: auto;
}

/* 确保过渡效果正常工作 */
#mobile-category-dropdown.opacity-0 {
    opacity: 0 !important;
}

#mobile-category-dropdown.opacity-100 {
    opacity: 1 !important;
}

#mobile-category-dropdown.invisible {
    visibility: hidden !important;
}

#mobile-category-dropdown.visible {
    visibility: visible !important;
}

#mobile-category-dropdown.-translate-y-2 {
    transform: translateY(-0.5rem) !important;
}

#mobile-category-dropdown.translate-y-0 {
    transform: translateY(0) !important;
}

/* 旋转箭头 */
#mobile-category-toggle svg {
    transition: transform 0.3s ease;
}

#mobile-category-toggle svg.rotate-180 {
    transform: rotate(180deg);
}

/* 分类按钮样式 */
.category-filter {
    transition: all 0.2s ease;
}

.category-filter:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.category-filter.active {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* 移动端优化 */
@media (max-width: 640px) {
    #mobile-category-dropdown {
        min-width: 200px;
    }
}