/* ============ Nexus AI · 布局与页面 app.css ============ */
#root { position: relative; z-index: 1; height: 100vh; }

/* ================= 登录页 ================= */
.login-wrap { height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; }
.login-banner {
  display: flex; align-items: center; gap: 10px; padding: 11px 22px; border-radius: 40px;
  background: rgba(251, 191, 36, .09); border: 1px solid rgba(251, 191, 36, .32);
  color: #fcd34d; font-size: 13.5px; font-weight: 500; backdrop-filter: blur(10px);
}
.login-banner svg { width: 17px; height: 17px; flex: none; }
.login-card {
  width: min(400px, 92vw); padding: 34px 34px 26px; border-radius: 24px;
  background: linear-gradient(165deg, rgba(22, 28, 48, .82), rgba(12, 16, 30, .88));
  border: 1px solid var(--border2); box-shadow: var(--shadow); backdrop-filter: blur(18px);
  animation: popin .4s cubic-bezier(.3, 1.4, .5, 1);
}
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 26px; }
.login-logo .logo-mark {
  width: 62px; height: 62px; border-radius: 19px; background: var(--grad);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 30px rgba(99, 102, 241, .5);
  animation: logofloat 4s ease-in-out infinite;
}
.login-logo .logo-mark svg { width: 32px; height: 32px; color: #fff; }
@keyframes logofloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.login-logo h1 { font-size: 21px; font-weight: 700; letter-spacing: .5px; }
.login-logo p { font-size: 12.5px; color: var(--text3); }
.login-card .btn-primary { width: 100%; padding: 11px; font-size: 14.5px; margin-top: 4px; }
.login-foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--text3); line-height: 1.8; }
.login-foot .warn-line { color: #fcd34d; }
.login-ann {
  width: min(400px, 92vw); text-align: center; font-size: 12.5px; color: var(--text3);
}
.login-error {
  background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .35); color: #fca5a5;
  padding: 8px 12px; border-radius: 9px; font-size: 12.5px; margin-bottom: 12px; display: none;
}

/* ================= 应用壳 ================= */
.shell { display: grid; grid-template-columns: 224px 1fr; height: 100vh; }
.sidebar {
  display: flex; flex-direction: column; border-right: 1px solid var(--border);
  background: rgba(8, 11, 20, .72); backdrop-filter: blur(16px); padding: 16px 12px 12px;
}
.logo-row { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.logo-row .logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 3px 14px rgba(99, 102, 241, .45); }
.logo-row .logo-mark svg { width: 19px; height: 19px; color: #fff; }
.logo-row .logo-name { font-size: 14.5px; font-weight: 700; letter-spacing: .3px; }
.logo-row .logo-sub { font-size: 10.5px; color: var(--text3); }
.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9.5px 12px; border-radius: 11px;
  color: var(--text2); font-size: 13.5px; cursor: pointer; transition: all .16s ease;
  border: 1px solid transparent; position: relative;
}
.nav-item svg { width: 17px; height: 17px; flex: none; }
.nav-item:hover { background: var(--glass); color: var(--text); }
.nav-item.on {
  background: linear-gradient(135deg, rgba(99, 102, 241, .22), rgba(34, 211, 238, .1));
  border-color: rgba(99, 102, 241, .4); color: #fff; font-weight: 600;
}
.nav-item.on::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 3px; background: var(--grad);
}
.nav-sec { font-size: 10.5px; color: var(--text3); padding: 12px 12px 6px; letter-spacing: 1px; }
.side-balance {
  margin: 10px 4px 0; padding: 13px 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, .16), rgba(34, 211, 238, .07));
  border: 1px solid rgba(99, 102, 241, .3);
}
.side-balance .sb-label { font-size: 11px; color: var(--text2); display: flex; align-items: center; gap: 5px; }
.side-balance .sb-label svg { width: 12px; height: 12px; }
.side-balance .sb-num { font-size: 19px; font-weight: 700; font-family: var(--mono); margin-top: 3px; }
.side-user { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 9px 10px; border-radius: 12px; cursor: pointer; transition: background .15s; }
.side-user:hover { background: var(--glass); }
.avatar {
  width: 33px; height: 33px; border-radius: 50%; background: var(--grad2); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none;
}
.side-user .su-name { font-size: 13px; font-weight: 600; }
.side-user .su-role { font-size: 10.5px; color: var(--text3); }

