/**
 * Vue Mobile 样式文件
 * 移动端优化，兼容iOS 12及以上
 */

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #222222;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Vue应用容器 */
#app {
    min-height: 100vh;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 1rem;
}

/* 积分显示区域 - 紧凑型设计 */
.points-container {
    width: 100%;
    max-width: 1280px;
    padding: 15px 20px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: flex-start;
    -webkit-align-items: flex-start;
    align-items: flex-start;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    gap: 20px;
}

.points-main {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    gap: 15px;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.points-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: #667eea;
}

.points-label {
    font-size: 0.8rem;
    color: #ffffff;
    margin-top: 2px;
}

/* 积分区右侧文字 */
.points-text {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #ffffff;
    text-align: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}

.points-text-line {
    margin: 0;
    padding: 0;
}

/* 文本容器 - 一行一句的文字说明样式 */
.description {
    width: 100%;
    max-width: 1280px;
    padding: 15px;
    font-size: 0.85rem;
    line-height: 1.6;
}

.description-line {
    margin-bottom: 8px;
    padding-left: 8px;
    border-left: 3px solid #e1e5e9;
    color: #ffffff;
}

.description-line:last-child {
    margin-bottom: 0;
}

/* 视频容器 */
.video-container {
    width: 100%;
    max-width: 1280px;
    position: relative;
    padding-top: 56.25%;
    margin-bottom: 1.5rem;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    cursor: pointer;
    z-index: 2;
}

.play-button {
    width: 80px;
    height: 80px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-transition: background-color 0.3s;
    transition: background-color 0.3s;
}

.play-button:active {
    background-color: rgba(255, 255, 255, 0.3);
}

.play-button::after {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 20px 0 20px 30px;
    border-color: transparent transparent transparent #fff;
    margin-left: 8px;
}

video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

/* 按钮容器 */
.buttons-container {
    width: 100%;
    max-width: 1280px;
    padding: 0 1rem;
}

/* 操作按钮 */
.action-buttons {
    width: 100%;
    max-width: 1280px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    gap: 8px;
    padding: 15px;
    margin-bottom: 0;
}

.action-btn {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: 10px;
    font-size: 0.77rem;
    font-weight: normal;
    cursor: pointer;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 6px;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    color: #ffffff;
}

.action-btn:active {
    opacity: 0.8;
}

/* 分享按钮 */
.share-buttons {
    width: 100%;
    max-width: 1280px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    gap: 8px;
    padding: 0 15px 15px;
    margin-bottom: 0;
}

.share-btn {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: 10px;
    font-size: 0.77rem;
    font-weight: normal;
    cursor: pointer;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    gap: 6px;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    color: #ffffff;
}

.share-btn:active {
    opacity: 0.8;
}

/* 上传二维码按钮 */
.upload-qr-button {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    width: 100%;
    padding: 11px;
    text-align: center;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.77rem;
    font-weight: normal;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    cursor: pointer;
    margin-bottom: 8px;
    gap: 6px;
    background-color: rgba(247, 0, 82, 0.87);
}

.upload-qr-button:active {
    opacity: 0.8;
}

