/* ============================================================
   人才发展 Agent · 对话工作台样式
   深色科技感 · 蓝紫主色 · 玻璃拟态 · motion-anything 动效集成
   令牌源自 ~/zstd/app/styles.css 蓝色系(深色变体),只读参考
   ============================================================ */

/* ---------- 1. Design Tokens(深色变体)---------- */
:root {
  /* 背景与表面 */
  --bg:        #070a14;
  --bg-2:      #0b0f1e;
  --surface:   rgba(255,255,255,.045);
  --surface-2: rgba(255,255,255,.07);
  --surface-3: rgba(255,255,255,.10);
  --border:        rgba(255,255,255,.09);
  --border-strong: rgba(255,255,255,.16);

  /* 文字 */
  --text:   #e8eaf2;
  --text-2: #9aa1b4;   /* 次文字 */
  --text-3: #656c80;   /* 更弱 */

  /* 主色(蓝)+ 强调(紫/青,与 aurora 一致) */
  --primary:   #3B82F6;
  --primary-2: #60A5FA;
  --primary-3: #1D4ED8;
  --primary-soft: rgba(59,130,246,.16);
  --accent:  #8b7cf6;   /* motion 配方自带紫 */
  --accent-2:#22D3EE;   /* 青 */

  /* 语义色(深色提亮) */
  --success: #22c55e;  --success-bg: rgba(34,197,94,.14);
  --warning: #f59e0b;  --warning-bg: rgba(245,158,11,.14);
  --danger:  #ef4444;  --danger-bg:  rgba(239,68,68,.14);
  --info:    #22D3EE;  --info-bg:    rgba(34,211,238,.14);

  /* 间距 / 圆角 / 阴影 */
  --sp-xs:4px; --sp-sm:8px; --sp-md:16px; --sp-lg:24px; --sp-xl:32px;
  --r-sm:8px; --r-md:14px; --r-lg:18px; --r-full:999px;
  --sh-sm: 0 1px 2px rgba(0,0,0,.3);
  --sh-md: 0 8px 30px rgba(0,0,0,.45);
  --sh-glow: 0 0 0 1px rgba(59,130,246,.25), 0 8px 40px rgba(59,130,246,.18);

  --font: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---------- 2. Reset / Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px; line-height: 22px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  letter-spacing: .005em;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--text); }
ul { list-style: none; }
::selection { background: rgba(59,130,246,.35); color: #fff; }
:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; border-radius: 4px; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; transition: background .2s; }
::-webkit-scrollbar-thumb:hover { background: rgba(96,165,250,.3); background-clip: content-box; }

/* ---------- 3. 背景层 ---------- */
.aurora {
  position: fixed; inset: 0; z-index: 0;
  opacity: .5; pointer-events: none;
  mix-blend-mode: screen;
}
/* 整体内容浮于背景之上 */
.app { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100vh; }

/* ---------- 4. 顶部栏 ---------- */
.topbar {
  flex: 0 0 60px; height: 60px;
  display: flex; align-items: center; gap: var(--sp-lg);
  padding: 0 var(--sp-lg);
  background: rgba(11,15,30,.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 5;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; }
.topbar .logo {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--primary-2), var(--primary-3));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 4px 16px rgba(59,130,246,.45), 0 0 0 1px rgba(96,165,250,.2);
  animation: logo-glow 3.5s ease-in-out infinite;
}
@keyframes logo-glow { 0%, 100% { box-shadow: 0 4px 16px rgba(59,130,246,.4), 0 0 0 1px rgba(96,165,250,.2); } 50% { box-shadow: 0 6px 24px rgba(59,130,246,.65), 0 0 0 1px rgba(96,165,250,.4); } }
.topbar .name { font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.topbar .ver { font-size: 10px; font-weight: 700; color: var(--primary-2); background: var(--primary-soft); padding: 2px 6px; border-radius: var(--r-sm); }
.topbar .status { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.topbar .status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.topbar .actions { display: flex; align-items: center; gap: var(--sp-sm); }
.topbar .icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: grid; place-items: center; color: var(--text-2);
  transition: background .18s, color .18s, transform .18s;
}
.topbar .icon-btn:hover { background: var(--surface-2); color: var(--text); transform: translateY(-1px); }
.topbar .icon-btn:active { transform: translateY(0) scale(.95); }
.topbar .user { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border-radius: var(--r-full); transition: background .18s; }
.topbar .user:hover { background: var(--surface-2); }
.topbar .user .avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg,var(--accent),var(--primary-3)); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.topbar .user .uname { font-size: 13px; color: var(--text-2); }

