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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 36px;
    width: auto;
}

.logo-text h1 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

nav ul {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover,
nav a.active {
    color: #3498db;
}

.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.hero-section {
    text-align: center;
    padding: 40px 20px;
}

.hero-section h1 {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
}

.hero-section h1 i {
    color: #e74c3c;
    margin-right: 10px;
}

.hero-section p {
    font-size: 16px;
    color: #666;
}

.search-filter-section {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-box button {
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.search-box button:hover {
    background: #2980b9;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-tag {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-tag:hover {
    border-color: #3498db;
    color: #3498db;
}

.category-tag.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.category-tag .count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.template-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.template-preview {
    height: 180px;
    position: relative;
    overflow: hidden;
}

.template-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.template-card:hover .template-preview img {
    transform: scale(1.05);
}

.template-info {
    padding: 16px;
}

.template-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.4;
}

.template-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-category {
    font-size: 12px;
    color: #3498db;
    display: flex;
    align-items: center;
    gap: 4px;
}

.download-btn {
    padding: 6px 14px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.download-btn:hover {
    background: #2980b9;
    color: white;
    text-decoration: none;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

.empty-state h3 {
    font-size: 20px;
    color: #666;
    margin-bottom: 10px;
}

.results-info {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.filter-info {
    color: #3498db;
    margin: 0 8px;
}

.clear-filter {
    color: #e74c3c;
    text-decoration: none;
    font-size: 13px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.page-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.page-dots {
    padding: 8px 4px;
    color: #999;
    font-weight: 600;
    user-select: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    padding: 30px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f7fa;
    border-radius: 50%;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #e9ecef;
    color: #666;
}

.modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.modal-header h3 i {
    color: #3498db;
    margin-right: 8px;
}

.modal-header p {
    color: #666;
    font-size: 14px;
}

.qr-section {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    align-items: center;
}

.qr-code {
    width: 140px;
    height: 140px;
    padding: 10px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    flex-shrink: 0;
}

.qr-code img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-tips {
    flex: 1;
}

.qr-tips p {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.qr-tips p:last-child {
    margin-bottom: 0;
}

.qr-tips i {
    color: #3498db;
    font-size: 16px;
    width: 20px;
}

.qr-tips strong {
    color: #e74c3c;
    font-size: 16px;
}

.verify-input {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.verify-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    text-align: center;
    letter-spacing: 2px;
    transition: all 0.2s;
}

.verify-input input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.verify-input button {
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.verify-input button:hover {
    background: #2980b9;
}

.verify-status {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.verify-status.error {
    background: #fef2f2;
    color: #dc2626;
    display: block;
}

.verify-status.success {
    background: #f0fdf4;
    color: #16a34a;
    display: block;
}

footer {
    background: #343a40;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 20px;
    font-size: 14px;
    margin-top: auto;
}

@media (max-width: 992px) {
    .templates-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-container {
        padding: 0 15px;
    }
    
    .logo-text h1 {
        font-size: 16px;
    }
    
    nav ul {
        gap: 15px;
    }
    
    .hero-section h1 {
        font-size: 24px;
    }
    
    .qr-section {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .category-tags {
        justify-content: center;
    }
    
    .verify-input {
        flex-direction: column;
    }
    
    .modal-content {
        padding: 20px;
    }
}