/* 数字按钮网格 */
.number-buttons-grid {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

/* 数字按钮默认样式 */
.number-button {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    background: #f8f9fa;
    border: none;
    border-radius: 10px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    text-decoration: none;
    color: #ffffff;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    font-size: 0.77rem;
    cursor: pointer;
    padding: 9px;
    text-align: center;
    line-height: 1.4;
}

/* 当数字按钮数量为4个时：一行4个正方形 */
.number-buttons-grid.count-4 {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-flex-wrap: nowrap;
    flex-wrap: nowrap;
}

.number-buttons-grid.count-4 .number-button {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    aspect-ratio: 1;
}

/* 当数字按钮数量不为4个时：长方形样式（类似上传按钮） */
.number-buttons-grid:not(.count-4) {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
}

.number-buttons-grid:not(.count-4) .number-button {
    width: 100%;
    padding: 11px;
    aspect-ratio: auto;
}

.number-button:active {
    opacity: 0.8;
}

/* 按钮容器 */
.buttons-container {
    width: 100%;
    max-width: 1280px;
    padding: 0 15px;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding: 15px;
}

.modal-content {
    background: rgba(40, 40, 40, 0.95);
    padding: 30px;
    border-radius: 20px;
    width: 360px;
    max-width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.modal-content h3 {
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 25px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
    margin: 5px;
}

.modal-btn:active {
    opacity: 0.8;
}

.modal-btn-success {
    background: #4CAF50;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.modal-btn-danger {
    background: #f44336;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.modal-btn-warning {
    background: #FF9800;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

/* 分享成功确认弹窗样式 - 上下分层结构 */
.share-success-modal {
    /* ⭐ 修改弹窗背景色的位置 */
    background: #ffffff !important;  /* 纯白背景 */
    padding: 0 !important;  /* 移除内边距，让内容完全贴合 */
    overflow: hidden;  /* 隐藏溢出，保持圆角效果 */
}

.share-success-message {
    /* ⭐ 修改文字大小的位置 */
    font-size: 15px;  /* 文字大小12px */
    color: #ffffff;  /* 深灰色文字 */
    padding: 25px 20px;  /* 增加上下内边距 */
    margin: 0;  /* 移除外边距 */
    line-height: 1;  /* 增加行高，让每行之间有足够间距 */
    white-space: pre-line;  /* 支持\n换行 */
    text-align: center;
    font-weight: 500;
    /* 移除背景色，让每行文字有独立背景 */
    background: transparent;
}

/* 每一行文字的独立背景色样式 */
.share-success-message::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* 为每一行添加独立背景 - 通过行内元素实现 */
.share-success-line {
    display: flex;  /* 使用flex布局 */
    align-items: center;  /* 垂直居中 */
    justify-content: flex-start;  /* 水平靠左 */
    /* ⭐ 修改每行文字背景色的位置 */
    background: #d14d4d;  /* 浅灰色背景 */
    /* ⭐ 修改内边距确保垂直居中 */
    padding: 10px 15px;  /* 上下左右对称的内边距 */
    margin: 4px 0;  /* 每行之间的间距 */
    border-radius: 6px;  /* 每行的圆角 */
    /* ⭐ 修改文字对齐方式的位置 */
    text-align: left;  /* 靠左对齐 */
    /* ⭐ 修改文字垂直居中的位置 */
    line-height: 1;  /* 行高设置为1.4 */
    min-height: 20px;  /* 最小高度 */
}

.share-success-btn {
    /* 确定按钮融入弹窗背景 */
    /* ⭐ 修改按钮背景色的位置 */
    background: #4CAF50 !important;  /* 绿色背景 */
    color: white;
    border: none;
    width: 100%;  /* 占满整个宽度 */
    padding: 18px 0;  /* 上下内边距 */
    font-size: 18px;  /* 按钮文字大小 */
    font-weight: 600;
    cursor: pointer;
    margin: 0;  /* 移除外边距 */
    border-radius: 0;  /* 移除圆角，融入弹窗 */
    box-shadow: none !important;  /* 移除阴影 */
    transition: opacity 0.3s ease;
}

.share-success-btn:active {
    opacity: 0.8;  /* 点击时的反馈效果 */
}

/* 图片预览 */
.image-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    margin: 15px auto;
}

/* 分享图片 */
.share-image {
    width: 100%;
    display: block;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* 二维码提示 */
.qrcode-tip {
    padding: 10px;
    margin: 15px 0 0 0;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    line-height: 1.4;
    border: 3px solid white;
    border-radius: 16px;
    -webkit-animation: colorChange 2s infinite;
    animation: colorChange 2s infinite;
}

@-webkit-keyframes colorChange {
    0% { color: #FF00FF; }
    50% { color: #800080; }
    100% { color: #FF00FF; }
}

@keyframes colorChange {
    0% { color: #FF00FF; }
    50% { color: #800080; }
    100% { color: #FF00FF; }
}

/* 加载动画 */
.loading-dots {
    display: inline-block;
}

.loading-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #2196F3;
    margin: 0 2px;
    -webkit-animation: loading 1.4s infinite ease-in-out both;
    animation: loading 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    -webkit-animation-delay: -0.32s;
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    -webkit-animation-delay: -0.16s;
    animation-delay: -0.16s;
}

@-webkit-keyframes loading {
    0%, 80%, 100% {
        -webkit-transform: scale(0);
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes loading {
    0%, 80%, 100% {
        -webkit-transform: scale(0);
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        -webkit-transform: scale(1);
        transform: scale(1);
        opacity: 1;
    }
}

/* 淡出动画 */
@-webkit-keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

/* 移动端适配 */
@media (max-width: 768px) {
    #app {
        padding: 0;
    }

    .video-container {
        margin-bottom: 8px;
        border-radius: 0;
    }

    .buttons-container {
        padding: 0 0.5rem;
    }

    .number-buttons-grid {
        gap: 8px;
        margin-bottom: 8px;
    }

    .upload-qr-button {
        height: 40px;
        font-size: 15px;
        margin-bottom: 8px;
        gap: 5px;
    }

    .number-button {
        font-size: 15px;
    }
    
    /* 移动端：4个按钮时保持正方形的最小高度 */
    .number-buttons-grid.count-4 .number-button {
        min-height: 48px;
    }
    
    /* 移动端：非4个按钮时使用固定高度 */
    .number-buttons-grid:not(.count-4) .number-button {
        min-height: 40px;
        height: 40px;
    }

    .action-btn,
    .share-btn {
        height: 40px;
        font-size: 15px;
    }

    .action-buttons,
    .share-buttons {
        padding: 0 0.5rem;
        gap: 8px;
        margin-bottom: 8px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 10px;
    }

    .modal-content h3 {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .image-preview {
        max-width: 150px;
        max-height: 150px;
    }
}

/* 大屏幕适配 */
@media (min-width: 1200px) {
    .number-button {
        font-size: 18px;
    }
    
    /* 大屏幕：4个按钮时保持正方形的最小高度 */
    .number-buttons-grid.count-4 .number-button {
        min-height: 70px;
    }
    
    /* 大屏幕：非4个按钮时使用固定高度 */
    .number-buttons-grid:not(.count-4) .number-button {
        min-height: 44px;
        height: 44px;
    }
}

/* 小屏幕适配 */
@media (max-width: 480px) {
    .number-button {
        font-size: 13px;
    }
    
    /* 小屏幕：4个按钮时保持正方形的最小高度 */
    .number-buttons-grid.count-4 .number-button {
        min-height: 44px;
    }
    
    /* 小屏幕：非4个按钮时使用固定高度 */
    .number-buttons-grid:not(.count-4) .number-button {
        min-height: 35px;
        height: 35px;
    }
}

/* 隐藏滚动条但保持滚动功能 */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Vue过渡动画 */
.fade-enter-active, .fade-leave-active {
    -webkit-transition: opacity 0.3s;
    transition: opacity 0.3s;
}

.fade-enter, .fade-leave-to {
    opacity: 0;
}

.slide-enter-active, .slide-leave-active {
    -webkit-transition: -webkit-transform 0.3s;
    transition: -webkit-transform 0.3s;
    transition: transform 0.3s;
    transition: transform 0.3s, -webkit-transform 0.3s;
}

.slide-enter, .slide-leave-to {
    -webkit-transform: translateY(100%);
    transform: translateY(100%);
}

/* 提示消息动画 */
@-webkit-keyframes messageSlideIn {
    0% {
        opacity: 0;
        -webkit-transform: translate(-50%, -50%) scale(0.9);
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 1;
        -webkit-transform: translate(-50%, -50%) scale(1);
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@-webkit-keyframes messageSlideOut {
    0% {
        opacity: 1;
        -webkit-transform: translate(-50%, -50%) scale(1);
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        -webkit-transform: translate(-50%, -50%) scale(0.95);
        transform: translate(-50%, -50%) scale(0.95);
    }
}

@keyframes messageSlideOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
}

/* 微信签到引导弹窗样式 */
.wechat-checkin-modal {
    max-width: 500px;
    padding: 35px 25px;
}

.wechat-checkin-modal h3 {
    text-align: center;
    font-weight: 600;
}

.checkin-steps {
    width: 100%;
    margin: 20px 0;
}

.checkin-step {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    align-items: flex-start;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.checkin-step:hover {
    background: rgba(255, 255, 255, 0.08);
    -webkit-transform: translateX(5px);
    transform: translateX(5px);
}

.checkin-step:last-child {
    margin-bottom: 0;
}

.step-number {
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    margin-right: 15px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.step-content {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
}

.step-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1.4;
}

.step-desc {
    font-size: 14px;
    color: #cccccc;
    margin-top: 5px;
    line-height: 1.5;
}

/* 小屏幕适配 */
@media (max-width: 480px) {
    .wechat-checkin-modal {
        padding: 25px 20px;
    }
    
    .wechat-checkin-modal h3 {
        font-size: 19px;
    }
    
    .checkin-step {
        padding: 15px;
        margin-bottom: 18px;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 18px;
        margin-right: 12px;
    }
    
    .step-title {
        font-size: 16px;
    }
    
    .step-desc {
        font-size: 13px;
    }
}
