/* 农户查询页面样式 */
.farmer-query-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 查询表单样式 */
.query-form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.query-form .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.query-form .form-group {
    flex: 1;
    min-width: 200px;
}

/* 美化选择器样式 */
.query-form select {
    width: 100%;
    padding: 12px 35px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    background-color: #fafafa;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 18px 18px;
    appearance: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.query-form select:hover {
    border-color: #4CAF50;
    background-color: #fff;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.2), inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    background-size: 22px 22px;
}

.query-form select:focus {
    outline: none;
    border-color: #4CAF50;
    background-color: #fff;
    box-shadow: 0 0 0 5px rgba(76, 175, 80, 0.25), inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    background-size: 22px 22px;
}

.query-form select:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3), inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 优化选择器下拉动画 - 使用CSS动画 */
@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dropdownSlide {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 500px;
        opacity: 1;
    }
}

/* 为所有选择器添加平滑过渡效果 */
select {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    /* 添加选择器下拉动画支持 */
    animation: dropdownSlide 0.5s ease-out;
}

/* 增强选项的视觉效果 */
select option {
    padding: 12px 15px;
    transition: all 0.3s ease;
    background-color: #fff;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

select option:hover {
    background-color: #e8f5e8;
    color: #4CAF50;
    transform: translateX(5px);
}

select option:checked {
    background-color: #4CAF50;
    color: white;
}

/* 为所有输入框添加样式，包括autocomplete提示的样式 */
input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 隐藏浏览器默认的autocomplete提示 */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    -webkit-text-fill-color: #333;
    transition: background-color 5000s ease-in-out 0s;
}

/* 为所有页面的选择器添加相同的动画效果 */
select {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

select:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

select:focus {
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2);
    transform: translateY(-1px);
}

/* 美化输入框样式，保持与选择器一致 */
.query-form input[type="text"],
.query-form input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    background-color: #fafafa;
    transition: all 0.2s ease-in-out;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.query-form input[type="text"]:hover,
.query-form input[type="number"]:hover {
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15), inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.query-form input[type="text"]:focus,
.query-form input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2), inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.query-form input[type="text"]:active,
.query-form input[type="number"]:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.25), inset 0 1px 3px rgba(0, 0, 0, 0.05);
}



.query-form .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

/* 导入导出区域样式 */
.import-export-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.import-export-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.import-export-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 数据表格样式 */
.data-table-section {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 0;
}

.data-table-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

#farmerList {
    position: relative;
    min-height: 200px;
    overflow: hidden;
}

.table-container {
    overflow-x: auto;
    margin: 0;
    transition: opacity 0.3s ease;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.farmer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: auto;
    min-width: 1000px;
}

.farmer-table th,
.farmer-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* 设置各列宽度 */
.farmer-table th:nth-child(1),
.farmer-table td:nth-child(1) {
    width: 40px; /* 选择框 */
    text-align: center;
    min-width: 40px;
}

.farmer-table th:nth-child(2),
.farmer-table td:nth-child(2) {
    width: 50px; /* 序号 */
    text-align: center;
    min-width: 50px;
}

.farmer-table th:nth-child(3),
.farmer-table td:nth-child(3) {
    width: 110px; /* 姓名 */
    min-width: 110px;
}

.farmer-table th:nth-child(4),
.farmer-table td:nth-child(4) {
    width: 160px; /* 身份证号 */
    min-width: 160px;
}

.farmer-table th:nth-child(5),
.farmer-table td:nth-child(5) {
    width: 110px; /* 手机号 */
    min-width: 110px;
}

.farmer-table th:nth-child(6),
.farmer-table td:nth-child(6) {
    width: 90px; /* 所属乡镇 */
    min-width: 90px;
}

.farmer-table th:nth-child(7),
.farmer-table td:nth-child(7) {
    width: 80px; /* 所属村 */
    min-width: 80px;
}

.farmer-table th:nth-child(8),
.farmer-table td:nth-child(8) {
    width: 180px; /* 地址 */
    min-width: 180px;
}

.farmer-table th:nth-child(9),
.farmer-table td:nth-child(9) {
    width: 140px; /* 银行卡号 */
    min-width: 140px;
}

.farmer-table th:nth-child(10),
.farmer-table td:nth-child(10) {
    width: 90px; /* 银行名称 */
    min-width: 90px;
}

.farmer-table th:nth-child(11),
.farmer-table td:nth-child(11) {
    width: 120px; /* 单位名称 */
    min-width: 120px;
}

.farmer-table th:nth-child(12),
.farmer-table td:nth-child(12) {
    width: 120px; /* 操作 */
    text-align: center;
    white-space: nowrap;
    overflow: visible;
    min-width: 120px;
}

.farmer-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.farmer-table tr:hover {
    background-color: #f9f9f9;
}

.farmer-table td.actions {
    text-align: center;
}

/* 操作按钮容器样式 */
.action-buttons {
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
}

/* 操作按钮样式优化 */
.action-buttons .btn {
    padding: 4px 8px;
    font-size: 12px;
    margin: 0;
    border-radius: 3px;
}

/* 加载状态样式 */
.loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.8);
    color: #666;
    z-index: 20;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}

.loading i {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

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

/* 空数据提示样式 */
.empty-data {
    text-align: center;
    padding: 40px;
    color: #999;
    transition: opacity 0.3s ease;
}

/* 分页控件样式 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding: 20px 0 0 0;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 20px;
}

.pagination-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.page-size-selector select {
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.2em 1.2em;
    appearance: none;
    width: 80px;
}

.page-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    box-shadow: none;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background-color: #0b7dda;
}

.btn-success {
    background-color: #4CAF50;
    color: white;
}

.btn-success:hover {
    background-color: #45a049;
}

.btn-warning {
    background-color: #ff9800;
    color: white;
}

.btn-warning:hover {
    background-color: #e68a00;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .query-form .form-row {
        flex-direction: column;
    }
    
    .import-export-actions {
        flex-direction: column;
    }
    
    .pagination-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pagination-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .farmer-table {
        font-size: 12px;
    }
    
    .farmer-table th,
    .farmer-table td {
        padding: 8px;
    }
    
    /* 响应式列宽调整 */
    .farmer-table th:nth-child(4),
    .farmer-table td:nth-child(4) {
        width: 140px; /* 身份证号 */
    }
    
    .farmer-table th:nth-child(8),
    .farmer-table td:nth-child(8) {
        width: 160px; /* 地址 */
    }
    
    .farmer-table th:nth-child(9),
    .farmer-table td:nth-child(9) {
        width: 120px; /* 银行卡号 */
    }
}