/* 公共样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f2f4f8; color: #2c3345; font-size: 14px; }

/* 顶部导航 */
.nav { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 52px; background: #1f2d3d; color: #fff; position: sticky; top: 0; z-index: 10; }
.nav .logo { font-size: 16px; font-weight: 600; letter-spacing: .5px; }
.nav a { color: #aeb9c8; text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: 14px; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.active { color: #fff; background: #3a67d6; }
.nav .tip { margin-left: auto; font-size: 12px; color: #8a97a8; }

.page { max-width: 1280px; margin: 0 auto; padding: 20px 24px 48px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #d4dae3; background: #fff; color: #2c3345; border-radius: 6px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: all .15s; }
.btn:hover { border-color: #3a67d6; color: #3a67d6; }
.btn.primary { background: #3a67d6; border-color: #3a67d6; color: #fff; }
.btn.primary:hover { background: #2f57bd; }
.btn.danger:hover { border-color: #e05252; color: #e05252; }
.btn.mini { padding: 2px 8px; font-size: 12px; border-radius: 4px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* 卡片 */
.cards { display: flex; flex-wrap: wrap; gap: 14px; }
.card { width: 216px; background: #fff; border: 2px solid #e4e9f1; border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: all .15s; position: relative; }
.card:hover { border-color: #9db6ea; box-shadow: 0 3px 10px rgba(58,103,214,.1); }
.card.selected { border-color: #3a67d6; background: #f4f8ff; box-shadow: 0 3px 10px rgba(58,103,214,.16); }
.card .card-title { font-size: 15px; font-weight: 600; padding-right: 40px; word-break: break-all; }
.card .card-sub { margin-top: 6px; font-size: 12px; color: #7b8598; }
.card .card-ops { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.card:hover .card-ops, .card.selected .card-ops { opacity: 1; }
.card-add { display: flex; align-items: center; justify-content: center; min-height: 74px; color: #7b8598; border-style: dashed; font-size: 14px; }

/* 表格 */
.table-wrap { background: #fff; border: 1px solid #e4e9f1; border-radius: 10px; overflow: auto; }
table.tree { width: 100%; border-collapse: collapse; }
table.tree th { text-align: left; padding: 10px 14px; background: #f7f9fc; border-bottom: 1px solid #e4e9f1; font-size: 13px; color: #5a6577; position: sticky; top: 0; white-space: nowrap; }
table.tree td { padding: 8px 14px; border-bottom: 1px solid #f0f3f8; vertical-align: top; }
table.tree tr.row:hover td { background: #f7faff; }
.cell-name { display: flex; align-items: center; gap: 6px; }
.expander { width: 18px; height: 18px; flex: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #8a97a8; border-radius: 4px; user-select: none; font-size: 10px; }
.expander:hover { background: #e8eef9; color: #3a67d6; }
.expander.leaf { visibility: hidden; }
.cell-desc { color: #5a6577; }
.cell-detail { color: #8a97a8; font-size: 12px; max-width: 420px; white-space: pre-wrap; }
.cell-ops { white-space: nowrap; }
.cell-ops .btn { margin-right: 6px; }

/* 层级标签 */
.tag { display: inline-block; font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 4px; flex: none; }
.tag.lv1 { background: #e8effd; color: #2f57bd; }
.tag.lv2 { background: #e5f6ec; color: #1e8a53; }
.tag.lv3 { background: #fdf1e2; color: #c07a18; }
.tag.lv4 { background: #eef1f6; color: #6a7689; }
.tag.scene { background: #e8effd; color: #2f57bd; margin: 2px 4px 2px 0; }

/* 复选框（三态） */
.cbx { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1.5px solid #b9c3d2; border-radius: 4px; background: #fff; cursor: pointer; flex: none; position: relative; }
.cbx:hover { border-color: #3a67d6; }
.cbx.checked { background: #3a67d6; border-color: #3a67d6; }
.cbx.checked::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.cbx.some { border-color: #3a67d6; }
.cbx.some::after { content: ""; position: absolute; width: 8px; height: 2px; background: #3a67d6; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(20,28,40,.45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding-top: 12vh; }
.dialog { background: #fff; border-radius: 10px; width: 560px; max-width: 92vw; max-height: 76vh; display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.dialog .d-head { padding: 16px 20px 0; font-size: 16px; font-weight: 600; }
.dialog .d-body { padding: 16px 20px; overflow: auto; }
.dialog .d-foot { padding: 12px 20px 16px; text-align: right; }
.dialog .d-foot .btn { margin-left: 10px; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: #5a6577; margin-bottom: 6px; }
.form-item input, .form-item textarea { width: 100%; border: 1px solid #d4dae3; border-radius: 6px; padding: 8px 10px; font-size: 14px; font-family: inherit; outline: none; }
.form-item input:focus, .form-item textarea:focus { border-color: #3a67d6; }
.form-item textarea { min-height: 96px; resize: vertical; }
.form-item .hint { font-size: 12px; color: #98a2b3; margin-top: 4px; }
.err { color: #e05252; font-size: 12px; margin-top: 4px; }

/* 工具条 */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .search { border: 1px solid #d4dae3; border-radius: 6px; padding: 7px 12px; font-size: 13px; width: 260px; outline: none; background: #fff; }
.toolbar .search:focus { border-color: #3a67d6; }
.toolbar .stat { color: #7b8598; font-size: 13px; }
.spacer { flex: 1; }

.empty { text-align: center; color: #98a2b3; padding: 60px 0; font-size: 14px; }
.empty .big { font-size: 34px; margin-bottom: 10px; }

.section-title { font-size: 15px; font-weight: 600; margin: 22px 0 12px; display: flex; align-items: center; gap: 10px; }
.badge { font-size: 12px; color: #3a67d6; background: #e8effd; border-radius: 10px; padding: 2px 9px; font-weight: normal; }
