* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: #f5f6f8;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 搜索区 */
.search-hero {
    background: linear-gradient(135deg, #1e3c7a 0%, #2d5ab8 100%);
    padding: 80px 0 60px;
    text-align: center;
    color: white;
}

.search-hero h1 {
    font-size: 42px;
    margin-bottom: 12px;
    font-weight: 600;
}

.search-hero .subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.search-box {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 16px 140px 16px 20px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    outline: none;
}

.search-box button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 24px;
    background: #2d5ab8;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #1e3c7a;
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 10;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: #f0f7ff;
}

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

/* 搜索结果 */
.search-results {
    padding: 40px 0 60px;
}

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

.results-header h2 {
    font-size: 24px;
    color: #1e3c7a;
}

/* 标题隐藏时，计数仍保持右对齐 */
.results-header span {
    margin-left: auto;
}

.results-count {
    font-size: 14px;
    color: #666;
}

/* 分类筛选 */
.category-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.category-btn:hover {
    border-color: #2d5ab8;
    color: #2d5ab8;
}

.category-btn.active {
    background: #2d5ab8;
    color: white;
    border-color: #2d5ab8;
}

/* 分类区块 */
.result-category {
    margin-bottom: 30px;
}

.category-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2d5ab8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-title i {
    color: #2d5ab8;
}

.category-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
}

/* 结果项 */
.result-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 12px;
    transition: all 0.3s;
    border: 1px solid #eee;
}

.result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #2d5ab8;
}

.result-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #f0f7ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2d5ab8;
}

.result-content {
    flex: 1;
}

.result-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
}

.result-title a {
    color: inherit;
    text-decoration: none;
}

.result-title a:hover {
    color: #2d5ab8;
}

.result-type {
    font-size: 12px;
    color: #999;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* 空状态 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
}

.no-results i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.no-results p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    background: #2d5ab8;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn:hover {
    background: #1e3c7a;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #666;
}

.loading i {
    margin-right: 8px;
    color: #2d5ab8;
}

