* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.input-section,
.result-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.tab-container {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    background: #f8f9fa;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: bold;
}

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

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

#textInput {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#textInput:focus {
    outline: none;
    border-color: #667eea;
}

.options-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.option-item {
    display: flex;
    flex-direction: column;
}

.option-item label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.option-item select,
.option-item input[type="color"] {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.option-item input[type="color"] {
    height: 40px;
    cursor: pointer;
}

.logo-upload {
    grid-column: span 2;
}

.upload-btn {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-right: 10px;
}

.upload-btn:hover {
    background: #5a6268;
}

.file-name {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

@media (max-width: 768px) {
    .logo-upload {
        grid-column: span 1;
    }
}

.generate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

.qrcode-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
}

.qrcode-container canvas {
    border-radius: 8px;
}

.placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
}

.download-section {
    text-align: center;
}

.stats-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.stats-section.hidden {
    display: none;
}

.stats-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-actions {
    display: flex;
    gap: 8px;
}

.stats-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.scan-count {
    font-size: 1rem;
    color: #495057;
}

.scan-count strong {
    color: #007bff;
    font-size: 1.2rem;
}

.qr-filename {
    font-size: 0.85rem;
    color: #6c757d;
}

.qr-filename code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #495057;
}

.reset-stats-btn {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.simulate-scan-btn {
    padding: 6px 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.simulate-scan-btn:hover {
    background: #218838;
}

.reset-stats-btn:hover {
    background: #c82333;
}

.download-section.hidden {
    display: none;
}

.download-btn {
    padding: 12px 30px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.download-btn:hover {
    background: #218838;
}

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .input-section,
    .result-section {
        padding: 20px;
    }
    
    .options-group {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .input-section,
    .result-section {
        padding: 15px;
    }
    
    .tab-btn {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
}