/* ============================================
   网站设计升级 - 全局样式
   适用：社团服务区 / 标准化知识区 / 修行网站
   版本：v1.0
   ============================================ */

/* ---------- 动画定义 ---------- */
@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

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

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

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

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(5, 150, 105, 0.3); }
    50% { box-shadow: 0 0 40px rgba(5, 150, 105, 0.6); }
}

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

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---------- 动画类 ---------- */
.animate-breathe { animation: breathe 4s ease-in-out infinite; }
.animate-float { animation: float 5s ease-in-out infinite; }
.animate-fade-in-up { animation: fadeInUp 0.8s ease-out forwards; }
.animate-fade-in { animation: fadeIn 0.6s ease-out forwards; }
.animate-fade-in-left { animation: fadeInLeft 0.8s ease-out forwards; }
.animate-fade-in-right { animation: fadeInRight 0.8s ease-out forwards; }
.animate-gradient { background-size: 200% 200%; animation: gradientShift 8s ease infinite; }
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}
.animate-rotate-slow { animation: rotate-slow 20s linear infinite; }

.animate-delay-100 { animation-delay: 100ms; }
.animate-delay-200 { animation-delay: 200ms; }
.animate-delay-300 { animation-delay: 300ms; }
.animate-delay-400 { animation-delay: 400ms; }
.animate-delay-500 { animation-delay: 500ms; }
.animate-delay-600 { animation-delay: 600ms; }

/* ---------- 玻璃态设计 ---------- */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
}

.glass-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}
.glass-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* ---------- 阴影系统 ---------- */
.shadow-soft { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.shadow-card { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.shadow-hover { box-shadow: 0 12px 24px rgba(0,0,0,0.12); }
.shadow-float { box-shadow: 0 20px 40px rgba(0,0,0,0.15); }

/* 彩色阴影 */
.shadow-green { box-shadow: 0 10px 30px rgba(5, 150, 105, 0.25); }
.shadow-blue { box-shadow: 0 10px 30px rgba(59, 130, 246, 0.25); }
.shadow-gold { box-shadow: 0 10px 30px rgba(196, 167, 125, 0.25); }
.shadow-purple { box-shadow: 0 10px 30px rgba(139, 92, 246, 0.25); }

/* 多层阴影 */
.shadow-layers {
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.05),
        0 8px 16px rgba(0,0,0,0.08),
        0 16px 32px rgba(0,0,0,0.1);
}

/* ---------- 交互效果 ---------- */
.card-interactive {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-interactive:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.img-zoom {
    overflow: hidden;
}
.img-zoom img {
    transition: transform 0.6s ease;
}
.img-zoom:hover img {
    transform: scale(1.1);
}

.link-underline {
    position: relative;
}
.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}
.link-underline:hover::after {
    width: 100%;
}

/* ---------- 按钮样式 ---------- */
.btn-shine {
    position: relative;
    overflow: hidden;
}
.btn-shine::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}
.btn-shine:hover::after {
    transform: translateX(100%);
}

.btn-scale {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.btn-scale:hover {
    transform: scale(1.05);
}

/* ---------- 渐变背景 ---------- */
.bg-gradient-hero-green {
    background: linear-gradient(135deg, #059669 0%, #10B981 50%, #34D399 100%);
}

.bg-gradient-hero-blue {
    background: linear-gradient(135deg, #1D4ED8 0%, #3B82F6 50%, #60A5FA 100%);
}

.bg-gradient-hero-zen {
    background: linear-gradient(135deg, #8B7355 0%, #C4A77D 50%, #E8D5B5 100%);
}

/* 动态渐变背景 */
.bg-animated-gradient {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* ---------- 滚动触发动画 ---------- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ---------- 装饰元素 ---------- */
.decorative-circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.decorative-circle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.2;
    animation: breathe 4s ease-in-out infinite;
}

.decorative-square {
    position: absolute;
    pointer-events: none;
}

.decorative-square::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid currentColor;
    opacity: 0.2;
    transform: rotate(45deg);
}

/* ---------- 文字渐变 ---------- */
.text-gradient-green {
    background: linear-gradient(135deg, #059669, #10B981, #34D399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-blue {
    background: linear-gradient(135deg, #1D4ED8, #3B82F6, #60A5FA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-gold {
    background: linear-gradient(135deg, #8B7355, #C4A77D, #E8D5B5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- 滚动条美化 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

/* Firefox滚动条 */
* { scrollbar-width: thin; scrollbar-color: #c1c1c1 #f1f1f1; }

/* ---------- 响应式工具 ---------- */
@media (max-width: 768px) {
    .animate-float { animation-duration: 3s; }
    .animate-breathe { animation-duration: 3s; }
}

/* ---------- 加载状态 ---------- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-dark {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ---------- 焦点状态（无障碍） ---------- */
:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

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