/* ==========================================================================
   静心手作 — 站点样式
   说明：站点仍通过 tailwind.js（Tailwind Play CDN）为「脚本动态生成」的活动
   卡片与缩略图提供工具类支持；本文件负责「静态 HTML」的语义化样式，让
   index.html 的结构保持干净、可读、对 SEO 友好。
   ========================================================================== */

:root {
    --green-50:  #f0fdf4;
    --green-100: #dcfce7;
    --green-200: #bbf7d0;
    --green-300: #86efac;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;
    --green-800: #166534;

    --gray-50:  #f9fafb;
    --gray-100: #f3f4f6;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-800: #1f2937;

    --shadow-sm:  0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg:  0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl:  0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* ==========================================================================
   字体 / Typography
   ========================================================================== */

/* 英文版字体：优雅衬线 Cormorant Garamond，仅在 body.lang-en 时生效 */
body.lang-en {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    letter-spacing: 0.01em;
    /* Cormorant 字面偏小，英文版整体放大一档以保证可读性 */
    font-size: 1.06rem;
}

body.lang-en p,
body.lang-en h3 {
    letter-spacing: 0.015em;
}

/* 语言切换按钮文字保持清晰字号 */
body.lang-en #langToggleLabel {
    font-size: 0.95rem;
}

/* 多行文本截断 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   通用工具 / Helpers
   ========================================================================== */

/* 半透明叠层（装饰用，配合 aria-hidden） */
.overlay {
    position: absolute;
    inset: 0;
}
.overlay--white-30 { background: rgb(255 255 255 / 0.3); }
.overlay--white-40 { background: rgb(255 255 255 / 0.4); }
.overlay--green   { background: linear-gradient(to bottom right, var(--green-50), var(--gray-50), var(--green-50)); }

/* 滚动条样式 */
.custom-scrollbar::-webkit-scrollbar {
    height: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 2px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--green-200);
    border-radius: 2px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--green-300);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

/* ==========================================================================
   Hero / 首屏
   ========================================================================== */

.hero {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(to bottom right, var(--gray-50), var(--green-50), var(--gray-100));
}

.hero__content {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 4rem 1rem 3rem;
}

.hero__inner {
    width: 100%;
    max-width: 64rem;
    text-align: center;
}

.hero__logo {
    margin: 0 0 1.5rem;
}

.hero__logo-img {
    display: block;
    height: 7rem;
    width: auto;
    max-width: none;
    margin: 0 auto;
    object-fit: contain;
}

/* 图片加载失败时由内联 onerror 切换为 flex 显示 */
.hero__logo-fallback {
    display: none;
    height: 7rem;
    min-width: 200px;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    color: #fff;
    background: linear-gradient(to right, var(--green-700), var(--green-600));
    box-shadow: var(--shadow-lg);
}

.hero__logo-fallback-text {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.hero__subtitle {
    margin: 0 0 1rem;
    padding: 0 0.5rem;
    font-size: 1.125rem;
    line-height: 1.625;
    font-weight: 300;
    letter-spacing: 0.025em;
    color: var(--green-700);
}

.hero__divider {
    width: 4rem;
    height: 0.125rem;
    margin: 0 auto 1.5rem;
    background: var(--green-600);
}

.hero__actions {
    max-width: 48rem;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
}

/* 语言切换按钮 */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 300;
    color: var(--green-700);
    background: rgb(255 255 255 / 0.9);
    border: 1px solid var(--green-200);
    border-radius: 9999px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: all 0.2s ease;
}
.lang-toggle:hover {
    color: var(--green-800);
    background: #fff;
    border-color: var(--green-300);
}
.lang-toggle__icon {
    width: 1rem;
    height: 1rem;
}

/* ==========================================================================
   Section / 通用版块（过往活动、加入我们）
   ========================================================================== */

.section {
    position: relative;
    padding: 4rem 0;
}
.section--join {
    background: linear-gradient(to bottom right, var(--gray-50), var(--green-50), var(--gray-50));
}

