:root {
  --primary: #185FA5;
  --primary-dark: #0C447C;
  --primary-light: #E6F1FB;
  --teal: #0F6E56;
  --teal-light: #E1F5EE;
  --text: #2C2C2A;
  --text-sec: #5F5E5A;
  --text-hint: #888780;
  --border: #DDDBCF;
  --bg: #F6F5F1;
  --card: #FFFFFF;
  --danger: #A32D2D;
  --danger-light: #FCEBEB;
  --warn: #854F0B;
  --warn-light: #FAEEDA;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
a { color: var(--primary); text-decoration: none; }

/* ===== 顶部导航（紧凑） ===== */
.topbar { background: var(--card); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 0 16px; height: 48px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-logo { width: 28px; height: 28px; border-radius: 7px; object-fit: cover; border: 1.5px solid var(--primary); }
.brand-name { font-size: 15px; font-weight: 600; color: var(--text); display: flex; align-items: baseline; gap: 6px; }
.brand-name i { font-style: normal; font-size: 11px; color: var(--text-hint); font-weight: 400; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 5px 10px; border-radius: 6px; color: var(--text-sec); font-size: 13px; }
.nav a:hover { background: var(--primary-light); color: var(--primary); }
.nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.nav .credit-chip { background: var(--teal-light); color: var(--teal); border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 500; margin-left: 4px; cursor: pointer; white-space: nowrap; }

/* ===== 主内容区 ===== */
main { flex: 1; max-width: 1080px; width: 100%; margin: 0 auto; padding: 20px 16px 40px; overflow-y: auto; }
.footer { border-top: 1px solid var(--border); padding: 10px 14px; text-align: center; font-size: 11px; color: var(--text-hint); background: var(--card); flex-shrink: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: 8px; padding: 9px 20px; font-size: 14px; cursor: pointer; background: var(--primary); color: #fff; transition: opacity .15s; font-family: inherit; }
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--card); color: var(--primary); border: 1px solid var(--primary); }
.btn.sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn.danger { background: var(--danger); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; }
.hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; border-radius: 16px; padding: 34px 36px; margin-bottom: 26px; }
.hero h1 { font-size: 24px; margin-bottom: 8px; font-weight: 600; }
.hero p { opacity: .92; font-size: 14px; max-width: 640px; }
.hero .hero-tags { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.hero .hero-tags span { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); padding: 3px 12px; border-radius: 16px; font-size: 12px; }

