/* 简化版样式 - 优化加载速度 */
:root {
    /* 动态主色调 - 将由JavaScript根据卡牌动态更新 */
    --primary-color: #667eea;
    --primary-light: #a8b8ff;
    --primary-dark: #3b4cb8;
    
    /* 新增天使主题变量 */
    --angel-primary: #667eea;
    --angel-secondary: #764ba2;
    --angel-accent: #4facfe;
    --angel-text: #ffffff;
    --angel-text-secondary: rgba(255, 255, 255, 0.8);
    --angel-text-accent: #ffd700;
    
    /* 中性色调 */
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-900: #171717;
    
    /* 动画曲线 - 简化版 */
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-ios: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* 动画时长 */
    --duration-normal: 250ms;
    --duration-slow: 350ms;
    --duration-slower: 500ms;
}

/* 全局重置 */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 基础样式 */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
    background: #ffffff;
    color: #171717;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    overflow-y: hidden;
    height: 100vh;
    /* 移动端兼容性增强 */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    /* iOS风格的丝滑滚动 */
    -webkit-overflow-scrolling: touch;
    /* 防止移动端缩放 */
    -ms-touch-action: manipulation;
    /* 优化移动端字体渲染 */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* 动态背景 - 优化版，支持天使主题 */
.dynamic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, var(--angel-primary) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--angel-secondary) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, var(--angel-accent) 0%, transparent 50%),
        linear-gradient(135deg, 
            var(--angel-primary) 0%, 
            var(--angel-secondary) 25%, 
            var(--angel-accent) 50%,
            var(--angel-primary) 75%,
            var(--angel-secondary) 100%);
    opacity: 0.85;
    transition: all 1.2s var(--ease-ios);
    z-index: -1;
    filter: blur(40px);
    will-change: background;
    transform: translateZ(0); /* 启用硬件加速 */
}

/* 主容器 */
.app-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 18px;
    gap: 14px;
}

/* 标题区域 */
.app-header {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
    animation: headerEntrance 1.2s var(--ease-spring) 0.3s forwards;
}

@keyframes headerEntrance {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-title {
    font-size: 2.6rem;
    font-weight: 750;
    background: linear-gradient(135deg, #ffffff, #f8faff, #f0f5ff, #e8f0ff, #f0f5ff, #f8faff, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 14px;
    text-shadow: 
        0 0 25px rgba(255, 255, 255, 0.85),
        0 0 18px rgba(240, 248, 255, 0.65),
        0 0 10px rgba(224, 240, 255, 0.45);
    letter-spacing: 1.5px;
    font-family: 'STXingkai', 'Kaiti', '楷体', 'SimSun', '宋体', serif;
    position: relative;
    padding: 10px 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transform: translateZ(0);
    will-change: transform;
}

.app-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ffffff, transparent);
    border-radius: 50%;
}

.angel-reminder {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 1);
    text-shadow: 
        0 0 15px rgba(255, 223, 0, 0.7),
        0 0 8px rgba(255, 255, 255, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUp 1.2s ease-out 0s forwards;
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 28px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 0 20px rgba(255, 215, 0, 0.1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载状态 */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    opacity: 1;
    transition: all var(--duration-slow) var(--ease-ios);
    z-index: 20;
}

.loading-state.hidden {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
    pointer-events: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    position: relative;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 215, 0, 0.8) 45deg,
        rgba(255, 215, 0, 0.4) 90deg,
        transparent 180deg
    );
    animation: spinSmooth 1.2s var(--ease-ios) infinite;
}

