/* 海角社区网站样式 */

/* CSS变量定义 */
:root {
    /* 主色调 */
    --primary-color: #0ea5e9;
    --secondary-color: #0284c7;
    --accent-color: #06b6d4;
    --ocean-color: #0891b2;
    --wave-color: #0e7490;
    
    /* 中性色 */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* 字体 */
    --font-inter: 'Inter', sans-serif;
    --font-noto: 'Noto Sans SC', sans-serif;
    
    /* 过渡 */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-noto);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 移动端菜单样式 */
#mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

#mobile-menu-toggle i {
    transition: var(--transition);
}

#mobile-menu-toggle.active i:before {
    content: '\f00d'; /* Font Awesome times icon */
}

#mobile-menu {
    transition: var(--transition);
}

#mobile-menu.active {
    display: block !important;
}

@media (max-width: 1023px) {
    #mobile-menu-toggle {
        display: flex;
    }
}

/* 动画类 */
.animate-fade-in {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

.animate-slide-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 1s ease forwards 0.2s;
}

.animate-bounce-in {
    opacity: 0;
    transform: scale(0.8);
    animation: bounceIn 1s ease forwards 0.4s;
}

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

.animate-float-delay {
    animation: float 4s ease-in-out infinite 2s;
}

.animate-gradient {
    background-size: 400% 400%;
    animation: gradient 3s ease infinite;
}

/* 动画定义 */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

/* 计数器动画 */
.counter {
    display: inline-block;
}

/* 返回顶部按钮 */
#back-to-top {
    transition: var(--transition);
}

#back-to-top.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .animate-fade-in,
    .animate-slide-up,
    .animate-bounce-in {
        animation-duration: 0.8s;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* 选择文本样式 */
::selection {
    background: var(--primary-color);
    color: var(--white);
}

/* 焦点样式 */
button:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 加载状态 */
.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 1.5s infinite;
}

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

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --gray-600: #000000;
        --gray-700: #000000;
        --gray-800: #000000;
        --gray-900: #000000;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 打印样式 */
@media print {
    .fixed,
    .animate-float,
    .animate-float-delay {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}