/* ================================================
   申报要素查询工具专用样式
   ================================================ */

/* 导航下拉菜单样式 */
.nav-tab-dropdown {
    position: relative;
    display: inline-block;
}

.nav-tab-dropdown .nav-tab {
    position: relative;
}

.dropdown-arrow {
    font-size: 0.75rem;
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.nav-tab-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem 0;
    backdrop-filter: blur(10px);
}

.nav-tab-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.8rem;
    position: relative;
    overflow: hidden;
}

.nav-dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-green-alpha), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

.nav-dropdown-item:hover {
    color: var(--primary-green);
    text-decoration: none;
    transform: translateX(4px);
}

.nav-dropdown-item:hover::before {
    opacity: 1;
}

.nav-dropdown-item.active {
    background: var(--primary-green);
    color: white;
    font-weight: 600;
}

.nav-dropdown-item.active::before {
    opacity: 0;
}

.nav-dropdown-item i {
    margin-right: 0.75rem;
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
}

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

/* 搜索区域 */
.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;
}

.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:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-primary) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    background: var(--bg-primary) !important;
    border-color: var(--primary-green) !important;
}

/* 修复Firefox自动填充样式 */
.form-input:-moz-autofill {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

.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; /* PC端：开始查询按钮在右侧，重置按钮在左侧 */
}

.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;
}

/* 申报要素说明 */
.declaration-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;
}

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

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

/* 查询结果区域 */
.results-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    overflow: visible;
}

.results-header {
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

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

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

/* 申报要素表格 */
.declaration-table-container {
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}


.declaration-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--bg-primary);
}

.declaration-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 5;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.declaration-table td {
    padding: 0.8rem;
    word-wrap: break-word;
    word-break: break-all;
    line-height: 1.5;
}

.declaration-table tbody tr {
    transition: all 0.2s ease;
}

.declaration-table tbody tr:hover {
    background: var(--primary-green-alpha);
}

.declaration-table tbody tr:nth-child(even):hover {
    background: var(--primary-green-alpha);
}

/* 表格列宽 */
.col-code {
    width: 15%;
    min-width: 120px;
}

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

.col-elements {
    width: 60%;
    min-width: 300px;
}

/* 商品编码链接 */
.hscode-link {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--primary-green-alpha);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.hscode-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.hscode-link:hover::before {
    left: 100%;
}

.hscode-link:hover {
    color: white;
    background: var(--primary-green);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 商品名称 */
.product-name {
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
    font-size: 0.9rem;
}

/* 申报要素 */
.declaration-elements {
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    font-size: 0.85rem;
}

/* 分页样式 */
.pagination {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn:hover {
    background: var(--primary-green-alpha);
    color: var(--primary-green);
    border-color: var(--primary-green);
    text-decoration: none;
}

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

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1.5rem;
}

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

.empty-description {
    font-size: 1rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.empty-action {
    padding: 0.75rem 2rem;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.empty-action:hover {
    background: var(--primary-green-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 现代化动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.declaration-table tbody tr {
    animation: fadeInUp 0.3s ease forwards;
    border-bottom:1px solid var(--border-light)
}

.declaration-table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.declaration-table tbody tr:nth-child(2) { animation-delay: 0.15s; }
.declaration-table tbody tr:nth-child(3) { animation-delay: 0.2s; }
.declaration-table tbody tr:nth-child(4) { animation-delay: 0.25s; }
.declaration-table tbody tr:nth-child(5) { animation-delay: 0.3s; }

.search-card {
    animation: fadeInUp 0.5s ease forwards;
}

.results-section {
    animation: fadeInUp 0.4s ease forwards;
    margin-bottom:2rem;
}

/* 加载状态 */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .declaration-description {
        padding: 1rem 1.5rem;
    }
    
    .declaration-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;
    }
    
    .results-header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .declaration-table th,
    .declaration-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
        line-height: 1.4;
    }
    
    .col-code {
        width: 30%;
        min-width: 80px;
    }
    
    .col-name {
        width: 35%;
        min-width: 100px;
    }
    
    .col-elements {
        width: 35%;
        min-width: 120px;
    }
    
    /* 移动端：确保表格一行显示，无横向滚动 */
    .declaration-table-container {
        overflow-x: hidden;
        overflow-y: visible;
    }
    
    .declaration-table {
        table-layout: fixed;
        width: 100%;
    }
    
    /* 移动端：统一字体大小，确保内容铺满 */
    .product-name {
        font-size: 0.8rem;
        font-weight: 500;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        width: 100%;
        line-height: 1.4;
    }
    
    .declaration-elements {
        font-size: 0.8rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        width: 100%;
        line-height: 1.4;
    }
    
    .hscode-link {
        font-size: 0.85rem;
        padding: 0.2rem 0.4rem;
    }
    
    .declaration-elements {
        font-size: 0.85rem;
        padding: 0.5rem;
    }
    
    .pagination {
        padding: 0.75rem;
        flex-wrap: wrap;
        gap: 0.25rem;
        justify-content: center;
    }
    
    .pagination-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        min-width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .pagination-info {
        font-size: 0.75rem;
        margin: 0 0.5rem;
        order: -1;
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .nav-dropdown-menu {
        position: fixed;
        left: 1rem;
        right: 1rem;
        top: auto;
        width: auto;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .search-header {
        padding: 1.5rem 1rem 1rem;
    }
    
    .search-title {
        font-size: 1.5rem;
    }
    
    .empty-state {
        padding: 3rem 1rem;
    }
    
    .empty-icon {
        font-size: 3rem;
    }
    
    .empty-title {
        font-size: 1.25rem;
    }
}
