:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --border: #e6e9f2;
  --text: #1c2233;
  --text-2: #616a80;
  --muted: #9aa2b5;
  --primary: #4f63e9;
  --primary-dark: #3d4fd1;
  --primary-soft: #eef0ff;
  --accent: #8b5cf6;
  --success: #16a06a;
  --danger: #d94f5c;
  --shadow: 0 6px 24px rgba(31, 42, 78, 0.06);
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 18px; height: 18px; flex: none; }

/* ---------------- 顶部栏 ---------------- */
.topbar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: -2px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12px;
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-pill.ok i { background: var(--success); box-shadow: 0 0 0 3px rgba(22,160,106,.12); }
.status-pill.warn i { background: #e0a020; box-shadow: 0 0 0 3px rgba(224,160,32,.12); }

/* ---------------- 布局 ---------------- */
.layout { display: flex; height: calc(100vh - 66px); }
.sidebar {
  width: 232px; flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow-y: auto;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  width: 100%; display: grid; grid-template-columns: 22px 1fr; grid-template-rows: auto auto;
  column-gap: 10px; align-items: center;
  padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-2); text-align: left;
  transition: background .15s, color .15s;
}
.nav-item svg { grid-row: 1 / 3; width: 19px; height: 19px; }
.nav-item span { font-weight: 600; font-size: 13px; }
.nav-item em { font-style: normal; font-size: 11px; color: var(--muted); }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-item.active em { color: #7b88d8; }
.sidebar-foot { margin-top: 16px; }
.tip-card { background: linear-gradient(160deg, #f2f4ff, #faf8ff); border: 1px solid #e6e9ff; border-radius: 12px; padding: 14px; }
.tip-title { font-weight: 700; font-size: 12px; margin-bottom: 4px; }
.tip-card p { margin: 0 0 8px; font-size: 11px; color: var(--text-2); line-height: 1.6; }
.tip-card a { font-size: 11px; font-weight: 600; }

.main { flex: 1; min-width: 0; overflow-y: auto; padding: 26px 30px 40px; }
.view { display: none; }
.view.active { display: block; animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.view-head h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -.3px; }
.view-head p { margin: 0; color: var(--text-2); font-size: 13px; }

/* ---------------- 通用组件 ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: 9px; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: all .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #b9c1e8; cursor: not-allowed; }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-text { background: transparent; border-color: transparent; color: var(--primary); padding: 6px 9px; }
.btn-text:hover { background: var(--primary-soft); }
.btn.full { width: 100%; margin-top: 14px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 11px; }
.placeholder { color: var(--muted); text-align: center; padding: 48px 12px; margin: 0; font-size: 13px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.field b { font-weight: 600; color: var(--primary); }
input[type="text"], input[type="password"], input[type="number"], input[type="url"], input[type="search"], textarea, .select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2); outline: none; transition: border .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.6; }
input:focus, textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,99,233,.1); background: #fff; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa2b5' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch-field { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.switch-field input { accent-color: var(--primary); }
.two-col { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 18px; align-items: start; }

/* ---------------- 对话 ---------------- */
.chat-layout { display: grid; grid-template-columns: 1fr 246px; gap: 18px; align-items: start; }
.chat-main { display: flex; flex-direction: column; height: calc(100vh - 168px); min-height: 520px; overflow: hidden; }
.chat-toolbar { display: flex; align-items: center; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.chat-toolbar .select { width: 240px; padding: 6px 30px 6px 10px; font-size: 12px; }
.system-panel { padding: 10px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.system-panel textarea { width: 100%; font-size: 12px; }
.messages { flex: 1; overflow-y: auto; padding: 22px; scroll-behavior: smooth; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.empty-icon svg { width: 28px; height: 28px; }
.empty-state h3 { margin: 0 0 6px; font-size: 16px; color: var(--text); }
.empty-state p { margin: 0 auto 18px; max-width: 400px; font-size: 13px; color: var(--muted); }
.quick-prompts { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.quick-prompts button { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 12px; }
.quick-prompts button:hover { border-color: var(--primary); color: var(--primary); }
.msg { display: flex; gap: 12px; margin-bottom: 22px; }
.msg.user { flex-direction: row-reverse; }
.avatar { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.msg.user .avatar { background: #94a3b8; }
.msg-body { max-width: min(760px, 82%); min-width: 0; }
.msg-name { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.msg.user .msg-name { text-align: right; }
.bubble { padding: 12px 15px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.msg.user .bubble { background: var(--primary-soft); border-color: #dfe3ff; }
.bubble.image-msg { padding: 8px; }
.bubble img { max-width: 100%; max-height: 280px; border-radius: 8px; display: block; margin-bottom: 6px; }
.msg-actions { display: flex; gap: 6px; margin-top: 6px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-actions { opacity: 1; }
.msg-actions button { border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 2px 6px; border-radius: 5px; }
.msg-actions button:hover { background: var(--surface-2); color: var(--primary); }
.composer { border-top: 1px solid var(--border); padding: 12px 18px 16px; background: var(--surface); }
.composer-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.composer-tools .hint { font-size: 11px; color: var(--muted); }
.composer-row { display: flex; gap: 10px; align-items: flex-end; }
.composer-row textarea { flex: 1; min-height: 52px; max-height: 180px; }
.send-btn { width: 44px; height: 44px; padding: 0; border-radius: 11px; }
.chat-side { padding: 18px; }
.side-title { font-weight: 700; font-size: 14px; margin-bottom: 16px; }
.side-block { padding: 14px 0; border-top: 1px solid var(--border); }
.side-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.side-desc { margin: 0; font-size: 12px; color: var(--text-2); line-height: 1.7; }
.stat-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); padding: 3px 0; }
.stat-row b { color: var(--text); }
.chat-thinking { color: var(--primary); font-size: 12px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------------- Markdown ---------------- */
.markdown { font-size: 13.5px; line-height: 1.75; word-break: break-word; }
.markdown h1, .markdown h2, .markdown h3 { margin: 16px 0 8px; font-size: 16px; }
.markdown p { margin: 8px 0; }
.markdown ul, .markdown ol { padding-left: 22px; margin: 8px 0; }
.markdown code { background: #eef0f6; border-radius: 4px; padding: 1px 5px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.markdown pre { background: #1e2333; color: #e7e9f5; border-radius: 10px; padding: 14px; overflow-x: auto; margin: 10px 0; }
.markdown pre code { background: none; color: inherit; padding: 0; }
.markdown blockquote { border-left: 3px solid var(--primary); margin: 10px 0; padding: 4px 12px; color: var(--text-2); background: var(--surface-2); }
.markdown table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 12px; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 6px 9px; text-align: left; }
.markdown th { background: var(--surface-2); }
.markdown a { word-break: break-all; }

/* ---------------- 上传与结果 ---------------- */
.upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 108px; padding: 16px; border: 1.5px dashed #cfd5e6; border-radius: 11px;
  background: var(--surface-2); color: var(--text-2); font-size: 12px; cursor: pointer; text-align: center;
}
.upload-zone:hover { border-color: var(--primary); color: var(--primary); }
.upload-zone.compact { min-height: 58px; }
.upload-zone svg { width: 22px; height: 22px; }
.preview-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.preview-item { position: relative; }
.preview-item img { width: 66px; height: 66px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.preview-item button { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; padding: 0; }
.result-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.result-head h3 { margin: 0; font-size: 14px; }
.result-body { min-height: 300px; }
.result-body.placeholder, .image-result .placeholder, .audio-result .placeholder { padding-top: 100px; }
.image-result { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; min-height: 320px; align-content: start; }
.image-result .placeholder { grid-column: 1 / -1; }
.image-card { border: 1px solid var(--border); border-radius: 11px; overflow: hidden; background: var(--surface-2); }
.image-card img { width: 100%; display: block; background: #eef0f6; }
.image-card .image-card-foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; font-size: 11px; color: var(--text-2); gap: 8px; }
.image-card .image-card-foot .btn { padding: 4px 8px; font-size: 11px; }
.audio-result { min-height: 260px; text-align: center; padding-top: 20px; }
.audio-player { display: inline-flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.audio-player audio { width: 100%; max-width: 440px; }
.audio-info { font-size: 12px; color: var(--text-2); }
.asr-text { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; min-height: 120px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.sentence-list { margin-top: 14px; max-height: 260px; overflow-y: auto; }
.sentence-row { display: flex; gap: 10px; padding: 7px 4px; border-bottom: 1px dashed var(--border); font-size: 12px; }
.sentence-row time { color: var(--primary); font-variant-numeric: tabular-nums; flex: none; }
.model-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.model-controls input { max-width: 320px; }
.table-wrap { overflow-x: auto; }
.model-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.model-table th, .model-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.model-table th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; background: var(--surface-2); }
.model-table code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: 12px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.online { color: var(--success); background: #e8f7f0; }
.badge.other { color: var(--text-2); background: var(--surface-2); }

/* ---------------- 弹窗与提示 ---------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,26,45,.42); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { width: min(520px, 100%); background: var(--surface); border-radius: 16px; box-shadow: 0 24px 70px rgba(20,26,45,.24); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px 22px 24px; }
.notice { background: #f2f5ff; border: 1px solid #e1e6ff; border-radius: 10px; padding: 12px; font-size: 12px; color: var(--text-2); margin-bottom: 18px; line-height: 1.7; }
.notice code { background: #e3e8ff; padding: 1px 4px; border-radius: 4px; font-size: 11px; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.test-result { margin-top: 12px; font-size: 12px; min-height: 18px; }
.test-result.ok { color: var(--success); }
.test-result.error { color: var(--danger); }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: #1f2536; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; z-index: 80; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: 80vw; }

/* ---------------- 账号、广告栏与后台 ---------------- */
.user-chip {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 4px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border);
  line-height: 1.25;
}
.user-chip b { font-size: 12px; font-weight: 700; }
.user-chip em { font-style: normal; font-size: 10px; color: var(--muted); }

.ad-banner {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 92px; margin: -26px -30px 18px; padding: 18px 30px;
  background: linear-gradient(100deg, #eef1ff, #f9f6ff);
  border-bottom: 1px solid #dfe4ff; border-radius: 0; overflow: hidden;
}
.ad-banner.has-image { min-height: 190px; background-size: cover; background-position: center; }
.ad-banner.has-image::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(16,22,44,.82) 0%, rgba(16,22,44,.42) 100%);
}
.ad-content { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
.ad-badge {
  flex: none; padding: 4px 11px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
}
.ad-body { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.ad-body strong { font-size: 17px; line-height: 1.4; }
.ad-body span { font-size: 13px; color: var(--text-2); }
.ad-link {
  flex: none; padding: 7px 14px; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 600;
}
.ad-link:hover { background: var(--primary-dark); text-decoration: none; }
.ad-close {
  position: relative; z-index: 2; flex: none; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 8px; background: rgba(255,255,255,.6); color: var(--muted); font-size: 12px;
}
.ad-close:hover { background: #e5e9ff; color: var(--primary); }
.ad-banner.has-image .ad-badge { background: #fff; color: var(--primary); }
.ad-banner.has-image .ad-body strong { color: #fff; }
.ad-banner.has-image .ad-body span { color: rgba(255,255,255,.88); }
.ad-banner.has-image .ad-link { background: #fff; color: var(--primary); }
.ad-banner.has-image .ad-close { background: rgba(255,255,255,.22); color: #fff; }
/* 纯图片模式：图上已含完整文案，做成留白圆角小卡片，不通栏铺满 */
.ad-banner.image-only {
  padding: 0; min-height: 0; margin: 0 0 18px;
  aspect-ratio: 1920 / 240; border-radius: 12px;
  border: 1px solid var(--border); box-shadow: 0 3px 14px rgba(24,22,45,.06);
  background-color: #6a1622; background-repeat: no-repeat; background-size: cover; background-position: center;
}
.ad-banner.image-only::before { display: none; }
.ad-banner.image-only .ad-content { display: none; }
.ad-banner.image-only .ad-close {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 22px; height: 22px; border-radius: 6px;
  background: rgba(0,0,0,.22); color: #fff; font-size: 11px;
}
.ad-image-preview { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; }
.ad-image-preview img { width: 120px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.ad-upload-btn { margin: 0; white-space: nowrap; }

.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.auth-tabs button {
  flex: 1; padding: 9px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--text-2); font-weight: 600;
}
.auth-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-demo {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 14px; padding: 10px 12px; border-radius: 9px;
  background: var(--surface-2); font-size: 12px; color: var(--text-2);
}
.auth-divider {
  margin: 22px 0 14px; padding-top: 16px;
  border-top: 1px solid var(--border); font-weight: 700; font-size: 13px;
}
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 12px;
}
.info-row span { color: var(--text-2); }
.info-row b { color: var(--text); }

.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.admin-card-title { margin: 0 0 14px; font-size: 14px; }
.span-2 { grid-column: 1 / -1; }
.user-create { display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)) auto; gap: 8px; align-items: center; }
.user-create input, .user-create select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); outline: none;
}
.admin-table th, .admin-table td { white-space: nowrap; }
.admin-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-actions .btn { padding: 3px 7px; font-size: 11px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
  .user-create { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
  .two-col, .chat-layout { grid-template-columns: 1fr; }
  .chat-main { height: 68vh; }
  .chat-side { display: none; }
}
/* ---------------- 技能中心 / 工具调用 ---------------- */
.btn-sm { padding: 5px 10px; font-size: 12px; }
.skill-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 9px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
}
.active-skills {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 8px 16px; margin: 0 0 2px;
  border-bottom: 1px solid var(--border); background: var(--bg-soft, #f7f8fc);
}
.active-skills .as-label { font-size: 11px; color: var(--muted); margin-right: 2px; }
.skill-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: #eef1ff; color: var(--primary);
}
.skill-chip.mcp { background: #e8f7f0; color: #16794a; }

.skill-intro {
  display: flex; align-items: center; gap: 16px; margin-bottom: 22px;
  background: linear-gradient(100deg, #eef1ff, #f7f4ff);
}
.skill-intro-icon {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 12px; background: var(--primary); color: #fff; font-size: 22px;
}
.skill-intro > div:nth-child(2) { flex: 1; min-width: 0; }
.skill-intro p { margin: 4px 0 0; }
.skill-section { margin-bottom: 26px; }
.skill-section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.skill-section-head h2 { font-size: 16px; margin: 0; }
.shortcut-grid, .tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px;
}
.shortcut-card, .tool-card {
  display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--card, #fff); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.shortcut-card:hover, .tool-card:hover {
  border-color: var(--primary); box-shadow: 0 4px 16px rgba(60,70,140,.08); transform: translateY(-1px);
}
.shortcut-icon, .tool-icon {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 9px; background: #eef1ff; font-size: 17px;
}
.tool-card.mcp .tool-icon { background: #e8f7f0; }
.shortcut-body, .tool-body { min-width: 0; flex: 1; }
.shortcut-body strong, .tool-body strong { display: block; font-size: 13px; margin-bottom: 3px; }
.shortcut-body span, .tool-body span { display: block; font-size: 11px; color: var(--muted); line-height: 1.5; }
.tool-badge {
  display: inline-block; margin-top: 6px; padding: 2px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700; background: #eef1ff; color: var(--primary);
}
.tool-badge.off { background: #f0f0f3; color: #999; }
.tool-badge.mcp { background: #e8f7f0; color: #16794a; }

.skill-modal { width: min(560px, 94vw); }
.skill-pick-list { display: grid; gap: 8px; margin-top: 12px; max-height: 50vh; overflow-y: auto; }
.skill-pick-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.skill-pick-item:hover { border-color: var(--primary); }
.skill-pick-item input { width: 16px; height: 16px; accent-color: var(--primary); }
.skill-pick-item .pi-body { flex: 1; min-width: 0; }
.skill-pick-item .pi-body strong { display: block; font-size: 13px; }
.skill-pick-item .pi-body span { font-size: 11px; color: var(--muted); }

/* 消息里的工具调用过程 */
.tool-call-block {
  margin: 6px 0; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; font-size: 12px;
}
.tool-call-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: #f7f8fc; cursor: pointer; user-select: none;
}
.tool-call-head .tc-icon { font-size: 14px; }
.tool-call-head .tc-name { flex: 1; font-weight: 600; }
.tool-call-head .tc-state { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #fff2d6; color: #9a6b00; }
.tool-call-head .tc-state.done { background: #e8f7f0; color: #16794a; }
.tool-call-detail { padding: 10px 12px; border-top: 1px solid var(--border); }
.tool-call-detail .tc-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.tool-call-detail pre {
  margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: #f4f5f9;
  font-size: 11px; white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow-y: auto;
}
.tool-call-detail pre:last-child { margin-bottom: 0; }

/* MCP 后台配置 */
.mcp-list { display: grid; gap: 10px; margin: 12px 0 16px; }
.mcp-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid var(--border); border-radius: 10px;
}
.mcp-item .mcp-info { flex: 1; min-width: 0; }
.mcp-item .mcp-info strong { font-size: 13px; }
.mcp-item .mcp-info code { display: block; font-size: 11px; color: var(--muted); word-break: break-all; margin-top: 2px; }
.mcp-item .mcp-actions { display: flex; gap: 6px; flex: none; }
.mcp-add { padding-top: 14px; border-top: 1px solid var(--border); }
.mcp-add-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* 深度思考徽章 */
.think-badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; background: #ede9fe; color: #6d28d9; vertical-align: middle;
}
/* 思维链（思考过程）面板 */
.reasoning-block {
  margin: 0 0 8px; border: 1px solid #e6e2fb; border-radius: 10px;
  background: linear-gradient(180deg, #faf9ff, #f5f3ff); overflow: hidden;
}
.reasoning-head {
  display: flex; align-items: center; gap: 7px; padding: 8px 12px;
  font-size: 12px; font-weight: 700; color: #6d28d9; cursor: pointer; user-select: none;
}
.reasoning-head:hover { background: #f1eeff; }
.reasoning-icon { font-size: 14px; }
.reasoning-tip { margin-left: auto; font-weight: 400; font-size: 11px; color: #9a8fc7; }
.reasoning-arrow { font-size: 12px; color: #8b7fc0; }
.reasoning-body {
  padding: 0 13px 10px; color: #5b5478; font-size: 12.5px; line-height: 1.7;
  max-height: 340px; overflow-y: auto;
}
.reasoning-body .markdown { font-size: 12.5px; color: #5b5478; }
.reasoning-block.open .reasoning-body { border-top: 1px dashed #e2dcf8; padding-top: 8px; }

@media (max-width: 720px) {
  .sidebar { width: 66px; padding: 14px 8px; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 10px 4px; }
  .nav-item svg { grid-row: auto; }
  .nav-item span, .nav-item em, .tip-card { display: none; }
  .main { padding: 18px 14px 30px; }
  .topbar { padding: 0 14px; }
  .brand-sub { display: none; }
  .status-pill, .user-chip { display: none; }
  .ad-banner { margin: -18px -14px 14px; padding: 14px; min-height: 130px; }
  .ad-banner.image-only { margin: 0 0 14px; padding: 0; min-height: 0; border-radius: 10px; }
  .ad-body { min-width: 150px; }
  .ad-body strong { font-size: 15px; }
  .ad-link { padding: 5px 10px; }
  .grid-2 { grid-template-columns: 1fr; }
  .top-actions { gap: 6px; }
  .brand-title { font-size: 14px; }
}
