/* 自定义样式 */
.sidebar-hidden {
    transform: translateX(-100%) !important;
}

.sidebar-visible {
    transform: translateX(0) !important;
}

.content-expanded {
    margin-left: 0;
}

.content-full-width {
    margin-left: 0 !important;
}

/* 统一顶部区域高度 */
.header-height {
    height: 73px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

/* 自定义滚动条 - 隐藏滚动条但保持滚动功能 */
.custom-scrollbar {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.custom-scrollbar::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

.tool-card {
    transition: all 0.3s ease;
    background: white;
    border-radius: 24px;
    border: 1px solid #f3f4f6;
    padding: 24px;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tool-tag {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* 统一主色调为 tailwindcss blue-500 #3b82f6 */

/* 取消渐变背景，统一为 blue-500 */
.gradient-bg {
    background: #3b82f6 !important;
}

/* 统一按钮主色调 */
#modal-search-btn,
#modal-search-btn:hover,
#login-btn,
button.bg-blue-500,
button.bg-blue-600,
.bg-blue-500,
.bg-blue-600 {
    background: #3b82f6 !important;
    color: #fff !important;
    border: none !important;
    background-image: none !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

#modal-search-btn:hover,
#login-btn:hover,
button.bg-blue-500:hover,
button.bg-blue-600:hover {
    background: #2563eb !important;
    /* 可选：hover时略深一点，也可直接用 #3b82f6 */
}

/* 统一所有蓝色字体和边框为 blue-500 */
.text-blue-500,
.text-blue-600,
.text-blue-700 {
    color: #3b82f6 !important;
}

.border-blue-500,
.border-blue-600,
.border-blue-700 {
    border-color: #3b82f6 !important;
}

/* 统一菜单栏悬浮色 */
@media (min-width: 1024px) {
    .sidebar-menu-hover:hover {
        background-color: #f3f8fd !important;
        color: #3b82f6 !important;
    }
}

/* 移动端搜索优化 */
@media (max-width: 1023px) {
    #search-suggestions {
        position: static !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .search-result-item {
        -webkit-tap-highlight-color: transparent;
    }
}

/* 防止移动端搜索时页面滚动 */
body.overflow-hidden {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* 悬浮按钮增强样式 */
.shadow-3xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* 打赏按钮样式 */
.shadow-3xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* 打赏按钮动画 */
@keyframes donateGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.5), 0 0 40px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(251, 191, 36, 0.8), 0 0 60px rgba(251, 191, 36, 0.5);
    }
}

@keyframes donatePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes donateShine {
    0% {
        transform: translateX(-100%) skewX(-12deg);
    }
    100% {
        transform: translateX(200%) skewX(-12deg);
    }
}

/* 打赏按钮悬停效果 */
/*
#donate-btn:hover {
    animation: donateGlow 2s ease-in-out infinite;
}

#donate-btn:hover .animate-bounce {
    animation: donatePulse 0.6s ease-in-out infinite;
}
*/

/* 装饰性元素动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.donate-decoration {
    animation: float 3s ease-in-out infinite;
}

.donate-decoration:nth-child(2) {
    animation-delay: 1s;
}

.donate-decoration:nth-child(3) {
    animation-delay: 2s;
}

/* 联系面板箭头指示器 */
/* #contact-panel::before {
    content: '';
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    filter: drop-shadow(2px 0 4px rgba(0, 0, 0, 0.1));
} */

/* 悬浮按钮动画优化 */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* 联系面板响应式优化 */
@media (max-width: 768px) {
    #contact-panel {
        position: fixed !important;
        bottom: 160px !important;
        right: 20px !important;
        left: 20px !important;
        width: auto !important;
        max-width: none !important;
    }

    /* #contact-panel::before {
        display: none;
    } */
}

/* 登录弹框样式 */
#login-modal {
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#login-modal.show {
    display: flex !important;
    opacity: 1;
}

#login-modal-content {
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s ease;
}

#login-modal.show #login-modal-content {
    transform: scale(1);
    opacity: 1;
}

/* 登录方式按钮悬浮效果 */
.login-method {
    transition: all 0.3s ease;
}

.login-method:hover {
    transform: translateY(-2px);
}

/* 二维码动画效果 */
@keyframes qrcode-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
}

.qr-code-container {
    animation: qrcode-pulse 2s infinite;
}

/* 顶部主按钮缩小 */
.header-height .lg\:flex.items-center.px-5.py-2\.5 {
    padding-left: 1.1rem !important;
    padding-right: 1.1rem !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    font-size: 0.97rem !important;
}

.header-height .lg\:flex.items-center.px-5.py-2\.5 i {
    font-size: 0.95em !important;
}

#login-btn {
    padding-left: 1.1rem !important;
    padding-right: 1.1rem !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    font-size: 0.97rem !important;
}

#login-btn i {
    font-size: 0.95em !important;
}

