* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans', "Microsoft JhengHei", sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 0;
}

/* 主題週廣告條：固定於視窗最頂（頁眉之上） */
.theme-strip-ad {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
    background: #f0f0f0;
    margin: 0;
    padding: 0;
}

.theme-strip-ad__inner {
    width: 100%;
    margin: 0 auto;
    line-height: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.theme-strip-ad__link {
    display: block;
    width: 100%;
}

/* 右上角卷角：懸停關閉鈕時向左下卷起 */
.theme-strip-ad__peel {
    position: absolute;
    top: 0;
    right: 0;
    width: 88px;
    height: 88px;
    z-index: 2;
    pointer-events: none;
}

.theme-strip-ad__peel-back,
.theme-strip-ad__peel-fold {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    transform-origin: 100% 0%;
    clip-path: polygon(100% 0, 100% 0, 100% 0);
    transition:
        clip-path 0.55s cubic-bezier(0.33, 1, 0.68, 1),
        transform 0.55s cubic-bezier(0.33, 1, 0.68, 1),
        opacity 0.35s ease;
}

.theme-strip-ad__peel-back {
    z-index: 1;
    background: linear-gradient(225deg, #2a2a2a 0%, #4a4a4a 55%, #666 100%);
    opacity: 0;
}

.theme-strip-ad__peel-fold {
    z-index: 2;
    background: linear-gradient(
        225deg,
        #ffffff 0%,
        #f0f0f0 38%,
        #d8d8d8 72%,
        #c4c4c4 100%
    );
    box-shadow: -6px 6px 14px rgba(0, 0, 0, 0.28);
    opacity: 0;
}

.theme-strip-ad--peel .theme-strip-ad__peel-back {
    opacity: 1;
    clip-path: polygon(100% 0, 18% 0, 100% 82%);
    transform: rotate(-5deg);
}

.theme-strip-ad--peel .theme-strip-ad__peel-fold {
    opacity: 1;
    clip-path: polygon(100% 0, 0 0, 100% 100%);
    transform: rotate(-14deg) translate(-10px, 10px);
}

.theme-strip-ad__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 4;
    transition: background-color 0.25s ease;
}

.theme-strip-ad__close:hover {
    background: rgba(0, 0, 0, 0.65);
}

.theme-strip-ad__close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .theme-strip-ad__peel-back,
    .theme-strip-ad__peel-fold {
        transition-duration: 0.01s;
    }

    .theme-strip-ad--peel .theme-strip-ad__peel-fold {
        transform: rotate(-8deg) translate(-4px, 4px);
    }
}

.theme-strip-ad img {
    display: block;
    width: 100%;
    height: var(--theme-strip-height, 90px);
    object-fit: cover;
    object-position: center;
}

body.has-theme-strip {
    --theme-strip-height: 90px;
    /* 為固定頂部廣告條留出空間，避免與下方內容重疊 */
    padding-top: var(--theme-strip-height);
}

body.has-theme-strip .main-header {
    top: var(--theme-strip-height);
}

/* 分類欄/輪播僅保留原有頂距（勿再加 theme-strip 高度，body padding 已處理） */
.main-header {
    background-color: #40B44B;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: 64px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo img {
    height: 32px;
    vertical-align: middle;
    filter: brightness(0) invert(1);
}

.logo-text {
    color: white;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

/* 用户下拉菜单 */
.nav-item.dropdown {
    position: relative;
}

/* 桌面端：給下拉菜單頂部增加可命中的緩衝區，避免移動鼠標時 hover 丟失 */
.nav-item.dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;
}

.nav-link.dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.5em;
    vertical-align: middle;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #40B44B;
    min-width: 200px;
    padding: 0.5rem 0;
    margin-top: 0;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
}

.nav-item.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: background-color 0.3s;
    font-size: 14px;
    text-align: center;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

