:root {
    --primary-color: #007AFF;
    --error-color: #FF3B30;
    --success-color: #34C759;
    --background-color: #F5F5F7;
    --card-background: #FFFFFF;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 390px;
    padding: 20px;
    margin: 0 auto;
}

.card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

h2 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 8px;
    text-align: center;
}

.subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 24px;
    font-size: 15px;
}

.input-group {
    margin-bottom: 16px;
}

input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 1px solid #E5E5E5;
    border-radius: var(--border-radius);
    font-size: 16px;
    margin-bottom: 16px;
    transition: var(--transition);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.primary-button {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.primary-button:hover {
    background-color: #0066D6;
}

.primary-button:active {
    transform: scale(0.98);
}

#errorMessage {
    color: var(--error-color);
    font-size: 14px;
    text-align: center;
    min-height: 20px;
    margin-top: 8px;
}

.scanner-container {
    text-align: center;
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    margin: 24px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: #000;
}

#video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% {
        top: 0;
    }
    50% {
        top: 100%;
    }
    100% {
        top: 0;
    }
}

.icon {
    margin-right: 8px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }
    
    .card {
        padding: 24px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .video-container {
        padding-bottom: 120%;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #000000;
        --card-background: #1C1C1E;
        --text-primary: #FFFFFF;
        --text-secondary: #98989D;
    }
    
    input[type="text"] {
        background-color: #2C2C2E;
        border-color: #3A3A3C;
        color: white;
    }
}