* {
    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%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.notif-bell-wrap {
    position: relative;
    flex-shrink: 0;
}

.notif-bell-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.notif-bell-dot {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border: 1px solid #fff;
    border-radius: 50%;
}

.notif-bell-dot.is-on {
    display: block;
}

.notif-bell-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: min(360px, calc(100vw - 24px));
    max-height: 420px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    color: #1f2937;
    z-index: 1100;
    overflow: hidden;
}

.notif-bell-panel[hidden] {
    display: none !important;
}

.notif-bell-panel__head,
.notif-bell-panel__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    background: #f8fafc;
}

.notif-bell-readall {
    border: none;
    background: none;
    color: #40B44B;
    font-size: 12px;
    cursor: pointer;
}

.notif-bell-panel__body {
    max-height: 300px;
    overflow-y: auto;
    font-size: 13px;
}

.notif-bell-empty {
    padding: 24px 14px;
    text-align: center;
    color: #6b7280;
}

.notif-bell-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.notif-bell-item.is-unread {
    background: #f0fdf4;
}

.notif-bell-item__title {
    display: block;
    font-weight: 700;
    margin-bottom: 2px;
}

.notif-bell-item__meta {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 4px;
}

.notif-bell-item__body {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #374151;
    white-space: pre-wrap;
}

.notif-bell-panel__foot {
    display: block;
    text-align: center;
    color: #40B44B;
    text-decoration: none;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

.lang-switch__item {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-weight: 500;
}

.lang-switch__item:hover {
    color: #fff;
    text-decoration: none;
}

.lang-switch__item.is-active {
    color: #fff;
    font-weight: 700;
}

.lang-switch__sep {
    color: rgba(255, 255, 255, 0.45);
}

.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;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
}

.category-nav--dual {
    height: 96px;
}

.category-nav-row {
    width: 100%;
    height: 48px;
    flex: 0 0 48px;
    display: flex;
    align-items: center;
}

.category-nav-row--second {
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.category-container--row2 {
    max-width: none;
    justify-content: center;
    gap: 0;
}

.category-nav-row--second .category-scroll-wrap {
    margin-left: 0;
    width: 100%;
}

.category-nav-row--second .category-scroll-list {
    justify-content: center;
}

.category-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 32px;
    overflow: hidden;
}

.category-scroll-wrap {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    margin-left: -8px;
    position: relative;
    display: flex;
    align-items: center;
}

.category-scroll {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    height: 48px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
}

