/* ================================================
   3C认证查询工具专用样式
   基于机场查询样式，适配3C认证查询需求
   ================================================ */

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

.form-input.error {
    border-color: var(--error-color, #dc3545);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

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

/* PC端按钮布局：重置在左，查询在右 */
@media (min-width: 769px) {
    .search-actions {
        justify-content: center;
        flex-direction: row;
    }
    
    .search-btn.secondary {
        order: 1;
    }
    
    .search-btn.primary {
        order: 2;
    }
}

.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 0.3s ease;
    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;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    width: 0;
    height: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

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

/* 演示单号样式 */
.demo-bill-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.demo-bill-number {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-green);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    margin-left: 0.5rem;
}

.demo-bill-number:hover {
    background: var(--primary-green-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* 3C认证查询说明 */
.ccc-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;
}

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

.ccc-description p:first-child {
    margin-top: 0;
}

.ccc-description p:last-child {
    margin-bottom: 0;
}

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

/* 结果区域 */
.results-section {
    animation: fadeInUp 0.5s ease-out;
}

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

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-title::before {
    content: '\f3ed';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--primary-green);
    font-size: 1.25rem;
}

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

/* 3C认证表格样式 */
.ccc-table-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

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

.ccc-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-medium);
    position: sticky;
    top: 0;
    z-index: 5;
    font-size: 0.875rem;
    letter-spacing: 0.3px;
    white-space: nowrap;
    vertical-align: middle;
}

.ccc-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
    line-height: 1.4;
}

.ccc-table tbody tr {
    transition: all 0.2s ease;
    animation: fadeInUp 0.3s ease forwards;
}

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

.ccc-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

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

/* 表格列宽设置 */
.col-hs-code {
    width: 120px;
    min-width: 120px;
}

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

.col-category {
    width: 150px;
    min-width: 150px;
}

.col-scope {
    width: 200px;
    min-width: 200px;
}

.col-authentication {
    width: 180px;
    min-width: 180px;
}

.col-detail {
    width: 220px;
    min-width: 220px;
}

/* HS编码样式 */
.hs-code {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
    color: white;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 1px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    box-shadow: var(--shadow-sm);
    vertical-align: middle;
}

/* HS编码所在的单元格居中对齐 */
.ccc-table .col-hs-code {
    text-align: center;
    vertical-align: middle;
}

.hs-code.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.hs-code.clickable:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--primary-green-dark), var(--primary-green));
}

/* 产品信息样式 */
.product-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.3;
    word-break: break-word;
}

.category {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
}

/* 内容区域样式 */
.scope-content,
.authentication-content,
.detail-content {
    position: relative;
}

.text-truncated {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-word;
    margin-bottom: 0.5rem;
}

.detail-link {
    color: var(--primary-green);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    background: rgba(74, 156, 1, 0.1);
}

.detail-link:hover {
    background: var(--primary-green);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(5px);
}

.modal-container {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
    color: white;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-label::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary-green);
    border-radius: 2px;
}

.detail-value {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9rem;
    padding-left: 1rem;
}

.detail-value.hs-code-display {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-green);
    background: rgba(74, 156, 1, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    display: inline-block;
    margin-left: 0;
}

.detail-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: var(--bg-secondary);
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.9rem;
}

.modal-btn.secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.modal-btn.secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-green);
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--card-background);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: 2rem;
}

.empty-state .empty-icon {
    font-size: 3rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

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

.empty-state .empty-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.empty-state .empty-action {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

.pagination-btn:hover {
    background: var(--primary-green-alpha);
    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 {
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-ellipsis {
    color: var(--text-muted);
    padding: 0.5rem 0.25rem;
    font-size: 0.875rem;
}

/* 响应式设计 */
/* 移动端布局 */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* 移动端按钮布局：查询在上，重置在下 */
    .search-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .search-btn.primary {
        order: 1;
    }
    
    .search-btn.secondary {
        order: 2;
    }
    
    .search-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .ccc-table-container {
        overflow-x: auto;
    }
    
    .ccc-table {
        min-width: 1000px;
    }
    
    .ccc-table th,
    .ccc-table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .hs-code {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .modal-container {
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 1.5rem;
        max-height: 70vh;
    }
}

@media (max-width: 480px) {
    .search-form {
        padding: 1.5rem;
    }
    
    .ccc-description {
        padding: 1rem;
    }
    
    .form-input {
        padding: 0.875rem 1rem;
    }
    
    .search-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .ccc-table th,
    .ccc-table td {
        padding: 0.4rem 0.3rem;
        font-size: 0.75rem;
    }
    
    .hs-code {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .product-name {
        font-size: 0.8rem;
    }
    
    .category {
        font-size: 0.75rem;
    }
    
    .text-truncated {
        font-size: 0.75rem;
    }
    
    .detail-link {
        font-size: 0.7rem;
        padding: 0.15rem 0.3rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .detail-value {
        font-size: 0.85rem;
    }
}

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ccc-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.ccc-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.ccc-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.ccc-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.ccc-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.ccc-table tbody tr:nth-child(6) { animation-delay: 0.3s; }
.ccc-table tbody tr:nth-child(7) { animation-delay: 0.35s; }
.ccc-table tbody tr:nth-child(8) { animation-delay: 0.4s; }

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

.results-section {
    animation: fadeInUp 0.4s ease forwards;
}

/* 高亮输入框动画 */
.highlight-input {
    animation: highlightPulse 1s ease-in-out;
    border-color: var(--primary-green) !important;
    box-shadow: 0 0 0 3px rgba(74, 156, 1, 0.1) !important;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 156, 1, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 156, 1, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 156, 1, 0);
    }
}

/* 查询加载动画特定调整 */
.query-loading-text {
    margin-bottom: 0.5rem;
}

.query-loading-subtext {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 暗色主题适配 */
[data-theme="dark"] .ccc-table tbody tr:nth-child(even) {
    background: rgba(55, 65, 81, 0.3);
}

[data-theme="dark"] .detail-value.hs-code-display {
    background: rgba(74, 156, 1, 0.2);
    color: var(--primary-green-light);
}
