:root {
  --bg: #0a0b14;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #e8eaf2;
  --muted: #9aa0b4;
  --c1: #7c5cff;
  --c2: #2f9bff;
  --c3: #1fd1c4;
  --grad: linear-gradient(120deg, var(--c1), var(--c2) 55%, var(--c3));
  --radius: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --grid: rgba(255, 255, 255, 0.03);
}

/* 浅色主题 */
[data-theme="light"] {
  --bg: #eef0f6;
  --glass: rgba(255, 255, 255, 0.7);
  --glass-strong: rgba(255, 255, 255, 0.85);
  --border: rgba(10, 12, 30, 0.1);
  --text: #1a1d2b;
  --muted: #5a6075;
  --shadow: 0 10px 40px rgba(20, 30, 80, 0.12);
  --grid: rgba(10, 12, 30, 0.04);
}

/* 主题色预设 */
[data-accent="blue"] { --c1: #3b6dff; --c2: #2f9bff; --c3: #36e0d0; }
[data-accent="teal"] { --c1: #10b9a6; --c2: #1fd1c4; --c3: #3b82f6; }
[data-accent="sunset"] { --c1: #ff7a59; --c2: #ff5c8a; --c3: #ffb24d; }

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 渐变光晕背景 */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(40% 40% at 18% 20%, color-mix(in srgb, var(--c1) 38%, transparent), transparent 70%),
    radial-gradient(38% 38% at 82% 18%, color-mix(in srgb, var(--c2) 32%, transparent), transparent 70%),
    radial-gradient(45% 45% at 60% 88%, color-mix(in srgb, var(--c3) 28%, transparent), transparent 70%);
  filter: blur(20px);
  animation: drift 18s ease-in-out infinite alternate;
  z-index: -2;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 46px 46px;
  z-index: -1;
  mask-image: radial-gradient(circle at 50% 30%, #000 30%, transparent 80%);
}
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-3%, 2%) scale(1.08); }
}

/* 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 32px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  font-size: 26px;
  border-radius: 14px;
  background: var(--grad);
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.5);
}
h1 {
  font-size: 22px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 1px;
}
.sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.stats { display: flex; gap: 12px; margin-left: auto; }
.stat {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 18px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  min-width: 78px;
}
.stat-num { font-size: 22px; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

.search-wrap {
  position: relative;
  display: flex; align-items: center;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  transition: border-color .2s, box-shadow .2s;
}
.search-wrap:focus-within { border-color: var(--c2); box-shadow: 0 0 0 3px rgba(47, 155, 255, 0.2); }
.s-ico { opacity: .6; margin-right: 6px; }
#search {
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 14px; padding: 11px 4px; width: 220px;
}
#search::placeholder { color: var(--muted); }

/* 布局 */
.layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  padding: 28px 32px 40px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}
.col-main { min-width: 0; }

.block-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.block-head h2 { font-size: 16px; color: var(--muted); font-weight: 600; }

.cats { display: flex; gap: 8px; flex-wrap: wrap; }
.cat {
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.cat:hover { color: var(--text); border-color: var(--c2); }
.cat.active {
  color: #fff;
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.45);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  animation: rise .5s both;
}
.card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, 0.14) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform .6s;
}
.card:hover { transform: translateY(-6px); border-color: var(--c2); box-shadow: var(--shadow); }
.card:hover::after { transform: translateX(120%); }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.ico {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 22px;
  border-radius: 12px;
  background: var(--grad);
  box-shadow: 0 6px 16px rgba(124, 92, 255, 0.35);
}
.pin { font-size: 11px; color: var(--c3); border: 1px solid var(--c3); border-radius: 6px; padding: 1px 6px; }
.ico-img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.note-emoji:has(.ico-img) { background: none; box-shadow: none; }
.note-emoji .ico-img { border-radius: 11px; }

