/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

#app {
    width: 100%;
    height: 100%;
}

/* 通用页面样式 */
.page {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ============ 首页样式 ============ */
.home-page {
    background: #201917;
    color: #fff;
}

.header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
}

.close-btn {
    font-size: 24px;
    color: #999;
    margin-right: 16px;
    cursor: pointer;
}

.title {
    font-size: 16px;
    color: #fff;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.video-container {
    width: 200px;
    height: 120px;
    background: #2a2a3e;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.play-btn {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}

.brand-logo {
    width: 200px;
    height: auto;
    margin: 30px 0;
    object-fit: contain;
}

.brand-logo.large {
    width: 250px;
}

.scan-btn {
    background: linear-gradient(135deg, #d4af37 0%, #c9a227 100%);
    color: #1a1a2e;
    border: none;
    padding: 14px 60px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.scan-btn:active {
    transform: scale(0.98);
}

.footer {
    padding: 16px;
    text-align: center;
    color: #666;
    font-size: 12px;
}

/* ============ 教学弹窗样式 ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    width: 85%;
    max-width: 320px;
    text-align: center;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tutorial-modal h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 12px;
}

.tutorial-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

.tutorial-image {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 24px;
}

.tutorial-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.product-icon,
.phone-icon {
    font-size: 40px;
}

.tutorial-qr {
    width: 60px;
    height: 60px;
    border-radius: 4px;
}

.arrow {
    font-size: 24px;
    color: #999;
    animation: arrowMove 1s ease-in-out infinite;
}

@keyframes arrowMove {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(10px);
    }
}

.confirm-btn {
    background: linear-gradient(135deg, #d4af37 0%, #c9a227 100%);
    color: #1a1a2e;
    border: none;
    padding: 12px 50px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* ============ 扫码界面样式 ============ */
.scanner-page {
    background: linear-gradient(180deg, #2d1f3d 0%, #1a1a2e 100%);
}

.scanner-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-text {
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 18px;
    color: #d4af37;
}

.scan-tip {
    text-align: center;
    padding: 16px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s;
}

/* 扫码提示 - 顶部位置 */
.scan-tip-top {
    text-align: center;
    padding: 20px 16px;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
}

.scan-tip-top.warning {
    color: #ffc800;
}

.scan-tip.warning {
    background: rgba(255, 200, 0, 0.2);
}

.tip-title {
    font-size: 14px;
    color: #ffc800;
}

.tip-subtitle {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

/* 扫描区域包装器 */
.scanner-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 20px 20px;
}

/* 白色边框扫描框 - 包含提示、摄像头和按钮 */
.scanner-frame {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 260px;
}

/* 框内顶部提示 */
.scan-tip-inner {
    text-align: center;
    padding: 12px 16px;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
}

.scan-tip-inner.warning {
    color: #ffc800;
}

.scan-tip-inner .tip-title {
    font-size: 14px;
    color: #ffc800;
}

.scan-tip-inner .tip-subtitle {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* 框内底部按钮 */
.scanner-actions-inner {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 0 0;
    width: 100%;
}

.scanner-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #1a1a2e;
}

#qr-reader {
    width: 220px;
    height: 240px;
    overflow: hidden;
    border-radius: 4px;
}

#qr-reader video {
    border-radius: 4px;
}

/* 隐藏 html5-qrcode 默认的一些元素 */
#qr-reader__scan_region {
    background: transparent !important;
}

#qr-reader__dashboard {
    display: none !important;
}

.scan-frame {
    position: relative;
    width: 250px;
    height: 250px;
    z-index: 10;
}

.corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid #fff;
}

.corner.tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.corner.tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

.corner.bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
}

.corner.br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 5%;
    width: 90%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff00, transparent);
    animation: scanMove 2s ease-in-out infinite;
}

@keyframes scanMove {

    0%,
    100% {
        top: 0;
    }

    50% {
        top: calc(100% - 2px);
    }
}

.scanner-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 25px 20px;
    background: transparent;
}

.action-btn {
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
}

/* 切换摄像头按钮 - 黄色 */
.action-btn.switch-btn {
    background: #f5d742;
    color: #333;
}

/* 打开灯光按钮 - 深色 */
.action-btn.flash-btn {
    background: #2a2a3a;
    color: #f5d742;
}

.action-btn .icon {
    font-size: 16px;
}

/* ============ 分析中页面样式 ============ */
.analyzing-page {
    background: linear-gradient(180deg, #303030 0%, #0b0b0b 50%, #020202 100%) !important;
}

.analyzing-header {
    padding: 16px;
    display: flex;
    align-items: center;
}

/* 分析中页面包装器 */
.analyzing-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 20px 20px;
}

/* 白色边框分析框 */
.analyzing-frame {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 260px;
}

/* 眼镜图标 */
.glasses-icon {
    font-size: 36px;
    margin-bottom: 8px;
    color: #4ade80;
}

/* 分析中文字 */
.analyzing-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    margin-bottom: 20px;
}

/* 闪动的点 */
.dots span {
    animation: blink 1.4s infinite;
    animation-fill-mode: both;
}

.dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {

    0%,
    80%,
    100% {
        opacity: 0;
    }

    40% {
        opacity: 1;
    }
}

/* 二维码预览容器 */
.qr-preview {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 绿色虚线边框 */
.qr-frame-dashed {
    padding: 10px;
    border: 3px dashed #4ade80;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.3);
    animation: borderPulse 1.5s ease-in-out infinite;
}

/* 二维码图片 */
.qr-image {
    width: 150px;
    height: 150px;
    display: block;
    border-radius: 4px;
}

@keyframes borderPulse {

    0%,
    100% {
        border-color: #4ade80;
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
    }

    50% {
        border-color: #22c55e;
        box-shadow: 0 0 15px 5px rgba(74, 222, 128, 0.2);
    }
}

/* ============ 验证结果页样式 ============ */
.result-page {
    background: #201917;
}

.result-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
}

.result-url {
    font-size: 12px;
    color: #ccc;
    text-decoration: none;
}

.result-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
}

.result-video {
    width: 100%;
    max-width: 300px;
    height: 150px;
    background: linear-gradient(135deg, #e8dff5 0%, #d4c4e8 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.result-status {
    margin: 20px 0;
}

.status-badge {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 4px;
    font-size: 24px;
    font-weight: 700;
}

.status-badge.genuine {
    color: #d4af37;
}

.result-desc {
    font-size: 16px;
    color: #fff;
    margin-bottom: 8px;
}

.result-info {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 30px;
}

.contact-section {
    text-align: center;
    color: #ccc;
}

.contact-section h3 {
    font-size: 14px;
    color: #999;
    margin-bottom: 10px;
}

.contact-section p {
    font-size: 14px;
    margin: 4px 0;
    color: #fff;
}