/**
 * 积分管家 · 小管家助手（悬浮球 + 问答面板）样式
 * ---------------------------------------------------------------------------
 * 依赖：assistant_widget.js / assistant_engine.js
 * 主题：跟随主站浅色紫色主题（--primary-color），自带兜底值，样式全部 aw- 前缀避免污染
 * 层级：悬浮球 9000 / 面板 9500 —— 均低于工具 iframe 容器（10000），
 *       打开「课程表」等工具页时悬浮球自动被工具页盖住，不挡操作
 */

:root {
    --aw-primary: var(--primary-color, #7B68EE);
    --aw-primary-light: var(--primary-light, #9B89EE);
    --aw-primary-dark: var(--primary-dark, #6B5BDE);
    --aw-primary-bg: var(--primary-bg, #F0E6FF);
    --aw-text: var(--text-primary, #333333);
    --aw-text-2: var(--text-secondary, #666666);
    --aw-text-3: var(--text-tertiary, #999999);
    --aw-border: var(--border-color, #E8E8E8);
    --aw-bg: var(--bg-secondary, #FFFFFF);
    --aw-radius: var(--radius-lg, 20px);
    --aw-shadow: var(--shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.12));
    --aw-font: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif);
}

/* ============================ 悬浮球 ============================ */

.aw-orb {
    position: fixed;
    right: 22px;
    bottom: var(--aw-bottom, 84px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: grab;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--aw-primary-light), var(--aw-primary-dark));
    box-shadow: 0 6px 20px rgba(123, 104, 238, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

.aw-orb:hover {
    transform: scale(1.07);
    box-shadow: 0 10px 26px rgba(123, 104, 238, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.aw-orb:active,
.aw-orb.aw-dragging {
    cursor: grabbing;
    transform: scale(0.96);
    transition: none;
}

.aw-orb-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* 待办有未完成项时的小红点 */
.aw-orb-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--secondary-color, #FF6B6B);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
    pointer-events: none;
}

.aw-orb-badge[hidden] { display: none; }

/* 呼吸光晕：提示"我在这儿，可以问我" */
.aw-orb::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(123, 104, 238, 0.5);
    animation: aw-pulse 2.6s ease-out infinite;
    pointer-events: none;
}

@keyframes aw-pulse {
    0%   { transform: scale(0.92); opacity: 0.85; }
    70%  { transform: scale(1.16); opacity: 0; }
    100% { transform: scale(1.16); opacity: 0; }
}

/* 首屏气泡引导（只出现一次） */
.aw-orb-tip {
    position: absolute;
    right: 68px;
    bottom: 8px;
    max-width: 190px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--aw-bg);
    color: var(--aw-text);
    font-size: 13px;
    line-height: 1.5;
    box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.08));
    border: 1px solid var(--aw-border);
    white-space: nowrap;
    animation: aw-tip-in 0.3s ease;
}

.aw-orb-tip::after {
    content: '';
    position: absolute;
    right: -5px;
    bottom: 14px;
    width: 10px;
    height: 10px;
    background: var(--aw-bg);
    border-right: 1px solid var(--aw-border);
    border-bottom: 1px solid var(--aw-border);
    transform: rotate(-45deg);
}

@keyframes aw-tip-in {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============================ 面板 ============================ */

.aw-panel {
    position: fixed;
    right: 22px;
    bottom: var(--aw-bottom, 84px);
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 150px);
    z-index: 9500;
    display: flex;
    flex-direction: column;
    background: var(--aw-bg);
    border: 1px solid var(--aw-border);
    border-radius: var(--aw-radius);
    box-shadow: var(--shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.12));
    overflow: hidden;
    font-family: var(--aw-font);
    font-size: 14px;
    color: var(--aw-text);
    animation: aw-panel-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 悬浮球拖到下方/上方时的锚定方向 */
.aw-panel.aw-panel-below {
    animation: aw-panel-in-below 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes aw-panel-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes aw-panel-in-below {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.aw-panel[hidden] { display: none; }

/* ---------- 头部 ---------- */

.aw-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--aw-primary), var(--aw-primary-light));
    color: #fff;
    flex-shrink: 0;
}

.aw-head-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    object-fit: contain;
    flex-shrink: 0;
}

.aw-head-id { flex: 1; min-width: 0; }

.aw-head-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aw-head-sub {
    font-size: 11px;
    opacity: 0.85;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aw-head-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
    position: relative;
}

.aw-head-btn:hover { background: rgba(255, 255, 255, 0.34); }

.aw-head-btn .aw-head-btn-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #FFD700;
}

.aw-head-btn .aw-head-btn-dot[hidden] { display: none; }

/* ---------- 消息区 ---------- */

.aw-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 14px 4px;
    background: var(--bg-primary, #F8F9FA);
    scroll-behavior: smooth;
}

.aw-body::-webkit-scrollbar { width: 6px; }
.aw-body::-webkit-scrollbar-thumb { background: #D8D8E0; border-radius: 3px; }

.aw-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    animation: aw-msg-in 0.2s ease;
}

@keyframes aw-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.aw-row.aw-row-user { flex-direction: row-reverse; }

.aw-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: contain;
    background: var(--aw-primary-bg);
}

/* 用户气泡 */
.aw-bubble {
    max-width: 78%;
    padding: 9px 13px;
    border-radius: 14px;
    background: var(--aw-primary);
    color: #fff;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
    border-bottom-right-radius: 5px;
}

/* 助手回答卡 */
.aw-card {
    max-width: 90%;
    background: var(--aw-bg);
    border: 1px solid var(--aw-border);
    border-radius: 14px;
    border-top-left-radius: 5px;
    padding: 11px 13px;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
    word-break: break-word;
}

.aw-card-top {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
}

.aw-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--aw-text);
    flex: 1;
    min-width: 0;
}

