/* ============================================================
   style.css —— 液态玻璃风格 + 动态背景
   ============================================================ */
:root {
    --bg1: #2c3e50;
    --bg2: #4a6583;
    --bg3: #6b8bab;
    --glass: rgba(255,255,255,0.14);
    --glassBorder: rgba(255,255,255,0.30);
    --textColor: #fff;
    --radius: 20px;
}

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

html, body {
    height: 100%;
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    color: var(--textColor);
    overflow-x: hidden;
    background: linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
    background-attachment: fixed;
    transition: background 1.2s ease;
}

/* ---------- 动态背景层 ---------- */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(120% 120% at 50% 0%, var(--bg3) 0%, var(--bg2) 45%, var(--bg1) 100%);
    transition: background 1.2s ease;
    background-repeat: no-repeat;
    background-position: center;
}
.bg-layer::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.03);
}
/* 有真实背景图时：铺满 + 深色渐变遮罩，保证白色文字可读 */
.bg-layer.bg-image::after {
    background: linear-gradient(180deg, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.30) 55%, rgba(0,0,0,0.48) 100%);
}
.bg-effect {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ---------- 主舞台 ---------- */
.stage {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 26px;
    transition: justify-content 0.9s cubic-bezier(.22,.8,.36,1);
}
.stage.no-dishes { justify-content: center; }
.stage.has-dishes { justify-content: flex-start; }

/* ---------- 菜单标题 ---------- */
.menu-title {
    font-size: clamp(34px, 7vw, 72px);
    font-weight: 800;
    letter-spacing: 6px;
    text-shadow: 0 4px 30px rgba(0,0,0,0.35);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1s ease, transform 1s ease;
    text-align: center;
}
.menu-title.show { opacity: 1; transform: translateY(0); }

/* ---------- 时间 ---------- */
.clock {
    text-align: center;
    padding: 26px 40px;
    border-radius: var(--radius);
    background: var(--glass);
    border: 1px solid var(--glassBorder);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    transition: all 0.9s cubic-bezier(.22,.8,.36,1);
}
.clock-main {
    font-size: clamp(20px, 4.6vw, 46px);
    font-weight: 600;
    letter-spacing: 2px;
}
.clock-main .num {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #ffd98a;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.festival-tag {
    display: inline-block;
    margin-left: 12px;
    padding: 3px 16px;
    border-radius: 30px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: #fff;
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 4px 18px rgba(255,107,107,0.4);
    vertical-align: middle;
}
.clock-sub {
    margin-top: 8px;
    font-size: clamp(13px, 2.4vw, 20px);
    color: rgba(255,255,255,0.82);
    letter-spacing: 1px;
}

/* ---------- 菜品区 ---------- */
.menu-body {
    width: 100%;
    max-width: 1100px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}
.menu-body.show { opacity: 1; transform: translateY(0); }

.group {
    margin-bottom: 30px;
}
.group-head {
    display: inline-block;
    font-size: clamp(22px, 4vw, 34px);
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 16px;
    padding: 8px 22px;
    border-radius: 14px;
    background: var(--glass);
    border: 1px solid var(--glassBorder);
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 22px rgba(0,0,0,0.18);
}
.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}

.dish {
    padding: 20px 22px;
    border-radius: 18px;
    background: var(--glass);
    border: 1px solid var(--glassBorder);
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    transition: transform .25s ease, box-shadow .25s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dish:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,0.26); }

.dish-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.dish-name {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 1px;
}
.dish-note {
    font-size: 14px;
    color: rgba(255,255,255,0.78);
    border-top: 1px dashed var(--glassBorder);
    padding-top: 8px;
    font-style: italic;
}