.section__inner {
    position: relative;
    z-index: 10;
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 1rem;
}
.section__inner--wide {
    max-width: 80rem;
}

/* 版块标题（图标 + 标题 + 分隔线） */
.section-head {
    margin-bottom: 3rem;
    text-align: center;
}

.section-head__row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.section-head__icon {
    flex-shrink: 0;
    width: 3.5rem;
    height: 3.5rem;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--green-700);
    border-radius: 9999px;
    box-shadow: var(--shadow-lg);
}

.section-head__glyph {
    width: 1.75rem;
    height: 1.75rem;
    color: #fff;
}

.section-head__title {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 300;
    letter-spacing: 0.025em;
    color: var(--green-800);
}

.section-divider {
    width: 8rem;
    height: 0.125rem;
    margin: 0 auto;
    background: var(--green-600);
}
.section-divider--gap {
    margin-bottom: 1.5rem;
}

.section-desc {
    max-width: 48rem;
    margin: 0 auto;
    padding: 0 0.5rem;
    font-size: 1rem;
    line-height: 1.625;
    font-weight: 300;
    letter-spacing: 0.025em;
    color: var(--gray-600);
}

/* ==========================================================================
   过往活动列表
   ========================================================================== */

.activities {
    position: relative;
}

/* 移动端：垂直堆叠 */
.activities--mobile {
    display: block;
}
.activities--mobile > * + * {
    margin-top: 2rem;
}

/* 桌面端：横向滚动 */
.activities--desktop {
    display: none;
}

.activities__scroller {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding-bottom: 1.5rem;
    scroll-behavior: smooth;
}

.activities__hint {
    margin-top: 2rem;
    text-align: center;
}

.activities__hint-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 300;
    color: var(--green-700);
}

.activities__dot {
    width: 0.5rem;
    height: 0.5rem;
    background: var(--green-600);
    border-radius: 9999px;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.activities__hint-text {
    letter-spacing: 0.025em;
}

/* 活动卡片（脚本动态生成的卡片复用此类） */
.activity-card {
    transition: all 0.3s ease;
}
.activity-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgb(0 0 0 / 0.1);
}

/* 图片/卡片悬停效果（供动态卡片使用） */
.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}
.group:hover .group-hover\:opacity-100 {
    opacity: 1;
}
.group:hover .group-hover\:translate-y-0 {
    transform: translateY(0);
}