@keyframes spinSmooth {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: rgba(255, 255, 255, 0.95);
    font-size: 18px;
    font-weight: 600;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 卡牌容器 */
.card-container {
    perspective: 1200px;
    opacity: 0;
    transform: translateY(50px) scale(0.9);
    transition: all var(--duration-slower) var(--ease-spring);
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.card-container.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
/* 移除烟花特效画布样式，保持界面简洁 */

/* 移除复杂的光晕脉冲特效，保持简洁优雅的设计风格 */

/* 入场顺序：让卡牌比标题/页脚更晚出现 */
.card-container {
    transition-delay: 1s;
}

/* 天使卡牌 - 优化图像显示设计 */
.angel-card {
    position: relative;
    width: 100%;
    height: 500px;
    cursor: pointer;
    /* 适度圆角设计，确保显示更多图像内容 */
    border-radius: 16px;
    -webkit-border-radius: 16px;
    overflow: hidden;
    background: transparent;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 0 50px rgba(255, 215, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    outline: none;
    transition: 
        transform var(--duration-normal) var(--ease-ios),
        box-shadow var(--duration-normal) var(--ease-ios);
    margin: 0 auto;
    perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 移动端触摸优化 */
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.angel-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        0 0 80px rgba(255, 215, 0, 0.25);
}

.angel-card:hover {
    transform: translateY(-8px);
}

/* 卡牌翻转容器 - 优化3D翻转特效 */
.card-flip-container {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    /* 适度圆角设计 */
    border-radius: 16px;
    -webkit-border-radius: 16px;
    overflow: hidden;
}

.angel-card.flipped .card-flip-container {
    transform: rotateY(180deg);
}

/* 卡牌面 - 优化3D设计 */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* 适度圆角设计 */
    border-radius: 16px;
    -webkit-border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.2);
}

.card-front {
    z-index: 2;
    transform: rotateY(0deg);
    background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 100%);
}

/* 卡牌背面 - 恢复美丽的天使主题色调 */
.card-back {
    /* 恢复透明背景，展现天使主题色彩 */
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.8);
    /* 修复文字反向问题 - 让背面内容不参与3D变换 */
    transform: rotateY(180deg);
    z-index: 1;
    color: white;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    /* 与正面卡牌保持相同圆角 */
    border-radius: 16px;
    -webkit-border-radius: 16px;
    /* 强制显示调试 */
    opacity: 1 !important;
    visibility: visible !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 确保尺寸与正面完全匹配 */
    max-width: 100%;
    max-height: 100%;
    min-width: 100%;
    min-height: 100%;
    /* 恢复天使主题背景效果 */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* 让背面内容不参与3D变换，像印在卡牌上一样 */
.card-back-content {
    /* 保持文字正常方向（不再二次翻转） */
    transform: none;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* 改为顶部对齐 */
    align-items: center;
    text-align: center;
    gap: 6px; /* 减小间距 */
    padding: 20px 16px 20px 16px; /* 上下均匀内边距 */
    box-sizing: border-box;
    overflow: visible;
    background: transparent;
    border: none;
    position: relative;
    z-index: 2;
}

/* 清除卡牌背面装饰效果，保持简洁 */
.card-back::before,
.card-back::after {
    display: none;
}

/* 翻转时保障可见性：正面淡出、背面置前 */
.angel-card.flipped .card-front { opacity: 0; }
.angel-card.flipped .card-back { z-index: 10 !important; }

/* iOS 兼容：翻转期间保持背面内容方向正确 */
@supports (-webkit-touch-callout: none) {
    .card-back-content { -webkit-transform: none !important; transform: none !important; }
}

/* 天使翅膀动画样式（与 HTML 中 #angelWings 匹配） */
.angel-wings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    height: 220px;
    pointer-events: none;
    opacity: 0;
    z-index: 5;
}
.wing {
    position: absolute;
    top: 50%;
    width: 160px;
    height: 120px;
    background: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.95), rgba(255,255,255,0.6) 60%, rgba(255,255,255,0) 70%);
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.25));
    transform-origin: center;
    border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
}
.wing-left { left: 0; transform: translateY(-50%) rotate(-12deg); }
.wing-right { right: 0; transform: translateY(-50%) rotate(12deg); }
.angel-wings.animate {
    opacity: 1;
    animation: wingsFlyIn 1400ms var(--ease-spring) 200ms forwards;
}
@keyframes wingsFlyIn {
    0% { opacity: 0; transform: translate(-50%, -60%) scale(0.85); filter: blur(6px); }
    60% { opacity: 1; transform: translate(-50%, -50%) scale(1.02); filter: blur(0); }
    100% { opacity: 0; transform: translate(-50%, -45%) scale(0.96); filter: blur(2px); }
}

/* 隐藏的“重新抽牌”按钮：默认隐藏，显隐通过 .reveal */
.reshuffle-btn {
    margin-left: 8px;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.18);
    color: #fff;
    cursor: pointer;
    transition: opacity 300ms var(--ease-ios), transform 300ms var(--ease-ios);
    opacity: 0;
    transform: scale(0.95);
}
.reshuffle-btn.reveal { opacity: 1; transform: scale(1); }
.reshuffle-btn:hover { background: rgba(255,255,255,0.28); }
.reshuffle-btn:active { transform: scale(0.98); }

