/* ===========================
   全局样式和CSS变量
   =========================== */
:root {
    --primary-color: #58CC02;
    --secondary-color: #1CB0F6;
    --danger-color: #FF4B4B;
    --text-dark: #2D3748;
    --text-gray: #718096;
    --bg-light: #F7FAFC;
    --bg-dark: #010435;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Segoe UI', 'Nunito', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: white;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    text-align: center;
}

img {
    display: block;
    margin: 0 auto;
}

/* ===========================
   语言切换按钮组
   =========================== */
.lang-switcher {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.lang-btn {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lang-btn:active {
    transform: translateY(0);
}

/* 当前选中的语言按钮 */
.lang-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(88, 204, 2, 0.4);
}

.lang-btn.active:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(88, 204, 2, 0.5);
}

/* ===========================
   主内容容器
   =========================== */
.content {
    display: flex;
    justify-content: center;
    align-items: center;
    align-content: center;
    flex-wrap: wrap;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
}

/* ===========================
   Logo和图标 - 带浮动效果
   =========================== */
.logo {
    width: 200px;
    height: 84px;
    margin-bottom: 30px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.icon {
    width: 350px;
    height: 250px;
    margin-bottom: 30px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ===========================
   标题和文本
   =========================== */
.test {
    font-family: Nunito, system-ui, sans-serif;
    font-weight: 700;
    color: #fff;
    font-size: 32px;
    line-height: 45px;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===========================
   主按钮 - 带脉动效果
   =========================== */
.btn {
    animation: subtle-pulse 2s ease-in-out infinite;
    color: var(--bg-dark);
    transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    background: #fff;
    padding: 15px 65px;
    border-radius: 60px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    line-height: 26px;
    border: none;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(255, 255, 255, 0.4);
}

@keyframes subtle-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes pulse-scale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

/* ===========================
   弹窗容器
   =========================== */
.joinWrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9998;
}

.joinWrap .joinBox {
    position: relative;
    z-index: 9999;
    border-radius: 12px;
    background: #fff;
    padding: 30px;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.joinWrap .joinBox .title {
    color: var(--secondary-color);
    font-size: 20px;
    line-height: 28px;
    margin-bottom: 30px;
    font-weight: 700;
}

/* ===========================
   教程按钮
   =========================== */
.joinWrap .joinBox .videoTest {
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 24px;
    border: 4px solid var(--secondary-color);
    padding: 16px;
    border-radius: 24px;
    background: rgb(239 246 255);
    animation: pulse-scale 2.5s ease-in-out infinite;
    cursor: pointer;
    transition: var(--transition);
}

.joinWrap .joinBox .videoTest:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(28, 176, 246, 0.3);
}

/* ===========================
   输入框
   =========================== */
.joinWrap .joinBox .input {
    border: 2px solid rgb(209 213 219);
    padding: 16px 24px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 16px;
    font-size: 18px;
    line-height: 28px;
    text-align: left;
    margin-bottom: 24px;
    transition: var(--transition);
    color: var(--text-dark);
}

input::placeholder {
    opacity: 1;
    color: #9ca3af;
}

input:focus {
    outline: 2px solid var(--secondary-color);
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(28, 176, 246, 0.2);
}

/* ===========================
   提交按钮
   =========================== */
.save {
    background: var(--secondary-color);
    color: #fff;
    font-size: 20px;
    line-height: 28px;
    font-weight: 700;
    transition-duration: .3s;
    transition-property: all;
    transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    cursor: pointer;
    padding: 20px 24px;
    border-radius: 16px;
    margin-bottom: 16px;
    border: none;
    width: 100%;
}

.save:hover:not(:disabled) {
    transform: scale(1.05);
    background: #1890D6;
}

.save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===========================
   提示信息
   =========================== */
.prm {
    color: rgb(239 68 68);
    font-size: 16px;
    line-height: 24px;
    padding: 16px;
    background: rgb(254 242 242);
    text-align: left;
    border-radius: 12px;
    margin-bottom: 16px;
}

.alert-banner {
    position: fixed !important;
    top: 0;
    left: 0;
    z-index: 10000;
    width: 100%;
    background: var(--danger-color);
    color: white;
    padding: 12px 20px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===========================
   图文教程弹窗
   =========================== */
.tutorialWrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 10000;
}

/* 通用教程容器 */
.tutorialBox {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 9999;
    height: 100%;
    display: flex;
    justify-content: center;
    align-content: center;
    align-items: center;
}

.tutorial-section {
    margin-top: 0 !important;
    max-height: 90vh;
    overflow-y: scroll;
    background: white;
    border-radius: 20px;
    padding: 30px;
    color: var(--text-dark);
}

.tutorial-section h2 {
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 1.5rem;
}

.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.tutorial-step {
    text-align: center;
}

.tutorial-step p {
    font-weight: 700;
    margin-bottom: 1rem;
}

.tutorial-image {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    margin: 1rem auto;
}

.tutorial-image:hover {
    transform: scale(1.02);
}

/* ===========================
   视频弹窗（参考海洋哥成功版本 + Edge兼容性）
   =========================== */
.tutorialBox video {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    position: relative;
    z-index: 10000;
    display: block;
    object-fit: contain;
    background-color: #000;
    /* Edge浏览器兼容性 */
    -ms-object-fit: contain;
    outline: none;
}

/* 确保视频控制条在Edge中正常显示 */
.tutorialBox video::-webkit-media-controls {
    display: flex !important;
}

.tutorialBox video::-webkit-media-controls-panel {
    display: flex !important;
}

/* 视频关闭按钮 */
.video-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    line-height: 1;
}

.video-close-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.video-close-btn:active {
    transform: scale(0.95);
}

/* ===========================
   通用弹窗样式
   =========================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 10000;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    color: var(--text-dark);
    z-index: 10002;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal .bg {
    z-index: 10001;
}

.modal-content h3 {
    color: var(--secondary-color);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
}

.modal-content p {
    color: var(--text-gray);
    white-space: pre-wrap;
    text-align: center;
    line-height: 1.6;
}

/* 弹窗内容文本居中，高亮框也居中但允许换行 */
.modal-content p .membership-type-highlight,
.modal-content p .membership-expiry-highlight {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 95%;
    width: fit-content;
}

/* 移动端优化 - 确保小屏幕上也能正常显示 */
@media (max-width: 480px) {
    .membership-type-highlight {
        font-size: 1em;
        padding: 8px 12px;
        max-width: 95%;
    }
    
    .membership-expiry-highlight {
        font-size: 0.95em;
        padding: 10px 14px;
        max-width: 95%;
    }
}

/* ===========================
   加载动画
   =========================== */
.loader {
    width: 48px;
    height: 48px;
    border: 3px solid #EEE;
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===========================
   微信客服按钮
   =========================== */
.wechat-service {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9000;
}

.wechat-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(88, 204, 2, 0.4);
    animation: pulse-glow 2s ease-in-out infinite;
    border: none;
}

.wechat-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(88, 204, 2, 0.6);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(88, 204, 2, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(88, 204, 2, 0.6);
    }
}

