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

/* =============================================================
   旗舰店柜台（Flagship Store Counter）
   薄荷画布 · 无瑕白卡 · 发丝分隔线 · 深墨字 · 状态绿独点
   ============================================================= */

body {
  background: #eefafa;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #1c1e21;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部（柜台台面） ---------- */
.app-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 28px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8e8;
  box-shadow: 0 1px 2px rgba(23, 26, 31, .04);
}

.app-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  color: #1c1e21;
}

.app-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16baaa;
  flex: none;
}

.status-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
}

.status-label {
  flex: none;
  white-space: nowrap;
  color: #8a8e94;
}

.status-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #3d4044;
}

.status-text.status-active {
  color: #16baaa;
}

.status-text.status-active::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16baaa;
  margin-right: 6px;
  vertical-align: middle;
}

.header-actions {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 12px;
}

.proxy-label {
  font-size: 13px;
  color: #8a8e94;
  user-select: none;
}

.update-link {
  font-size: 13px;
  color: #16baaa;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}

.update-link:hover {
  color: #0e9e90;
  text-decoration: underline;
}

/* ---------- 主体 ---------- */
.app-main {
  max-width: 1120px;
  margin: 28px auto;
  padding: 0 28px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #3d4044;
  margin-bottom: 14px;
}

/* ---------- 细线 tab ---------- */
.app-main .layui-tab-brief > .layui-tab-title {
  background: transparent;
  border-bottom: 1px solid #e2e8e8;
  height: 44px;
}

.app-main .layui-tab-brief > .layui-tab-title li {
  line-height: 44px;
  min-width: 0;
  padding: 0 22px;
  font-size: 14px;
  color: #8a8e94;
  transition: color .2s ease;
}

.app-main .layui-tab-brief > .layui-tab-title li:first-child { padding-left: 0; }

.app-main .layui-tab-brief > .layui-tab-title li:hover { color: #3d4044; }

.app-main .layui-tab-brief > .layui-tab-title .layui-this {
  color: #1c1e21;
  font-weight: 600;
}

.app-main .layui-tab-brief > .layui-tab-title .layui-this::after {
  border: none;
  border-radius: 0;
  border-bottom: 2px solid #16baaa;
  height: 44px;
}

.app-main .layui-tab-content { padding-top: 24px; }

/* ---------- 卡片网格 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 18px;
}

/* ---------- 配置方案卡片（精品陈列） ---------- */
.config-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8e8;
  border-radius: 12px;
  padding: 22px 22px 18px;
  box-shadow: 0 1px 2px rgba(23, 26, 31, .03);
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}

.config-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(23, 26, 31, .07);
}

.config-card.card-active {
  border-color: #16baaa;
  box-shadow: 0 0 0 1px rgba(22, 186, 170, .35), 0 6px 20px rgba(22, 186, 170, .12);
}

/* 使用中徽章：软色药丸 */
.active-badge {
  position: absolute;
  top: 14px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ebf9f8;
  color: #118f83;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 100px;
}

.active-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #16baaa;
}

.card-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  padding-right: 68px;
  color: #1c1e21;
}

.card-meta {
  font-size: 13px;
  color: #8a8e94;
  line-height: 1.7;
}

.card-targets {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.target-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 500;
}

.target-claude {
  background: #f8ede8;
  color: #b0563a;
}

.target-codex {
  background: #e9f0fb;
  color: #2f6fb4;
}

.target-dsh {
  background: #ececec;
  color: #3a3a3a;
}

.target-zcode {
  background: #efe9fb;
  color: #6d43c4;
}

.card-actions {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  gap: 8px;
}

/* ---------- 按钮（深墨主按钮 · 白描边次按钮 · 软红危险） ---------- */
.layui-btn {
  border-radius: 8px;
  font-size: 13px;
  height: 34px;
  line-height: 32px;
  padding: 0 16px;
  background-color: #ffffff;
  color: #3d4044;
  border: 1px solid #dce2e2;
  transition: all .2s ease;
}

.layui-btn:hover {
  background-color: #f2f6f6;
  color: #1c1e21;
  border-color: #d3d9d9;
  opacity: 1;
}

.layui-btn-normal {
  background-color: #1c1e21;
  color: #ffffff;
  border-color: #1c1e21;
}