.dropdown-item i {
    width: 1.25rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.dropdown-divider {
    height: 1px;
    margin: 0.5rem 0;
    background-color: rgba(255, 255, 255, 0.1);
}

/* 分类导航样式 */
.category-nav {
    background-color: #40B44B;
    border-bottom: none;
    margin-top: 64px;
    height: 48px;
    display: flex;
    align-items: center;
}

.category-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

.category-list {
    list-style: none;
    display: flex;
    gap: 32px;
    align-items: center;
    height: 100%;
    margin: 0;
    position: relative;
}

.merchant-center-link {
    margin-left: auto;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 0;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    position: relative;
    transition: color 0.2s ease;
    height: 48px;
    line-height: 48px;
}

.category-item i {
    display: flex;
    align-items: center;
    height: 100%;
    margin-right: 4px;
}

.category-item:hover {
    color: white;
}

.category-item.active {
    color: white;
    font-weight: 600;
}

.category-item.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: white;
    border-radius: 1.5px;
}

/* 分类导航下拉菜单 */
.category-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 48px;
    padding-bottom: 20px;
    margin-bottom: -20px;
}

.category-dropdown .category-item::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 4px;
    font-size: 14px;
}

.category-dropdown-menu {
    position: absolute;
    top: calc(100% - 12px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #40B44B;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-width: 160px;
    padding: 8px 0;
    display: none;
    z-index: 1000;
}

.category-dropdown:hover .category-dropdown-menu {
    display: block;
}

.category-dropdown-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    text-align: center;
}

.category-dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* 轮播海报样式 */
.banner-carousel {
    width: 100%;
    margin-top: 76px; /* Reduced to 76px */
    background-color: #f8f9fa;
    padding: 0;
    overflow: hidden;
}

.carousel-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(1.05);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-content {
    position: absolute;
    bottom: 48px;
    left: 48px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0.2s;
}

.carousel-slide.active .carousel-content {
    opacity: 1;
    transform: translateY(0);
}

.carousel-content h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.carousel-content p {
    font-size: 18px;
    opacity: 0.9;
}

.carousel-pages {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.carousel-page {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.carousel-page.active {
    background-color: #fff;
    color: #333;
    border-color: #fff;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.5);
}

.carousel-arrow.prev {
    left: 16px;
}

.carousel-arrow.next {
    right: 16px;
}

/* 主要内容区样式 */
.main-content {
    flex: 1;
    padding: 48px 0;
    margin-top: 0; /* 移除原来的边距，因为轮播图已经提供了间距 */
    min-height: calc(100vh - 64px - 400px); /* 减去头部和页脚的高度 */
}

.events-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* PC端搜索框按钮样式 */
.search-input button {
    background-color: #40B44B !important; /* 使用程序的主题绿色 */
    color: white !important;
    border: none !important;
}

.search-input button:hover {
    background-color: #35a03e !important; /* hover时使用稍深的绿色 */
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.event-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: block;
    color: inherit;
    width: 100%;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.event-image {
    position: relative;
    padding-top: 56.25%;
    background: #f8f9fa;
}

.event-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-card--expired .event-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1;
    pointer-events: none;
}

.event-expired-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-22deg);
    z-index: 2;
    padding: 0.35rem 1.25rem;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    pointer-events: none;
    border: 2px solid rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
    user-select: none;
}

.event-card--expired:hover {
    transform: none;
}

.event-date {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255,255,255,0.9);
    padding: 8px 12px;
    border-radius: 4px;
    text-align: center;
    line-height: 1.2;
    z-index: 3;
}

.event-date .month {
    display: block;
    font-size: 12px;
    color: #666;
}

.event-date .day {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #28a745;
}

.event-info {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "cat time"
        "title title"
        "location location"
        "price price";
    row-gap: 6px;
}

.event-category {
    grid-area: cat;
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    color: #40B44B;
    background: rgba(64, 180, 75, 0.08);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 0;
    width: auto;
    justify-self: flex-start;
}