/* attention 呼吸点(自研,覆盖任何同名配方) */
.dot.attention { box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: atten-pulse 2s ease-out infinite; }
@keyframes atten-pulse { 0%{box-shadow:0 0 0 0 rgba(34,197,94,.55)} 70%{box-shadow:0 0 0 8px rgba(34,197,94,0)} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0)} }

/* ---------- 5. 主体布局 ---------- */
.aiws { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr; }
.aiws.has-rail { grid-template-columns: 1fr 340px; }
.aiws:not(.has-rail) .rail { display: none; }
.aiws.has-rail .rail { animation: rail-in .45s cubic-bezier(.16,1,.3,1) both; }
@keyframes rail-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* 5.1 对话列 */
.chat-col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.chat-head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 18px 28px 16px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(11,15,30,.4), transparent);
}
.chat-head .ai-avatar {
  width: 42px; height: 42px; border-radius: var(--r-md); flex: 0 0 42px;
  background: linear-gradient(135deg, var(--accent), var(--primary-3));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 22px rgba(99,102,241,.4);
}
.ch-meta .ch-t { font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.ch-meta .ch-s { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* 5.2 消息体 */
.chat-body { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 28px 12px; scroll-behavior: smooth; }

/* 消息行 */
.msg { display: flex; gap: 12px; margin-bottom: 22px; max-width: 880px; }
.msg .av { width: 32px; height: 32px; border-radius: var(--r-sm); flex: 0 0 32px; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.msg.ai .av { background: linear-gradient(135deg,var(--accent),var(--primary-3)); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.35); }
.msg.user { flex-direction: row-reverse; margin-left: auto; }
.msg.user .av { background: var(--surface-2); color: var(--text-2); }
.msg .bubble {
  padding: 12px 16px; border-radius: var(--r-md); font-size: 14px; line-height: 24px;
  border: 1px solid var(--border);
}
.msg.ai .bubble { background: rgba(255,255,255,.05); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top-left-radius: 4px; }
.msg.user .bubble { background: linear-gradient(135deg, var(--primary), var(--primary-3)); border-color: transparent; border-top-right-radius: 4px; color: #fff; box-shadow: 0 4px 18px rgba(59,130,246,.3); }
.msg .bubble b { color: var(--primary-2); font-weight: 600; }
.msg.user .bubble b { color: #fff; }

/* 消息入场(fade-in-up + 微缩放 + 模糊,自研以保证动态消息可靠) */
.msg.in { animation: msg-in .5s cubic-bezier(.16,1,.3,1) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(16px) scale(.985); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

/* 打字光标 */
.caret { display: inline-block; width: 8px; height: 1.05em; vertical-align: -2px; margin-left: 2px; background: var(--primary-2); border-radius: 1px; animation: caret-blink 1s steps(2) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }

/* 思考态(骨架 + 文字) */
.thinking { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); border-top-left-radius: 4px; font-size: 13px; color: var(--text-2); }
.thinking .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--primary-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.thinking .skel-line { flex: 1; height: 10px; border-radius: 99px; max-width: 160px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { 0%{background-position:100% 50%} 100%{background-position:0 50%} }

/* 执行步骤行(像 Codex 的 ▸ running…) */
.step-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 6px 44px; padding: 8px 12px; font-size: 12px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); width: fit-content; max-width: 520px; }
.step-row .ic { width: 14px; height: 14px; display: grid; place-items: center; color: var(--primary-2); }
.step-row .ic.spin-c { border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--primary-2); animation: spin .8s linear infinite; }
.step-row.done { color: var(--text-3); }
.step-row.done .ic { color: var(--success); }
.step-row.in { animation: msg-in .3s ease-out both; }

/* ---------- 6. Artifact 卡(套 .spotlight)---------- */
.artifact { margin-top: 12px; margin-bottom: 22px; border-radius: var(--r-lg); }
.artifact .spotlight { transition: border-color .3s, box-shadow .3s, transform .3s; }
.artifact:hover .spotlight { border-color: rgba(139,124,246,.3); box-shadow: 0 6px 20px rgba(0,0,0,.2), 0 0 0 1px rgba(139,124,246,.08); }
.artifact.in { animation: art-in .5s cubic-bezier(.16,1,.3,1) both; }
@keyframes art-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.artifact .a-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--border);
}
.artifact .a-head .a-t { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.artifact .a-head .a-t svg { width: 16px; height: 16px; color: var(--primary-2); }
.artifact .a-type { font-size: 11px; color: var(--text-3); background: var(--surface-2); padding: 3px 9px; border-radius: var(--r-full); }
.artifact .a-body { padding: 16px 18px; }
.artifact .a-body.flush { padding: 0; }
.artifact .a-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); }
.artifact .a-foot .muted { font-size: 12px; color: var(--text-3); }