.layui-btn-normal:hover {
  background-color: #2d3035;
  color: #ffffff;
  border-color: #2d3035;
}

/* 危险按钮 = 软红描边（删除） */
.layui-btn-danger.layui-btn-primary {
  background-color: #fdf0ed;
  color: #c03a2f;
  border-color: #f0d6d0;
}

.layui-btn-danger.layui-btn-primary:hover {
  background-color: #fbe6e1;
  color: #a93329;
  border-color: #eac4bc;
}

/* 纯危险（如整块删除按钮） */
.layui-btn-danger:not(.layui-btn-primary) {
  background-color: #c03a2f;
  color: #ffffff;
  border-color: #c03a2f;
}

.layui-btn-danger:not(.layui-btn-primary):hover {
  background-color: #a93329;
  color: #ffffff;
  border-color: #a93329;
}

.layui-btn-sm { height: 30px; line-height: 28px; padding: 0 14px; font-size: 13px; }

.layui-btn-xs { height: 26px; line-height: 24px; padding: 0 10px; font-size: 12px; }

/* ---------- 空态 ---------- */
.empty-tip {
  grid-column: 1 / -1;
  text-align: center;
  color: #a7aaae;
  padding: 72px 0;
  font-size: 14px;
}

/* ---------- 供应商管理 ---------- */
.providers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.providers-title {
  font-size: 16px;
  font-weight: 600;
  color: #3d4044;
}

.provider-list {
  background: #ffffff;
  border: 1px solid #e2e8e8;
  border-radius: 12px;
  padding: 6px 18px 18px;
  box-shadow: 0 1px 2px rgba(23, 26, 31, .03);
}

.provider-list .empty-tip { padding: 48px 0; }

/* ---------- 表格 ---------- */
.provider-list .layui-table {
  margin: 10px 0 0;
  color: #3d4044;
}

.provider-list .layui-table th {
  background: #eefafa;
  color: #8a8e94;
  font-size: 12px;
  font-weight: 500;
  border-color: #ecf1f1;
  padding: 10px 14px;
}

.provider-list .layui-table td {
  border-color: #ecf1f1;
  padding: 12px 14px;
  font-size: 13px;
}

.provider-list .layui-table tr { transition: background .15s ease; }

.provider-list .layui-table tbody tr:hover td {
  background: #eefafa;
}

.provider-base {
  word-break: break-all;
  max-width: 380px;
  color: #8a8e94;
}

.provider-actions {
  white-space: nowrap;
}

.provider-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #8a8e94;
}

.provider-hint a {
  color: #2f6fb4;
  cursor: pointer;
}

/* ---------- 弹窗表单（柜台抽屉） ---------- */
.config-form,
.provider-form { padding: 22px 26px; }

.config-form .layui-form-label,
.provider-form .layui-form-label {
  width: 96px;
  padding: 9px 14px;
  color: #5b5e63;
  font-size: 13px;
}

.config-form .layui-input-block,
.provider-form .layui-input-block { margin-left: 126px; }

/* 输入框 */
.layui-input {
  border-radius: 8px;
  border-color: #dce2e2;
  background-color: #ffffff;
  color: #1c1e21;
  height: 36px;
}