.category-scroll-btn {
    position: absolute;
    top: 0;
    z-index: 4;
    width: 28px;
    height: 48px;
    border: 0;
    padding: 0;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.category-scroll-btn[hidden] {
    display: none !important;
}

.category-scroll-btn.prev {
    left: 0;
    background: linear-gradient(to right, #40B44B 55%, rgba(64, 180, 75, 0));
}

.category-scroll-btn.next {
    right: 0;
    background: linear-gradient(to left, #40B44B 55%, rgba(64, 180, 75, 0));
}

.category-scroll-btn:hover {
    color: #fff;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-scroll.is-dragging {
    cursor: grabbing;
}

.category-list {
    list-style: none;
    display: flex;
    flex-wrap: nowrap;
    gap: 32px;
    align-items: center;
    height: 100%;
    margin: 0;
    position: relative;
    width: max-content;
    white-space: nowrap;
}

.category-scroll-list {
    min-width: 100%;
}

.category-fixed-list {
    flex: 0 0 auto;
}

.category-right-list {
    margin-left: 0;
}

.category-list > li {
    flex: 0 0 auto;
}

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

.category-item {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0 8px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: var(--nav-font-size, 16px);
    font-weight: 500;
    position: relative;
    height: 36px;
    line-height: 36px;
    margin: 6px -8px;
    border-radius: 8px;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

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

.category-item:hover,
.category-dropdown:hover > .category-item {
    color: var(--nav-hover-text-color, #FFFFFF);
    background-color: var(--nav-hover-color, #2E8B3A);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.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: fixed;
    top: var(--category-dropdown-top, 112px);
    left: var(--category-dropdown-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: var(--nav-font-size, 16px);
    transition: all 0.2s ease;
    text-align: center;
}

.category-dropdown-item:hover {
    background-color: var(--nav-hover-color, #2E8B3A);
    color: var(--nav-hover-text-color, #FFFFFF);
}

.nav-link.mobile-category-link {
    font-size: var(--nav-font-size, 16px);
}

/* 轮播海报样式 */
.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: auto;
    aspect-ratio: 1200 / 500;
    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: contain;
    object-position: center;
    background: #f8f9fa;
}

.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;
    pointer-events: none;
    user-select: none;
    font-variant-east-asian: normal;
}

.event-expired-watermark::before {
    content: attr(data-label);
    display: block;
    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;
    border: 2px solid rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.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;
}

/* 活動卡片「首頁樣式」主題 */
.event-card--home-style {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid #eef2ee;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.event-card--home-style:hover {
    color: inherit;
    text-decoration: none;
    transform: translateY(-6px);
    border-color: #b7e3bc;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.13);
}

.event-card--home-style .event-home-image {
    position: relative;
    width: 100%;
    height: 200px;
    padding-top: 0;
    flex-shrink: 0;
    overflow: hidden;
}

.event-card--home-style .event-home-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #f8f9fa;
}

.event-card--home-style.event-card--expired .event-home-image::after {
    display: none;
}

.event-home-badge,
.event-home-expired {
    position: absolute;
    left: 16px;
    z-index: 2;
    padding: 6px 14px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
}

.event-home-badge {
    top: 16px;
    background: linear-gradient(135deg, #40B44B, #278d34);
}

.event-home-badge.paid {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.event-home-badge.display {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.event-home-expired {
    bottom: 16px;
    background: rgba(0, 0, 0, 0.66);
}

.event-home-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 24px;
}

.event-home-category {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    margin-bottom: 12px;
    padding: 4px 12px;
    color: #278d34;
    font-size: 12px;
    font-weight: 700;
    background: #effaf0;
    border-radius: 20px;
}

.event-home-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    min-height: 50px;
    margin: 0 0 12px;
    overflow: hidden;
    color: #17233c;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.event-home-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.event-home-meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #64748b;
    font-size: 14px;
}

.event-home-meta-item i {
    width: 18px;
    flex-shrink: 0;
    color: #40B44B;
}

.event-home-meta-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-home-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #eef2ee;
}

.event-home-price {
    color: #278d34;
    font-size: 20px;
    font-weight: 700;
}

.event-home-more {
    color: #40B44B;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.events-grid.events-grid--home-style {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1024px) {
    .events-grid.events-grid--home-style {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 桌面端左右浮動廣告：跟隨視窗並保持垂直置中 */
.side-floating-ad {
    position: fixed;
    top: 50%;
    z-index: 900;
    display: none;
    width: min(clamp(110px, 8.5vw, 145px), 25vh);
    max-height: 60vh;
    aspect-ratio: 500 / 1200;
    transform: translateY(-50%);
}

.side-floating-ad[hidden] {
    display: none !important;
}

.side-floating-ad--left {
    left: 0;
}

.side-floating-ad--right {
    right: 0;
}

.side-floating-ad a {
    display: block;
    width: 100%;
    height: 100%;
}

.side-floating-ad img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.side-floating-ad--left img {
    border-radius: 0 10px 10px 0;
}

.side-floating-ad--right img {
    border-radius: 10px 0 0 10px;
}

.side-floating-ad a:hover img {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.28);
}

.side-floating-ad-close {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #fff;
    background: rgba(0, 0, 0, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.side-floating-ad-close:hover {
    background: rgba(0, 0, 0, 0.88);
    transform: scale(1.06);
}

.site-popup-ad {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.site-popup-ad[hidden] {
    display: none !important;
}

.site-popup-ad-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.site-popup-ad-dialog {
    position: relative;
    z-index: 1;
    max-width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
}

.site-popup-ad-dialog img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.site-popup-ad-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #fff;
    background: rgba(0, 0, 0, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    cursor: pointer;
}

.site-popup-ad-close:hover {
    background: rgba(0, 0, 0, 0.88);
}

@media (min-width: 1500px) {
    .side-floating-ad {
        display: block;
    }
}

/* 页脚样式 */
.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,
.event-sidebar {
    min-width: 0;
}

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

.event-main-info img,
.rich-text img,
.rich-text video,
.rich-text iframe {
    max-width: 100%;
    height: auto;
}

.rich-text table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}

.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: contain;
    object-position: center;
    background: #f8f9fa;
}

.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-detail-ads {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.event-detail-ad {
    display: block;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.event-detail-ad img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: #f8f9fa;
}

.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;
}

.display-only-schedule {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 8px 0 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.display-only-schedule-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.display-only-schedule-label {
    font-size: 13px;
    color: #666;
}

.display-only-schedule-row strong {
    font-size: 16px;
    font-weight: 600;
    color: #2d2d2d;
}

.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-type-schedule {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 6px 0 10px;
}

.ticket-type-schedule-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.ticket-type-schedule-row strong {
    font-weight: 600;
    color: #2d2d2d;
    text-align: right;
}

.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端隐藏，移动端显示 */
}

/* 移動端底部導航（PC 端隱藏） */
.mobile-tab-bar {
    display: none;
}

@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: 0;
    }

    .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%;
        position: relative;
    }

    .nav-links .dropdown-menu {
        position: absolute;
        top: auto;
        bottom: 100%;
        left: 0;
        right: 0;
        display: none;
        width: 100%;
        background-color: #35963e;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
        margin-top: 0;
        border-radius: 0;
        z-index: 2;
    }

    /* 触摸设备的 hover 会把菜单撑到屏幕外，只在点按后向上展开 */
    .nav-links .nav-item.dropdown:hover .dropdown-menu {
        display: none;
    }

    .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;
        font-size: var(--nav-font-size, 16px);
    }

    .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;
    }

    .nav-link.mobile-category-link:hover,
    .mobile-dropdown-item:hover {
        background-color: var(--nav-hover-color, #2E8B3A);
        color: var(--nav-hover-text-color, #FFFFFF);
    }

    .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: var(--nav-font-size, 16px);
    }

    .mobile-dropdown-item:hover {
        background-color: var(--nav-hover-color, #2E8B3A);
        color: var(--nav-hover-text-color, #FFFFFF);
        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: auto;
        aspect-ratio: 1200 / 500;
        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;
    }

    /* 分類頁 / 專題欄無輪播時，覆蓋頁內 padding-top: 20px !important */
    main.main-content.main-content--no-carousel,
    .main-content.main-content--no-carousel {
        padding-top: 80px !important;
    }
    
    /* 首页：轮播图后的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,
    .events-grid.events-grid--home-style {
        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: contain;
        object-position: center;
        background: #f8f9fa;
    }

    .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;
    }

    .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;
    }

    /* 移动端商户详情页样式（具体布局见 merchants/detail.html extra_css） */
    .merchant-profile {
        margin-bottom: 20px;
    }

    /* 移动端筛选区域 */
    .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;
    }

    /* 移動端底部 Tab 導航 */
    .mobile-tab-bar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        align-items: stretch;
        justify-content: space-around;
        height: calc(56px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: #fff;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
    }

    .mobile-tab-bar__item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        padding: 6px 4px 4px;
        color: #8a8a8a;
        font-size: 11px;
        font-weight: 600;
        text-decoration: none;
        transition: color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-tab-bar__item i {
        font-size: 18px;
        line-height: 1;
    }

    .mobile-tab-bar__item span {
        line-height: 1.2;
        white-space: nowrap;
    }

    .mobile-tab-bar__item.is-active {
        color: #40B44B;
    }

    body.has-mobile-tab-bar {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }

    body.menu-open .mobile-tab-bar {
        display: none;
    }
}

/* 前台分頁：目前頁用綠底白字，避免白字落在白底上看不見 */
.page-item.active .page-link,
.page-item.active .page-link:hover,
.page-item.active .page-link:focus {
    background-color: #40B44B;
    border-color: #40B44B;
    color: #fff;
}

/* 超小屏幕设备优化 (小于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;
    }
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.page-size-form {
    margin: 0;
}

.page-size-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}

.page-size-label select {
    height: 36px;
    padding: 0 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 14px;
}

.event-tag-list,
.event-home-tags,
.home-event-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.event-tag-list {
    grid-area: cat;
    justify-self: flex-start;
}

.event-home-tags,
.home-event-tags {
    margin-bottom: 12px;
}

.event-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.event-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.event-gallery-thumb {
    width: 72px;
    height: 48px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    background: #f8f9fa;
    overflow: hidden;
    cursor: pointer;
}

.event-gallery-thumb.is-active {
    border-color: #40B44B;
}

.event-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}