#lottery-assistant {
    --assistant-blue: #347bef;
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 1030;
    font: 14px/1.5 "Microsoft YaHei", sans-serif;
    color: #273951;
}
#lottery-assistant [hidden], #lottery-assistant[hidden] { display: none; }
#lottery-assistant button, #lottery-assistant select, #lottery-assistant textarea { font: inherit; }
#lottery-assistant button { cursor: pointer; }
#lottery-assistant button:disabled { opacity: .55; cursor: wait; }
#lottery-assistant .assistant-toggle, #lottery-assistant form button {
    background: var(--assistant-blue); color: #fff; border: 0; border-radius: 22px; padding: 9px 16px;
}
.assistant-toggle { float: right; box-shadow: 0 4px 16px #253b6429; }
.assistant-panel {
    position: absolute; bottom: 50px; right: 0; width: min(430px, calc(100vw - 28px));
    height: min(540px, calc(100dvh - 110px)); display: flex; flex-direction: column;
    border: 1px solid #d7e1f1; background: white; border-radius: 14px; overflow: hidden;
    box-shadow: 0 12px 44px #22365838; box-sizing: border-box;
}
.assistant-panel header { display: flex; flex: none; align-items: center; gap: 10px; background: var(--navbar-gradient); color: white; padding: 10px 15px; min-height: 60px; box-sizing: border-box; }
.assistant-heading { display: grid; gap: 1px; margin-right: auto; }
.assistant-heading strong { font-size: 16px; line-height: 21px; }
.assistant-heading small { font-size: 12px; line-height: 17px; }
.assistant-online { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.assistant-online::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #2bdd98; box-shadow: 0 0 0 4px #ffffff24; }
#lottery-assistant [data-close] { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: white; color: #2862b3; box-shadow: 0 2px 7px #153c7638; font: bold 22px/1 Arial, sans-serif; }
.assistant-panel [role=log] { flex: 1; min-height: 48px; overflow-y: auto; padding: 12px; background: #f6f8fc; }
.assistant-panel [role=log] > div { width: fit-content; max-width: 96%; box-sizing: border-box; margin: 0 0 10px; padding: 9px 12px; border-radius: 10px; overflow-wrap: anywhere; }
.assistant-answer { background: white; border: 1px solid #dde6f2; }
.assistant-answer p { margin: 0; line-height: 1.65; }
.assistant-answer > * + * { margin-top: 7px; }
.assistant-answer strong { color: #244a7b; }
.assistant-answer table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.assistant-answer th, .assistant-answer td { padding: 5px 7px; text-align: left; border-bottom: 1px solid #e1e9f4; }
.assistant-answer th { background: #edf3fc; color: #38577c; font-weight: 600; }
.assistant-question { white-space: pre-wrap; }
.assistant-elapsed { display: block; margin-top: 3px; color: #657892; font-size: 12px; }
.assistant-question { margin-left: auto !important; color: #194e9c; background: #e2eeff; }
.assistant-recommend { padding: 8px 12px; border-top: 1px solid #e3eaf5; overflow-y: auto; max-height: 39%; }
.assistant-label, .assistant-chips { display: flex; align-items: center; gap: 5px; }
.assistant-label { justify-content: space-between; font-size: 13px; }
.assistant-label button { color: #326fc5; background: transparent; border: none; }
.assistant-chips { flex-wrap: wrap; margin: 6px 0 8px; }
.assistant-chips button, .assistant-questions button { color: #37557c; background: white; border: 1px solid #d5e2f3; border-radius: 5px; padding: 4px 6px; }
.assistant-chips button { border-radius: 999px; padding: 4px 10px; }
.assistant-chips button[aria-pressed=true] { background: var(--assistant-blue); color: #fff; border-color: var(--assistant-blue); }
.assistant-questions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.assistant-questions button { text-align: left; overflow-wrap: anywhere; }
.assistant-panel [role=status]:not(:empty) { padding: 5px 12px; font-size: 12px; }
.assistant-panel form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e3eaf5; }
.assistant-panel textarea { resize: none; flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid #c5d6ed; border-radius: 8px; }
@media(max-width:768px) {
    #lottery-assistant { right: 10px; bottom: calc(62px + env(safe-area-inset-bottom)); }
    .assistant-panel { width: min(430px, calc(100vw - 20px)); height: min(530px, calc(100dvh - 136px)); }
}
