/* 基础样式和动画效果 */
:root {
    --transition-duration: 0.3s;
    --hover-transform: translateY(-2px);
}

html {
    scroll-behavior: smooth; /* 添加平滑滚动效果 */
    scroll-padding-top: 80px; /* 为固定导航栏留出空间 */
}

body {
    overflow-x: hidden;
    cursor: none; /* 隐藏默认光标 */
}

/* 字符跳跃动画效果 */
.jumping-char {
    display: inline-block;
    animation: jump 2s ease-in-out infinite;
    animation-delay: calc(0.15s * var(--i));
}

@keyframes jump {
    0%, 40%, 100% {
        transform: translateY(0);
    }
    20% {
        transform: translateY(-6px);
    }
}

/* 保持所有交互元素的光标设置 */
a, button, .menu-item, .category-btn, .menu-icon {
    cursor: none;
}

/* 菜单分类按钮样式 */
.category-btn {
    position: relative;
    padding: 0.5rem 0.75rem;
    transition: color var(--transition-duration);
}

.category-btn::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #8D7B68;
    transform: translateX(-50%);
    transition: width var(--transition-duration);
}

.category-btn:hover::after,
.category-btn.active::after {
    width: 60%;
}

.category-btn.active {
    color: #4D3C2E;
    font-weight: 500;
}

/* 菜单项样式和动画 */
.menu-item {
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    transition: all var(--transition-duration);
    position: relative;
}

.menu-item:hover {
    background-color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transform: var(--hover-transform);
}

/* 菜单标题动画 */
.menu-title {
    position: relative;
    display: inline-block;
    transition: color var(--transition-duration);
    font-weight: 600; /* Make product names bold */
}

.menu-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: width var(--transition-duration) ease;
}

.menu-item:hover .menu-title {
    color: #4D3C2E;
}

.menu-item:hover .menu-title::after {
    width: 100%;
}

/* 推荐标签样式 */
.tag {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    background-color: #E8D9C5;
    color: #4D3C2E;
    margin-left: 0.5rem;
    vertical-align: middle;
    font-weight: 500;
    transition: transform 0.3s ease;
}

.tag.barista-pick {
    background-color: #8D7B68;
    color: white;
}

.tag.testing {
    background-color: #FFD166;
    color: #4D3C2E;
    border: 1px dashed #4D3C2E;
    position: relative;
    overflow: hidden;
}

.tag.testing:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 209, 102, 0.5),
        rgba(255, 209, 102, 0.5) 5px,
        rgba(255, 209, 102, 0.8) 5px,
        rgba(255, 209, 102, 0.8) 10px
    );
    z-index: -1;
}

/* 标签悬停弹跳效果 */
.menu-item:hover .tag {
    animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-5px);
    }
}

/* 价格动画 */
.price {
    display: inline-block;
    position: relative;
    transition: transform var(--transition-duration), color var(--transition-duration);
}

.menu-item:hover .price {
    transform: translateX(4px);
    color: #8D7B68;
}

/* 添加价格标签微动效 */
.price:hover {
    color: #4D3C2E;
}

.price:hover:after {
    content: "（友情价）";
    position: absolute;
    right: -4em;
    top: -1.5em;
    font-size: 0.8em;
    color: #8D7B68;
    animation: waveJump 1.2s ease-in-out infinite;
    transform-origin: bottom center;
    text-shadow: 0 0 5px rgba(200, 182, 166, 0.5);
}

@keyframes waveJump {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    10% {
        transform: translateY(-2px) rotate(-2deg);
    }
    20% {
        transform: translateY(-4px) rotate(0deg);
    }
    30% {
        transform: translateY(-2px) rotate(2deg);
    }
    40% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-1px) rotate(-1deg);
    }
    60% {
        transform: translateY(-2px) rotate(0deg);
    }
    70% {
        transform: translateY(-1px) rotate(1deg);
    }
    80% {
        transform: translateY(0) rotate(0deg);
    }
}

/* 菜单描述动画 */
.menu-description {
    transition: color var(--transition-duration), opacity 0.3s ease;
    max-width: 90%;
}

.menu-item:hover .menu-description {
    color: #6d6d6d;
    opacity: 0.8;
}

/* 鼠标指针特效 */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background-color: #4D3C2E;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
}

.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(77, 60, 46, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, width 0.3s, height 0.3s, border-color 0.3s;
}

body:hover .cursor-dot,
body:hover .cursor-outline {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .menu-categories {
        overflow-x: auto;
        justify-content: flex-start;
        white-space: nowrap;
        padding-bottom: 1rem;
        scrollbar-width: none; /* 火狐浏览器 */
    }
    
    .menu-categories::-webkit-scrollbar {
        display: none; /* 其他浏览器 */
    }
    
    .category-btn {
        display: inline-block;
    }
    
    .menu-item:hover {
        transform: none;
    }
    
    .cursor-dot, .cursor-outline {
        display: none;
    }

    /* 导航栏在小屏幕上的响应式布局 */
    nav .container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    nav .animate-pulse {
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
        order: 3;
    }
}

/* 可点击的段落标题链接样式 */
.section-link {
    position: relative;
    color: inherit;
    text-decoration: none;
    cursor: none;
    display: inline-block;
    padding-right: 1.5rem;
}

.section-link::after {
    content: '#';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    opacity: 0;
    color: #8D7B68;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.section-link:hover {
    color: #4D3C2E;
}

.section-link:hover::after {
    opacity: 1;
    transform: translate(-0.2rem, -50%);
}

/* 在大屏幕上增强区域标题可见性 */
@media (min-width: 769px) {
    section {
        padding-top: 2rem;
        margin-top: 2rem;
        border-top: 1px solid rgba(200, 182, 166, 0.3);
    }
    
    section:first-of-type {
        border-top: none;
        margin-top: 0;
    }
    
    section h2 {
        padding-bottom: 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .section-link {
        transition: all 0.3s ease;
    }
    
    .category-btn.active + section .section-link,
    .section-link:target {
        color: #4D3C2E;
        font-weight: 700;
    }
}

/* 缺货商品样式 */
.out-of-stock .menu-title,
.out-of-stock .menu-description,
.out-of-stock .price {
    text-decoration: line-through;
    opacity: 0.5;
    color: #a0a0a0;
}

.out-of-stock:after {
    content: "缺货中";
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: rgba(180, 180, 180, 0.8);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    transform: rotate(5deg);
}

/* 侧边菜单样式 */
.side-menu {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem;
    border-radius: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
}

.side-menu.visible {
    opacity: 1;
    visibility: visible;
}

.side-menu-btn {
    position: relative;
    display: flex;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
    background-color: transparent;
    cursor: none;
}

.side-menu-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: #C8B6A6;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.side-menu-btn.active .side-menu-dot {
    background-color: #4D3C2E;
    width: 10px;
    height: 10px;
}

.side-menu-label {
    position: absolute;
    right: 48px;
    white-space: nowrap;
    background-color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #4D3C2E;
    font-weight: 500;
}

.side-menu-btn:hover .side-menu-label {
    opacity: 1;
    transform: translateX(0);
}

.side-menu-btn:hover {
    background-color: rgba(200, 182, 166, 0.2);
}

.side-menu-btn.active {
    background-color: rgba(200, 182, 166, 0.4);
}

@media (max-width: 1024px) {
    .side-menu {
        display: none !important;
    }
} 