/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

h2 {
    color: #34495e;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.section {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #ecf0f1;
    color: #333;
}

.btn-secondary:hover {
    background-color: #dcdde1;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Section A: Upload Area */
.drop-area {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-area.active {
    border-color: #3498db;
    background-color: #f0f7ff;
}

.drop-area i {
    color: #3498db;
    margin-bottom: 15px;
}

/* Crop Container */
.crop-container {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.crop-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

#preview-image {
    width: 100%;
    height: auto;
    display: block;
}

.crop-controls {
    max-width: 500px;
    margin: 0 auto;
}

.decoded-token {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.token-value {
    font-family: monospace;
    word-break: break-all;
    margin-top: 5px;
    color: #27ae60;
}

#qr-name {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.button-group {
    display: flex;
    gap: 10px;
}

.button-group .btn {
    flex: 1;
}

/* Section B: OTP List */
.otp-list {
    display: grid;
    gap: 15px;
}

.otp-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.otp-info {
    flex: 1;
}

.otp-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
}

.otp-code {
    font-family: monospace;
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 5px;
    color: #27ae60;
}

.otp-timer {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.otp-actions {
    margin-left: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.empty-state i {
    margin-bottom: 15px;
    color: #bdc3c7;
}

/* Section C: Import/Export */
.data-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.import-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.info-text {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 10px;
}

/* Animations */
.pulse {
    animation: pulse 1s ease-in-out;
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .otp-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .otp-actions {
        margin-left: 0;
        margin-top: 15px;
        align-self: flex-end;
    }
    
    .data-controls {
        flex-direction: column;
    }
    
    .data-controls .btn {
        width: 100%;
    }
}
    

/* 摄像头扫描区域样式 */
.camera-area {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    margin-top: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.camera-area:hover {
    border-color: #3498db;
    background-color: #f0f7ff;
}

.camera-area i {
    color: #3498db;
    margin-bottom: 15px;
}

.camera-area .btn {
    margin-top: 15px;
}

/* 摄像头扫描容器 */
.camera-scan-container {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.scan-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

#camera-preview {
    width: 100%;
    height: auto;
    display: block;
}

/* 扫描框动画效果 */
.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(52, 152, 219, 0.2) 0%,
        rgba(52, 152, 219, 0.8) 50%,
        rgba(52, 152, 219, 0.2) 100%
    );
    background-size: 100% 400%;
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 100%; }
}