/* Centrol 页面外壳（2026-12-02）：左侧边栏 + AI 对话区 + 右侧文档面板怎么拼。
 * 引用顺序：tokens.css → components.css → cards.css → shell.css。
 * 只用 tokens.css 的变量。对话区的消息、头像、输入框沿用 components.css 已有的
 *   .chat .top .thread .col .msg.me .msg.ai .av .body .composer，这里只补首页稿里有、规范里没有的几样。
 *
 * 目录
 *   整页：.app  .app-main  .app-panel
 *   左侧边栏：.sidebar  .sb-logo  .sb-brand（.sb-menu）  .sb-new  .sb-label  .sb-item（.on .sb-n）
 *            .sb-camp（.dot.live / .dot.wait）  .sb-more  .sb-status（.led）  .sb-me
 *   AI 对话区：.top .brand-title  .sender  .runbar .run-pill  .day  .bgrun  .ask .ask-bar
 */

/* ───────── 整页：深色底上放侧栏，右边一块左侧带圆角的浅色主区 ───────── */
.app { display: flex; background: var(--bg-nav); min-height: 100%; }
.app-main { flex: 1; min-width: 0; display: flex; background: var(--bg-page); border-radius: var(--r-panel) 0 0 var(--r-panel); margin: var(--sp-2) 0; overflow: hidden; }
.app-main > .chat { flex: 1; min-width: var(--w-chat-min); border-radius: 0; background: transparent; }
/* 面板打开时对话区只剩 400px：顶栏不放发信邮箱，放不下就换行 */
.with-panel .top .sender { display: none; }
.with-panel .top { flex-wrap: wrap; }
/* 右侧文档面板：固定宽，里面放一张文档卡（cards.css 的 .mdoc） */
.app-panel { width: var(--w-panel); flex: none; display: flex; padding: var(--sp-3); background: var(--bg-section); border-left: 1px solid var(--c-line); }
.app-panel > .mdoc { flex: 1; min-height: 0; }

