/* ============ 91工坊 设计系统 ============ */
:root {
  --bg: #0b0b12;
  --bg2: #10101a;
  --panel: #15151f;
  --panel2: #1b1b28;
  --border: #262637;
  --border2: #33334a;
  --text: #e9e9f4;
  --muted: #8a8aa6;
  --muted2: #5e5e78;
  --accent: #7c5cff;
  --accent2: #4da3ff;
  --accent-grad: linear-gradient(135deg, #7c5cff, #4da3ff);
  --danger: #ff5c7a;
  --ok: #3ecf8e;
  --warn: #ffc46b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,.45);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Helvetica Neue", sans-serif;
  font-size: 14px;
  overflow: hidden;
}
#app { height: 100vh; width: 100%; display: flex; }
.layout-shell {
  display: flex; height: 100%; width: 100%;
  flex: 1 1 auto; min-width: 0;
}
a { color: var(--accent2); text-decoration: none; }
::selection { background: rgba(124,92,255,.35); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 布局 ============ */
.sidebar {
  width: 216px; flex-shrink: 0; height: 100%;
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 12px 14px;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(124,92,255,.4);
}
img.logo-mark { object-fit: cover; padding: 0; background: none; }
.logo-name { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.logo-sub { font-size: 10px; color: var(--muted2); margin-top: 1px; }
.nav { flex: 1; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-label { font-size: 11px; color: var(--muted2); padding: 14px 10px 6px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--muted); cursor: pointer;
  transition: all .15s; font-size: 14px; border: 1px solid transparent;
}
.nav-item:hover { color: var(--text); background: var(--panel); }
.nav-item.active { color: #fff; background: linear-gradient(135deg, rgba(124,92,255,.22), rgba(77,163,255,.14)); border-color: rgba(124,92,255,.4); }
.nav-item .ico { font-size: 16px; width: 20px; text-align: center; }
.main { flex: 1 1 auto; min-width: 0; width: auto; height: 100%; overflow-y: auto; position: relative; }
.page { padding: 28px 34px; max-width: 1240px; margin: 0 auto; }
.page-full { padding: 0; height: 100%; display: flex; flex-direction: column; }

/* 用户卡（侧栏底部） */
.usercard {
  border-top: 1px solid var(--border); padding-top: 12px; margin-top: 10px;
  display: flex; align-items: center; gap: 10px; cursor: pointer; border-radius: var(--radius-sm);
}
.usercard:hover { background: var(--panel); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center; font-weight: 600; color: #fff; flex-shrink: 0;
}
.usercard .uname { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usercard .ucredits { font-size: 11px; color: var(--warn); }
.nav-logout { font-size: 12px; color: var(--muted2); padding: 8px 12px; cursor: pointer; border-radius: 8px; }
.nav-logout:hover { color: var(--danger); background: var(--panel); }

/* ============ 通用组件 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm); border: 1px solid var(--border2);
  background: var(--panel2); color: var(--text); font-size: 14px; cursor: pointer;
  transition: all .15s; font-family: inherit; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  background: var(--accent-grad); border: none; color: #fff; font-weight: 600;
  box-shadow: 0 4px 16px rgba(124,92,255,.35);
}
.btn.primary:hover { filter: brightness(1.12); box-shadow: 0 6px 20px rgba(124,92,255,.5); }
.btn.danger { background: rgba(255,92,122,.12); border-color: rgba(255,92,122,.4); color: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }

.input, .select, .textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--border2);
  color: var(--text); border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 14px; font-family: inherit; outline: none; transition: border .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.select option { background: var(--panel); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1; }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px;
}
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

.page-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-desc { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px;
  background: rgba(124,92,255,.15); color: #a88fff; border: 1px solid rgba(124,92,255,.3);
}
.tag.ok { background: rgba(62,207,142,.12); color: var(--ok); border-color: rgba(62,207,142,.3); }
.tag.warn { background: rgba(255,196,107,.12); color: var(--warn); border-color: rgba(255,196,107,.3); }
.tag.danger { background: rgba(255,92,122,.12); color: var(--danger); border-color: rgba(255,92,122,.3); }
.tag.gray { background: var(--panel2); color: var(--muted); border-color: var(--border2); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 12px; white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:hover td { background: rgba(124,92,255,.04); }
.tbl .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 18px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-size: 14px; transition: all .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: #fff; border-bottom-color: var(--accent); font-weight: 600; }

/* Toast */
#toasts { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--panel2); border: 1px solid var(--border2); color: var(--text);
  padding: 11px 20px; border-radius: 12px; box-shadow: var(--shadow); font-size: 13px;
  animation: toastIn .25s ease; display: flex; align-items: center; gap: 8px; max-width: 80vw;
}
.toast.ok { border-color: rgba(62,207,142,.5); }
.toast.err { border-color: rgba(255,92,122,.5); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* Modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(5,5,10,.7); z-index: 1000;
  display: flex; align-items: center; justify-content: center; animation: fadeIn .15s ease;
}
.modal {
  background: var(--panel); border: 1px solid var(--border2); border-radius: var(--radius);
  width: min(560px, 92vw); max-height: 86vh; overflow-y: auto; padding: 24px;
  box-shadow: var(--shadow); animation: modalIn .2s ease;
}
.modal h3 { font-size: 17px; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(8px); } }

/* ============ 登录页 ============ */
.auth-wrap {
  height: 100vh; width: 100vw; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(800px 500px at 20% 10%, rgba(124,92,255,.18), transparent),
    radial-gradient(700px 500px at 85% 90%, rgba(77,163,255,.14), transparent),
    var(--bg);
}
.auth-card { width: 400px; padding: 38px 36px 30px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-logo .logo-mark { width: 54px; height: 54px; font-size: 24px; border-radius: 16px; }
.auth-logo h1 { font-size: 22px; font-weight: 700; }
.auth-logo p { color: var(--muted); font-size: 12px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.auth-switch a { cursor: pointer; }
.auth-feature { font-size: 12px; color: var(--muted2); text-align: center; margin-top: 22px; }

/* ============ Agent 对话 ============ */
.chat-layout { display: flex; height: 100%; }
.chat-list {
  width: 240px; flex-shrink: 0; border-right: 1px solid var(--border);
  padding: 16px 10px; overflow-y: auto; background: var(--bg2);
  display: flex; flex-direction: column; gap: 6px;
}
.chat-list .new-chat { margin-bottom: 8px; }
.chat-item { padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item:hover { background: var(--panel); color: var(--text); }
.chat-item.active { background: linear-gradient(135deg, rgba(124,92,255,.2), rgba(77,163,255,.1)); color: #fff; border: 1px solid rgba(124,92,255,.35); }
.chat-area { flex: 1; display: flex; flex-direction: column; height: 100%; min-width: 0; }
.chat-head { padding: 14px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.role-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.role-pill {
  padding: 6px 14px; border-radius: 20px; font-size: 12px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border2); color: var(--muted); transition: all .15s;
}
.role-pill.active { background: var(--accent-grad); color: #fff; border-color: transparent; font-weight: 600; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; max-width: 86%; animation: msgIn .25s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg .m-ava { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.msg.ai .m-ava { background: var(--accent-grad); }
.msg.user .m-ava { background: var(--panel2); border: 1px solid var(--border2); }
.m-body { padding: 12px 16px; border-radius: 14px; line-height: 1.7; font-size: 14px; min-width: 0; }
.msg.ai .m-body { background: var(--panel); border: 1px solid var(--border); border-top-left-radius: 4px; }
.msg.user .m-body { background: linear-gradient(135deg, rgba(124,92,255,.25), rgba(77,163,255,.18)); border: 1px solid rgba(124,92,255,.35); border-top-right-radius: 4px; }
.m-body .md p { margin: 6px 0; }
.m-body .md h4, .m-body .md strong { color: #fff; }
.m-body .md ul { padding-left: 20px; margin: 6px 0; }
.m-body .md li { margin: 3px 0; }
.m-body .md code { background: var(--panel2); padding: 1px 6px; border-radius: 5px; font-size: 12px; color: #a88fff; }
.m-meta { font-size: 11px; color: var(--muted2); margin-top: 8px; }
.chat-inputbar { padding: 14px 24px 18px; border-top: 1px solid var(--border); flex-shrink: 0; }
.chat-inputbar .textarea { min-height: 52px; max-height: 160px; background: var(--panel); }
.chat-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.chat-tip { font-size: 11px; color: var(--muted2); }
.quick-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.quick-btn { font-size: 12px; padding: 6px 12px; border-radius: 20px; background: var(--panel); border: 1px solid var(--border2); color: var(--muted); cursor: pointer; }
.quick-btn:hover { color: #fff; border-color: var(--accent); }
.typing { display: inline-flex; gap: 4px; padding: 6px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: tp 1s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; } .typing i:nth-child(3) { animation-delay: .36s; }
@keyframes tp { 0%,60%,100% { transform: none; opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.empty-chat { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.empty-chat .big { font-size: 44px; }

/* ============ 工坊页（视频/图片/分镜）================ */
.studio-grid { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
.upload-box {
  border: 1.5px dashed var(--border2); border-radius: var(--radius-sm); padding: 18px;
  text-align: center; cursor: pointer; color: var(--muted); font-size: 12px; transition: all .15s;
  position: relative; overflow: hidden;
}
.upload-box:hover { border-color: var(--accent); color: var(--text); }
.upload-box img { width: 100%; border-radius: 8px; display: block; margin-bottom: 8px; }
.upload-box.has img { max-height: 130px; object-fit: cover; }
.cost-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  background: rgba(255,196,107,.1); color: var(--warn); border: 1px solid rgba(255,196,107,.25);
  padding: 4px 12px; border-radius: 20px;
}
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card {
  padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border2);
  background: var(--panel); cursor: pointer; transition: all .15s;
}
.mode-card:hover { border-color: var(--accent); }
.mode-card.active { border-color: var(--accent); background: linear-gradient(135deg, rgba(124,92,255,.16), rgba(77,163,255,.08)); }
.mode-card .mt { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.mode-card .md2 { font-size: 11px; color: var(--muted2); line-height: 1.5; }
.result-panel { min-height: 300px; }
.result-item { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.result-item .r-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.result-item .r-body { padding: 16px; }
.video-frame { position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.video-frame img { width: 100%; display: block; }
.video-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25); color: #fff; font-size: 30px; pointer-events: none;
}
.video-badge { position: absolute; left: 10px; bottom: 8px; font-size: 11px; background: rgba(0,0,0,.55); padding: 2px 8px; border-radius: 6px; }
.progress-bar { height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; margin: 10px 0; }
.progress-bar i { display: block; height: 100%; background: var(--accent-grad); border-radius: 3px; transition: width .5s; }

/* 分镜表 */
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.shot-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.shot-card .sc-img { position: relative; }
.shot-card .sc-img img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
.shot-no { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 2px 9px; border-radius: 6px; }
.shot-body { padding: 12px 14px; }
.shot-body .st { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.shot-body .sd { font-size: 12px; color: var(--muted); line-height: 1.6; }
.shot-body .sd dl { display: grid; grid-template-columns: 40px 1fr; gap: 2px 8px; margin-top: 8px; }
.shot-body dt { color: var(--muted2); font-size: 11px; }
.shot-body dd { font-size: 11px; color: var(--muted); }

/* 剧本展示 */
.script-scene { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin: 16px 0; }
.script-scene .ss-head { font-weight: 700; font-size: 14px; margin-bottom: 6px; color: #c9b8ff; }
.script-scene .ss-act { color: var(--muted); line-height: 1.8; font-size: 13px; margin-bottom: 8px; }
.script-dialogue { display: flex; gap: 10px; margin: 6px 0; font-size: 13px; }
.script-dialogue b { color: var(--warn); flex-shrink: 0; }

/* 作品库 */
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.work-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: all .15s; }
.work-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.work-card .wc-cover {
  position: relative; background: #111;
  aspect-ratio: 4 / 3; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.work-card .wc-cover img {
  width: 100%; height: 100%; object-fit: contain; display: block; background: #111;
}
.work-card .wc-body { padding: 12px 14px; }
.work-card .wt { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-card .wm { font-size: 11px; color: var(--muted2); margin-top: 4px; display: flex; justify-content: space-between; }

/* 钱包 */
.wallet-hero {
  background: linear-gradient(135deg, rgba(124,92,255,.25), rgba(77,163,255,.14));
  border: 1px solid rgba(124,92,255,.4); border-radius: var(--radius); padding: 28px 30px;
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.wallet-hero .wh-num { font-size: 38px; font-weight: 800; }
.wallet-hero .wh-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.preset-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.preset-amt { padding: 14px 8px; text-align: center; border: 1px solid var(--border2); border-radius: var(--radius-sm); cursor: pointer; transition: all .15s; }
.preset-amt:hover, .preset-amt.active { border-color: var(--accent); background: rgba(124,92,255,.1); }
.preset-amt .pa { font-size: 18px; font-weight: 700; }
.preset-amt .pc { font-size: 11px; color: var(--warn); margin-top: 3px; }

/* 后台 */
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat-card .sc-num { font-size: 26px; font-weight: 800; margin-top: 6px; }
.stat-card .sc-label { color: var(--muted); font-size: 12px; }
.admin-tab-content { margin-top: 20px; }
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.search-bar .input { max-width: 300px; }

/* 响应式：平板缩侧栏；手机底栏 + 项目抽屉（不再隐藏项目列表导致看不到电脑端内容） */
@media (max-width: 960px) {
  .sidebar { width: 64px; padding: 14px 8px; }
  .sidebar .logo-name, .sidebar .logo-sub, .nav-item span.txt, .usercard .uinfo { display: none; }
  .studio-grid { grid-template-columns: 1fr; }
  .g3, .g4 { grid-template-columns: 1fr 1fr; }
  .lang-switch label { display: none; }
  .page { padding: 16px 14px; }
  .msg-media img, .msg-media video { max-width: min(72vw, 280px); max-height: 220px; }
}


.mobile-nav { display: none; }

/* 手机可折叠状态栏 */
.m-status { display: none; }
.desk-head { display: flex; }
body.is-mobile .desk-head { display: none !important; }
body.is-mobile .m-status { display: block; background: #fff; border-bottom: 1px solid #eee; position: relative; z-index: 20; }
body.is-mobile .m-status-bar {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: none; background: #fff; color: #111;
  min-height: 48px; cursor: pointer; text-align: left;
}
body.is-mobile .msb-left { font-size: 18px; width: 28px; flex: none; }
body.is-mobile .msb-title { flex: 1; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-mobile .msb-credits { font-size: 12px; color: #2f6bff; font-weight: 600; flex: none; }
body.is-mobile .msb-user {
  width: 28px; height: 28px; border-radius: 50%; background: #111; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none;
}
body.is-mobile .msb-caret { color: #8e8e93; font-size: 12px; flex: none; }
body.is-mobile .m-status-panel {
  padding: 0 12px 12px; background: #fff; border-top: 1px solid #f0f0f0;
  max-height: 55vh; overflow: auto;
}
body.is-mobile .msp-tabs { display: flex; gap: 6px; padding: 8px 0 10px; overflow-x: auto; }
body.is-mobile .msp-tab {
  flex: none; border: 1px solid #e8e8ed; background: #f5f5f7; color: #333;
  border-radius: 999px; padding: 6px 12px; font-size: 12px;
}
body.is-mobile .msp-tab.active { background: #111; color: #fff; border-color: #111; }
body.is-mobile .m-proj-items { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
body.is-mobile .m-proj {
  padding: 10px 12px; border-radius: 12px; background: #f5f5f7; font-size: 13px; cursor: pointer;
}
body.is-mobile .m-proj.active { background: #dbeafe; font-weight: 600; }
body.is-mobile .m-empty, body.is-mobile .m-hint { font-size: 12px; color: #8e8e93; padding: 10px 2px; }
body.is-mobile .m-task { padding: 8px 10px; border-radius: 10px; background: #f5f5f7; font-size: 12px; margin-bottom: 6px; }
body.is-mobile .m-acc-card { padding: 12px; border-radius: 14px; background: #f5f5f7; }
body.is-mobile .m-acc-name { font-weight: 700; font-size: 15px; }
body.is-mobile .m-acc-credits { margin: 6px 0 12px; font-size: 13px; color: #333; }
body.is-mobile .m-acc-credits b { color: #2f6bff; font-size: 18px; }
body.is-mobile .m-acc-row { display: flex; gap: 8px; }
body.is-mobile .m-acc-row .btn { flex: 1; }
body.is-mobile .m-input-meta {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 4px 0; font-size: 12px; color: #8e8e93;
}
body.is-mobile .m-input-meta b { color: #2f6bff; }
body.is-mobile .m-input-meta .mim-pay { color: #2f6bff; font-weight: 600; cursor: pointer; }
body:not(.is-mobile) .m-input-meta { display: none; }
/* 手机/电脑同一套模式逻辑：显示自动/对话/图片等胶囊（可横滑），不藏起来误导成「只能出图」 */
/* 手机也显示队列，支持连发 */
body.is-mobile #queue-bar { display: flex !important; flex-wrap: wrap; gap: 6px; padding: 6px 10px; font-size: 12px; }


/* 桌面/通用：composer 像聊天助手 —— 附件在上、输入中间、+ 在左下 */
.composer-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.composer-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 0;
}
.composer-tb-spacer { flex: 1; }
.composer-plus {
  width: 36px; height: 36px; min-width: 36px; border-radius: 50%;
  border: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel2, #2a2a32); color: var(--text, #eee);
  font-size: 22px; font-weight: 400; line-height: 1; cursor: pointer;
}
.composer-plus:hover { background: var(--accent, #2f6bff); color: #fff; }
.composer-send { display: none; }
body:not(.is-mobile) .composer-shell .textarea {
  width: 100%; min-height: 52px; max-height: 160px;
}
body:not(.is-mobile) .desktop-only-actions { display: flex; }
body:not(.is-mobile) .desktop-only-actions #chat-pipeline { display: inline-flex; }
body:not(.is-mobile) .desktop-only-actions::after { content: none; }

.plus-menu {
  position: absolute; left: 8px; bottom: 48px; z-index: 80;
  min-width: 200px; padding: 6px;
  background: var(--panel, #1c1c22); border: 1px solid var(--border2, #333);
  border-radius: 14px; box-shadow: 0 12px 36px rgba(0,0,0,.35);
}
.plus-mi {
  display: block; width: 100%; text-align: left;
  border: none; background: transparent; color: var(--text, #eee);
  padding: 10px 12px; border-radius: 10px; font-size: 13px; cursor: pointer;
}
.plus-mi:hover { background: var(--panel2, #2a2a32); }

.mobile-me-bar { display:none; }
@media (max-width: 720px) {
  /* ===== 豆包风：手机浅色 ===== */
  body.is-mobile {
    --bg: #f5f5f7;
    --bg2: #ffffff;
    --panel: #ffffff;
    --panel2: #f0f0f2;
    --border: #ebebed;
    --border2: #e5e5ea;
    --text: #111111;
    --muted: #8e8e93;
    --muted2: #aeaeb2;
    --accent: #2f6bff;
    --accent2: #2f6bff;
    --accent-grad: linear-gradient(135deg, #2f6bff, #5b8cff);
    --danger: #ff3b30;
    --ok: #34c759;
    --warn: #ff9f0a;
    --shadow: 0 4px 20px rgba(0,0,0,.08);
    background: var(--bg);
    color: var(--text);
  }
  html, body, #app { height: 100%; overscroll-behavior-y: contain; }
  body.is-mobile #app > div {
    flex-direction: column; height: 100dvh; max-height: 100dvh; overflow: hidden;
    background: var(--bg);
  }

  /* 底栏：白底细线 */
  body.is-mobile .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; height: auto; z-index: 50;
    display: flex; flex-direction: row; align-items: stretch;
    padding: 2px 4px calc(2px + env(safe-area-inset-bottom));
    border-right: none; border-top: 1px solid var(--border);
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -1px 0 rgba(0,0,0,.04);
  }
  body.is-mobile .sidebar .logo,
  body.is-mobile .sidebar .nav-label,
  body.is-mobile .sidebar .usercard,
  body.is-mobile .sidebar .nav-logout,
  body.is-mobile .sidebar .lang-switch,
  body.is-mobile .sidebar .desktop-nav { display: none !important; }
  body.is-mobile .sidebar .mobile-nav {
    display: flex !important; flex: 1; justify-content: space-around; align-items: center;
    margin: 0; width: 100%; padding: 0;
  }
  body.is-mobile .sidebar .nav-item,
  body.is-mobile .sidebar .mobile-tab {
    flex: 1; flex-direction: column; justify-content: center; gap: 2px;
    padding: 8px 2px; font-size: 10px; text-align: center; border-radius: 12px;
    color: #8e8e93; border: none; background: transparent;
  }
  body.is-mobile .sidebar .nav-item.active,
  body.is-mobile .sidebar .mobile-tab.active { color: #111; background: transparent; font-weight: 600; }
  body.is-mobile .sidebar .nav-item .ico,
  body.is-mobile .sidebar .mobile-tab .ico { font-size: 22px; line-height: 1; }
  body.is-mobile .sidebar .nav-item span.txt,
  body.is-mobile .sidebar .mobile-tab span.txt { display: block !important; font-size: 10px; }

  body.is-mobile .main {
    flex: 1; width: 100%; min-height: 0; overflow: hidden;
    padding-bottom: calc(54px + env(safe-area-inset-bottom));
    background: var(--bg);
  }

  /* 创作页 */
  body.is-mobile .chat-layout {
    height: 100%; position: relative; display: flex; flex-direction: column;
    background: #f5f5f7;
  }
  body.is-mobile .chat-area { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #f5f5f7; }

  /* 左侧项目抽屉：白底 */
  body.is-mobile .chat-list {
    display: flex !important; flex-direction: column;
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
    width: min(82vw, 320px); transform: translateX(-105%);
    transition: transform .24s cubic-bezier(.2,.8,.2,1);
    background: #fff; box-shadow: 12px 0 40px rgba(0,0,0,.18);
    padding: 16px 12px calc(72px + env(safe-area-inset-bottom));
    border-right: 1px solid var(--border);
  }
  body.is-mobile .chat-list.open { transform: translateX(0); }
  body.is-mobile .chat-item { color: #333; }
  body.is-mobile .chat-item.active {
    background: #f0f0f2; color: #111; border: 1px solid transparent;
  }
  body.is-mobile .proj-backdrop {
    display: none; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.35);
  }
  body.is-mobile .proj-backdrop.show { display: block; }
  body.is-mobile .sync-banner { display: none !important; }

  /* 顶栏：白、汉堡、居中标题 */
  body.is-mobile .chat-head {
    padding: 10px 12px; gap: 10px; flex-wrap: nowrap; min-height: 52px;
    border-bottom: 1px solid #eee;
    background: #fff;
    backdrop-filter: none;
  }
  body.is-mobile .chat-head > b#proj-title {
    flex: 1; text-align: center; font-size: 16px; font-weight: 700; color: #111;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  body.is-mobile .chat-head .btn.sm { display: none !important; }
  body.is-mobile #quota-badge { display: none; }
  body.is-mobile .chat-head > div:last-child {
    margin-left: 0 !important; gap: 4px !important; color: #8e8e93; font-size: 12px;
  }
  body.is-mobile .chat-head > div:last-child .tag,
  body.is-mobile .chat-head span[style*="warn"] { color: #2f6bff !important; }
  body.is-mobile .proj-toggle {
    display: inline-flex !important; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0; border-radius: 12px;
    border: none; background: transparent; font-size: 18px; color: #111;
  }
  body.is-mobile .proj-toggle span { display: none; }

  /* 消息区浅灰底 */
  body.is-mobile .chat-scroll {
    padding: 16px 14px 10px; gap: 14px; background: #f5f5f7;
    -webkit-overflow-scrolling: touch;
  }
  body.is-mobile .msg { max-width: 92%; gap: 8px; }
  body.is-mobile .msg .m-ava { display: none; } /* 豆包聊天区常不强调头像 */
  body.is-mobile .m-body {
    padding: 12px 14px; font-size: 15px; line-height: 1.65; border-radius: 16px;
    color: #111;
  }
  body.is-mobile .msg.user .m-body {
    background: #dbeafe; border: none; color: #111;
    border-top-right-radius: 4px;
  }
  body.is-mobile .msg.ai .m-body {
    background: #fff; border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    border-top-left-radius: 4px;
  }
  body.is-mobile .msg-media img, body.is-mobile .msg-media video {
    max-width: min(68vw, 240px); max-height: 200px; border-radius: 12px;
  }
  body.is-mobile .empty-chat { padding: 48px 24px; color: #111; }
  body.is-mobile .empty-chat .big { font-size: 36px; }
  body.is-mobile .empty-chat > div { color: #111; }
  body.is-mobile .empty-chat [style*="muted"] { color: #8e8e93 !important; }

  /* 模式胶囊：浅灰 pill */
  body.is-mobile .mode-mini {
    display: flex; gap: 8px; overflow-x: auto; flex-wrap: nowrap;
    padding: 8px 12px 4px; background: #f5f5f7; scrollbar-width: none;
  }
  body.is-mobile .mode-mini::-webkit-scrollbar { display: none; }
  body.is-mobile .mpill {
    flex: none; padding: 8px 14px; min-height: 34px; border-radius: 999px;
    background: #fff !important; border: 1px solid #e8e8ed !important; color: #333 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
  }
  body.is-mobile .mpill.active {
    background: #111 !important; color: #fff !important; border-color: #111 !important;
  }
  body.is-mobile .params-row {
    display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px;
    padding: 4px 12px 6px; background: #f5f5f7; scrollbar-width: none;
  }
  body.is-mobile .params-row .input, body.is-mobile .params-row select {
    flex: none; border-radius: 999px; padding: 6px 10px; font-size: 12px;
    background: #fff; border: 1px solid #e8e8ed; color: #111;
  }
  body.is-mobile .ptag { display: none; }

  /* 底部输入：浅灰圆角条 */
  body.is-mobile .chat-inputbar.imagine,
  body.is-mobile .chat-inputbar {
    padding: 8px 12px calc(10px + var(--kb, 0px));
    border-top: none; background: #f5f5f7;
  }
  body.is-mobile .composer-shell {
    display: flex; flex-direction: column; align-items: stretch; gap: 6px;
    background: #fff;
    border: 1px solid #e8e8ed;
    border-radius: 22px; padding: 8px 8px 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
  }
  body.is-mobile .composer-shell .textarea {
    width: 100%; min-height: 24px; max-height: 120px; height: 24px;
    border: none !important; background: transparent !important;
    box-shadow: none !important; padding: 4px 6px 2px;
    font-size: 16px; line-height: 1.35; color: #111;
    overflow-y: auto; resize: none;
  }
  body.is-mobile .composer-shell .textarea::placeholder { color: #aeaeb2; }
  body.is-mobile .composer-toolbar { padding: 0 2px 2px; }
  body.is-mobile .ib-actions { display: none !important; }
  body.is-mobile #chat-pipeline, body.is-mobile #cost-tip, body.is-mobile .chat-tip { display: none !important; }
  body.is-mobile .composer-plus, body.is-mobile .composer-send {
    width: 36px; height: 36px; min-width: 36px; border-radius: 50%; border: none; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
  }
  body.is-mobile .composer-plus {
    background: #ebebed; color: #111; font-size: 22px; font-weight: 500;
  }
  body.is-mobile .composer-send {
    background: #2f6bff; color: #fff; font-size: 18px; font-weight: 700;
  }
  body.is-mobile .plus-menu {
    left: 10px; bottom: 52px;
    background: #fff; border-color: #e5e5ea; box-shadow: 0 10px 28px rgba(0,0,0,.14);
  }
  body.is-mobile .plus-mi { color: #111; }
  body.is-mobile .plus-mi:hover { background: #f5f5f7; }
  body.is-mobile.kb-open .sidebar { transform: translateY(110%); pointer-events: none; }
  body.is-mobile.kb-open .main { padding-bottom: 0; }

  body.is-mobile .quick-chips {
    display: flex; gap: 8px; overflow-x: auto; padding: 0 2px 8px;
    scrollbar-width: none; justify-content: flex-start; flex-wrap: wrap;
  }
  body.is-mobile .quick-chips .qchip {
    flex: none; padding: 8px 12px; border-radius: 999px; font-size: 13px;
    background: #fff; border: 1px solid #e8e8ed; color: #333;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
  }

  body.is-mobile .page { padding: 16px 14px 24px; background: #f5f5f7; color: #111; }
  body.is-mobile .page-title { color: #111; }
  body.is-mobile .wallet-hero,
  body.is-mobile .card, body.is-mobile .panel {
    background: #fff; border: 1px solid #eee; color: #111;
  }
  body.is-mobile .mobile-me-bar { display: block; padding: 8px 2px 12px; }
  body.is-mobile .mobile-me-bar .mm-title { font-size: 22px; font-weight: 700; color: #111; margin-bottom: 10px; }
  body.is-mobile .input, body.is-mobile .textarea, body.is-mobile select.input {
    background: #fff; border: 1px solid #e5e5ea; color: #111;
  }
  body.is-mobile .btn { border-radius: 12px; }
  body.is-mobile .btn.primary { background: #111; color: #fff; border: none; }
  body.is-mobile .sp-admin { flex-direction: column; height: auto; min-height: 70vh; background: #fff; }
  body.is-mobile .sp-list { width: 100%; max-height: 40vh; }
  body.is-mobile .sp-bubble { background: #f0f0f2; color: #111; }
  body.is-mobile .sp-msg.me .sp-bubble { background: #2f6bff; color: #fff; }
}


.proj-toggle {
  display: none; border: 1px solid var(--line); background: var(--panel2);
  border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
body.is-mobile .proj-toggle { display: inline-flex; align-items: center; gap: 4px; }
.sync-banner {
  display: none; font-size: 11px; color: var(--muted); padding: 4px 10px;
  border-bottom: 1px solid var(--border);
}
body.is-mobile .sync-banner { display: block; }


/* 参考图小尺寸上传框（图片工坊图生图） */
.upload-box.sm { min-height: 90px; padding: 10px; font-size: 12px; }
.upload-box.sm.has img { max-height: 70px; }

/* ==================== 在线客服 ==================== */
.sp-head { display:flex; align-items:center; gap:10px; padding:14px 18px; border-bottom:1px solid var(--border); }
.sp-ava { width:38px; height:38px; border-radius:50%; background:linear-gradient(135deg,var(--primary),#4338ca); color:#fff; display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:600; flex:none; }
.sp-ava.sm { width:30px; height:30px; font-size:12px; }
.sp-body { flex:1; overflow-y:auto; padding:18px; display:flex; flex-direction:column; gap:14px; }
.sp-empty { margin:auto; text-align:center; color:var(--muted2); font-size:14px; line-height:2; }
.sp-msg { display:flex; gap:8px; align-items:flex-start; }
.sp-msg.me { justify-content:flex-end; }
.sp-bubble { max-width:70%; padding:10px 14px; border-radius:14px 14px 14px 4px; background:var(--panel2); font-size:13px; line-height:1.7; white-space:pre-wrap; word-break:break-word; }
.sp-msg.me .sp-bubble { border-radius:14px 14px 4px 14px; background:var(--primary); color:#fff; }
.sp-time { font-size:10px; opacity:.55; margin-top:4px; }
.sp-input { display:flex; gap:10px; padding:12px 14px; border-top:1px solid var(--border); align-items:flex-end; }
.sp-input textarea { flex:1; resize:none; }

/* 后台客服工作台 */
.sp-admin { display:flex; gap:0; border:1px solid var(--border); border-radius:12px; overflow:hidden; height:calc(100vh - 260px); min-height:480px; background:var(--panel); }
.sp-list { width:280px; flex:none; border-right:1px solid var(--border); overflow-y:auto; }
.sp-item { display:flex; gap:10px; align-items:center; padding:12px 14px; cursor:pointer; border-bottom:1px solid var(--border); position:relative; }
.sp-item:hover { background:rgba(124,92,255,.06); }
.sp-item.active { background:rgba(124,92,255,.12); }
.sp-dot { width:9px; height:9px; border-radius:50%; background:var(--warn); flex:none; }
.sp-panel { flex:1; display:flex; flex-direction:column; min-width:0; }
.sp-userinfo { padding:14px 18px; border-bottom:1px solid var(--border); font-size:13px; }
.sp-panel-msgs { flex:1; overflow-y:auto; padding:18px; display:flex; flex-direction:column; gap:14px; }

/* ============ 91工坊 v2：统一创作界面 ============ */
/* 天蓝色 logo */
.logo-rain, .logo-mark.logo-rain {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  box-shadow: 0 4px 14px rgba(56,189,248,.4);
}

/* 参数行（模式下方） */
.params-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 8px 2px 2px; font-size: 12px;
}
.ptag { color: var(--muted); font-size: 12px; }
.params-row .input { font-size: 12px; }
.ref-thumb {
  width: 34px; height: 34px; object-fit: cover; border-radius: 8px;
  border: 2px solid var(--border2); cursor: pointer; vertical-align: middle;
}
.ref-thumb:hover { border-color: var(--danger); }

/* 素材网格（素材库页 + 选择弹窗共用） */
.asset-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px; margin-top: 16px;
}
.asset-card {
  position: relative; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; transition: all .15s;
}
.asset-card { cursor: default; }
.asset-card:hover { border-color: var(--accent); transform: translateY(-2px); }
/* 多选模式：操作条 / 勾选角标 / 选中高亮 */
.sel-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 14px;
}
.asset-card.sel-mode { cursor: pointer; }
.work-card.sel-mode { cursor: pointer; }
/* 选中态（相册式）：主题色描边 + 蒙层 + 轻微缩放，一眼可辨 */
.asset-card.sel-on, .work-card.sel-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  transform: scale(.98);
}
.work-card.sel-on::before, .asset-card.sel-on::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: rgba(124,92,255,.16); border-radius: inherit; pointer-events: none;
}
.work-card { position: relative; }
.sel-badge {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.45); border: 2px solid #fff;
  color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; transition: background .12s, transform .12s;
}
.sel-on > .sel-badge { background: var(--accent); border-color: #fff; transform: scale(1.08); }
/* 自定义复选框（原生 checkbox 在深色主题下几乎不可见） */
.cbx {
  appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0;
  border: 2px solid var(--muted2); border-radius: 5px; background: transparent;
  cursor: pointer; display: inline-block; vertical-align: middle;
  position: relative; transition: all .12s; flex: none;
}
.cbx:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.18); }
.cbx:checked { background: var(--accent); border-color: var(--accent); }
.cbx:checked::after {
  content: '✓'; position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 800; line-height: 1;
}
.asset-thumb { width: 100%; aspect-ratio: 1/1; background-color: var(--panel2); background-size: cover; background-position: center; }
.asset-card .ac-media, .asset-card > img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: contain; display: block; background: #111;
}
.asset-card img {
  width: 100%; height: 100%; aspect-ratio: 1 / 1; object-fit: contain; display: block; background: #111;
}
.asset-name {
  font-size: 12px; padding: 8px 10px 2px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.asset-time { font-size: 10px; color: var(--muted2); padding: 0 10px 8px; }
.asset-ops { display: flex; gap: 4px; padding: 0 8px 10px; flex-wrap: wrap; }
.asset-ops .btn { padding: 3px 8px; font-size: 11px; }
/* 弹窗内的选择态 */
.asset-card[data-sel] { cursor: pointer; }
.asset-card[data-sel="1"] { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124,92,255,.35); }
.asset-check {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px;
  display: none; align-items: center; justify-content: center;
}
.asset-card[data-sel="1"] .asset-check { display: flex; }

/* 快捷索引面板 */
.idx-panel {
  display: none; width: 240px; flex-shrink: 0; margin-left: 12px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  overflow-y: auto; max-height: 100%;
}
.idx-head {
  position: sticky; top: 0; background: var(--bg2); padding: 12px 14px;
  font-size: 13px; font-weight: 700; border-bottom: 1px solid var(--border);
}
.idx-list { padding: 8px; }
.idx-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px;
  border-radius: 8px; cursor: pointer; font-size: 12px; color: var(--muted);
}
.idx-item:hover { background: var(--panel); color: var(--text); }

/* 消息流内的作品卡片（覆盖 works 页网格样式） */
.m-body .work-card {
  padding: 10px; cursor: default; min-width: 200px; max-width: 340px;
}
.m-body .work-card:hover { transform: none; }
.m-bubble { white-space: pre-wrap; word-break: break-word; }

/* 剧本场次 */
.scene-item { border-left: 2px solid var(--border2); padding: 8px 0 8px 12px; margin-top: 10px; }
.scene-head { font-size: 12px; font-weight: 700; color: var(--accent2); }
.scene-body { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.7; }
.scene-dlg { font-size: 12px; margin-top: 6px; padding: 6px 10px; background: var(--panel2); border-radius: 8px; line-height: 1.6; }

/* 分镜列表 */
.sb-shots { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.shot-item { display: flex; gap: 12px; align-items: stretch; }
.shot-item.shot-item-text { flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--border2); border-radius: 12px; background: var(--panel, var(--bg2)); }
.shot-item img {
  width: 128px; height: 72px; object-fit: cover; border-radius: 8px;
  background: var(--panel2); flex-shrink: 0;
}
.shot-info { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.shot-info b { color: var(--text); font-size: 12px; display: block; margin-bottom: 2px; }
.shot-struct { color: var(--text); font-size: 13px; line-height: 1.7; }
.shot-struct-title { font-weight: 650; color: var(--text); margin-bottom: 6px; font-size: 14px; }
.shot-row { display: grid; grid-template-columns: 9.5em 1fr; gap: 6px; margin: 3px 0; align-items: start; }
.shot-k { color: var(--accent); font-weight: 600; white-space: nowrap; }
.shot-v { color: var(--text); word-break: break-word; }
.shot-frame-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.shot-frame-label { font-size: 11px; color: var(--muted); }
.shot-frame-mini { width: 56px !important; height: 100px !important; object-fit: cover; border-radius: 8px; border: 1px solid var(--border2); cursor: pointer; }
@media (max-width: 640px) {
  .shot-row { grid-template-columns: 1fr; gap: 2px; }
  .shot-k { font-size: 12px; }
}

/* 图片网格 + 操作 */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.img-cell { position: relative; border-radius: 10px; overflow: hidden; background: #111; }
.img-cell img { width: 100%; max-height: 240px; object-fit: contain; display: block; background: #111; }
.img-ops {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-around; flex-wrap: wrap; gap: 2px;
  padding: 6px 4px; background: rgba(11,11,18,.82); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .15s;
}
.img-cell:hover .img-ops { opacity: 1; }
.img-ops span {
  font-size: 11px; color: #dfe8ff; cursor: pointer; padding: 3px 8px;
  border-radius: 6px; white-space: nowrap;
}
.img-ops span:hover { background: rgba(124,92,255,.35); }

/* 分镜流水线：镜头出图/出片操作条 + 一键逐镜出片 */
.shot-pipeline {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; margin: 8px 0 10px; border-radius: 10px;
  background: var(--bg2, rgba(124,92,255,.06)); border: 1px solid var(--border2);
}
.shot-act {
  font-size: 12px; cursor: pointer; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--border2); color: var(--fg); white-space: nowrap;
}
.shot-act:hover { border-color: var(--accent); color: var(--accent); }
.shot-act.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.shot-act.primary:hover { filter: brightness(1.1); color: #fff; }
.shot-ops {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px;
  font-size: 12px;
}
.shot-ops span {
  cursor: pointer; padding: 3px 9px; border-radius: 7px;
  border: 1px solid var(--border2); color: var(--fg); white-space: nowrap;
}
.shot-ops span:hover { border-color: var(--accent); color: var(--accent); }
.shot-ops span[style] { cursor: default; border-color: transparent; }

/* 视频首尾帧 / 参考图缩略 */
.frame-thumb {
  width: 56px; height: 56px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border2); margin-right: 6px; vertical-align: middle;
}

/* 项目列表项名称 / 删除 */
.proj-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.chat-item { display: flex; align-items: center; gap: 6px; }
.proj-del {
  color: var(--muted2); font-size: 11px; padding: 2px 5px; border-radius: 5px;
  opacity: 0; flex-shrink: 0;
}
.chat-item:hover .proj-del { opacity: 1; }
.proj-del:hover { color: var(--danger); background: rgba(255,92,122,.12); }

/* ============ Grok Imagine 风格：悬浮输入条 + 画布 ============ */
.chat-scroll { padding: 24px 20px; }
.chat-scroll .msg { max-width: 86%; margin: 0 0 20px; } /* 全部靠左（用户消息仍在右侧，但删除键统一靠右） */
.msg.user .msg-del { order: -1; } /* row-reverse 下 order:-1 → 显示在消息右侧 */
.msg .msg-del { align-self: flex-start; opacity: 0; cursor: pointer; font-size: 13px; padding: 4px 6px; border-radius: 8px; transition: opacity .15s; line-height: 1; user-select: none; }
.msg:hover .msg-del, .msg .msg-del:focus { opacity: .45; }
.msg .msg-del:hover { opacity: 1; background: var(--panel2); }

/* 任务队列条 */
.queue-bar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--panel); border-radius: 12px 12px 0 0; }
.qb-chip { font-size: 11px; padding: 3px 10px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qb-chip.qb-running { border-color: var(--accent); color: var(--accent); }
.qb-chip i { cursor: pointer; margin-left: 6px; color: var(--danger); font-style: normal; }

/* 消息右键菜单 */
.ctx-menu { position: fixed; z-index: 9999; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.35); padding: 6px; min-width: 180px; }
.ctx-menu .ctx-item { padding: 8px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.ctx-menu .ctx-item:hover { background: var(--panel2); }
.ctx-menu .ctx-item.danger { color: var(--danger); }

/* 悬浮大圆角输入容器 */
.chat-inputbar.imagine {
  margin: 0 20px 20px;
  max-width: 860px;
  align-self: center;
  width: calc(100% - 40px);
  border-radius: 22px;
  border: 1px solid var(--border2);
  background: var(--panel);
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  padding: 12px 14px 10px;
}
.chat-inputbar.imagine:focus-within {
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(124,92,255,.22);
}
.chat-inputbar.imagine .textarea {
  border: none; background: transparent; box-shadow: none; padding: 6px 4px;
  min-height: 52px; font-size: 14px;
}
.ib-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ib-btn {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--border2); background: var(--panel2);
  color: var(--text); font-size: 17px; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.ib-btn:hover { border-color: var(--accent); color: var(--accent); }

/* 创作区全区域拖拽上传 */
.chat-area { position: relative; }
.chat-drop-overlay {
  display: none; position: absolute; inset: 0; z-index: 20;
  background: rgba(15, 23, 42, .72); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; pointer-events: none;
  animation: fadeIn .15s ease;
}
.chat-drop-inner {
  background: var(--panel); border: 2px dashed var(--primary); border-radius: 20px;
  padding: 48px 64px; text-align: center; color: var(--text);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
@keyframes fadeIn { from { opacity: 0; } }

/* 输入框上方附件：方缩略图 + 右上角 ✕（像助手附件条） */
.attach-row {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 2px 2px 6px; margin: 0;
  border-bottom: none;
}
.attach-chip, .attach-thumb {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  background: var(--panel2, #222); border: 1px solid var(--border2, #333);
  border-radius: 12px; padding: 0; overflow: visible;
  cursor: pointer; flex: none;
}
.attach-chip img, .attach-thumb img {
  width: 56px; height: 56px; object-fit: cover; border-radius: 12px; display: block;
}
.attach-thumb-body {
  width: 56px; height: 56px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel2, #2a2a32); font-size: 22px;
}
.attach-thumb.text { width: auto; min-width: 56px; max-width: 140px; padding: 0 8px; gap: 4px; }
.attach-cap { font-size: 11px; color: var(--muted); max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-no {
  position: absolute; left: 4px; bottom: 4px; z-index: 2;
  font-size: 9px; font-weight: 700; line-height: 1;
  background: rgba(47,107,255,.92); color: #fff;
  padding: 3px 5px; border-radius: 6px; white-space: nowrap;
}
.attach-x {
  position: absolute; top: -6px; right: -6px; z-index: 3;
  width: 20px; height: 20px; border-radius: 50%; border: none;
  background: #444; color: #fff; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.attach-x:hover { background: #ff3b30; }
.attach-chip i { display: none; }

/* @引用选择器：输入 @ 弹出人物/场景资产与参考图 */
.chat-inputbar.imagine { position: relative; }
.mention-pop {
  position: absolute; left: 14px; right: 14px; bottom: calc(100% - 6px); z-index: 60;
  background: var(--panel); border: 1px solid var(--border2); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.22); padding: 8px;
  max-height: 264px; overflow-y: auto;
  animation: fadeIn .12s ease;
}
.mention-title { font-size: 11px; color: var(--muted2); padding: 2px 6px 8px; }
.mention-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 9px; cursor: pointer; font-size: 13px; color: var(--text);
}
.mention-item:hover, .mention-item.on { background: var(--panel2); }
.mention-item b { color: var(--accent); font-weight: 600; }
.mention-item .mi-desc { font-size: 11px; color: var(--muted2); flex: 1; }
.mention-item img { width: 30px; height: 30px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border2); }
.attach-chip.text span:first-child { font-size: 14px; }
.attach-chip.text span:nth-child(2) {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px;
}

/* 输入条内小型模式选择 */
.mode-mini { display: flex; gap: 4px; flex-wrap: wrap; }
.mpill {
  display: flex; align-items: center; gap: 3px;
  padding: 5px 10px; border-radius: 999px; cursor: pointer;
  font-size: 12px; color: var(--muted);
  border: 1px solid transparent; transition: all .12s;
  white-space: nowrap;
}
.mpill:hover { color: var(--text); background: var(--panel2); }
.mpill.active {
  color: #fff; background: var(--accent-grad, linear-gradient(135deg,#7c5cff,#9d7bff));
  box-shadow: 0 2px 10px rgba(124,92,255,.35);
}
.mpill-t { font-size: 12px; }

/* 空状态示例卡片 */
.ex-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px; margin: 22px auto 0; max-width: 720px;
}
.ex-card {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 14px 16px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel);
  font-size: 13px; color: var(--muted); transition: all .15s;
}
.ex-card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.ex-card span { font-size: 20px; }

/* ===== 全屏查看器（图片/视频放大 + 可隐藏工具栏） ===== */
.lb-mask { position: fixed; inset: 0; z-index: 8000; background: rgba(8,8,12,.93); display: flex; align-items: center; justify-content: center; animation: lbfade .18s ease; }
@keyframes lbfade { from { opacity: 0 } to { opacity: 1 } }
.lb-title { position: fixed; top: 18px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; opacity: .85; transition: opacity .25s; pointer-events: none; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; }
.lb-media img, .lb-media video { max-width: 92vw; max-height: 82vh; border-radius: 10px; box-shadow: 0 8px 40px rgba(0,0,0,.55); }
.lb-media img { cursor: zoom-out; transition: transform .15s ease-out; will-change: transform; }
/* 查看器缩放控制条 */
.lb-zoombar {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.55); border-radius: 20px; padding: 6px 12px;
}
.lb-zo { border: none; background: rgba(255,255,255,.14); color: #fff; width: 30px; height: 30px; border-radius: 50%; font-size: 14px; cursor: pointer; transition: background .2s; }
.lb-zo:hover { background: rgba(255,255,255,.3); }
.lb-zp { color: #fff; font-size: 12px; min-width: 42px; text-align: center; user-select: none; }
.lb-arrow { position: fixed; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: none; background: rgba(255,255,255,.12); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; transition: opacity .25s, background .2s, transform .25s; z-index: 2; }
.lb-arrow:hover { background: rgba(255,255,255,.26); }
.lb-prev { left: 22px; } .lb-next { right: 22px; }
.lb-count { position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 12px; opacity: .7; transition: opacity .25s; }
.lb-ops { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; background: rgba(22,22,28,.88); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 8px 10px; transition: opacity .25s, transform .25s; max-width: 94vw; flex-wrap: wrap; justify-content: center; }
.lb-ops span { color: #eee; font-size: 13px; padding: 6px 12px; border-radius: 9px; cursor: pointer; white-space: nowrap; transition: background .15s; user-select: none; }
.lb-ops span:hover { background: rgba(255,255,255,.13); }
.lb-hidden { opacity: 0; pointer-events: none !important; }
.lb-ops.lb-hidden { transform: translateX(-50%) translateY(14px); }
.lb-arrow.lb-hidden { transform: translateY(-50%) translateY(10px); }
.lb-expand { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.55); color: #fff; border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; z-index: 3; transition: background .15s; }
.lb-expand:hover { background: rgba(0,0,0,.78); }
img[data-zoom] { cursor: zoom-in; }

/* ===== 对话内上传附件：缩略图 + 引用操作 ===== */
.msg-media { position: relative; display: inline-block; margin: 2px 0 8px; }
.msg .user .msg-media, .msg.user .msg-media { display: block; }
.msg-media img, .msg-media video { display: block; max-width: min(280px, 52vw); max-height: 220px; border-radius: 10px; object-fit: contain; background: #111; cursor: zoom-in; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.mm-ops { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px; padding: 16px 6px 6px; border-radius: 0 0 10px 10px; background: linear-gradient(transparent, rgba(0,0,0,.65)); opacity: 0; transition: opacity .18s; }
.msg-media:hover .mm-ops { opacity: 1; }
.mm-ops span { color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 7px; background: rgba(255,255,255,.18); cursor: pointer; white-space: nowrap; backdrop-filter: blur(4px); }
.mm-ops span:hover { background: rgba(255,255,255,.32); }

/* 语言切换：侧栏左下 */
.lang-switch {
  margin-top: auto;
  padding: 10px 8px 12px;
  border-top: 1px solid var(--border);
}
.lang-switch label {
  display: block; font-size: 10px; color: var(--muted2); margin-bottom: 4px; padding-left: 4px;
}
.lang-switch select {
  width: 100%; font-size: 12px; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px;
}
.sidebar { display: flex; flex-direction: column; }
.sidebar .nav { flex: 1; min-height: 0; }


/* 手机去掉底栏/侧栏竖排，对话全屏 */
body.is-mobile .sidebar { display: none !important; }
body.is-mobile .main { padding-bottom: 0 !important; width: 100%; }
body.is-mobile .layout-shell { display: block !important; height: 100dvh; }
body.is-mobile .m-status { display: block; }
body.is-mobile .desk-head { display: none !important; }
/* 桌面也强化顶栏用户积分 */
.proj-title-btn {
  border: none; background: transparent; color: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: left; padding: 4px 6px; border-radius: 8px;
}
.proj-title-btn:hover { background: rgba(127,127,127,.12); }
.head-user { font-size: 13px; color: var(--muted); }
.head-credits { font-size: 13px; font-weight: 700; color: var(--accent2); }

body.is-mobile .m-status-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff;
}
body.is-mobile .msb-left {
  width: 36px; height: 36px; border: none; border-radius: 10px; background: #f0f0f2;
  font-size: 16px; flex: none; cursor: pointer;
}
body.is-mobile .msb-title {
  flex: 1; border: none; background: transparent; font-size: 15px; font-weight: 700;
  text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #111; padding: 6px 4px; border-radius: 8px;
}
body.is-mobile .msb-right { display: flex; align-items: center; gap: 8px; flex: none; }
body.is-mobile .msb-user-name { font-size: 12px; color: #666; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.is-mobile .msb-credits { font-size: 12px; color: #2f6bff; font-weight: 700; }

/* 状态栏展开为左侧列感觉：贴顶下拉列表 */
body.is-mobile .m-status-panel {
  position: absolute; left: 0; top: 100%; width: min(86vw, 320px);
  max-height: 70vh; overflow: auto; z-index: 40;
  background: #fff; border: 1px solid #eee; border-radius: 0 0 16px 0;
  box-shadow: 8px 12px 32px rgba(0,0,0,.12); padding: 10px 12px 14px;
}
body.is-mobile .m-status { position: relative; z-index: 30; }

/* 素材缩略图墙（桌面暗色主题；手机在 body.is-mobile 下覆盖为浅色） */
.asset-wall {
  position: absolute; inset: 0; z-index: 15;
  background: var(--bg);
  color: var(--text);
  display: flex; flex-direction: column;
  width: 100%; height: 100%;
}
.asset-wall[hidden] { display: none !important; }
.aw-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--border);
  flex: none; color: var(--text); gap: 10px;
}
.aw-head b { color: var(--text); font-weight: 700; }
.aw-grid {
  flex: 1; min-height: 0; overflow-y: auto; padding: 14px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px;
  align-content: start; grid-auto-rows: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}
.aw-thumb {
  background: var(--panel); border-radius: 14px; overflow: hidden; border: 1px solid var(--border);
  cursor: pointer; position: relative;
  display: flex; flex-direction: column;
  height: auto; min-height: 0; aspect-ratio: auto;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.aw-media {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  background: #111; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.aw-thumb img, .aw-media > img {
  width: 100%; height: 100%; object-fit: contain; display: block; background: #1a1a1a;
}
.aw-vid {
  width: 100%; height: 100%; background: #111; color: #fff;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.aw-vid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .85; background: #111; }
.aw-vid span { position: relative; z-index: 1; font-size: 22px; }
.aw-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px;
  font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; z-index: 1;
}
.aw-viewer { flex: 1; overflow: auto; padding: 12px; background: var(--bg); color: var(--text); }
.aw-stage { margin: 10px 0; }
.aw-actions { display: flex; flex-wrap: wrap; gap: 8px; }
body.is-mobile .chat-area { position: relative; }

/* 桌面顶栏也显示 m-status? 仅手机。桌面用 desk-head */
body:not(.is-mobile) .m-status { display: none !important; }
body:not(.is-mobile) .asset-wall { inset: 0; width: 100%; height: 100%; }


.m-inline-player { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-end; justify-content: center; }
.m-inline-player .mip-bg { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.m-inline-player .mip-card {
  position: relative; z-index: 1; width: 100%; max-width: 560px;
  background: #fff; border-radius: 16px 16px 0 0; padding: 12px;
  box-shadow: 0 -8px 30px rgba(0,0,0,.2);
}
.m-inline-player .mip-actions { display: flex; gap: 8px; margin-top: 10px; }

/* mobile-nav 强制隐藏（对话/作品/积分/我 中竖条） */
body.is-mobile .mobile-nav,
body.is-mobile .sidebar .mobile-nav { display: none !important; }
body.is-mobile .layout-shell { display: block !important; }
body.is-mobile .main { width: 100% !important; max-width: 100% !important; }


/* ===== 手机左右分栏：左列 + 右内容 ===== */
body.is-mobile .m-body-row {
  flex: 1; min-height: 0; display: flex; flex-direction: row;
  position: relative; overflow: hidden; background: #f5f5f7;
}
body.is-mobile .m-left-col {
  display: flex; flex-direction: column;
  width: 42vw; max-width: 200px; min-width: 148px;
  flex: none; height: 100%; overflow: auto;
  background: #fff; border-right: 1px solid #eee;
  padding: 8px 8px 12px; z-index: 5;
  box-shadow: none; position: relative; top: auto; left: auto;
  border-radius: 0; max-height: none;
}
body.is-mobile .m-left-col[hidden] { display: none !important; }
body.is-mobile .m-right-pane {
  flex: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; position: relative;
  background: #f5f5f7;
}
body.is-mobile .m-status { flex: none; position: relative; z-index: 20; }
body.is-mobile .chat-area { display: flex; flex-direction: column; height: 100%; min-height: 0; }
body.is-mobile .asset-wall {
  position: absolute; inset: 0; z-index: 8;
  background: #f5f5f7; display: flex; flex-direction: column;
}
body.is-mobile .asset-wall[hidden] { display: none !important; }
body.is-mobile .msp-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 10px; flex: none;
}
body.is-mobile .msp-tab {
  flex: 1 1 40%; text-align: center; border: 1px solid #e8e8ed; background: #f5f5f7;
  color: #333; border-radius: 10px; padding: 8px 6px; font-size: 12px;
}
body.is-mobile .msp-tab.active { background: #111; color: #fff; border-color: #111; }
body.is-mobile .msp-body { flex: 1; min-height: 0; overflow: auto; }
/* 覆盖早期 absolute 下拉样式 */
body.is-mobile .m-status-panel,
body.is-mobile aside.m-left-col#m-status-panel {
  position: relative !important; left: auto !important; top: auto !important;
  width: 42vw !important; max-width: 200px !important; max-height: none !important;
  box-shadow: none !important; border-radius: 0 !important;
}
/* 桌面：右栏为真实 flex 列，资产墙可绝对铺满；左列隐藏 */
body:not(.is-mobile) .m-body-row {
  flex: 1; min-height: 0; min-width: 0; height: 100%;
  display: flex; flex-direction: row; position: relative; overflow: hidden;
}
body:not(.is-mobile) .m-left-col { display: none !important; }
body:not(.is-mobile) .m-right-pane {
  flex: 1; min-width: 0; height: 100%; position: relative;
  display: flex; flex-direction: column;
}


/* ===== 修复：左栏自适应换行 / 顶栏不截断 / 输入条嵌入 / 客服返回 ===== */

/* 顶栏：用户名与积分可换行，不卡一半 */
body.is-mobile .m-status-bar {
  flex-wrap: wrap; align-items: flex-start; row-gap: 4px;
}
body.is-mobile .msb-title {
  white-space: normal !important; overflow: visible !important;
  text-overflow: unset !important; word-break: break-word; line-height: 1.25;
  max-width: none;
}
body.is-mobile .msb-right {
  flex-wrap: wrap; max-width: 100%; justify-content: flex-end;
}
body.is-mobile .msb-user-name {
  max-width: none !important; white-space: normal !important;
  overflow: visible !important; text-overflow: unset !important;
  word-break: break-word;
}

/* 左列加宽，文字换行完整显示 */
body.is-mobile .m-left-col,
body.is-mobile aside.m-left-col#m-status-panel {
  width: min(58vw, 260px) !important;
  max-width: 260px !important;
  min-width: 160px !important;
}
body.is-mobile .m-proj,
body.is-mobile .m-task,
body.is-mobile .m-hint,
body.is-mobile .m-acc-name,
body.is-mobile .msp-tab {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  word-break: break-word;
  line-height: 1.35;
}
body.is-mobile .msp-tab { font-size: 12px; padding: 8px 4px; }

/* 手机输入条：贴底嵌入，去掉悬浮大圆角块 */
body.is-mobile .chat-inputbar.imagine,
body.is-mobile .chat-inputbar {
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  align-self: stretch !important;
  border-radius: 0 !important;
  border: none !important;
  border-top: 1px solid #e8e8ed !important;
  background: #fff !important;
  box-shadow: none !important;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px) + var(--kb, 0px)) !important;
}
body.is-mobile .composer-shell {
  border-radius: 16px !important;
  box-shadow: none !important;
  border: 1px solid #e5e5ea !important;
  background: #f5f5f7 !important;
  flex-direction: column !important;
  align-items: stretch !important;
}
body.is-mobile .m-input-meta {
  padding: 6px 2px 0;
  background: transparent;
}

/* 客服页：顶栏返回 + 聊天嵌入页面 */
.sp-page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.sp-page-head .sp-back { flex: none; white-space: nowrap; }
.sp-chat-embed {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  overflow: hidden;
  height: calc(100dvh - 200px);
  min-height: 360px;
}
body.is-mobile .support-page { padding-bottom: 12px; }
body.is-mobile .sp-chat-embed {
  height: auto;
  min-height: 420px;
  flex: 1;
  border-radius: 12px;
  border: 1px solid #e8e8ed;
  box-shadow: none;
}
body.is-mobile .mobile-me-bar + .support-page .sp-chat-embed,
body.is-mobile .support-page .sp-chat-embed {
  height: calc(100dvh - 280px);
}
body.is-mobile .sp-head {
  background: #fafafa; padding: 12px;
  display: flex; align-items: center; gap: 10px;
}
body.is-mobile .sp-body { background: #f5f5f7; }
body.is-mobile .sp-input {
  background: #fff; border-top: 1px solid #eee;
  padding: 10px; display: flex; gap: 8px; align-items: flex-end;
}
body.is-mobile .sp-input .input {
  flex: 1; border-radius: 12px; background: #f5f5f7; border: 1px solid #e8e8ed;
}

body.is-mobile .mm-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px;
}
body.is-mobile .mm-top .mm-title { margin-bottom: 0; }


/* ===== 滚动手感：触底可再拖一点 + 底线留白；充值/作品返回 ===== */
body.is-mobile .main {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
  padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)) !important;
}
/* 创作页仍由内部 chat-scroll 滚动，main 不抢 */
body.is-mobile .main:has(.chat-layout) {
  overflow: hidden !important;
  padding-bottom: 0 !important;
}
body.is-mobile .chat-scroll {
  padding-bottom: 56px !important;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.is-mobile .page {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
}
body.is-mobile .page::after {
  content: "";
  display: block;
  height: 28px;
}
body.is-mobile .m-left-col,
body.is-mobile .msp-body,
body.is-mobile .aw-grid,
body.is-mobile .sp-body {
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}
body.is-mobile .wallet-cs-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
}
body.is-mobile .wallet-page .wallet-hero {
  border-radius: 14px;
}


/* ===== 左栏浮层 + 右栏可滚 + 素材墙不塌高度 ===== */
body.is-mobile .m-body-row {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  position: relative; overflow: hidden; background: #f5f5f7;
}
/* 左列改为浮层，不再挤窄右边聊天 */
body.is-mobile .m-left-col,
body.is-mobile aside.m-left-col#m-status-panel {
  position: absolute !important;
  left: 0 !important; top: 0 !important; bottom: 0 !important;
  width: min(78vw, 300px) !important;
  max-width: 300px !important; min-width: 200px !important;
  z-index: 40 !important;
  box-shadow: 8px 0 28px rgba(0,0,0,.18) !important;
  border-right: 1px solid #eee !important;
  border-radius: 0 !important;
  background: #fff !important;
}
body.is-mobile .m-left-col[hidden] { display: none !important; }
body.is-mobile .m-left-backdrop {
  position: absolute; inset: 0; z-index: 35;
  background: rgba(0,0,0,.35); border: none; padding: 0;
}
body.is-mobile .m-left-backdrop[hidden] { display: none !important; }
body.is-mobile .m-right-pane {
  flex: 1; min-width: 0; min-height: 0; width: 100%;
  display: flex; flex-direction: column; position: relative;
  background: #f5f5f7; overflow: hidden;
}
body.is-mobile .chat-main-wrap {
  flex: 1 !important; min-height: 0 !important;
  overflow: hidden !important; display: flex !important;
  position: relative;
}
body.is-mobile .chat-scroll {
  flex: 1 !important; min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
  padding: 14px 14px 20px !important;
}
/* 气泡正常宽度，可被视口裁切，靠滚动看完 */
body.is-mobile .msg {
  max-width: min(88%, 520px) !important;
  width: auto !important;
}
body.is-mobile .m-body,
body.is-mobile .m-bubble {
  word-break: break-word !important;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
/* 素材墙：占满右栏，不要 absolute 塌高度 */
body.is-mobile .asset-wall {
  position: relative !important;
  inset: auto !important;
  flex: 1 !important;
  min-height: 0 !important;
  width: 100% !important;
  z-index: 8;
  background: #f5f5f7;
  display: flex; flex-direction: column;
}
body.is-mobile .asset-wall[hidden] { display: none !important; }
body.is-mobile .aw-grid {
  flex: 1; min-height: 0; overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 12px; display: grid;
  grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important;
  align-content: start; grid-auto-rows: auto;
}
body.is-mobile .aw-viewer {
  flex: 1; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.is-mobile .m-empty {
  grid-column: 1 / -1;
  padding: 24px 12px; text-align: center; color: #8e8e93; font-size: 13px;
}


/* ===== 手机：附件缩略图条（在输入框内上方） ===== */
body.is-mobile .attach-row {
  display: flex !important;
  flex-wrap: wrap; gap: 10px;
  padding: 4px 2px 2px !important;
  margin: 0 !important;
  border-bottom: none !important;
  background: transparent;
  max-height: 140px; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.is-mobile .attach-row[style*="display: none"] { display: none !important; }
body.is-mobile .attach-chip,
body.is-mobile .attach-thumb {
  width: 52px !important; height: 52px !important;
  background: #fff !important;
  border: 1px solid #e5e5ea !important;
  border-radius: 12px !important;
  max-width: none !important;
  padding: 0 !important;
}
body.is-mobile .attach-chip img,
body.is-mobile .attach-thumb img,
body.is-mobile .attach-thumb-body {
  width: 52px !important; height: 52px !important;
  border-radius: 12px !important;
}
body.is-mobile .attach-x {
  background: #3a3a3c !important; color: #fff !important;
  width: 20px; height: 20px;
}
body.is-mobile .attach-no {
  background: #2f6bff !important; color: #fff !important;
}

/* 对话内图片：足够大，操作条常显（手机无 hover） */
body.is-mobile .msg-media {
  display: block !important;
  max-width: 100%;
  margin: 6px 0 10px;
}
body.is-mobile .msg-media img,
body.is-mobile .msg-media video {
  max-width: min(68vw, 240px) !important;
  max-height: 200px !important;
  width: auto; height: auto;
  object-fit: contain !important;
  background: #111;
  border-radius: 12px !important;
}
.mm-name { font-size: 11px; color: var(--muted); margin-top: 4px; }
body.is-mobile .mm-ops {
  position: static !important;
  opacity: 1 !important;
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 0 !important;
  background: none !important;
  border-radius: 0 !important;
  justify-content: flex-start;
}
body.is-mobile .mm-ops span {
  color: #111 !important;
  background: #f0f0f2 !important;
  border: 1px solid #e5e5ea;
  font-size: 12px !important;
  padding: 6px 10px !important;
  border-radius: 999px !important;
  backdrop-filter: none;
}
body.is-mobile .img-ops {
  position: static !important;
  opacity: 1 !important;
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 0 !important;
  background: none !important;
}
body.is-mobile .img-ops span {
  color: #111 !important;
  background: #f0f0f2 !important;
  border: 1px solid #e5e5ea;
  padding: 6px 10px !important;
  border-radius: 999px !important;
}
body.is-mobile .img-cell img {
  max-height: 200px;
  width: 100%;
  object-fit: contain !important;
  background: #111;
}

.aw-thumb { position: relative; }
.aw-del {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.aw-del:hover { background: #ff3b30; }
body.is-mobile .aw-del { width: 32px; height: 32px; background: rgba(0,0,0,.65); }

.aw-quick { display: flex; gap: 4px; padding: 6px 4px 4px; flex-wrap: wrap; }
.aw-qbtn {
  flex: 1; min-width: 0; border: 1px solid var(--border, #333); background: var(--panel2, #222);
  color: var(--text, #eee); font-size: 11px; padding: 6px 4px; border-radius: 8px; cursor: pointer;
}
.aw-qbtn.primary { background: var(--accent, #7c5cff); border-color: var(--accent, #7c5cff); color: #fff; }
body:not(.is-mobile) .aw-qbtn {
  background: var(--panel2); border-color: var(--border2); color: var(--text);
}
body:not(.is-mobile) .aw-qbtn:hover { border-color: var(--accent); color: #fff; }
body.is-mobile .aw-qbtn { font-size: 12px; padding: 8px 4px; }
body.is-mobile .aw-thumb { min-height: auto !important; height: auto !important; aspect-ratio: auto !important; }
body.is-mobile .aw-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
.img-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) {
  .img-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

/* 手机素材墙：引用按钮常显、好点 */
body.is-mobile .aw-quick { display: flex !important; gap: 6px; padding: 8px 4px 6px; }
body.is-mobile .aw-qbtn {
  flex: 1; min-height: 36px; font-size: 13px !important;
  border-radius: 10px !important;
}
body.is-mobile .aw-name { font-size: 12px; padding: 4px 6px 0; }
body.is-mobile #aw-grid .aw-thumb { border: 1px solid #e5e5ea; border-radius: 12px; overflow: hidden; background: #fff; }

/* ===== 手机状态栏紧凑 + 左侧栏滑动进出 ===== */
body.is-mobile .m-status-bar {
  min-height: 40px !important;
  padding: 6px 10px !important;
  align-items: center !important;
}
body.is-mobile .msb-title {
  font-size: 14px !important;
  line-height: 1.2 !important;
  max-width: 42vw !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body.is-mobile .msb-right { gap: 6px !important; font-size: 12px !important; }
body.is-mobile .msb-left {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid #e8e8ed; background: #f5f5f7;
  display: inline-flex; align-items: center; justify-content: center;
}
body.is-mobile aside.m-left-col#m-status-panel,
body.is-mobile .m-left-col {
  transform: translateX(-105%);
  transition: transform .28s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
  display: flex !important;
}
body.is-mobile aside.m-left-col#m-status-panel:not([hidden]),
body.is-mobile .m-left-col:not([hidden]),
body.is-mobile .m-status.open aside.m-left-col#m-status-panel,
body.is-mobile .m-body-row.left-open aside.m-left-col#m-status-panel {
  transform: translateX(0);
}
body.is-mobile aside.m-left-col#m-status-panel[hidden] {
  display: flex !important;
  pointer-events: none;
  transform: translateX(-105%);
}
body.is-mobile .m-left-backdrop {
  opacity: 0; transition: opacity .28s ease;
  pointer-events: none;
}
body.is-mobile .m-left-backdrop:not([hidden]) {
  opacity: 1; pointer-events: auto; display: block !important;
}
body.is-mobile .msp-tabs {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px; padding: 6px 8px 8px !important;
  flex-wrap: nowrap !important;
}
body.is-mobile .msp-tab {
  flex: none !important;
  padding: 8px 2px !important;
  font-size: 12px !important;
  border-radius: 10px !important;
}
body.is-mobile .m-proj {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 10px; border-radius: 12px;
}
body.is-mobile .m-proj-name { flex: 1; min-width: 0; font-size: 13px; }
body.is-mobile .m-proj-ops { display: flex; gap: 4px; flex: none; }
body.is-mobile .m-proj-btn {
  border: 1px solid #e5e5ea; background: #f5f5f7; color: #333;
  border-radius: 8px; padding: 4px 8px; font-size: 12px;
}
body.is-mobile .m-proj-btn.danger { color: #ff3b30; }

/* 素材墙：卡片完整展开，可上下滑，不叠压 */
body.is-mobile #aw-grid .aw-thumb {
  display: flex !important; flex-direction: column !important;
  height: auto !important; min-height: auto !important;
  aspect-ratio: auto !important; overflow: hidden;
}
body.is-mobile #aw-grid .aw-media {
  width: 100%; aspect-ratio: 1 / 1; flex: none;
}
body.is-mobile #aw-grid .aw-quick {
  flex: none; background: #fff; border-top: 1px solid #f0f0f2;
}

/* 图片操作条：单行规整 */
.img-ops {
  display: flex !important; flex-wrap: nowrap !important; gap: 6px !important;
  justify-content: center; overflow-x: auto; opacity: 1 !important;
  padding: 8px 6px !important;
}
.img-ops span {
  flex: none; white-space: nowrap; font-size: 12px !important;
  padding: 6px 10px !important; border-radius: 999px !important;
}
body.is-mobile .img-ops { opacity: 1 !important; }
body.is-mobile .mm-ops {
  opacity: 1 !important;
  flex-wrap: wrap !important;
  overflow-x: visible !important;
  gap: 6px !important;
  padding: 8px 2px 2px !important;
  margin: 0 !important;
  width: 100%;
  box-sizing: border-box;
}
body.is-mobile .mm-ops span {
  flex: none !important;
  max-width: 100%;
}
body.is-mobile .img-ops {
  flex-wrap: wrap !important;
  overflow-x: visible !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  padding: 8px 2px 2px !important;
}
.lb-zoombar { display: none !important; }
.lb-ops {
  flex-wrap: nowrap !important; gap: 8px !important;
  max-width: 96vw; overflow-x: auto;
}
.lb-ops span { flex: none; }
.lb-title, .lb-count { display: none !important; } /* 进大图更干净，像外面大图 */

/* 毛刷改图面板 */
.brush-mask {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center;
  padding: 12px;
}
.brush-panel {
  width: min(960px, 100%); max-height: 94vh; overflow: auto;
  background: #fff; border-radius: 16px; padding: 12px 14px 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,.28);
}
.brush-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.brush-stage { background: #111; border-radius: 12px; overflow: auto; text-align: center; }
.brush-canvas { max-width: 100%; touch-action: none; cursor: crosshair; }
.brush-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.brush-prompt { width: 100%; border: 1px solid #e5e5ea; border-radius: 10px; padding: 10px; font-size: 14px; }
.brush-actions { margin-top: 10px; }
.brush-hint { font-size: 12px; color: #8e8e93; margin-top: 8px; }
.brush-face-preview { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 12px; color: #333; }
.brush-face-preview img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
body.is-mobile .brush-panel { padding: 10px; border-radius: 14px; }


/* ===== 2026-09 layout unify: full-width pages + desk head + mobile polish ===== */

/* Works / Assets pages use full .main width on desktop */
body:not(.is-mobile) #wk-page.page,
body:not(.is-mobile) #asset-page.page {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 22px 28px 28px;
  box-sizing: border-box;
}
body:not(.is-mobile) .main:has(#wk-page),
body:not(.is-mobile) .main:has(#asset-page) {
  overflow-x: hidden;
}
body:not(.is-mobile) #wk-page .work-grid,
body:not(.is-mobile) #asset-page .asset-grid {
  width: 100% !important;
}
body:not(.is-mobile) #wk-page .work-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
body:not(.is-mobile) #asset-page .asset-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

/* Page headers: title + actions one row, wrap cleanly */
.page-head, .sp-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.page-head > div:first-child,
.sp-page-head > div:first-child { flex: 1; min-width: 180px; }
.page-head > div:last-child,
.sp-page-head .sp-back { flex: none; }
#asset-page .page-head > div:last-child,
#wk-page .sp-page-head + * {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}

/* Desk head: no awkward overflow on mid widths */
body:not(.is-mobile) .desk-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  min-width: 0;
}
body:not(.is-mobile) .desk-head .proj-title-btn {
  flex: 1 1 auto; min-width: 80px; max-width: min(36vw, 320px);
}
body:not(.is-mobile) .desk-head > div:last-child {
  display: flex !important; flex-wrap: wrap; gap: 8px !important;
  align-items: center; justify-content: flex-end;
  margin-left: auto !important; min-width: 0; max-width: 62%;
}
body:not(.is-mobile) .desk-head .head-user {
  max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 1100px) {
  body:not(.is-mobile) .desk-head .head-user { display: none; }
}
@media (max-width: 900px) {
  body:not(.is-mobile) .chat-list { width: 200px; }
  body:not(.is-mobile) .desk-head #skills-pref-btn,
  body:not(.is-mobile) .desk-head #idx-btn { display: none; }
}

/* Chat: list fixed, area fills remainder; inputbar centered OK; asset wall full */
body:not(.is-mobile) .chat-layout { width: 100%; min-width: 0; }
body:not(.is-mobile) .chat-area { flex: 1; min-width: 0; width: auto; }
body:not(.is-mobile) .chat-inputbar.imagine {
  max-width: 860px; align-self: center;
}
/* Asset wall must NOT inherit inputbar max-width / centering */
body:not(.is-mobile) .asset-wall,
body:not(.is-mobile) .asset-wall .aw-grid,
body:not(.is-mobile) .asset-wall .aw-viewer {
  max-width: none !important;
  width: 100% !important;
  align-self: stretch !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Mobile: compact status bar (override earlier wrap that makes it tall) */
body.is-mobile .m-status-bar {
  flex-wrap: nowrap !important;
  align-items: center !important;
  padding: 6px 10px !important;
  min-height: 44px;
  row-gap: 0 !important;
}
body.is-mobile .msb-title {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 14px !important;
  padding: 4px 2px !important;
}
body.is-mobile .msb-right { flex-wrap: nowrap !important; gap: 6px; }
body.is-mobile .msb-user-name {
  max-width: 64px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Mobile: avoid double-scroll traps */
body.is-mobile .main:has(.chat-layout) {
  overflow: hidden !important;
  height: 100%;
  display: flex; flex-direction: column;
}
body.is-mobile .chat-layout,
body.is-mobile .m-body-row,
body.is-mobile .m-right-pane,
body.is-mobile .chat-area {
  min-height: 0;
}
body.is-mobile .chat-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.is-mobile .asset-wall {
  overflow: hidden;
}
body.is-mobile .aw-grid {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}

/* Mobile works/wallet/assets: light consistent with chat */
body.is-mobile #wk-page.page,
body.is-mobile #asset-page.page,
body.is-mobile .page:has(.wallet-hero),
body.is-mobile #wallet-page,
body.is-mobile .main > .page {
  background: #f5f5f7;
  color: #111;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 14px 14px calc(24px + env(safe-area-inset-bottom, 0px));
  min-height: 100%;
  box-sizing: border-box;
}
body.is-mobile #wk-page .work-card,
body.is-mobile #asset-page .asset-card,
body.is-mobile .work-card,
body.is-mobile .asset-card {
  background: #fff;
  border-color: #e8e8ed;
  color: #111;
}
body.is-mobile .page-title { color: #111; }
body.is-mobile .page-desc,
body.is-mobile .page-sub { color: #8e8e93; }

/* Mobile attach thumbs not clipping */
body.is-mobile .attach-row {
  display: flex !important; flex-wrap: nowrap; gap: 8px;
  overflow-x: auto; overflow-y: hidden;
  padding: 6px 4px 4px;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
body.is-mobile .attach-thumb,
body.is-mobile .attach-chip {
  flex: none !important;
  width: 56px; height: 56px;
}
body.is-mobile .composer-plus,
body.is-mobile .composer-send {
  width: 36px !important; height: 36px !important;
  flex: none !important;
}

/* Mobile project rename/delete readable */
body.is-mobile .m-proj-btn {
  min-width: 36px; min-height: 32px;
  padding: 6px 10px !important;
  font-size: 13px !important;
}
body.is-mobile .m-proj-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Mobile asset wall light (keep Doubao look) */
body.is-mobile .asset-wall {
  background: #f5f5f7 !important;
  color: #111;
}
body.is-mobile .aw-head {
  background: #fff !important;
  border-bottom: 1px solid #eee !important;
  color: #111;
}
body.is-mobile .aw-head b { color: #111; }
body.is-mobile .aw-grid {
  background: #f5f5f7 !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 8px !important;
  padding: 10px !important;
}
body.is-mobile .aw-thumb {
  background: #fff !important;
  border-color: #eee !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.06) !important;
}
body.is-mobile .aw-viewer { background: #fff !important; color: #111; }
body.is-mobile .aw-qbtn {
  background: #f5f5f7; border-color: #e5e5ea; color: #333;
}
body.is-mobile .aw-qbtn.primary { background: #2f6bff; border-color: #2f6bff; color: #fff; }

/* Ensure chat-area fills when asset wall open */
body:not(.is-mobile) .chat-area { position: relative; overflow: hidden; }

/* lb-ops always-on：放大后操作条固定中下方，不自动隐藏 */
.lb-ops {
  position: fixed !important;
  bottom: max(18px, env(safe-area-inset-bottom, 0px)) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 8100 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  max-width: min(96vw, 720px) !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px !important;
}
.lb-ops.lb-hidden { opacity: 1 !important; pointer-events: auto !important; transform: translateX(-50%) !important; }
body.is-mobile .lb-ops { bottom: max(22px, env(safe-area-inset-bottom, 0px)) !important; }
body.is-mobile .lb-media img, body.is-mobile .lb-media video {
  max-width: 92vw; max-height: 72vh;
}
/* 聊天媒体再压一档（作品卡内图） */
body:not(.is-mobile) .m-body .img-cell img { max-height: 220px; }
body.is-mobile .m-body .work-card { min-width: 0 !important; max-width: 100% !important; }
body.is-mobile .m-body .img-grid { grid-template-columns: 1fr !important; }

/* ===== 电脑版布局：用户调试页导出配置 2026-09-16 ===== */
body:not(.is-mobile) {
  --desk-sidebar: 148px;
  --desk-proj: 160px;
  --desk-head: 40px;
  --desk-input: 56px;
  --desk-radius: 10px;
  --desk-msg-w: 180px;
  --desk-msg-h: 120px;
  --desk-bubble: 81%;
}
body:not(.is-mobile) .sidebar {
  width: var(--desk-sidebar) !important;
  padding: 12px 8px 10px !important;
}
body:not(.is-mobile) .chat-list {
  width: var(--desk-proj) !important;
  padding: 12px 8px !important;
}
body:not(.is-mobile) .desk-head,
body:not(.is-mobile) .chat-head.desk-head {
  min-height: var(--desk-head) !important;
  height: auto !important;
  padding: 6px 12px !important;
  gap: 8px !important;
}
body:not(.is-mobile) .desk-head .btn.sm {
  padding: 4px 8px !important;
  font-size: 11px !important;
}
body:not(.is-mobile) .chat-inputbar.imagine {
  margin: 0 14px 12px !important;
  max-width: min(920px, 100%) !important;
  width: calc(100% - 28px) !important;
  border-radius: var(--desk-radius) !important;
  padding: 8px 10px 6px !important;
  align-self: center;
}
body:not(.is-mobile) .chat-inputbar.imagine .textarea {
  min-height: 28px !important;
  max-height: 120px !important;
  font-size: 13px !important;
  padding: 4px 2px !important;
}
body:not(.is-mobile) .composer-shell {
  border-radius: var(--desk-radius) !important;
}
body:not(.is-mobile) .msg,
body:not(.is-mobile) .chat-scroll .msg {
  max-width: var(--desk-bubble) !important;
}
/* 消息媒体：自适应上限 + 可伸缩 */
body:not(.is-mobile) .msg-media img,
body:not(.is-mobile) .msg-media video {
  max-width: min(var(--desk-msg-w), 100%) !important;
  max-height: var(--desk-msg-h) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}
body:not(.is-mobile) .m-body .img-cell img {
  max-height: var(--desk-msg-h) !important;
  width: 100%;
  object-fit: contain !important;
}
body:not(.is-mobile) .m-body .work-card {
  max-width: min(420px, 100%) !important;
  min-width: 0 !important;
  padding: 10px !important;
}
/* 多图自动平铺 */
body:not(.is-mobile) .msg-media-tile {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
  gap: 8px;
  width: 100%;
  max-width: min(560px, 100%);
  margin: 4px 0 6px;
}
body:not(.is-mobile) .msg-media-tile .msg-media {
  display: block !important;
  margin: 0 !important;
  min-width: 0;
  width: 100%;
}
body:not(.is-mobile) .msg-media-tile .msg-media img,
body:not(.is-mobile) .msg-media-tile .msg-media video {
  width: 100% !important;
  max-width: 100% !important;
  max-height: var(--desk-msg-h) !important;
  height: auto !important;
  object-fit: contain !important;
}
body:not(.is-mobile) .img-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)) !important;
  gap: 8px !important;
}
body:not(.is-mobile) .aw-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
}
@media (max-width: 1100px) {
  body:not(.is-mobile) .chat-list { width: 150px !important; }
}
@media (max-width: 960px) {
  body:not(.is-mobile) .sidebar { width: 64px !important; }
}

/* ===== 手机版布局：用户调试页导出配置 2026-09-16 ===== */
body.is-mobile {
  --m-status: 46px;
  --m-input: 48px;
  --m-radius: 20px;
  --m-msg-w: 140px;
  --m-msg-h: 100px;
  --m-bubble: 96%;
  --m-pad: 20px;
}
body.is-mobile .m-status-bar {
  min-height: var(--m-status) !important;
  height: auto !important;
  padding: 8px 12px !important;
  align-items: center !important;
}
body.is-mobile .msb-title { font-size: 14px !important; }
body.is-mobile .chat-scroll,
body.is-mobile #chat-scroll {
  padding: var(--m-pad) !important;
}
body.is-mobile .msg,
body.is-mobile .chat-scroll .msg {
  max-width: var(--m-bubble) !important;
}
body.is-mobile .msg-media img,
body.is-mobile .msg-media video {
  max-width: min(var(--m-msg-w), 68vw) !important;
  max-height: var(--m-msg-h) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}
body.is-mobile .msg-media-tile {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 110px), 1fr));
  gap: 8px;
  width: 100%;
  max-width: min(100%, calc(var(--m-msg-w) * 1.5));
  margin: 6px 0 4px;
}
body.is-mobile .msg-media-tile .msg-media {
  display: block !important;
  margin: 0 !important;
  min-width: 0;
  width: 100%;
}
body.is-mobile .msg-media-tile .msg-media img,
body.is-mobile .msg-media-tile .msg-media video {
  width: 100% !important;
  max-width: 100% !important;
  max-height: var(--m-msg-h) !important;
}
body.is-mobile .m-body .img-cell img {
  max-height: var(--m-msg-h) !important;
  object-fit: contain !important;
}
body.is-mobile .m-body .img-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)) !important;
  gap: 8px !important;
}
body.is-mobile .chat-inputbar.imagine,
body.is-mobile .chat-inputbar {
  padding: 6px 10px calc(8px + var(--kb, 0px)) !important;
}
body.is-mobile .composer-shell {
  border-radius: var(--m-radius) !important;
  padding: 6px 8px 4px !important;
}
body.is-mobile .composer-shell .textarea {
  min-height: 22px !important;
  height: 22px;
  max-height: 110px !important;
  font-size: 16px !important;
  line-height: 1.35 !important;
  padding: 2px 4px !important;
}
body.is-mobile .composer-plus,
body.is-mobile .composer-send {
  width: 32px !important;
  height: 32px !important;
}
/* 输入条整体更贴 48px 量级 */
body.is-mobile #chat-inputbar.imagine {
  min-height: 0 !important;
}
body.is-mobile .m-input-meta {
  font-size: 11px !important;
  padding: 2px 4px 0 !important;
}

/* ===== 消息图再缩小 + 自适应平铺加强 ===== */
/* 电脑 */
body:not(.is-mobile) .msg-media img,
body:not(.is-mobile) .msg-media video {
  max-width: min(var(--desk-msg-w, 180px), 42vw, 100%) !important;
  max-height: var(--desk-msg-h, 120px) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}
body:not(.is-mobile) .msg-media-tile {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 110px), 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: min(420px, 100%) !important;
}
body:not(.is-mobile) .msg-media-tile .msg-media img,
body:not(.is-mobile) .msg-media-tile .msg-media video {
  width: 100% !important;
  max-width: 100% !important;
  max-height: var(--desk-msg-h, 120px) !important;
  height: auto !important;
}
body:not(.is-mobile) .m-body .img-cell img {
  max-height: var(--desk-msg-h, 120px) !important;
}
body:not(.is-mobile) .img-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)) !important;
  gap: 6px !important;
}

/* 手机 */
body.is-mobile .msg-media img,
body.is-mobile .msg-media video {
  max-width: min(var(--m-msg-w, 140px), 52vw, 100%) !important;
  max-height: var(--m-msg-h, 100px) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}
body.is-mobile .msg-media-tile {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 96px), 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
}
body.is-mobile .msg-media-tile .msg-media img,
body.is-mobile .msg-media-tile .msg-media video {
  width: 100% !important;
  max-width: 100% !important;
  max-height: var(--m-msg-h, 100px) !important;
}
body.is-mobile .m-body .img-cell img {
  max-height: var(--m-msg-h, 100px) !important;
}
body.is-mobile .img-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 100px), 1fr)) !important;
  gap: 6px !important;
}

/* ===== 生成图/视频：不被气泡框死，大图铺开 ===== */
/* 含作品卡的 AI 消息：气泡放宽，接近聊天区全宽 */
body:not(.is-mobile) .msg.ai:has(.work-card),
body:not(.is-mobile) .msg.ai:has(video) {
  max-width: min(760px, 94%) !important;
  width: 100%;
}
body.is-mobile .msg.ai:has(.work-card),
body.is-mobile .msg.ai:has(video) {
  max-width: 100% !important;
  width: 100%;
}
body:not(.is-mobile) .m-body .work-card,
body.is-mobile .m-body .work-card {
  max-width: 100% !important;
  min-width: 0 !important;
  width: 100% !important;
  padding: 12px !important;
}
/* 生成图：大图 contain，高度跟屏幕走 */
body:not(.is-mobile) .m-body .img-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important;
  gap: 10px !important;
}
body:not(.is-mobile) .m-body .img-cell {
  overflow: visible !important;
  background: #0a0a10 !important;
}
body:not(.is-mobile) .m-body .img-cell img {
  width: 100% !important;
  max-width: 100% !important;
  max-height: min(68vh, 640px) !important;
  height: auto !important;
  object-fit: contain !important;
  background: #111 !important;
}
body.is-mobile .m-body .img-grid {
  grid-template-columns: 1fr !important;
  gap: 8px !important;
}
body.is-mobile .m-body .img-cell img {
  width: 100% !important;
  max-width: 100% !important;
  max-height: min(55vh, 420px) !important;
  height: auto !important;
  object-fit: contain !important;
}
/* 生成视频：铺满作品卡 */
body:not(.is-mobile) .m-body .work-card video,
body:not(.is-mobile) .m-body [data-vidcard] video {
  width: 100% !important;
  max-width: 100% !important;
  max-height: min(68vh, 640px) !important;
  height: auto !important;
  object-fit: contain !important;
  background: #000 !important;
  border-radius: 10px;
}
body.is-mobile .m-body .work-card video,
body.is-mobile .m-body [data-vidcard] video {
  width: 100% !important;
  max-width: 100% !important;
  max-height: min(50vh, 360px) !important;
  height: auto !important;
  object-fit: contain !important;
}
/* 用户上传附件仍保持较小缩略（不抢生成图） */
body:not(.is-mobile) .msg-media-tile .msg-media img,
body:not(.is-mobile) .msg-media-tile .msg-media video,
body:not(.is-mobile) .msg.user .msg-media img,
body:not(.is-mobile) .msg.user .msg-media video {
  max-width: min(var(--desk-msg-w, 180px), 100%) !important;
  max-height: var(--desk-msg-h, 120px) !important;
}
body.is-mobile .msg-media-tile .msg-media img,
body.is-mobile .msg-media-tile .msg-media video,
body.is-mobile .msg.user .msg-media img,
body.is-mobile .msg.user .msg-media video {
  max-width: min(var(--m-msg-w, 140px), 100%) !important;
  max-height: var(--m-msg-h, 100px) !important;
}
/* 操作条在大图下常显一行 */
body:not(.is-mobile) .m-body .img-ops {
  opacity: 1 !important;
  position: static !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  padding: 8px 0 0 !important;
  background: none !important;
  justify-content: flex-start !important;
}

/* ===== 作品库/素材库：统一网格 + 框内整图（不裁脸） ===== */
#wk-page .work-grid,
.work-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 14px !important;
  align-items: stretch !important;
}
#wk-page .work-card,
.work-grid .work-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  margin: 0 !important;
  overflow: hidden !important;
}
#wk-page .work-card .wc-cover,
.work-grid .work-card .wc-cover {
  position: relative !important;
  flex: none !important;
  width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  background: #111 !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#wk-page .work-card .wc-cover img,
.work-grid .work-card .wc-cover img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  background: #111 !important;
}
#wk-page .work-card .wc-cover > div,
.work-grid .work-card .wc-cover > div {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #15151f !important;
}
#wk-page .work-card .wc-body,
.work-grid .work-card .wc-body {
  flex: 1 !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#asset-page .asset-grid,
.asset-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
  gap: 14px !important;
  align-items: stretch !important;
}
#asset-page .asset-card,
.asset-grid .asset-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  overflow: hidden !important;
}
#asset-page .asset-card img,
.asset-grid .asset-card img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center !important;
  background: #111 !important;
  flex: none !important;
}

#aw-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
  gap: 12px !important;
  align-items: stretch !important;
}
#aw-grid .aw-thumb {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}
#aw-grid .aw-media {
  aspect-ratio: 1 / 1 !important;
  min-height: 0 !important;
  max-height: none !important;
  width: 100% !important;
  background: #111 !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#aw-grid .aw-thumb img,
#aw-grid .aw-media > img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center !important;
  background: #111 !important;
}
body.is-mobile #wk-page .work-grid,
body.is-mobile .work-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
  gap: 10px !important;
}
body.is-mobile #asset-page .asset-grid,
body.is-mobile .asset-grid {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px !important;
}
body.is-mobile #aw-grid {
  grid-template-columns: repeat(2, 1fr) !important;
}

/* ===== layout-shell 整窗铺满（作品/素材少时也不缩栏） ===== */
#app > .layout-shell,
.layout-shell {
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  box-sizing: border-box;
}
body:not(.is-mobile) #wk-page,
body:not(.is-mobile) #asset-page {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}


/* ===== 创作左侧项目列表：接近作品库卡片 ===== */
.chat-list .proj-card {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 8px 8px !important;
  border-radius: 12px !important;
  white-space: normal !important;
  overflow: visible !important;
  border: 1px solid transparent;
  margin-bottom: 6px;
}
.chat-list .proj-card-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.chat-list .proj-card-ico {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--panel2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex: none;
}
.chat-list .proj-card-meta {
  min-width: 0; display: flex; flex-direction: column; gap: 2px;
}
.chat-list .proj-card .proj-name {
  font-size: 12px; font-weight: 600; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-list .proj-card-sub {
  font-size: 10px; color: var(--muted2);
}
.chat-list .proj-card .proj-del {
  opacity: 0.55 !important;
  font-size: 12px !important;
  padding: 4px 6px !important;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted2);
  flex: none;
}
.chat-list .proj-card:hover .proj-del,
.chat-list .proj-card.active .proj-del { opacity: 1 !important; }
.chat-list .proj-card .proj-del:hover {
  color: var(--danger);
  background: rgba(255,92,122,.12);
  border-radius: 8px;
}
body.is-mobile .chat-list .proj-card .proj-del { opacity: 1 !important; }

/* 作品库卡片操作：引用 / 下载 */
.wk-card-ops {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 2;
}
.wk-card-ops .btn.sm {
  padding: 3px 8px !important;
  font-size: 11px !important;
  background: rgba(0,0,0,.55) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
}
.work-card { position: relative; }

/* 作品库：去掉右下角积分浮标 / 角标（含遗留 desk-head / 浮层） */
body.route-works .credits-float,
body.route-works .float-credits,
body.route-works .credits-corner,
body.route-works #wk-credits,
body.route-works .wk-credits,
body.route-works .wk-credits-float,
body.route-works .head-credits,
body.route-works .desk-head .head-credits,
#wk-page .credits-float,
#wk-page .float-credits,
#wk-page .credits-corner,
#wk-page #wk-credits {
  display: none !important;
}
/* 作品库页不展示侧栏积分角标，避免右下/底部干扰 */
body.route-works .usercard .ucredits {
  display: none !important;
}

body.is-mobile .msb-back {
  flex: none; border: 1px solid #ddd; background: #f5f5f7; color: #111;
  border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 600;
}
body.is-mobile .msb-right { display: flex; align-items: center; gap: 8px; flex: none; }

/* ==== DESKTOP PRO (KaiPai-inspired, PC only) ==== */
/* 灵感：开拍 kaipai.tv —— 专业暗色工作台、点阵底、细导航、丝滑过渡；仅电脑端，手机保持现有逻辑 */
body:not(.is-mobile) {
  --bg: #07070c;
  --bg2: #0c0c12;
  --panel: #12121a;
  --panel2: #181822;
  --border: rgba(255,255,255,.06);
  --border2: rgba(255,255,255,.1);
  --text: #f2f2f7;
  --muted: #9a9aad;
  --muted2: #6b6b80;
  --accent: #ff7a1a;
  --accent2: #ff9a4a;
  --accent-grad: linear-gradient(135deg, #ff8a2b, #ff5c00);
  --radius: 12px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0,0,0,.55);
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}
body:not(.is-mobile) .layout-shell {
  background: #07070c;
}
body:not(.is-mobile) .main {
  background-color: #07070c;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255,122,26,.08), transparent 55%),
    radial-gradient(circle, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: auto, 22px 22px;
  background-attachment: local;
}
body:not(.is-mobile) .sidebar {
  width: 228px;
  background: rgba(10,10,14,.92);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(255,255,255,.07);
  padding: 16px 12px 12px;
}
body:not(.is-mobile) .logo { padding: 6px 8px 20px; gap: 12px; }
body:not(.is-mobile) .logo-mark {
  width: 32px; height: 32px; border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(255,122,26,.35), 0 6px 18px rgba(255,122,26,.25);
}
body:not(.is-mobile) .logo-name {
  font-size: 15px; font-weight: 700; letter-spacing: .02em;
}
body:not(.is-mobile) .logo-sub {
  font-size: 11px; color: var(--muted2); margin-top: 2px;
}
body:not(.is-mobile) .nav-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em;
  color: #5c5c70; padding: 16px 10px 6px;
}
body:not(.is-mobile) .nav-item {
  padding: 9px 12px; border-radius: 10px; gap: 11px;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
body:not(.is-mobile) .nav-item:hover {
  background: rgba(255,255,255,.04); color: #fff; transform: translateX(1px);
}
body:not(.is-mobile) .nav-item.active {
  color: #fff;
  background: rgba(255,122,26,.12);
  border-color: rgba(255,122,26,.35);
  box-shadow: inset 0 0 0 1px rgba(255,122,26,.15);
}
body:not(.is-mobile) .btn {
  transition: background .2s ease, border-color .2s ease, transform .15s ease, box-shadow .2s ease, filter .15s;
  border-radius: 10px;
}
body:not(.is-mobile) .btn:hover { transform: translateY(-1px); }
body:not(.is-mobile) .btn.primary {
  background: #fff; color: #111; border: none; font-weight: 650;
  box-shadow: 0 4px 16px rgba(255,255,255,.12);
}
body:not(.is-mobile) .btn.primary:hover {
  filter: none; background: #f0f0f0; box-shadow: 0 6px 22px rgba(255,255,255,.18);
}
body:not(.is-mobile) .btn.sm { border-radius: 8px; }

/* 创作台顶栏 */
body:not(.is-mobile) .desk-head {
  align-items: center; gap: 10px;
  padding: 10px 18px;
  background: rgba(10,10,14,.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: sticky; top: 0; z-index: 12;
}
body:not(.is-mobile) .proj-title-btn {
  font-size: 14px; font-weight: 650; letter-spacing: .01em;
  background: transparent; border: none; color: var(--text);
}
body:not(.is-mobile) .head-credits {
  font-variant-numeric: tabular-nums; color: var(--accent2);
}

/* 项目列表 */
body:not(.is-mobile) .chat-list {
  background: rgba(8,8,12,.85);
  border-right: 1px solid rgba(255,255,255,.06);
  padding: 14px 10px;
}
body:not(.is-mobile) .chat-item {
  border-radius: 10px; transition: background .18s ease, color .18s ease;
}
body:not(.is-mobile) .chat-item:hover,
body:not(.is-mobile) .chat-item.active {
  background: rgba(255,255,255,.05);
}

/* 消息区 */
body:not(.is-mobile) .chat-msgs {
  padding: 22px 28px 12px;
}
body:not(.is-mobile) .msg .m-body {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.06);
  transition: border-color .2s ease;
}
body:not(.is-mobile) .msg.ai .m-body {
  background: rgba(18,18,26,.9);
}
body:not(.is-mobile) .msg.user .m-body {
  background: rgba(255,122,26,.1);
  border-color: rgba(255,122,26,.22);
}

/* 模式胶囊 + 输入区 */
body:not(.is-mobile) .mode-mini {
  gap: 8px; padding: 8px 4px 6px;
}
body:not(.is-mobile) .mpill {
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .15s;
}
body:not(.is-mobile) .mpill:hover {
  background: rgba(255,255,255,.06); color: #fff; transform: translateY(-1px);
}
body:not(.is-mobile) .mpill.active {
  background: #fff !important; color: #111 !important; border-color: #fff !important;
  font-weight: 650;
}
body:not(.is-mobile) .chat-inputbar.imagine {
  padding: 8px 18px 18px;
  background: linear-gradient(180deg, transparent, rgba(7,7,12,.92) 28%);
}
body:not(.is-mobile) .composer-shell {
  background: rgba(16,16,22,.92);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 10px 12px 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
  transition: border-color .2s ease, box-shadow .2s ease;
}
body:not(.is-mobile) .composer-shell:focus-within {
  border-color: rgba(255,122,26,.45);
  box-shadow: 0 10px 36px rgba(0,0,0,.4), 0 0 0 1px rgba(255,122,26,.2);
}
body:not(.is-mobile) .composer-shell .textarea {
  background: transparent; border: none; min-height: 48px;
  padding: 6px 4px; font-size: 14.5px; line-height: 1.55;
}
body:not(.is-mobile) .composer-shell .textarea:focus { outline: none; box-shadow: none; }
body:not(.is-mobile) .composer-plus {
  background: rgba(255,255,255,.06); transition: background .18s, transform .15s;
}
body:not(.is-mobile) .composer-plus:hover { background: rgba(255,255,255,.12); transform: scale(1.04); }
body:not(.is-mobile) .composer-send {
  background: #fff; color: #111; border: none;
  width: 36px; height: 36px; border-radius: 50%;
  font-weight: 700; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .15s;
  box-shadow: 0 4px 14px rgba(255,255,255,.15);
}
body:not(.is-mobile) .composer-send:hover {
  transform: scale(1.06); background: #f3f3f3;
}

/* 卡片 / 页面 */
body:not(.is-mobile) .card {
  background: rgba(16,16,22,.88);
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
  transition: border-color .2s ease, transform .2s ease;
}
body:not(.is-mobile) .card:hover { border-color: rgba(255,255,255,.12); }
body:not(.is-mobile) .page-title { letter-spacing: .02em; font-weight: 700; }
body:not(.is-mobile) .page-desc { color: var(--muted); line-height: 1.7; }

/* 作品/素材墙 */
body:not(.is-mobile) .work-card,
body:not(.is-mobile) .result-item {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.07);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
body:not(.is-mobile) .work-card:hover,
body:not(.is-mobile) .result-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255,122,26,.35);
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
}

/* 滚动条更细 */
body:not(.is-mobile) ::-webkit-scrollbar { width: 6px; height: 6px; }
body:not(.is-mobile) ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12); border-radius: 99px;
}


/* ========== P0 capsule composer (本机工作台风格) + agent-only ========== */
.mode-mini {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 8px;
}
.mode-mini .mpill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 13px;
  background: transparent; color: var(--muted); border: 1px solid transparent;
  cursor: default;
}
.mode-mini .mpill.active {
  background: linear-gradient(135deg, #5b8cff, #7c5cff);
  color: #fff; border: none; font-weight: 600;
}
/* Hide non-agent pills if any leftover */
.mode-mini .mpill:not([data-mode="auto"]):not(.active) { display: none !important; }

.chat-inputbar.imagine.capsule,
.chat-inputbar.capsule {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 8px 12px 10px !important;
  max-width: min(920px, 100%) !important;
}

.composer-shell.capsule-shell {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  background: #2a2a2e !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 28px !important;
  padding: 12px 12px 10px !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.28) !important;
  color: #f2f2f7 !important;
}

.composer-shell.capsule-shell .textarea {
  width: 100% !important;
  min-height: 44px !important;
  max-height: 160px !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #f5f5f7 !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
  padding: 4px 8px 2px !important;
  resize: none !important;
}
.composer-shell.capsule-shell .textarea::placeholder {
  color: #8e8e93 !important;
}

.composer-shell.capsule-shell .composer-toolbar {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 2px 2px 0 !important;
}

.composer-shell.capsule-shell .composer-plus {
  width: 36px !important; height: 36px !important; min-width: 36px !important;
  border-radius: 50% !important; border: none !important;
  background: rgba(255,255,255,.12) !important; color: #f2f2f7 !important;
  font-size: 22px !important; font-weight: 400 !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  cursor: pointer !important;
}
.composer-shell.capsule-shell .composer-plus:hover {
  background: rgba(255,255,255,.2) !important;
}

.composer-shell.capsule-shell .composer-send {
  display: inline-flex !important;
  width: 36px !important; height: 36px !important; min-width: 36px !important;
  border-radius: 50% !important; border: none !important;
  background: #ffffff !important; color: #111 !important;
  font-size: 18px !important; font-weight: 700 !important;
  align-items: center !important; justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
}
.composer-shell.capsule-shell .composer-send:hover {
  filter: brightness(0.96);
}

/* 禁止麦克风/语音按钮（若历史残留） */
.composer-mic, .composer-voice, #chat-mic, button[aria-label*="语音"], button[title*="语音"], button[title*="麦克风"] {
  display: none !important;
}

/* 桌面旧发送条隐藏，统一胶囊发送 */
.desktop-only-actions { display: none !important; }

.m-input-meta {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 0; font-size: 12px; color: var(--muted);
}
.m-input-meta .chat-tip { flex: 1; text-align: right; opacity: .85; }

/* 手机同样深色胶囊，不再用浅灰大框 */
body.is-mobile .chat-inputbar.imagine,
body.is-mobile .chat-inputbar {
  background: transparent !important;
  border-top: none !important;
  padding: 8px 12px calc(10px + var(--kb, 0px)) !important;
}
body.is-mobile .composer-shell,
body.is-mobile .composer-shell.capsule-shell {
  background: #2a2a2e !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 28px !important;
  padding: 10px 10px 8px !important;
  box-shadow: 0 6px 20px rgba(0,0,0,.25) !important;
}
body.is-mobile .composer-shell .textarea,
body.is-mobile .composer-shell.capsule-shell .textarea {
  color: #f5f5f7 !important;
  background: transparent !important;
  font-size: 16px !important;
}
body.is-mobile .composer-shell .textarea::placeholder {
  color: #8e8e93 !important;
}
body.is-mobile .composer-plus {
  background: rgba(255,255,255,.12) !important; color: #f2f2f7 !important;
}
body.is-mobile .composer-send {
  display: inline-flex !important;
  background: #ffffff !important; color: #111 !important;
}
body.is-mobile .m-input-meta { color: #8e8e93; }

/* 空场次不留灰条 */
.scene-item:empty { display: none !important; margin: 0 !important; padding: 0 !important; border: none !important; }
.script-scene:empty { display: none !important; }

/* agent 单模式：参数行默认隐藏（auto） */
#params-row:empty { display: none !important; }


/* 登录/注册合规说明：小字灰提示，不挡表单 */
.auth-compliance {
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted2, #8b93a7);
  margin: 12px 0 0;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}
.auth-card .auth-compliance { max-width: 100%; }