.section-title { font-size: 17px; font-weight: 600; margin: 26px 0 14px; }
.grid-agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.agent-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; cursor: pointer; transition: box-shadow .15s, transform .15s; position: relative; }
.agent-card:hover { box-shadow: 0 4px 18px rgba(24,95,165,.12); transform: translateY(-2px); }
.agent-card.off { opacity: .55; cursor: not-allowed; }
.agent-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.agent-avatar { width: 44px; height: 44px; border-radius: 10px; color: #fff; font-size: 18px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.agent-name { font-size: 15px; font-weight: 600; }
.agent-tag { font-size: 11px; color: var(--primary); background: var(--primary-light); border-radius: 10px; padding: 1px 8px; margin-left: 6px; font-weight: 400; }
.agent-short { color: var(--text-sec); font-size: 13px; margin-bottom: 12px; min-height: 38px; }
.agent-position { font-size: 12px; color: var(--primary); margin-top: 2px; font-weight: 500; }
.agent-pain { font-size: 12.5px; color: var(--text-sec); margin-bottom: 6px; line-height: 1.5; }
.agent-value { font-size: 12.5px; color: var(--teal); margin-bottom: 12px; line-height: 1.5; }
.pv-label { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 4px; padding: 0 6px; margin-right: 4px; }
.pv-label.pain { background: var(--warn-light); color: var(--warn); }
.pv-label.value { background: var(--teal-light); color: var(--teal); }
.agent-foot { display: flex; align-items: center; justify-content: space-between; }
.agent-price { font-size: 13px; font-weight: 600; color: var(--teal); }
.agent-price .free { color: var(--danger); }

.auth-wrap { max-width: 400px; margin: 40px auto; }
.auth-wrap h2 { font-size: 20px; margin-bottom: 18px; text-align: center; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-sec); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: inherit; background: var(--card); color: var(--text); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); }
.error-msg { background: var(--danger-light); color: var(--danger); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.ok-msg { background: var(--teal-light); color: var(--teal); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; }
.muted { color: var(--text-hint); font-size: 13px; }

/* ===== 对话页（最大化） ===== */
.chat-layout { display: grid; grid-template-columns: 1fr 220px; gap: 14px; height: calc(100dvh - 48px - 48px); /* 减去 topbar + footer */ }
.chat-main { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.chat-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.chat-header .agent-avatar-img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; border: 1.5px solid var(--primary); flex-shrink: 0; }
.chat-header .agent-name { font-size: 14px; font-weight: 600; }
.agent-info { display: flex; flex-direction: column; gap: 5px; padding: 10px 14px; background: var(--primary-light); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.agent-info .ai-row { display: flex; align-items: flex-start; gap: 4px; font-size: 12.5px; color: var(--text); line-height: 1.5; }
.agent-info .ai-row .pv-label { flex-shrink: 0; margin-top: 1px; }
.chat-header .agent-sub { font-size: 11px; color: var(--text-hint); }
.chat-balance { margin-left: auto; font-size: 12px; color: var(--teal); font-weight: 500; white-space: nowrap; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 8px; max-width: 94%; }
.msg .bubble { border-radius: 10px; padding: 9px 13px; font-size: 14px; line-height: 1.65; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .bubble { background: var(--primary); color: #fff; }
.msg.ai .bubble { background: var(--bg); border: 1px solid var(--border); }
.msg .who { width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 600; }
.msg .who-img { width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0; object-fit: cover; border: 1px solid var(--border); }
.bubble h4 { font-size: 14px; margin: 10px 0 4px; color: var(--primary); }
.bubble h4:first-child { margin-top: 0; }
.bubble ul, .bubble ol { padding-left: 20px; margin: 4px 0; }
.bubble li { margin: 2px 0; }
.bubble blockquote { border-left: 3px solid var(--warn); background: var(--warn-light); padding: 6px 10px; border-radius: 6px; margin: 8px 0; font-size: 13px; color: var(--warn); }
.bubble strong { font-weight: 600; }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-hint); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity: .25; } 40% { opacity: 1; } }

/* 快捷问题 */
.starters { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; flex-shrink: 0; }
.starters span { background: var(--primary-light); color: var(--primary); font-size: 12px; padding: 3px 10px; border-radius: 12px; cursor: pointer; white-space: nowrap; }

/* 输入区 */
.chat-input { border-top: 1px solid var(--border); padding: 10px 14px; flex-shrink: 0; }
.chat-input textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 11px; font-size: 14px; resize: none; height: 56px; font-family: inherit; background: var(--card); }
.chat-input textarea:focus { outline: none; border-color: var(--primary); }
.chat-input-row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.chat-input-row .input-left { display: flex; align-items: center; gap: 8px; flex: 1; }
.chat-input-row .input-right { display: flex; align-items: center; gap: 10px; }

.upload-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--text-sec); font-size: 12px; cursor: pointer; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); transition: all .15s; }
.upload-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.file-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-light); color: var(--primary); font-size: 12px; padding: 3px 8px; border-radius: 12px; }
.file-chip span { cursor: pointer; opacity: .7; }
.file-chip span:hover { opacity: 1; }
.file-attach { font-size: 11px; color: var(--text-sec); margin-top: 4px; padding: 3px 6px; background: rgba(24,95,165,.08); border-radius: 4px; display: inline-block; }

.export-bar { margin-top: 8px; }