.main { display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 58px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; border-bottom: 1px solid var(--border); background: rgba(8, 11, 20, .5); backdrop-filter: blur(12px);
}
.topbar .tb-title { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.topbar .tb-title svg { width: 18px; height: 18px; color: var(--pri2); }
.topbar .tb-right { display: flex; align-items: center; gap: 10px; }
.balance-chip {
  display: flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 20px;
  background: rgba(52, 211, 153, .08); border: 1px solid rgba(52, 211, 153, .3); font-size: 12.5px; color: #a7f3d0;
}
.balance-chip svg { width: 13px; height: 13px; }
.balance-chip b { font-family: var(--mono); font-weight: 700; }
.view { flex: 1; overflow-y: auto; overflow-x: hidden; }

/* ================= 首页 ================= */
.home { padding: 30px 34px; max-width: 1200px; margin: 0 auto; }
.home-hero { margin-bottom: 26px; }
.home-hero h1 { font-size: 27px; font-weight: 700; letter-spacing: .3px; }
.home-hero p { color: var(--text3); font-size: 13.5px; margin-top: 5px; }
.home-quick { display: flex; gap: 10px; margin-top: 16px; max-width: 640px; }
.home-quick input { flex: 1; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.stat-card { padding: 18px 20px; border-radius: 16px; position: relative; overflow: hidden; transition: transform .2s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-card .sc-label { font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.stat-card .sc-label svg { width: 14px; height: 14px; }
.stat-card .sc-num { font-size: 23px; font-weight: 700; font-family: var(--mono); margin-top: 6px; }
.stat-card .sc-num small { font-size: 12px; color: var(--text3); font-weight: 400; }
.stat-card::after { content: ""; position: absolute; top: -30px; right: -30px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(99, 102, 241, .18), transparent 70%); }
.board-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.board-card {
  padding: 18px; border-radius: 16px; cursor: pointer; transition: all .2s ease; position: relative; overflow: hidden;
}
.board-card:hover { transform: translateY(-3px); border-color: var(--border2); background: var(--glass2); }
.board-card .bc-icon {
  width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; background: var(--glass2); border: 1px solid var(--border);
}
.board-card .bc-icon svg { width: 20px; height: 20px; }
.board-card:hover .bc-icon { background: var(--grad); border-color: transparent; }
.board-card:hover .bc-icon svg { color: #fff; }
.board-card .bc-name { font-weight: 600; font-size: 14.5px; }
.board-card .bc-desc { font-size: 12px; color: var(--text3); margin-top: 4px; line-height: 1.5; }
.home-recent { margin-top: 26px; }

/* ================= 对话页 ================= */
.chat-wrap { display: grid; grid-template-columns: 248px 1fr; height: 100%; }
.sess-panel { border-right: 1px solid var(--border); display: flex; flex-direction: column; background: rgba(8, 11, 20, .4); }
.sess-head { padding: 14px 12px 8px; }
.sess-list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.sess-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 10px;
  cursor: pointer; color: var(--text2); font-size: 13px; transition: all .15s; position: relative; margin-bottom: 2px;
}
.sess-item:hover { background: var(--glass); color: var(--text); }
.sess-item.on { background: linear-gradient(135deg, rgba(99, 102, 241, .2), rgba(34, 211, 238, .08)); color: #fff; }
.sess-item .si-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess-item .si-del { opacity: 0; padding: 3px; border-radius: 6px; color: var(--text3); flex: none; transition: all .15s; }
.sess-item:hover .si-del { opacity: 1; }
.sess-item .si-del:hover { color: var(--err); background: rgba(248, 113, 113, .12); }
.sess-item .si-del svg { width: 14px; height: 14px; display: block; }

.chat-main { display: flex; flex-direction: column; overflow: hidden; }
.chat-top { height: 52px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.chat-top .ct-title { font-weight: 600; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgs { flex: 1; overflow-y: auto; padding: 22px 0 10px; scroll-behavior: smooth; }
.msgs-inner { max-width: 860px; margin: 0 auto; padding: 0 24px; }

.msg { margin-bottom: 22px; animation: msgin .3s ease; }
@keyframes msgin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.msg-user { display: flex; justify-content: flex-end; }
.msg-user .mu-bubble {
  max-width: 78%; padding: 11px 16px; border-radius: 16px 16px 4px 16px; font-size: 14px; line-height: 1.7;
  background: linear-gradient(135deg, rgba(99, 102, 241, .32), rgba(139, 92, 246, .22));
  border: 1px solid rgba(99, 102, 241, .45); white-space: pre-wrap; word-break: break-word;
}
.msg-ai .ma-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.msg-ai .ma-avatar { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); display: flex; align-items: center; justify-content: center; flex: none; }
.msg-ai .ma-avatar svg { width: 15px; height: 15px; color: #fff; }
.msg-ai .ma-logo { width: 26px; height: 26px; border-radius: 8px; object-fit: cover; flex: none; border: 1px solid var(--border); background: #fff; }
.msg-imgs { display: flex; flex-direction: column; }
.msg-ai .ma-body { padding: 4px 2px; font-size: 14px; line-height: 1.75; }

.think-box { margin-bottom: 10px; border-radius: 12px; border: 1px solid rgba(168, 85, 247, .28); background: rgba(168, 85, 247, .06); overflow: hidden; }
.think-box .tk-head {
  display: flex; align-items: center; gap: 7px; padding: 8px 13px; font-size: 12px; color: #d8b4fe; cursor: pointer; user-select: none;
}
.think-box .tk-head svg { width: 14px; height: 14px; }
.think-box .tk-head .tk-arrow { margin-left: auto; transition: transform .2s; }
.think-box.open .tk-head .tk-arrow { transform: rotate(180deg); }
.think-box .tk-body { display: none; padding: 4px 14px 12px; font-size: 12.5px; color: var(--text2); line-height: 1.8; white-space: pre-wrap; border-top: 1px dashed rgba(168, 85, 247, .25); }
.think-box.open .tk-body { display: block; }

.step-card { border: 1px solid rgba(34, 211, 238, .26); background: rgba(34, 211, 238, .05); border-radius: 12px; padding: 11px 14px; margin-bottom: 10px; font-size: 13px; }
.step-card .st-head { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #7ee4f5; font-size: 13px; }
.step-card .st-head svg { width: 14px; height: 14px; }
.step-card .st-body { margin-top: 6px; color: var(--text2); font-size: 12.8px; line-height: 1.7; }
.step-card .st-tool { margin-top: 8px; padding: 8px 11px; border-radius: 9px; background: rgba(0, 0, 0, .28); border: 1px solid var(--border); }
.step-card .st-tool .tool-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--pri2); font-family: var(--mono); }
.step-card .st-tool .tool-tag svg { width: 12px; height: 12px; }
.step-card .st-tool .ts-title { font-size: 12.3px; color: var(--text2); margin: 6px 0 4px; }
.step-card .st-tool .ts-link { display: block; font-size: 12px; color: var(--pri2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }

.src-box { margin: 10px 0; padding: 11px 14px; border-radius: 12px; background: rgba(0, 0, 0, .22); border: 1px solid var(--border); }
.src-box .src-head { font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.src-box .src-head svg { width: 13px; height: 13px; color: var(--pri2); }
.src-list { display: flex; flex-wrap: wrap; gap: 7px; }
.src-pill { font-size: 12px; color: var(--text2); padding: 4px 11px; border-radius: 14px; background: var(--glass); border: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.src-pill:hover { color: var(--pri2); border-color: rgba(99, 102, 241, .4); }

.usage-line { margin-top: 9px; font-size: 11.5px; color: var(--text3); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.usage-line svg { width: 12px; height: 12px; }
.usage-line b { color: var(--text2); font-family: var(--mono); font-weight: 600; }
.ma-actions { display: flex; gap: 4px; margin-top: 8px; opacity: 0; transition: opacity .2s; }
.msg:hover .ma-actions { opacity: 1; }
.act-btn { padding: 5px 9px; border-radius: 8px; font-size: 11.5px; color: var(--text3); cursor: pointer; background: transparent; border: none; display: inline-flex; align-items: center; gap: 5px; transition: all .15s; }
.act-btn svg { width: 13px; height: 13px; }
.act-btn:hover { background: var(--glass2); color: var(--text); }

.cursor-blink { display: inline-block; width: 8px; height: 15px; background: var(--pri2); border-radius: 2px; vertical-align: -2px; margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.chat-welcome { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; }
.chat-welcome .cw-logo { width: 58px; height: 58px; border-radius: 18px; background: var(--grad); display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 34px rgba(99, 102, 241, .45); }
.chat-welcome .cw-logo svg { width: 30px; height: 30px; color: #fff; }
.chat-welcome h2 { font-size: 21px; }
.chat-welcome p { color: var(--text3); font-size: 13px; }
.cw-cards { display: grid; grid-template-columns: repeat(2, 200px); gap: 10px; margin-top: 8px; }
.cw-card { padding: 13px 15px; border-radius: 13px; cursor: pointer; transition: all .18s; font-size: 12.8px; color: var(--text2); }
.cw-card:hover { border-color: rgba(99, 102, 241, .5); color: var(--text); transform: translateY(-2px); }
.cw-card b { display: block; color: var(--text); font-size: 13px; margin-bottom: 3px; }

.composer { flex: none; padding: 10px 24px 14px; }
.composer-inner { max-width: 860px; margin: 0 auto; }
.comp-box {
  border-radius: 18px; border: 1px solid var(--border2); background: rgba(10, 14, 26, .78);
  backdrop-filter: blur(16px); transition: border-color .2s, box-shadow .2s; overflow: hidden;
}
.comp-box:focus-within { border-color: rgba(99, 102, 241, .65); box-shadow: 0 0 0 3px rgba(99, 102, 241, .14), 0 8px 30px rgba(0, 0, 0, .35); }
.comp-tools { display: flex; align-items: center; gap: 8px; padding: 9px 12px 0; flex-wrap: wrap; }
.comp-tools select.input { width: auto; padding: 5px 28px 5px 10px; font-size: 12.3px; border-radius: 9px; background-color: rgba(255, 255, 255, .05); }
.comp-tools .tool-sep { width: 1px; height: 18px; background: var(--border2); }
.comp-input { display: flex; align-items: flex-end; gap: 10px; padding: 8px 10px 10px 14px; }
.comp-input textarea {
  flex: 1; background: transparent; border: none; outline: none; resize: none;
  font-size: 14px; line-height: 1.6; max-height: 180px; min-height: 24px; color: var(--text); padding: 4px 0;
}
.comp-input textarea::placeholder { color: var(--text3); }
.send-btn {
  width: 38px; height: 38px; border-radius: 12px; border: none; cursor: pointer; flex: none;
  background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center;
  transition: all .18s; box-shadow: 0 4px 16px rgba(99, 102, 241, .4);
}
.send-btn svg { width: 17px; height: 17px; }
.send-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.send-btn:disabled { opacity: .4; transform: none; }
.send-btn.stop { background: linear-gradient(135deg, #f87171, #ef4444); box-shadow: 0 4px 16px rgba(239, 68, 68, .4); }
.comp-hint { text-align: center; font-size: 11px; color: var(--text3); padding-top: 7px; }

/* ---------- Markdown 渲染 ---------- */
.md { word-break: break-word; }
.md p { margin: 8px 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 16px 0 8px; font-weight: 700; line-height: 1.4; }
.md h1 { font-size: 19px; } .md h2 { font-size: 17px; } .md h3 { font-size: 15.5px; } .md h4 { font-size: 14px; }
.md h1:first-child, .md h2:first-child, .md h3:first-child, .md p:first-child { margin-top: 0; }
.md ul, .md ol { padding-left: 22px; margin: 8px 0; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--pri2); }
.md blockquote { border-left: 3px solid var(--pri); padding: 6px 14px; margin: 10px 0; background: rgba(99, 102, 241, .07); border-radius: 0 9px 9px 0; color: var(--text2); font-size: 13px; }
.md code.inline { font-family: var(--mono); font-size: 12.6px; background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .22); padding: 1.5px 6px; border-radius: 6px; color: #7ee4f5; }
.md .codeblock { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); margin: 12px 0; background: rgba(0, 0, 0, .4); }
.md .code-head { display: flex; align-items: center; justify-content: space-between; padding: 7px 13px; background: rgba(255, 255, 255, .04); border-bottom: 1px solid var(--border); font-size: 11.5px; color: var(--text3); font-family: var(--mono); }
.md .code-copy { background: transparent; border: none; color: var(--text3); font-size: 11.5px; cursor: pointer; display: flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 6px; }
.md .code-copy:hover { background: var(--glass2); color: var(--text); }
.md .code-copy svg { width: 12px; height: 12px; }
.md pre { padding: 13px 15px; overflow-x: auto; }
.md pre code { font-family: var(--mono); font-size: 12.8px; line-height: 1.7; color: #dbe2f4; }
.md table { border-collapse: collapse; margin: 12px 0; width: 100%; font-size: 13px; }
.md th, .md td { border: 1px solid var(--border); padding: 7px 12px; text-align: left; }
.md th { background: rgba(255, 255, 255, .05); font-weight: 600; }
.md tr:hover td { background: rgba(255, 255, 255, .025); }
.md hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.md strong { color: #fff; font-weight: 650; }
.tok-kw { color: #c792ea; } .tok-str { color: #a5d6a7; } .tok-num { color: #f8b88e; } .tok-com { color: #6b7386; font-style: italic; } .tok-fn { color: #82aaff; }

/* ================= 创作板块通用 ================= */
.board-page { padding: 26px 34px; max-width: 1100px; margin: 0 auto; }
.board-head { margin-bottom: 20px; }
.board-head h2 { font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.board-head h2 svg { width: 24px; height: 24px; color: var(--pri2); }
.board-head p { color: var(--text3); font-size: 13px; margin-top: 4px; }
.board-grid2 { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.form-card { padding: 20px; }
.form-card h3 { font-size: 14.5px; margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }
.form-card h3 svg { width: 15px; height: 15px; color: var(--pri2); }
.result-card { min-height: 300px; padding: 20px; }
.result-empty { height: 100%; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text3); }
.result-empty svg { width: 44px; height: 44px; opacity: .3; }
.img-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.img-item { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); animation: popin .35s ease; }
.img-item img { width: 100%; display: block; transition: transform .3s; }
.img-item:hover img { transform: scale(1.03); }
.img-item .img-ops { position: absolute; bottom: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.img-item:hover .img-ops { opacity: 1; }
.img-item .img-ops button { padding: 5px 10px; border-radius: 8px; font-size: 11.5px; background: rgba(5, 8, 15, .78); border: 1px solid var(--border2); color: var(--text); cursor: pointer; backdrop-filter: blur(6px); }
.img-item .img-ops button:hover { border-color: var(--pri2); color: var(--pri2); }
.prompt-block { border-radius: 12px; border: 1px solid var(--border); background: rgba(0, 0, 0, .26); padding: 13px 15px; margin-bottom: 12px; }
.prompt-block .pb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 12.5px; color: var(--text2); font-weight: 600; }
.prompt-block .pb-body { font-size: 13px; line-height: 1.75; white-space: pre-wrap; color: var(--text); }
.prompt-block.en .pb-body { font-family: var(--mono); font-size: 12.5px; color: #b8c4e0; }
.shot-tbl { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.shot-tbl th, .shot-tbl td { border: 1px solid var(--border); padding: 7px 11px; text-align: left; }
.shot-tbl th { background: rgba(255, 255, 255, .05); color: var(--text2); font-weight: 600; }
.kv-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }

/* 3D 查看器 */
.viewer3d { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: radial-gradient(circle at 50% 30%, #131a2e, #06090f); cursor: grab; }
.viewer3d:active { cursor: grabbing; }
.viewer3d canvas { display: block; width: 100%; height: 100%; }
.viewer3d .v3d-tip { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--text3); pointer-events: none; }
.viewer3d .v3d-ops { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }

/* 转写 / 总结 */
.trans-item { display: flex; gap: 12px; padding: 9px 4px; border-bottom: 1px dashed rgba(255, 255, 255, .07); font-size: 13.2px; }
.trans-item:last-child { border-bottom: none; }
.trans-item .ts-time { flex: none; font-family: var(--mono); font-size: 11.5px; color: var(--pri2); padding-top: 2px; width: 86px; }
.chapter-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 15px; margin-bottom: 10px; background: rgba(255, 255, 255, .025); }
.chapter-card .ch-head { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13.5px; }
.chapter-card .ch-head .ch-time { font-family: var(--mono); font-size: 11.5px; color: var(--pri2); background: rgba(34, 211, 238, .08); border: 1px solid rgba(34, 211, 238, .25); padding: 1px 8px; border-radius: 10px; }
.chapter-card ul { margin: 7px 0 0; padding-left: 20px; font-size: 12.8px; color: var(--text2); }
.dropzone {
  border: 1.5px dashed var(--border2); border-radius: 14px; padding: 26px; text-align: center;
  color: var(--text3); cursor: pointer; transition: all .2s; font-size: 13px;
}
.dropzone:hover, .dropzone.drag { border-color: var(--pri); background: rgba(99, 102, 241, .07); color: var(--text2); }
.dropzone svg { width: 30px; height: 30px; opacity: .5; margin-bottom: 6px; }
.history-list { margin-top: 18px; }
.history-item { display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-radius: 11px; border: 1px solid var(--border); margin-bottom: 8px; font-size: 12.8px; transition: all .15s; cursor: pointer; }
.history-item:hover { border-color: var(--border2); background: var(--glass); }
.history-item .hi-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }
.history-item .hi-cost { font-family: var(--mono); font-size: 11.5px; color: var(--text3); flex: none; }

/* ================= 账单页 ================= */
.billing-page { padding: 26px 34px; max-width: 1200px; margin: 0 auto; }
.chart-box { position: relative; }
.chart-box canvas { width: 100%; height: 220px; display: block; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar select.input, .filter-bar input.input { width: auto; min-width: 130px; padding: 7px 12px; font-size: 12.5px; }

/* ================= 管理后台 ================= */
.admin-shell { display: grid; grid-template-columns: 210px 1fr; height: 100vh; }
.admin-page { padding: 24px 30px; max-width: 1150px; margin: 0 auto; }
.stat-mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 20px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.inline-ops { display: flex; gap: 5px; }
.rate-edit-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rate-hint { font-size: 11.5px; color: var(--text3); margin-top: -8px; margin-bottom: 12px; }
.cred-box { border-radius: 13px; border: 1px solid rgba(52, 211, 153, .3); background: rgba(52, 211, 153, .07); padding: 14px 16px; margin-bottom: 12px; }
.cred-box .cred-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 13.5px; }
.cred-box .cred-row b { font-family: var(--mono); font-size: 14px; color: #a7f3d0; letter-spacing: .5px; }
.msg-ok-box { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 10px; font-size: 12.8px; margin-bottom: 12px; }
.msg-ok-box.ok { background: rgba(52, 211, 153, .08); border: 1px solid rgba(52, 211, 153, .3); color: #a7f3d0; }
.msg-ok-box.err { background: rgba(248, 113, 113, .08); border: 1px solid rgba(248, 113, 113, .3); color: #fca5a5; }

/* 密码弹窗内行 */
.pw-warn { font-size: 12.5px; color: var(--warn); background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .3); padding: 8px 12px; border-radius: 9px; }

/* ================= 模型选择器（自定义，支持词条悬浮卡） ================= */
.mp-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 9px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--border); color: var(--text);
  font-size: 12.3px; cursor: pointer; max-width: 250px; transition: all .15s;
}
.mp-btn:hover { border-color: var(--border2); background: rgba(255, 255, 255, .08); }
.mp-btn img, .mp-btn .mp-letter { width: 17px; height: 17px; border-radius: 4px; object-fit: cover; flex: none; }
.mp-btn .mp-letter { background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.mp-btn .mp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-btn .mp-rate { color: var(--text3); font-size: 10.5px; flex: none; }
.mp-btn .mp-caret { color: var(--text3); flex: none; display: flex; }
.mp-list {
  position: fixed; z-index: 950; min-width: 260px; max-width: 320px; padding: 6px;
  background: linear-gradient(160deg, #171e33, #0d1220); border: 1px solid var(--border2);
  border-radius: 14px; box-shadow: var(--shadow); animation: popin .15s ease;
  max-height: 430px; overflow-y: auto;
}
.mp-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.mp-item:hover { background: var(--glass2); }
.mp-item.on { background: rgba(99, 102, 241, .16); }
.mp-item img, .mp-item .mp-letter { width: 27px; height: 27px; border-radius: 8px; object-fit: cover; flex: none; }
.mp-item .mp-letter { background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.mp-item .mpi-info { flex: 1; min-width: 0; }
.mp-item .mpi-name { font-size: 13px; font-weight: 600; }
.mp-item .mpi-sub { font-size: 11px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-item .mpi-check { color: var(--pri2); flex: none; display: none; }
.mp-item.on .mpi-check { display: flex; }
.mp-card {
  position: fixed; z-index: 960; width: 252px; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(160deg, #1a2138, #101626); border: 1px solid rgba(99, 102, 241, .5);
  box-shadow: 0 14px 46px rgba(0, 0, 0, .65); animation: popin .16s ease; pointer-events: none;
}
.mp-card .mc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.mp-card .mc-head img, .mp-card .mc-head .mp-letter { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; }
.mp-card .mc-head .mp-letter { background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; }
.mp-card .mc-name { font-weight: 700; font-size: 14px; }
.mp-card .mc-vendor { font-size: 11px; color: var(--text3); }
.mp-card .mc-desc { font-size: 12px; color: var(--text2); line-height: 1.65; margin-bottom: 9px; }
.mp-card .mc-tag { margin-bottom: 8px; }
.mp-card .mc-tag b {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #7ee4f5;
  background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .32);
  padding: 1.5px 9px; border-radius: 9px; font-weight: 600;
}
.mp-card .mc-tag p { font-size: 11.5px; color: var(--text2); margin: 4px 0 0; line-height: 1.55; }
.mp-card .mc-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.mp-hint-tip { font-size: 10.5px; color: var(--text3); text-align: center; padding: 5px 0 3px; }

/* ================= 消息内图片（图文并茂） ================= */
.md-img {
  max-width: min(400px, 100%); border-radius: 12px; border: 1px solid var(--border);
  display: block; margin: 10px 0 4px; animation: popin .35s ease;
}

/* ================= 智能体中心 ================= */
.agent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.agent-card { padding: 20px; border-radius: 18px; cursor: pointer; transition: all .2s ease; }
.agent-card:hover { transform: translateY(-3px); border-color: rgba(99, 102, 241, .5); background: var(--glass2); }
.agent-card .ac-top { display: flex; align-items: center; gap: 13px; margin-bottom: 11px; }
.agent-card .ac-avatar {
  width: 48px; height: 48px; border-radius: 14px; background: var(--glass2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 26px; flex: none; overflow: hidden;
}
.agent-card .ac-avatar img { width: 100%; height: 100%; object-fit: cover; }
.agent-card .ac-name { font-weight: 700; font-size: 15px; }
.agent-card .ac-badge-off { font-size: 10px; color: var(--err); }
.agent-card .ac-desc { font-size: 12.5px; color: var(--text2); line-height: 1.7; min-height: 42px; }
.agent-card .ac-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.agent-card .ac-chips .chip { pointer-events: none; font-size: 11px; padding: 3px 10px; }
.agent-card .ac-go {
  margin-top: 12px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  color: var(--pri2); font-weight: 600;
}
.agent-card:hover .ac-go { text-decoration: underline; }
.agent-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 16px;
  font-size: 12px; background: linear-gradient(135deg, rgba(168, 85, 247, .18), rgba(99, 102, 241, .14));
  border: 1px solid rgba(168, 85, 247, .42); color: #d8b4fe; font-weight: 600;
}
.sugg-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sugg-list .chip { font-size: 12px; }

/* ================= 后台：词条编辑器 ================= */
.tag-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.tag-row { display: flex; gap: 8px; align-items: center; }
.tag-row .tr-title { width: 140px; flex: none; }
.tag-row .tr-desc { flex: 1; }
.tag-row .tr-del { flex: none; }

/* 响应式 */
@media (max-width: 1080px) {
  .stat-grid, .stat-mini-grid { grid-template-columns: repeat(2, 1fr); }
  .board-grid { grid-template-columns: repeat(2, 1fr); }
  .board-grid2 { grid-template-columns: 1fr; }
  .chat-wrap { grid-template-columns: 200px 1fr; }
}
@media (max-width: 760px) {
  .shell, .admin-shell { grid-template-columns: 64px 1fr; }
  .logo-row .logo-name, .logo-row .logo-sub, .nav-item span, .nav-sec, .side-balance, .side-user .su-info { display: none; }
  .nav-item { justify-content: center; padding: 11px; }
  .stat-grid, .stat-mini-grid, .board-grid { grid-template-columns: 1fr; }
  .chat-wrap { grid-template-columns: 1fr; }
  .sess-panel { display: none; }
  .cw-cards { grid-template-columns: 1fr; }
}
