
/* Reset & Base */
body {
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #0f0c29; 
}
::-webkit-scrollbar-thumb {
    background: #302b63; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #00d2ff; 
}

/* Utilities */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Modal Helpers */
.modal-open {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.modal-content-open {
    transform: scale(1) !important;
}

/* 购物车动画与显示逻辑 */
.cart-open {
    transform: translateX(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.cart-closed {
    transform: translateX(100%);
    visibility: hidden; /* 彻底隐藏，防止显示一部分阴影 */
    opacity: 0;
    pointer-events: none;
}

.block-important {
    display: block !important;
}

.flex-important {
    display: flex !important;
}

/* Floating Particles */
.particle {
    position: absolute;
    border-radius: 50%;
    background-color: #22d3ee; 
    pointer-events: none;
    z-index: 0;
}

@keyframes float {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    50% { opacity: 0.8; }
    100% { transform: translateY(-100vh) translateX(20px); opacity: 0; }
}

/* Tech Corners CSS Implementation (HUD style) */
.tech-corner {
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: rgba(6, 182, 212, 0.6); 
    pointer-events: none;
    z-index: 10;
}
.tech-tl { top: 0; left: 0; border-left-width: 1.5px; border-top-width: 1.5px; border-top-left-radius: 2px; }
.tech-tr { top: 0; right: 0; border-right-width: 1.5px; border-top-width: 1.5px; border-top-right-radius: 2px; }
.tech-bl { bottom: 0; left: 0; border-left-width: 1.5px; border-bottom-width: 1.5px; border-bottom-left-radius: 2px; }
.tech-br { bottom: 0; right: 0; border-right-width: 1.5px; border-bottom-width: 1.5px; border-bottom-right-radius: 2px; }

@media (min-width: 768px) {
    .tech-corner { width: 12px; height: 12px; }
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Toast Animation */
.toast-visible {
    opacity: 1 !important;
    transform: translate(-50%, 0) scale(1) !important;
}

/* 添加弹性拖拽效果的CSS */
.elastic-container {
    perspective: 1000px;
    transform-style: preserve-3d;
    cursor: grab;
    will-change: transform;
}

.elastic-container:active {
    cursor: grabbing;
}

.elastic-image {
    transition: transform 0.1s linear; /* 拖动时响应更快 */
    transform-style: preserve-3d;
    will-change: transform;
}

/* Promotion Fade Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(1.1); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fadeIn {
    animation: fadeIn 0.8s ease-out forwards;
}

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

.animate-slideIn {
    animation: slideInRight 0.5s ease-out forwards;
}

/* 桌面AI按钮的悬停效果 */
#desktop-ai-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 210, 255, 0.3);
}

/* 购买按钮的点击反馈 */
button:active {
    transform: scale(0.98);
}

/* 心形图标的过渡效果 */
[data-lucide="heart"] {
    transition: all 0.3s ease;
}

/* --- Hash Link Highlight Animation --- */
@keyframes highlight-pulse-anim {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.7);
        background-color: rgba(0, 210, 255, 0.2);
        transform: scale(1.02);
    }
    50% {
        box-shadow: 0 0 20px 0 rgba(0, 210, 255, 0.4);
        background-color: rgba(0, 210, 255, 0.1);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 210, 255, 0);
        background-color: transparent;
        transform: scale(1);
    }
}

.highlight-pulse {
    animation: highlight-pulse-anim 1.5s ease-out 3; /* Play 3 times */
    border-radius: 8px;
    position: relative;
    z-index: 50;
    transition: all 0.3s ease;
}

/* --- AI CHAT BUBBLES & UI --- */
.chat-container {
    scroll-behavior: smooth;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.chat-ai {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    border-bottom-left-radius: 4px;
    margin-right: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-user {
    background: linear-gradient(135deg, #00d2ff, #3a7bd5);
    color: white;
    border-bottom-right-radius: 4px;
    margin-left: auto;
    text-align: right;
}

.chat-system {
    width: 100%;
    margin: 10px 0;
    text-align: center;
}

.chat-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-top: 5px;
    max-width: 100%;
}

.typing-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #fff;
    animation: typing 1.4s infinite ease-in-out both;
    margin: 0 2px;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Improved Mobile User Header Background */
.has-user-bg {
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Primary Gradient Overlay - Fades to menu background color #1a1642 */
.has-user-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(26, 22, 66, 0) 0%,
        rgba(26, 22, 66, 0.2) 50%,
        rgba(26, 22, 66, 0.8) 85%,
        #1a1642 100%
    );
    z-index: 1;
}

/* Secondary Overlay for Text Contrast */
.has-user-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2); 
    z-index: 1;
    pointer-events: none;
}

/* Ensure content sits on top */
.has-user-bg > * {
    position: relative;
    z-index: 10;
}

/* 平板端优化样式 */
@media (max-width: 1024px) and (min-width: 768px) {
    #desktop-ai-btn {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        display: flex !important;
    }
    #user-info-trigger {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        display: flex !important;
    }
    #user-dropdown {
        right: 0;
    }
    header .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Price Scroll Effect */
.price-display {
    transition: filter 0.2s ease-out, transform 0.2s ease-out;
}

.price-scrolling {
    filter: blur(1px);
    transform: translateY(-2px);
}
