/* 欧易OKX品牌配色 - 黑白主题 */
:root {
    --primary-color: #000000;
    --primary-dark: #1A1A1A;
    --primary-light: #FFFFFF;
    --bg-dark: #000000;
    --bg-darker: #0A0A0A;
    --bg-card: #1A1A1A;
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.15);
    --error-color: #FF4D4F;
    --success-color: #52C41A;
    --warning-color: #FAAD14;

    --page-bg: linear-gradient(180deg, #000000 0%, #0A0A0A 100%);

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
                 'Microsoft YaHei', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 页面容器 */
.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
    overflow-y: auto;
    overflow-x: hidden;
}

.page.active {
    display: flex;
    opacity: 1;
}

/* 欢迎页样式 */
#welcome-page {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--page-bg);
    padding: 40px 20px;
}

.welcome-container {
    text-align: center;
    z-index: 10;
    max-width: 400px;
}

.logo-wrapper {
    margin-bottom: 30px;
    animation: fadeInDown 0.8s ease;
}

.okx-logo {
    width: 120px;
    height: auto;
}

.welcome-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 1px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 50px;
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* 按钮样式 */
.btn-primary {
    width: 100%;
    max-width: 320px;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    color: black;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
    animation: fadeInUp 0.8s ease 0.6s both;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 255, 255, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

/* 安全提示 */
.security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 14px;
    animation: fadeInUp 0.8s ease 0.8s both;
}

.notice-icon {
    width: 20px;
    height: 20px;
}

/* 背景装饰 */
.bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

.bg-circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.bg-circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: -50px;
    animation-delay: 2s;
}

.bg-circle-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: -30px;
    animation-delay: 4s;
}

/* 验证页样式 */
#verify-page {
    flex-direction: column;
    background: var(--bg-dark);
}

.verify-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
}

.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.verify-title {
    font-size: 18px;
    font-weight: 600;
}

.header-spacer {
    width: 40px;
}

.verify-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* 摄像头区域 */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 3/4;
    background: var(--bg-darker);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

#camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 人脸识别框 */
.face-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 60%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    animation: breathe 3s ease-in-out infinite;
}

.frame-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 4px solid #FFFFFF;
    border-radius: 6px;
}

.frame-corner.top-left {
    top: -4px;
    left: -4px;
    border-right: none;
    border-bottom: none;
}

.frame-corner.top-right {
    top: -4px;
    right: -4px;
    border-left: none;
    border-bottom: none;
}

.frame-corner.bottom-left {
    bottom: -4px;
    left: -4px;
    border-right: none;
    border-top: none;
}

.frame-corner.bottom-right {
    bottom: -4px;
    right: -4px;
    border-left: none;
    border-top: none;
}

/* 扫描线 */
.scan-line {
    position: absolute;
    left: 15%;
    width: 70%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--primary-color) 20%,
        var(--primary-color) 80%,
        transparent 100%);
    box-shadow: 0 0 20px var(--primary-color),
                0 0 40px var(--primary-color);
    animation: scan 2s ease-in-out infinite;
}

/* 加载状态 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity var(--transition-normal);
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay p {
    margin-top: 20px;
    font-size: 16px;
    color: var(--text-secondary);
}

/* 步骤指示器 */
.step-indicator {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0 10px;
    width: 100%;
    max-width: 360px;
}

.step-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.4;
    transition: all var(--transition-normal);
}

.step-item.active {
    opacity: 1;
}

.step-item.completed {
    opacity: 1;
}

.step-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all var(--transition-fast);
}

.step-item.active .step-number {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.step-item.completed .step-number {
    background: var(--success-color);
    border-color: var(--success-color);
}

.step-text {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.step-item.active .step-text {
    color: var(--text-primary);
}

/* 提示文字 */
.verify-hint {
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 360px;
}

/* 结果页样式 */
#result-page {
    background: var(--bg-dark);
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.result-container {
    text-align: center;
    max-width: 400px;
}

.result-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    animation: scaleIn 0.5s ease;
}

.result-icon svg {
    width: 100%;
    height: 100%;
}

.result-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    animation: fadeInUp 0.5s ease 0.2s both;
}

.result-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    animation: fadeInUp 0.5s ease 0.3s both;
}

.result-tips {
    text-align: left;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    animation: fadeInUp 0.5s ease 0.4s both;
}

.result-tips h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.result-tips ul {
    list-style: none;
}

.result-tips li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: var(--text-secondary);
    font-size: 14px;
}

.result-tips li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

/* 页脚水印 */
.footer-watermark {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 14px;
    animation: fadeInUp 0.5s ease 0.5s both;
}

.okx-logo-small {
    width: 60px;
    height: auto;
    opacity: 0.5;
}

/* 动画定义 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes breathe {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.8;
    }
}

@keyframes scan {
    0%, 100% {
        top: 20%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 80%;
        opacity: 0;
    }
}

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

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* 响应式适配 */
@media (max-width: 375px) {
    .welcome-title {
        font-size: 28px;
    }

    .verify-title {
        font-size: 16px;
    }

    .step-indicator {
        gap: 8px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .step-text {
        font-size: 10px;
    }
}

@media (min-width: 768px) {
    #welcome-page,
    #result-page {
        justify-content: center;
    }

    .welcome-container,
    .result-container {
        max-width: 480px;
    }

    .camera-container {
        max-width: 420px;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .camera-container {
        max-width: 300px;
        aspect-ratio: 4/3;
    }

    .step-indicator {
        margin-bottom: 10px;
    }

    .verify-hint {
        font-size: 14px;
    }
}

/* iOS安全区域适配 */
@supports (padding: max(0px)) {
    .verify-header {
        padding-top: max(20px, env(safe-area-inset-top));
    }

    #welcome-page,
    #result-page {
        padding-top: max(40px, env(safe-area-inset-top));
    }
}

/* 暗黑模式系统支持 */
@media (prefers-color-scheme: dark) {
    html {
        background-color: var(--bg-dark);
    }
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