.layui-input:hover { border-color: #d3d9d9; }

.layui-input:focus {
  border-color: #16baaa !important;
  box-shadow: 0 0 0 3px rgba(22, 186, 170, .1) !important;
}

.layui-input::placeholder { color: #a7aaae; }

/* 下拉选择 */
.layui-form-select .layui-input {
  border-radius: 8px;
  border-color: #dce2e2;
}

.layui-form-select dl {
  border-radius: 10px;
  border-color: #e2e8e8;
  box-shadow: 0 12px 32px rgba(23, 26, 31, .12);
  padding: 6px;
}

.layui-form-select dl dd {
  border-radius: 6px;
  font-size: 13px;
  color: #3d4044;
}

.layui-form-select dl dd:hover { background-color: #eefafa; }

.layui-form-select dl dd.layui-this {
  background-color: #eefafa;
  color: #118f83;
  font-weight: 600;
}

/* 复选框（primary 皮肤） */
.layui-form-checkbox[lay-skin=primary] > i {
  border-radius: 5px;
  border-color: #d3d9d9;
}

.layui-form-checkbox[lay-skin=primary]:hover > i { border-color: #16baaa; }

.layui-form-checkbox[lay-skin=primary] > div { color: #3d4044; }

.layui-form-checked[lay-skin=primary] > i,
.layui-form-checked[lay-skin=primary]:hover > i {
  border-color: #16baaa !important;
  background-color: #16baaa;
  color: #fff;
}

/* 开关（代理服务） */
.layui-form-switch {
  margin-top: 0;
  border-radius: 100px;
  border-color: #d3d9d9;
  background-color: #ffffff;
}

.layui-form-switch i {
  background-color: #d3d9d9;
}

.layui-form-onswitch {
  border-color: #16baaa;
  background-color: #16baaa;
}

.layui-form-onswitch i { background-color: #ffffff; }

/* 开关文字（lay-text 直连|代理 等）：哑灰 → 白（选中态） */
.layui-form-switch > div { color: #8a8e94 !important; }

.layui-form-onswitch > div { color: #ffffff !important; }

/* ---------- layer 弹窗（旗舰店玻璃柜） ---------- */
.layui-layer {
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(23, 26, 31, .16);
  border: 1px solid #ecf1f1;
}

.layui-layer-title {
  height: 50px;
  line-height: 50px;
  padding: 0 20px;
  border-bottom: 1px solid #ecf1f1;
  font-size: 15px;
  color: #1c1e21;
  border-radius: 12px 12px 0 0;
}

.layui-layer-btn {
  border-top: 1px solid #ecf1f1;
  padding: 12px 18px 16px;
  text-align: right;
}

.layui-layer-btn a {
  height: 32px;
  line-height: 30px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid #dce2e2;
  background-color: #ffffff;
  color: #3d4044;
  font-size: 13px;
}

.layui-layer-btn a:hover {
  background-color: #f2f6f6;
  color: #1c1e21;
  opacity: 1;
}

.layui-layer-btn .layui-layer-btn0 {
  background-color: #1c1e21;
  border-color: #1c1e21;
  color: #ffffff;
}

.layui-layer-btn .layui-layer-btn0:hover {
  background-color: #2d3035;
  border-color: #2d3035;
  color: #ffffff;
}

/* ---------- 通知（layer.msg toast · layer.confirm 确认框） ---------- */
/* toast：比弹窗更轻的影，白卡 + 浅发丝边，语义色只落在图标上 */
.layui-layer-msg {
  min-width: 180px;
  border-color: #ecf1f1;
  box-shadow: 0 12px 32px rgba(23, 26, 31, .12);
}

/* 未带图标的 msg 默认走 layui hui 深色皮——压回白卡，与图标 toast 同一语言 */
.layui-layer-msg.layui-layer-hui {
  background-color: #ffffff;
  color: #3d4044;
  border: 1px solid #ecf1f1;
}

/* 正文：软墨（替代默认 rgba(0,0,0,.85)） */
.layui-layer-dialog .layui-layer-content {
  color: #3d4044;
}

/* 图标基准：哑灰（中性，The One-Signal Rule 之外） */
.layui-layer-dialog .layui-layer-content .layui-layer-face {
  color: #8a8e94;
}

/* 成功 → 状态绿（操作已生效的瞬时回声）；失败 → 危险红 */
.layui-layer-dialog .layui-layer-content .layui-icon-success {
  color: #16baaa;
}

.layui-layer-dialog .layui-layer-content .layui-icon-error {
  top: 19px;
  color: #c03a2f;
}

/* 确认问号 / 提示：中性哑灰，不抢「当前生效」的绿 */
.layui-layer-dialog .layui-layer-content .layui-icon-question,
.layui-layer-dialog .layui-layer-content .layui-icon-tips {
  color: #8a8e94;
}

/* 确认框关闭按钮：弱灰 → 软墨 */
.layui-layer-setwin .layui-layer-close {
  color: #a7aaae;
  transition: color .2s ease;
}

.layui-layer-setwin .layui-layer-close:hover {
  color: #3d4044;
}

/* 修复 layui layer 在 type:1 内联内容时的渲染怪癖：关闭按钮被放进
   .layui-layer-content 而非标题栏——把这类 setwin 视觉归位到标题栏右上
   （标题栏固定 50px 高，content 从标题栏底部开始） */
.layui-layer-content > .layui-layer-setwin {
  position: absolute;
  top: -48px;
  right: 15px;
}

/* 弹窗内的开关（原生 Responses / 自定义） */
.layui-layer .layui-form-switch {
  margin-top: 10px;
}

/* ---------- 滚动条（弱化） ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d3d9d9;
  border: 2px solid transparent;
  border-radius: 100px;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #a7aaae;
  background-clip: content-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* ---------- 更新弹窗 ---------- */
.update-panel {
  padding: 20px 24px;
  color: #3d4044;
}

.update-panel p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.7;
}

.update-versions {
  color: #5a5e63;
}

.update-notes {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #e2e8e8;
  border-radius: 8px;
  background: #fafbfb;
  color: #5a5e63;
  font-size: 13px;
  line-height: 1.7;
  white-space: normal;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
}
/* 渲染后的 Markdown 内容样式 */
.update-notes h1, .update-notes h2, .update-notes h3 {
  margin: 10px 0 4px;
  font-size: 15px;
  color: #1c1e21;
}
.update-notes h1:first-child, .update-notes h2:first-child, .update-notes h3:first-child { margin-top: 0; }
.update-notes p { margin: 6px 0; }
.update-notes ul, .update-notes ol { margin: 6px 0 6px 20px; padding: 0; }
.update-notes li { margin: 3px 0; }
.update-notes code {
  background: #eef1f1;
  border-radius: 5px;
  padding: 1px 5px;
  font-family: Consolas, Menlo, monospace;
  font-size: 12px;
}
.update-notes pre {
  background: #f0f3f3;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  overflow-x: auto;
}
.update-notes pre code { background: transparent; padding: 0; }
.update-notes blockquote {
  margin: 8px 0;
  padding: 6px 12px;
  border-left: 3px solid #dce2e2;
  background: #eefafa;
  color: #5a5e63;
}

/* 表格（GFM）：发丝边框 · 表头浅底 · 过宽横向滚动 */
.update-notes table {
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
  max-width: 100%;
  display: block;
  overflow-x: auto;
}

.update-notes th,
.update-notes td {
  border: 1px solid #dce2e2;
  padding: 6px 12px;
  text-align: left;
}

.update-notes th {
  background: #eefafa;
  color: #3d4044;
  font-weight: 600;
  white-space: nowrap;
}

.update-notes tbody tr:nth-child(even) { background: #fafbfb; }

.update-notes a { color: #2f6fb4; }
.update-notes a:hover { text-decoration: underline; }

.update-notes-url {
  margin-top: 10px;
  font-size: 13px;
}

.update-notes-url a {
  color: #16baaa;
}

.update-warn {
  color: #b0563a;
}

.update-download {
  padding: 24px 28px;
}

.update-download-status {
  margin-top: 12px;
  font-size: 13px;
  color: #8a8e94;
  text-align: right;
}

/* ---------- 技能管理 ---------- */
.skills-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.skills-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.seg-control {
  display: inline-flex;
  border: 1px solid #dce2e2;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.seg-btn {
  border: none;
  background: transparent;
  height: 30px;
  line-height: 28px;
  padding: 0 16px;
  font-size: 13px;
  color: #8a8e94;
  cursor: pointer;
  transition: all .2s ease;
}

.seg-btn + .seg-btn { border-left: 1px solid #e2e8e8; }

.seg-btn:hover { color: #3d4044; }

.seg-btn.seg-active {
  background-color: #eefafa;
  color: #118f83;
  font-weight: 600;
}

/* 聚合卡片 */
.skill-card .card-name { padding-right: 0; }

.skill-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.dup-badge {
  background: #f3eefb;
  color: #6b46a8;
}

.skill-desc {
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 22px;
}

.skill-desc-none { color: #b9bcbe; font-style: normal; }

.skill-copies {
  margin-top: 12px;
  border-top: 1px solid #ecf1f1;
  padding-top: 6px;
  display: flex;
  flex-direction: column;
}

.skill-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed #f0f3f3;
  min-height: 30px;
}

.skill-copy:last-child { border-bottom: none; }

.skill-copy-path {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: #a7aaae;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-copy-actions {
  flex: none;
  visibility: hidden;
  white-space: nowrap;
}

.skill-copy:hover .skill-copy-actions { visibility: visible; }

.skill-copy-actions a {
  font-size: 12px;
  color: #2f6fb4;
  text-decoration: none;
  margin-left: 10px;
}

.skill-copy-actions a:hover { text-decoration: underline; }

/* 项目视图：块级分组 */
.proj-block {
  grid-column: 1 / -1;
  background: #ffffff;
  border: 1px solid #e2e8e8;
  border-radius: 12px;
  padding: 16px 20px 20px;
  box-shadow: 0 1px 2px rgba(23, 26, 31, .03);
  margin-bottom: 4px;
}

.proj-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ecf1f1;
}

.proj-name { font-size: 15px; font-weight: 600; color: #1c1e21; }

.proj-root {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: #a7aaae;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.proj-empty { padding: 32px 0; }

/* 迁移弹窗 */
.mig-panel { padding: 16px 22px; max-height: 480px; overflow-y: auto; }

.mig-section { margin-bottom: 14px; }

.mig-title {
  font-size: 13px;
  color: #5b5e63;
  font-weight: 600;
  margin-bottom: 8px;
}

.mig-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 7px 0;
  border-bottom: 1px dashed #f0f3f3;
}

.mig-group-name {
  flex: none;
  width: 88px;
  font-size: 12px;
  color: #8a8e94;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mig-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.mig-item input[type="radio"],
.mig-item input[type="checkbox"] { accent-color: #1c1e21; cursor: pointer; }

/* 悬停不变色、无 hover 反馈 */
.mig-item:hover { background: transparent; }
.mig-item input[type="radio"]:hover,
.mig-item input[type="checkbox"]:hover,
.mig-item input[type="radio"]:checked:hover,
.mig-item input[type="checkbox"]:checked:hover { accent-color: #1c1e21; }

.mig-item input:disabled ~ * { opacity: .45; }

.mig-item.mig-disabled { opacity: .55; }

.mig-place { font-size: 12px; color: #5b5e63; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* MCP 迁移：目标端传输不兼容的提示 */
.mig-unsupported { font-size: 11px; color: #c03a2f; }

/* MCP server 卡片：env 键数徽标与详情弹窗 */
.mcp-env-hint {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  font-size: 11px;
  line-height: 18px;
  color: #5b5e63;
  background: #f0f4f4;
  border-radius: 9px;
  cursor: default;
  flex: none;
}

.mcp-env-list { margin: 4px 0 0 2px; }

.mcp-env-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 5px;
  font-size: 12px;
}

.mcp-env-row code {
  flex: none;
  color: #2c3034;
  background: #f0f4f4;
  border-radius: 4px;
  padding: 1px 6px;
}

.mcp-env-val { color: #5b5e63; word-break: break-all; }

.adapt-list { margin: 0 0 4px 18px; font-size: 13px; line-height: 1.9; color: #3d4044; }

/* 迁移进度层（执行期间阻塞其他操作） */
.mig-progress-skin { border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }

.mig-progress { padding: 20px 24px 16px; }

.mig-progress-title {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: #2c3034;
  word-break: break-all;
}

.mig-progress-bar { background-color: #16baaa; }

#mig-progress-bar {
  transition: width .25s ease;
  position: relative;
  overflow: hidden;
}

/* 条纹流动动画：请求进行中也能看出「在动」 */
#mig-progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(45deg,
    rgba(255, 255, 255, .30) 25%, transparent 25%, transparent 50%,
    rgba(255, 255, 255, .30) 50%, rgba(255, 255, 255, .30) 75%, transparent 75%);
  background-size: 18px 18px;
  animation: mig-bar-stripes .8s linear infinite;
}

@keyframes mig-bar-stripes {
  from { background-position: 0 0; }
  to { background-position: 36px 0; }
}

.mig-progress-text {
  margin-top: 10px;
  font-size: 12px;
  color: #5b5e63;
  word-break: break-all;
  min-height: 18px;
}

.mig-progress-count { color: #16a589; font-weight: 600; }

.mig-progress-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #b0b3b8;
}

/* 回收站 / 迁移日志表格 */
.trash-table { margin: 0; }

.trash-table th {
  background: #eefafa;
  color: #8a8e94;
  font-size: 12px;
  border-color: #ecf1f1;
  padding: 9px 12px;
}

.trash-table td { border-color: #ecf1f1; padding: 10px 12px; font-size: 13px; color: #3d4044; }

/* 操作列固定宽度：两个按钮不换行 */
.trash-table .trash-col-actions {
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  white-space: nowrap;
}

.trash-origin {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #8a8e94;
}

.trash-notice {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #ebf9f8;
  color: #118f83;
  font-size: 12px;
}

.mig-ok { color: #118f83; }
.mig-fail { color: #c03a2f; word-break: break-all; }

/* SKILL.md 预览 */
.skill-preview { padding: 16px 22px; max-height: 560px; overflow-y: auto; }

.skill-fm {
  padding: 10px 14px;
  border: 1px solid #e2e8e8;
  border-radius: 8px;
  background: #fafbfb;
  margin-bottom: 12px;
}

.skill-fm-line { margin: 2px 0; font-size: 13px; color: #5b5e63; word-break: break-all; }

.skill-fm-line code {
  background: #eef1f1;
  border-radius: 5px;
  padding: 1px 5px;
  font-family: Consolas, Menlo, monospace;
  font-size: 12px;
}

.skill-md { border: none; background: transparent; padding: 0; max-height: none; }

#roots-input { font-family: Consolas, Menlo, monospace; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .app-header { padding: 14px 16px; gap: 12px; }
  .app-main { margin: 20px auto; padding: 0 16px; }
  .app-title { font-size: 18px; }
  .proxy-label { display: none; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); }
  .config-form,
  .provider-form { padding: 16px 18px; }
  .skills-header { flex-wrap: wrap; }
  .proj-grid { grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); }
}

/* ---------- 本地模型（llama.cpp 控制台） ---------- */
.llama-welcome {
  max-width: 560px;
  margin: 60px auto;
  text-align: center;
  padding: 40px 32px;
  background: var(--card-bg, #fff);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
}
.llama-welcome-title { font-size: 20px; font-weight: 600; color: #1f2329; margin-bottom: 12px; }
.llama-welcome-desc { color: #6b7280; font-size: 13px; line-height: 1.8; margin-bottom: 12px; }
.llama-welcome-hint { color: #16a34a; font-size: 13px; margin-bottom: 16px; }

.llama-topline {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; margin-bottom: 16px;
  background: #fff; border: 1px solid rgba(0, 0, 0, 0.06); border-radius: 10px;
}
.llama-topline-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.llama-topline-model { font-weight: 600; color: #1f2329; }
.llama-topline-meta { color: #9ca3af; font-size: 12px; }
.llama-topline-actions { display: flex; align-items: center; gap: 10px; }

.llama-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.llama-badge-running { background: #dcfce7; color: #15803d; }
.llama-badge-starting { background: #fef9c3; color: #a16207; }
.llama-badge-failed { background: #fee2e2; color: #b91c1c; }
.llama-badge-stopped { background: #f3f4f6; color: #6b7280; }

.llama-progress { display: flex; align-items: center; gap: 12px; padding: 8px 14px; margin-bottom: 16px; background: #f8fafc; border-radius: 10px; }
.llama-progress-text { font-size: 12px; color: #475569; white-space: nowrap; }
.llama-progress-bar { flex: 1; height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.llama-progress-bar-lg { height: 10px; margin-top: 10px; }
.llama-progress-inner { height: 100%; background: #16a34a; border-radius: 999px; transition: width 0.3s; }
.llama-progress-indet { animation: llama-indet 1.2s ease-in-out infinite; width: 40%; }
@keyframes llama-indet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

.llama-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 960px) { .llama-grid { grid-template-columns: 1fr; } }
.llama-card { display: flex; flex-direction: column; background: #fff; border: 1px solid rgba(0, 0, 0, 0.06); border-radius: 10px; padding: 14px 16px; }
.llama-card-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14px; color: #1f2329; margin-bottom: 10px; }

.llama-dir-row { display: flex; gap: 8px; margin-bottom: 8px; }
.llama-input { flex: 1; height: 32px; font-size: 12px; }
.llama-input-sm { width: 140px; height: 30px; font-size: 12px; display: inline-block; }
.llama-select { height: 30px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 12px; padding: 0 8px; background: #fff; }
.llama-select-wide { width: 100%; height: 34px; }
.llama-check { margin-right: 14px; font-size: 13px; color: #374151; cursor: pointer; font-weight: normal; }

.llama-dirs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.llama-dir-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 8px; background: #f3f4f6; border-radius: 6px; font-size: 12px; color: #4b5563; }
.llama-dir-chip .llama-dir-remove { color: #9ca3af; text-decoration: none; }
.llama-dir-chip .llama-dir-remove:hover { color: #b91c1c; }
.llama-dir-empty, .llama-wizard-note { color: #9ca3af; font-size: 12px; }

.llama-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.llama-table th { text-align: left; color: #9ca3af; font-weight: 500; padding: 4px 6px; border-bottom: 1px solid #f3f4f6; }
.llama-table td { padding: 4px 6px; border-bottom: 1px solid #fafafa; color: #374151; }
.llama-table tr.llama-row-bad td { color: #c0c4cc; }
.llama-td-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.llama-set-default { color: #2563eb; font-size: 12px; text-decoration: none; }
.llama-default-flag { color: #15803d; font-size: 12px; }

.llama-logs { flex: 1; min-height: 260px; height: auto; overflow-y: auto; background: #0f172a; border-radius: 8px; padding: 8px 10px; font-family: Consolas, Menlo, monospace; font-size: 11px; line-height: 1.6; }
.llama-log-line { color: #cbd5e1; white-space: pre-wrap; word-break: break-all; }
.llama-log-empty { color: #475569; }

.llama-kv { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.llama-kv-label { width: 110px; color: #6b7280; font-size: 12px; flex-shrink: 0; }
.llama-kv-value { flex: 1; min-width: 0; background: #f8fafc; border-radius: 6px; padding: 3px 8px; font-size: 12px; word-break: break-all; }
.llama-kv-note { color: #9ca3af; font-size: 12px; }
.llama-copy { color: #2563eb; font-size: 12px; cursor: pointer; text-decoration: none; flex-shrink: 0; }
.llama-code-label { color: #6b7280; font-size: 11px; margin: 8px 0 2px; }
.llama-code { background: #0f172a; border-radius: 8px; padding: 8px 10px; margin: 0; max-height: 140px; overflow: auto; }
.llama-code code { color: #e2e8f0; font-family: Consolas, Menlo, monospace; font-size: 11px; line-height: 1.6; white-space: pre; }

.llama-form-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.llama-form-label { width: 120px; color: #6b7280; font-size: 12px; flex-shrink: 0; text-align: right; }
.llama-form-hint { color: #c0c4cc; font-size: 11px; }

.llama-wizard { padding: 16px 20px; display: flex; flex-direction: column; height: calc(100% - 20px); }
.llama-wizard-title { font-size: 15px; font-weight: 600; color: #1f2329; margin-bottom: 12px; }
.llama-wizard-body { flex: 1; overflow-y: auto; }
.llama-wizard-error { color: #b91c1c; font-size: 12px; min-height: 18px; margin-top: 6px; }
.llama-wizard-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }
.llama-wizard-intro { color: #6b7280; font-size: 13px; margin-bottom: 10px; line-height: 1.7; }
.llama-wizard-pack { display: block; padding: 7px 10px; margin-bottom: 6px; border: 1px solid #f3f4f6; border-radius: 8px; font-size: 13px; cursor: pointer; }
.llama-wizard-pack:hover { background: #fafafa; }
.llama-wizard-pack-note { color: #9ca3af; font-size: 12px; margin-left: 8px; }
.llama-wizard-panel { background: #fafafa; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; font-size: 13px; color: #374151; line-height: 1.9; }
.llama-wizard-panel-title { font-weight: 600; color: #1f2329; margin-bottom: 4px; }
.llama-wizard-gpu-line { font-family: Consolas, Menlo, monospace; font-size: 12px; }
.llama-wizard-dlstatus { color: #475569; font-size: 12px; margin-top: 8px; min-height: 18px; }
.llama-wizard-risk { color: #b45309; margin-top: 6px; }
.llama-wizard-ok { color: #15803d; margin-top: 6px; }

/* llama 页原生单选着色（对齐 .mig-item 的 accent-color 先例） */
.llama-check input[type="radio"],
.llama-wizard-pack input[type="radio"] {
  accent-color: #16baaa;
  cursor: pointer;
  vertical-align: -2px;
  margin: 0 6px 0 0;
}

/* layui primary 复选框容器（向导摘要下方） */
.llama-form-plain { margin-top: 12px; }
.llama-form-row .layui-form { display: inline-block; }
