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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

header h1 {
    color: #4a5568;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    color: #718096;
    font-size: 1.2em;
}

.function-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-btn {
    background: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    color: #4a5568;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.function-section {
    display: none;
}

.function-section.active {
    display: block;
}

.function-section h2 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.function-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.function-card:hover {
    transform: translateY(-5px);
}

.function-card h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    background: #f7fafc;
}

.upload-area:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.upload-area.small {
    padding: 20px;
}

.upload-content {
    pointer-events: auto;
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 10px;
    opacity: 0.7;
}

.upload-area p {
    color: #4a5568;
    font-size: 1.1em;
    font-weight: 500;
}

.controls {
    margin-top: 20px;
}

.controls.hidden,
.hidden {
    display: none;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

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

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

.file-list {
    background: #f7fafc;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.file-item {
    background: white;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.file-item:last-child {
    margin-bottom: 0;
}

.page-range {
    margin: 15px 0;
}

.page-range label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2d3748;
}

#page-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
}

.page-checkbox {
    display: flex;
    align-items: center;
    padding: 8px;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.page-checkbox:hover {
    background: #edf2f7;
}

.page-checkbox input {
    margin-right: 8px;
}

.vlookup-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.file-group h4 {
    color: #2d3748;
    margin-bottom: 15px;
    text-align: center;
}

select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    margin-top: 10px;
    background: white;
    color: #2d3748;
}

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

#sheet-list {
    background: #f7fafc;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.sheet-item {
    background: white;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sheet-item:last-child {
    margin-bottom: 0;
}

.sheet-item input {
    margin-right: 10px;
}

.progress {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.progress-bar {
    background: #e2e8f0;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    width: 0%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    color: #4a5568;
    font-weight: 600;
}

.result {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.result.success {
    border-left: 5px solid #48bb78;
}

.result.error {
    border-left: 5px solid #f56565;
}

.result h3 {
    color: #2d3748;
    margin-bottom: 10px;
}

.result p {
    color: #4a5568;
    line-height: 1.6;
}

.download-link {
    display: inline-block;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    margin-top: 10px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.download-link:hover {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .function-nav {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        width: 200px;
        margin-bottom: 10px;
    }
    
    .function-card {
        padding: 20px;
    }
    
    .vlookup-container {
        grid-template-columns: 1fr;
    }
    
    .upload-area {
        padding: 30px 20px;
    }
    
    .upload-icon {
        font-size: 2.5em;
    }
    
    #page-checkboxes {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8em;
    }
    
    header p {
        font-size: 1em;
    }
    
    .function-card {
        padding: 15px;
    }
    
    .upload-area {
        padding: 25px 15px;
    }
    
    .btn {
        padding: 10px 25px;
        font-size: 14px;
    }
    
    #page-checkboxes {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    }
}