* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

header h1 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px 25px;
    background: #f5f5f5;
    border-radius: 10px;
    min-width: 120px;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.stat-value.used {
    color: #4CAF50;
}

.stat-value.unused {
    color: #2196F3;
}

.controls {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    gap: 10px;
}

#searchInput {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

#searchInput:focus {
    border-color: #667eea;
}

button {
    padding: 12px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #5568d3;
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.qr-item {
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.qr-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.qr-item.used {
    opacity: 0.7;
    position: relative;
}

.qr-item.used::after {
    content: '已使用';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(244, 67, 54, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 18px;
}

.qr-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 10px;
}

.qr-id {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.qr-status {
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    margin-top: 5px;
}

.qr-status.unused {
    background: #e3f2fd;
    color: #1976d2;
}

.qr-status.used {
    background: #ffebee;
    color: #c62828;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 10px 15px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.pagination button:hover {
    background: #667eea;
    color: white;
}

.pagination button.active {
    background: #667eea;
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .qr-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .stats {
        flex-direction: column;
    }
}