/* 通用小部件 */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 10px; border-radius: var(--r-full); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); transition: background .15s, border-color .15s, transform .12s; }
.chip:hover { transform: translateY(-1px); }
.chip .lvl { font-size: 10px; font-weight: 700; color: var(--primary-2); background: var(--primary-soft); padding: 1px 5px; border-radius: 99px; }
.chip.gap { background: var(--danger-bg); border-color: rgba(239,68,68,.3); color: var(--danger); }
.chip.met { background: var(--success-bg); border-color: rgba(34,197,94,.3); color: var(--success); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 2px 8px; border-radius: var(--r-sm); }
.tag .tdot { width: 6px; height: 6px; border-radius: 50%; }
.tag.draft  { background: var(--surface-2); color: var(--text-3); } .tag.draft .tdot{ background: var(--text-3); }
.tag.run    { background: var(--warning-bg); color: var(--warning); } .tag.run .tdot{ background: var(--warning); }
.tag.done   { background: var(--success-bg); color: var(--success); } .tag.done .tdot{ background: var(--success); }
.tag.suggest{ background: var(--primary-soft); color: var(--primary-2); } .tag.suggest .tdot{ background: var(--primary-2); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500; transition: background .18s, border-color .18s, color .18s, transform .12s, box-shadow .18s; white-space: nowrap; }
.btn svg { width: 14px; height: 14px; }
.btn:active { transform: translateY(1px) scale(.97); }
.btn.primary { background: linear-gradient(135deg,var(--primary),var(--primary-3)); color: #fff; }
.btn.primary:hover { box-shadow: 0 6px 20px rgba(59,130,246,.5); transform: translateY(-1px); }
.btn.ghost { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn.danger { color: var(--danger); }
.btn.adopted { opacity: .55; pointer-events: none; }
.a-type.adopted-tag { background: var(--success-bg) !important; color: var(--success); border: 1px solid rgba(34,197,94,.3); }

/* 6.1 组织结构矩阵 */
.mini-grid { display: grid; gap: 4px; font-size: 12px; }
.mini-grid .mc { padding: 10px 8px; border-radius: var(--r-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; border: 1px solid var(--border); background: var(--surface); }
.mini-grid .mc.head { background: transparent; border-color: transparent; color: var(--text-3); font-weight: 600; font-size: 11px; min-height: 24px; }
.mini-grid .mc .n { font-size: 15px; font-weight: 700; color: var(--text); }
.mini-grid .mc .n.zero { color: var(--text-3); }
.mini-grid .mc .lab { font-size: 10px; color: var(--text-3); margin-top: 1px; }
.mini-grid .mc.key { border-color: rgba(245,158,11,.4); box-shadow: inset 0 0 0 1px rgba(245,158,11,.15); }

/* 6.2 关键岗位象限 */
.quad-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center; }
.quad { position: relative; aspect-ratio: 1/1; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.quad .ax { position: absolute; font-size: 10px; color: var(--text-3); }
.quad .ax.x { bottom: 6px; left: 50%; transform: translateX(-50%); }
.quad .ax.y { top: 50%; left: 6px; transform: translateY(-50%) rotate(-90deg); transform-origin: left center; }
.quad .divline { position: absolute; background: var(--border); }
.quad .divline.v { left: 50%; top: 0; bottom: 0; width: 1px; }
.quad .divline.h { top: 50%; left: 0; right: 0; height: 1px; }
.quad .bubble { position: absolute; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 600; color: #fff; transform: translate(-50%,-50%); cursor: pointer; transition: transform .2s; }
.quad .bubble:hover { transform: translate(-50%,-50%) scale(1.12); }
.quad .bubble.key { background: radial-gradient(circle at 35% 30%, #ff6b6b, #c81e1e); box-shadow: 0 0 18px rgba(239,68,68,.5); }
.quad .bubble.norm { background: radial-gradient(circle at 35% 30%, #6b7280, #374151); opacity: .8; }

/* 6.3 岗位标准 */
.duty-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; margin-bottom: 10px; }
.duty-block .d-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.duty-block .d-tag { font-size: 10px; font-weight: 700; color: var(--accent); background: rgba(139,124,246,.14); padding: 2px 7px; border-radius: 99px; }
.duty-block .task { display: flex; gap: 8px; font-size: 12px; color: var(--text-2); padding: 3px 0 3px 4px; }
.duty-block .task::before { content: "▸"; color: var(--primary-2); }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* 6.4 九宫格 */
.grid9 { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.grid9 .g9 { border-radius: var(--r-sm); padding: 14px 8px; text-align: center; border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; }
.grid9 .g9 .g9-l { font-size: 11px; color: var(--text-3); }
.grid9 .g9 .g9-n { font-size: 22px; font-weight: 700; }
.grid9 .g9.hipo { background: linear-gradient(135deg, rgba(59,130,246,.28), rgba(59,130,246,.12)); border-color: rgba(59,130,246,.4); }
.grid9 .g9.hipo .g9-n { color: var(--primary-2); }
.grid9 .g9.core { background: linear-gradient(135deg, rgba(34,197,94,.24), rgba(34,197,94,.10)); border-color: rgba(34,197,94,.4); }
.grid9 .g9.core .g9-n { color: var(--success); }
.grid9 .g9.risk { background: var(--danger-bg); border-color: rgba(239,68,68,.35); }
.grid9 .g9.risk .g9-n { color: var(--danger); }
.grid9 .g9.ordinary { background: var(--surface); }
.grid9 .g9.ordinary .g9-n { color: var(--text-2); }

/* 6.5 IDP */
.idp-target { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--primary-soft); border: 1px solid rgba(59,130,246,.3); border-radius: var(--r-md); }
.idp-target .t-lab { font-size: 11px; color: var(--text-3); }
.idp-target .t-val { font-size: 14px; font-weight: 600; color: var(--primary-2); }
.gap-row { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 5px 0; }
.gap-row .g-name { width: 90px; color: var(--text-2); }
.gap-row .g-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; position: relative; }
.gap-row .g-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg,var(--warning),var(--danger)); border-radius: 99px; }
.gap-row .g-val { font-size: 11px; color: var(--text-3); width: 60px; text-align: right; }

/* 6.6 雷达 */
.radar-wrap { display: flex; align-items: center; gap: 20px; }
.radar-svg .grid { fill: none; stroke: var(--border); stroke-width: 1; }
.radar-svg .spoke { stroke: var(--border); stroke-width: 1; }
.radar-svg .std { fill: none; stroke: var(--text-3); stroke-width: 1.4; stroke-dasharray: 4 4; }
.radar-svg .act { fill: rgba(59,130,246,.18); stroke: var(--primary-2); stroke-width: 2; }
.radar-svg .axlabel { font-size: 9px; fill: var(--text-2); }
.radar-svg .dot { fill: var(--primary-2); }

/* 表格(通用) */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 12px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); }
table.t tbody tr { transition: background .15s; }
table.t tbody tr:hover { background: rgba(255,255,255,.025); }
table.t tr:last-child td { border-bottom: none; }
table.t td b { color: var(--text); font-weight: 600; }

/* inline warning */
.hint-box { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); font-size: 12px; line-height: 20px; }
.hint-box.warn { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,.25); }
.hint-box.warn svg { flex: 0 0 14px; width: 14px; height: 14px; margin-top: 3px; }