/* 层级徽章 */
.aw-tag {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 7px;
    background: var(--aw-primary-bg);
    color: var(--aw-primary-dark);
    white-space: nowrap;
}

.aw-tag.aw-tag-trouble { background: #FFECEC; color: #D94A4A; }
.aw-tag.aw-tag-write   { background: #E8F7EC; color: #2E8B47; }

.aw-card-text {
    color: var(--aw-text-2);
    line-height: 1.65;
    font-size: 13.5px;
}

/* 步骤 */
.aw-steps {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: aw-step;
}

.aw-steps li {
    counter-increment: aw-step;
    position: relative;
    padding-left: 22px;
    margin-bottom: 5px;
    line-height: 1.6;
    font-size: 13.5px;
    color: var(--aw-text);
}

.aw-steps li::before {
    content: counter(aw-step);
    position: absolute;
    left: 0;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--aw-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

/* 缩进子项（· 开头的说明行）不参与计数编号 */
.aw-steps li.aw-step-sub {
    padding-left: 22px;
    counter-increment: none;
    color: var(--aw-text-2);
    font-size: 13px;
}

.aw-steps li.aw-step-sub::before { display: none; }

/* 提示 */
.aw-tips {
    margin: 9px 0 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: #FFFBF0;
    border-left: 3px solid var(--warning-color, #FFD700);
    list-style: none;
}

.aw-tips li {
    color: #8A6D1B;
    font-size: 12.5px;
    line-height: 1.6;
    margin-bottom: 3px;
}

.aw-tips li:last-child { margin-bottom: 0; }

.aw-tips li::before { content: '⚠ '; }

/* 结果列表 */
.aw-results {
    margin-top: 9px;
    border-top: 1px dashed var(--aw-border);
    padding-top: 8px;
}

.aw-results-label {
    font-size: 11.5px;
    color: var(--aw-text-3);
    margin-bottom: 5px;
}

.aw-result {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.14s ease;
}

.aw-result:hover { background: var(--aw-primary-bg); }

.aw-result-type {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--aw-primary-dark);
    background: var(--aw-primary-bg);
    border-radius: 6px;
    padding: 1px 6px;
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aw-result-main { flex: 1; min-width: 0; }

.aw-result-title {
    font-size: 13px;
    color: var(--aw-text);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aw-result-meta {
    font-size: 11.5px;
    color: var(--aw-text-3);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aw-result-arrow { color: var(--aw-text-3); font-size: 13px; flex-shrink: 0; }

/* 动作按钮 */
.aw-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

.aw-btn {
    padding: 7px 14px;
    border: none;
    border-radius: 9px;
    background: var(--aw-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, transform 0.1s ease;
}

.aw-btn:hover { background: var(--aw-primary-dark); }
.aw-btn:active { transform: scale(0.97); }

.aw-btn.aw-btn-ghost {
    background: transparent;
    color: var(--aw-primary-dark);
    border: 1px solid var(--aw-primary-light);
}

.aw-btn.aw-btn-ghost:hover { background: var(--aw-primary-bg); }

/* ---------- 推荐问题 ---------- */

.aw-chips {
    display: flex;
    flex-wrap: wrap;      /* 换行铺开，避免单行被截断「显示不全」 */
    gap: 7px;
    padding: 8px 14px;
    max-height: 96px;     /* 自定义问题过多时纵向内部滚动 */
    overflow-y: auto;
    background: var(--aw-bg);
    border-top: 1px solid var(--aw-border);
    flex-shrink: 0;
    scrollbar-width: thin;
}

.aw-chips::-webkit-scrollbar { width: 4px; }
.aw-chips[hidden] { display: none; }

.aw-chip {
    flex-shrink: 0;
    padding: 5px 11px;
    border-radius: 14px;
    background: var(--bg-tertiary, #F5F5F5);
    border: 1px solid var(--aw-border);
    color: var(--aw-text-2);
    font-size: 12.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.14s ease;
}

.aw-chip:hover {
    background: var(--aw-primary-bg);
    border-color: var(--aw-primary-light);
    color: var(--aw-primary-dark);
}

/* ---------- 输入区 ---------- */

.aw-input {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px 12px;
    background: var(--aw-bg);
    border-top: 1px solid var(--aw-border);
    flex-shrink: 0;
}

.aw-input textarea {
    flex: 1;
    min-height: 38px;
    max-height: 96px;
    padding: 9px 12px;
    border: 1px solid var(--aw-border);
    border-radius: 12px;
    background: var(--bg-primary, #F8F9FA);
    color: var(--aw-text);
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aw-input textarea:focus {
    border-color: var(--aw-primary);
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.12);
}

.aw-send {
    height: 38px;
    padding: 0 15px;
    border: none;
    border-radius: 12px;
    background: var(--aw-primary);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.aw-send:hover { background: var(--aw-primary-dark); }

/* ============================ 子视图（待办 / 设置） ============================ */

.aw-subview {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary, #F8F9FA);
    padding: 12px 14px;
}

.aw-subview[hidden] { display: none; }

.aw-sec-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--aw-text-3);
    letter-spacing: 0.5px;
    margin: 4px 0 8px;
}

.aw-todo {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 9px 11px;
    margin-bottom: 7px;
    background: var(--aw-bg);
    border: 1px solid var(--aw-border);
    border-radius: 11px;
}

.aw-todo-check {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    accent-color: var(--aw-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.aw-todo-main { flex: 1; min-width: 0; }

.aw-todo-title { font-size: 13.5px; line-height: 1.5; color: var(--aw-text); }
.aw-todo.done .aw-todo-title { text-decoration: line-through; color: var(--aw-text-3); }

.aw-todo-time { font-size: 11.5px; color: var(--aw-primary-dark); margin-top: 2px; }

.aw-todo-del {
    border: none;
    background: transparent;
    color: var(--aw-text-3);
    font-size: 15px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}

.aw-todo-del:hover { color: var(--secondary-color, #FF6B6B); }

.aw-empty {
    text-align: center;
    color: var(--aw-text-3);
    font-size: 13px;
    line-height: 1.7;
    padding: 28px 12px;
}

/* 设置表单 */
.aw-field { margin-bottom: 14px; }

.aw-label {
    display: block;
    font-size: 12.5px;
    color: var(--aw-text-2);
    margin-bottom: 5px;
    font-weight: 600;
}

.aw-input-text {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--aw-border);
    border-radius: 10px;
    background: var(--aw-bg);
    color: var(--aw-text);
    font-family: inherit;
    font-size: 13.5px;
    outline: none;
    box-sizing: border-box;
}

.aw-input-text:focus {
    border-color: var(--aw-primary);
    box-shadow: 0 0 0 3px rgba(123, 104, 238, 0.12);
}

.aw-avatar-row { display: flex; align-items: center; gap: 12px; }

.aw-avatar-preview {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--aw-primary-bg);
    object-fit: contain;
    flex-shrink: 0;
    border: 2px solid var(--aw-border);
}

.aw-avatar-btns { display: flex; flex-direction: column; gap: 6px; }

.aw-hint {
    font-size: 11.5px;
    color: var(--aw-text-3);
    line-height: 1.6;
    margin-top: 5px;
}

.aw-row-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================ 学生卡片定位高亮 ============================ */

/* 由小管家从结果列表跳转过来时，短暂描边该学生卡片，让人一眼看到是哪一个 */
.student-card.aw-flash {
    animation: aw-flash 0.9s ease 2;
    outline: 3px solid var(--aw-primary, #7B68EE);
    outline-offset: 2px;
    border-radius: var(--radius-md, 12px);
}

@keyframes aw-flash {
    0%, 100% { box-shadow: 0 0 0 0 rgba(123, 104, 238, 0); }
    50%      { box-shadow: 0 0 0 10px rgba(123, 104, 238, 0.28); }
}

/* ============================ 移动端 ============================ */

@media (max-width: 600px) {
    .aw-orb {
        right: 14px;
        bottom: calc(var(--aw-bottom, 84px) + 4px);
        width: 50px;
        height: 50px;
    }

    .aw-orb-avatar { width: 41px; height: 41px; }

    .aw-orb-tip { display: none; }

    .aw-panel {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 78vh;
        max-height: 78vh;
        border-radius: 18px 18px 0 0;
        border-bottom: none;
    }
}

/* ============================================================
   手机下的悬浮球让位：必须让开 mobile-navbar（2026-09-21）
   ------------------------------------------------------------
   故障：≤767px 时 assistant_widget.js 的 defaultBottom() 找不到
   「桌面底部导航」那条船（mobile.css 已把 .sidebar 整条 display:none），
   于是按「导航在左侧」的 22px 计算 --aw-bottom；叠加上面的 +4px 后
   悬浮球只离底 26px，而 mobile-navbar 有 56px 高
   ⇒ 球直接压在最右边的「撤回」按钮上（实测 390/430 视口均命中，
      elementFromPoint 在按钮中心点返回 #awOrb 而不是按钮本身）。
   修法：这里不再依赖 JS 算出来的 --aw-bottom，直接按 mobile-navbar 的
   实测高度 56px + 16px 留白让位；下面的断点必须放在 @media (max-width:600px)
   之后，同特异性靠书写顺序取胜（600px 里那条会把这里覆盖掉）。
   env(safe-area-inset-bottom) 用于 iPhone 底部小白条的机型。
   ============================================================ */
@media screen and (max-width: 767px) {
    .aw-orb {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }
}

/* ============================ 大模型设置（智能回答） ============================ */

.aw-switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--aw-text);
    font-weight: 600;
}

.aw-switch { position: absolute; opacity: 0; width: 0; height: 0; }

.aw-switch-track {
    width: 38px;
    height: 22px;
    border-radius: 11px;
    background: #d9d4ea;
    position: relative;
    transition: background 0.18s ease;
    flex: none;
}

.aw-switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s ease;
}

.aw-switch:checked + .aw-switch-track { background: var(--aw-primary); }
.aw-switch:checked + .aw-switch-track::after { transform: translateX(16px); }
.aw-switch:focus-visible + .aw-switch-track { outline: 2px solid var(--aw-primary); outline-offset: 2px; }

.aw-llm-block { transition: opacity 0.18s ease; }
.aw-llm-off { opacity: 0.45; }

.aw-select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 11px;
    border: 1px solid var(--aw-border);
    border-radius: 10px;
    background: var(--aw-bg);
    color: var(--aw-text);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.aw-key-row { display: flex; gap: 8px; align-items: center; }
.aw-key-row .aw-input-text { flex: 1; min-width: 0; }
.aw-key-row .aw-btn { flex: none; }

.aw-llm-status {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.55;
    padding: 7px 10px;
    border-radius: 8px;
    word-break: break-all;
}
.aw-llm-status.ok { background: #eefaee; color: #1e7e34; }
.aw-llm-status.bad { background: #fdeeee; color: #c0392b; }
.aw-llm-status.pending { background: var(--aw-primary-bg); color: var(--aw-primary-dark); }

.aw-tag-ai {
    background: linear-gradient(135deg, var(--aw-primary), var(--aw-primary-light));
    color: #fff;
}

.aw-card-thinking .aw-card-text { animation: aw-think-pulse 1.4s ease-in-out infinite; }
@keyframes aw-think-pulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
}

.aw-hint-warn { color: #b4690e; }

/* ============================ 语音（朗读 + 语音输入） ============================ */

/* 卡片右上角的朗读小按钮：tag 之后靠右 */
.aw-card-top .aw-speak {
    margin-left: auto;
    flex: none;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--aw-text-3);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.aw-card-top .aw-speak:hover { background: var(--aw-primary-bg); color: var(--aw-primary-dark); }

/* 输入行麦克风按钮（尺寸与发送按钮对齐，图标居中） */
.aw-mic {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--aw-border);
    border-radius: 12px;
    background: var(--aw-bg);
    color: var(--aw-text-2);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.aw-mic:hover { background: var(--aw-primary-bg); border-color: var(--aw-primary-light); }
.aw-mic-live { border-color: var(--aw-primary); color: var(--aw-primary-dark); }
.aw-mic-listen { background: #ffe9e9; border-color: #f08a8a; animation: aw-mic-pulse 1.1s ease-in-out infinite; }
.aw-mic-rec { background: #ffe3e3; border-color: #e05c5c; animation: aw-mic-pulse 1.1s ease-in-out infinite; }
.aw-mic-busy { background: var(--aw-primary-bg); border-color: var(--aw-primary-light); }

/* 长按说话：按住不弹系统菜单、不选中文字、不触发滚动 */
.aw-mic {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* 语音直发气泡旁的「撤回」按钮 */
.aw-recall {
    flex: none;
    align-self: center;
    border: none;
    background: transparent;
    color: #9a9aa5;
    font-size: 12px;
    padding: 4px 6px;
    cursor: pointer;
}
.aw-recall:hover { color: var(--aw-primary-dark, #5B4FC4); text-decoration: underline; }

@keyframes aw-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(224, 92, 92, 0.45); }
    50% { box-shadow: 0 0 0 6px rgba(224, 92, 92, 0); }
}

/* 语速滑块 */
.aw-range {
    width: 100%;
    accent-color: var(--aw-primary);
    cursor: pointer;
}

/* 正在朗读时悬浮球轻微呼吸，给个反馈 */
.aw-orb.aw-speaking { animation: aw-orb-speak 1.3s ease-in-out infinite; }
@keyframes aw-orb-speak {
    0%, 100% { box-shadow: 0 6px 18px rgba(123, 104, 238, 0.35); }
    50% { box-shadow: 0 6px 26px rgba(123, 104, 238, 0.75); }
}
