:root {
  --bg: #ffffff;
  --sidebar: #f7f8fa;
  --accent: #4d6bfe;
  --accent-soft: #eef1ff;
  --text: #1f2329;
  --muted: #8a919f;
  --border: #ececf0;
  --user-bubble: #f4f6fb;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text); background: var(--bg);
}
.hidden { display: none !important; }
.primary { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 9px 16px; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.primary:hover { opacity: .92; }
.link { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 13px; }
input, select, textarea {
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 14px; outline: none; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.muted { color: var(--muted); font-size: 13px; }

/* ===== 登录页（双栏：品牌区 + 登录卡片）===== */
.login-wrap { display: flex; min-height: 100vh; background: #fff; }

/* 左：品牌区 */
.lp-brand {
  position: relative; flex: 1 1 58%; min-width: 0;
  display: flex; flex-direction: column;
  padding: 40px 56px;
  background:
    radial-gradient(900px 520px at 78% 8%, rgba(255,255,255,.95), rgba(255,255,255,0) 62%),
    radial-gradient(760px 520px at 12% 96%, rgba(46,230,192,.22), rgba(46,230,192,0) 60%),
    linear-gradient(148deg, #dfeaff 0%, #eaf3ff 38%, #e4f6ff 66%, #dff3fb 100%);
  overflow: hidden;
}
.lp-glow {
  position: absolute; inset: -30% -10% auto -10%; height: 78%;
  background: radial-gradient(560px 300px at 62% 0%, rgba(255,255,255,.9), rgba(255,255,255,0) 70%);
  pointer-events: none;
}
.lp-logo { position: relative; display: flex; align-items: center; gap: 14px; }
.lp-logo img { width: 64px; height: 64px; display: block; }
.lp-logo-txt { display: flex; flex-direction: column; line-height: 1.1; }
.lp-logo-txt b { font-size: 24px; color: #12306e; letter-spacing: 3px; }
.lp-logo-txt span { font-size: 12px; color: #2b5ea8; letter-spacing: 4px; font-weight: 700; }

.lp-hero { position: relative; margin: auto 0; padding-bottom: 8px; }
.lp-title {
  margin: 0; font-size: clamp(34px, 4.2vw, 56px); line-height: 1.22; font-weight: 800;
  color: #12306e; letter-spacing: 1px;
}
.lp-title em {
  font-style: normal; font-weight: 800;
  background: linear-gradient(92deg, #1a4fd0 0%, #2b7fe8 42%, #17b6c9 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lp-sub { margin: 18px 0 0; font-size: clamp(15px, 1.3vw, 19px); color: #3c5a8c; letter-spacing: 1px; }
.lp-tags { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px; }
.lp-tag {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.9);
  border-radius: 999px; padding: 8px 16px 8px 12px;
  font-size: 13px; color: #23477f; box-shadow: 0 4px 16px rgba(26,79,208,.08);
  backdrop-filter: blur(6px);
}
.lp-ico { font-style: normal; font-size: 15px; }
/* 右下角装饰网络节点 */
.lp-net {
  position: absolute; right: -110px; bottom: -120px; width: 480px; height: 480px;
  opacity: .42; pointer-events: none;
}

/* 右：登录面板 */
.lp-panel {
  flex: 0 0 40%; min-width: 440px; max-width: 620px;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 48px;
  background:
    radial-gradient(720px 460px at 50% 42%, rgba(26,79,208,.05), rgba(26,79,208,0) 68%),
    linear-gradient(200deg, #f9fcff 0%, #ffffff 50%, #f6fbff 100%);
}
.login-card {
  width: 100%; max-width: 400px; background: #fff;
  padding: 36px 34px 28px; border-radius: 18px;
  border: 1px solid rgba(26,79,208,.07);
  box-shadow: 0 18px 48px rgba(20,60,140,.09), 0 2px 6px rgba(20,60,140,.04);
}
/* 管理后台沿用同一张卡片（带内边距与阴影） */
.login-wrap.is-admin {
  align-items: center; justify-content: center; height: 100vh;
  background: linear-gradient(135deg,#eef1ff,#f7f8fa);
}
.login-wrap.is-admin .login-card {
  max-width: 380px; padding: 32px; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.06);
}
.brand { font-size: 20px; font-weight: 700; }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 18px; }
.lp-h2 { margin: 0; font-size: 26px; font-weight: 700; color: #16233f; }
.lp-h2sub { margin: 8px 0 22px; font-size: 13px; color: var(--muted); }
.lp-submit { width: 100%; margin-top: 6px; padding: 12px 16px; font-size: 15px; border-radius: 10px;
  background: linear-gradient(96deg, #1a4fd0, #2b7fe8 55%, #17b6c9 100%); }
.lp-alt { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; font-size: 13px; }
.lp-alt-l { color: var(--muted); }
.lp-alt-r { color: var(--accent); font-weight: 600; }
.lp-admin { text-align: center; margin-top: 10px; }

/* 响应式：窄屏收起品牌区 */
@media (max-width: 900px) {
  .lp-brand { display: none; }
  .lp-panel { flex: 1 1 100%; max-width: none; }
}
.tab { display: flex; gap: 18px; margin-bottom: 16px; }
.tab-item { cursor: pointer; padding-bottom: 6px; color: var(--muted); }
.tab-item.active { color: var(--text); border-bottom: 2px solid var(--accent); font-weight: 600; }
/* 登录方式子 tab（密码 / 短信验证码） */
.tab-sub { gap: 20px; margin: 0 0 16px; padding-bottom: 0; border-bottom: none; }
.tab-sub .tab-item { font-size: 13px; padding: 0 0 6px; position: relative; }
.tab-sub .tab-item.active { color: var(--accent); border-bottom: 2px solid var(--accent); }
/* 验证码输入行：输入框 + 获取按钮 */
.sms-row { display: flex; gap: 8px; align-items: stretch; }
.sms-row input { flex: 1; margin-bottom: 12px; }
.sms-row .ghost { flex-shrink: 0; width: auto; white-space: nowrap; margin-bottom: 12px; padding: 0 14px; }
.sms-row .ghost:disabled { opacity: .6; cursor: not-allowed; }
/* 登录页辅助说明 */
.auth-tip { font-size: 12px; color: var(--muted); margin: -4px 0 12px; line-height: 1.5; }
.login-card input { width: 100%; margin-bottom: 12px; }
.login-card .primary { width: 100%; margin-top: 4px; }
.msg { color: #e5484d; font-size: 13px; min-height: 18px; margin-top: 8px; }
.msg.warn { color: #b07d12; }
.msg.ok { color: #2a7a3d; }
.msg.info { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; margin-top: 14px; }

/* 布局 */
.app { display: flex; height: 100vh; }
.sidebar { width: 248px; background: var(--sidebar); display: flex; flex-direction: column; padding: 16px; border-right: 1px solid var(--border); }
.logo { font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.new-chat { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 10px; cursor: pointer; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.session-list { flex: 1; overflow-y: auto; }
.session { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: #3a3f47; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session:hover { background: #eceef5; }
.session.active { background: var(--accent-soft); color: var(--accent); }
.nav { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 10px; }
.nav-item { padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.nav-item:hover { background: #eceef5; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-ico { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; }
.btn-ico { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; }
.user-box { border-top: 1px solid var(--border); padding-top: 10px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.points-badge { color: var(--muted); }
.points-badge b { color: var(--accent); }

.main { flex: 1; display: flex; flex-direction: column; }
.page { flex: 1; display: none; flex-direction: column; padding: 18px 24px; overflow-y: auto; }
.page.active { display: flex; }
.page h2 { margin: 0 0 12px; font-size: 18px; }

/* 控制台 */
.topbar { display: flex; align-items: center; gap: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.switch { font-size: 13px; color: #555; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.chat-area { flex: 1; overflow-y: auto; padding: 20px 0; }
.msg-row { display: flex; margin-bottom: 18px; }
.msg-row.user { justify-content: flex-end; }
.bubble { max-width: 72%; padding: 12px 14px; border-radius: 12px; line-height: 1.6; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.msg-row.user .bubble { background: var(--user-bubble); }
.msg-row.assistant .bubble { background: #fff; border: 1px solid var(--border); }
.input-bar { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.composer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.model-picker { flex: 1 1 auto; min-width: 200px; max-width: 440px; font-weight: 500; }
.composer-toggles { display: flex; align-items: center; gap: 16px; }
.composer-bottom { display: flex; gap: 10px; align-items: flex-end; }
.input-bar textarea { flex: 1; resize: none; height: 56px; min-height: 56px; }
.thinking { color: var(--muted); font-style: italic; }

/* 通用 */
.row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.row input { flex: 1; min-width: 200px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 14px; }
.card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.card h3 { margin: 0 0 6px; font-size: 15px; }
.table { display: flex; flex-direction: column; gap: 8px; }
.trow { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; flex-wrap: wrap; }
.trow > div { flex: 1; min-width: 120px; }
.kbd { font-family: monospace; background: #f3f4f7; padding: 2px 6px; border-radius: 6px; font-size: 12px; word-break: break-all; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; max-width: 720px; }
.pay-box { margin-top: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
#pay-qr img { width: 200px; height: 200px; border: 1px solid var(--border); border-radius: 8px; }

/* 算力节点 */
.tag { font-size: 12px; padding: 1px 8px; border-radius: 10px; margin-left: 6px; }
.tag.ok { background: #e6f7ed; color: #18a058; }
.tag.off { background: #fde8e8; color: #e5484d; }
.ghost { background: #fff; color: var(--accent); border: 1px solid var(--accent); border-radius: 8px; padding: 9px 16px; cursor: pointer; font-size: 14px; }
.ghost:hover { background: var(--accent-soft); }
.cloud-box { margin: 4px 0 16px; max-width: 720px; }
.cloud-box summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.tip { background: var(--accent-soft, #eef3ff); border: 1px solid var(--accent, #3b6cf6); color: var(--text, #1f2329); padding: 8px 12px; border-radius: 8px; font-size: 13px; margin: 4px 0 14px; }
.card button { margin-top: 12px; }

/* ===================== 资料库 ===================== */
.kb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kb-head h2 { margin: 0; }
.kb-head-right { display: flex; align-items: center; gap: 12px; }
.kb-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.kb-tab { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 20px; padding: 6px 14px; cursor: pointer; font-size: 13px; background: #fff; user-select: none; }
.kb-tab:hover { border-color: var(--accent); }
.kb-tab.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.kb-tab .kb-tab-check { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; }
.kb-tab.on .kb-tab-check { background: var(--accent); border-color: var(--accent); }
.kb-tab .kb-tab-n { color: var(--muted); font-size: 12px; }

.kb-drop { border: 1.5px dashed var(--border); border-radius: 12px; padding: 26px; text-align: center; color: var(--muted); margin: 14px 0; transition: .15s; }
.kb-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.kb-drop-ico { width: 28px; height: 28px; color: var(--muted); margin-bottom: 6px; }

.kb-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 10px; }
.kb-file { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; gap: 10px; align-items: flex-start; }
.kb-file:hover { box-shadow: 0 2px 10px rgba(31,35,41,.06); }
.kb-file-ico { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; flex-shrink: 0; }
.kb-file-main { flex: 1; min-width: 0; }
.kb-file-name { font-size: 13px; font-weight: 500; word-break: break-all; line-height: 1.4; }
.kb-file-meta { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kb-file-del { background: none; border: none; color: var(--muted); cursor: pointer; padding: 2px; }
.kb-file-del:hover { color: #e5484d; }
.kb-st { font-size: 11px; padding: 1px 7px; border-radius: 9px; }
.kb-st.pending { background: #f3f4f7; color: #8a919f; }
.kb-st.indexing { background: #e8f0fe; color: #3b6cf6; }
.kb-st.ready { background: #e6f7ed; color: #18a058; }
.kb-st.failed { background: #fde8e8; color: #e5484d; }
.kb-progress { height: 3px; background: var(--accent-soft); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.kb-progress i { display: block; height: 100%; width: 40%; background: var(--accent); animation: kb-slide 1.2s infinite linear; }
@keyframes kb-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* 已选知识库标签（输入框上方） */
.kb-active { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fbfbfd; margin-bottom: 8px; }
.kb-active-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: var(--accent-soft); color: var(--accent); border-radius: 14px; padding: 3px 10px; }
.kb-active-tag b { font-weight: 500; }
.kb-active-tag button { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 14px; line-height: 1; }

/* ===================== 我的认证 ===================== */
.verify-levels { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.vlevel { border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.vlevel.done { border-color: #b7ebc6; background: #f6fffa; }
.vlevel-t { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.vlevel-d { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.vlevel-s { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.vlevel-s.ok { color: #18a058; font-weight: 500; }
.vlevel-s.warn { color: #d25f00; }
.kyc-records { margin-top: 18px; max-width: 760px; }
.kyc-rec { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 8px; font-size: 13px; }

/* ===================== 认证审核（管理员） ===================== */
.kyc-files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.kyc-files a { font-size: 12px; color: var(--accent); text-decoration: none; border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
.kyc-files a:hover { border-color: var(--accent); }

/* 资料库引用出处 */
.kb-cites { margin-top: 10px; padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.kb-cites-t { font-size: 12px; color: var(--accent); font-weight: 500; margin-bottom: 5px; }
.kb-cite { font-size: 12px; color: var(--text); padding: 2px 0; }
.kb-cite-n { font-weight: 500; }
.kb-cite-m { color: var(--muted); margin-left: 8px; font-size: 11px; }

/* ===================== 管理后台（独立入口 /admin） ===================== */
.admin-body { background: #f4f5f7; }
.admin-sidebar { background: #1c2333; }
.admin-sidebar .logo { color: #fff; }
.admin-sidebar .nav-item { color: #a8b0c0; }
.admin-sidebar .nav-item:hover { color: #fff; }
.admin-sidebar .nav-item.active { color: #fff; background: rgba(255,255,255,.1); }
.admin-sidebar .user-box { color: #a8b0c0; border-top-color: rgba(255,255,255,.1); }
.admin-sidebar .link { color: #7aa2ff; }
.admin-sidebar .points-badge { background: rgba(255,255,255,.08); color: #cfd6e4; }
.admin-sidebar .points-badge b { color: #fff; }

/* ===================== 模型库三级分类 ===================== */
.model-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 14px 0 18px; }
.mcat { border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; background: #fff; transition: .15s; }
.mcat:hover { border-color: var(--accent); }
.mcat.active { border-color: var(--accent); background: var(--accent-soft); }
.mcat-t { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.mcat-d { font-size: 12px; color: var(--muted); line-height: 1.5; min-height: 34px; }
.mcat-n { font-size: 12px; color: var(--accent); margin-top: 6px; }
.msub { margin: 18px 0; }
.msub-t { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.msub-n { background: #f3f4f7; border-radius: 9px; padding: 0 7px; font-size: 11px; }
.mcard { position: relative; }
.mcard h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mcard-disc { background: #fde8e8; color: #e5484d; font-size: 11px; padding: 1px 7px; border-radius: 9px; font-weight: 500; }
.mcard-price { color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 8px; }

/* 管理端：分类与定价表单 */
.mform-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; max-width: 720px; }
.mform-row .full { grid-column: 1 / -1; }
.price-preview { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: 4px 0 12px; }
.cat-badge { font-size: 11px; padding: 1px 7px; border-radius: 9px; background: #eef1ff; color: var(--accent); }
.cat-badge.platform { background: #e6f7ed; color: #18a058; }
.cat-badge.enterprise { background: #fff3e0; color: #d25f00; }
.cat-badge.user { background: #f3f4f7; color: #6b7280; }

/* ===================== 管理端：模型管理库三组分组 ===================== */
.mg-group { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; background: #fff; }
.mg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.mg-title { font-size: 15px; font-weight: 600; }
.mg-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.mg-table { display: flex; flex-direction: column; gap: 8px; }
.mg-row { align-items: stretch; }
.mg-row-default { border-color: var(--accent); background: var(--accent-soft); }
.mg-pick { flex: 0 0 72px; max-width: 72px; min-width: 72px; display: flex; align-items: center; }
.mg-radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: var(--muted); user-select: none; }
.mg-radio input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.mg-row-default .mg-radio { color: var(--accent); font-weight: 500; }
.mg-def-tag { background: var(--accent); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 8px; font-weight: 500; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,20,30,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 720px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 600; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ===================== 生成图片 ===================== */
.gen-image { margin-top: 10px; }
.gen-image-wrap { position: relative; display: inline-block; max-width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #f7f8fa; }
.gen-image-wrap img { display: block; max-width: 100%; height: auto; }
.gen-image-dl { position: absolute; right: 8px; top: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 12px; text-decoration: none; }
.gen-image-dl:hover { background: var(--accent); }
.gen-image-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 11px; color: var(--muted); }
.gen-image-err { padding: 30px; color: var(--muted); font-size: 13px; text-align: center; }

/* 图片生成进度提示 */
.gen-progress { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.gen-progress .gen-spin { width: 13px; height: 13px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: gen-rotate .8s linear infinite; flex-shrink: 0; }
@keyframes gen-rotate { to { transform: rotate(360deg); } }
.gen-progress.gen-fail { color: #e5484d; }

/* 模型模式提示（图片生成模式） */
#model-mode-hint { font-size: 12px; margin: 0 2px 6px; min-height: 16px; }
#model-mode-hint.gen-progress { color: var(--accent); }

/* 平台公共知识库（只读、自动启用） */
.kb-plat-head { font-size: 12px; color: var(--muted); margin: 12px 0 8px; padding-bottom: 4px; border-bottom: 1px dashed var(--border); }
.kb-tab-plat { cursor: pointer; background: linear-gradient(96deg, #f4f8ff, #f2fbfa); border-color: #d7e6fb; color: #23477f; }
.kb-tab-plat:hover { border-color: #a9c8f0; }
.kb-tab .kb-tab-lock { font-size: 11px; opacity: .7; }

/* ==================== 模型微调（4 步向导）==================== */
.ft-steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.ft-step {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  font-size: 13px; color: var(--muted);
  background: var(--bg-soft, #f5f6f8);
}
.ft-step.active { background: var(--accent, #3b6cf6); color: #fff; font-weight: 600; }
.ft-step.done { background: var(--accent-soft, #eef3ff); color: var(--accent, #3b6cf6); }
.ft-step-n {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; background: rgba(0,0,0,.08);
}
.ft-step.active .ft-step-n { background: rgba(255,255,255,.25); }

.ft-hint {
  background: var(--bg-soft, #f5f6f8); border-radius: 10px;
  padding: 12px 14px; font-size: 13px; line-height: 1.7; margin-bottom: 14px;
}
.ft-hint code {
  background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px;
  font-size: 12px; font-family: ui-monospace, Menlo, monospace;
}
.ft-field { margin-bottom: 14px; }
.ft-field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.ft-field input[type=text], .ft-field input:not([type]), .ft-field textarea {
  width: 100%; box-sizing: border-box;
}
.ft-field textarea {
  font-family: ui-monospace, Menlo, monospace; font-size: 13px;
  line-height: 1.6; resize: vertical;
}
.ft-row { display: flex; gap: 10px; margin-top: 16px; }

/* 数据体检 */
.ft-quality { display: flex; flex-direction: column; gap: 8px; }
.ft-qi {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.6;
}
.ft-qi > span:first-child { flex-shrink: 0; font-weight: 700; }
.ft-qi-ok { background: rgba(52,168,83,.08); color: #2a7a3d; }
.ft-qi-warn { background: rgba(210,150,20,.10); color: #8a5f00; }
.ft-qi-error { background: rgba(229,72,77,.10); color: #b3282c; }

/* 目标选择 */
.ft-goals { display: flex; flex-direction: column; gap: 10px; }
.ft-goal {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
  transition: border-color .15s, background .15s;
}
.ft-goal:hover { border-color: var(--accent, #3b6cf6); }
.ft-goal input { margin-top: 3px; flex-shrink: 0; }
.ft-goal-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.ft-goal-p { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 确认摘要 */
.ft-summary {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 14px; margin-bottom: 16px; background: #fff;
}
.ft-sum-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px;
}
.ft-sum-row:last-child { border-bottom: none; }
.ft-sum-row span { color: var(--muted); }
.ft-sum-cost b { color: #d97a00; font-size: 15px; }

/* 任务卡片 */
.ft-cards { display: flex; flex-direction: column; gap: 12px; }
.ft-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #fff;
}
.ft-card-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 6px;
}
.ft-card-act { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ft-status {
  font-size: 12px; padding: 2px 9px; border-radius: 12px; white-space: nowrap;
}
.ft-st-queued   { background: rgba(140,145,160,.15); color: #5b6270; }
.ft-st-training { background: rgba(59,108,246,.13); color: #3b6cf6; }
.ft-st-ok       { background: rgba(52,168,83,.13);  color: #2a7a3d; }
.ft-st-fail     { background: rgba(229,72,77,.13);  color: #b3282c; }
.ft-st-cancel   { background: rgba(140,145,160,.15); color: #5b6270; }
.ft-st-review   { background: rgba(210,150,20,.13); color: #8a5f00; }

.ft-prog {
  height: 6px; background: rgba(0,0,0,.06); border-radius: 3px;
  margin: 8px 0 5px; overflow: hidden;
}
.ft-prog-bar { height: 100%; background: var(--accent, #3b6cf6); transition: width .4s; }
.ft-err {
  background: rgba(229,72,77,.08); color: #b3282c;
  padding: 8px 10px; border-radius: 6px; font-size: 12px; margin-top: 8px;
  white-space: pre-wrap; word-break: break-all;
}
.ft-ok { color: #2a7a3d; font-size: 13px; margin-top: 8px; }

/* 管理端微调任务 */
.ft-admin-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.ft-admin-row:last-child { border-bottom: none; }
.ft-admin-main { flex: 1; min-width: 0; }
.ft-admin-name { font-weight: 600; font-size: 14px; }
.ft-admin-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ft-admin-stat {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 12px 14px; background: var(--bg-soft, #f5f6f8);
  border-radius: 10px; margin-bottom: 14px;
}
.ft-admin-stat div { font-size: 13px; }
.ft-admin-stat b { font-size: 18px; display: block; margin-top: 2px; }

/* ==================== 知识库 → 训练集 ==================== */
.ft-kb-entry {
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  margin-top: 16px; padding: 13px 15px;
  border: 1px dashed var(--border); border-radius: 10px;
  background: var(--bg-soft, #f5f6f8);
}
.ft-kb-entry-t { font-size: 13.5px; font-weight: 600; color: var(--navy); margin-bottom: 3px; }

.ft-kb-panel {
  margin-top: 16px; border: 1px solid var(--border); border-radius: 10px;
  padding: 15px; background: #fff; border-top: 3px solid var(--gold);
}
.ft-kb-panel-h {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.ft-kb-panel-h b { font-size: 14px; color: var(--navy); }
.ft-kb-tip {
  font-size: 12px; color: var(--muted); line-height: 1.65;
  padding: 9px 11px; background: var(--bg-soft, #f5f6f8);
  border-radius: 7px; margin-bottom: 11px;
}
.ft-kb-empty {
  font-size: 12.5px; color: var(--muted); line-height: 1.75;
  padding: 18px 14px; text-align: center;
}
.ft-kb-loading {
  padding: 22px; text-align: center; font-size: 13px; color: var(--muted);
}

.ft-kb-list { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; }
.ft-kb-kb { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.ft-kb-kb-h { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 7px; }
.ft-kb-kb-h b { color: var(--navy); }
.ft-kb-files { padding-left: 22px; display: flex; flex-direction: column; gap: 5px; }
.ft-kb-file {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink); cursor: pointer;
}
.ft-kb-file > span:first-of-type { flex: 1; min-width: 0; }
.ft-kb-file .muted { font-size: 11.5px; }
.ft-kb-tag {
  font-size: 10.5px; padding: 1px 7px; border-radius: 9px;
  background: rgba(210,150,20,.13); color: #8a5f00;
}

.ft-kb-result {
  margin-top: 14px; padding: 13px; border-radius: 9px;
  background: rgba(52,168,83,.07); border: 1px solid rgba(52,168,83,.24);
}
.ft-kb-result-h { font-size: 13.5px; font-weight: 700; color: #2a7a3d; margin-bottom: 4px; }
.ft-kb-preview { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.ft-kb-pv { background: #fff; border: 1px solid var(--border); border-radius: 7px; padding: 9px 11px; }
.ft-kb-pv-q { font-size: 12.5px; color: var(--navy); font-weight: 600; margin-bottom: 3px; }
.ft-kb-pv-a { font-size: 12px; color: var(--muted); line-height: 1.6; }


/* ---------- 对话附图 ---------- */
.attach-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.attach-chip { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: #fff; }
.attach-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-chip button { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; padding: 0;
  border-radius: 50%; border: none; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer; }
.attach-chip button:hover { background: rgba(0, 0, 0, .75); }
.attach-btn { flex-shrink: 0; width: 44px; height: 56px; display: flex; align-items: center; justify-content: center; }
.msg-imgs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.msg-imgs img { max-width: 160px; max-height: 160px; border-radius: 8px; display: block; cursor: zoom-in; }

/* ---------- 云伴开放平台 · 控制台分组导航 ---------- */
.nav-group { padding: 14px 12px 5px; font-size: 11px; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.nav-sub { margin: 0 0 2px 8px; padding-left: 10px; border-left: 1px solid var(--border); }
.nav-item.sub { padding-left: 10px; font-size: 12.5px; }
.nav-item[data-toggle]::after { content: '⌄'; float: right; opacity: .55; }
.btn-link { display: inline-block; text-decoration: none; line-height: 36px; padding: 0 16px; }
.library-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.library-card b { font-size: 13.5px; }
.library-card .muted { font-size: 12px; }
.library-card .tag { margin-left: 8px; }
.lib-head { display: flex; align-items: center; gap: 4px; }
.lib-ops { margin-left: auto; display: inline-flex; gap: 4px; }
.lib-ops button { border: 1px solid var(--border); background: #fff; color: var(--text, #1f2329); border-radius: 6px; padding: 2px 7px; font-size: 12px; cursor: pointer; }
.lib-ops button:hover { background: var(--accent-soft, #eef3ff); border-color: var(--accent, #3b6cf6); }
.lib-ops button.danger { color: #e5484d; }
.lib-modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.lib-modal { background: #fff; border-radius: 10px; width: min(560px, calc(100vw - 32px)); max-height: 86vh; overflow: auto; padding: 18px 20px; box-shadow: 0 18px 48px rgba(0,0,0,.2); }
.lib-modal h3 { margin: 0 0 14px; font-size: 16px; }
.lib-modal label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.lib-modal input, .lib-modal textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 13px; font-family: inherit; color: var(--text, #1f2329); background: #fff; resize: vertical; }
.lib-modal-ops { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.lib-modal-ops button { border: 1px solid var(--border); background: #fff; color: var(--text, #1f2329); border-radius: 6px; padding: 7px 16px; font-size: 13px; cursor: pointer; }
.lib-modal-ops button.primary { background: var(--accent, #3b6cf6); color: #fff; border-color: var(--accent, #3b6cf6); }
