:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --sidebar: #101c2c;
  --sidebar-hover: #1b2c44;
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --text: #1a2332;
  --muted: #6b7686;
  --border: #e6e9ef;
  --green: #16a34a;
  --orange: #ea7b12;
  --red: #dc2626;
  --yellow: #d97706;
  --shadow: 0 1px 3px rgba(16, 28, 44, 0.06), 0 4px 16px rgba(16, 28, 44, 0.07);
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.55;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; }
a { text-decoration: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 20% 10%, #123a6b 0%, #0d2237 45%, #0a1626 100%); padding: 20px; }
.login-card { background: #fff; border-radius: 18px; padding: 40px 36px; width: 400px; max-width: 100%; box-shadow: 0 24px 60px rgba(0,0,0,0.35); }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.logo { width: 48px; height: 48px; border-radius: 13px; background: linear-gradient(135deg, #0d6efd, #4aa8ff); color: #fff; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.logo.small { width: 40px; height: 40px; font-size: 16px; border-radius: 11px; }
.login-card h1 { font-size: 20px; font-weight: 700; }
.login-card p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.login-card form label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.login-card input { width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; }
.login-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,0.12); }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }
.btn-primary { width: 100%; margin-top: 8px; padding: 12px; background: linear-gradient(135deg, #0d6efd, #2f8bfd); color: #fff; font-size: 15px; font-weight: 600; border-radius: 9px; }
.btn-primary:hover { filter: brightness(1.05); }
.login-tip { margin-top: 18px; text-align: center; color: #9aa6b5; font-size: 12px; }

/* ---------- 布局 ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 216px; background: var(--sidebar); color: #d8e0ee; display: flex; flex-direction: column; flex: none; }
.brand-side { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.25; }
.brand-txt strong { color: #fff; font-size: 15px; }
.brand-txt span { color: #8fa0b8; font-size: 12px; }
.nav { flex: 1; padding: 8px 10px; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 9px; color: #b9c5d6; text-decoration: none; font-size: 14px; margin-bottom: 3px; transition: all .15s; }
.nav a:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(13,110,253,0.35); }
.nav-ic { width: 18px; text-align: center; font-size: 15px; }
.side-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255,255,255,0.07); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #2f8bfd, #0d6efd); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; flex: none; }
.user-txt { display: flex; flex-direction: column; line-height: 1.3; }
.user-txt strong { color: #fff; font-size: 13px; }
.user-txt span { color: #8fa0b8; font-size: 12px; }
.logout { width: 100%; padding: 8px; background: rgba(255,255,255,0.06); color: #b9c5d6; border-radius: 8px; font-size: 13px; }
.logout:hover { background: rgba(220,38,38,0.2); color: #ff9a9a; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 58px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; flex: none; }
.crumb { font-size: 16px; font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.conn { width: 9px; height: 9px; border-radius: 50%; background: #9aa6b5; display: inline-block; }
.conn.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,0.15); }
.conn.bad { background: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,0.15); }
.content { flex: 1; overflow-y: auto; padding: 22px; }

/* ---------- 通用组件 ---------- */
.btn { padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; transition: all .15s; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-primary { background: linear-gradient(135deg, #0d6efd, #2f8bfd); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(1.08); }
.btn-danger { background: #fff; color: var(--red); border: 1px solid #f3c1c1; }
.btn-danger:hover { background: #fef2f2; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge-green { background: #e8f7ee; color: #15803d; }
.badge-orange { background: #fdf0e0; color: #b45309; }
.badge-red { background: #fdeaea; color: #b91c1c; }
.badge-blue { background: #e8f1fe; color: #1d4ed8; }
.badge-gray { background: #eef0f4; color: #4b5563; }
.badge-yellow { background: #fef9c3; color: #854d0e; }

.progress { height: 8px; background: #eef0f4; border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #0d6efd, #4aa8ff); transition: width .4s; }
.progress.green > i { background: linear-gradient(90deg, #16a34a, #4ade80); }
.progress.orange > i { background: linear-gradient(90deg, #ea7b12, #fbbf24); }
.progress.red > i { background: linear-gradient(90deg, #dc2626, #f87171); }

/* ---------- 看板 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { padding: 16px 18px; }
.stat-card .k { font-size: 12px; color: var(--muted); }
.stat-card .v { font-size: 26px; font-weight: 700; margin-top: 4px; line-height: 1.2; }
.stat-card .s { font-size: 12px; color: var(--muted); margin-top: 3px; }
.stat-card .v.green { color: var(--green); }
.stat-card .v.orange { color: var(--orange); }
.stat-card .v.red { color: var(--red); }
.stat-card .v.blue { color: var(--primary); }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.chart-card { padding: 16px 18px; }
.chart-box { height: 230px; }
.recent-table { width: 100%; border-collapse: collapse; }
.recent-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.recent-table td { padding: 10px; border-bottom: 1px solid #f2f4f8; font-size: 13px; vertical-align: middle; }
.recent-table tr:hover td { background: #f8fafc; }
.row-link { color: var(--primary); cursor: pointer; }
.row-link:hover { text-decoration: underline; }

/* ---------- 项目列表 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type=text], .toolbar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.toolbar input[type=text] { width: 240px; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.proj-card { padding: 16px 18px; cursor: pointer; transition: all .18s; border: 1px solid transparent; }
.proj-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,28,44,0.1); border-color: #cfe0fd; }
.proj-card .pc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.proj-card .pc-name { font-size: 15px; font-weight: 600; }
.proj-card .pc-id { font-size: 11px; color: var(--muted); }
.pc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin: 10px 0; }
.pc-meta b { color: var(--text); font-weight: 600; }
.pc-progress { display: flex; align-items: center; gap: 10px; }
.pc-progress .progress { flex: 1; }
.pc-progress .pct { font-size: 13px; font-weight: 600; }
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* ---------- 项目详情 ---------- */
.pd-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pd-name { font-size: 20px; font-weight: 700; }
.pd-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.pd-progress-big { width: 92px; text-align: center; flex: none; }
.pd-progress-big .ring { width: 88px; height: 88px; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--p)*1%), #eef0f4 0); display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; position: relative; }
.pd-progress-big .ring::after { content: ""; position: absolute; inset: 8px; background: #fff; border-radius: 50%; }
.pd-progress-big .ring b { position: relative; z-index: 1; font-size: 18px; }
.pd-progress-big .lbl { font-size: 12px; color: var(--muted); }
.pd-info { flex: 1; min-width: 240px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 18px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; }
.pd-info .it { font-size: 12px; color: var(--muted); }
.pd-info .iv { font-size: 13px; font-weight: 500; margin-top: 1px; }
.pd-actions { display: flex; flex-direction: column; gap: 8px; flex: none; }

.stage-strip { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 4px; }
.stage-chip { flex: 1; min-width: 108px; background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; border-top: 3px solid #cbd5e1; cursor: pointer; position: relative; transition: all .15s; }
.stage-chip:hover { transform: translateY(-2px); }
.stage-chip .sc-seq { font-size: 11px; color: var(--muted); }
.stage-chip .sc-name { font-size: 13px; font-weight: 600; margin: 2px 0; }
.stage-chip .sc-gate { font-size: 11px; color: var(--muted); }
.stage-chip.done { border-top-color: var(--green); background: linear-gradient(180deg, #f4fbf7, #fff); }
.stage-chip.done .sc-seq { color: var(--green); }
.stage-chip.active { border-top-color: var(--primary); background: linear-gradient(180deg, #eff6ff, #fff); box-shadow: 0 4px 14px rgba(13,110,253,0.18); }
.stage-chip.active .sc-seq { color: var(--primary); font-weight: 600; }
.stage-chip.current::after { content: "当前"; position: absolute; top: -8px; right: 8px; background: var(--primary); color: #fff; font-size: 10px; padding: 1px 8px; border-radius: 10px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { padding: 9px 16px; background: none; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.table-card { padding: 6px 0; overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.grid td { padding: 10px 12px; border-bottom: 1px solid #f2f4f8; font-size: 13px; vertical-align: middle; }
table.grid tr:hover td { background: #f8fafc; }
.td-main { font-weight: 500; }
.td-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.task-check { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid #cbd5e1; background: #fff; color: transparent; font-size: 15px; display: flex; align-items: center; justify-content: center; transition: all .15s; flex: none; }
.task-check:hover { border-color: var(--green); color: var(--green); }
.task-check.on { background: var(--green); border-color: var(--green); color: #fff; }
.task-check.going { background: #e8f1fe; border-color: var(--primary); color: var(--primary); }
select.status-sel { padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; font-size: 12px; background: #fff; }
textarea.inline-edit, input.inline-edit { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
textarea.inline-edit:focus, input.inline-edit:focus { outline: none; border-color: var(--primary); }

/* ---------- 任务视图 ---------- */
.task-section { margin-bottom: 20px; }
.task-count { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }

/* ---------- AI ---------- */
.ai-wrap { display: flex; flex-direction: column; height: calc(100vh - 150px); max-width: 860px; margin: 0 auto; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 16px 4px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 78%; padding: 11px 14px; border-radius: 14px; font-size: 14px; white-space: pre-wrap; line-height: 1.6; }
.msg.user { align-self: flex-end; background: linear-gradient(135deg, #0d6efd, #2f8bfd); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: #fff; box-shadow: var(--shadow); border-bottom-left-radius: 4px; }
.ai-input { display: flex; gap: 10px; margin-top: 12px; }
.ai-input input { flex: 1; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; font-size: 14px; }
.ai-input input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,0.1); }
.ai-hint { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* ---------- 设置 ---------- */
.set-list { max-width: 680px; }
.set-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; border-bottom: 1px solid #f2f4f8; }
.set-row:last-child { border-bottom: none; }
.set-row .k { font-size: 14px; font-weight: 500; }
.set-row .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.set-row .v { font-size: 13px; color: var(--primary); font-weight: 500; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(10,18,30,0.55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: 16px; width: 640px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,0.35); }
.modal.wide { width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.modal-head strong { font-size: 16px; }
.modal-close { background: none; font-size: 22px; color: var(--muted); line-height: 1; }
.modal-close:hover { color: var(--red); }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.f-item label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.f-item input, .f-item select, .f-item textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.f-item input:focus, .f-item select:focus, .f-item textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,0.1); }
.f-item textarea { min-height: 64px; resize: vertical; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); }

/* ---------- Toast ---------- */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-80px); background: #1a2332; color: #fff; padding: 11px 22px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); transition: transform .3s; z-index: 99; max-width: 80vw; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }

/* ---------- 风险卡片 ---------- */
.risk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.risk-card { padding: 14px 16px; border-left: 4px solid var(--orange); }
.risk-card.blocking { border-left-color: var(--red); background: #fffafa; }
.risk-card .rk-head { display: flex; justify-content: space-between; gap: 8px; }
.risk-card .rk-title { font-weight: 600; font-size: 14px; }
.risk-card .rk-body { font-size: 13px; color: var(--muted); margin-top: 6px; }
.risk-card .rk-action { font-size: 13px; margin-top: 6px; background: #f8fafc; border-radius: 8px; padding: 6px 10px; }
.risk-card .rk-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; color: var(--muted); }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { width: 64px; }
  .brand-txt, .user-txt, .nav a span:not(.nav-ic) { display: none; }
  .nav a { justify-content: center; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- 商务档案 ---------- */
.biz-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.biz-tabs button { padding: 7px 16px; border-radius: 999px; background: #f1f4f9; font-size: 13px; color: var(--muted); transition: all .15s; }
.biz-tabs button:hover { color: var(--primary); }
.biz-tabs button.active { background: var(--primary); color: #fff; font-weight: 600; }
table.grid tr.totrow td { border-top: 2px solid var(--border); background: #f8fafc; font-weight: 600; }
.calc-result { margin-top: 14px; padding: 12px 16px; border-radius: 10px; background: #f0f7ff; border: 1px solid #cfe6ff; font-size: 13px; line-height: 1.7; }
.calc-line + .calc-line { border-top: 1px dashed #cfe0f6; margin-top: 6px; padding-top: 6px; }

/* 等宽操作按钮（取消/保存 平衡） */
.btn-eq { flex: 1; padding: 12px; border-radius: 9px; font-size: 15px; font-weight: 600; text-align: center; cursor: pointer; transition: all .15s; }
.btn-eq.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-eq.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-eq.primary { background: linear-gradient(135deg, #0d6efd, #2f8bfd); color: #fff; }
.btn-eq.primary:hover { filter: brightness(1.05); }

/* 筛选控件 */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-sel { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fff; color: var(--text); }

/* 等宽字体（编号/路径） */
.mono-sm { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 报价模块多选 */
.mod-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mod-chk { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: #fff; cursor: pointer; transition: all .15s; }
.mod-chk:hover { border-color: var(--primary); }
.mod-chk.on { border-color: var(--primary); background: #eff6ff; }
.mod-chk input { width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.mod-chk .mod-name { flex: 1; font-size: 13px; font-weight: 500; }
.mod-chk .mod-price { font-size: 12px; color: var(--primary); font-weight: 600; }

/* 款项进出子标签 */
.pay-tabs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.pay-tab { padding: 6px 15px; border-radius: 999px; background: #f1f4f9; font-size: 13px; color: var(--muted); border: none; cursor: pointer; transition: all .15s; }
.pay-tab:hover { color: var(--primary); }
.pay-tab.active { background: var(--primary); color: #fff; font-weight: 600; }

/* 合同文件上传行 */
.upl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 表格行操作 */
.row-ops { white-space: nowrap; }
.op-link { background: none; border: none; cursor: pointer; font-size: 13px; padding: 0 6px 0 0; text-decoration: none; }
.op-link.edit { color: var(--primary); }
.op-link.del { color: var(--red); }
.op-link:hover { text-decoration: underline; }

@media (max-width: 640px) { .mod-grid { grid-template-columns: 1fr; } }

/* 设置页标签页与 AI 配置输入 */
.set-tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.set-tabs button { padding: 7px 16px; border-radius: 999px; background: #f1f4f9; font-size: 13px; color: var(--muted); transition: all .15s; }
.set-tabs button:hover { color: var(--primary); }
.set-tabs button.active { background: var(--primary); color: #fff; font-weight: 600; }
.ai-f.in { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; width: 100%; }
.ai-f.in:focus { outline: none; border-color: var(--primary); }
.set-tabs .muted.small { font-size: 12px; }

/* 款项进出：进账/支出按钮等宽 */
.pay-add { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.btnPay { flex: 1; min-width: 96px; padding: 8px 18px; border-radius: 8px; border: 1px solid var(--primary); background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; }
.btnPay:hover { filter: brightness(1.05); }

/* 报价面谈模块 */
.mod-price.negot { color: var(--orange); font-weight: 600; }

/* 知识库嵌入 */
.kb-embed { margin-top: 8px; }
.kb-embed iframe { width: 100%; height: 480px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }

/* 我的任务来源筛选 */
.mt-filter { display: inline-flex; gap: 6px; margin: 0 12px; }
.mt-chip { padding: 5px 14px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 12px; color: var(--muted); cursor: pointer; transition: all .15s; }
.mt-chip:hover { border-color: var(--primary); color: var(--primary); }
.mt-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ---------- AI 助手聊天界面 ---------- */
.ai-shell { height: calc(100vh - 120px); min-height: 420px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 6px 24px rgba(31, 41, 55, .06); }
.ai-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, #f0f6ff, #fff); }
.ai-logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), #2f8bfd); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; box-shadow: 0 4px 10px rgba(13, 110, 253, .25); }
.ai-head .ai-title { font-size: 15px; font-weight: 700; }
.ai-head .ai-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ai-clear { margin-left: auto; font-size: 12px; color: var(--muted); cursor: pointer; padding: 5px 10px; border-radius: 8px; }
.ai-clear:hover { background: #eef2f7; color: var(--red); }
.ai-msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; background: #f7f9fc; }
.ai-row { display: flex; align-items: flex-start; gap: 10px; max-width: 86%; }
.ai-row.user { margin-left: auto; flex-direction: row-reverse; }
.ai-avatar { width: 34px; height: 34px; flex: none; border-radius: 10px; background: linear-gradient(135deg, var(--primary), #2f8bfd); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.ai-avatar.user { background: linear-gradient(135deg, #3b6bfd, #6245d0); font-size: 14px; font-weight: 700; }
.ai-bubble { padding: 11px 15px; border-radius: 14px; font-size: 14px; line-height: 1.65; background: #fff; color: #26303f; box-shadow: 0 1px 3px rgba(31, 41, 55, .07); border: 1px solid var(--border); }
.ai-bubble.user { background: linear-gradient(135deg, #3567f2, #4a7df6); color: #fff; border: none; border-bottom-right-radius: 4px; }
.ai-bubble.bot { border-bottom-left-radius: 4px; }
.ai-bubble.bot p { margin: 0 0 8px; }
.ai-bubble.bot p:last-child { margin-bottom: 0; }
.ai-bubble b { color: var(--primary); }
.ai-bubble code { background: #eef2f7; padding: 1px 5px; border-radius: 5px; font-size: 12px; font-family: ui-monospace, Menlo, monospace; }
.ai-bub-wrap { display: flex; flex-direction: column; gap: 4px; }
.ai-meta { font-size: 11px; color: #9aa7b6; padding-left: 4px; }
.ai-typing .ai-bubble, .bot-typing { display: flex; }
.bot-typing .dot { width: 7px; height: 7px; margin: 2px; border-radius: 50%; background: #b6c4d4; animation: blip 1.2s infinite; }
.bot-typing .dot:nth-child(2) { animation-delay: .2s; } .bot-typing .dot:nth-child(3) { animation-delay: .4s; }
@keyframes blip { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.ai-suggests { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px 2px; background: #fff; }
.ai-chip { border: 1px solid #d7e3f5; background: #f4f8ff; color: var(--primary); font-size: 12px; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.ai-chip:hover { background: #e6efff; }
.ai-input-bar { display: flex; align-items: flex-end; gap: 10px; padding: 12px 16px; background: #fff; border-top: 1px solid var(--border); }
.ai-input-bar textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-size: 14px; line-height: 1.5; max-height: 120px; outline: none; font-family: inherit; }
.ai-input-bar textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 110, 253, .1); }
.ai-send { flex: none; padding: 11px 22px; border-radius: 12px; border: none; background: linear-gradient(135deg, var(--primary), #2f8bfd); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.ai-send:hover { filter: brightness(1.05); }
@media (max-width: 640px) { .ai-row { max-width: 96%; } .ai-shell { height: calc(100vh - 150px); } }
