/* ===== 三栏浏览页专用样式 ===== */
* { box-sizing: border-box; }

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ===== 顶部 ===== */
.app-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.brand-mark {
    font-size: 22px;
}

.brand-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.search-wrap {
    position: relative;
    flex: 1;
    max-width: 480px;
}

.search-wrap input {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #fafafa;
    transition: border-color 0.2s;
}

.search-wrap input:focus {
    border-color: var(--primary);
    background: #fff;
}

.suggest-box {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    max-height: 320px;
    overflow-y: auto;
    z-index: 200;
}

.suggest-box.hidden { display: none; }

.suggest-item {
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
}

.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: #f5f7ff; }
.suggest-item .s-cat {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 6px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.ghost-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.ghost-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

/* ===== 三栏布局 ===== */
.layout {
    display: grid;
    grid-template-columns: 220px 1fr 380px;
    flex: 1;
    overflow: hidden;
}

/* 左：分类 */
.sidebar {
    background: #fff;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px 12px;
}

.side-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 8px 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.side-loading {
    padding: 12px 8px;
    font-size: 13px;
    color: #ccc;
}

.cat-group {
    margin-bottom: 4px;
}

.cat-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: none;
    border-radius: 8px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.cat-btn:hover { background: #f5f7ff; }

.cat-btn.active {
    background: #eef1fe;
    color: var(--primary);
    font-weight: 600;
}

.cat-btn .cat-count {
    font-size: 11px;
    color: #bbb;
    margin-left: 6px;
}

.cat-children {
    padding-left: 14px;
    margin-bottom: 6px;
    display: none;
}

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

.cat-btn .cat-arrow {
    margin-left: auto;
    font-size: 10px;
    color: #bbb;
    transition: transform 0.2s;
    margin-right: 4px;
}

.cat-btn .cat-arrow.rotated {
    transform: rotate(90deg);
}

.cat-sub-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 6px 10px;
    border: none;
    background: none;
    border-radius: 6px;
    font-size: 12.5px;
    color: #777;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.cat-sub-btn:hover { background: #f5f7ff; }

.cat-sub-btn.active {
    background: #eef1fe;
    color: var(--primary);
    font-weight: 600;
}

.cat-sub-btn .cat-count {
    margin-left: auto;
    font-size: 10.5px;
    color: #bbb;
}

/* 中：结果列表 */
.main {
    overflow-y: auto;
    padding: 16px 20px;
    border-right: 1px solid var(--border);
}

.pane-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.pane-head h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.pane-head .count {
    font-size: 12px;
    color: var(--text-muted);
}

.results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.result-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s;
}

.result-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(79,110,247,0.1);
}

.result-card.active {
    border-color: var(--primary);
    background: #f7f9ff;
}

.result-card-head {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #f0f2ff, #e8ecfd);
    font-size: 11px;
    color: var(--primary);
    font-weight: 700;
}

.result-card-body {
    padding: 10px;
}

.result-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.result-card-vals {
    font-size: 11px;
    color: #666;
    line-height: 1.6;
}

.load-anchor {
    height: 1px;
}

.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty.hidden { display: none; }

/* 右：详情 */
.detail {
    overflow-y: auto;
    padding: 20px;
    background: #fafbfd;
}

.detail-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #bbb;
    text-align: center;
}

.detail-placeholder .ph-icon {
    font-size: 42px;
    margin-bottom: 10px;
}

.detail-placeholder p {
    font-size: 13px;
}

.detail-placeholder.hidden { display: none; }
#detailBody.hidden { display: none; }

.d-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.d-cat {
    display: inline-block;
    font-size: 12px;
    color: var(--primary);
    background: #eef1fe;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.d-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    margin-bottom: 18px;
}

.d-spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 18px;
}

.d-spec-table th {
    padding: 7px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    background: #f2f4fa;
}

.d-spec-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eef0f5;
}

.d-spec-table .highlight {
    color: var(--primary);
    font-weight: 700;
}

.d-meta-row {
    display: flex;
    gap: 8px;
    font-size: 12.5px;
    margin-bottom: 8px;
}

.d-meta-row .m-label {
    color: var(--text-muted);
    min-width: 64px;
    flex-shrink: 0;
}

.d-tag {
    display: inline-block;
    font-size: 11px;
    background: #eef1fe;
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    margin: 2px 3px 2px 0;
    cursor: pointer;
    text-decoration: none;
}

.d-link {
    display: block;
    margin-top: 10px;
    padding: 9px;
    background: #ff6a00;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
}

.d-link:hover { background: #e05a00; color: #fff; text-decoration: none; }

.d-full-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== 响应式：小屏隐藏侧栏，改成弹层式（简化处理：横向滚动三栏） ===== */
@media (max-width: 1000px) {
    .layout {
        grid-template-columns: 180px 1fr 320px;
    }
}

@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
    .sidebar, .main, .detail {
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow-y: visible;
        max-height: none;
    }
    .app {
        overflow: auto;
        height: auto;
        min-height: 100vh;
    }
    html, body {
        overflow: auto;
    }
}