.muted { color: var(--text-3); }
.text-sm { font-size: 12px; }
.flex { display: flex; } .gap-sm { gap: 8px; } .gap-md { gap: 16px; } .between { justify-content: space-between; } .center { align-items: center; } .mt-sm { margin-top: 8px; } .mt-md { margin-top: 16px; } .mb-sm { margin-bottom: 8px; } .wrap { flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); }

/* ---------- 7. 输入区 ---------- */
.chat-foot { flex: 0 0 auto; padding: 12px 28px 18px; border-top: 1px solid var(--border); background: rgba(11,15,30,.5); backdrop-filter: blur(12px); }
.chat-foot .gnav { margin-bottom: 12px; }
/* 发送按钮:复用 shimmer 流光,改成蓝色品牌渐变 */
.btn-send.shimmer {
  background: linear-gradient(135deg, var(--primary-2), var(--primary-3)) !important;
  padding: 0 18px !important; height: 44px; border-radius: var(--r-md) !important;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 6px 22px rgba(59,130,246,.45);
  flex: 0 0 auto;
  transition: transform .18s, box-shadow .18s;
}
.btn-send.shimmer:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 10px 30px rgba(59,130,246,.6); }
.btn-send.shimmer:active { transform: translateY(0) scale(.97); }
.ci-box { display: flex; align-items: flex-end; gap: 10px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 8px 8px 8px 16px; transition: border-color .18s, box-shadow .18s; }
.ci-box:focus-within { border-color: rgba(59,130,246,.5); box-shadow: 0 0 0 3px var(--primary-soft); }
.ci-box textarea { flex: 1; background: transparent; border: none; outline: none; resize: none; max-height: 140px; line-height: 24px; color: var(--text); }
.ci-box textarea::placeholder { color: var(--text-3); }
.ci-hint { margin-top: 8px; font-size: 11px; color: var(--text-3); }
.ci-hint b { color: var(--text-2); font-weight: 500; }