/* ───────── 左侧边栏 ───────── */
.sidebar { width: var(--w-sidebar); flex: none; display: flex; flex-direction: column; padding: var(--sp-5) var(--sp-3); background: var(--bg-nav); color: var(--text-on-dark); }
.sb-logo { display: flex; align-items: center; gap: var(--sp-2); font: 400 var(--fs-logo)/1 var(--font-display); margin: 0 var(--sp-2) var(--sp-5); }
.sb-logo svg { width: 1.05em; height: 1.05em; }
/* 品牌切换：描边按钮 + 白色下拉菜单 */
.sb-brand { position: relative; margin-bottom: var(--sp-3); }
.sb-brand > a { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line-on-dark); border-radius: var(--r-item); color: var(--text-on-dark); text-decoration: none; cursor: pointer; }
.sb-brand > a:hover { background: var(--c-plum-850); }
.sb-brand .logo { width: var(--sz-avatar); height: var(--sz-avatar); border-radius: var(--r-sm); background: var(--c-cream); color: var(--c-plum-950); display: grid; place-items: center; font-size: var(--fs-sm); font-weight: 700; flex: none; }
.sb-brand b { display: block; font-size: var(--fs-md); font-weight: 600; }
.sb-brand small { display: block; font-size: var(--fs-xs); color: var(--text-on-dark-faint); }
.sb-brand .caret { margin-left: auto; color: var(--text-on-dark-faint); font-size: var(--fs-sm); }
.sb-brand .n { position: absolute; top: calc(-1 * var(--sp-2)); right: calc(-1 * var(--sp-2)); }
.sb-menu { display: none; position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + var(--sp-1)); background: var(--bg-card); color: var(--text); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: var(--sp-2); }
.sb-brand.open .sb-menu { display: block; }
.sb-menu .lbl { font-size: var(--fs-xs); letter-spacing: .08em; color: var(--text-muted); padding: var(--sp-1) var(--sp-2); }
.sb-menu a { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2); border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-size: var(--fs-small); }
.sb-menu a:hover { background: var(--c-cream); }
.sb-menu a.cur { background: var(--c-sand); font-weight: 600; }
.sb-menu a .sb-n { margin-left: auto; }
/* 新建活动：侧栏里唯一的大入口 */
.sb-new { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-item); background: var(--c-plum-800); color: var(--text-on-dark); font-size: var(--fs-md); font-weight: 500; text-decoration: none; }
.sb-new:hover { background: var(--c-plum-700); }
.sb-new i { width: var(--sp-5); height: var(--sp-5); border-radius: var(--r-xs); background: var(--c-coral); color: var(--c-plum-950); display: grid; place-items: center; font-style: normal; font-weight: 700; }
/* 分组小标题 */
.sb-label { font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-on-dark-faint); margin: var(--sp-5) var(--sp-3) var(--sp-2); }
/* 导航项：默认 / 悬停 / 选中 / 带角标 */
.sb-item { position: relative; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); margin-bottom: 2px; border-radius: var(--r-item); color: var(--text-on-dark-muted); font-size: var(--fs-md); text-decoration: none; cursor: pointer; }
.sb-item .ic { width: var(--sz-icon); text-align: center; flex: none; opacity: .8; }
.sb-item:hover, .sb-item.is-hover { background: var(--c-plum-850); color: var(--text-on-dark); }
.sb-item.on { background: var(--c-plum-600); color: var(--text-on-dark); }
.sb-item.on::before { content: ""; position: absolute; left: calc(-1 * var(--sp-2)); top: var(--sp-2); bottom: var(--sp-2); width: 3px; border-radius: 2px; background: var(--c-coral); }
.sb-item small { margin-left: auto; font-size: var(--fs-xs); color: var(--text-on-dark-faint); }
/* 角标：等你处理的件数，只写数字 */
.sb-n { margin-left: auto; min-width: var(--sp-5); text-align: center; font-size: var(--fs-xs); font-weight: 700; border-radius: var(--r-pill); padding: 2px var(--sp-2); background: var(--c-coral); color: var(--c-plum-950); }
/* 活动列表：前面一个状态点 */
.sb-camp .dot { width: var(--sz-dot); height: var(--sz-dot); border-radius: 50%; flex: none; margin: 0 6px; }
.sb-camp .dot.live { background: var(--c-lime); }
.sb-camp .dot.wait { background: var(--c-coral); }
.sb-more { display: block; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); color: var(--text-on-dark-faint); text-decoration: none; }
.sb-more:hover { color: var(--text-on-dark); }
/* 底部：连接状态、额度、账号 */
.sb-status { margin-top: auto; padding-bottom: var(--sp-2); }
.sb-status .sb-item { font-size: var(--fs-sm); }
.sb-status .led { width: var(--sz-dot); height: var(--sz-dot); border-radius: 50%; background: var(--c-lime); flex: none; margin: 0 6px; }
.sb-me { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-2) 0; border-top: 1px solid var(--line-on-dark); font-size: var(--fs-small); }
.sb-me .face { width: var(--sz-avatar); height: var(--sz-avatar); border-radius: 50%; background: var(--c-lime); color: var(--c-plum-950); display: grid; place-items: center; font-weight: 600; flex: none; }
.sb-me small { display: block; font-size: var(--fs-xs); color: var(--text-on-dark-faint); }
.sb-me .gear { margin-left: auto; color: var(--text-on-dark-faint); text-decoration: none; }

