/* ============================================================
    翻卡对比样式（swiper.css）
   第6屏核心交互：前后对比翻翻看（3组翻卡，左右滑动或点击翻转）
   ============================================================ */

/* ---------- 翻卡堆叠容器 ---------- */
.flip-stack {
    position: relative;
    z-index: 2;
    width: 92vw;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 6px 4px 10px;
}

/* ---------- 单张翻卡 ---------- */
.flip-card {
    position: relative;
    width: 100%;
    height: 132px;
    perspective: 900px;
    touch-action: pan-y;
    cursor: pointer;
}
.flip-card-inner {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 0.65s var(--ease-out);
}
.flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }

/* 翻卡两面（过去/现在） */
.flip-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    box-shadow: var(--shadow-note);
    background: var(--c-linen);
}
.flip-face.past-face { transform: rotateY(0); }
.flip-face.now-face { transform: rotateY(180deg); }

/* 面内图片区 */
.flip-face-img {
    flex: 0 0 42%;
    background-size: cover;
    background-position: center;
    position: relative;
    filter: sepia(0.4) saturate(0.85) brightness(0.95);
    border-right: 1.5px dashed rgba(139, 107, 74, 0.3);
}
.now-face .flip-face-img {
    filter: saturate(1.05) brightness(1.02);
    border-right: none;
    border-left: 1.5px dashed rgba(107, 158, 107, 0.4);
}

/* 面内文字区 */
.flip-face-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 12px 14px;
}
.flip-tag {
    display: inline-block;
    align-self: flex-start;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-family: var(--font-hand);
    letter-spacing: 2px;
}
.past-face .flip-tag { background: rgba(212, 197, 169, 0.6); color: #7A6144; border: 1px dashed rgba(139, 107, 74, 0.5); }
.now-face .flip-tag { background: rgba(107, 158, 107, 0.18); color: var(--c-green); border: 1px solid rgba(107, 158, 107, 0.55); }
.flip-text { font-size: 15px; font-weight: 700; color: var(--c-dark); font-family: var(--font-hand); line-height: 1.5; }
.flip-desc { font-size: 12px; color: var(--c-brown); line-height: 1.5; }

/* ---------- 卡片标题（左侧竖排小标签） ---------- */
.flip-card-title {
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left center;
    background: var(--c-gold);
    color: #fff;
    font-size: 13px;
    font-family: var(--font-hand);
    letter-spacing: 3px;
    padding: 6px 14px;
    border-radius: 999px;
    z-index: 5;
    box-shadow: var(--shadow-soft);
    white-space: nowrap;
    pointer-events: none;
}

/* ---------- 翻卡时的胶带装饰 ---------- */
.flip-card::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 54px;
    height: 16px;
    background: rgba(232, 184, 75, 0.5);
    box-shadow: 0 1px 4px rgba(90, 62, 40, 0.15);
    z-index: 6;
    pointer-events: none;
}

/* ---------- 提示小箭头（翻卡方向） ---------- */
.flip-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    color: rgba(139, 107, 74, 0.6);
    z-index: 4;
    pointer-events: none;
    animation: floatX 2s ease-in-out infinite;
}
.flip-arrow svg { width: 100%; height: 100%; }

/* ---------- 翻卡进入视口的动画 ---------- */
.flip-card.enter { animation: cardEnter 0.7s var(--ease-bounce) both; }
.flip-card.enter:nth-child(1) { animation-delay: 0.1s; }
.flip-card.enter:nth-child(2) { animation-delay: 0.25s; }
.flip-card.enter:nth-child(3) { animation-delay: 0.4s; }
@keyframes cardEnter {
    from { opacity: 0; transform: translateY(34px) rotate(-2deg) scale(0.92); }
    to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

/* ---------- 翻转过程中的光影 ---------- */
.flip-card-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(253, 246, 227, 0), rgba(253, 246, 227, 0.35), rgba(253, 246, 227, 0));
    opacity: 0;
    transition: opacity 0.4s;
}
.flip-card.flipping .flip-card-inner::after { opacity: 1; }

/* 不支持 3D 变换时的降级（仅点击切换内容） */
@supports not (transform-style: preserve-3d) {
    .flip-face.now-face { transform: none; opacity: 0; transition: opacity 0.3s; }
    .flip-card.flipped .flip-face.past-face { opacity: 0; }
    .flip-card.flipped .flip-face.now-face { opacity: 1; }
}

/* 宽屏适配 */
@media (min-width: 600px) {
    .flip-stack { max-width: 460px; }
    .flip-card { height: 150px; }
}
