/* 全局样式 - 投稿客 */

/* 基础样式 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 滚动行为 */
html { 
    scroll-behavior: smooth; 
}

/* 焦点样式 - WCAG 2.1 AA compliant */
:focus-visible { 
    outline: 3px solid #4f46e5; 
    outline-offset: 2px; 
    border-radius: 4px;
}

/* 确保所有交互元素有可见的焦点状态 */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #4f46e5;
    outline-offset: 2px;
}

/* 触摸目标最小 44x44px - WCAG 2.1 */
button,
a,
input[type="checkbox"],
input[type="radio"],
.nav-link {
    min-height: 44px;
    min-width: 44px;
}

/* 小型按钮保持最小触摸目标 */
.btn-sm,
.icon-btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 渐变文字 */
.gradient-text {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 移动端菜单动画 */
.mobile-menu-enter {
    animation: slideDown 0.3s ease-out;
}

.mobile-menu-exit {
    animation: slideUp 0.2s ease-in;
}

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

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

/* 滚动渐显动画 */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* 浮动动画 */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}
.float-anim {
    animation: float 3s ease-in-out infinite;
}
.float-anim-delay {
    animation: float 3s ease-in-out infinite 1s;
}
.float-anim-delay-2 {
    animation: float 3s ease-in-out infinite 2s;
}

/* 脉冲动画 */
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}
.pulse-ring {
    animation: pulse-ring 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 加载骨架屏 */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}
.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
}
.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 1000px 100%;
}

/* 导航栏滚动效果 */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.dark .nav-scrolled {
    background: rgba(17, 24, 39, 0.95) !important;
}

/* 隐藏滚动条但保留功能 */
.hide-scrollbar::-webkit-scrollbar { 
    display: none; 
}
.hide-scrollbar { 
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}

/* Toast 动画 */
@keyframes slideInRight {
    from {
        transform: translateX(100%) translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%) translateY(10px);
        opacity: 0;
    }
}

/* 页面加载进度条 */
.page-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* 按钮点击效果 */
.btn-active:active {
    transform: scale(0.98);
}

/* 图片懒加载占位 */
.img-placeholder {
    background: linear-gradient(110deg, #f0f0f0 8%, #f8f8f8 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}
.dark .img-placeholder {
    background: linear-gradient(110deg, #374151 8%, #4b5563 18%, #374151 33%);
}

/* 链接下划线动画 */
.link-underline {
    position: relative;
}
.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.3s ease;
}
.link-underline:hover::after {
    width: 100%;
}

/* 选中文字样式 */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: inherit;
}

/* 响应式字体 */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
}