/* 主按钮（备用） */
.btn-primary {
    background: linear-gradient(135deg, #166534, #15803d);
    transition: all 0.3s ease;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #15803d, #166534);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgb(22 101 52 / 0.3);
}

/* ==========================================================================
   加入我们 / 二维码
   ========================================================================== */

.join__body {
    text-align: center;
}

.join__desc {
    max-width: 42rem;
    margin: 0 auto 2rem;
    padding: 0 1rem;
    font-size: 0.875rem;
    line-height: 1.625;
    font-weight: 300;
    letter-spacing: 0.025em;
    color: var(--gray-600);
}

.join__qr {
    max-width: 20rem;
    margin: 0 auto;
}

.join__qr-card {
    padding: 1rem;
    text-align: center;
    background: #fff;
    border: 1px solid var(--gray-100);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
}

.join__qr-wechat {
    width: 10rem;
    height: 10rem;
    margin: 0 auto;
    border-radius: 0.25rem;
}

.join__qr-instagram {
    width: 10rem;
    height: auto;
    margin: 0 auto;
    border-radius: 0.25rem;
}

/* ==========================================================================
   图片画廊模态框
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0 0 0 / 0.5);
}
.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 90vw;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    background: linear-gradient(to bottom right, var(--gray-50), var(--green-50), var(--gray-50));
    border: 1px solid var(--green-100);
    border-radius: 0.125rem;
    box-shadow: var(--shadow-2xl);
}

.modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(255 255 255 / 0.95);
    border: 1px solid var(--gray-300);
    border-radius: 0.125rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}
.modal__close:hover {
    background: #fff;
    border-color: var(--green-500);
    box-shadow: var(--shadow-md);
}
.modal__close-icon {
    width: 1rem;
    height: 1rem;
    color: var(--gray-500);
}
.modal__close:hover .modal__close-icon {
    color: var(--green-500);
}

.modal__header {
    padding: 1rem 1.5rem;
    background: rgb(255 255 255 / 0.9);
    border-bottom: 1px solid var(--green-100);
}
.modal__header-row {
    display: flex;
    align-items: center;
    padding-right: 3rem;
}
.modal__title {
    flex: 1;
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: 0.025em;
    color: var(--green-800);
}
.modal__count {
    font-size: 0.875rem;
    font-weight: 300;
    color: var(--gray-500);
    white-space: nowrap;
}

.modal__stage {
    position: relative;
    padding: 2rem;
    background: rgb(255 255 255 / 0.8);
}

.modal__frame {
    position: relative;
    overflow: hidden;
    background: rgb(240 253 244 / 0.3);
    border: 1px solid rgb(220 252 231 / 0.2);
    border-radius: 0.125rem;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(4px);
}

.modal__image {
    width: 100%;
    height: 24rem;
    object-fit: contain;
    background: rgb(249 250 251 / 0.3);
}

.modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(240 253 244 / 0.2);
    border: 1px solid rgb(220 252 231 / 0.3);
    border-radius: 0.125rem;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    cursor: pointer;
    transition: all 0.3s ease;
}
.modal__nav:hover {
    background: rgb(240 253 244 / 0.4);
    border-color: rgb(187 247 208 / 0.5);
    box-shadow: var(--shadow-md);
}
.modal__nav--prev { left: 1rem; }
.modal__nav--next { right: 1rem; }
.modal__nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: rgb(22 163 74 / 0.7);
}

.modal__counter {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    background: rgb(255 255 255 / 0.95);
    border: 1px solid var(--green-200);
    border-radius: 0.125rem;
    box-shadow: var(--shadow-sm);
    font-size: 0.875rem;
    font-weight: 300;
    color: var(--green-700);
}

.modal__thumbs {
    padding: 0 1.5rem 1.5rem;
    background: rgb(255 255 255 / 0.8);
}
.modal__thumb-list {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

/* ==========================================================================
   响应式 / Responsive (md ≥ 768px, lg ≥ 1024px)
   ========================================================================== */

@media (min-width: 768px) {
    .hero__content {
        align-items: center;
        padding: 5rem 1rem;
    }
    .hero__logo-img,
    .hero__logo-fallback { height: 12rem; }
    .hero__logo-fallback-text {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }
    .hero__subtitle { font-size: 1.875rem; }
    .join__desc { font-size: 1rem; }
}

@media (min-width: 1024px) {
    .hero__content { padding: 5rem 1.5rem; }
    .hero__logo { margin-bottom: 2rem; }
    .hero__logo-img,
    .hero__logo-fallback { height: 16rem; }
    .hero__logo-fallback-text {
        font-size: 3rem;
        line-height: 1;
    }
    .hero__subtitle { font-size: 2.25rem; margin-bottom: 2rem; }
    .hero__divider { width: 8rem; margin-bottom: 2rem; }
    .hero__actions { margin-bottom: 3rem; }

    .section { padding: 6rem 0; }
    .section__inner { padding: 0 1.5rem; }

    .section-head { margin-bottom: 4rem; }
    .section-head--spacious { margin-bottom: 5rem; }
    .section-head__row { margin-bottom: 2rem; }
    .section-head__icon {
        width: 4.5rem;
        height: 4.5rem;
        margin-right: 1.5rem;
    }
    .section-head__glyph {
        width: 2.25rem;
        height: 2.25rem;
    }
    .section-head__title {
        font-size: 3rem;
        line-height: 1;
    }
    .section-divider { width: 10rem; }
    .section-divider--gap { margin-bottom: 2rem; }
    .section-desc { font-size: 1.25rem; }

    .activities--mobile { display: none; }
    .activities--desktop { display: block; }

    .join__desc {
        font-size: 1.125rem;
        margin-bottom: 2.5rem;
    }
}
