/* ===== 3D CAD 分类树（cad-tree）===== */
.cad-sidebar{background:#fff;border:1px solid #e6eaf2;border-radius:12px;padding:20px 14px;}
.cad-sidebar-head{border-bottom:1px solid #eef1f6;padding:0 8px 14px;margin-bottom:10px;}
.cad-sidebar-head h4{margin:0;font-size:16px;color:#181828;font-weight:700;}
.cad-sidebar-head h4 a{color:#0f4c92;}
.cad-sidebar-head h4 a:hover{text-decoration:none;color:#0a3f7d;}

ul.cad-tree{list-style:none;margin:0;padding:0;}
/* 子层：max-height 过渡实现丝滑展开/收起（px→px，全浏览器兼容） */
ul.cad-tree ul.cad-tree{
    max-height:0;
    overflow:hidden;
    transition:max-height .38s cubic-bezier(.4,0,.2,1);
    padding-left:0;
}
/* 展开态保持：JS 动画结束后清空内联 max-height，回落到此规则维持展开 */
ul.cad-tree li.open > ul.cad-tree{max-height:6000px;}
ul.cad-tree ul.cad-tree > li{min-height:0;}

/* 行 */
.cad-tree-row{
    position:relative;
    display:flex;align-items:center;
    padding:6px 8px 6px 12px;
    border-radius:8px;
    font-size:13.5px;line-height:1.5;
    transition:background .2s ease;
}
.cad-tree-row:hover{background:#f2f6fc;}
.cad-tree-row.active{
    background:linear-gradient(90deg,#e7f0ff,#f4f8ff);
    color:#0f4c92;font-weight:600;
}
.cad-tree-row.active:before{
    content:'';position:absolute;left:0;top:7px;bottom:7px;width:3px;border-radius:3px;background:#0f4c92;
}
.cad-tree-row.active a{color:#0f4c92;font-weight:600;}
.cad-tree-row a{color:#3c465a;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:2px 0;}
.cad-tree-row a:hover{color:#0f4c92;text-decoration:none;}

/* 展开箭头（CSS 三角 + 旋转动画） */
.cad-tree-toggle{
    width:20px;height:20px;flex-shrink:0;
    display:inline-flex;align-items:center;justify-content:center;
    margin-right:2px;cursor:pointer;user-select:none;border-radius:5px;
    transition:background .2s ease;
}
.cad-tree-toggle:hover{background:#e3ebf7;}
.cad-caret{
    display:block;width:0;height:0;
    border-left:5px solid #aab4c6;
    border-top:4px solid transparent;
    border-bottom:4px solid transparent;
    transition:transform .3s cubic-bezier(.4,0,.2,1);
}
li.has-kids > .cad-tree-row .cad-caret{border-left-color:#5d6679;}
li.open > .cad-tree-row .cad-caret{transform:rotate(90deg);}
.cad-tree-toggle-empty{width:20px;flex-shrink:0;}

/* 缩进 + 层级引导线 */
ul.cad-tree ul.cad-tree > li{position:relative;padding-left:22px;}
ul.cad-tree ul.cad-tree > li:before{
    content:'';position:absolute;left:10px;top:0;bottom:0;width:1px;background:#e8edf5;
}
ul.cad-tree ul.cad-tree > li:last-child:before{height:50%;}

/* 计数徽章 */
.cad-tree-count{
    font-style:normal;font-size:11px;color:#0f4c92;
    background:#eaf1ff;border-radius:10px;padding:1px 8px;margin-left:6px;font-weight:600;
    flex-shrink:0;
}

.cad-sidebar-cta{margin-top:16px;border-top:1px dashed #e6eaf2;padding:16px 8px 4px;text-align:center;}
.cad-sidebar-cta p{font-size:12.5px;color:#6b7280;margin:0 0 10px;}
