﻿
/* 基础样式重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    background-attachment: fixed;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 动画定义 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease forwards;
}

.animate-bounce {
    animation: bounce 1s ease-in-out;
}

/* 布局组件 */
.app-container {
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    position: relative;
    overflow-x: hidden;
}

/* 顶部区域 */
.header-section {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    text-align: center;
    padding: 1.5rem 1rem 1.2rem;
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: hidden;
}

    .header-section::before,
    .header-section::after {
        content: '';
        position: absolute;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
    }

    .header-section::before {
        top: 10px;
        left: 10px;
        width: 60px;
        height: 60px;
    }

    .header-section::after {
        bottom: 15px;
        right: 15px;
        width: 90px;
        height: 90px;
    }

.logo {
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 12px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e3c72;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

.header-title {
    font-size: clamp(1.4rem, 5vw, 1.6rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.header-subtitle {
    font-size: clamp(0.9rem, 3vw, 1rem);
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* 输入区域 */
.input-section {
    padding: 1.5rem 1.5rem 1.2rem;
    background: #fff;
}

.input-label {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.8rem;
    display: block;
}

.input-field {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;

    min-height: 60px; /* 保证默认高度足够显示2行 */
    resize: vertical; /* 允许用户垂直拉伸（可选） */
    line-height: 1.5; /* 优化多行文字行间距 */ 
}

    .input-field:focus {
        outline: none;
        border-color: #1e3c72;
        background: #fff;
        box-shadow: 0 0 0 2px rgba(30, 60, 114, 0.2);
    }

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.2s ease;
    min-height: 48px;
    position: relative;
    box-shadow: 0 2px 5px rgba(30, 60, 114, 0.2);
}

    .submit-btn:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
    }

    .submit-btn:active:not(:disabled) {
        transform: translateY(0);
    }

    .submit-btn:disabled {
        background: #ccc;
        cursor: not-allowed;
        opacity: 0.6;
        box-shadow: none;
    }

/* 加载状态 */
.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 提示区域 */
.message-section {
    padding: 0.8rem 1.5rem 1rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message {
    text-align: center;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
    width: 100%;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

    .message.error {
        background: #ffeaea;
        color: #d32f2f;
        border: 1px solid #ffcdd2;
        white-space: pre-line;
        box-shadow: 0 2px 8px rgba(211, 47, 47, 0.1);
    }

    .message.success {
        background: #e8f5e8;
        color: #2e7d32;
        border: 1px solid #c8e6c9;
    }

    .message.info {
        background: #fff8e1;
        color: #ff8f00;
        border: 1px solid #ffe082;
    }

/* 导航栏 */
.nav-section {
    padding: 0.3rem 1.5rem 0.8rem;
    background: #fff;
}

.nav-tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2px;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
}

.nav-tab {
    flex: 1;
    padding: 0.6rem 0.8rem;
    text-align: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

    .nav-tab.active {
        background: #1e3c72;
        color: #fff;
        box-shadow: 0 1px 3px rgba(30, 60, 114, 0.2);
    }

    .nav-tab:not(.active):hover {
        background-color: #e9ecef;
    }

    .nav-tab .icon {
        font-size: 0.9rem;
    }

/* 单Tab模式样式 */
.nav-section.single-tab {
    padding: 0.5rem 1.5rem 0.5rem;
}

    .nav-section.single-tab .nav-tabs {
        background: transparent;
        border: none;
        padding: 0;
        margin-bottom: 0.5rem;
    }

    .nav-section.single-tab .nav-tab {
        background: #e3f2fd;
        border: 1px solid #bbdefb;
        color: #1565c0;
        cursor: default;
        pointer-events: none;
    }

/* 内容区域 */
.content-section {
    flex: 1;
    padding: 0.3rem 1.5rem 1.5rem;
    background: #fff;
}

.content-area {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.2rem 1rem;
    text-align: center;
    min-height: 160px;
    border: 1px solid #e9ecef;
}

.video-container {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    margin-bottom: 0.6rem;
    max-width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.video-cover {
    width: 100%;
    cursor: pointer;
    position: relative;
}

    .video-cover img {
        width: 100%;
        height: auto;
        display: block;
        opacity: 0;
        transition: opacity 0.5s ease;
    }

        .video-cover img.loaded {
            opacity: 1;
        }

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid rgba(255,255,255,0.8);
}

    .play-button:hover {
        background: rgba(0,0,0,0.85);
        border-color: #fff;
        transform: translate(-50%, -50%) scale(1.05);
    }

    .play-button svg {
        width: 20px;
        height: 20px;
        fill: #fff;
        margin-left: 2px;
    }

.video-player {
    width: 100%;
    border-radius: 10px;
}

.video-hint {
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.2rem;
    line-height: 1.4;
}

.service-content {
    text-align: center;
}

.service-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.6rem;
}

.qr-code-container {
    background: #fff;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 0.6rem auto;
    display: inline-block;
    transition: all 0.3s ease;
}

    .qr-code-container:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

.qr-code {
    width: 140px;
    height: 140px;
    border-radius: 6px;
    display: block;
}

.service-info {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Tab内容切换样式 */
.tab-content {
    display: none;
}

    .tab-content.active {
        display: block;
        animation: fadeIn 0.3s ease forwards;
    }

.wechat-id {
    color: #1e3c72;
    font-weight: 600;
    margin: 0.4rem 0;
    font-size: 0.9rem;
}

/* 成功页面 */
.success-section {
    padding: 1.5rem 1.5rem;
    text-align: center;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #4caf50;
    border-radius: 50%;
    margin: 0 auto 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.success-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.8rem;
}

.success-message {
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* 网络状态指示器 */
.network-status {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff5722;
    color: #fff;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

    .network-status.show {
        transform: translateY(0);
    }

/* 响应式优化 */
@media (max-width: 480px) {
    .app-container {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .header-section {
        border-radius: 0;
        padding: 1.2rem 1rem 0.8rem;
        /* 适配刘海屏 */
        padding-top: calc(1.2rem + env(safe-area-inset-top));
    }

    .input-section {
        padding: 1.2rem max(1rem, env(safe-area-inset-left)) 1rem max(1rem, env(safe-area-inset-right));
    }

    .message-section {
        padding: 0.6rem max(1rem, env(safe-area-inset-left)) 0.8rem max(1rem, env(safe-area-inset-right));
        min-height: 50px;
    }

    .nav-section {
        padding: 0.2rem max(1rem, env(safe-area-inset-left)) 0.6rem max(1rem, env(safe-area-inset-right));
    }

    .content-section {
        padding: 0.2rem max(1rem, env(safe-area-inset-left)) 1.2rem max(1rem, env(safe-area-inset-right));
    }

    .success-section {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 动画和过渡效果 */
.scale-hover {
    transition: transform 0.2s ease;
}

    .scale-hover:hover {
        transform: scale(1.03);
    }

#successContent {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(100%);
    transition: transform 0.5s ease;
}

    #successContent.visible {
        transform: translateY(0);
    }

#mainContent {
    transition: opacity 0.3s ease;
}





#styleFailureAlert {
    display: none;
}
