/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #c41e3a;
    --secondary-red: #ff4d4d;
    --gold: #ffd700;
    --light-gold: #fff5e6;
    --dark-red: #8b0000;
}

body {
    font-family: "Microsoft YaHei", "SimSun", sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #fff5f5 0%, #fff8e7 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.loaded {
    opacity: 1;
}

/* 导航栏样式 */
header {
    background: linear-gradient(to right, var(--dark-red), var(--primary-red));
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.main-nav {
    flex: 1;
    justify-content: center;
}

.user-nav {
    margin-left: 2rem;
}

nav a {
    color: var(--light-gold);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

nav a:hover {
    background-color: var(--secondary-red);
    color: var(--gold);
    transform: translateY(-2px);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--gold);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::after {
    width: 80%;
}

.login-btn {
    background-color: var(--gold);
    color: var(--primary-red);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: bold;
    border: 2px solid var(--gold);
    transition: all 0.3s ease;
}

.login-btn:hover {
    background-color: transparent;
    color: var(--gold);
    transform: translateY(-2px);
}

.login-btn::after {
    display: none;
}

.login-btn.active {
    background-color: transparent;
    color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 主要内容样式 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    opacity: 1;
    transition: all 0.3s ease;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--primary-red);
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: fadeInDown 1s ease;
}

.hero img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.hero img:hover {
    transform: scale(1.02);
}

/* 传统文化卡片样式 */
.traditions, .decorations, .customs, .traditional-foods, .snacks, .greeting-cards, .blessing-words {
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
}

h2 {
    text-align: center;
    color: var(--primary-red);
    margin-bottom: 2rem;
    font-size: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-red), var(--gold));
}

.tradition-cards, .decoration-items, .custom-grid, .food-grid, .snack-grid, .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.card, .item, .custom-item, .food-item, .snack-item, .greeting-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card:hover, .item:hover, .custom-item:hover, .food-item:hover, .snack-item:hover, .greeting-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card img, .item img, .custom-item img, .food-item img, .snack-item img, .greeting-card img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.card:hover img, .item:hover img, .custom-item:hover img, .food-item:hover img, .snack-item:hover img, .greeting-card:hover img {
    transform: scale(1.05);
}

h3 {
    color: var(--primary-red);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

p {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

/* 特殊效果 */
.taboo-item, .blessing-item {
    background: linear-gradient(135deg, #fff 0%, var(--light-gold) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.taboo-content ul, .blessing-content ul {
    list-style: none;
    padding: 1rem;
}

.taboo-content li, .blessing-content li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.taboo-content li::before, .blessing-content li::before {
    content: '•';
    color: var(--primary-red);
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

/* 祝福弹窗样式 */
.greeting-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}

.greeting-modal.show {
    opacity: 1;
    visibility: visible;
}

.greeting-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    max-width: 90%;
    width: 400px;
    position: relative;
    border: 2px solid var(--gold);
}

.greeting-modal.show .greeting-content {
    transform: scale(1);
}

.close-greeting {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    margin-top: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.close-greeting:hover {
    background: var(--secondary-red);
}

/* 页脚样式 */
footer {
    background: linear-gradient(to right, var(--dark-red), var(--primary-red));
    color: var(--light-gold);
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

/* 动画关键帧 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .user-nav {
        margin-left: 0;
        margin-top: 1rem;
    }

    nav a {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .login-btn {
        width: auto;
        min-width: 120px;
    }

    .tradition-cards, .decoration-items, .custom-grid, .food-grid, .snack-grid, .card-grid {
        grid-template-columns: 1fr;
    }

    main {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.8rem;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
        color: #fff;
    }

    .card, .item, .custom-item, .food-item, .snack-item, .greeting-card {
        background: #2a2a2a;
        color: #fff;
    }

    p {
        color: #ccc;
    }

    .taboo-item, .blessing-item {
        background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
        border-color: rgba(255, 215, 0, 0.1);
    }
} 