/* ===== AI 询价助手 单页对话样式 ===== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
    margin: 0; padding: 0; height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #eef2f7;
    color: #1f2937;
}
.agent-app {
    display: flex; flex-direction: column;
    height: 100vh; height: 100dvh;
    max-width: 720px; margin: 0 auto;
    background: #f6f8fb;
    box-shadow: 0 0 40px rgba(30, 58, 138, 0.08);
    overflow: hidden;
}

/* 顶栏 */
.agent-header {
    display: flex; align-items: center; gap: 12px;
    padding: calc(env(safe-area-inset-top) + 14px) 18px 14px;
    background: linear-gradient(120deg, #2563eb 0%, #0891b2 100%);
    color: #fff;
}
.agent-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.agent-headtext { flex: 1; min-width: 0; }
.agent-title { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.agent-sub { font-size: 12px; opacity: .82; margin-top: 2px; }
.agent-status { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 6px; }
.agent-status .dot {
    width: 8px; height: 8px; border-radius: 50%; background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74,222,128,.25);
}

/* Hero 价值主张区 */
.agent-hero {
    padding: 16px 18px 14px;
    background: linear-gradient(180deg, rgba(37,99,235,.06), rgba(8,145,178,.03));
    border-bottom: 1px solid #e6ebf2;
}
.hero-title {
    margin: 0; font-size: 17px; font-weight: 700; color: #0f172a; line-height: 1.4;
    letter-spacing: .2px;
}
.hero-sub {
    margin: 6px 0 0; font-size: 13px; color: #64748b; line-height: 1.5;
}
.hero-chips {
    display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap;
}
.hero-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; color: #1e40af; background: #eaf1ff;
    border: 1px solid #d6e4ff; border-radius: 999px; padding: 4px 11px;
}
.hero-chip i { font-size: 11px; opacity: .85; }

