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

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 搜索区域 */
.search-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

#searchInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#searchBtn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.secondary-btn {
    padding: 15px 30px;
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.secondary-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

/* 结果区域 */
.result-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.result-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: #495057;
}

.result-box {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 40px 20px;
    min-height: 200px;
    text-align: center;
}

.placeholder {
    color: #6c757d;
    font-size: 1.2rem;
}

.placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 数据管理区域 */
.data-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #667eea;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

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

.data-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.file-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-btn {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

#fileName {
    color: #6c757d;
    font-size: 0.9rem;
}

.data-info {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.data-info p {
    font-size: 1.2rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 10px;
}

#recordCount {
    font-weight: 700;
    color: #667eea;
}

/* 数据预览 */
.data-preview {
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
}

.search-data {
    display: flex;
    gap: 10px;
}

#filterData {
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    width: 200px;
}

.small-btn {
    padding: 10px 15px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

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

.data-preview-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 20px;
}

.data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.data-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
    transition: all 0.3s ease;
}

.data-code {
    font-weight: 600;
    color: #495057;
}

.data-ip {
    font-family: monospace;
    color: #667eea;
    background: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: 600;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e5e9;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #6c757d;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e1e5e9;
    text-align: right;
}

/* 加载动画 */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 页脚 */
footer {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .data-controls {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .preview-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .search-data {
        width: 100%;
    }
    
    #filterData {
        width: 100%;
    }
}

/* 高亮匹配项 */
.highlight {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}