* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.nav {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: white;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    margin: 0 10px;
    font-size: 1em;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    color: #666;
}

.nav-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.main {
    min-height: 500px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    resize: vertical;
    min-height: 120px;
}

.form-group input[type="range"] {
    width: 70%;
    margin-right: 10px;
}

.form-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    background: white;
}

#generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 20px auto;
}

#generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.qr-result {
    text-align: center;
    margin-top: 30px;
}

#qr-canvas {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn {
    display: inline-block;
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.scan-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

#preview {
    width: 100%;
    height: auto;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

#start-scan, #stop-scan {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
}

#start-scan:hover, #stop-scan:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

#stop-scan {
    background: #f44336;
}

#stop-scan:hover {
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.4);
}

#stop-scan:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.about-content {
    line-height: 1.8;
}

.about-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

.about-content ul, .about-content ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

.about-content li {
    margin-bottom: 8px;
}

.about-content a {
    color: #667eea;
    text-decoration: none;
}

.about-content a:hover {
    text-decoration: underline;
}

.footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .nav {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        margin: 5px 0;
        width: 100%;
        max-width: 200px;
    }
    
    .card {
        padding: 20px;
    }
    
    .form-group input[type="range"] {
        width: 60%;
    }
    
    #start-scan, #stop-scan {
        display: block;
        margin: 10px auto;
        width: 80%;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}