.event-title {
    grid-area: title;
    font-size: 16px;
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 0;
    line-height: 1.4;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* PC端活动卡片：确保活动名称和活动时间之间的间距 */
.event-card .event-info .event-title {
    margin-bottom: 0;
}

.event-details {
    font-size: 13px;
    color: #666;
    margin-bottom: 0;
    display: contents;
}

/* 第一行右侧：开始时间 */
.event-details span:first-child {
    grid-area: time;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-self: flex-end;
    text-align: right;
}

/* 第三行左侧：地址 */
.event-details span:last-child {
    grid-area: location;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-self: flex-start;
    text-align: left;
}

.event-details i {
    margin-right: 0;
    width: 14px;
    color: #40B44B; /* 绿色图标 */
}

/* PC端：地址过长时省略号显示（仅影响PC端基础样式，移动端在后面的媒体查询中重新布局） */
.events-grid .event-card .event-info .event-details span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-width: 0;
}

/* PC端和移动端：去掉开始时间前面的图标，仅保留地点图标 */
.event-details span:first-child i {
    display: none;
}

.event-price {
    grid-area: price;
    font-size: 15px;
    color: #40B44B;
    font-weight: 600;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    justify-self: stretch;
    width: 100%;
    text-align: right;
}

/* 页脚样式 */
.main-footer {
    background-color: #40B44B;
    color: #fff;
    padding: 40px 0 20px;
    width: 100%;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-section h3 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-social {
    display: flex;
    gap: 16px;
    align-items: center;
}

.footer-social a {
    color: white;
    font-size: 20px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-social a:hover {
    opacity: 1;
}

.footer-apps {
    display: flex;
    gap: 12px;
}

.app-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 16px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.app-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.app-button i {
    font-size: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* 活动详情页样式 */
.event-detail-content {
    padding-top: 76px;
    padding-bottom: 48px;
}

.event-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.event-detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

.event-main-info {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.event-main-info .event-title {
    font-size: 24px;
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 16px;
}

.organizer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
    margin-bottom: 24px;
}

.organizer-info i {
    color: #40B44B;
}

.event-gallery {
    margin-bottom: 32px;
}

.event-main-image {
    width: 100%;
    border-radius: 8px;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.event-description h2,
.event-info h2 {
    font-size: 18px;
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 16px;
}

.rich-text {
    font-size: 15px;
    line-height: 1.6;
    color: #4a4a4a;
}

.rich-text p {
    margin-bottom: 16px;
}

.rich-text p:last-child {
    margin-bottom: 0;
}

.info-list {
    margin-top: 24px;
}

.info-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item i {
    color: #40B44B;
    font-size: 20px;
    width: 20px;
    text-align: center;
}

.info-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 8px;
}

.info-content p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* 票务信息侧边栏 */
.event-sidebar {
    position: sticky;
    top: 76px;
}

.ticket-box {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 24px;
}

.ticket-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 4px;
}

.ticket-header .price {
    font-size: 20px;
    color: #40B44B;
    font-weight: 600;
    margin-bottom: 16px;
}

.ticket-type {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
    background: #f8f9fa;
}

.ticket-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.ticket-type-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #2d2d2d;
}

.ticket-type-header .price {
    font-size: 15px;
    color: #40B44B;
    font-weight: 600;
}

.ticket-note {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #e9ecef;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #f8f9fa;
}

.quantity-input {
    width: 60px;
    height: 28px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    color: #2d2d2d;
}

.btn-primary {
    background-color: #40B44B;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    margin-top: 16px;
}

.btn-primary:hover {
    background-color: #379f41;
}

/* 分享按钮 */
.share-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.share-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
}