@media (max-width: 640px) {
    #search-modal>div>.pt-8 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    #search-modal .mb-4 {
        margin-bottom: 0.5rem !important;
    }

    #search-modal .bg-white.rounded-2xl.shadow-2xl {
        padding-bottom: 2.5rem !important;
    }

    #search-modal #modal-search-results {
        min-height: 40vh !important;
    }
}

/* 搜索弹窗搜索框优化样式 */
#search-modal .modal-content .search-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    #search-modal .modal-content .search-bar {
        flex-direction: row;
        align-items: stretch;
    }
}

#modal-search-input {
    border-radius: 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#modal-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px #dbeafe;
    background: #fff;
}

#modal-search-btn {
    border-radius: 0.75rem;
    background: #3b82f6;
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    transition: background 0.2s;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
    border: none;
}

#modal-search-btn:hover {
    background: #2563eb;
}

#modal-clear-btn {
    border-radius: 9999px;
    color: #9ca3af;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

/* 推荐搜索词字体和样式优化 */
#search-modal .popular-search {
    font-size: 0.95rem;
    padding: 0.5rem 1.25rem;
    border-radius: 1.5rem;
    background: #f3f4f6;
    color: #374151;
    transition: background 0.2s;
    margin-bottom: 0.25rem;
}

#search-modal .popular-search:hover {
    background: #e5e7eb;
}

/* 联系我们悬浮按钮主色统一为 blue-500 */
#contact-btn,
#contact-btn:hover,
.contact-btn,
.contact-btn:hover {
    background: #3b82f6 !important;
    color: #fff !important;
    background-image: none !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

/* ===== 自定义图片预览功能样式 ===== */

/* 图片预览容器 */
#custom-photos-container {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 图片容器 */
#custom-photos-container .relative {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 图片样式 - 修复抖动问题 */
#custom-photos-container img {
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    /* 防止图片尺寸变化导致的抖动 */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 禁用图片hover缩放效果 */
#custom-photos-container img:hover {
    transform: none !important;
}

/* 导航按钮样式 - 修复抖动问题 */
#custom-photos-container button {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 16px;
    font-weight: 600;
    /* 防止按钮悬浮时的抖动 */
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
    /* 确保按钮位置稳定 */
    position: absolute;
    z-index: 10;
}

#custom-photos-container button:hover {
    transform: scale(1.05) translateZ(0);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* 工具栏按钮横向排列不重叠 */
#custom-photos-container .absolute.top-4 {
    display: flex;
    gap: 0.75rem;
    top: 1rem;
    right: 1rem;
    position: absolute;
    z-index: 20;
}

#custom-photos-container .absolute.top-4 button {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    transform: translateZ(0);
    backface-visibility: hidden;
}

#custom-photos-container .absolute.top-4 button:hover {
    transform: scale(1.05) translateZ(0);
    background-color: rgba(0, 0, 0, 0.7) !important;
}

/* 计数器样式 */
#photos-counter {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
    letter-spacing: 0.5px;
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%) translateZ(0);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 15;
}

/* 响应式布局优化 */
@media (max-width: 768px) {
    #custom-photos-container .relative {
        max-width: 100vw;
        max-height: 100vh;
        padding: 0.5rem;
    }

    #custom-photos-container img {
        max-height: 85vh;
        max-width: 95vw;
    }

    #custom-photos-container button {
        width: 2.5rem !important;
        height: 2.5rem !important;
        font-size: 14px;
    }

    #custom-photos-container .absolute.top-4 {
        top: 0.5rem !important;
        right: 0.5rem !important;
        gap: 0.5rem;
    }

    #custom-photos-container .absolute.bottom-4 {
        bottom: 0.5rem !important;
    }

    #photos-counter {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

@media (max-width: 480px) {
    #custom-photos-container .relative {
        padding: 0.25rem;
    }

    #custom-photos-container img {
        max-height: 80vh;
        max-width: 98vw;
    }

    #custom-photos-container button {
        width: 2rem !important;
        height: 2rem !important;
        font-size: 12px;
    }

    #custom-photos-container .absolute.top-4 {
        top: 0.25rem !important;
        right: 0.25rem !important;
    }

    #photos-counter {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }
}

/* 加载动画 */
#custom-photos-container img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#custom-photos-container img.loaded {
    opacity: 1;
}

/* 图片加载状态 */
#custom-photos-container .loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    z-index: 5;
}

/* 错误状态 */
#custom-photos-container .error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ef4444;
    text-align: center;
    z-index: 5;
}

#custom-photos-container .error i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

/* 下载进度指示器 */
#custom-photos-container .download-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    z-index: 30;
    display: none;
}

#custom-photos-container .download-progress.show {
    display: block;
}

/* 工具栏动画 */
#custom-photos-container .absolute.top-4 {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 导航按钮动画 */
#custom-photos-container .absolute.left-4,
#custom-photos-container .absolute.right-4 {
    top: 50% !important;
    transform: translateY(-50%) !important;
    height: 3rem !important;
    min-height: 3rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {

    #custom-photos-container .absolute.left-4,
    #custom-photos-container .absolute.right-4 {
        height: 2.5rem !important;
        min-height: 2.5rem !important;
    }
}