/* prompt 建议 chip(欢迎态) */
.bubble .wf-line { line-height: 24px; }
.bubble .wf-line.lead { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.prompt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.prompt-chip { font-size: 12px; padding: 6px 12px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.prompt-chip:hover { background: var(--primary-soft); border-color: rgba(59,130,246,.4); color: var(--primary-2); transform: translateY(-1px); }

/* ---------- 8. 右侧 rail ---------- */
.rail { overflow-y: auto; padding: 20px 18px; background: rgba(11,15,30,.45); backdrop-filter: blur(12px); }
.rail-sec { margin-bottom: 26px; }
.rail-title { font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
.rail-item { display: flex; gap: 10px; padding: 10px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); margin-bottom: 8px; transition: background .18s, border-color .18s, transform .18s; cursor: pointer; }
.rail-item:hover { background: var(--surface-2); border-color: rgba(59,130,246,.3); transform: translateX(3px); }
.rail-item .ri-ic { flex: 0 0 16px; width: 16px; height: 16px; color: var(--primary-2); margin-top: 1px; }
.rail-item .ri-t { font-size: 13px; font-weight: 500; }
.rail-item .ri-s { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.rail-empty { font-size: 12px; color: var(--text-3); padding: 6px 2px; }
.rail-action { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); padding: 5px 2px; }
.rail-action .ra-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary-2); box-shadow: 0 0 8px var(--primary-2); }
.rail-note .rail-text { font-size: 12px; color: var(--text-3); line-height: 20px; }
.rail-note .rail-text b { color: var(--text-2); }

/* ---------- 9. 设置弹窗 ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 10000; background: rgba(5,7,15,.7); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; }
.modal-backdrop.show { display: flex; animation: msg-in .25s ease-out; }
.modal { width: 460px; max-width: calc(100vw - 40px); background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--sh-md); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head .m-title { font-size: 15px; font-weight: 600; }
.modal-head .m-close { width: 30px; height: 30px; border-radius: var(--r-sm); color: var(--text-3); font-size: 16px; }
.modal-head .m-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 18px 20px; }
.modal-body .field { display: block; margin-bottom: 14px; }
.modal-body .field span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.modal-body .field input { width: 100%; height: 38px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); outline: none; transition: border-color .15s; }
.modal-body .field input:focus { border-color: rgba(59,130,246,.5); }
.modal-body .m-tip { font-size: 12px; color: var(--text-3); line-height: 20px; background: var(--primary-soft); border: 1px solid rgba(59,130,246,.2); padding: 10px 12px; border-radius: var(--r-sm); }
.modal-body .m-tip b { color: var(--primary-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ---------- 10. Toast ---------- */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 10001; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--sh-md); font-size: 13px; animation: toast-in .3s cubic-bezier(.16,1,.3,1) both; }
.toast.out { animation: toast-out .3s ease-in both; }
.toast .ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: 0 0 18px; }
.toast.ok .ic { background: var(--success); }
.toast.info .ic { background: var(--primary); }
.toast.warn .ic { background: var(--warning); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.96); } }

