/* AOW5 AI 问答 widget 样式（scoped，前缀 aowai-，尽量复用站点主色） */
.aowai-fab {
    position: fixed; right: 18px; bottom: 18px; z-index: 9998;
    width: 54px; height: 54px; border-radius: 50%;
    background: var(--primary, #255A41); color: #fff; border: none; cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.24); display: flex; align-items: center; justify-content: center;
    transition: transform .15s ease;
}
.aowai-fab:hover { transform: scale(1.06); }
.aowai-fab svg { width: 26px; height: 26px; }
.aowai-fab .aowai-badge {
    position: absolute; top: -2px; right: -2px; width: 14px; height: 14px; border-radius: 50%;
    background: #e8503a; border: 2px solid #fff;
}

.aowai-panel {
    position: fixed; right: 18px; bottom: 82px; z-index: 9999;
    width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 110px));
    background: #fff; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.28);
    display: none; flex-direction: column; overflow: hidden;
    font-family: inherit;
}
.aowai-panel.aowai-open { display: flex; }

.aowai-head {
    background: var(--primary, #255A41); color: #fff; padding: 12px 14px;
    display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
}
.aowai-head .aowai-title { font-weight: 700; font-size: 15px; flex: 1; }
.aowai-head .aowai-sub { font-size: 11px; opacity: .8; font-weight: 400; }
.aowai-head button { background: rgba(255,255,255,.16); border: none; color: #fff; cursor: pointer;
    width: 26px; height: 26px; border-radius: 6px; font-size: 16px; line-height: 1; }
.aowai-head button:hover { background: rgba(255,255,255,.3); }

.aowai-body { flex: 1 1 auto; overflow-y: auto; padding: 12px; background: var(--bg, #F5F6F7); }
.aowai-msg { margin-bottom: 10px; display: flex; }
.aowai-msg.aowai-user { justify-content: flex-end; }
.aowai-bubble {
    max-width: 84%; padding: 8px 11px; border-radius: 12px; font-size: 13.5px; line-height: 1.6;
    white-space: pre-wrap; word-break: break-word;
}
.aowai-user .aowai-bubble { background: var(--primary, #255A41); color: #fff; border-bottom-right-radius: 3px; }
.aowai-bot .aowai-bubble { background: #fff; color: #222; border: 1px solid #e6e8ea; border-bottom-left-radius: 3px; }
.aowai-bubble strong { font-weight: 700; }
.aowai-bubble code { background: rgba(0,0,0,.06); padding: 1px 4px; border-radius: 4px; font-size: 12px; }
.aowai-bubble.aowai-err { background: var(--bad-bg, #fdecea); color: #b3261e; border-color: #f5c2c0; }
.aowai-typing { display: inline-flex; gap: 3px; }
.aowai-typing i { width: 6px; height: 6px; border-radius: 50%; background: #9aa; animation: aowai-blink 1.2s infinite; }
.aowai-typing i:nth-child(2){animation-delay:.2s} .aowai-typing i:nth-child(3){animation-delay:.4s}
@keyframes aowai-blink { 0%,60%,100%{opacity:.25} 30%{opacity:1} }

.aowai-input { flex: 0 0 auto; display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #eceef0; background: #fff; }
.aowai-input textarea {
    flex: 1; resize: none; border: 1px solid #d9dde0; border-radius: 10px; padding: 8px 10px;
    font-size: 13.5px; font-family: inherit; height: 38px; max-height: 90px; outline: none; line-height: 1.4;
}
.aowai-input textarea:focus { border-color: var(--primary, #255A41); }
.aowai-send {
    flex: 0 0 auto; width: 40px; border: none; border-radius: 10px; background: var(--primary, #255A41);
    color: #fff; cursor: pointer; font-size: 16px;
}
.aowai-send:disabled { opacity: .5; cursor: not-allowed; }
.aowai-foot { font-size: 10.5px; color: #9aa; text-align: center; padding: 0 0 6px; background: #fff; }

@media (max-width: 480px) {
    .aowai-panel { right: 8px; left: 8px; bottom: 74px; width: auto; height: calc(100vh - 90px); }
    .aowai-fab { right: 12px; bottom: 12px; }
}

/* ---------- 首页内嵌问答（#aowai-home，提问后展开） ---------- */
.aowai-home-thread {
    display: none; margin: 14px 0 12px; border: 1px solid #e6e8ea; border-radius: 12px;
    background: var(--bg, #F5F6F7); overflow: hidden;
}
.aowai-home.aowai-open .aowai-home-thread { display: block; animation: aowai-fadein .25s ease; }
@keyframes aowai-fadein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.aowai-home-threadhead {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 12px; border-bottom: 1px solid #e6e8ea; background: #fff;
}
.aowai-home-thlabel { font-size: 12.5px; font-weight: 600; color: #6b7470; }
.aowai-home-clear { border: none; background: none; color: #6b7470; font-size: 12.5px; cursor: pointer; font-family: inherit; padding: 2px 4px; }
.aowai-home-clear:hover { color: var(--primary, #255A41); }
.aowai-home-msgs { max-height: 340px; overflow-y: auto; padding: 12px; }
.aowai-home .aowai-input { border-top: none; background: transparent; padding: 0; }
.aowai-home .aowai-input textarea { background: #fff; }
.aowai-home .aowai-foot { background: transparent; padding: 8px 2px 0; }
