/* ===== D2Admin 风格外壳 ===== */
html, body, #app { height: 100%; margin: 0; padding: 0; width: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; color: #303133; background: #f5f7f9; }

.boot-loading { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #303133; }
.boot-loading__title { color: #fff; font-size: 14px; margin-bottom: 10px; }
.boot-loading__sub { color: #ababab; font-size: 12px; }

.d2-layout { height: 100%; }
.d2-header { height: 56px !important; background: #fff; border-bottom: 1px solid #e4e7ed; display: flex; align-items: center; padding: 0 16px; }
.d2-header__logo { font-weight: 600; font-size: 16px; color: #303133; margin-right: 12px; display: flex; align-items: center; }
.d2-header__logo .el-tag { margin-left: 8px; }
.d2-header__right { margin-left: auto; display: flex; align-items: center; gap: 16px; color: #606266; font-size: 13px; }
.d2-aside { background: #fff; border-right: 1px solid #e4e7ed; overflow-y: auto; }
.d2-aside .el-menu { border-right: none; }
.d2-aside .el-menu-item.is-placeholder { color: #c0c4cc; cursor: not-allowed; }
.d2-tabs { background: #fff; border-bottom: 1px solid #e4e7ed; padding: 6px 12px 0; }
.d2-tabs .el-tabs__header { margin: 0; }
.d2-main { padding: 16px; overflow: auto; }

/* ===== 通用页面 ===== */
.page-card { background: #fff; border-radius: 4px; padding: 16px 20px; box-shadow: 0 1px 4px rgba(0,21,41,.06); }
.page-card + .page-card { margin-top: 16px; }
.page-toolbar { display: flex; align-items: center; margin-bottom: 14px; gap: 12px; }
.page-toolbar .grow { flex: 1; }
.page-title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.page-sub { color: #909399; font-size: 12px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.ml-8 { margin-left: 8px; } .mr-8 { margin-right: 8px; }
.text-muted { color: #909399; } .text-danger { color: #f56c6c; } .text-success { color: #67c23a; } .text-warning { color: #e6a23c; } .text-primary { color: #409eff; }
.mono { font-family: Menlo, Monaco, Consolas, monospace; font-size: 12px; }
.tag-list .el-tag { margin-right: 4px; margin-bottom: 2px; }
.cell-tip { color: #909399; font-size: 12px; }

/* 编辑页 */
.edit-tabs .el-tabs__content { padding-top: 8px; }
.edit-footer { position: sticky; bottom: 0; background: #fff; padding: 12px 20px; border-top: 1px solid #e4e7ed; display: flex; gap: 10px; margin: 16px -20px -16px; border-radius: 0 0 4px 4px; }
.editable-table .el-input, .editable-table .el-select, .editable-table .el-input-number { width: 100%; }
.tab-error .el-badge__content { background: #f56c6c; }
.tab-label-error { color: #f56c6c; }

/* diff 配色（沿用线上辅料同步页：新增绿 / 变更橙 / 移除红 / 保留灰） */
.row-add    td { background: #f0f9eb !important; }
.row-replace td { background: #fdf6ec !important; }
.row-removed td { background: #fef0f0 !important; }
.row-keep   td { background: #fafafa !important; color: #909399; }
.row-create td { background: #ecf5ff !important; }
.diff-legend { display: flex; gap: 14px; font-size: 12px; color: #606266; align-items: center; }
.diff-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 4px; vertical-align: -2px; border: 1px solid #dcdfe6; }
.diff-legend .lg-add { background: #f0f9eb; } .diff-legend .lg-replace { background: #fdf6ec; } .diff-legend .lg-removed { background: #fef0f0; } .diff-legend .lg-keep { background: #fafafa; } .diff-legend .lg-create { background: #ecf5ff; }

.diff-section { margin: 8px 0 14px; }
.diff-section__title { font-weight: 600; font-size: 13px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.expand-inner { padding: 6px 12px 10px 40px; background: #fafbfc; }
.expand-inner .el-table { margin-bottom: 10px; }

/* 向导 */
.run-steps { margin: 8px 0 24px; }
.run-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.warn-bar { display: flex; align-items: center; gap: 12px; }
.warn-bar .grow { flex: 1; }
.decision-box { background: #fdf6ec; border: 1px solid #faecd8; border-radius: 4px; padding: 10px 14px; margin-bottom: 10px; }
.decision-box__title { color: #e6a23c; font-weight: 600; margin-bottom: 6px; }
.decision-box .el-radio { display: block; margin: 6px 0 0; line-height: 20px; }
.decision-box .el-radio__label { white-space: normal; }
.config-sub { padding: 4px 0 4px 48px; }
.config-sub .el-checkbox { display: block; margin: 6px 0; }
.config-sub .el-checkbox__label { white-space: normal; }

/* 执行 */
.exec-box { max-width: 760px; margin: 0 auto; }
.exec-current { text-align: center; margin: 14px 0; color: #606266; }
.exec-log { max-height: 360px; overflow: auto; padding: 8px 16px; background: #fafbfc; border-radius: 4px; }

/* 汇总 */
.stat-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 8px 0 18px; }
.stat-tile { background: #fafbfc; border: 1px solid #ebeef5; border-radius: 4px; padding: 12px 14px; }
.stat-tile__label { color: #909399; font-size: 12px; }
.stat-tile__value { font-size: 24px; font-weight: 600; margin-top: 4px; }
.stat-tile.success .stat-tile__value { color: #67c23a; }
.stat-tile.danger .stat-tile__value { color: #f56c6c; }
.stat-tile.info .stat-tile__value { color: #909399; }
.stat-tile.primary .stat-tile__value { color: #409eff; }
.stat-tile.warning .stat-tile__value { color: #e6a23c; }
.log-list { margin: 0; padding-left: 18px; font-size: 12px; line-height: 20px; }
.log-list li.ok::marker { color: #67c23a; } .log-list li.warn::marker { color: #e6a23c; } .log-list li.err::marker { color: #f56c6c; }

/* ===== v2：资源库 / 接口池 / 联盟条 ===== */
.pool-table .el-table__row td { vertical-align: middle; }
.preview-box { width: 56px; height: 36px; background: #f2f3f5; color: #c0c4cc; font-size: 11px; display: flex; align-items: center; justify-content: center; border-radius: 3px; }
.key-box { display: inline-block; border: 1px solid #dcdfe6; border-radius: 4px; padding: 2px 8px; color: #909399; background: #fafafa; }
.net-strip { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.net-strip .el-tag { margin: 0; }
.net-strip .el-tag.is-hit { font-weight: 600; }
.net-strip .dim { opacity: .55; }
.ver-chips { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.ver-chips span { background: #f4f4f5; border: 1px solid #e9e9eb; color: #606266; border-radius: 3px; padding: 0 5px; font-size: 11px; line-height: 18px; font-family: Menlo, Monaco, monospace; }
.config-row { display: grid; grid-template-columns: 28px 1fr; gap: 6px 8px; padding: 8px 0 8px 46px; border-bottom: 1px dashed #ebeef5; align-items: start; }
.config-row:last-child { border-bottom: none; }
.config-row__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.config-row__sub { color: #909399; font-size: 12px; margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.config-row.is-hit { background: #f0f9eb55; }
.row-sample td { background: #ecf5ff !important; }
.row-preset td { background: #fdf6ec !important; }
.stat-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