/* 添加弹窗：图标上传 */
.ico-upload { display: flex; flex-direction: column; gap: 6px; }
.ico-upload input[type="file"] {
  font-size: 12px; color: var(--text-2); padding: 6px;
  border: 1px dashed var(--line); border-radius: 8px; background: rgba(255,255,255,.02);
}
.ico-prev { display: inline-flex; }
.ico-prev img { width: 40px; height: 40px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.fav-btn {
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition: transform .15s, color .15s, background .15s;
}
.fav-btn:hover { background: rgba(255,255,255,.06); transform: scale(1.15); }
.fav-btn.on { color: #ffcc33; }

/* ⚑ 置顶按钮（点一下置顶常用工具） */
.fav-tip { grid-column: 1 / -1; color: var(--muted); font-size: 12px; margin: 0 0 4px; opacity: .8; }
.top-btn {
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition: transform .15s, color .15s, background .15s;
}
.top-btn:hover { background: rgba(255,255,255,.06); color: var(--c2); transform: scale(1.15); }
.top-btn.on { color: #ff8a3d; }
.name { font-size: 15px; font-weight: 600; margin-top: 12px; }
.desc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; min-height: 34px; }
.cat-tag { font-size: 11px; color: var(--muted); margin-top: 10px; }
.empty { color: var(--muted); grid-column: 1 / -1; text-align: center; padding: 40px; }

/* 迷你工具卡 */
.mini-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.mini-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.mini-card.ai-room { border-color: rgba(124, 92, 255, 0.4); box-shadow: inset 0 0 30px rgba(124, 92, 255, 0.12); }
.mini-top { display: flex; align-items: center; gap: 10px; }
.mini-ico { font-size: 20px; }
.mini-card h3 { font-size: 15px; }
.mini-desc { font-size: 12px; color: var(--muted); margin: 10px 0 12px; line-height: 1.5; }
.mini-soon {
  display: inline-block; font-size: 11px; color: var(--muted);
  background: var(--glass-strong); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 8px;
}
.mini-soon.locked { color: #ffd479; border-color: rgba(255, 212, 121, 0.4); }

/* 侧栏面板 */
.col-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 96px; }
.panel {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(14px);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-head h3 { font-size: 15px; }
.panel-hint { font-size: 11px; color: var(--muted); }

.todo-form input {
  width: 100%;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
}
.todo-form input:focus { border-color: var(--c2); }
.todo-list { list-style: none; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.todo-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
  animation: rise .3s both;
}
.todo-item .chk {
  width: 18px; height: 18px; flex: none;
  border-radius: 6px; border: 1.5px solid var(--border);
  cursor: pointer; display: grid; place-items: center; font-size: 12px;
  transition: all .2s;
}
.todo-item.done .chk { background: var(--grad); border-color: transparent; }
.todo-item.done .txt { color: var(--muted); text-decoration: line-through; }
.todo-item .txt { flex: 1; word-break: break-all; }
.todo-item .del { color: var(--muted); cursor: pointer; opacity: .5; transition: opacity .2s; flex: none; }
.todo-item .del:hover { opacity: 1; color: #ff7a7a; }

.notes-area {
  width: 100%;
  min-height: 150px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition: border-color .2s;
}
.notes-area:focus { border-color: var(--c2); }
.notes-area::placeholder { color: var(--muted); }

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px;
  border-top: 1px solid var(--border);
}
.admin-link { color: var(--c2); text-decoration: none; margin-left: 8px; }
.admin-link:hover { text-decoration: underline; }

/* 左右分栏布局 */
body { display: flex; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* 左侧导航 */
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: 232px;
  min-height: 100vh;
  padding: 22px 16px;
  background: rgba(255, 255, 255, 0.035);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex-shrink: 0;
  backdrop-filter: blur(18px);
}
.sb-brand { gap: 10px; padding: 0 4px; }
.sb-logo { width: 40px; height: 40px; font-size: 20px; border-radius: 11px; box-shadow: 0 6px 18px rgba(124, 92, 255, 0.4); }
.sidebar h1 { font-size: 16px; letter-spacing: 0.5px; }
.sidebar .sub { font-size: 11px; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color .2s, background .2s;
}
.nav-item:hover { color: var(--text); background: var(--glass); }
.nav-item.active {
  color: #fff;
  background: var(--glass-strong);
  box-shadow: inset 0 0 0 1px var(--border);
}
.nav-ico { font-size: 16px; width: 22px; text-align: center; }

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sidebar-foot .admin-link { color: var(--muted); text-decoration: none; font-size: 12px; }
.sidebar-foot .admin-link:hover { color: var(--c2); }

/* 页内顶部条 */
.page-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.page-top .stats { margin-left: 0; }
.page-top .search-wrap { margin-left: auto; }
.page-title h2 { font-size: 18px; margin-bottom: 4px; }
.page-title p { color: var(--muted); font-size: 12px; }

/* AI 群聊页 */
.chat-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 260px;
  gap: 20px;
  padding: 20px 32px 40px;
  max-width: 1500px;
  margin: 0 auto;
  height: calc(100vh - 170px);
}
.roles {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  overflow-y: auto;
}
.roles h3 { font-size: 15px; }
.roles-hint { font-size: 12px; color: var(--muted); margin: 8px 0 14px; line-height: 1.5; }
.role-list { display: flex; flex-direction: column; gap: 12px; }
.role-item {
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.role-row { display: flex; align-items: center; gap: 8px; }
.role-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grad); flex: none; }
.role-name { flex: 1; background: transparent; border: none; color: var(--text); font-size: 13px; font-weight: 600; outline: none; }
.role-model { background: var(--glass); border: 1px solid var(--border); color: var(--muted); font-size: 11px; border-radius: 6px; padding: 3px 6px; max-width: 130px; }
.role-prompt { width: 100%; margin-top: 8px; background: transparent; border: none; color: var(--muted); font-size: 12px; line-height: 1.5; resize: none; outline: none; font-family: inherit; }
.role-active { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.role-active input { accent-color: var(--c2); cursor: pointer; }
.role-badge { font-size: 11px; color: var(--c2); border: 1px solid var(--c2); border-radius: 6px; padding: 1px 6px; }
.role-badge-ceo { color: #1a1a1a; background: #ffd54a; border-color: #ffd54a; font-weight: 700; }
.role-del { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 2px 4px; border-radius: 6px; }
.role-del:hover { color: #ff6b6b; background: rgba(255,107,107,.12); }
.role-off { opacity: .45; filter: grayscale(.6); }
.role-off .role-active { color: var(--c1); }
.btn-ghost {
  margin-top: 14px; width: 100%;
  background: transparent; border: 1px dashed var(--border);
  color: var(--muted); border-radius: 10px; padding: 9px; cursor: pointer; font-size: 13px;
  transition: all .2s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--c2); }

/* 右侧历史会议栏 */
.history {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.hist-head { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.hist-count { font-size: 11px; color: var(--muted); background: var(--glass-strong); border: 1px solid var(--border); border-radius: 10px; padding: 0 7px; }
.hist-list { display: flex; flex-direction: column; gap: 10px; }
.hist-empty { font-size: 12px; color: var(--muted); line-height: 1.6; text-align: center; padding: 20px 6px; }
.hist-item {
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.hist-item:hover { border-color: var(--c2); transform: translateY(-1px); }
.hist-item.active { border-color: var(--c2); box-shadow: 0 0 0 1px var(--c2) inset; }
.hist-topic { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; margin-bottom: 6px; }
.hist-meta { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hist-done { color: var(--c3); }
.hist-live { color: #ff8a3d; }
/* 回放态：聊天区加灰边提示只读 */
.stream.replay { opacity: .96; }
.sc-done { opacity: .8; }
.sc-done span { color: var(--muted); }

@media (max-width: 1080px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .history { order: 3; max-height: 360px; }
}

.chat-main { display: flex; flex-direction: column; background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stream { flex: 1; padding: 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.stream-empty { margin: auto; text-align: center; color: var(--text); }
.stream-empty-ico { font-size: 40px; margin-bottom: 12px; }
.stream-empty .muted { color: var(--muted); font-size: 13px; margin-top: 6px; }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); background: var(--glass-strong); }
.chat-input input { flex: 1; background: var(--glass); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; color: var(--text); font-size: 14px; outline: none; }
.chat-input input:disabled { opacity: .5; }
.btn-send { background: var(--grad); border: none; color: #fff; border-radius: 10px; padding: 0 22px; font-size: 14px; cursor: pointer; box-shadow: 0 6px 18px rgba(124,92,255,.4); }
.btn-send:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ---- 群聊气泡 ---- */
.msg { display: flex; flex-direction: column; max-width: 86%; animation: rise .35s ease both; }
.msg-user { align-self: flex-end; align-items: flex-end; }
.msg-role { align-self: flex-start; align-items: flex-start; }
.msg-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.msg-name { font-size: 12px; font-weight: 700; color: var(--text); }
.msg-model { font-size: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.bubble { border-radius: 14px; padding: 11px 15px; font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.bubble-user { background: var(--grad); color: #fff; border-bottom-right-radius: 4px; box-shadow: 0 6px 18px rgba(124,92,255,.35); }
.bubble-role { background: var(--glass-strong); border: 1px solid var(--border); border-bottom-left-radius: 4px; color: var(--text); min-height: 20px; }
.msg-meta { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* ---- 侧栏标签 ---- */
.side-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.side-tab { flex: 1; background: var(--glass); border: 1px solid var(--border); color: var(--muted); border-radius: 9px; padding: 8px; font-size: 13px; cursor: pointer; transition: all .2s; }
.side-tab.active { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 4px 14px rgba(124,92,255,.35); }

/* ---- 会议面板 ---- */
.meeting-info { background: var(--glass-strong); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-top: 4px; }
.mi-topic { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; line-height: 1.5; }
.mi-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.meeting-members, .meeting-idle { display: flex; flex-wrap: wrap; gap: 6px; }
.member-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--glass); border: 1px solid var(--border); color: var(--text); font-size: 12px; border-radius: 20px; padding: 4px 11px; cursor: pointer; transition: all .15s; }
.member-chip .role-dot { width: 8px; height: 8px; }
.member-chip.in { background: rgba(74,222,128,.14); border-color: #4ade80; }
.member-chip.out { opacity: .6; }
.member-chip:hover { filter: brightness(1.15); }

/* ---- 系统气泡 ---- */
.msg-sys { align-self: center; max-width: 92%; }
.sys-line { font-size: 11px; color: var(--muted); background: rgba(255,255,255,.04); border: 1px dashed var(--border); border-radius: 20px; padding: 4px 14px; text-align: center; }

/* ---- 总结卡片 ---- */
.summary-card { align-self: stretch; background: var(--glass-strong); border: 1px solid var(--c2); border-radius: 14px; padding: 16px; margin-top: 6px; animation: rise .35s ease both; }
.summary-head { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.summary-sub { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.summary-col { margin-bottom: 12px; }
.sc-title { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.sc-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--glass); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; margin-bottom: 7px; font-size: 12.5px; color: var(--text); }
.sc-btn { flex: none; background: var(--grad); border: none; color: #fff; border-radius: 7px; padding: 4px 10px; font-size: 11px; cursor: pointer; }
.sc-btn:disabled { background: #4ade80; cursor: default; }

/* ---- 开始会议弹窗 ---- */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 50; backdrop-filter: blur(4px); }
.modal-card { width: 380px; max-width: 90vw; background: var(--glass-strong); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal-title { font-size: 17px; font-weight: 700; color: var(--text); }
.modal-sub { font-size: 12px; color: var(--muted); margin: 6px 0 14px; line-height: 1.5; }
.modal-input { width: 100%; box-sizing: border-box; background: var(--glass); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; color: var(--text); font-size: 14px; outline: none; font-family: inherit; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn-send { flex: 1; }
.modal-actions .btn-ghost { margin-top: 0; flex: 1; }

/* ---- 角色面板增强 ---- */
.role-badge { font-size: 10px; color: #c084fc; border: 1px solid #c084fc55; border-radius: 6px; padding: 1px 6px; flex: none; }
.role-del { flex: none; width: 22px; height: 22px; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; border-radius: 6px; }
.role-del:hover { background: rgba(255,90,90,.12); color: #ff6b6b; }
.role-model { max-width: 100%; }

@media (max-width: 920px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .tabs { padding: 10px 20px 0; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .col-side { position: static; }
  .stats { order: 3; width: 100%; justify-content: space-between; margin-left: 0; }
  .mini-tools { grid-template-columns: 1fr; }
}

/* 知识库页 */
.kb-source { display: flex; align-items: center; gap: 8px; }
.src-btn {
  background: rgba(255,255,255,.06); color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 14px; font-size: 13px; cursor: pointer; transition: .15s;
}
.src-btn:hover { color: var(--text); border-color: var(--c2); }
.src-btn.active { background: var(--c2); color: #fff; border-color: var(--c2); }
.src-status { font-size: 12px; color: var(--muted); margin-left: 4px; }
.kb-main { padding: 24px 28px 40px; max-width: 1400px; margin: 0 auto; }
.kb-quick {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: 14px; padding: 0 14px;
  transition: border-color .2s, box-shadow .2s;
}
.kb-quick:focus-within { border-color: var(--c2); box-shadow: 0 0 0 3px rgba(47, 155, 255, 0.2); }
.kb-quick-ico { font-size: 18px; opacity: .7; }
#quickAdd {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 15px; padding: 14px 4px;
}
#quickAdd::placeholder { color: var(--muted); }
.kb-hint { font-size: 12px; color: var(--muted); margin: 10px 2px 18px; line-height: 1.5; }

.kb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.kb-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.kb-tag {
  border: 1px solid var(--border); background: var(--glass);
  color: var(--muted); padding: 7px 14px; border-radius: 999px;
  font-size: 13px; cursor: pointer; transition: all .2s;
}
.kb-tag:hover { color: var(--text); border-color: var(--c2); }
.kb-tag.active { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 6px 18px rgba(124, 92, 255, 0.45); }
.btn-new {
  background: var(--grad); border: none; color: #fff;
  border-radius: 10px; padding: 9px 18px; font-size: 13px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.4); white-space: nowrap;
  transition: transform .2s;
}
.btn-new:hover { transform: translateY(-2px); }

.note-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.note-card {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  position: relative; overflow: hidden; cursor: pointer;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  animation: rise .5s both;
}
.note-card:hover { transform: translateY(-5px); border-color: var(--c2); box-shadow: var(--shadow); }
.note-top { display: flex; align-items: center; justify-content: space-between; }
.note-emoji {
  width: 38px; height: 38px; display: grid; place-items: center;
  font-size: 19px; border-radius: 11px; background: var(--grad);
  box-shadow: 0 5px 14px rgba(124, 92, 255, 0.35);
}
.note-date { font-size: 11px; color: var(--muted); }
.note-title { font-size: 15px; font-weight: 600; margin-top: 12px; }
.note-body { font-size: 12px; color: var(--muted); margin: 6px 0 12px; line-height: 1.6; max-height: 60px; overflow: hidden; }
.note-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ntag { font-size: 11px; color: var(--c3); background: rgba(31, 209, 196, 0.12); border: 1px solid rgba(31, 209, 196, 0.3); border-radius: 6px; padding: 2px 8px; }
.note-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.note-src { font-size: 11px; color: var(--muted); }
.note-del { font-size: 11px; color: var(--muted); cursor: pointer; opacity: .55; transition: opacity .2s; }
.note-del:hover { opacity: 1; color: #ff7a7a; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; background: rgba(5, 6, 12, 0.6);
  backdrop-filter: blur(6px); display: none; place-items: center; z-index: 50;
}
.modal.open { display: grid; }
.modal-box {
  width: min(520px, 92vw); background: #14151f;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); animation: rise .3s both;
}
.modal-box h3 { font-size: 17px; margin-bottom: 16px; }
.modal-input, .modal-area {
  width: 100%; background: var(--glass-strong); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 13px; color: var(--text); font-size: 14px;
  outline: none; margin-bottom: 12px; font-family: inherit; transition: border-color .2s;
}
.modal-input:focus, .modal-area:focus { border-color: var(--c2); }
.modal-area { min-height: 120px; resize: vertical; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.modal-actions .btn-send { padding: 9px 22px; }
.modal-actions .btn-ghost {
  margin-top: 0; width: auto; padding: 9px 18px; border-style: solid;
}

/* 资讯看板 */
.news-refresh { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.news-updated { font-size: 12px; color: var(--muted); }
.news-card .note-body { max-height: 72px; }
.news-open {
  font-size: 12px; color: var(--c2); text-decoration: none;
  border: 1px solid rgba(47, 155, 255, 0.4); border-radius: 7px;
  padding: 3px 9px; transition: all .2s;
}
.news-open:hover { background: rgba(47, 155, 255, 0.15); }

/* 自定义渠道弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(5,6,12,.6); backdrop-filter: blur(6px); display: none; place-items: center; z-index: 50; }
.modal-mask.show { display: grid; }
/* 兼容任何把 display 设成 flex/grid/block 的触发方式：都能居中子元素 */
.modal-mask[style*="display: flex"],
.modal-mask[style*="display:grid"],
.modal-mask[style*="display: grid"] { align-items: center; justify-content: center; }
.modal-box input, .modal-box select, .modal-box textarea {
  width: 100%; background: var(--glass-strong); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 13px; color: var(--text); font-size: 14px;
  outline: none; margin-bottom: 12px; font-family: inherit; transition: border-color .2s;
}
.modal-box input:focus, .modal-box select:focus, .modal-box textarea:focus { border-color: var(--c2); }
.modal-box textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.modal-sub { font-size: 12px; color: var(--muted); margin: -6px 0 16px; }
.ch-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; max-height: 220px; overflow: auto; }
.ch-item { display: flex; align-items: center; gap: 10px; background: var(--glass-strong); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.ch-emoji2 { font-size: 18px; }
.ch-meta { flex: 1; min-width: 0; }
.ch-name { font-size: 14px; color: var(--text); }
.ch-type { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-del { background: transparent; border: 1px solid rgba(255,122,122,.4); color: #ff7a7a; border-radius: 7px; padding: 4px 10px; font-size: 12px; cursor: pointer; transition: all .2s; }
.ch-del:hover { background: rgba(255,122,122,.15); }
.ch-form { border-top: 1px solid var(--border); padding-top: 14px; }
.ch-row2 { display: flex; gap: 10px; }
.ch-row2 select { flex: 1; }
.ch-emoji { width: 64px !important; text-align: center; }
.src-type { background: rgba(124,92,255,.2) !important; color: #b9a6ff !important; }
@media (max-width: 920px) {
  .news-refresh { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* 主看板总览 */
.dash { padding: 24px 28px 40px; max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dstat { background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; backdrop-filter: blur(14px); animation: rise .5s both; }
.dstat-num { font-size: 30px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dstat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.dstat-sub { font-size: 11px; color: var(--muted); margin-top: 2px; opacity: .8; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
/* 仅右列（待办看板）拉伸填满，左列今日重点保持自然高度 */
.dash-grid > .dash-col:last-child > .dcard { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.dash-grid > .dash-col:last-child > .dcard .dash-list { flex: 1 1 auto; overflow-y: auto; min-height: 160px; padding-right: 4px; }

/* 最新动态：看板下方上下堆叠横板（资讯在上、知识库在下，分开） */
.dash-news { display: flex; flex-direction: column; gap: 16px; }
.dash-news .dcard { display: flex; flex-direction: column; min-height: 0; }
.dash-news .dcard .dash-list.dash-list-row { flex: 1 1 auto; overflow-y: auto; min-height: 120px; padding-right: 4px; }
.dash-news .dcard .dash-list-row .dash-li { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.dash-news .dcard .dash-list-row .dash-li-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-news .dcard .dash-list-row .dash-li-meta { flex: none; white-space: nowrap; }
.dcard { background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(14px); animation: rise .5s both; }
.dcard-head { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.dcard-sub { font-size: 12px; color: var(--c3); margin: 14px 0 8px; }
.dash-todo { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.dash-todo-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text); }
.dash-todo-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); flex: none; }
.dash-todo-item.done { color: var(--muted); text-decoration: line-through; }
.dash-todo-item.done .dot { background: var(--border); }
.dash-scratch { font-size: 13px; color: var(--muted); line-height: 1.6; white-space: pre-wrap; }
.dash-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.dash-li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--glass-strong); border: 1px solid var(--border); border-radius: 10px; transition: border-color .2s; }
.dash-li:hover { border-color: var(--c2); }
.dash-li-title { font-size: 13px; color: var(--text); }
.dash-li-meta { font-size: 11px; color: var(--muted); }
.dash-empty { font-size: 12px; color: var(--muted); padding: 6px 2px; }
.dash-empty a { color: var(--c2); }
.dash-more { margin-top: 2px; list-style: none; }
.dash-more a { color: var(--c2); font-size: 12px; text-decoration: none; }
.dash-more a:hover { text-decoration: underline; }
.dash-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.qcard { display: flex; align-items: center; gap: 12px; background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--text); font-size: 14px; transition: transform .2s, border-color .2s, box-shadow .2s; animation: rise .5s both; }
.qcard:hover { transform: translateY(-4px); border-color: var(--c2); box-shadow: var(--shadow); }
.q-ico { width: 42px; height: 42px; display: grid; place-items: center; font-size: 20px; border-radius: 12px; background: var(--grad); box-shadow: 0 6px 16px rgba(124,92,255,.35); }
@media (max-width: 920px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-quick { grid-template-columns: repeat(2, 1fr); }
  .kanban { grid-template-columns: 1fr; }
}

/* 总览：待办添加 + 看板 */
.dash-todo-form { display: flex; gap: 8px; margin-bottom: 4px; }
.dash-todo-form input { width: auto; flex: 1; }
.btn-add {
  background: var(--grad); border: none; color: #fff; border-radius: 10px;
  padding: 0 16px; font-size: 13px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.35); transition: transform .2s;
  font-family: inherit;
}
.btn-add:hover { transform: translateY(-1px); }
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 4px; }
.kanban-col {
  background: var(--glass-strong); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 90px;
}
.kc-head { font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.kc-count { background: var(--glass); border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; font-size: 11px; color: var(--text); }
.kc-list { display: flex; flex-direction: column; gap: 8px; }
.kc-empty { font-size: 11px; color: var(--muted); text-align: center; padding: 14px 0; }
.kanban-card {
  background: var(--glass); border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px; animation: rise .3s both; transition: border-color .2s;
  overflow: hidden;
}
.kanban-card:hover { border-color: var(--c2); }
.kc-main {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px; cursor: pointer;
}
.kanban-card .kc-txt { flex: 1; word-break: break-all; line-height: 1.5; }
.kanban-card.done .kc-txt { color: var(--muted); text-decoration: line-through; }
.kc-toggle {
  flex: none; border: none; background: transparent; cursor: pointer; font-size: 13px;
  color: var(--muted); transition: transform .25s, color .2s; padding: 0 2px; line-height: 1.5;
}
.kanban-card.open .kc-toggle { transform: rotate(180deg); color: var(--c2); }
.kc-detail {
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .3s ease, opacity .25s ease, padding .3s ease;
  padding: 0 10px;
  border-top: 1px solid transparent;
}
.kanban-card.open .kc-detail {
  max-height: 160px; opacity: 1; padding: 8px 10px 12px;
  border-top: 1px solid var(--border);
}
.kc-detail-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.kc-meta { line-height: 1.5; }
.kc-move-row label { flex: none; }
.kc-status {
  flex: 1; background: var(--glass-strong); border: 1px solid var(--border);
  color: var(--text); font-size: 12px; border-radius: 8px; padding: 6px 8px; outline: none;
  font-family: inherit; cursor: pointer;
}
.kc-status:focus { border-color: var(--c2); }
.kc-detail-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.kc-del {
  border: 1px solid rgba(255, 122, 122, 0.4); background: transparent; cursor: pointer;
  color: #ff7a7a; border-radius: 8px; padding: 5px 14px; font-size: 12px;
  transition: background .2s, opacity .2s; font-family: inherit;
}
.kc-del:hover { background: rgba(255, 122, 122, 0.15); }

/* 项目 / 客户 / 财务 页 */
.sum-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; padding: 18px 28px 0; max-width: 1400px; margin: 0 auto; }
.proj-bar { height: 8px; background: var(--glass-strong); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.proj-fill { height: 100%; background: var(--grad); border-radius: 999px; transition: width .4s; }
.proj-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 12px; color: var(--muted); }
.kv { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.kv b { color: var(--text); font-weight: 600; }
.amt-in { color: #ff6b6b; font-weight: 700; }
.amt-out { color: #4ade80; font-weight: 700; }
@media (max-width: 920px) { .sum-stats { grid-template-columns: repeat(2, 1fr); } }

/* 设置页 */
.settings { max-width: 880px; margin: 0 auto; padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 18px; }
.set-card { background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; backdrop-filter: blur(18px); }
.set-head { padding: 15px 20px; font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--border); background: var(--glass-strong); }
.set-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.set-tip { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin: 0; }
.set-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.set-hint { font-size: 12px; color: var(--c3); margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input { background: var(--glass-strong); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 14px; font-family: inherit; }
.field input:focus { outline: none; border-color: var(--c2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c2) 25%, transparent); }
.field-block { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; background: var(--glass-strong); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; width: fit-content; }
.seg-btn { border: none; background: transparent; color: var(--muted); font-size: 13px; padding: 8px 16px; border-radius: 9px; cursor: pointer; transition: all .2s; font-family: inherit; }
.seg-btn.active { color: #fff; background: var(--grad); box-shadow: 0 4px 12px rgba(124,92,255,.35); }
.swatches { display: inline-flex; gap: 10px; }
.sw { width: 36px; height: 36px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; transition: transform .2s; }
.sw:hover { transform: scale(1.08); }
.sw.active { border-color: #fff; box-shadow: 0 0 0 3px var(--grad); }
.file-btn { cursor: pointer; display: inline-flex; align-items: center; }
@media (max-width: 920px) { .settings { padding: 18px 16px 40px; } }

/* 随时助理：右下角悬浮入口 */
.assistant { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.assist-fab {
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 26px; background: var(--grad); color: #fff;
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.55);
  transition: transform .2s, box-shadow .2s; flex: none;
}
.assist-fab:hover { transform: translateY(-3px) scale(1.05); }
.assist-panel {
  width: 340px; max-width: calc(100vw - 48px);
  background: var(--glass-strong); border: 1px solid var(--border);
  border-radius: var(--radius); backdrop-filter: blur(20px);
  box-shadow: var(--shadow); overflow: hidden;
  transform-origin: bottom right; transform: scale(.85); opacity: 0; pointer-events: none;
  transition: transform .22s ease, opacity .22s ease;
  display: flex; flex-direction: column;
}
.assist-panel.open { transform: scale(1); opacity: 1; pointer-events: auto; }
.assist-head { padding: 14px 16px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--border); background: var(--glass); display: flex; flex-direction: column; gap: 2px; }
.assist-hint { font-size: 11px; color: var(--muted); font-weight: 400; }
.assist-log { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; font-size: 13px; line-height: 1.5; }
.assist-msg { color: var(--text); background: var(--glass); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; word-break: break-all; }
.assist-msg.err { color: #ffb4b4; border-color: rgba(255, 122, 122, 0.35); }
.assist-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--glass); }
.assist-form input { flex: 1; width: auto; background: var(--glass-strong); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 13px; outline: none; font-family: inherit; }
.assist-form input:focus { border-color: var(--c2); }

/* RunningHub 工作流卡片 */
.card { display: block; }
.card-rh { border-color: color-mix(in srgb, var(--c3) 45%, var(--border)); }
.card-rh:hover { border-color: var(--c3); box-shadow: 0 8px 24px color-mix(in srgb, var(--c3) 18%, transparent); }
.card .card-link { display: block; text-decoration: none; color: inherit; }
.card .card-link:hover { color: inherit; }
.card-rh .pin.rh { background: color-mix(in srgb, var(--c3) 22%, transparent); color: var(--c3); border: 1px solid color-mix(in srgb, var(--c3) 50%, transparent); }
.btn.rh-trigger { margin-top: 10px; width: 100%; background: linear-gradient(135deg, var(--c3), var(--c2)); border: none; color: #0c0f1a; font-weight: 600; border-radius: 10px; padding: 9px 12px; cursor: pointer; font-family: inherit; font-size: 13px; transition: opacity .2s, transform .15s; }
.btn.rh-trigger:hover { opacity: .9; transform: translateY(-1px); }
.btn.rh-trigger:disabled { opacity: .6; cursor: default; transform: none; }
.tag-rh { color: var(--c3); font-size: 11px; }

/* ============ 管理端 admin.html 专属样式 ============ */
.admin-wrap { max-width: 920px; margin: 0 auto; padding: 40px 22px 80px; animation: rise .4s both; }

/* 口令门 */
.gate {
  max-width: 380px; margin: 12vh auto 0; padding: 34px 30px;
  background: var(--glass-strong); border: 1px solid var(--border);
  border-radius: 18px; text-align: center; box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.gate h1 { font-size: 22px; margin-bottom: 6px; }
.gate input {
  width: 100%; margin-top: 16px; background: var(--glass); border: 1px solid var(--border);
  border-radius: 11px; padding: 12px 14px; color: var(--text); font-size: 15px;
  outline: none; font-family: inherit; transition: border-color .2s;
}
.gate input:focus { border-color: var(--c2); }
.gate .btn { margin-top: 4px; width: 100%; }
.gate p { font-size: 12px; line-height: 1.6; }

/* 面板标题 */
.admin-wrap h1 { font-size: 24px; margin-bottom: 4px; }
.admin-wrap h2 { font-size: 16px; margin: 30px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* 提示条 */
.note {
  background: color-mix(in srgb, var(--c3) 10%, var(--glass));
  border: 1px solid color-mix(in srgb, var(--c3) 35%, transparent);
  border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.7; color: var(--text);
}
.note b { color: var(--c2); }

/* 表单整体卡片化 */
.admin-wrap form {
  background: var(--glass-strong); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px; box-shadow: var(--shadow);
}
.form-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.form-row label {
  flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.form-row label input,
.form-row label select,
.form-row label textarea {
  background: var(--glass); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; color: var(--text); font-size: 14px; outline: none;
  font-family: inherit; transition: border-color .2s; width: 100%;
}
.form-row label input:focus,
.form-row label select:focus,
.form-row label textarea:focus { border-color: var(--c2); }
.form-row label textarea { min-height: 64px; resize: vertical; line-height: 1.6; }
.form-row label select { cursor: pointer; appearance: none; }

/* RunningHub 区块视觉分组 */
#row-runhub { width: 100%; border-top: 1px dashed var(--border); padding-top: 14px; margin-top: 2px; }

/* 按钮组 */
.admin-wrap .form-row:has(button) { gap: 12px; }
.btn {
  background: var(--grad); border: none; color: #fff; border-radius: 10px;
  padding: 11px 22px; font-size: 14px; cursor: pointer; font-family: inherit; font-weight: 600;
  box-shadow: 0 6px 18px rgba(124,92,255,.35); transition: transform .15s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn.ghost {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  box-shadow: none; font-weight: 500;
}
.btn.ghost:hover { color: var(--text); border-color: var(--c2); transform: translateY(-1px); }
.btn.danger { background: transparent; border: 1px solid color-mix(in srgb, #ff7a7a 50%, transparent); color: #ff7a7a; box-shadow: none; font-weight: 500; }
.btn.danger:hover { background: color-mix(in srgb, #ff7a7a 16%, transparent); transform: translateY(-1px); }
/* 按钮行（含非 label 子元素）不强制 flex 撑满 */
.admin-wrap .form-row.btns { flex-wrap: wrap; }
.admin-wrap .form-row.btns .btn { flex: none; }

/* 已有工具列表 */
.tool-list { display: flex; flex-direction: column; gap: 10px; }
.tool-list .tool-item {
  display: flex; align-items: center; gap: 12px; background: var(--glass-strong);
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; transition: border-color .2s;
}
.tool-list .tool-item:hover { border-color: var(--c2); }
.tool-list .tool-item .ico {
  width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center;
  font-size: 20px; background: var(--glass);
}
.tool-list .tool-item .meta { flex: 1; min-width: 0; }
.tool-list .tool-item .n { font-size: 14px; font-weight: 600; color: var(--text); }
.tool-list .tool-item .u {
  font-size: 11px; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.tool-list .tool-item .ops { display: flex; gap: 6px; flex: none; }
.tool-list .tool-item .ops button {
  border: 1px solid var(--border); background: var(--glass); color: var(--muted);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; font-family: inherit;
  transition: all .2s;
}
.tool-list .tool-item .ops button:hover { color: var(--text); border-color: var(--c2); }
.tool-list .tool-item .ops button.danger:hover { color: #ff7a7a; border-color: #ff7a7a; }

/* JSON 代码框 */
.code-box {
  width: 100%; min-height: 150px; background: #0a0d18; border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; color: #c8e1ff; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.6; resize: vertical; outline: none;
}

/* ============ 工具页「＋ 添加工具」头部 + 弹窗 ============ */
.top-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.top-actions .search-wrap { flex: 1; min-width: 180px; }
.add-tool-btn { flex: none; background: var(--grad); border: none; color: #fff; border-radius: 11px; padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; box-shadow: 0 6px 18px rgba(124,92,255,.35); transition: transform .15s; }
.add-tool-btn:hover { transform: translateY(-2px); }

/* 添加弹窗复用 .modal-box，这里补头部/关闭/表单间距 */
#addMask .modal-box { max-height: 88vh; overflow: auto; }
#addMask .modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
#addMask .modal-head h3 { font-size: 17px; margin: 0; }
.modal-x { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 14px; transition: all .2s; }
.modal-x:hover { color: var(--text); border-color: var(--c2); }
#addMask .form-row label { color: var(--muted); font-size: 12px; }
#addMask .form-row label input,
#addMask .form-row label select,
#addMask .form-row label textarea { background: var(--glass-strong); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 14px; outline: none; font-family: inherit; transition: border-color .2s; }
#addMask .form-row label input:focus,
#addMask .form-row label select:focus,
#addMask .form-row label textarea:focus { border-color: var(--c2); }
#addMask .form-row label textarea { min-height: 64px; resize: vertical; line-height: 1.6; }
#addMask .form-row.btns { gap: 12px; margin-top: 4px; }
#addMask .form-row.btns .btn { flex: none; }

/* ===== WB-08 外部服务状态 / 会议总结 / 助理确认 ===== */
.provider-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 4px; }
.provider-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; }
.provider-name { font-weight: 600; }
.provider-state { color: var(--muted); font-size: 13px; }
.summary-body { font-size: 13px; line-height: 1.7; color: var(--text); margin: 6px 0; white-space: pre-wrap; }
.msg-failed { color: #ff7a7a; }
.assist-confirm { display: flex; justify-content: flex-end; }
.assist-confirm .btn-add { margin: 0; }

/* ============ WB-07 飞书同步面板 ============ */
#feishuCard { margin-bottom: 18px; }
.fs-conflict { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--glass-strong); display: flex; flex-direction: column; gap: 6px; }
.fs-conflict p { margin: 0; font-size: 12.5px; color: var(--text); line-height: 1.6; overflow-wrap: anywhere; }
.fs-conflict p:first-child { font-weight: 600; color: var(--c3); }