@media (max-width: 480px) {

    #custom-photos-container .absolute.left-4,
    #custom-photos-container .absolute.right-4 {
        height: 2rem !important;
        min-height: 2rem !important;
    }
}

/* 计数器动画 */
#photos-counter {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    #custom-photos-container button {
        min-width: 44px;
        min-height: 44px;
    }

    #custom-photos-container .absolute.top-4 {
        top: 20px !important;
        right: 20px !important;
    }

    #custom-photos-container .absolute.bottom-4 {
        bottom: 20px !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    #custom-photos-container button {
        border: 2px solid white;
        background-color: rgba(0, 0, 0, 0.8) !important;
    }

    #photos-counter {
        border: 2px solid white;
        background-color: rgba(0, 0, 0, 0.8) !important;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {

    #custom-photos-container,
    #custom-photos-container img,
    #custom-photos-container button,
    #custom-photos-container .absolute.top-4,
    #custom-photos-container .absolute.left-4,
    #custom-photos-container .absolute.right-4,
    #photos-counter {
        animation: none;
        transition: none;
    }

    #custom-photos-container img:hover {
        transform: none;
    }

    #custom-photos-container button:hover {
        transform: none;
    }
}

/* 自定义图片预览专用按钮布局，彻底避免tailwind定位类冲突 */
.custom-photos-toolbar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.75rem;
    z-index: 20;
    align-items: center;
    justify-content: flex-end;
    min-width: unset !important;
    width: auto !important;
    height: auto !important;
}

.custom-photos-toolbar button {
    position: relative;
    margin: 0;
    flex: 0 0 auto;
}

.custom-photos-nav-left,
.custom-photos-nav-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-photos-nav-left {
    left: 1rem;
}

.custom-photos-nav-right {
    right: 1rem;
}

@media (max-width: 768px) {
    .custom-photos-toolbar {
        top: 0.5rem;
        right: 0.5rem;
        gap: 0.5rem;
    }

    .custom-photos-nav-left {
        left: 0.5rem;
    }

    .custom-photos-nav-right {
        right: 0.5rem;
    }
}

@media (max-width: 480px) {
    .custom-photos-toolbar {
        top: 0.25rem;
        right: 0.25rem;
        gap: 0.25rem;
    }

    .custom-photos-nav-left {
        left: 0.25rem;
    }

    .custom-photos-nav-right {
        right: 0.25rem;
    }
}

/* 防止苹果手机Safari浏览器点击输入框时自动放大 */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select {
    font-size: 16px !important;
}

/* 隐藏滚动条但保持滚动功能 */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;  /* Chrome, Safari and Opera */
}

/* 滑块样式 */
.slider-container {
    padding: 10px 0;
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.slider:hover {
    opacity: 1;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    transition: background 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    background: #2563eb;
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.slider::-moz-range-thumb:hover {
    background: #2563eb;
}

/* ===== 通用懒加载样式 ===== */

/* lozad.js 懒加载基础样式 */
.lozad {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lozad.loaded {
    opacity: 1;
}

/* 加载占位符样式 */
.loading-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 12px;
    z-index: 1;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 图片加载完成后隐藏占位符 */
.lozad.loaded + .loading-placeholder {
    display: none;
}

/* 错误状态样式 */
.loading-placeholder.error {
    background: #fef2f2;
    color: #dc3545;
    animation: none;
}

/* 懒加载容器样式 */
.lazy-container {
    position: relative;
    display: inline-block;
}

/* 响应式懒加载 */
@media (max-width: 768px) {
    .loading-placeholder {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* 懒加载淡入动画 */
@keyframes lazyFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lozad.loaded {
    animation: lazyFadeIn 0.4s ease-out;
}

/* ===== FAQ折叠面板样式 ===== */
.faq-item.active .faq-content {
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
}

.faq-icon {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-item button {
    transition: color 0.2s ease;
}

.faq-item button:hover {
    color: #2563eb;
}

.faq-item.active button {
    color: #2563eb;
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s ease-out;
}

 /* 手机端通知弹框位置优化 */
 @media (max-width: 768px) {
    #notification-dropdown {
        position: fixed !important;
        top: 70px !important;
        right: 16px !important;
        left: 16px !important;
        width: auto !important;
        max-width: calc(100vw - 32px) !important;
        transform: none !important;
    }
}

@media (max-width: 480px) {
    #notification-dropdown {
        right: 12px !important;
        left: 12px !important;
        max-width: calc(100vw - 24px) !important;
    }
}

/* ========================================
   加载动效 - 基于iconfont SVG
   ======================================== */

/* 旋转加载动画 */
.loading-spin {
    animation: loading-rotate 1s linear infinite;
}

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

/* 脉冲加载动画 */
.loading-pulse {
    animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

/* 弹跳加载动画 */
.loading-bounce {
    animation: loading-bounce 1s ease-in-out infinite;
}

@keyframes loading-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}