/* ---------- 10.5 思考链(Dia 风格)+ 产出高亮 ---------- */
.think-chain { margin: 4px 0 10px 44px; width: fit-content; max-width: 600px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); border-top-left-radius: 4px; overflow: hidden; }
.think-chain .tc-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 12px; color: var(--text-3); cursor: pointer; user-select: none; transition: background .15s; }
.think-chain .tc-head:hover { background: var(--surface-2); }
.think-chain .tc-spin { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--primary-2); animation: spin .8s linear infinite; flex: 0 0 11px; }
.think-chain .tc-title { flex: 1; }
.think-chain .tc-chev { font-size: 10px; color: var(--text-3); transition: transform .25s; }
.think-chain.done .tc-spin { display: none; }
.think-chain.done .tc-head::before { content: '✓'; color: var(--success); font-weight: 700; font-size: 13px; width: 11px; text-align: center; }
.think-chain.collapsed .tc-list { display: none; }
.think-chain.collapsed .tc-chev { transform: rotate(-90deg); }
.think-chain .tc-list { display: flex; flex-direction: column; padding: 2px 14px 8px; }
.think-node { display: flex; gap: 12px; align-items: flex-start; padding: 4px 0; }
.think-node .nd-col { position: relative; width: 14px; flex: 0 0 14px; align-self: stretch; display: flex; justify-content: center; padding-top: 5px; }
.think-node .nd { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--text-3); background: var(--bg); z-index: 1; position: relative; transition: all .25s; }
.think-node .ln { position: absolute; left: 50%; top: 18px; bottom: -4px; width: 2px; transform: translateX(-50%); background: var(--border); transition: background .3s; }
.think-node:last-child .ln { display: none; }
.think-node .nd-text { font-size: 13px; line-height: 22px; color: var(--text-3); transition: color .25s; }
.think-node.active .nd { border-color: var(--primary-2); background: var(--primary-2); box-shadow: 0 0 0 4px var(--primary-soft); animation: nd-pulse 1.1s ease-out infinite; }
.think-node.active .nd-text { color: var(--text); }
.think-node.active .ln { background: linear-gradient(var(--primary-2), var(--border)); background-size: 100% 200%; animation: ln-flow 1.2s linear infinite; }
@keyframes ln-flow { 0% { background-position: 0 0; } 100% { background-position: 0 -200%; } }
.think-node.done .nd { background: var(--primary-2); border-color: var(--primary-2); }
.think-node.done .nd::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 9px; font-weight: 700; line-height: 1; }
.think-node.done .ln { background: linear-gradient(var(--primary-2), var(--border)); }
.think-node.done .nd-text { color: var(--text-2); }
@keyframes nd-pulse { 0% { box-shadow: 0 0 0 0 rgba(59,130,246,.5); } 70% { box-shadow: 0 0 0 6px rgba(59,130,246,0); } 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); } }
.think-node.in { animation: node-in .3s ease-out both; }
@keyframes node-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
/* 产出高亮(点击右侧产出项定位) */
.artifact { transition: box-shadow .3s; }
.artifact.regen { animation: art-regen .65s cubic-bezier(.16,1,.3,1); }
@keyframes art-regen { 0% { transform: scale(.97); opacity: .35; filter: blur(2px); } 60% { opacity: 1; } 100% { transform: none; opacity: 1; filter: none; } }
.artifact.highlight { animation: art-flash 1.3s ease-out; }
@keyframes art-flash { 0%, 100% { box-shadow: none; } 15% { box-shadow: 0 0 0 2px var(--primary-2), 0 0 32px rgba(59,130,246,.45); } }