.share-buttons {
    display: flex;
    gap: 12px;
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    transition: transform 0.2s;
    text-decoration: none;
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.line {
    background: #00b900;
}

.share-btn.twitter {
    background: #1da1f2;
}

/* ============================================
   移动端响应式样式 (仅在小屏幕设备上生效)
   不影响PC端样式和功能
   ============================================ */

/* PC端隐藏移动端菜单按钮和移动端分类菜单 */
.mobile-menu-toggle,
.mobile-menu-overlay {
    display: none;
}

.mobile-category-menu {
    display: none; /* PC端隐藏，移动端显示 */
}

@media (max-width: 768px) {
    /* 移动端显示菜单按钮 */
    .mobile-menu-toggle,
    .mobile-category-toggle {
        display: flex;
    }
    /* 移动端导航栏样式 */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        color: white;
        font-size: 20px;
        cursor: pointer;
        padding: 0;
        margin-left: auto;
    }

    .mobile-menu-toggle:focus {
        outline: none;
    }

    .nav-links {
        position: fixed;
        top: 64px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 64px);
        height: calc(100dvh - 64px);
        background-color: #40B44B;
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 0 calc(12px + env(safe-area-inset-bottom, 0px));
        gap: 0;
        transition: right 0.3s ease;
        z-index: 999;
        overflow: hidden;
        box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    }

    .nav-links.mobile-show {
        right: 0;
    }

    .nav-links .nav-link {
        width: 100%;
        padding: 16px 20px;
        border-radius: 0;
        text-align: left;
        justify-content: flex-start;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .nav-links .nav-item.dropdown {
        width: 100%;
    }

    .nav-links .dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        background-color: rgba(0,0,0,0.1);
        box-shadow: none;
        margin-top: 0;
        border-radius: 0;
    }

    /* 移动端不使用 hover 展开，避免触摸设备残影 */
    .nav-links .nav-item.dropdown.active .dropdown-menu {
        display: block;
    }

    .nav-links .nav-item.dropdown .dropdown-menu {
        transform: none !important;
        will-change: auto;
    }

    .nav-links .dropdown-item {
        padding-left: 40px;
        justify-content: flex-start;
    }

    /* 移动端菜单遮罩层 */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        width: 100%;
        height: calc(100vh - 64px);
        height: calc(100dvh - 64px);
        background-color: rgba(0,0,0,0.5);
        z-index: 998;
    }

    .mobile-menu-overlay.active {
        display: block;
    }

    body.menu-open {
        overflow: hidden;
    }

    /* 移动端隐藏分类导航栏 */
    .category-nav {
        display: none;
    }

    /* 移动端显示汉堡菜单中的分类菜单 */
    .mobile-category-menu {
        display: block;
        width: 100%;
        order: -1; /* 将分类菜单放在最前面 */
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 底部登录/用户入口固定可见，不随分类列表滚动 */
    .mobile-auth-entry {
        width: 100%;
        flex: 0 0 auto;
        margin-top: auto;
        border-top: 1px solid rgba(255,255,255,0.2);
        background-color: rgba(0,0,0,0.12);
    }

    .mobile-category-link {
        width: 100%;
        padding: 16px 20px;
        border-radius: 0;
        text-align: left;
        justify-content: flex-start;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mobile-category-link i:first-child {
        width: 20px;
        text-align: center;
    }

    .mobile-category-link.active {
        background-color: rgba(255,255,255,0.15);
        font-weight: 600;
    }

    .mobile-menu-divider {
        height: 1px;
        background-color: rgba(255,255,255,0.2);
        margin: 8px 0;
    }

    /* 移动端分类下拉菜单 */
    .mobile-category-dropdown {
        width: 100%;
    }

    .mobile-dropdown-toggle {
        position: relative;
    }

    .mobile-chevron {
        margin-left: auto;
        font-size: 12px;
        transition: transform 0.3s ease;
        cursor: pointer;
        padding: 4px 8px; /* 增加点击区域 */
        margin-right: -8px; /* 补偿padding，保持视觉位置 */
    }

    .mobile-category-dropdown.active .mobile-chevron {
        transform: rotate(180deg);
    }

    .mobile-dropdown-menu {
        display: none;
        background-color: rgba(0,0,0,0.2);
        padding: 0;
    }

    .mobile-category-dropdown.active .mobile-dropdown-menu {
        display: block;
    }

    .mobile-dropdown-item {
        display: block;
        padding: 12px 20px 12px 52px;
        color: rgba(255,255,255,0.9);
        text-decoration: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        transition: background-color 0.2s;
        font-size: 14px;
    }

    .mobile-dropdown-item:hover {
        background-color: rgba(255,255,255,0.1);
        color: white;
        text-decoration: none;
    }

    /* 移动端轮播图样式 - 使用最高优先级覆盖所有样式 */
    section.banner-carousel,
    .banner-carousel {
        margin-top: 64px !important;
        margin-bottom: 0 !important; /* 移除底部间距，强制覆盖内联样式 */
        padding-bottom: 0 !important; /* 确保没有底部内边距 */
    }
    
    /* 轮播图容器也要移除底部间距 */
    section.banner-carousel .carousel-container,
    .banner-carousel .carousel-container {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        margin-top: 0 !important;
    }

    .carousel-container {
        height: 250px;
        border-radius: 0;
        margin: 0;
        max-width: 100%;
    }

    .carousel-content {
        bottom: 24px;
        left: 16px;
        right: 16px;
    }

    .carousel-content h2 {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .carousel-content p {
        font-size: 14px;
    }

    .carousel-arrow {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .carousel-arrow.prev {
        left: 8px;
    }

    .carousel-arrow.next {
        right: 8px;
    }

    .carousel-pages {
        bottom: 12px;
        gap: 4px;
        padding: 3px 6px;
    }

    .carousel-page {
        min-width: 24px;
        height: 24px;
        font-size: 12px;
        padding: 0 6px;
    }

    body.has-theme-strip {
        --theme-strip-height: 90px;
    }

    body.has-theme-strip .mobile-menu-overlay {
        top: calc(var(--theme-strip-height) + 64px);
        height: calc(100vh - var(--theme-strip-height) - 64px);
        height: calc(100dvh - var(--theme-strip-height) - 64px);
    }

    /* 移动端主要内容区 */
    main.main-content,
    .main-content {
        padding: 24px 0;
        padding-top: 88px; /* 64px导航栏 + 24px间距，避免被固定导航栏遮挡 */
        margin-top: 0;
        min-height: auto;
    }
    
    /* 首页：轮播图后的main-content，减小顶部间距 - 使用最高优先级 */
    section.banner-carousel + main.main-content,
    .banner-carousel + .main-content,
    section.banner-carousel ~ main.main-content,
    .banner-carousel ~ .main-content {
        padding: 0 !important; /* 完全重置所有padding */
        padding-bottom: 24px !important; /* 只保留底部内边距 */
        margin: 0 !important; /* 移除所有外边距 */
    }

    .events-container {
        padding: 0 15px;
    }
    
    /* 移动端活动列表网格 */
    .events-grid {
        grid-template-columns: 1fr;
        gap: 28px; /* 进一步增加到28px，让卡片之间有更大的间距 */
        margin-top: 0; /* 默认无间距 */
        padding-top: 0;
    }
    
    /* 首页：确保轮播图和main-content之间没有任何间距 */
    section.banner-carousel + main.main-content,
    .banner-carousel + .main-content {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* 首页轮播图后的容器间距 */
    section.banner-carousel + main.main-content .events-container,
    .banner-carousel + .main-content .events-container {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* 首页轮播图后的间距优化 - 直接在grid上设置margin-top */
    section.banner-carousel + main.main-content .events-container .events-grid,
    .banner-carousel + .main-content .events-container .events-grid,
    section.banner-carousel ~ main.main-content .events-container .events-grid,
    .banner-carousel ~ .main-content .events-container .events-grid {
        margin-top: 28px !important; /* 首页轮播图后，设置间距 */
        margin-bottom: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* 其他直接子元素移除顶部间距 */
    section.banner-carousel + main.main-content > *:not(.events-container),
    .banner-carousel + .main-content > *:not(.events-container) {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .event-card {
        margin-bottom: 0;
        position: relative;
        display: flex;
        flex-direction: column;
        height: auto;
        overflow: hidden;
        border-radius: 16px;
        box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    }

    /* 移动端活动卡片图片 - 宽图铺满，信息置于图片下方 */
    .event-image {
        position: relative;
        width: 100%;
        height: auto;
        padding-top: 55%; /* 调小图片上下高度 */
        flex-shrink: 0;
    }

    .event-image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .event-image::after {
        display: none;
    }

    .event-date {
        top: 8px;
        left: 8px;
        padding: 6px 10px;
        z-index: 2;
    }

    .event-date .month {
        font-size: 11px;
    }

    .event-date .day {
        font-size: 16px;
    }

    /* 移动端：信息区域放在图片下方，使用网格布局控制行列 */
    .event-info {
        position: relative;
        width: 100%;
        padding: 14px 16px 16px;
        background: white;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "cat time"
            "title title"
            "location location"
            "price price";
        row-gap: 6px;
        z-index: 1;
        margin-left: 0;
        box-shadow: none;
    }

    .event-info::before {
        content: "";
        position: absolute;
        top: -12px;
        left: 0;
        right: 0;
        height: 12px;
        background: linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0));
        opacity: 0.08;
        pointer-events: none;
    }

    .event-category {
        grid-area: cat;
        font-size: 12px;
        margin-bottom: 0;
        color: #40B44B;
        background: rgba(64, 180, 75, 0.12);
        padding: 4px 10px;
        border-radius: 999px;
        display: inline-flex;
        width: auto;
        align-self: flex-start;
        justify-self: flex-start;
    }

    .event-title {
        grid-area: title;
        font-size: 18px !important;
        line-height: 1.45;
        margin-bottom: 0;
        color: #2d2d2d;
        font-weight: 600;
        height: auto;
        min-height: 0;
        -webkit-line-clamp: unset;
        display: block;
        overflow: visible;
    }

    /* 让时间和地点两个 span 直接参与父级 grid 布局 */
    .event-details {
        font-size: 12px;
        margin-bottom: 0;
        color: #555;
        display: contents;
    }

    /* 第一行右侧：开始时间 */
    .event-details span:first-child {
        grid-area: time;
        display: flex;
        align-items: center;
        gap: 6px;
        justify-self: flex-end;
        text-align: right;
        font-size: 14px;
        font-weight: 500;
    }

    /* 第三行左侧：活动地点 */
    .event-details span:last-child {
        grid-area: location;
        display: flex;
        align-items: center;
        gap: 6px;
        justify-self: flex-start;
        text-align: left;
    }

    .event-details i {
        color: #40B44B; /* 绿色图标 */
        width: 14px;
        flex-shrink: 0;
        text-align: center;
    }

    /* 去掉开始时间前面的图标，仅保留地点图标 */
    .event-details span:first-child i {
        display: none;
    }

    /* 第四行右侧：价格或“免费” */
    .event-price {
        grid-area: price;
        font-size: 15px;
        color: #40B44B;
        font-weight: 700;
        text-shadow: none;
        margin-top: 6px;
        padding-top: 6px;
        border-top: 1px solid #eee; /* 地址与价格之间的分割线 */
        justify-self: stretch; /* 让分割线横跨整行 */
        width: 100%;
        text-align: right;
    }

    /* 移动端页脚样式 */
    .main-footer {
        padding: 32px 0 20px;
    }

    .footer-container {
        padding: 0 16px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
        margin-bottom: 32px;
    }

    /* 移动端隐藏：關於我們、幫助中心、合作夥伴 */
    .footer-section:first-child,
    .footer-section:nth-child(2),
    .footer-section:nth-child(3) {
        display: none !important; /* 确保隐藏 */
    }

    /* 只显示：關注我們（包含社交媒体和APP下载） */
    .footer-section:last-child,
    .footer-section:nth-last-child(2) {
        display: flex;
        flex-direction: column;
        align-items: center; /* 水平居中 */
        text-align: center; /* 文字居中 */
    }

    .footer-section {
        gap: 14px;
    }

    .footer-section h3 {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 12px;
        color: white;
    }
    
    /* 关注我们标题的特殊间距 - 使用更具体的选择器 */
    .footer-section:has(.footer-social) h3,
    .footer-section h3:has(+ .footer-social) {
        margin-bottom: 4px !important; /* 进一步缩小间距：从8px改为4px */
    }

    .footer-section a {
        font-size: 14px;
        color: rgba(255, 255, 255, 0.85);
        line-height: 1.8;
        display: block;
    }

    .footer-section a:hover {
        color: white;
    }

    .footer-social {
        gap: 16px;
        margin-top: 0 !important; /* 进一步缩小间距：从4px改为0 */
        justify-content: center; /* 图标居中 */
    }

    .footer-social a {
        font-size: 24px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.1);
        transition: all 0.2s;
    }

    .footer-social a:hover {
        background-color: rgba(255, 255, 255, 0.2);
        transform: scale(1.1);
    }

    /* 关注我们标题的特殊间距 */
    .footer-section:has(.footer-social) h3 {
        margin-bottom: 8px !important; /* 缩小间距：从16px改为8px */
    }
    
    
    /* 下载APP标题的特殊间距 */
    .footer-section:has(.footer-apps) h3 {
        margin-bottom: 4px !important; /* 缩小间距：从16px改为4px */
    }
    
    /* 使用更具体的选择器确保生效 */
    .footer-section:has(.footer-apps) h3,
    .footer-section h3:has(+ .footer-apps) {
        margin-bottom: 4px !important;
    }

    .footer-apps {
        flex-direction: row; /* 改为一行显示 */
        gap: 12px;
        margin-top: 0 !important; /* 缩小间距：从8px改为0 */
        justify-content: center; /* 按钮居中 */
    }

    .app-button {
        font-size: 14px;
        padding: 12px 20px;
        justify-content: center;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.15);
        transition: all 0.2s;
    }

    .app-button:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: translateY(-2px);
    }

    .app-button i {
        font-size: 24px;
    }

    .footer-bottom {
        font-size: 13px;
        padding-top: 24px;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        color: rgba(255, 255, 255, 0.8);
    }

    /* 移动端活动详情页 */
    .event-detail-container {
        padding: 0 12px;
    }

    .event-detail-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .event-main-info {
        padding: 16px;
    }

    .event-main-info .event-title {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .organizer-info {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .event-gallery {
        margin-bottom: 20px;
    }

    .event-description h2,
    .event-info h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .rich-text {
        font-size: 14px;
    }

    .info-item {
        gap: 12px;
        margin-bottom: 16px;
        padding: 12px;
    }

    .info-item i {
        font-size: 18px;
        width: 18px;
    }

    .info-content h3 {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .info-content p {
        font-size: 13px;
    }

    .event-sidebar {
        position: static;
        top: auto;
    }

    .ticket-box {
        padding: 16px;
        margin-bottom: 16px;
    }

    .ticket-header h2 {
        font-size: 15px;
    }

    .ticket-header .price {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .ticket-type {
        padding: 12px;
        margin-bottom: 12px;
    }

    .ticket-type-header h3 {
        font-size: 14px;
    }

    .ticket-type-header .price {
        font-size: 14px;
    }

    .ticket-note {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .quantity-btn {
        width: 32px;
        height: 32px;
    }

    .quantity-input {
        width: 50px;
    }

    .btn-primary {
        padding: 10px 20px;
        font-size: 14px;
        margin-top: 12px;
    }

    .share-section {
        padding: 16px;
    }

    .share-section h3 {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .share-buttons {
        gap: 10px;
    }

    .share-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    /* 移动端搜索栏和筛选器 */
    .search-bar {
        margin-bottom: 16px;
        margin-top: 0; /* 确保搜索框不被遮挡 */
        display: flex;
        justify-content: center; /* 居中显示 */
        align-items: center; /* 垂直居中 */
    }

    .search-bar form {
        width: 100%;
        display: flex;
        justify-content: center; /* 表单内容居中 */
    }

    .search-input {
        max-width: 75% !important; /* 进一步减小宽度，从85%改为75% */
        margin: 0 auto !important; /* 确保居中 */
        width: 75% !important; /* 同时设置width确保生效 */
        display: flex !important; /* 确保flex布局 */
    }

    .search-input input {
        font-size: 14px !important;
        padding: 4px 12px !important; /* 进一步减小高度：从8px改为6px */
        height: auto !important; /* 确保高度自适应 */
    }

    .search-input button {
        padding: 4px 12px !important; /* 进一步减小高度：从8px改为6px，左右也减小到12px */
        height: auto !important; /* 确保高度自适应 */
        background-color: #40B44B !important; /* 使用程序的主题绿色 */
        color: white !important; /* 确保文字为白色 */
        border: none !important; /* 移除边框 */
    }

    .search-input button:hover {
        background-color: #35a03e !important; /* hover时使用稍深的绿色 */
    }

    /* 移动端分页 */
    .pagination {
        flex-wrap: wrap;
        gap: 4px;
    }

    .page-link {
        padding: 8px 12px;
        font-size: 14px;
    }

    /* 移动端返回链接 */
    .back-link {
        margin-bottom: 16px;
    }

    .back-link a {
        font-size: 14px;
    }

    /* 移动端商户详情页样式 */
    .merchant-profile {
        margin-bottom: 20px;
    }

    .merchant-banner-container {
        aspect-ratio: auto;
        height: 220px;
    }

    .merchant-info-overlay {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.4));
    }

    .merchant-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 8px;
    }

    .merchant-title-area {
        margin-left: 0;
        max-width: 100%;
        height: auto;
    }

    .merchant-name {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .merchant-description {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    /* 移动端筛选区域 */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin: 16px 0;
    }

    .section-title {
        font-size: 18px;
    }

    .filter-container {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .search-form {
        max-width: 100%;
    }

    .custom-dropdown {
        width: 100%;
    }

    .custom-dropdown-toggle {
        width: 100%;
    }

    .search-results-info {
        font-size: 13px;
        margin-bottom: 12px;
    }

    /* 移动端登录/注册页样式 */
    .login-content {
        padding: 20px 12px;
        margin-top: 64px;
        min-height: calc(100vh - 64px - 61px);
    }

    .login-container {
        max-width: 100%;
    }

    .login-box {
        padding: 24px 20px;
    }

    .login-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .social-login {
        gap: 10px;
        margin-bottom: 20px;
    }

    .social-btn {
        padding: 10px;
        font-size: 14px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-group input {
        padding: 10px;
        font-size: 14px;
    }

    .form-options {
        margin-bottom: 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .remember-me {
        font-size: 13px;
    }

    .forgot-password {
        font-size: 13px;
    }

    .login-btn {
        padding: 10px;
        font-size: 15px;
    }

    .register-link {
        font-size: 13px;
        margin-top: 20px;
    }

    .back-home {
        margin-top: 10px;
    }

    .back-home a {
        font-size: 13px;
    }
}

/* 超小屏幕设备优化 (小于480px) */
@media (max-width: 480px) {
    .logo-text {
        font-size: 20px;
    }

    .carousel-container {
        height: 200px;
    }

    .carousel-content h2 {
        font-size: 20px;
    }

    .carousel-content p {
        font-size: 12px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .footer-section {
        gap: 12px;
    }

    .footer-section h3 {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .footer-section a {
        font-size: 13px;
    }

    .footer-social {
        gap: 12px;
    }

    .footer-social a {
        font-size: 22px;
        width: 36px;
        height: 36px;
    }

    .app-button {
        font-size: 13px;
        padding: 10px 16px;
    }

    .app-button i {
        font-size: 20px;
    }

    .footer-bottom {
        font-size: 12px;
        padding-top: 20px;
    }

    .event-main-info .event-title {
        font-size: 18px;
    }

    .events-container {
        padding: 0 15px;
    }

    .events-grid {
        gap: 20px;
    }

    .event-card {
        height: auto;
        border-radius: 14px;
        box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    }

    .event-image {
        width: 100%;
        padding-top: 60%; /* 超小屏幕再略微降低高度 */
    }

    .event-date {
        top: 10px;
        left: 10px;
        padding: 5px 9px;
    }

    .event-info {
        width: 100%;
        padding: 12px 14px 14px;
        margin-left: 0;
    }

    .event-info::before {
        top: -10px;
        height: 10px;
    }

    .event-category {
        font-size: 11px;
        padding: 3px 8px;
        margin-bottom: 0;
    }

    .event-title {
        font-size: 14px;
        margin-bottom: 0;
    }

    .event-details {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .event-price {
        font-size: 14px;
    }
}