.status-pill {
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    white-space: nowrap;
}
.status-未开始 { background: rgba(180,180,190,0.28); color: #fff; }
.status-制作中 { background: linear-gradient(135deg,#ffa23a,#ff7a3a); color: #fff; animation: pulse 1.6s infinite; }
.status-已上菜 { background: linear-gradient(135deg,#3ecf6e,#22a352); color: #fff; }

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

.foot {
    margin-top: 20px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 2px;
    opacity: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.foot.show { opacity: 1; }
.foot-sep { color: rgba(255,255,255,0.3); }
.foot-about {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    padding: 3px 16px;
    border-radius: 30px;
    border: 1px solid var(--glassBorder);
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all .25s ease;
    letter-spacing: 2px;
}
.foot-about:hover {
    color: #ffd98a;
    border-color: rgba(255,217,138,0.6);
    box-shadow: 0 0 16px rgba(255,217,138,0.25);
    transform: translateY(-1px);
}

/* ============================================================
   动态背景特效
   ============================================================ */
@keyframes floatUp { 0% { transform: translateY(110vh); opacity: .35;} 20%{opacity:.95;} 80%{opacity:.9;} 100%{ transform: translateY(-10vh); opacity: .45;} }
@keyframes fallDown { 0% { transform: translateY(-10vh); opacity: .35;} 20%{opacity:.95;} 80%{opacity:.9;} 100%{ transform: translateY(110vh); opacity: .45;} }
@keyframes sway { 0%,100% { margin-left:0;} 50% { margin-left:20px;} }

.particle {
    position: absolute;
    top: 0;
    border-radius: 50%;
    will-change: transform, opacity;
}

/* 雪花 / 红色雪 */
.effect-snow .particle, .effect-snow_red .particle { background: #fff; animation: fallDown linear infinite; }
.effect-snow_red .particle.red { background: #ffd166; }

/* 烟花：用 CSS 渐变点模拟 */
.effect-firework .particle {
    background: radial-gradient(circle, #ffd166, #ff6b6b);
    animation: firework linear infinite;
    opacity: 0;
}
@keyframes firework { 0%{ transform: scale(0); opacity:1;} 100%{ transform: scale(1.4); opacity:0;} }

/* 灯笼：向上飘的圆点（元宵） */
.effect-lantern .particle {
    background: radial-gradient(circle, #ffd166, #ff5a3a);
    animation: floatUp linear infinite;
}

/* 星星（七夕/中秋/春节等：闪烁不下落，替代中秋旧版"月亮+颗粒下落"） */
.effect-stars .particle { background: #fff; animation: twinkle ease-in-out infinite; }
@keyframes twinkle { 0%,100%{opacity:.1;} 50%{opacity:1;} }

/* 爱心（情人节） */
.effect-hearts .particle {
    background: #ff6b8a;
    animation: floatUp linear infinite;
    clip-path: polygon(50% 15%, 62% 30%, 78% 25%, 82% 45%, 50% 90%, 18% 45%, 22% 25%, 38% 30%);
}

/* 泡泡（儿童/生日） */
.effect-bubbles .particle {
    background: radial-gradient(circle at 30% 30%, #fff, rgba(255,255,255,0.2));
    animation: floatUp linear infinite;
    border: 1px solid rgba(255,255,255,0.4);
}

/* 花瓣（重阳/感恩/秋） */
.effect-petals .particle { background: #ffd98a; animation: fallDown linear infinite; border-radius: 60% 40% 55% 45%; }

/* 雨（清明/雨水） */
.effect-rain .particle {
    width: 2px !important; height: 30px;
    background: linear-gradient(to bottom, transparent, #cfecff);
    border-radius: 2px;
    animation: fallDown linear infinite;
}

/* 露珠 */
.effect-dew .particle { background: rgba(220,240,255,0.6); animation: fallDown linear infinite; }

/* 霜 */
.effect-frost .particle { background: rgba(240,245,255,0.7); animation: fallDown linear infinite; }

/* 水波（端午） */
.effect-water .particle { background: rgba(120,200,255,0.5); animation: floatUp linear infinite; }

/* 热气（腊八） */
.effect-steam .particle { background: rgba(255,255,255,0.6); animation: floatUp linear infinite; border-radius: 50%; }

/* 嫩芽（春） */
.effect-sprout .particle {
    background: radial-gradient(circle, #c6ffc6, #5fbf6f);
    animation: floatUp linear infinite;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

/* 太阳（夏） */
.effect-sun::before {
    content: "";
    position: absolute;
    right: 12%; top: 10%;
    width: 130px; height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff3c0, #ffd166 45%, transparent 72%);
    box-shadow: 0 0 80px 24px rgba(255,209,102,0.45);
}
.effect-sun .particle { background: #fff3c0; animation: floatUp linear infinite; }

/* 红旗（国庆/党建）：底部红绸飘动 */
.effect-redflag::before {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 120px;
    background: linear-gradient(180deg, transparent, rgba(224,57,70,0.35));
}
.effect-redflag .particle {
    background: linear-gradient(135deg, #ffd166, #ff8c42);
    animation: fallDown linear infinite;
    border-radius: 3px;
}
.effect-redflag .flag-star {
    position: absolute;
    color: #ffd166;
    font-size: 30px;
    animation: sway 6s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(255,209,102,0.6);
}

/* 蝙蝠（万圣） */
.effect-bats .particle {
    background: #3a2b3d;
    animation: floatUp linear infinite;
    clip-path: polygon(0 0, 40% 0, 50% 35%, 60% 0, 100% 0, 75% 50%, 100% 100%, 50% 70%, 0 100%, 25% 50%);
}

/* 国旗（国庆）额外元素 */
.effect-redflag .flag {
    position: absolute;
    top: 8%;
    left: 6%;
    width: 120px;
    animation: flagWave 4s ease-in-out infinite;
    filter: drop-shadow(0 6px 18px rgba(0,0,0,0.3));
}
@keyframes flagWave {
    0%,100% { transform: rotate(-3deg) scale(1); }
    50% { transform: rotate(3deg) scale(1.06); }
}

/* ============================================================
   响应式（手机端：菜品一行一个；时间 / 节日 / 农历各占一行）
   ============================================================ */
@media (max-width: 768px) {
    .clock { padding: 16px 18px; }
    .stage { padding: 20px 12px; gap: 18px; }
    .menu-body { max-width: 100%; }

    /* 菜品一行一个（列表式，不挤） */
    .group-grid { grid-template-columns: 1fr; gap: 12px; }
    .dish { padding: 16px 18px; }

    /* 时间 / 节日 / 农历 各占一行 */
    .clock-main {
        display: block;
        font-size: 15px;
        letter-spacing: 0.5px;
        line-height: 1.6;
        white-space: nowrap; /* 时间日期保持一行 */
    }
    .festival-tag {
        display: block !important;
        width: 100%;
        text-align: center;
        margin: 10px 0 0 0 !important;
        font-size: 18px;
        white-space: normal;
    }
    .clock-sub {
        display: block;
        margin-top: 8px;
        font-size: 14px;
        letter-spacing: 1px;
    }
}
