/* HTS数据查询系统样式文件 */

/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    font-weight: 500;
}

.upload-zone {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: #fdfdfd;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.upload-zone.dragover {
    border-color: #0d6efd;
    background-color: #f0f7ff;
}

@media (max-width: 576px) {
    .upload-zone .row .col {
        flex: 1 0 100%;
    }
    .upload-zone .row .col-auto {
        margin-top: 0.25rem;
    }
}

/* 搜索框样式 */
#searchInput {
    border-radius: 0.375rem 0 0 0.375rem;
    border-right: none;
}

#searchBtn {
    border-radius: 0 0.375rem 0.375rem 0;
    padding: 0.75rem 1.5rem;
}

/* 搜索结果样式 */
.search-result-item {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
    padding: 1rem;
    background-color: #fff;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

/* 详情页面双语描述样式 */
.bilingual-description .chinese-text {
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 1rem;
    display: block;
    line-height: 1.5;
}

.bilingual-description .english-text {
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
    display: block;
    margin-left: 0;
    padding-left: 1rem;
    border-left: 3px solid #e9ecef;
    line-height: 1.4;
}

/* 查询流程图样式 */
.flow-diagram-svg {
    width: 100%;
    height: auto;
}
.flow-node .node-rect {
    fill: #f8f9fa;
    stroke: #6c757d;
    stroke-width: 1.5;
    rx: 8;
}
.flow-node:hover .node-rect {
    stroke: #0d6efd;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    cursor: pointer;
}
.flow-node text {
    font-size: 12px;
    fill: #343a40;
}
.flow-node.active .node-rect {
    stroke: #0d6efd;
    fill: #e7f1ff;
}
.flow-node.done .node-rect {
    stroke: #198754;
    fill: #eaf6ef;
}
.flow-edge {
    stroke: #adb5bd;
    stroke-width: 1.5;
    marker-end: url(#arrowHead);
}
.flow-edge.active {
    stroke: #0d6efd;
}
.flow-legend {
    font-size: 12px;
    color: #6c757d;
}

.search-result-item:hover {
    border-color: #0d6efd;
    box-shadow: 0 0.25rem 0.5rem rgba(13, 110, 253, 0.15);
    transform: translateY(-1px);
}

.search-result-item.selected {
    border-color: #0d6efd;
    background-color: #f8f9ff;
}

.hts-code {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #0d6efd;
    font-size: 1.1rem;
}

.description {
    color: #495057;
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.rate-info {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.rate-badge {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 500;
    margin-right: 4px;
    display: inline-block;
}

.rate-badge.free {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.rate-badge.rate {
    background-color: #fff3e0;
    color: #f57c00;
}

/* 综合税率颜色分档 */
/* 让综合税率更显眼：使用更饱和的背景色、边框与更高字重 */
.rate-badge.composite-free {
    background-color: #d1e7dd; /* 更饱和的绿色背景 */
    color: #0f5132;           /* 深绿色文字 */
    border: 1px solid #95d5b2;
    font-weight: 600;
}
.rate-badge.composite-low {
    background-color: #cfe2ff; /* 更醒目的蓝色背景 */
    color: #084298;            /* 深蓝文字 */
    border: 1px solid #9ec5fe;
    font-weight: 600;
}
.rate-badge.composite-mid {
    background-color: #ffe5b3; /* 更饱和的橙色背景 */
    color: #a15c00;            /* 深橙文字 */
    border: 1px solid #ffd08a;
    font-weight: 600;
}
.rate-badge.composite-high {
    background-color: #ffccd5; /* 更强的红色背景 */
    color: #842029;            /* 深红文字 */
    border: 1px solid #f1aeb5;
    font-weight: 700;
}

/* 搜索结果节点的税率信息容器 */
.rate-info {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

/* 搜索结果节点特殊样式 */
.tree-node[data-level="search_result"] {
    background-color: #f8f9fa;
    border-left: 3px solid #28a745;
}

.tree-node[data-level="search_result"] .tree-content {
    padding: 8px;
}

.tree-node[data-level="search_result"] .level-indicator {
    background-color: #28a745;
    color: white;
    font-weight: bold;
}

/* 树形结构样式 */
.tree-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.tree-node {
    margin: 0.25rem 0;
    border-left: 2px solid #dee2e6;
    padding-left: 1rem;
    position: relative;
}

.tree-node.level-chapter {
    border-left-color: #dc3545;
    background-color: #fff5f5;
}

.tree-node.level-heading {
    border-left-color: #fd7e14;
    background-color: #fff8f0;
}

.tree-node.level-subheading {
    border-left-color: #198754;
    background-color: #f0fff4;
}

.tree-node.target {
    background-color: #e7f3ff;
    border-left-color: #0d6efd;
    border-left-width: 4px;
}

.tree-node-header {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.tree-node-header:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

.tree-toggle {
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
}

.tree-toggle:hover {
    background-color: #e9ecef;
    color: #495057;
}

.tree-toggle.expanded {
    transform: rotate(90deg);
}

.tree-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tree-info {
    flex: 1;
}

.tree-actions {
    display: flex;
    gap: 0.5rem;
}

.tree-children {
    margin-left: 1.5rem;
    border-left: 1px dashed #dee2e6;
    padding-left: 1rem;
    display: none;
}

.tree-children.expanded {
    display: block;
}

.level-indicator {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 0.25rem;
    margin-right: 0.5rem;
    text-transform: uppercase;
}

.level-indicator.chapter {
    background-color: #dc3545;
    color: white;
}

.level-indicator.heading {
    background-color: #fd7e14;
    color: white;
}

.level-indicator.subheading {
    background-color: #198754;
    color: white;
}

/* 详情模态框样式 */
.detail-table {
    font-size: 0.9rem;
    width: 100%;
}

.detail-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    width: 30%;
    vertical-align: top;
    padding: 0.75rem;
}

.detail-table td {
    padding: 0.75rem;
    word-break: break-word;
}

.field-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.field-group-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
}

/* 关贸协定表格样式 */
.trade-agreement-table {
    width: 100%;
    font-size: 0.85rem;
}

.trade-agreement-table th {
    background-color: #f1f8ff;
    font-weight: 600;
    padding: 0.6rem;
    text-align: center;
}

.trade-agreement-table td {
    padding: 0.6rem;
    text-align: center;
}

.trade-agreement-table td:first-child {
    text-align: left;
    font-weight: 500;
}

/* 详情模态框宽度 */
.modal-xl {
    max-width: 95%;
}

/* 非关贸协定字段表格 */
.non-trade-fields-table {
    width: 100%;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid #dee2e6;
}

/* 统计信息样式 */
.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #dee2e6;
}

.stats-item:last-child {
    border-bottom: none;
}

.stats-label {
    font-weight: 500;
    color: #495057;
}

.stats-value {
    font-weight: 600;
    color: #0d6efd;
    font-family: 'Courier New', monospace;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .rate-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tree-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .tree-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .tree-node {
        padding-left: 0.5rem;
    }
    
    .tree-children {
        margin-left: 1rem;
        padding-left: 0.5rem;
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.slide-down {
    animation: slideDown 0.3s ease-in-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 双语描述样式 */
.description-text.bilingual {
    line-height: 1.4;
}

.chinese-text {
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 2px;
    font-size: 0.95rem;
}

.english-text {
    color: #6c757d;
    font-size: 0.85rem;
    font-style: italic;
    margin-left: 8px;
}

/* 打印样式 */
@media print {
    .navbar,
    .modal,
    .toast-container,
    #loadingSpinner {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .tree-node-header:hover {
        background-color: transparent;
    }
}
