/* ===== 现代化增强样式 ===== */

/* 玻璃拟态效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* 渐变文字效果 */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 浮动动画 */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

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

/* 脉冲效果 */
.pulse {
    animation: pulse 2s infinite;
}

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

/* 卡片悬停增强 */
.url-card .url-body {
    position: relative;
    overflow: hidden;
}

.url-card .url-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.url-card .url-body:hover::before {
    left: 100%;
}

/* 搜索框增强 */
#search {
    position: relative;
}

#search::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

#search:focus-within::after {
    width: 100%;
}

/* 导航菜单增强 */
.navbar-nav > li > a {
    position: relative;
    overflow: hidden;
}

.navbar-nav > li > a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav > li > a:hover::before {
    width: 100%;
}

/* 侧边栏增强 */
.sidebar-menu-inner a {
    position: relative;
    overflow: hidden;
}

.sidebar-menu-inner a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.sidebar-menu-inner a:hover::before {
    left: 100%;
}

/* 按钮增强 */
.btn {
    position: relative;
    overflow: hidden;
}

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

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* 图片悬停效果 */
.url-card .url-img {
    position: relative;
    overflow: hidden;
}

.url-card .url-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.url-card .url-body:hover .url-img::after {
    transform: translateX(100%);
}

/* 分类标题增强 */
.text-gray.text-lg {
    position: relative;
    overflow: hidden;
}

.text-gray.text-lg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.text-gray.text-lg:hover::after {
    transform: scaleX(1);
}

/* 公告栏增强 */
.bulletin-big .card {
    position: relative;
    overflow: hidden;
}

/* 热门词汇增强 */
.header-big .word .wordsub {
    position: relative;
    overflow: hidden;
}

.header-big .word .wordsub::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.header-big .word .wordsub:hover::before {
    left: 100%;
}

/* 页面加载动画 */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.page-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 滚动指示器 */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary-gradient);
    z-index: 9998;
    transition: width 0.1s ease;
}

/* 卡片网格动画 */
.url-card {
    animation: cardAppear 0.6s ease-out;
    animation-fill-mode: both;
}

.url-card:nth-child(1) { animation-delay: 0.1s; }
.url-card:nth-child(2) { animation-delay: 0.2s; }
.url-card:nth-child(3) { animation-delay: 0.3s; }
.url-card:nth-child(4) { animation-delay: 0.4s; }
.url-card:nth-child(5) { animation-delay: 0.5s; }
.url-card:nth-child(6) { animation-delay: 0.6s; }

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

/* 深色模式增强 */
.io-black-mode .glass-effect {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.io-black-mode .url-card .url-body::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.io-black-mode .navbar-nav > li > a::before {
    background: var(--primary-gradient);
}

.io-black-mode .sidebar-menu-inner a::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* 响应式增强 */
@media (max-width: 768px) {
    .url-card {
        animation-delay: 0.1s !important;
    }
    
    .float-animation {
        animation: none;
    }
    
    .pulse {
        animation: none;
    }
}

/* 性能优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000000;
        --gray-600: #000000;
        --gray-700: #000000;
    }
    
    .url-card .url-body {
        border: 2px solid #000000;
    }
    
    .btn {
        border: 2px solid #000000;
    }
}

/* 打印样式 */
@media print {
    .url-card .url-body:hover {
        transform: none;
        box-shadow: none;
    }
    
    .sidebar-nav,
    .page-header,
    #footer-tools {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* 搜索建议样式 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--gray-100);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

/* 跳过链接样式 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--border-radius);
    z-index: 10000;
    transition: var(--transition);
}

.skip-link:focus {
    top: 6px;
}

/* 焦点样式 */
.focused {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 增强工具提示 */
.enhanced-tooltip {
    position: absolute;
    background: var(--gray-900);
    color: white;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    z-index: 10000;
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--transition);
    pointer-events: none;
    max-width: 200px;
    word-wrap: break-word;
}

.enhanced-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.enhanced-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--gray-900);
}

/* 移动端侧边栏 */
@media (max-width: 768px) {
    body.sidebar-open .sidebar-nav {
        transform: translateX(0);
    }
    
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1080;
    }
}

/* 加载状态样式 */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 活跃状态样式 */
.active {
    background: var(--primary-gradient) !important;
    color: white !important;
}

/* 错误状态样式 */
.error {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2) !important;
}

/* 成功状态样式 */
.success {
    border-color: var(--success-color) !important;
    box-shadow: 0 0 0 2px rgba(67, 233, 123, 0.2) !important;
}

/* 警告状态样式 */
.warning {
    border-color: var(--warning-color) !important;
    box-shadow: 0 0 0 2px rgba(250, 112, 154, 0.2) !important;
}

/* 背景切换按钮样式 */
.switch-background {
    background: var(--primary-gradient) !important;
    color: white !important;
    border: none !important;
    transition: var(--transition);
}

.switch-background:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.background-ico {
    font-size: 1.1rem;
    transition: var(--transition);
}

.switch-background:hover .background-ico {
    transform: rotate(15deg);
}

/* 深色模式下的背景切换按钮 */
.io-black-mode .switch-background {
    background: var(--primary-gradient) !important;
    color: white !important;
}

/* 背景切换动画 - 移除全局body过渡以避免冲突 */
/* body {
    transition: background 0.5s ease, background-color 0.5s ease;
} */

/* 背景切换时的内容过渡 */
.content-site {
    transition: opacity 0.3s ease;
}

body.background-transitioning .content-site {
    opacity: 0.8;
} 