/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-brand {
    display: inline-block;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    letter-spacing: 2px;
}

.logo-sub {
    font-size: 0.8rem;
    color: #aaa;
    margin-left: 10px;
}

.nav-links {
    float: right;
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #4fc3f7;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

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

/* Category Sections */
.category {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.category-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #667eea;
    color: #1a1a2e;
}

.subcategory {
    font-size: 1.3rem;
    margin: 2rem 0 1rem 0;
    color: #555;
    padding-left: 1rem;
    border-left: 4px solid #764ba2;
}

/* Docs Grid */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

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

.doc-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    cursor: pointer;
}

.doc-card h3 {
    padding: 1rem 1rem 0.5rem;
    font-size: 1.1rem;
    color: #1a1a2e;
}

.doc-card p {
    padding: 0 1rem;
    color: #666;
    font-size: 0.9rem;
}

.view-btn {
    display: block;
    margin: 1rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #2c3e50 0%, #1a1a2e 100%);
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: opacity 0.3s;
}

.view-btn:hover {
    opacity: 0.9;
}

.qr-btn {
    display: block;
    margin: 0.5rem 1rem 1rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #4a4a4a 0%, #2c2c2c 100%);
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: opacity 0.3s;
}

.qr-btn:hover {
    opacity: 0.9;
}

/* Search Box */
.search-box {
    max-width: 500px;
    margin: 2rem auto 0;
}

.search-box input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    outline: none;
    transition: box-shadow 0.3s;
}

.search-box input:focus {
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.search-box input::placeholder {
    color: #999;
}

/* Search Highlight */
.search-highlight {
    box-shadow: 0 0 0 3px #f39c12, 0 8px 25px rgba(0,0,0,0.15) !important;
    animation: pulse 2s infinite;
}

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

/* Footer */
.footer {
    background: #1a1a2e;
    color: white;
    padding: 3rem 2rem 1rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    align-items: start;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #4fc3f7;
}

.footer-section p {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-section a {
    display: block;
    color: #aaa;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #4fc3f7;
}

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

.qrcode-img {
    max-width: 150px;
    border-radius: 8px;
    margin: 0.5rem 0;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 1;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-caption {
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .docs-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .doc-card img {
        height: 120px;
    }
}