/* ---------- 10.6 历史对话抽屉(默认收起)---------- */
.h-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); z-index: 200; opacity: 0; pointer-events: none; transition: opacity .3s; }
.h-backdrop.open { opacity: 1; pointer-events: auto; }
.h-drawer { position: fixed; left: 0; top: 0; bottom: 0; width: 300px; max-width: 84vw; background: var(--bg-2); border-right: 1px solid var(--border); box-shadow: var(--sh-md); z-index: 201; transform: translateX(-100%); transition: transform .35s cubic-bezier(.16,1,.3,1); display: flex; flex-direction: column; }
.h-drawer.open { transform: translateX(0); }
.h-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.h-title { font-size: 14px; font-weight: 600; }
.h-new { font-size: 12px; color: var(--primary-2); background: var(--primary-soft); padding: 6px 12px; border-radius: var(--r-sm); transition: background .15s; }
.h-new:hover { background: rgba(59,130,246,.24); }
.h-list { flex: 1; overflow-y: auto; padding: 8px; }
.h-item { padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; margin-bottom: 4px; transition: background .18s, transform .18s; }
.h-item:hover { background: var(--surface-2); transform: translateX(3px); }
.h-item.active { background: var(--primary-soft); }
.h-item .h-it { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-item .h-id { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.h-empty { font-size: 12px; color: var(--text-3); padding: 28px 12px; text-align: center; }

/* ---------- 10.7 人才中心 · 找人才 ---------- */
.match-bar { width: 84px; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.match-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary-2), var(--accent)); border-radius: 99px; }
.pool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pool-card { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.pool-card .pc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 6px; }
.pool-card .pc-name { font-size: 13px; font-weight: 600; }
.pool-card .pc-type { font-size: 10px; color: var(--primary-2); background: var(--primary-soft); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.pool-card .pc-count { font-size: 22px; font-weight: 700; color: var(--text); }
.pool-card .pc-gap { font-size: 11px; color: var(--warning); margin-top: 6px; }

/* ---------- 10.8 岗位标准(基本信息 + 资格 4D)---------- */
.std-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.std-info .si-row { display: flex; gap: 8px; font-size: 13px; align-items: center; }
.std-info .si-k { color: var(--text-3); width: 64px; flex: 0 0 64px; }
.std-info .si-v { color: var(--text); }
.std-sec-title { font-size: 13px; font-weight: 600; margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.std-sec-title::before { content: ''; width: 3px; height: 13px; background: var(--primary-2); border-radius: 2px; display: inline-block; }
.std-sub-title { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 12px 0 6px; }
.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 13px; }
.exp-item { display: flex; gap: 8px; align-items: baseline; }
.exp-item .ek { color: var(--text-3); width: 56px; flex: 0 0 56px; }
.ability-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.ability-row .ab-name { width: 96px; flex: 0 0 96px; color: var(--text); }
.ability-row .ab-level { font-size: 11px; font-weight: 700; color: var(--primary-2); background: var(--primary-soft); padding: 2px 8px; border-radius: 99px; flex: 0 0 auto; }
.ability-row .ab-weight { flex: 1; height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ability-row .ab-weight span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary-2), var(--accent)); }
.ability-row .ab-wv { font-size: 11px; color: var(--text-3); width: 36px; text-align: right; }