/* 底部联系条 */
.agent-footer {
    padding: 11px 18px calc(env(safe-area-inset-bottom) + 11px);
    background: #fff; border-top: 1px solid #e6ebf2;
}
.ft-line { font-size: 12.5px; color: #334155; line-height: 1.7; }
.ft-muted { color: #94a3b8; font-size: 11.5px; margin-top: 2px; }
.ft-k { color: #64748b; margin-right: 6px; }
.ft-v { color: #1e293b; font-weight: 600; }
.ft-sep { color: #cbd5e1; margin: 0 8px; }

/* 消息区 */
.agent-messages {
    flex: 1; overflow-y: auto;
    padding: 18px 16px 8px;
    display: flex; flex-direction: column; gap: 14px;
    background:
        radial-gradient(1200px 400px at 100% -10%, rgba(37,99,235,.05), transparent),
        radial-gradient(900px 360px at -10% 110%, rgba(8,145,178,.05), transparent),
        #f6f8fb;
}
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg .bubble {
    padding: 11px 14px; border-radius: 16px; line-height: 1.6; font-size: 14.5px;
    white-space: pre-wrap; word-break: break-word;
}
.msg.bot { align-self: flex-start; }
.msg.bot .ava {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(120deg,#2563eb,#0891b2); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.msg.bot .bubble {
    background: #fff; border: 1px solid #e6ebf2; color: #1f2937;
    border-top-left-radius: 4px;
    box-shadow: 0 4px 14px rgba(30,58,138,.06);
}
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .bubble {
    background: linear-gradient(120deg,#2563eb,#0891b2); color: #fff;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 14px rgba(37,99,235,.18);
}

/* 打字指示 */
.agent-typing {
    align-self: flex-start; display: flex; gap: 5px; padding: 12px 16px;
    background: #fff; border: 1px solid #e6ebf2; border-radius: 16px;
    border-top-left-radius: 4px; margin-left: 44px;
}
.agent-typing span {
    width: 7px; height: 7px; border-radius: 50%; background: #94a3b8;
    animation: blink 1.2s infinite ease-in-out;
}
.agent-typing span:nth-child(2) { animation-delay: .2s; }
.agent-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100%{opacity:.3;transform:translateY(0)} 40%{opacity:1;transform:translateY(-3px)} }

/* 确认卡 */
.confirm-card {
    align-self: flex-start; max-width: 92%; width: 100%;
    background: #fff; border: 1px solid #e6ebf2; border-radius: 16px;
    box-shadow: 0 8px 24px rgba(30,58,138,.10); overflow: hidden;
    margin-left: 44px;
}
.confirm-card .cc-head {
    background: linear-gradient(120deg,#2563eb,#0891b2); color: #fff;
    padding: 10px 16px; font-weight: 700; font-size: 14.5px;
    display: flex; align-items: center; gap: 8px;
}
.cc-body { padding: 6px 16px 12px; }
.cc-row {
    display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #eef1f6; font-size: 14px;
}
.cc-row:last-child { border-bottom: none; }
.cc-label { width: 84px; flex-shrink: 0; color: #64748b; text-align: justify; text-align-last: justify; }
.cc-value { flex: 1; color: #0f172a; font-weight: 500; word-break: break-word; }
.cc-actions { display: flex; gap: 10px; padding: 12px 16px 16px; }
.cc-actions button {
    flex: 1; border: none; border-radius: 10px; padding: 11px 0; font-size: 14.5px;
    font-weight: 700; cursor: pointer; transition: transform .12s, box-shadow .12s;
}
.cc-actions .btn-ok { background: linear-gradient(120deg,#2563eb,#0891b2); color: #fff; }
.cc-actions .btn-edit { background: #f1f5f9; color: #475569; }
.cc-actions button:active { transform: scale(.97); }
.cc-group {
    font-size: 12px; font-weight: 700; color: #2563eb;
    margin: 10px 0 2px; padding-left: 2px; letter-spacing: .3px;
}
.cc-group:first-child { margin-top: 4px; }

/* 产品检索结果卡片（接地可视化） */
.prod-pick {
    align-self: flex-start; max-width: 92%; width: 100%;
    background: #fff; border: 1px solid #e6ebf2; border-radius: 16px;
    box-shadow: 0 8px 24px rgba(30,58,138,.08); overflow: hidden; margin-left: 44px;
}
.prod-pick .pp-head {
    background: #f0f6ff; color: #1e3a8a; padding: 9px 14px; font-size: 13px; font-weight: 600;
    display: flex; align-items: center; gap: 7px; border-bottom: 1px solid #e6ebf2;
}
.prod-pick .pp-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    border-bottom: 1px dashed #eef1f6;
}
.prod-pick .pp-item:last-child { border-bottom: none; }
.prod-pick .pp-main { flex: 1; min-width: 0; }
.prod-pick .pp-name { font-size: 14px; font-weight: 700; color: #0f172a; }
.prod-pick .pp-en { font-size: 12px; font-weight: 500; color: #94a3b8; margin-left: 6px; }
.prod-pick .pp-meta { font-size: 12px; color: #64748b; margin-top: 2px; }
.prod-pick .pp-choose {
    flex-shrink: 0; border: none; border-radius: 9px; padding: 8px 14px;
    background: linear-gradient(120deg,#2563eb,#0891b2); color: #fff;
    font-size: 13px; font-weight: 700; cursor: pointer; transition: transform .12s;
}
.prod-pick .pp-choose:active { transform: scale(.95); }

/* 成功提示 */
.msg.success .bubble {
    background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46;
    font-weight: 600; align-self: flex-start;
}

/* 输入栏 */
.agent-inputbar {
    display: flex; align-items: flex-end; gap: 10px;
    padding: 12px 14px calc(env(safe-area-inset-bottom) + 12px);
    background: #fff; border-top: 1px solid #e6ebf2;
}
.agent-inputbar textarea {
    flex: 1; resize: none; border: 1px solid #dbe2ea; border-radius: 14px;
    padding: 11px 14px; font-size: 14.5px; line-height: 1.5; max-height: 120px;
    outline: none; font-family: inherit; background: #f8fafc;
    transition: border-color .15s, box-shadow .15s;
}
.agent-inputbar textarea:focus {
    border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: #fff;
}
.agent-inputbar button {
    width: 46px; height: 46px; border: none; border-radius: 14px; flex-shrink: 0;
    background: linear-gradient(120deg,#2563eb,#0891b2); color: #fff; font-size: 18px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform .12s, opacity .12s;
}
.agent-inputbar button:active { transform: scale(.93); }
.agent-inputbar button:disabled { opacity: .55; cursor: default; }

@media (max-width: 480px) {
    .msg { max-width: 94%; }
    .confirm-card { margin-left: 0; }
    .prod-pick { margin-left: 0; }
    .agent-hero { padding: 13px 14px 12px; }
    .hero-title { font-size: 16px; }
    .agent-footer { padding: 10px 14px calc(env(safe-area-inset-bottom) + 10px); }
}