.chat-side { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.conv-list { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.conv-list h4 { font-size: 12px; color: var(--text-sec); margin-bottom: 8px; }
.conv-item { padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 12px; color: var(--text-sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item:hover { background: var(--bg); }
.conv-item.active { background: var(--primary-light); color: var(--primary); }

.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tier { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-align: center; position: relative; }
.tier.hot { border-color: var(--primary); border-width: 1.5px; }
.tier .badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: 11px; padding: 2px 12px; border-radius: 12px; }
.tier .t-label { font-size: 14px; color: var(--text-sec); }
.tier .t-credits { font-size: 26px; font-weight: 600; color: var(--primary); margin: 8px 0 2px; }
.tier .t-credits small { font-size: 13px; font-weight: 400; }
.tier .t-price { font-size: 15px; margin-bottom: 6px; }
.tier .t-note { font-size: 12px; color: var(--text-hint); margin-bottom: 14px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { border-bottom: 1px solid var(--border); padding: 9px 10px; text-align: left; }
.tbl th { color: var(--text-sec); font-weight: 500; font-size: 12px; }
.badge-status { font-size: 12px; padding: 2px 10px; border-radius: 10px; }
.badge-status.paid { background: var(--teal-light); color: var(--teal); }
.badge-status.pending { background: var(--warn-light); color: var(--warn); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat .s-num { font-size: 22px; font-weight: 600; color: var(--primary); }
.stat .s-label { font-size: 12px; color: var(--text-hint); }

.demo-banner { background: var(--warn-light); border: 1px solid #EF9F27; color: var(--warn); border-radius: 10px; padding: 10px 16px; font-size: 13px; margin-bottom: 18px; }
.grant-row { display: flex; gap: 6px; align-items: center; }
.grant-row input { width: 80px; border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: 13px; }

/* ===== 管理后台 ===== */
.admin-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-tab { padding: 8px 18px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text-sec); font-size: 14px; cursor: pointer; transition: all .15s; font-family: inherit; }
.admin-tab:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.admin-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 500; }

.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-card .stat-num { font-size: 26px; font-weight: 700; }
.stat-card .stat-label { font-size: 13px; color: var(--text-hint); margin-top: 4px; }

.admin-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.search-input { width: 260px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 14px; font-family: inherit; background: var(--bg); }
.search-input:focus { outline: none; border-color: var(--primary); }
.filter-group { display: flex; gap: 6px; }

.role-badge { font-size: 12px; padding: 2px 10px; border-radius: 10px; font-weight: 500; }
.role-badge.admin { background: var(--primary-light); color: var(--primary); }
.role-badge.user { background: var(--bg); color: var(--text-sec); }

.recent-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.recent-row:last-child { border-bottom: none; }
.recent-row .r-name { font-weight: 500; color: var(--text); }
.recent-row .r-meta { color: var(--text-hint); font-size: 12px; }

.price-edit { display: flex; align-items: center; gap: 8px; }
.price-edit input { border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; font-size: 13px; font-family: inherit; }

/* 模态框 */
.modal-mask, .modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { background: var(--card); border-radius: var(--radius); max-width: 700px; width: 100%; max-height: 90vh; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 600; }
.modal-close { cursor: pointer; color: var(--text-hint); font-size: 22px; line-height: 1; padding: 0 4px; text-decoration: none; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 16px 20px; overflow-y: auto; max-height: calc(90vh - 60px); }
.user-info-bar { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-sec); background: var(--bg); padding: 10px 14px; border-radius: 8px; }

/* ===== 移动端 ===== */
@media (max-width: 860px) {
  .chat-layout { grid-template-columns: 1fr; height: calc(100dvh - 48px); }
  .chat-side { display: none; }
  .chat-main { border-radius: 0; border-left: none; border-right: none; border-bottom: none; }
  .chat-header { padding: 8px 12px; }
  .chat-header .agent-avatar-img { width: 28px; height: 28px; }
  .chat-header .agent-name { font-size: 13px; }
  .chat-messages { padding: 10px; gap: 10px; }
  .msg .bubble { font-size: 13px; padding: 8px 11px; }
  .starters { padding: 6px 12px 0; }
  .starters span { font-size: 11px; padding: 2px 8px; }
  .chat-input { padding: 8px 12px; }
  .chat-input textarea { height: 48px; font-size: 13px; }
  .nav a.hide-m { display: none; }
  .nav { flex-wrap: wrap; justify-content: flex-end; gap: 2px; }
  .nav a { font-size: 12px; padding: 4px 7px; }
  .nav .credit-chip { font-size: 11px; padding: 2px 8px; }
  .topbar-inner { height: auto; min-height: 48px; flex-wrap: wrap; padding: 4px 10px; }
  .hero { padding: 24px; }
  .hero h1 { font-size: 20px; }
  .admin-two-col { grid-template-columns: 1fr; }
  .search-input { width: 100%; }
  .modal-card { max-width: 100%; }
}

/* ===== V1.5.5 公网链接弹窗 + 自愈守护 ===== */
.tunnel-card { max-width: 520px; }
.tunnel-card .modal-body { padding: 20px; }
.tunnel-loading { text-align: center; color: var(--text-hint); padding: 40px 0; }
.tunnel-status { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bg); border-radius: 8px; font-size: 13px; color: var(--text-sec); margin-bottom: 14px; flex-wrap: wrap; }
.tunnel-status .dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(0,0,0,.04); }
.tunnel-status .gen { background: var(--primary-light); color: var(--primary); padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tunnel-status .updated { margin-left: auto; color: var(--text-hint); font-size: 12px; }
.tunnel-changed { background: #FFF8E5; border: 1px solid #EBC66A; color: #8B6914; padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.tunnel-url-box { display: flex; gap: 6px; margin-bottom: 12px; }
.tunnel-url-box input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--bg); color: var(--text); }
.tunnel-url-box input:focus { outline: 2px solid var(--primary-light); border-color: var(--primary); }
.tunnel-copy-btn { padding: 10px 14px; background: var(--primary); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 13px; white-space: nowrap; transition: background .15s; font-family: inherit; }
.tunnel-copy-btn:hover { background: var(--primary-deep, #163E6F); }
.tunnel-copy-btn.copied { background: #0F6E56; }
.tunnel-hint { font-size: 12.5px; color: var(--text-hint); line-height: 1.7; padding: 8px 12px; background: rgba(24,95,165,.05); border-radius: 6px; margin-bottom: 12px; }
.tunnel-qr { text-align: center; padding-top: 4px; }
.tunnel-qr-title { font-size: 12px; color: var(--text-hint); margin-bottom: 8px; }
.tunnel-qr img, .tunnel-qr canvas { display: inline-block !important; }
.tunnel-empty { text-align: center; color: var(--text-sec); padding: 30px 12px; font-size: 13.5px; line-height: 1.8; }
.tunnel-empty small { color: var(--text-hint); }
/* 微信扫码支付弹窗（V1.7） */
.pay-qr-card { max-width: 340px; padding: 22px 20px 18px; text-align: center; }
.pay-qr-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.pay-qr-amount { font-size: 28px; font-weight: 700; color: #07C160; margin: 4px 0 2px; }
.pay-qr-sub { font-size: 13px; color: var(--text-sec); margin-bottom: 12px; }
.pay-qr-hint { font-size: 12px; color: var(--text-hint); line-height: 1.7; margin: 10px 0 6px; }
.pay-qr-status { font-size: 12.5px; color: var(--text-sec); background: rgba(24,95,165,.06); border-radius: 6px; padding: 8px 10px; margin-bottom: 12px; }
/* 顶栏按钮 */
.tunnel-link-btn { font-size: 13px; padding: 6px 10px; border-radius: 6px; color: var(--text-sec); text-decoration: none; }
.tunnel-link-btn:hover { color: var(--primary); background: var(--primary-light); }

/* ===== 新手任务：3 步拿高端单 ===== */
.task-card { padding: 20px 22px; border: 1px solid #E8E3D2; background: linear-gradient(135deg, #FFFDF7 0%, #FBF6E9 100%); }
.task-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.task-card-title { font-size: 17px; font-weight: 700; color: var(--text); }
.task-card-sub { font-size: 13px; color: var(--text-sec); margin-top: 4px; max-width: 560px; }
.task-progress { height: 6px; background: #EFE9DA; border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.task-progress-bar { height: 100%; background: linear-gradient(90deg, #EF9F27, #E8850C); border-radius: 3px; transition: width .4s; }
.task-step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); margin-bottom: 8px; }
.task-step.done { background: #F2F8F3; border-color: #CDE7D3; }
.task-step-icon { width: 30px; height: 30px; min-width: 30px; border-radius: 50%; background: #EF9F27; color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.task-step.done .task-step-icon { background: #2E9E5B; }
.task-step-body { flex: 1; min-width: 0; }
.task-step-title { font-size: 14px; font-weight: 600; color: var(--text); }
.task-step-desc { font-size: 12px; color: var(--text-hint); margin-top: 2px; }
.task-done-flag { display: inline-block; font-size: 11px; color: #2E9E5B; background: #E5F4EA; border-radius: 4px; padding: 1px 6px; margin-left: 6px; font-weight: 500; }
.task-claimed { font-size: 14px; color: #2E9E5B; font-weight: 600; }
.task-modal { max-width: 460px; padding: 22px 22px 18px; text-align: center; }
.task-modal-hero { font-size: 14px; color: #854F0B; background: #FAEEDA; border-radius: 8px; padding: 6px 10px; font-weight: 600; }
.task-modal .task-step { text-align: left; }
.task-modal .btn { margin-top: 12px; }
.task-hint { width: 100%; font-size: 12px; color: #854F0B; background: #FAEEDA; border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; }
@media (max-width: 860px) {
  .task-card { padding: 16px; }
  .task-card-head { flex-direction: column; }
  .task-step-desc { display: none; }
}

/* ===== 头像（易效宝形象） ===== */
.agent-head .agent-avatar-img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); background: #fff; }
.btn-mem { margin-left: auto; }
.btn-history { margin-left: 6px; display: none; }
.mem-count { display: inline-block; background: var(--primary); color: #fff; font-size: 10px; font-weight: 600; border-radius: 8px; padding: 0 6px; line-height: 16px; margin-left: 2px; }

/* ===== 一问一答 ===== */
.chat-messages .qa { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; border-bottom: 1px dashed var(--border); }
.chat-messages .qa:last-child { border-bottom: none; padding-bottom: 0; }
.qa-q { display: flex; align-items: flex-start; gap: 10px; background: var(--primary-light); border-radius: 10px; padding: 10px 14px; }
.qa-n { flex-shrink: 0; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 2px 7px; margin-top: 3px; }
.qa-q-text { flex: 1; font-size: 14px; font-weight: 500; color: var(--primary-dark); line-height: 1.65; word-break: break-word; }
.qa-a { display: flex; align-items: flex-start; gap: 10px; padding: 0 2px; }
.qa-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); background: #fff; }
.qa-a-main { flex: 1; min-width: 0; }
.qa-a-name { font-size: 12px; color: var(--text-hint); margin-bottom: 5px; }
.qa-content { font-size: 14px; line-height: 1.75; color: var(--text); word-break: break-word; }
.qa-content strong { font-weight: 600; }
.qa-content h4 { font-size: 14px; margin: 10px 0 4px; color: var(--primary); }
.qa-content h4:first-child { margin-top: 0; }
.qa-content ul, .qa-content ol { padding-left: 20px; margin: 4px 0; }
.qa-content li { margin: 2px 0; }
.qa-content blockquote { border-left: 3px solid var(--warn); background: var(--warn-light); padding: 6px 10px; border-radius: 6px; margin: 8px 0; font-size: 13px; color: var(--warn); }

/* ===== V1.5.4 答案操作栏（复制 / 重新提问）===== */
.qa-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity .2s, max-height .2s;
}
.qa-actions.show { opacity: 1; max-height: 40px; }
.qa-action {
  font-size: 12px;
  color: var(--text-hint);
  background: #fff;
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  font-family: inherit;
  line-height: 1.5;
}
.qa-action:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}
.qa-action.copied {
  color: #0F6E56;
  border-color: #0F6E56;
  background: rgba(15,110,86,.08);
}
.qa-action.fail {
  color: #A32D2D;
  border-color: #A32D2D;
  background: rgba(163,45,45,.08);
}
/* 移动端操作栏默认可见，避免悬浮不可用 */
@media (max-width: 860px) {
  .qa-actions { opacity: 1; max-height: 40px; }
}

/* 空态引导 */
.qa-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 16px; gap: 6px; }
.qa-empty-img { width: 96px; height: 96px; border-radius: 20px; margin-bottom: 6px; box-shadow: 0 6px 20px rgba(24,95,165,.16); }
.qa-empty-title { font-size: 17px; font-weight: 700; color: var(--text); }
.qa-empty-agent { font-size: 12.5px; color: var(--primary); background: var(--primary-light); padding: 2px 12px; border-radius: 12px; }
.qa-empty-desc { font-size: 13.5px; color: var(--text-sec); max-width: 580px; line-height: 1.8; margin-top: 8px; text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 15px; }
.qa-empty-tip { font-size: 12px; color: var(--text-hint); margin-top: 10px; }

/* ===== 历史记录 ===== */
.conv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.conv-head h4 { flex: 1; font-size: 13px; font-weight: 600; color: var(--text); }
.conv-total { font-size: 11px; color: var(--text-hint); background: var(--bg); padding: 1px 8px; border-radius: 8px; }
.conv-close { display: none; cursor: pointer; color: var(--text-hint); font-size: 14px; padding: 0 4px; }
.conv-item { position: relative; padding: 8px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; margin-bottom: 4px; }
.conv-item:hover { background: var(--bg); }
.conv-item.active { background: var(--primary-light); border-color: #C9DEF2; }
.conv-title { font-size: 12.5px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 20px; }
.conv-meta { font-size: 11px; color: var(--text-hint); display: flex; gap: 10px; margin-top: 2px; }
.conv-del { position: absolute; right: 6px; top: 7px; font-size: 11px; color: var(--text-hint); opacity: 0; transition: opacity .15s; padding: 1px 5px; border-radius: 4px; }
.conv-item:hover .conv-del { opacity: .75; }
.conv-del:hover { background: var(--danger-light); color: var(--danger); opacity: 1; }
.conv-empty { font-size: 12px; line-height: 1.7; text-align: center; padding: 12px 4px; }

/* ===== 移动端：历史记录抽屉 + 问答缩放 ===== */
@media (max-width: 860px) {
  /* 对话页自适应可用高度（顶栏在移动端会换行，固定高度会挤出输入区） */
  main.app-chat { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
  main.app-chat .chat-layout { height: 100%; min-height: 0; }
  main.app-chat .chat-main { min-height: 0; }
  .chat-side.open { display: flex; position: fixed; inset: 0; z-index: 120; background: var(--bg); padding: 14px; overflow-y: auto; gap: 0; }
  .conv-close { display: block; }
  .conv-item { padding: 10px 12px; }
  .conv-del { opacity: .6; }
  .qa-avatar { width: 28px; height: 28px; }
  .qa-n { font-size: 10px; padding: 2px 6px; }
  .qa-q { padding: 8px 11px; }
  .qa-q-text { font-size: 13px; }
  .qa-content { font-size: 13px; }
  .qa-empty { padding: 16px 8px; }
  .qa-empty-img { width: 78px; height: 78px; }
  .qa-empty-title { font-size: 15px; }
  .qa-empty-desc { font-size: 12.5px; }
  .btn-history { display: inline-flex; padding: 4px 9px; font-size: 12px; }
}

/* ================= V1.5 界面美化 + 高端财税统领官（2026-09-19） ================= */

/* ---- 全局质感 ---- */
body {
  background:
    radial-gradient(900px 340px at 85% -60px, rgba(24,95,165,.10), rgba(0,0,0,0) 70%),
    radial-gradient(700px 300px at -80px 30%, rgba(15,110,86,.07), rgba(0,0,0,0) 70%),
    var(--bg);
}
.topbar {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(221,219,207,.8);
  box-shadow: 0 1px 12px rgba(24,95,165,.06);
}
.brand-name { font-size: 16px; letter-spacing: .5px; }
.nav a { transition: background .15s, color .15s; }

/* ---- 按钮升级：主色渐变 + 光泽 ---- */
.btn { background: linear-gradient(135deg, #2273BE 0%, var(--primary) 55%, var(--primary-dark) 100%); box-shadow: 0 2px 8px rgba(24,95,165,.22); border-radius: 9px; }
.btn:hover { opacity: 1; filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { filter: none; transform: none; }
.btn.ghost { background: var(--card); box-shadow: none; }

/* ---- Hero 首屏：深蓝渐变 + 易效宝形象 + 装饰光斑 ---- */
.hero {
  position: relative;
  display: flex; align-items: center; gap: 28px;
  background:
    radial-gradient(500px 260px at 90% -30%, rgba(94,164,224,.35), rgba(0,0,0,0) 65%),
    radial-gradient(420px 240px at 8% 115%, rgba(15,110,86,.28), rgba(0,0,0,0) 60%),
    linear-gradient(128deg, #1E68AC 0%, var(--primary-dark) 58%, #082F55 100%);
  border-radius: 20px; padding: 38px 42px; margin-bottom: 28px;
  overflow: hidden;
  box-shadow: 0 10px 34px rgba(12,68,124,.28);
}
.hero::before {
  content: ""; position: absolute; left: -60px; top: -80px; width: 260px; height: 260px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.14); pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; right: 18%; bottom: -110px; width: 220px; height: 220px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.10); pointer-events: none;
}
.hero-body { position: relative; z-index: 2; flex: 1; }
.hero-badge {
  display: inline-block; font-size: 12px; letter-spacing: 1px;
  color: #CFE4F7; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12);
  border-radius: 20px; padding: 3px 14px; margin-bottom: 14px;
}
.hero h1 { font-size: 27px; line-height: 1.45; margin-bottom: 10px; font-weight: 700; letter-spacing: .5px; }
.hero p { opacity: .93; font-size: 13.5px; max-width: 660px; }
.hero .hero-tags { margin-top: 16px; }
.hero .hero-tags span { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.28); padding: 4px 13px; border-radius: 16px; font-size: 12px; backdrop-filter: blur(2px); }
.hero-avatar { position: relative; z-index: 2; width: 118px; height: 118px; flex-shrink: 0; filter: drop-shadow(0 8px 18px rgba(0,0,0,.35)); }

/* ---- 区块标题：金色短杠 + 主标 ---- */
.section-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; margin: 30px 0 16px; }
.section-title::before { content: ""; width: 5px; height: 20px; border-radius: 3px; background: linear-gradient(180deg, #C99A3C, #8A5A00); flex-shrink: 0; }
.section-title small { font-size: 12px; color: var(--text-hint); font-weight: 400; margin-left: 2px; }

/* ---- 统领官旗舰横幅卡：藏蓝金双色 ---- */
.flagship-card {
  position: relative; border-radius: 18px; overflow: hidden; cursor: pointer; margin-bottom: 6px;
  background:
    radial-gradient(420px 200px at 96% -40px, rgba(201,154,60,.30), rgba(0,0,0,0) 62%),
    linear-gradient(120deg, #123B63 0%, #0C447C 52%, #0A3158 100%);
  box-shadow: 0 8px 26px rgba(12,68,124,.30);
  transition: transform .18s, box-shadow .18s;
}
.flagship-card:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(12,68,124,.42); }
.flagship-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, #E5C173 0%, #C99A3C 55%, #8A5A00 100%);
}
.flagship-main { position: relative; z-index: 2; padding: 22px 26px 20px 30px; }
.flagship-head { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.flagship-avatar {
  width: 58px; height: 58px; border-radius: 14px; object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(229,193,115,.85); box-shadow: 0 4px 14px rgba(0,0,0,.35);
  background: #fff;
}
.flagship-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flagship-name { font-size: 19px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.flagship-badge {
  font-size: 11.5px; font-weight: 600; color: #F3DCA8;
  background: linear-gradient(135deg, rgba(201,154,60,.32), rgba(201,154,60,.14));
  border: 1px solid rgba(229,193,115,.55); border-radius: 20px; padding: 2px 12px;
}
.flagship-position { font-size: 12.5px; color: #BBD5EC; margin-top: 4px; letter-spacing: .5px; }
.flagship-desc { color: rgba(255,255,255,.90); font-size: 13.5px; margin-bottom: 12px; max-width: 780px; line-height: 1.7; }
.flagship-modules { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.flagship-modules span {
  font-size: 12px; color: #D9E9F7; background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.22); border-radius: 14px; padding: 2px 12px;
}
.flagship-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flagship-foot .agent-price { color: #F3DCA8; }
.flagship-btn {
  background: linear-gradient(135deg, #E5C173 0%, #C99A3C 60%, #A87E28 100%);
  color: #213041; font-weight: 600; border: none; box-shadow: 0 3px 12px rgba(201,154,60,.35);
}
.flagship-btn:hover { filter: brightness(1.06); }

/* ---- 专业智能体卡片：顶部彩条 + 悬浮层次 ---- */
.grid-agents { gap: 16px; }
.agent-card { border-radius: 14px; overflow: hidden; border-color: #E3E0D4; box-shadow: 0 1px 4px rgba(44,44,42,.04); }
.agent-card-accent { position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.agent-card:hover { box-shadow: 0 10px 28px rgba(24,95,165,.16); transform: translateY(-3px); }
.agent-head .agent-avatar-img { border-radius: 12px; box-shadow: 0 3px 10px rgba(24,95,165,.18); border: 1.5px solid rgba(24,95,165,.25); }
.agent-name { font-size: 15.5px; }
.agent-short { min-height: 42px; }
.agent-foot { border-top: 1px dashed #E5E2D6; padding-top: 12px; }

/* ---- 对话页头部小幅升级 ---- */
.chat-main { box-shadow: 0 2px 14px rgba(24,95,165,.06); }
.chat-header { background: linear-gradient(180deg, #FBFCFE, #F4F8FC); }

/* ---- 对话正文：markdown 分隔线 / 表格 ---- */
.md-hr { border: none; border-top: 1px dashed #DCD9CC; margin: 12px 0; }
.md-table-wrap { overflow-x: auto; margin: 10px 0; border: 1px solid #E3E0D4; border-radius: 10px; }
.md-table { border-collapse: collapse; width: 100%; font-size: 13px; background: #fff; }
.md-table th, .md-table td { padding: 7px 12px; text-align: left; border-bottom: 1px solid #EDEAE0; vertical-align: top; }
.md-table thead th { background: #EEF4FB; color: var(--primary-dark); font-weight: 600; white-space: nowrap; }
.md-table tbody tr:last-child td { border-bottom: none; }
.md-table tbody tr:nth-child(even) { background: #FAFBFC; }

/* ---- 移动端适配（首页 hero / 旗舰卡 / 顶栏） ---- */
@media (max-width: 860px) {
  /* 顶栏紧凑，避免换行过高 */
  .topbar-inner { padding: 7px 12px; height: auto; min-height: 44px; flex-wrap: wrap; row-gap: 4px; }
  .brand-name { font-size: 14px; }
  .brand-logo { width: 24px; height: 24px; }
  .nav { gap: 2px; flex-wrap: wrap; }
  .nav a { padding: 4px 7px; font-size: 12px; }
  .nav .credit-chip { font-size: 11px; padding: 2px 8px; margin-left: 2px; }

  /* Hero：竖排，头像置顶，文字占满宽度 */
  .hero { flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px 18px; border-radius: 16px; }
  .hero-body { width: 100%; }
  .hero-avatar { width: 66px; height: 66px; order: -1; }
  .hero-badge { font-size: 11px; padding: 2px 11px; margin-bottom: 10px; }
  .hero h1 { font-size: 18px; line-height: 1.5; }
  .hero p { font-size: 12.5px; }
  .hero .hero-tags { margin-top: 12px; gap: 6px; }
  .hero .hero-tags span { font-size: 11px; padding: 3px 9px; }
  .flagship-main { padding: 18px 18px 16px 22px; }
  .flagship-avatar { width: 48px; height: 48px; border-radius: 12px; }
  .flagship-name { font-size: 16.5px; }
  .flagship-desc { font-size: 12.5px; }
  .flagship-modules span { font-size: 11px; padding: 2px 9px; }
  .section-title { font-size: 16px; margin: 22px 0 12px; }
}

/* ---- 多文件上传与对话内图片识别展示（V1.5.2） ---- */
.file-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; max-width: 100%; vertical-align: middle; }
.file-chip.img { padding: 2px 6px 2px 2px; gap: 5px; }
.file-chip.img img { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; background: #fff; }
.file-chip.img i { font-style: normal; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-q-text .qa-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.qa-imgs img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(255,255,255,.55); cursor: zoom-in; background: #fff; transition: transform .15s, box-shadow .15s; }
.qa-imgs img:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.18); }
@media (max-width: 860px) {
  .qa-imgs img { width: 78px; height: 78px; }
  .file-chip.img i { max-width: 72px; }
}

/* ===== V1.6 智能体记忆面板 ===== */
.mem-card { max-width: 560px; }
.mem-card .modal-body { padding: 14px 18px; }
.mem-group { margin-bottom: 14px; }
.mem-group-title { font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 6px; padding-left: 8px; border-left: 3px solid var(--primary); }
.mem-group-n { font-weight: 400; color: var(--text-hint); font-size: 12px; }
.mem-item { position: relative; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 34px 8px 12px; margin-bottom: 6px; }
.mem-text { font-size: 13px; color: var(--text); line-height: 1.6; word-break: break-word; }
.mem-meta { font-size: 11px; color: var(--text-hint); margin-top: 3px; }
.mem-del { position: absolute; right: 8px; top: 8px; cursor: pointer; color: var(--text-hint); font-size: 13px; padding: 2px 4px; }
.mem-del:hover { color: #A32D2D; }
.mem-empty { text-align: center; font-size: 13px; color: var(--text-sec); line-height: 1.9; padding: 22px 10px; }
.mem-hint { font-size: 12px; color: var(--text-hint); background: var(--warn-light); border-radius: 8px; padding: 8px 12px; line-height: 1.7; margin-top: 4px; }
.mem-hint-cmd { margin-bottom: 10px; }
.mem-foot { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.mem-add-input { flex: 1; min-width: 200px; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: inherit; }
.mem-add-input:focus { outline: none; border-color: var(--primary); }
.mem-clear-btn { color: #A32D2D; }
.mem-clear-btn:hover { border-color: #A32D2D; }

/* ===== V1.6 统领官调度卡片 ===== */
.dispatch-card { background: linear-gradient(135deg, rgba(138,90,0,.06), rgba(24,95,165,.05)); border: 1px solid rgba(138,90,0,.25); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.dispatch-head { font-size: 13px; font-weight: 600; color: #8A5A00; margin-bottom: 6px; }
.dispatch-reason { font-weight: 400; font-size: 12px; color: var(--text-hint); margin-left: 8px; }
.dispatch-row { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; font-size: 12.5px; }
.dispatch-status { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: #bbb; }
.dispatch-status.run { background: var(--warn); animation: dispatchPulse 1.1s ease-in-out infinite; }
.dispatch-status.ok { background: #0F6E56; }
.dispatch-status.fail { background: #A32D2D; }
@keyframes dispatchPulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.dispatch-name { flex-shrink: 0; font-weight: 600; color: var(--text); }
.dispatch-task { color: var(--text-sec); line-height: 1.5; }
.dispatch-note { font-size: 11.5px; color: var(--text-hint); margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