/* ---------- 10.9 思考动效卡(左:颜色弥散球 · 右:滚动代码)---------- */
.think-fx { display: flex; gap: 18px; align-items: center; margin: 4px 0 12px 44px; max-width: 600px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: max-width .42s cubic-bezier(.16,1,.3,1), padding .42s, background .42s, border-color .42s, margin .42s, border-radius .42s; }
.think-fx.morphing { padding: 0; background: transparent; border-color: transparent; }
.think-fx.morphed { display: block; max-width: none; margin: 16px 0 22px 0; padding: 0; background: transparent; border: 0; border-radius: 18px; overflow: visible; }
.think-fx.morphing .fx-orb, .think-fx.morphing .fx-code { opacity: 0; transform: scale(.88); transition: opacity .3s ease-in, transform .3s ease-in; }
.fx-orb { width: 76px; height: 76px; flex: 0 0 76px; border-radius: 50%; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 32% 26%, rgba(255,255,255,.45), transparent 42%),
    radial-gradient(circle at 72% 78%, rgba(8,12,30,.2), transparent 58%),
    conic-gradient(from 0deg, rgba(147,197,253,.4), transparent 18%, rgba(196,181,253,.4), transparent 43%, rgba(103,232,249,.4), transparent 68%, rgba(110,231,183,.4), transparent 93%);
  box-shadow: inset 0 0 14px rgba(8,12,30,.16);
  animation: fx-hue 6s linear infinite;
}
@keyframes fx-hue { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }
.fx-code { flex: 1; min-width: 0; height: 72px; overflow: hidden; position: relative; font-family: var(--mono); font-size: 11px; line-height: 18px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent); }
.fx-code-track { position: absolute; left: 0; right: 0; top: 0; animation: fx-code-scroll 7s linear infinite; }
.fx-code-track div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-kw { color: #c084fc; } .c-fn { color: #60a5fa; } .c-v { color: #34d399; } .c-s { color: #fbbf24; } .c-cm { color: var(--text-3); } .c-n { color: #f87171; }
@keyframes fx-code-scroll { from { transform: translateY(0); } to { transform: translateY(-50%); } }

/* ---------- 11. 全局 reduced-motion 兜底 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .caret, .thinking .spin, .thinking .skel-line, .step-row .ic.spin-c { animation: none !important; }
  .msg.in { animation: none !important; }
}

/* ---------- 12. 浅色主题(data-theme="light",令牌切换 + 深色玻璃覆盖)---------- */
[data-theme="light"] {
  --bg: #fafbfd; --bg-2: #ffffff;
  --surface: rgba(255,255,255,.65); --surface-2: rgba(255,255,255,.8); --surface-3: rgba(255,255,255,.92);
  --border: rgba(15,23,42,.08); --border-strong: rgba(15,23,42,.14);
  --text: #0b1220; --text-2: #475569; --text-3: #94a3b8;
  --primary: #2563eb; --primary-2: #3b82f6; --primary-3: #1d4ed8; --primary-soft: rgba(37,99,235,.09);
  --accent: #7c3aed;
  --success: #16a34a; --success-bg: rgba(22,163,74,.12);
  --warning: #d97706; --warning-bg: rgba(217,119,6,.12);
  --danger: #dc2626;  --danger-bg: rgba(220,38,38,.10);
  --info: #0891b2;    --info-bg: rgba(8,145,178,.12);
  --sh-sm: 0 1px 2px rgba(15,23,42,.04);
  --sh-md: 0 8px 30px rgba(15,23,42,.08);
  --sh-glow: 0 0 0 1px rgba(37,99,235,.14), 0 8px 40px rgba(37,99,235,.12);
}
[data-theme="light"] body {
  background:
    radial-gradient(1100px 520px at 100% 100%, rgba(124,58,237,.05), transparent 60%),
    radial-gradient(1000px 520px at -5% 100%, rgba(37,99,235,.05), transparent 60%),
    #fafbfd;
}
[data-theme="light"] .aurora { display: none; }
[data-theme="light"] .topbar { background: rgba(255,255,255,.88); border-bottom-color: var(--border); box-shadow: 0 1px 0 rgba(15,23,42,.04), 0 4px 24px rgba(15,23,42,.05); }
[data-theme="light"] .chat-head { background: transparent; border-bottom-color: var(--border); }
[data-theme="light"] .chat-foot { background: rgba(255,255,255,.72); }
[data-theme="light"] .rail { background: rgba(248,250,252,.72); }
[data-theme="light"] .msg.ai .bubble { background: rgba(255,255,255,.78); border-color: var(--border); }
[data-theme="light"] .msg.user .bubble { box-shadow: 0 4px 14px rgba(37,99,235,.25); }
[data-theme="light"] .think-node .nd { background: var(--bg); }
[data-theme="light"] .spotlight { background: #ffffff; border-color: rgba(15,23,42,.10); }
[data-theme="light"] .spotlight::before { display: none; }
[data-theme="light"] .spotlight:hover { border-color: rgba(124,58,237,.22); }
[data-theme="light"] .gnav { background: rgba(15,23,42,.04); border-color: var(--border); }
[data-theme="light"] .modal-backdrop { background: rgba(15,23,42,.42); }
[data-theme="light"] .h-backdrop { background: rgba(15,23,42,.4); }
[data-theme="light"] .modal { background: var(--bg-2); box-shadow: 0 20px 60px rgba(15,23,42,.18); }
[data-theme="light"] .h-drawer { background: var(--bg-2); box-shadow: 8px 0 32px rgba(15,23,42,.1); }
[data-theme="light"] .toast { background: var(--bg-2); box-shadow: 0 8px 30px rgba(15,23,42,.14); }
[data-theme="light"] table.t tbody tr:hover { background: rgba(37,99,235,.05); }
[data-theme="light"] table.t th { background: rgba(15,23,42,.045); }
[data-theme="light"] .quad { background: var(--surface); }
[data-theme="light"] .quad .bubble.norm { background: radial-gradient(circle at 35% 30%, #94a3b8, #475569); }
/* 主题按钮图标显隐:深色显太阳(切浅),浅色显月亮(切深) */
#themeBtn .ic-moon { display: none; }
#themeBtn .ic-sun { display: block; }
[data-theme="light"] #themeBtn .ic-sun { display: none; }
[data-theme="light"] #themeBtn .ic-moon { display: block; }