/* 天使名字容器 */
.angel-name-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 0 8px 0; /* 减小下边距 */
    padding: 0;
    flex-shrink: 0;
}

/* 中文名字样式 - 增强可读性 */
.angel-name-chinese {
    font-size: clamp(18px, 5vw, 26px);
    font-weight: 800;
    color: var(--angel-text);
    margin: 0;
    padding: 0;
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(255, 255, 255, 0.5);
    line-height: 1.1;
    letter-spacing: 0.8px;
    text-align: center;
    font-family: 'STXingkai', 'Kaiti', '楷体', 'SimSun', '宋体', serif;
}

/* 英文名字样式 - 拼音样式，增强可读性 */
.angel-name-english {
    font-size: clamp(10px, 2.5vw, 16px);
    font-weight: 600;
    color: var(--angel-text-secondary);
    margin: 4px 0 8px 0;
    padding: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    line-height: 1.2;
    letter-spacing: 0.5px;
    text-align: center;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
}



/* 天使消息容器 - 调整样式以适应透明背景 */
/* 天使消息容器 - 恢复优雅的半透明效果 */
.angel-message-container {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    -webkit-border-radius: 12px;
    padding: 16px 8px 16px 8px; /* 左右使用相同的8px内边距，确保间距一致 */
    margin: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 100%;
    box-sizing: border-box;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.angel-message {
    font-size: clamp(16px, 5.5vw, 20px); /* 进一步放大移动端字体可读性 */
    line-height: 1.5; /* 优化行高，提升可读性 */
    margin: 0;
    text-align: justify; /* 两端对齐，充分利用空间 */
    text-align-last: left; /* 最后一行左对齐，保持自然美感 */
    text-indent: 0; /* 显式移除首行缩进 */
    width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    font-weight: 500;
    color: var(--angel-text);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.flip-hint-front {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 卡牌图片 - 优化显示 */
.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* 适度圆角设计 */
    border-radius: 16px;
    -webkit-border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 与卡牌圆角同步 */
    border-radius: 16px;
    -webkit-border-radius: 16px;
    transform: scale(1);
    transition: transform 0.5s ease-out;
}

.angel-card:hover .card-image {
    transform: scale(1.1);
}

/* 底部版权 */
.app-footer {
    margin-top: 5px;
    padding: 16px 0;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    animation: footerFadeIn 1s var(--ease-ios) 0s forwards;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

@keyframes footerFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 天使链接指南 */
.angel-guide {
    text-align: center;
    margin-top: 12px;
    margin-bottom: 12px;
}

/* 天使风格分割线 */
.angelic-separator {
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    margin: 5px auto;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.guide-text {
    color: rgba(255, 255, 255, 1);
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.7px;
    text-align: center;
    line-height: 1.8;
}

.guide-steps {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.8;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    margin: 0 auto;
    letter-spacing: 0.5px;
    text-align: center;
}

.copyright {
    margin-top: 15px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    font-weight: 500;
    letter-spacing: 0.8px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    padding: 9px 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: inline-block;
}

/* 移动端优化：触摸交互和性能优化 */
@media (max-width: 768px) {
    .app-container {
        padding: 14px;
        gap: 8px; /* 减少间距，让内容更紧凑 */
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
        justify-content: flex-start;
    }
    
    .app-header {
        margin-top: 15px;
        margin-bottom: 5px;
        flex-shrink: 0;
    }
    
    .app-title {
        font-size: 1.9rem;
        margin-bottom: 8px;
        padding: 8px 14px;
        letter-spacing: 0.8px;
    }
    
    .angel-reminder {
        padding: 10px 20px;
        font-size: 0.9rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 1);
        text-shadow: 
            0 0 12px rgba(255, 223, 0, 0.6),
            0 0 6px rgba(255, 255, 255, 0.4),
            0 2px 6px rgba(0, 0, 0, 0.3);
        line-height: 1.4;
        max-width: 380px;
        white-space: normal;
        overflow: visible;
        text-overflow: initial;
        background: rgba(255, 255, 255, 0.15);
        border-radius: 22px;
        border: 1px solid rgba(255, 215, 0, 0.3);
        box-shadow: 
            0 6px 20px rgba(0, 0, 0, 0.12),
            0 0 0 1px rgba(255, 255, 255, 0.06),
            0 0 15px rgba(255, 215, 0, 0.1);
    }
    
    .card-container {
        margin: 5px 0 8px 0; /* 减少卡牌容器的上下间距 */
        flex-shrink: 0;
    }
    
    .angel-card {
        height: 45vh;
        height: calc(var(--vh, 1vh) * 45);
        max-height: 420px;
        min-height: 300px;
        border-radius: 20px;
        -webkit-border-radius: 20px;
        overflow: hidden;
        background: transparent;
        box-shadow: 
            0 15px 30px rgba(0, 0, 0, 0.2),
            0 0 0 1px rgba(255, 255, 255, 0.1),
            0 0 30px rgba(255, 215, 0, 0.15);
        border: 2px solid rgba(255, 255, 255, 0.2);
        /* 移动端触摸优化 */
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* 移动端底部内容紧贴卡牌 */
    .app-footer {
        margin-top: 12px !important; /* 大幅减少上边距 */
        padding: 8px 0 16px 0 !important; /* 减少内边距 */
        flex-shrink: 0;
        gap: 6px !important; /* 减少内部间距 */
        text-align: center;
    }
    
    .angel-guide {
        margin-top: 0 !important;
        margin-bottom: 8px !important; /* 减少下边距 */
    }
    
    .guide-text {
        font-size: 1.4rem !important; /* 稍微缩小字体 */
        margin-bottom: 4px !important; /* 减少下边距 */
        text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
        text-align: center;
        line-height: 1.2 !important;
    }
    
    .guide-steps {
        font-size: 1.2rem !important; /* 稍微缩小字体 */
        max-width: 420px;
        line-height: 1.4 !important;
        margin-top: 0 !important; /* 移除上边距 */
        text-align: center;
    }
    
    .copyright {
        font-size: 12px !important; /* 缩小版权文字 */
        padding: 6px 12px !important; /* 减少内边距 */
        margin-top: 4px !important; /* 减少上边距 */
    }
    
    .angel-name {
        font-size: 1.35rem;
        font-weight: 650;
        letter-spacing: 0.25px;
        line-height: 1.1;
        margin-bottom: 6px;
    }
    
    
    .card-back-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        padding: 12px 8px 10px 8px !important; /* 左右使用相同的8px内边距，确保间距一致 */
        gap: 6px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        align-items: center !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important; /* 顶部对齐 */
    }
    
    .angel-name-container {
        margin-bottom: 8px;
    }
    
    .angel-name-chinese {
        font-size: clamp(14px, 4vw, 22px) !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .angel-name-english {
        font-size: clamp(10px, 2.2vw, 14px) !important;
        margin: 2px 0 0 0 !important;
    }
    
    
    .angel-message-container {
        background: rgba(255, 255, 255, 0.2) !important;
        border-radius: 12px !important;
        -webkit-border-radius: 12px !important;
        padding: 14px 8px 16px 8px !important; /* 左右使用相同的8px内边距，确保间距一致 */
        margin: 0 !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        flex: 1 !important;
        width: 100% !important;
        min-height: 0 !important;
        overflow: auto !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
    }
    
    
    .angel-message {
        font-size: clamp(15px, 4.2vw, 18px) !important;
        line-height: 1.6 !important; /* 增加行高 */
        font-weight: 500 !important;
        text-align: justify !important; /* 两端对齐，充分利用空间 */
        text-align-last: left !important; /* 最后一行左对齐，保持自然美感 */
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
        padding: 2px 0px !important; /* 移除左右内边距 */
        color: rgba(255, 255, 255, 0.95) !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        -webkit-hyphens: auto !important;
        margin: 0 !important;
    }
}

/* 深度移动端优化 - 增强版本 */
.mobile-optimized {
    /* 移动端专用字体优化 */
    font-size: 14px;
    line-height: 1.5;
    /* 移动端性能优化 */
    will-change: scroll-position;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.mobile-optimized .app-container {
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    padding: 10px;
    gap: 6px; /* 恢复元素之间的间距 */
    justify-content: flex-start;
    display: flex;
    flex-direction: column;
}

.mobile-optimized .app-header {
    margin-top: 20px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.mobile-optimized .app-title {
    font-size: 1.7rem;
    margin-bottom: 7px;
    padding: 5px 10px;
    line-height: 1.15;
    letter-spacing: 0.7px;
}

.mobile-optimized .angel-reminder {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 1);
    text-shadow: 
        0 0 12px rgba(255, 223, 0, 0.6),
        0 0 6px rgba(255, 255, 255, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
    line-height: 1.4;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 22px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 0 15px rgba(255, 215, 0, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-optimized .card-container {
    width: 94%;
    max-width: 94vw;
    margin: 2px 0 2px 0; /* 恢复卡牌容器的底部边距 */
    flex-shrink: 0;
}

.mobile-optimized .angel-card {
    height: 45vh;
    height: calc(var(--vh, 1vh) * 45);
    max-height: 420px;
    /* 恢复圆润圆角 */
    border-radius: 20px;
    -webkit-border-radius: 20px;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    border: none;
}

.mobile-optimized .card-face {
    /* 恢复圆润圆角 */
    border-radius: 20px;
    -webkit-border-radius: 20px;
}

.mobile-optimized .card-image-wrapper {
    /* 恢复圆润圆角 */
    border-radius: 20px;
    -webkit-border-radius: 20px;
    padding: 0;
}

.mobile-optimized .card-image {
    max-width: 100%;
    max-height: 100%;
    /* 恢复圆润圆角 */
    border-radius: 20px; /* 与移动端卡牌圆角保持一致 */
    -webkit-border-radius: 20px;
}

.mobile-optimized .guide-text {
    font-size: 1.6rem;
    margin-bottom: 6px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.mobile-optimized .guide-steps {
    font-size: 1.35rem;
    max-width: 420px;
    line-height: 1.5;
    margin-top: 4px;
    text-align: center;
}

.mobile-optimized .card-back-content {
    /* 移动端：方向保持正常并与正面同尺寸观感 */
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    padding: 12px 2px 10px 2px !important; /* 进一步减少左右内边距：从4px改为2px，为文字腾出更多空间 */
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important; /* 顶部对齐 */
    align-items: center !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    gap: 4px !important; /* 减少组件间距 */
    text-align: center !important;
    /* 完全移除背景和边框，与正面保持一致 */
    background: transparent !important;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* 移动端：让卡背内框与正面观感一致（半径与内缩匹配） */
.mobile-optimized .card-back::before {
    /* 与卡牌外缘严格一致，确保翻转后轮廓完全重合 */
    inset: 0;
    border-radius: inherit;
    -webkit-border-radius: inherit;
    /* 确保伪元素不会增加卡牌尺寸 */
    pointer-events: none;
    box-shadow: none;
    background: transparent;
}

/* 全局规则：确保所有天使信息文字都没有首行缩进，并采用两端对齐 */
.angel-message,
.mobile-optimized .angel-message,
.angel-message.extra-long-text {
    text-indent: 0 !important;
    text-align: justify !important; /* 两端对齐，充分利用空间 */
    text-align-last: left !important; /* 最后一行左对齐，保持自然美感 */
}

/* 天使信息容器移动端优化 - 左右间距一致版 */
.mobile-optimized .angel-message-container {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 8px 8px !important; /* 左右使用相同的8px内边距，确保间距一致 */
    margin: 0 !important;
    box-sizing: border-box !important;
    background: rgba(255, 255, 255, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 12px !important;
    -webkit-border-radius: 12px !important;
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    display: block !important;
    align-items: normal !important;
    justify-content: normal !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    /* 容器查询支持 */
    container-type: size;
    container-name: angel-message;
}

/* 天使信息文字移动端优化 - 两端对齐版 */
.mobile-optimized .angel-message {
    font-size: clamp(17px, 6vw, 22px) !important; /* 用户要求进一步放大：17px起，最大22px */
    line-height: 1.5 !important; /* 优化行高 */
    width: 100% !important;
    text-align: justify !important; /* 两端对齐，充分利用空间 */
    text-align-last: left !important; /* 最后一行左对齐，保持自然美感 */
    text-indent: 0 !important; /* 显式移除首行缩进 */
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    hyphens: auto !important;
    -webkit-hyphens: auto !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
    padding: 2px 0px !important; /* 移除左右内边距 */
    margin: 0 !important;
}

/* 容器查询支持：基于卡牌容器尺寸的真正自适应字体 */
@supports (font-size: 1cqw) {
    .mobile-optimized .angel-message {
        font-size: clamp(17px, 7.2cqw, 22px) !important; /* 放大容器查询字体 */
        line-height: clamp(1.3, calc(5cqw + 0.2), 1.6) !important;
        text-align: justify !important; /* 两端对齐 */
        text-align-last: left !important; /* 最后一行左对齐 */
    }
}

/* 降级方案：不支持容器查询的浏览器 */
@supports not (font-size: 1cqw) {
    .mobile-optimized .angel-message {
        font-size: clamp(17px, 5.8vw, 22px) !important; /* 放大降级方案字体 */
        line-height: 1.5 !important;
        text-align: justify !important; /* 两端对齐 */
        text-align-last: left !important; /* 最后一行左对齐 */
    }
}

.mobile-optimized .angel-name-container {
    margin-bottom: 4px !important; /* 减少下边距，缩短与文字内容的距离 */
    flex-shrink: 0 !important;
}

/* 移除复杂的三次翻转动画，保持简洁的翻转效果 */

.mobile-optimized .angel-name-chinese {
    font-size: clamp(18px, 5vw, 24px) !important;
    font-weight: 800 !important;
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.7),
        0 0 15px rgba(255, 255, 255, 0.6) !important;
    color: var(--angel-text) !important;
    letter-spacing: 0.8px !important;
}

.mobile-optimized .angel-name-english {
    font-size: clamp(12px, 3vw, 16px) !important;
    font-weight: 600 !important;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
    color: var(--angel-text-secondary) !important;
    letter-spacing: 0.5px !important;
}

.mobile-optimized .action-guide-title {
    font-size: clamp(16px, 4.5vw, 22px) !important;
    font-weight: 800 !important;
    margin: 8px 0 6px 0 !important;
    color: var(--angel-text-accent) !important;
    text-shadow: 
        0 0 20px rgba(255, 223, 0, 0.9),
        0 2px 8px rgba(0, 0, 0, 0.7),
        0 0 4px rgba(255, 223, 0, 1) !important;
    letter-spacing: 0.5px !important;
    text-align: center !important;
    line-height: 1.2 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

html.mobile-optimized .angel-name-english {
    font-size: 0.85rem !important;
    margin: 4px 0 8px 0 !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    letter-spacing: 0.3px !important;
    flex-shrink: 0 !important;
}



html.mobile-optimized .angel-message-container {
    padding: 12px !important;
    margin: 2px 0 0 0 !important;
    /* 完全移除边框和背景 */
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex: 1 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
}

.mobile-optimized .angel-message {
    font-size: clamp(17px, 6vw, 22px); /* 基础样式也同步放大 */
    line-height: 1.5;
    width: 100%;
    text-indent: 0; /* 显式移除首行缩进 */
    overflow: hidden;
    word-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    text-align: left;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.98);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.mobile-optimized .app-footer {
    margin-top: 0px !important; /* 移除顶部边距 */
    padding: 0px 0 12px 0 !important; /* 减小顶部内边距 */
    flex-shrink: 0;
    gap: 4px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mobile-optimized .guide-text {
    font-size: 1.3rem !important; /* 进一步缩小 */
    font-weight: 600;
    margin-bottom: 3px !important;
    text-shadow: 
        0 0 10px rgba(255, 223, 0, 0.7),
        0 1px 4px rgba(0, 0, 0, 0.4);
    line-height: 1.2 !important;
}

.mobile-optimized .guide-steps {
    font-size: 1.1rem !important; /* 进一步缩小 */
    max-width: 380px;
    line-height: 1.3 !important;
    margin: 0 !important;
}

.mobile-optimized .copyright {
    font-size: 11px !important; /* 进一步缩小 */
    padding: 5px 10px !important;
    letter-spacing: 0.4px !important;
    margin-top: 3px !important;
}

/* 移动设备触摸优化 - 恢复3D翻转特效 */
@media (max-width: 768px) and (hover: none) {
    .app-container {
        gap: 3px !important; /* 进一步压缩间距，为文字腾出空间 */
        padding: 10px 12px !important; /* 减少容器边距 */
    }
    
    .angel-card {
        /* 恢复圆润圆角 */
        border-radius: 22px !important;
        -webkit-border-radius: 22px !important;
        overflow: hidden !important;
        /* 启用硬件加速的3D变换 */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        will-change: transform;
        /* 卡牌高度根据屏幕高度动态调整 */
        height: calc(85vh - 200px);
        /* 限制最小高度 */
        min-height: 400px;
        /* 最大高度 - 避免在大屏幕上过高 */
        max-height: 550px;
        width: 90vw;
        max-width: 280px;
        /* 强制统一尺寸 */
        box-sizing: border-box !important;
        margin-bottom: 8px !important; /* 减少卡牌下边距 */
    }

    /* 确保正面和背面完全匹配 - 移动端 */
    .card-front,
    .card-back {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-width: 100% !important;
        min-height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        box-sizing: border-box !important;
    }

    /* 增强移动端文字可读性 */
    .angel-message {
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
        padding: 4px !important;
        line-height: 1.45 !important;
    }
    
    .card-flip-container {
        /* 移动端3D变换优化 */
        -webkit-transform-style: preserve-3d !important;
        transform-style: preserve-3d !important;
        -webkit-perspective: 1000px;
        perspective: 1000px;
    }
    
    .card-face {
        /* 恢复圆润圆角 */
        border-radius: 22px !important;
        -webkit-border-radius: 22px !important;
        /* 移动端硬件加速 */
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
    }
    
    .card-image-wrapper {
        /* 恢复圆润圆角 */
        border-radius: 22px !important;
        -webkit-border-radius: 22px !important;
    }
    
    .card-image {
        /* 恢复圆润圆角 */
        border-radius: 20px !important;
        -webkit-border-radius: 20px !important;
    }
}

/* 强制可见性确保 - 卡牌背面内容显示保障 */
.card-back,
.card-back-content,
.angel-name,
.angel-message-container,
.angel-message {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    color: rgba(255, 255, 255, 1) !important;
}

.card-back {
    display: flex !important;
}

.card-back-content {
    display: flex !important;
    flex-direction: column !important;
}

.angel-message-container {
    display: flex !important;
}

.angel-name,
.action-guide-title,
.angel-message {
    display: block !important;
}

/* 强化强制可见性规则 - 确保背面内容在任何情况下都不透明 */
.card-back-content,
.angel-name,
.angel-message-container,
.angel-message {
    opacity: 1 !important;
    visibility: visible !important;
    color: rgba(255, 255, 255, 1) !important;
    display: block !important;
}

.card-back-content {
    display: flex !important;
    flex-direction: column !important;
}

.angel-message-container {
    display: flex !important;
}

.action-guide-title {
    color: rgba(255, 223, 0, 1) !important;
    display: block !important;
}

/* 3D翻转状态下的背面内容显示保障 */
.angel-card.flipped .card-back {
    /* 在3D翻转后确保背面内容可见 */
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    z-index: 100 !important;
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
}

.angel-card.flipped .card-back-content,
.angel-card.flipped .angel-name,
.angel-card.flipped .action-guide-title,
.angel-card.flipped .angel-message-container,
.angel-card.flipped .angel-message {
    opacity: 1 !important;
    visibility: visible !important;
    color: rgba(255, 255, 255, 1) !important;
    z-index: 200 !important;
    display: inherit !important;
}

.angel-card.flipped .action-guide-title {
    color: rgba(255, 223, 0, 1) !important;
}

.angel-card.flipped .card-back-content {
    display: flex !important;
    flex-direction: column !important;
}

.angel-card.flipped .angel-message-container {
    display: flex !important;
}

/* iOS设备特殊优化 - 确保3D翻转正常工作 */
@supports (-webkit-touch-callout: none) {
    .angel-card {
        -webkit-transform-style: preserve-3d;
        transform-style: preserve-3d;
    }
    
    .card-flip-container {
        -webkit-transform-style: preserve-3d !important;
        transform-style: preserve-3d !important;
        -webkit-perspective: 1000px;
        perspective: 1000px;
    }
    
    .card-face {
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
        -webkit-transform: translateZ(0.1px);
        transform: translateZ(0.1px);
    }
    
    .card-back {
        -webkit-transform: rotateY(180deg) translateZ(0.1px);
        transform: rotateY(180deg) translateZ(0.1px);
        width: 100% !important;
        height: 100% !important;
    }
    
    /* iOS设备的背面内容反向修复 - 移除额外旋转 */
    .card-back-content {
        -webkit-transform: none !important;
        transform: none !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 12px !important;
        box-sizing: border-box !important;
    }
    
    /* iOS翻转状态下的特殊处理 */
    .angel-card.flipped .card-flip-container {
        -webkit-transform: rotateY(180deg);
        transform: rotateY(180deg);
    }
    
    .angel-card.flipped .card-back {
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 10 !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    .angel-card.flipped .card-back-content,
    .angel-card.flipped .angel-name,
    .angel-card.flipped .action-guide-title,
    .angel-card.flipped .angel-message {
        opacity: 1 !important;
        visibility: visible !important;
        color: rgba(255, 255, 255, 1) !important;
    }
    
    /* iOS设备：确保伪元素不会增加卡牌尺寸 */
    .card-back::before {
        -webkit-box-shadow: none !important;
        box-shadow: none !important;
        background: transparent !important;
        inset: 0 !important;
        border-radius: inherit !important;
        -webkit-border-radius: inherit !important;
    }
}

/* 移动端特殊处理 */
.mobile-optimized .angel-card.flipped .card-back,
.mobile-optimized .angel-card.flipped .card-back-content,
.mobile-optimized .angel-card.flipped .angel-name,
.mobile-optimized .angel-card.flipped .action-guide-title,
.mobile-optimized .angel-card.flipped .angel-message-container,
.mobile-optimized .angel-card.flipped .angel-message {
    opacity: 1 !important;
    visibility: visible !important;
    display: inherit !important;
    z-index: 300 !important;
    color: rgba(255, 255, 255, 1) !important;
}

/* 超级强制显示规则 - 用于调试 */
.card-back * {
    opacity: 1 !important;
    visibility: visible !important;
    color: rgba(255, 255, 255, 1) !important;
}

.angel-card.flipped .card-back * {
    opacity: 1 !important;
    visibility: visible !important;
    color: rgba(255, 255, 255, 1) !important;
    z-index: 999 !important;
}

.angel-card.flipped .action-guide-title {
    color: rgba(255, 223, 0, 1) !important;
}

/* 继续强制显示 */
.angel-card.flipped {
    pointer-events: auto !important;
}

.angel-card.flipped .card-back {
    pointer-events: auto !important;
    /* 保持背面的正常变换，不强制修改 */
}

/* 强制移动端布局规则 - 最高优先级 */
@media screen and (max-width: 768px) {
    .angel-name-english {
        margin: 4px 0 8px 0 !important;
    }
    
    .action-guide-title {
        margin: 4px 0 4px 0 !important;
    }
    
    .angel-message-container {
        margin: 2px 0 0 0 !important;
    }
}

/* 移动设备触摸检测 */
@media (pointer: coarse) {
    .angel-name-english {
        margin: 4px 0 8px 0 !important;
    }
    
    .action-guide-title {
        margin: 4px 0 4px 0 !important;
    }
    
    .angel-message-container {
        margin: 2px 0 0 0 !important;
    }
}

/* 超长文字特别优化 - 最大化字体可读性 */
.mobile-optimized .angel-message.extra-long-text {
    font-size: clamp(16px, 5.8vw, 20px) !important;
    line-height: 1.35 !important; /* 略微减少行高以节省空间 */
    text-indent: 0 !important; /* 确保移除首行缩进 */
    padding: 1px !important; /* 最小化内边距 */
}

/* 特别长的文字（Zadkiel1, Chamuel2, Jophiel3, Haniel3等）专用样式 */
.mobile-optimized .angel-message.very-long-text {
    font-size: clamp(13px, 4.2vw, 17px) !important; /* 进一步缩小以确保完整显示 */
    line-height: 1.3 !important; /* 更紧凑的行高 */
    text-indent: 0 !important;
    padding: 0 !important; /* 移除所有内边距 */
    word-spacing: -0.5px !important; /* 缩小单词间距 */
    letter-spacing: -0.2px !important; /* 缩小字母间距 */
}

/* 特别长文字的容器优化 */
.mobile-optimized .angel-message-container.very-long-container {
    padding: 4px 3px !important; /* 最小化容器内边距 */
    margin: -3px 0 0 0 !important; /* 进一步向上调整位置 */
}

/* 超长文字的容器优化 */
.mobile-optimized .angel-message-container.extra-long-container {
    padding: 6px 4px !important; /* 最小化容器内边距 */
    margin: -2px 0 0 0 !important; /* 微调位置 */
}