/* ───────── AI 对话区：顶栏、运行中条、日期分隔、后台在跑、输入框 ───────── */
.top .brand-title { font: 400 var(--fs-h2-doc) var(--font-display); white-space: nowrap; }
.top .prog { white-space: nowrap; }
.sender { margin-left: auto; display: inline-flex; align-items: center; gap: var(--sp-2); background: var(--c-sand); border-radius: var(--r-pill); padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); color: var(--text-muted); white-space: nowrap; }
.sender b { color: var(--text); font-weight: 600; }
.top .sender + .prog { margin-left: 0; }
/* 运行中条：顶栏下面一行，每个后台任务一个胶囊 */
.runbar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; padding: var(--sp-2) var(--sp-5); border-bottom: 1px solid var(--c-line); font-size: var(--fs-sm); color: var(--text-muted); }
.run-pill { display: inline-flex; align-items: center; gap: var(--sp-2); background: var(--bg-card); border: 1px solid var(--c-line); border-radius: var(--r-pill); padding: var(--sp-1) var(--sp-3); }
.run-pill b { color: var(--text); font-weight: 600; }
.run-pill i { width: var(--sp-7); height: 5px; border-radius: var(--r-pill); background: var(--c-line); overflow: hidden; display: block; }
.run-pill i u { display: block; height: 100%; background: var(--c-coral); }
/* 日期分隔 */
.day { text-align: center; font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin: var(--sp-1) 0 var(--sp-5); }
/* 消息里嵌卡片：卡片之间 8px，卡片和下一条消息 16px（卡片本身用 cards.css 的组件） */
.msg.ai .body > .pick-card, .msg.ai .body > .mdoc { margin: var(--sp-2) 0; }
.msg.ai .body > :last-child { margin-bottom: 0; }
/* 消息里的文字链（「查看」）：珊瑚字、加粗，不做成按钮 */
.msg .body .lnk { color: var(--c-coral); font-weight: 600; cursor: pointer; text-decoration: none; }
/* 后台在跑：一行灰字，前面一个转圈 */
.bgrun { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-4) 40px; font-size: var(--fs-sm); color: var(--text-muted); }
.bgrun i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--c-coral); border-top-color: transparent; animation: c-spin 1s linear infinite; flex: none; }
/* 底部输入框：白卡，上面多行输入，下面一排「上传 + 快捷句 + 发送」 */
.ask { max-width: var(--w-col); margin: 0 auto; background: var(--bg-card); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: var(--sp-4) var(--sp-4) var(--sp-3) var(--sp-5); border: 1.5px solid transparent; }
.ask:focus-within, .ask.is-focus { border-color: var(--c-coral-soft); }
.ask textarea { display: block; width: 100%; height: var(--sp-7); border: 0; outline: 0; resize: none; background: transparent; font: var(--fs-md)/var(--lh-body) var(--font-body); color: var(--text); }
.ask textarea::placeholder { color: var(--c-placeholder); }
.ask-bar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }
.ask-bar .qb { border: 1px solid var(--c-line); background: var(--bg-page); color: var(--text); border-radius: var(--r-pill); padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); }
.ask-bar .qb:hover { border-color: var(--c-plum-950); }
.ask-bar .up { width: var(--sz-avatar); height: var(--sz-avatar); border-radius: 50%; border: 1px solid var(--c-line); background: var(--bg-card); color: var(--text-muted); display: grid; place-items: center; padding: 0; }
.ask-bar .btn-secondary { margin-left: auto; }

/* ───────── 外壳用的线性图标（写法同 components.css 的 .icon：<i class="icon icon-home"></i>） ───────── */
.sb-item .icon, .sb-me .icon { width: 16px; height: 16px; }
.icon-home { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5'/%3E%3Cpath d='M5 9.5V20h14V9.5'/%3E%3C/svg%3E"); }
.icon-users { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0'/%3E%3Cpath d='M16 4.5a3.5 3.5 0 0 1 0 7'/%3E%3Cpath d='M18 14.5a6.5 6.5 0 0 1 3.5 5.5'/%3E%3C/svg%3E"); }
.icon-settings { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E"); }
.icon-plus { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.icon-clip { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 11-8.6 8.6a5 5 0 0 1-7.1-7.1l8.6-8.6a3.3 3.3 0 0 1 4.7 4.7l-8.6 8.6a1.7 1.7 0 0 1-2.4-2.4l7.9-7.9'/%3E%3C/svg%3E"); }
.icon-coin { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v10M9.5 9.5h4a1.5 1.5 0 0 1 0 3h-3a1.5 1.5 0 0 0 0 3h4'/%3E%3C/svg%3E"); }