/* 错误状态 */
.error {
    text-align: center;
    padding: 60px 20px;
    background: #fff3f3;
    border-radius: 8px;
    color: #ff4d4f;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    min-width: 40px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

/* 筛选面板 */
.filter-panel {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 14px 18px;
    text-align: left;
}

/* 「型号搜索」分组框：与属性筛选面板同款式 */
.search-panel {
    margin-top: 0;                  /* 面板之间靠下一个的 margin-top 分隔 */
    padding-bottom: 8px;
}

.panel-head {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.panel-head h3 {
    margin: 0;
    font-size: 15px;
    color: #fff;
    font-weight: 600;
}

.filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 6px 0;
}

.filter-row + .filter-row {
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.filter-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    min-width: 90px;
}

.radio-item,
.check-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.radio-item:hover,
.check-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.radio-item input,
.check-item input {
    accent-color: #4a7fe0;
    cursor: pointer;
}

/* 天线三组单选之间的分隔竖线 */
.group-sep {
    display: inline-block;
    width: 1px;
    height: 14px;
    margin: 0 10px;
    background: rgba(255, 255, 255, 0.35);
    vertical-align: middle;
}

/* 置灰失效的选项（如勾选天线「无」后的根数单选） */
.radio-item.disabled,
.check-item.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.radio-item.disabled:hover,
.check-item.disabled:hover {
    background: none;
}

.radio-item.disabled input,
.check-item.disabled input {
    cursor: not-allowed;
}

/* 产品描述 */
.result-desc {
    margin-top: 6px;
    font-size: 13px;
    color: #888;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 列表展示 */
.result-list {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
}

.result-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.result-row:last-child {
    border-bottom: none;
}

.result-row:hover {
    background: #f7f9fc;
}

.row-index {
    flex: 0 0 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    background: #f0f3f8;
    color: #8a94a6;
    border-radius: 4px;
    font-size: 13px;
}

.row-main {
    flex: 1 1 auto;
    min-width: 0;
}

.row-title {
    display: block;
    font-size: 15px;
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-title:hover {
    color: #2d5ab8;
    text-decoration: underline;
}

.filter-tip {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.55);
}

.row-ports {
    margin: 4px 0 0;
    font-size: 13px;
    color: #1e7a45;
    line-height: 1.5;
}

.row-ports i {
    margin-right: 4px;
    opacity: 0.75;
}

.row-desc {
    margin: 4px 0 0;
    font-size: 13px;
    color: #999;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-link {
    flex: 0 0 auto;
    font-size: 13px;
    color: #2d5ab8;
    text-decoration: none;
    white-space: nowrap;
}

.row-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .row-desc,
    .row-link {
        display: none;
    }

    .result-row {
        padding: 12px 14px;
        gap: 12px;
    }
}

.page-btn:hover {
    border-color: #2d5ab8;
    color: #2d5ab8;
}

.page-btn.active {
    background: #2d5ab8;
    color: white;
    border-color: #2d5ab8;
}

.page-ellipsis {
    padding: 8px 12px;
    color: #999;
}

/* 响应式 */
@media (max-width: 768px) {
    .search-hero {
        padding: 60px 0 40px;
    }
    
    .search-hero h1 {
        font-size: 32px;
    }
    
    .category-items {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}


/* ==================== 搜索区两栏：左搜索 + 右属性筛选 ==================== */
.hero-grid {
    display: flex;
    justify-content: center;
    margin-top: 6px;
}

.hero-left {
    flex: 1;
    min-width: 0;
    max-width: 760px;
}

/* 属性筛选面板：位于「产品分类」下方，与搜索框同宽的半透明白卡 */
.hero-filter {
    width: 100%;
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(2px);
    max-height: 560px;      /* 内容多时面板内滚动，一般不会触发 */
    overflow-y: auto;
}

.hero-filter .side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-filter .side-head h3 {
    margin: 0;
    font-size: 15px;
    color: #fff;
}

.hero-filter .side-head .clear-link {
    font-size: 13px;
    color: #bfd4ff;
    text-decoration: none;
}

.hero-filter .side-head .clear-link:hover {
    text-decoration: underline;
}

.hero-filter .filter-tip {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    margin: 8px 0 0;
    line-height: 1.6;
}

/* 分类行在左栏内左对齐 */
.category-row {
    margin-top: 14px;
    justify-content: flex-start;
}

/* 扫描进度（深底面板内） */
.scan-box {
    padding: 6px 0 2px;
}

.scan-text {
    font-size: 13px;
    color: #cfe0ff;
    margin: 0 0 6px;
}

.scan-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.scan-fill {
    height: 100%;
    background: linear-gradient(90deg, #7fa8f0, #cfe0ff);
    border-radius: 3px;
    transition: width 0.3s;
}

/* 响应式：窄屏时筛选面板移到搜索框下方 */
@media (max-width: 900px) {
    .hero-grid {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-left {
        max-width: none;
    }

    .hero-filter {
        width: 100%;
        max-height: none;
    }
}


/* ==================== 结果表格 ==================== */
.table-card {
    background: white;
    border: 1px solid #e8edf5;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(30, 60, 122, 0.08);
    overflow: hidden;
}

.result-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

/* 表头：浅蓝渐变 + 吸顶 */
.result-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, #f7f9fd 0%, #eef3fb 100%);
    color: #1e3c7a;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid #dde5f2;
    white-space: nowrap;
}

.result-table tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid #f0f3f8;
    color: #333;
    vertical-align: middle;
}

.result-table tbody tr {
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.result-table tbody tr:nth-child(even) {
    background: #fbfcfe;
}

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

.result-table tbody tr:hover {
    background: #f2f7ff;
}

/* 序号：圆角小徽章 */
.result-table .col-index {
    width: 78px;
    text-align: center;
}

.idx-badge {
    display: inline-block;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #eef3fb;
    color: #5a78b8;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

/* 序号徽章在鼠标悬停时保持原样式，不跟随行高亮变化 */

/* 型号：蓝色链接 + 外链小图标 */
.result-table .col-model a {
    color: #2d5ab8;
    text-decoration: none;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: color 0.15s ease;
}

.result-table .col-model a i {
    font-size: 11px;
    color: #a8bde3;
    transition: color 0.15s ease, transform 0.15s ease;
}

.result-table .col-model a:hover {
    color: #1e3c7a;
    text-decoration: underline;
}

.result-table .col-model a:hover i {
    color: #1e3c7a;
    transform: translate(2px, -2px);
}

/* 空结果提示 */
.results-list > p {
    background: white;
    border: 1px dashed #d9e2f0;
    border-radius: 8px;
    padding: 22px;
    color: #777;
    text-align: center;
}

/* 窄屏适配 */
@media (max-width: 600px) {
    .result-table thead th,
    .result-table tbody td {
        padding: 9px 10px;
        font-size: 13px;
    }

    .result-table .col-index {
        width: 52px;
    }

    .idx-badge {
        min-width: 22px;
        padding: 2px 6px;
        font-size: 11px;
    }
}

/* ==================== 表格单元格辅助样式 ==================== */
.result-table .cell-ports {
    color: #2c8a5a;
    font-size: 13px;
}

.result-table .cell-empty {
    color: #c2cad8;
}

/* 多列时型号列不挤压，其余列自适应 */
.result-table .col-model {
    min-width: 200px;
}

/* ==================== 多列表格 ==================== */
.table-scroll {
    overflow-x: auto;
}

/* 多列表格：默认宽度自适应铺满容器，窄屏才横向滚动 */
.result-table-multi {
    width: 100%;
    min-width: 860px;   /* 仅在窄屏出现横向滚动 */
}

/* 表头不换行；单元格允许换行，避免长文本把表格撑出容器 */
.result-table-multi thead th {
    white-space: nowrap;
}

.result-table-multi tbody td {
    white-space: normal;
    font-size: 13px;
    line-height: 1.45;
}

.result-table-multi .col-model {
    white-space: normal;
    min-width: 220px;
}

/* ==================== 成对「类型 + 数量」列 ==================== */
/* key 以 Type / Count 结尾的列自动套用，新增成对列无需再写样式 */
.result-table th[class$="Type"],
.result-table td[class$="Type"] {
    color: #5a6b85;
}

.result-table th[class$="Count"],
.result-table td[class$="Count"] {
    text-align: center;
    background: #fafcff;
    color: #1e3c7a;
    font-weight: 600;
    font-size: 13px;
}

.result-table th[class$="Count"] {
    background: #f2f6fc;
    font-weight: 500;
    color: #6a7e9e;
    font-size: 12px;
}

.result-table tbody tr:hover td[class$="Count"] {
    background: #eaf1fb;
}

/* 多列表格下型号列只展示纯型号，宽度收窄给后面的规格列让位 */
.result-table-multi .col-model {
    min-width: 150px;
}

/* 数量列内容短，去掉内边距冗余 */
.result-table-multi th[class$="Count"],
.result-table-multi td[class$="Count"] {
    padding-left: 6px;
    padding-right: 6px;
}

/* ==================== 操作列 ==================== */
.result-table .col-action {
    text-align: center;
}

.row-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid #d6e0f0;
    border-radius: 14px;
    background: #fff;
    color: #2d5ab8;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.row-action i {
    font-size: 10px;
}

.row-action:hover {
    background: #2d5ab8;
    border-color: #2d5ab8;
    color: #fff;
}

/* 列多时收紧单元格留白，避免总宽超出 .container 可用区（约 1160px） */
.result-table-multi thead th {
    padding: 10px 8px;
}

.result-table-multi tbody td {
    padding: 9px 8px;
}

/* ==================== 操作列：已添加 / 可添加 ==================== */
.result-table .col-action {
    text-align: center;
}

.tag-added,
.tag-add {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    line-height: 1.6;
    white-space: nowrap;
    border: 1px solid transparent;
}

/* 已在库中：灰色圆角矩形，不可点 */
.tag-added {
    background: #eceef2;
    border-color: #e2e6ed;
    color: #98a0ae;
    cursor: default;
}

/* 未收录：绿色圆角矩形，链接按钮 */
.tag-add {
    background: #e9f8ef;
    border-color: #b7e6c8;
    color: #1a9c55;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tag-add i {
    font-size: 10px;
}

.tag-add:hover {
    background: #1a9c55;
    border-color: #1a9c55;
    color: #fff;
}

.tag-add[disabled] {
    opacity: 0.6;
    pointer-events: none;
}
