/* ================================================
   国内地区代码查询工具专用样式 - 参考HS编码查询工具现代化设计
   ================================================ */

/* 搜索区域 */
.search-section {
    margin-bottom: 2rem;
}

.search-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.search-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
    color: white;
}

.search-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.search-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

/* 搜索表单 */
.search-form {
    padding: 2rem;
}

/* 地区代码说明 */
.district-description {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(74, 156, 1, 0.03) 0%, rgba(74, 156, 1, 0.01) 100%);
    border-bottom: 1px solid var(--border-light);
    border-radius: 20px;
    margin-top: 40px;
}

.district-description p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    text-align: justify;
}

.district-description strong {
    color: var(--text-primary);
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.form-label i {
    color: var(--primary-green);
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(74, 156, 1, 0.1);
    background: var(--bg-primary);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 搜索按钮 */
.search-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-direction: row-reverse;
}

.search-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow: hidden;
    min-width: 140px;
    justify-content: center;
}

.search-btn.primary {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
    color: white;
    box-shadow: var(--shadow-md);
}

.search-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.search-btn.primary:disabled {
    background: var(--gray-300);
    color: var(--gray-500);
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

.search-btn.secondary {
    background: linear-gradient(135deg, rgba(74, 156, 1, 0.08), rgba(74, 156, 1, 0.05));
    color: var(--primary-green-dark);
    border: 1px solid rgba(74, 156, 1, 0.2);
    box-shadow: 0 2px 8px rgba(74, 156, 1, 0.1);
}

.search-btn.secondary:hover {
    background: linear-gradient(135deg, rgba(74, 156, 1, 0.15), rgba(74, 156, 1, 0.1));
    color: var(--primary-green);
    border-color: rgba(74, 156, 1, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 156, 1, 0.15);
}

/* 按钮波纹效果 */
.btn-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.search-btn:active .btn-ripple {
    width: 300px;
    height: 300px;
}

/* 查询结果区域 */
.results-section {
    margin-top: 2rem;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.results-stats {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 地区代码表格样式 - 简洁清爽版本 */
.district-table-container {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
}

.district-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: transparent;
}

.district-table thead {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
    color: white;
}

.district-table thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    white-space: nowrap;
    text-align: center
}

.district-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
}

.district-table tbody tr:hover {
    background: rgba(74, 156, 1, 0.04);
}

.district-table tbody tr:last-child {
    border-bottom: none;
}

.district-table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border: none;
    color: var(--text-primary);
    text-align: center
}

/* 列宽设置 */
.col-code {
    width: 25%;
    min-width: 120px;
    text-align: center;
}

.col-name {
    width: 75%;
    min-width: 200px;
}

/* 地区代码样式 - 简洁版本 */
.district-code {
    display: inline-block;
    background: var(--primary-green);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    letter-spacing: 0.5px;
}

/* 地区名称样式 - 简洁版本 */
.district-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* 分页样式 - 简洁版本 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem;
    flex-wrap: wrap;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.pagination-btn.active {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    margin: 0 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* 空状态样式 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border-medium);
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.empty-icon i {
    font-size: 2rem;
}

.empty-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 400px;
}

.empty-action {
    padding: 0.75rem 1.5rem;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.empty-action:hover {
    background: var(--primary-green-dark);
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .district-description {
        padding: 1rem 1.5rem;
}

.district-description p {
        font-size: 0.8rem;
        line-height: 1.5;
    }
    
    .search-title {
        font-size: 1.5rem;
    }
    
    .search-form {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .search-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .search-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .district-table-container {
        border-radius: 8px;
    }
    
    /* 确保结果区域有适当的边距 */
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin: 0 0 1.5rem 0;
    }
    
    .results-title {
        font-size: 1.3rem;
    }
    
    .district-table {
        font-size: 0.85rem;
    }
    
    .district-table thead th,
    .district-table tbody td {
        padding: 0.75rem 0.5rem;
        text-align: center
    }
    
    .col-code {
        width: 30%;
        min-width: 100px;
    }
    
    .col-name {
        width: 70%;
        min-width: 150px;
    }
    
    .district-code {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .pagination {
        gap: 0.25rem;
        margin: 2rem 1rem 0;
    }
    
    .pagination-btn {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
    
    .pagination-info {
        margin: 0 0.5rem;
        font-size: 0.8rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .results-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .search-header {
        padding: 1rem;
    }
    
    .district-description {
        padding: 0.75rem 1rem;
    }
    
    .district-description p {
        font-size: 0.75rem;
        line-height: 1.4;
    }
    
    .search-title {
        font-size: 1.25rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-form {
        padding: 1rem;
    }
    
    .form-input {
        padding: 0.875rem 1rem;
    }
    
    .search-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .district-table-container {
        border-radius: 6px;
    }
    
    .district-table {
        font-size: 0.8rem;
    }
    
    .district-table thead th,
    .district-table tbody td {
        padding: 0.5rem 0.25rem;
        text-align: center
    }
    
    .district-code {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .pagination-btn {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-icon {
        width: 60px;
        height: 60px;
    }
    
    .empty-icon i {
        font-size: 1.5rem;
    }
    
    .empty-title {
        font-size: 1.3rem;
    }
}

/* 高性能动画和微交互 */
.district-table tbody tr {
    contain: layout style paint;
    will-change: transform, box-shadow;
}

.district-table tbody tr:hover {
    will-change: auto;
}

/* 无障碍性增强 */
@media (prefers-reduced-motion: reduce) {
    .district-table tbody tr,
    .district-table tbody tr::before {
        transition: none !important;
        animation: none !important;
    }
    
    .district-table tbody tr:hover {
        transform: none !important;
    }
}