/* ===========================
   微信弹窗内容
   =========================== */
.wechat-content {
    text-align: center;
}

.wechat-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.wechat-icon {
    font-size: 32px;
}

.wechat-header h3 {
    color: var(--text-dark);
    font-size: 22px;
    font-weight: 700;
}

.wechat-hint {
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 15px;
}

.wechat-id {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    padding: 12px;
    background: rgba(88, 204, 2, 0.1);
    border-radius: 12px;
    margin-bottom: 20px;
}

.qr-code {
    margin-bottom: 20px;
}

.qr-code img {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-wechat-close {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--text-gray);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-wechat-close:hover {
    background: var(--text-dark);
}

/* ===========================
   滚动条美化
   =========================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(88, 204, 2, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(88, 204, 2, 0.7);
}

/* ===========================
   会员类型高亮样式（老模板特效）
   =========================== */
.membership-type-highlight {
    color: #FF3030;
    font-size: 1.2em;
    font-weight: 700;
    text-align: center;
    margin: 1rem auto;
    text-shadow: 0 1px 2px rgba(255, 48, 48, 0.3);
    background: linear-gradient(135deg, #FFE5E5 0%, #FFF0F0 100%);
    padding: 10px 16px;
    border-radius: 12px;
    border: 2px solid #FF6B6B;
    animation: pulse-glow 2s infinite;
    display: block;
    max-width: 90%;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 会员有效期高亮样式（老模板特效）*/
.membership-expiry-highlight {
    color: #58CC02;
    font-size: 1.1em;
    font-weight: 700;
    text-align: center;
    margin: 1rem auto;
    text-shadow: 0 2px 4px rgba(88, 204, 2, 0.3);
    background: linear-gradient(135deg, #E8F5E8 0%, #F0FFF0 100%);
    padding: 12px 18px;
    border-radius: 15px;
    border: 2px solid #58CC02;
    animation: expiry-float 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(88, 204, 2, 0.2);
    display: block;
    max-width: 90%;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 会员有效期的闪烁光效 */
.membership-expiry-highlight::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(88, 204, 2, 0.3), transparent);
    animation: shimmer 3s infinite;
    z-index: 1;
}

/* 确保文字在闪烁效果上方 */
.membership-expiry-highlight > * {
    position: relative;
    z-index: 2;
}

/* 脉动发光动画 */
@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(255, 48, 48, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 15px rgba(255, 48, 48, 0.6);
        transform: scale(1.02);
    }
}

/* 浮动动画 */
@keyframes expiry-float {
    0%, 100% { 
        box-shadow: 0 0 8px rgba(88, 204, 2, 0.4);
        transform: translateY(0px) scale(1);
    }
    50% { 
        box-shadow: 0 0 20px rgba(88, 204, 2, 0.8);
        transform: translateY(-3px) scale(1.03);
    }
}

/* 闪烁光效动画 */
@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* ===========================
   辅助类
   =========================== */
.hidden {
    display: none !important;
}

/* ===========================
   响应式设计
   =========================== */
@media (max-width: 768px) {
    .test {
        font-size: 24px;
        line-height: 32px;
    }

    .logo {
        width: 160px;
        height: auto;
    }

    .icon {
        max-width: 280px;
        height: auto;
    }

    .btn {
        padding: 14px 40px;
        font-size: 16px;
    }

    .joinWrap .joinBox {
        padding: 20px;
        width: 95%;
    }

    /* 移动端语言切换按钮 */
    .lang-switcher {
        top: 10px;
        gap: 6px;
        padding: 6px;
    }

    .lang-btn {
        padding: 6px 12px;
        font-size: 12px;
        gap: 3px;
    }

    .wechat-service {
        bottom: 20px;
        right: 20px;
    }

    .wechat-btn span {
        display: none;
    }

    .wechat-btn {
        padding: 12px;
        border-radius: 50%;
    }

    .tutorial-grid {
        grid-template-columns: 1fr;
    }

    .tutorialBox video {
        max-width: 95%;
        max-height: 70vh;
    }

    .video-close-btn {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .test {
        font-size: 20px;
        line-height: 28px;
    }

    .content {
        padding: 10px;
    }

    .modal-content {
        padding: 20px;
    }

    .tutorialBox video {
        max-width: 100%;
        max-height: 60vh;
    }

    .video-close-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

