/* ============================================
   麻升智能工作室 - 通用组件样式
   卡片、动画、交互元素、导航
   ============================================ */

/* 噪点纹理覆盖层 */
.noise-overlay {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* 💎 质感升级：顶级玻璃拟态 */
.glass-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.4) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 1px 0 0 rgba(255, 255, 255, 0.02);
    transform: translate3d(0, 0, 0);
}

/* 视图区块切换 */
.view-section {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

.view-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 点阵背景覆盖层 */
.dot-grid-sm {
    background-image: radial-gradient(circle at 2px 2px, rgba(6, 182, 212, 0.2) 1px, transparent 0);
    background-size: 32px 32px;
}

.dot-grid-lg {
    background-image: radial-gradient(circle at center, rgba(6, 182, 212, 0.3) 1px, transparent 1px);
    background-size: 40px 40px;
}

.dot-grid-xs {
    background-image: radial-gradient(circle at 1px 1px, white 1px, transparent 1px);
    background-size: 20px 20px;
}

/* 高级科技网格背景 (用于 B 端和大盘) */
.bg-tech-grid {
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, rgba(6, 182, 212, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(6, 182, 212, 0.05) 1px, transparent 1px);
    mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
}

/* 抗锯齿形影效果 */
.glitch-filter {
    filter: drop-shadow(1px 1px 0px #0ff) drop-shadow(-1px -1px 0px #f0f);
}

/* Reveal 阶梯延迟工具类 */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }

/* 静态滚动视差动画 */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 高级渐变文字 */
.text-gradient-cyan {
    background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-pink {
    background: linear-gradient(135deg, #f472b6 0%, #d946ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Mac 风格窗口控制点 */
.mac-dots {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mac-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.mac-dot.red {
    background: #ff5f56;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.mac-dot.yellow {
    background: #ffbd2e;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.mac-dot.green {
    background: #27c93f;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* ============================================
   滚动条美化
   ============================================ */
input[type=range] {
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--b-accent);
    margin-top: -8px;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.6);
    transition: transform 0.2s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #1e293b;
    border-radius: 2px;
}

/* details/summary 重置 */
details > summary {
    list-style: none;
    outline: none;
}

details > summary::-webkit-details-marker {
    display: none;
}

/* 隐藏滚动条 */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ============================================
   导航栏
   ============================================ */
.nav-link {
    position: relative;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: #06b6d4;
    border-radius: 2px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff !important;
    transform: translateY(-2px);
}

.nav-link.active {
    color: #ffffff !important;
    background: rgba(6, 182, 212, 0.15);
    box-shadow: inset 0 0 20px rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.nav-link.active::after {
    width: 60%;
}

/* ============================================
   CS 面板
   ============================================ */
#cs-panel.open {
    display: flex;
    animation: slideUpIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ============================================
   Dify 聊天机器人
   ============================================ */
#dify-chatbot-bubble-button {
    position: fixed !important;
    bottom: 2rem !important;
    right: 2rem !important;
    z-index: 999998 !important;
    background-color: #06b6d4 !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.6) !important;
    animation: dify-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#dify-chatbot-bubble-button:hover {
    transform: scale(1.1) rotate(5deg) !important;
}

#dify-chatbot-bubble-window {
    position: fixed !important;
    bottom: 6rem !important;
    right: 2rem !important;
    z-index: 999999 !important;
    width: 26rem !important;
    height: 45rem !important;
    max-height: 85vh !important;
    border-radius: 1.5rem !important;
    border: 1px solid rgba(6, 182, 212, 0.4) !important;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(6, 182, 212, 0.2) !important;
    background: rgba(2, 6, 23, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

@media (max-width: 640px) {
    #dify-chatbot-bubble-button {
        bottom: 1.5rem !important;
        right: 1.5rem !important;
    }

    #dify-chatbot-bubble-window {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
    }

    #dify-guide-tooltip {
        display: none;
    }
}

/* ============================================
   关键帧动画
   ============================================ */

/* 跑马灯 */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-marquee {
    animation: marquee 50s linear infinite;
    will-change: transform;
}

/* 打字光标 */
.typing-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* 慢速旋转 */
.animate-spin-slow {
    animation: spin 15s linear infinite;
    will-change: transform;
}

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

/* 上滑进入 */
@keyframes slideUpIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 博客卡片入场 */
@keyframes slideUpFadeCard {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card-enter {
    animation: slideUpFadeCard 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

/* AI 消息弹入 */
.msg-enter {
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

/* 音波条 */
@keyframes soundWave {
    0%, 100% { height: 4px; }
    50% { height: 18px; }
}

.sound-wave-bar {
    width: 3px;
    background: #ec4899;
    border-radius: 2px;
    animation: soundWave 1.2s ease-in-out infinite;
}

.sound-wave-bar:nth-child(2) { animation-delay: 0.2s; background: #d946ef; }
.sound-wave-bar:nth-child(3) { animation-delay: 0.4s; background: #ec4899; }
.sound-wave-bar:nth-child(4) { animation-delay: 0.6s; background: #d946ef; }
.sound-wave-bar:nth-child(5) { animation-delay: 0.8s; background: #ec4899; }

/* 浮动 */
@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.animate-floating {
    animation: floating 4s ease-in-out infinite;
    will-change: transform;
}

/* 动画方向与速度覆盖 */
.anim-orb-reverse {
    animation-direction: reverse;
    animation-duration: 20s;
}

/* 扫描器 */
@keyframes scanner {
    0%, 100% { top: 0%; opacity: 0; }
    10%, 90% { opacity: 1; }
    50% { top: 100%; opacity: 1; }
}

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

/* 自动打字 */
@keyframes auto-typing {
    0%, 15% { width: 0; border-right-color: #ec4899; }
    45%, 70% { width: 100%; border-right-color: transparent; }
    100% { width: 0; border-right-color: transparent; }
}

.animate-auto-typing {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    animation: auto-typing 4s steps(20, end) infinite;
    border-right: 2px solid #ec4899;
}

/* 消息序列动画 */
@keyframes slideUpMsg1 {
    0%, 100% { opacity: 0; transform: translateY(10px); }
    10%, 90% { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpMsg2 {
    0%, 25%, 100% { opacity: 0; transform: translateY(10px); }
    35%, 90% { opacity: 1; transform: translateY(0); }
}

.anim-msg-1 { animation: slideUpMsg1 4s ease-out infinite; }
.anim-msg-2 { animation: slideUpMsg2 4s ease-out infinite; }

@keyframes slideDownReview {
    0%, 100% { opacity: 0; transform: translateY(-5px); }
    10%, 40% { opacity: 1; transform: translateY(0); }
    50%, 90% { opacity: 0; transform: translateY(-5px); }
}

@keyframes popCoupon {
    0%, 45%, 100% { opacity: 0; transform: scale(0.95); }
    55%, 90% { opacity: 1; transform: scale(1); }
}

.anim-review { animation: slideDownReview 4s ease-in-out infinite; }
.anim-coupon { animation: popCoupon 4s ease-in-out infinite; }

/* 生态脉冲与流光线 */
@keyframes dashLine {
    to { stroke-dashoffset: -20; }
}

.animate-dash-line {
    stroke-dasharray: 4;
    animation: dashLine 1s linear infinite;
}

@keyframes orbitRotate {
    from { transform: rotate(0deg) translateX(120px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(120px) rotate(-360deg); }
}

.animate-orbit { animation: orbitRotate 20s linear infinite; }

@keyframes orbitRotateSlow {
    from { transform: rotate(180deg) translateX(180px) rotate(-180deg); }
    to { transform: rotate(540deg) translateX(180px) rotate(-540deg); }
}

.animate-orbit-slow { animation: orbitRotateSlow 30s linear infinite; }

/* 数据流线 */
@keyframes flowData {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

.data-flow-line {
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.8), transparent);
    background-size: 200% 100%;
    animation: flowData 2.5s infinite linear;
}

/* Dify 脉冲 */
@keyframes dify-pulse {
    0% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(6, 182, 212, 0); }
    100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

/* ============================================
   博客阅读器正文排版
   ============================================ */
.article-content h3 {
    color: #f8fafc;
    font-size: 1.4rem;
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-content h3::before {
    content: "";
    display: block;
    width: 4px;
    height: 1.2em;
    background: #06b6d4;
    border-radius: 2px;
}

.article-content p {
    margin-bottom: 1.75rem;
    line-height: 1.85;
    color: #94a3b8;
    font-size: 1rem;
    font-weight: 400;
}

.article-content strong {
    color: #f8fafc;
    font-weight: 700;
    background: rgba(6, 182, 212, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.article-content ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 2rem;
    color: #94a3b8;
}

.article-content li {
    margin-bottom: 1rem;
    line-height: 1.7;
    position: relative;
    padding-left: 1.75rem;
}

.article-content li::before {
    content: "❖";
    position: absolute;
    left: 0;
    color: #06b6d4;
    font-size: 0.7rem;
    top: 3px;
    opacity: 0.7;
}

.article-content blockquote {
    border-left: 4px solid #ec4899;
    font-style: italic;
    color: #e2e8f0;
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.08) 0%, transparent 100%);
    padding: 1.5rem;
    border-radius: 0 0.75rem 0.75rem 0;
    margin-bottom: 2.5rem;
    font-size: 1.05rem;
}

.article-content code {
    background: #0f172a;
    padding: 3px 8px;
    border-radius: 6px;
    color: #f472b6;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid #1e293b;
    font-size: 0.85em;
}
