:root {
  --bg: #f4f6fa; --card: #fff; --line: #e4e8f0; --text: #1f2733; --muted: #6b7686;
  --brand: #2d5bff; --brand-d: #1f47d6; --ok: #16a34a; --warn: #d97706; --bad: #dc2626;
  --chip: #eef2ff; --shadow: 0 1px 3px rgba(20,30,60,.08), 0 1px 2px rgba(20,30,60,.04);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1f47d6 0%, #2d5bff 50%, #5b7cff 100%); }
.login-card { background: #fff; padding: 40px 36px; border-radius: 16px; width: min(360px, 92vw); box-shadow: 0 20px 60px rgba(20,30,80,.3); }
.pwwrap { position: relative; }
.login-card .pwwrap input { padding-right: 44px; }
.login-card .pwtoggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: auto; margin: 0; padding: 4px 6px; background: none; border: none; color: var(--muted); font-size: 18px; line-height: 1; opacity: .65; }
.login-card .pwtoggle:hover { opacity: 1; background: none; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card .sub { color: var(--muted); margin-bottom: 24px; font-size: 13px; }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.login-card input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; }
.login-card button { width: 100%; margin-top: 22px; padding: 12px; background: var(--brand); color: #fff; border: none; border-radius: 9px; font-size: 15px; font-weight: 600; }
.login-card button:hover { background: var(--brand-d); }
.login-hint { margin-top: 18px; font-size: 12px; color: var(--muted); line-height: 1.8; background: #f7f9fc; padding: 10px 12px; border-radius: 8px; }
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; }
.captcha-img { width: 124px; height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; overflow: hidden; background: #eef2f7; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.captcha-img svg { display: block; }
.permtable { border-collapse: collapse; min-width: 640px; }
.permtable th, .permtable td { border: 1px solid var(--line); padding: 7px 12px; text-align: center; font-size: 13px; }
.permtable .pmod { text-align: left; font-weight: 600; white-space: nowrap; }
.permtable .pgrp { background: #eef2f7; font-weight: 600; }
.permtable .pc { width: 60px; }
.permtable input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.permtable input[disabled] { cursor: not-allowed; opacity: .55; }
.login-err { color: var(--bad); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ---------- 布局 ---------- */
.layout { display: flex; height: 100vh; overflow: hidden; }
.side { width: 210px; background: #0f1830; color: #c7d0e0; flex-shrink: 0; display: flex; flex-direction: column; height: 100vh; }
.side .logo { padding: 20px 22px; font-size: 17px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.side .logo span { color: #5b7cff; }
.nav { flex: 1; padding: 8px; overflow: auto; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 9px; color: #c7d0e0; margin-bottom: 2px; font-size: 14px; }
.nav a:hover { background: #1a2547; color: #fff; }
.nav a.active { background: var(--brand); color: #fff; }
.nav a .ic { width: 18px; text-align: center; }
.nav .badge { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.side .who { padding: 14px 18px; border-top: 1px solid #1a2547; font-size: 13px; }
.side .who .role { color: #5b7cff; font-weight: 600; }
.side .who button { margin-top: 8px; background: transparent; border: 1px solid #2a3a64; color: #9fb0d0; padding: 5px 10px; border-radius: 7px; font-size: 12px; width: 100%; }
.side .who button:hover { background: #1a2547; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 14px 26px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.topbar h2 { margin: 0; font-size: 18px; }
.topbar .tools { display: flex; gap: 10px; align-items: center; }
.content { padding: 22px 26px; overflow: auto; flex: 1; min-height: 0; }

/* ---------- 组件 ---------- */
.btn { background: var(--brand); color: #fff; border: none; padding: 8px 15px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.btn:hover { background: var(--brand-d); }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.ghost:hover { background: var(--chip); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.gray { background: #eef1f6; color: var(--text); }
.btn.gray:hover { background: #e2e7ef; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat .v.small { font-size: 20px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card .hd { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.card .hd h3 { margin: 0; font-size: 15px; }
.card .bd { padding: 16px 18px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: #fafbfd; position: sticky; top: 0; }
tr:hover td { background: #fafbff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge2 { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.s-收款中 { background: #dcfce7; color: #15803d; }
.s-审查中 { background: #fef3c7; color: #b45309; }
.s-停用 { background: #ffedd5; color: #c2410c; }
.s-弃用 { background: #374151; color: #fff; }
.s-备用 { background: #e0e7ff; color: #4338ca; }
.s-新PP待接入 { background: #ccfbf1; color: #0f766e; }
.s-禁用 { background: #7f1d1d; color: #fff; }
.s-关闭收款 { background: #f1f5f9; color: #475569; }
.lv-严重 { background: #fee2e2; color: #b91c1c; }
.lv-警告 { background: #fef3c7; color: #b45309; }
.lv-提示 { background: #e0f2fe; color: #0369a1; }
.tag { display: inline-block; background: var(--chip); color: var(--brand); padding: 1px 8px; border-radius: 6px; font-size: 12px; margin: 1px 3px 1px 0; }
.tag.wp { background: #fce7f3; color: #be185d; }

form.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; align-items: end; }
.fld label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.fld input, .fld select, .fld textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; }
.fld textarea { resize: vertical; min-height: 70px; }
.fld.full { grid-column: 1 / -1; }
.ppmulti { position: relative; }
.ppmulti .ppmulti-input { width: 100%; }
.ppmulti-list { margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; max-height: 190px; overflow: auto; background: #fff; }
.ppmulti-option { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--text); text-align: left; font-size: 13px; }
.ppmulti-option:last-child { border-bottom: 0; }
.ppmulti-option:hover { background: var(--chip); }
.ppmulti-option b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppmulti-option span { flex-shrink: 0; color: var(--muted); font-size: 12px; }
.ppmulti-picked { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 28px; }
.ppmulti-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 8px; border-radius: 8px; background: var(--chip); color: var(--brand); font-size: 12px; word-break: break-all; }
.ppmulti-chip button { border: 0; background: transparent; color: var(--brand); font-size: 15px; line-height: 1; padding: 0; }
.ppmulti-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.row-actions { display: flex; gap: 8px; }
.muted { color: var(--muted); }
.mono { font-family: "SF Mono", Consolas, monospace; font-size: 12px; }
.right { text-align: right; }
.hl { color: var(--bad); font-weight: 600; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar select, .toolbar input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }

#toast { position: fixed; top: 18px; right: 18px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #0f1830; color: #fff; padding: 11px 16px; border-radius: 9px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: slidein .2s; }
.toast.ok { background: var(--ok); } .toast.err { background: var(--bad); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }

.modal-bg { position: fixed; inset: 0; background: rgba(15,24,48,.45); display: flex; align-items: center; justify-content: center; z-index: 500; }
.modal { background: #fff; border-radius: 14px; width: min(880px, 94vw); max-height: 88vh; overflow: auto; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.modal .hd { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal .hd h3 { margin: 0; } .modal .bd { padding: 18px 20px; }
.modal .x { background: none; border: none; font-size: 22px; color: var(--muted); }
.pill { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: #eef1f6; color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.help { font-size: 12px; color: var(--muted); line-height: 1.7; }
.bindrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.bindrow:hover { background: var(--chip); }
.bindrow input { width: 16px; height: 16px; }
.keyrow { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.keyrow b { width: 76px; flex-shrink: 0; color: var(--muted); font-weight: 600; }
.keyrow .kv { flex: 1; word-break: break-all; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--brand); }
.statbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.statchip { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; box-shadow: var(--shadow); }
.statchip .n { font-size: 20px; font-weight: 700; }
.statchip .l { font-size: 12px; color: var(--muted); }
.statchip { cursor: pointer; }
.statchip.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(45,91,255,.25); }
.sitefilter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.sitefilter .chip { padding: 3px 10px; border: 1px solid var(--line); border-radius: 14px; font-size: 12px; cursor: pointer; background: var(--card); }
.sitefilter .chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
/* 分页器 */
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); background: #fafbfd; }
.pager select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.pager .sp { flex: 1; }
.pager .btn[disabled] { opacity: .45; cursor: default; }
/* 首页快捷积木 */
.quickblocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.qblock { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: 14px; cursor: pointer; color: #fff; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.qblock:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(20,30,80,.22); }
.qb-ev { background: linear-gradient(135deg, #2d5bff, #5b7cff); }
.qb-pol { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.qb-ic { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.2)); }
.qb-tx { flex: 1; }
.qb-t { font-size: 17px; font-weight: 700; }
.qb-s { font-size: 12.5px; opacity: .9; margin-top: 3px; }
.qb-cta { background: rgba(255,255,255,.22); padding: 8px 16px; border-radius: 9px; font-weight: 600; font-size: 14px; white-space: nowrap; }
/* 提醒事项 */
.remadd { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.remadd input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.remadd #remText { flex: 1; min-width: 220px; }
.remrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); margin-top: 8px; }
.remrow .rt { flex: 1; }
.remrow.due { background: #fef2f2; border-color: #fecaca; }
.remrow.due .rt { font-weight: 600; color: #b91c1c; }
.remrow.done { opacity: .55; }
.remrow.done .rt { text-decoration: line-through; }
/* 站点视图分组 */
.sitegroup-h { font-size: 13px; font-weight: 700; color: var(--text); margin: 20px 0 10px; display: flex; align-items: center; gap: 10px; }
.sitegroup-h:first-child { margin-top: 0; }
.sitegroup-h .ln { flex: 1; height: 1px; background: var(--line); }
.sitegroup-h .pill { font-weight: 500; }
.sitecard { cursor: pointer; }
.sitecard.dragging { opacity: .45; outline: 2px dashed var(--brand); pointer-events: none; }
.draghandle { cursor: grab; color: var(--muted); font-size: 14px; }
.ppchips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.ppchip { display: inline-block; padding: 3px 9px; border-radius: 8px; font-size: 12px; color: #fff; line-height: 1.4; word-break: break-all; }
.ppchip.unl { background: #16a34a; }   /* 不限额=绿 */
.ppchip.lim { background: #b8860b; }   /* 限额=偏暗的黄(深金黄) */
.ppchip.cc  { background: #d97706; }   /* 信用卡渠道=黄(琥珀) */
.ppchip.rev { opacity: .82; border: 1.5px dashed rgba(255,255,255,.95); }   /* 审查中：虚线边框 */
.sorthint { color: var(--line); font-size: 11px; }
th.sortable:hover .sorthint { color: var(--brand); }

/* ---------- 顶栏左侧 + 汉堡菜单（移动端） ---------- */
.tb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hamburger { display: none; background: none; border: none; font-size: 22px; line-height: 1; color: var(--text); padding: 2px 6px; }
.nav-backdrop { display: none; }

/* ---------- 响应式：手机/平板 ---------- */
@media (max-width: 768px) {
  .hamburger { display: block; }
  /* 侧边栏变成可滑出的抽屉 */
  .side { position: fixed; top: 0; left: 0; bottom: 0; z-index: 600; width: 240px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0,0,0,.45); }
  .layout.nav-open .side { transform: translateX(0); }
  .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,24,48,.5); z-index: 590; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .layout.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  .main { width: 100%; }
  .topbar { padding: 12px 14px; }
  .topbar h2 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .content { padding: 14px; }
  /* 统计卡更紧凑 */
  .cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
  .stat { padding: 12px 14px; }
  .stat .v { font-size: 22px; }
  /* 表单单列堆叠 */
  form.grid { grid-template-columns: 1fr; }
  /* 宽表格横向滚动 */
  .card .bd { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* 弹窗更贴边 */
  .modal { width: 96vw; max-height: 92vh; }
  .modal .bd { padding: 14px; }
  /* 首页快捷积木单列 */
  .quickblocks { grid-template-columns: 1fr; }
  .qblock { padding: 16px 18px; }
}
@media (max-width: 420px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 30px 22px; }
  .toolbar { gap: 8px; }
}

/* ---------- PP 档案 · 手机端折叠卡片 ---------- */
.ppcards { display: flex; flex-direction: column; gap: 10px; }
.ppcard { background: var(--card); border: 1px solid var(--line); border-left: 4px solid #cbd5e1; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.ppcard[data-st="收款中"] { border-left-color: #16a34a; }
.ppcard[data-st="审查中"] { border-left-color: #d97706; }
.ppcard[data-st="停用"] { border-left-color: #c2410c; }
.ppcard[data-st="弃用"] { border-left-color: #374151; }
.ppcard[data-st="备用"] { border-left-color: #4338ca; }
.ppcard[data-st="新PP待接入"] { border-left-color: #0f766e; }
.ppcard[data-ev="up"] { border-left-color: #16a34a; }
.ppcard[data-ev="down"] { border-left-color: #dc2626; }
.ppcard[data-ev="mid"] { border-left-color: #64748b; }
.ppcard[data-lt="收款"] { border-left-color: #16a34a; }
.ppcard[data-lt="提款"] { border-left-color: #2563eb; }
.ppcard[data-lt="退款"] { border-left-color: #dc2626; }
.ppcard[data-lt="微调"] { border-left-color: #d97706; }
.ppcard[data-lv] { border-left-color: #d97706; }
@keyframes siteflash { 0% { box-shadow: 0 0 0 3px var(--brand); } 100% { box-shadow: var(--shadow); } }
.sitecard.flash { animation: siteflash 1.5s ease; }
.ppc-sum { list-style: none; display: flex; align-items: center; gap: 12px; padding: 13px 14px; cursor: pointer; user-select: none; }
.ppc-sum::-webkit-details-marker { display: none; }
.ppc-id { flex: 1; min-width: 0; }
.ppc-email { font-weight: 600; font-size: 14px; line-height: 1.35; word-break: break-all; }
.ppc-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 5px; font-size: 12px; }
.ppc-bal { text-align: right; flex-shrink: 0; }
.ppc-bal-n { display: block; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ppc-bal-l { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.ppc-chev { color: var(--muted); font-size: 22px; line-height: 1; flex-shrink: 0; transition: transform .2s ease; }
.ppcard[open] .ppc-chev { transform: rotate(90deg); }
.ppc-body { padding: 2px 14px 14px; border-top: 1px solid var(--line); }
.ppc-kv { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.ppc-kv .k { color: var(--muted); width: 72px; flex-shrink: 0; }
.ppc-kv .v { flex: 1; min-width: 0; word-break: break-all; }
.ppc-act { display: flex; gap: 8px; margin-top: 12px; }
.ppc-act .btn { flex: 1; }
@media (prefers-reduced-motion: reduce) { .ppc-chev, .side, .nav-backdrop { transition: none; } }

/* ===================== AI 助手 ===================== */
.ai-page { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; height: calc(100vh - 140px); min-height: 480px; }
.ai-hero { position: relative; overflow: hidden; background: linear-gradient(135deg, #1f47d6 0%, #2d5bff 48%, #7a3bff 100%); border-radius: 18px; padding: 24px 26px; color: #fff; box-shadow: 0 10px 30px rgba(45, 91, 255, .26); margin-bottom: 14px; }
.ai-hero::before { content: ''; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.12); }
.ai-hero::after { content: ''; position: absolute; right: 50px; bottom: -70px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.10); }
.ai-title { font-size: 20px; font-weight: 800; letter-spacing: .3px; display: flex; align-items: center; gap: 12px; position: relative; }
.ai-title .ai-logo { font-size: 32px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,.22)); }
.ai-sub { color: rgba(255,255,255,.88); font-size: 13px; margin-top: 8px; position: relative; }
.ai-sub .ai-pill { display: inline-block; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 1px 10px; margin-right: 4px; font-size: 12px; }
.ai-chat { flex: 1; overflow-y: auto; padding: 10px 4px; display: flex; flex-direction: column; gap: 14px; }
.ai-msg { display: flex; align-items: flex-start; gap: 9px; }
.ai-bot { justify-content: flex-start; }
.ai-user { justify-content: flex-end; }
.ai-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #2d5bff, #7a3bff); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; box-shadow: 0 3px 8px rgba(45, 91, 255, .3); }
.ai-bubble { max-width: 82%; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; font-size: 14px; line-height: 1.7; box-shadow: 0 2px 10px rgba(20,30,60,.06); word-break: break-word; }
.ai-bot .ai-bubble { border-top-left-radius: 6px; }
.ai-user .ai-bubble { background: linear-gradient(135deg, #2d5bff, #4a6bff); color: #fff; border: 0; border-bottom-right-radius: 6px; box-shadow: 0 4px 14px rgba(45, 91, 255, .3); }
.ai-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 0 8px; }
.ai-chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 500; color: var(--text); transition: all .18s ease; box-shadow: 0 1px 2px rgba(20,30,60,.04); }
.ai-chip:hover { border-color: var(--brand); color: var(--brand); background: #f4f7ff; transform: translateY(-1px); box-shadow: 0 5px 14px rgba(45, 91, 255, .14); }
.ai-chip:active { transform: translateY(0); }
.ai-inputbar { display: flex; gap: 10px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 6px 22px rgba(20,30,60,.08); }
.ai-input { flex: 1; padding: 12px 14px; border: 0; border-radius: 12px; font-size: 14px; font-family: inherit; background: var(--bg); outline: none; transition: box-shadow .15s; }
.ai-input:focus { background: #fff; box-shadow: 0 0 0 2px var(--brand); }
.ai-send { background: linear-gradient(135deg, #2d5bff, #5b3bff); color: #fff; border: 0; border-radius: 12px; padding: 0 26px; font-size: 14px; font-weight: 700; flex-shrink: 0; transition: all .18s ease; box-shadow: 0 4px 12px rgba(45, 91, 255, .3); }
.ai-send:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(45, 91, 255, .4); }
.ai-send:active { transform: translateY(0); }
.ai-preview { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; padding: 14px 16px; box-shadow: 0 2px 10px rgba(20,30,60,.05); }
.ai-preview[data-action="add"] { border-left-color: var(--ok); }
.ai-preview[data-action="close"] { border-left-color: var(--bad); }
.ai-preview[data-action="set_limit"] { border-left-color: var(--warn); }
.ai-pv-head { font-size: 14px; margin-bottom: 8px; font-weight: 500; line-height: 1.6; }
.ai-pv-head b { color: var(--brand); }
.ai-preview[data-action="add"] .ai-pv-head b { color: var(--ok); }
.ai-preview[data-action="close"] .ai-pv-head b { color: var(--bad); }
.ai-preview[data-action="set_limit"] .ai-pv-head b { color: var(--warn); }
.ai-pv-errors { color: var(--bad); font-size: 13px; padding: 8px 12px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; margin: 6px 0; }
.ai-pv-warn { color: var(--warn); font-size: 13px; padding: 8px 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; margin: 6px 0; }
.ai-pv-ok { color: var(--ok); font-weight: 700; padding: 4px 0; }
.ai-pv-actions { display: flex; gap: 10px; margin-top: 12px; }
.ai-pv-actions .btn { padding: 9px 22px; font-size: 14px; font-weight: 600; border-radius: 10px; }
.ai-pv-actions .btn.ghost { border-radius: 10px; }
.ai-cancelled { opacity: .5; filter: grayscale(.4); }
.ai-cancel-tag { display: inline-block; font-size: 12px; color: var(--muted); background: #eef1f6; border-radius: 6px; padding: 1px 9px; margin-left: 8px; }
.ai-step { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin-top: 7px; background: #fafbfd; }
.ai-step-t { font-size: 13px; }
.ai-step-r { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ai-qrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.ai-qrow:last-child { border-bottom: 0; }
.ai-qmail { font-weight: 500; word-break: break-all; }
.ai-qlim { color: var(--muted); font-size: 12px; }
.ai-page .tag { font-size: 11px; background: var(--chip); color: var(--brand); border-radius: 6px; padding: 1px 7px; margin-left: 4px; }
@media (max-width: 768px) {
  .ai-page { height: calc(100vh - 118px); }
  .ai-hero { padding: 18px; border-radius: 14px; }
  .ai-title { font-size: 17px; }
  .ai-bubble { max-width: 90%; }
  .ai-inputbar { position: sticky; bottom: 0; border-radius: 16px; }
  .ai-send { padding: 0 18px; }
}
