/* ==============================
   XinghuosClaw AI - 前端样式
   莫兰迪橙色 + 淡蓝色调，毛玻璃，年轻化
   ============================== */

:root {
    --xhclaw-orange: #E8A87C;
    --xhclaw-orange-deep: #D4845A;
    --xhclaw-orange-light: #F5D5BC;
    --xhclaw-blue: #A8C8D8;
    --xhclaw-blue-light: #D4E6EF;
    --xhclaw-blue-deep: #7BA8BD;
    --xhclaw-bg: rgba(255, 255, 255, 0.25);
    --xhclaw-card: rgba(255, 255, 255, 0.45);
    --xhclaw-card-hover: rgba(255, 255, 255, 0.6);
    --xhclaw-text: #3D3D3D;
    --xhclaw-text-light: #6B6B6B;
    --xhclaw-text-muted: #9B9B9B;
    --xhclaw-border: rgba(232, 168, 124, 0.3);
    --xhclaw-shadow: 0 8px 32px rgba(212, 132, 90, 0.12);
    --xhclaw-shadow-lg: 0 16px 48px rgba(212, 132, 90, 0.18);
    --xhclaw-radius: 16px;
    --xhclaw-radius-sm: 10px;
    --xhclaw-radius-xs: 6px;
    --xhclaw-gradient: linear-gradient(135deg, var(--xhclaw-orange-light), var(--xhclaw-blue-light));
    --xhclaw-gradient-btn: linear-gradient(135deg, var(--xhclaw-orange), var(--xhclaw-orange-deep));
    --xhclaw-blur: blur(16px);
}

/* 媒体库面板 */
#xhclaw-media-panel {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
#xhclaw-media-panel .xhclaw-media-panel-inner {
    max-width: 900px;
    margin: 0 auto;
}

/* 媒体库模式：隐藏输入框等 */
.xhclaw-media-mode .xhclaw-fb-input-wrap,
.xhclaw-media-mode #xhclaw-chat-img-preview,
.xhclaw-media-mode #xhclaw-image-controls {
    display: none !important;
}

/* 上传选择器弹窗 */
.xhclaw-upload-picker {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: xhclawModalFadeIn 0.2s ease;
}
.xhclaw-upload-picker-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
}
.xhclaw-upload-picker-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    animation: xhclawModalSlideUp 0.25s ease;
}
.xhclaw-upload-picker-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}
.xhclaw-upload-picker-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.xhclaw-upload-picker-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 15px;
    width: 100%;
    text-align: left;
}
.xhclaw-upload-picker-btn:hover {
    border-color: var(--xhclaw-primary, #6366f1);
    background: rgba(99,102,241,0.06);
}
.xhclaw-upload-picker-btn-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.xhclaw-upload-picker-btn-info {
    display: flex;
    flex-direction: column;
}
.xhclaw-upload-picker-btn-label {
    font-weight: 600;
    color: #333;
}
.xhclaw-upload-picker-btn-desc {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

/* 媒体库卡片样式 */
.xhclaw-media-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.xhclaw-media-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.xhclaw-media-search-input:focus {
    border-color: var(--xhclaw-primary, #6366f1);
}
.xhclaw-media-view-btns {
    display: flex;
    gap: 4px;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 3px;
}
.xhclaw-media-view-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: #999;
}
.xhclaw-media-view-btn.active {
    background: #fff;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 网格模式 */
.xhclaw-media-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.xhclaw-media-card-grid {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
    position: relative;
}
.xhclaw-media-card-grid:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.xhclaw-media-card-grid .xhclaw-media-card-thumb {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #f5f5f5;
}
.xhclaw-media-card-grid .xhclaw-media-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.xhclaw-media-card-grid .xhclaw-media-card-info {
    padding: 8px 10px;
    flex: 1;
}
.xhclaw-media-card-grid .xhclaw-media-card-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xhclaw-media-card-grid .xhclaw-media-card-meta {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}
.xhclaw-media-card-grid .xhclaw-media-card-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}
.xhclaw-media-card-grid:hover .xhclaw-media-card-actions {
    opacity: 1;
}

/* 列表模式 */
.xhclaw-media-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.xhclaw-media-card-list {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 10px 14px;
    transition: box-shadow 0.2s;
}
.xhclaw-media-card-list:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.xhclaw-media-card-list .xhclaw-media-card-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
}
.xhclaw-media-card-list .xhclaw-media-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.xhclaw-media-card-list .xhclaw-media-card-info {
    flex: 1;
    min-width: 0;
}
.xhclaw-media-card-list .xhclaw-media-card-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xhclaw-media-card-list .xhclaw-media-card-meta {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}
.xhclaw-media-card-list .xhclaw-media-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* 通用卡片按钮 */
.xhclaw-media-card-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    background: rgba(0,0,0,0.5);
    color: #fff;
}
.xhclaw-media-card-btn:hover {
    background: rgba(0,0,0,0.7);
}
.xhclaw-media-card-btn[data-action="select"]:hover {
    background: #6366f1;
}
.xhclaw-media-card-btn[data-action="delete"]:hover {
    background: #ef4444;
}

/* 占位符 */
.xhclaw-media-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #ccc;
    background: #f8f8f8;
}

/* 空状态 */
.xhclaw-media-items-empty {
    display: block;
}


.xhclaw-app {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--xhclaw-text);
    overflow: visible;
    width: 100%;
}

/* Banner */
.xhclaw-banner {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--xhclaw-radius) var(--xhclaw-radius) 0 0;
}
.xhclaw-banner-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}
.xhclaw-banner-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.4));
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

/* Header */
.xhclaw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border-bottom: 1px solid var(--xhclaw-border);
}
.xhclaw-header-left, .xhclaw-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.xhclaw-site-info {
    display: flex;
    align-items: center;
    gap: 6px;
}
.xhclaw-site-select {
    padding: 6px 28px 6px 10px;
    border: 1px solid var(--xhclaw-border);
    border-radius: var(--xhclaw-radius-xs);
    background: rgba(255,255,255,0.6);
    font-size: 13px;
    color: var(--xhclaw-text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.xhclaw-btn-icon {
    width: 28px;
    height: 28px;
    border: 1px dashed var(--xhclaw-border);
    border-radius: var(--xhclaw-radius-xs);
    background: rgba(255,255,255,0.4);
    color: var(--xhclaw-orange-deep);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.xhclaw-btn-icon:hover {
    background: var(--xhclaw-orange-light);
    border-color: var(--xhclaw-orange);
}

/* ===========================================
   悬浮操作栏（xhclaw-floating-bar）
   =========================================== */
.xhclaw-floating-bar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 16px 8px;
    background: rgba(255,255,255,0.97);
    backdrop-filter: saturate(4) blur(24px);
    -webkit-backdrop-filter: saturate(4) blur(24px);
    border-top: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

/* 行容器 */
.xhclaw-fb-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
}

/* 第一行：站点 + 智能体 + 积分 */
.xhclaw-fb-row1 {
    padding: 0 2px;
}

/* 站点选择区 */
.xhclaw-fb-site {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.xhclaw-fb-session {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.xhclaw-fb-site-select {
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    background: #fff;
    max-width: 130px;
    min-width: 90px;
    color: #555;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 22px;
}
.xhclaw-fb-site-select:hover,
.xhclaw-fb-site-select:focus {
    border-color: rgba(232,168,124,0.5);
    box-shadow: 0 0 0 3px rgba(232,168,124,0.1);
}

/* 添加站点按钮 */
.xhclaw-fb-add-site {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    flex-shrink: 0;
    transition: all 0.2s;
    line-height: 1;
}
.xhclaw-fb-add-site:hover {
    border-color: #E8A87C;
    color: #E8A87C;
    background: rgba(232,168,124,0.06);
}

/* 积分区域 */
.xhclaw-fb-points-wrap {
    margin-left: auto;
    flex-shrink: 0;
}

.xhclaw-fb-points-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #E8A87C;
    cursor: pointer;
    background: rgba(232,168,124,0.08);
    padding: 4px 10px;
    border-radius: 14px;
    white-space: nowrap;
    transition: background 0.2s, transform 0.15s;
    user-select: none;
}
.xhclaw-fb-points-badge:hover {
    background: rgba(232,168,124,0.15);
    transform: translateY(-1px);
}

.xhclaw-fb-points-unit {
    color: #ccc;
    font-size: 11px;
}

.xhclaw-fb-login {
    font-size: 12px;
    color: #E8A87C;
    text-decoration: none;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 14px;
    background: rgba(232,168,124,0.08);
    transition: background 0.2s;
    display: inline-block;
}
.xhclaw-fb-login:hover {
    background: rgba(232,168,124,0.15);
}

/* 作图控件区 */
.xhclaw-fb-img-controls {
    display: none;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
    padding: 2px 2px;
    animation: xhclaw-fb-slideDown 0.2s ease-out;
}
@keyframes xhclaw-fb-slideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 通用下拉选择 */
.xhclaw-fb-select {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    background: #fff;
    color: #555;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 18px;
}
.xhclaw-fb-select:hover,
.xhclaw-fb-select:focus {
    border-color: rgba(232,168,124,0.4);
    box-shadow: 0 0 0 3px rgba(232,168,124,0.08);
}

/* 积分提示 */
.xhclaw-fb-points-hint {
    font-size: 11px;
    color: #E8A87C;
    white-space: nowrap;
    background: rgba(232,168,124,0.06);
    padding: 2px 8px;
    border-radius: 10px;
}

/* 输入框区域 */
.xhclaw-fb-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    background: rgba(255,255,255,0.9);
    border: 1.5px solid rgba(232,168,124,0.2);
    border-radius: 14px;
    padding: 6px 10px;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.xhclaw-fb-input-wrap:focus-within {
    border-color: rgba(232,168,124,0.5);
    box-shadow: 0 0 0 4px rgba(232,168,124,0.1);
}

/* 图标按钮（指令、附件） */
.xhclaw-fb-icon-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: #aaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.xhclaw-fb-icon-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(232,168,124,0);
    transition: background 0.2s;
}
.xhclaw-fb-icon-btn:hover::after {
    background: rgba(232,168,124,0.1);
}
.xhclaw-fb-icon-btn:hover {
    color: #E8A87C;
}
.xhclaw-fb-icon-btn:active {
    transform: scale(0.92);
}

/* 加号按钮特殊样式 */
.xhclaw-fb-attach-btn {
    font-size: 22px;
    line-height: 1;
    font-weight: 300;
}

/* 输入框 */
.xhclaw-fb-textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.6;
    max-height: 120px;
    min-height: 24px;
    font-family: inherit;
    color: #3D3D3D;
    padding: 6px 4px;
}
.xhclaw-fb-textarea::placeholder {
    color: #bbb;
}

/* 发送按钮 */
.xhclaw-fb-send-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border: none;
    background: linear-gradient(135deg, #E8A87C, #D4845A);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(232,168,124,0.35);
    position: relative;
    overflow: hidden;
    padding: 0;
    line-height: 1;
}
.xhclaw-fb-send-btn svg {
    width: 20px;
    height: 20px;
    display: block;
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    transform-origin: 50% 50%;
}
.xhclaw-fb-send-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0);
    transition: background 0.2s;
    pointer-events: none;
}
.xhclaw-fb-send-btn:hover {
    box-shadow: 0 4px 16px rgba(232,168,124,0.5);
    transform: translateY(-1px) scale(1.05);
}
.xhclaw-fb-send-btn:hover::after {
    background: rgba(255,255,255,0.1);
}
.xhclaw-fb-send-btn:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 1px 4px rgba(232,168,124,0.3);
}
.xhclaw-fb-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.xhclaw-fb-send-btn.loading {
    opacity: 1;
    cursor: pointer;
    transform: none;
    box-shadow: 0 4px 14px rgba(232,168,124,0.38);
}
.xhclaw-fb-send-btn.loading svg {
    opacity: 0;
    animation: none !important;
}
.xhclaw-fb-send-btn.loading::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: #fff;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.45);
}
.xhclaw-fb-send-btn.loading::after {
    background: rgba(255,255,255,0.10);
}
.xhclaw-generation-cancelled-tip {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(232,168,124,0.10);
    border: 1px solid rgba(232,168,124,0.22);
    color: #8a5a35;
    font-size: 12px;
    line-height: 1.45;
}
.xhclaw-generation-cancelled-tip span {
    display: block;
    font-weight: 700;
}
.xhclaw-generation-cancelled-tip small {
    display: block;
    margin-top: 2px;
    color: #9a7a62;
    font-size: 11px;
}

/* 底部免责声明 */
.xhclaw-fb-footer {
    padding-top: 4px;
    user-select: none;
}
.xhclaw-fb-footer-text {
    font-size: 11px;
    color: #bbb;
    text-align: center;
    white-space: nowrap;
}

/* 对话模型菜单里的联网搜索工具 */
.xhclaw-chat-mode-search-tools {
    display: block;
    padding: 12px;
    margin: 0 0 10px;
    background: linear-gradient(135deg, rgba(232,168,124,0.10), rgba(255,255,255,0.94));
    border: 1px solid rgba(232,168,124,0.22);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(140, 90, 54, 0.08);
}
.xhclaw-search-tools-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.xhclaw-search-tools-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: #7a4f2f;
}
.xhclaw-search-tools-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cfcfcf;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}
.xhclaw-chat-mode-search-tools.xhclaw-search-tools-active .xhclaw-search-tools-dot {
    background: #54c47a;
    box-shadow: 0 0 0 4px rgba(84,196,122,0.14), 0 0 10px rgba(84,196,122,0.45);
}
.xhclaw-search-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}
.xhclaw-search-mode-tab {
    border: 1px solid rgba(232,168,124,0.22);
    border-radius: 12px;
    padding: 9px 10px;
    background: rgba(255,255,255,0.72);
    text-align: left;
    cursor: pointer;
    transition: all 0.18s ease;
    color: #77583f;
}
.xhclaw-search-mode-tab:hover {
    border-color: rgba(232,168,124,0.58);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(140,90,54,0.08);
}
.xhclaw-search-mode-tab.active {
    border-color: #E8A87C;
    background: linear-gradient(135deg, rgba(232,168,124,0.22), rgba(255,255,255,0.92));
    box-shadow: 0 4px 12px rgba(232,168,124,0.20);
}
.xhclaw-search-mode-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #694325;
    margin-bottom: 4px;
}
.xhclaw-search-mode-desc {
    display: block;
    font-size: 11px;
    line-height: 1.35;
    color: #9a7a62;
}
.xhclaw-search-provider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

/* 智能体切换 - 内联标签按钮 */
.xhclaw-agent-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(0,0,0,0.05);
    border-radius: 18px;
    padding: 2px;
    flex-shrink: 1;
    min-width: 0;
    overflow: visible;
    position: relative;
}
.xhclaw-agent-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
    font-size: 12px;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    border: none;
    background: none;
    outline: none;
    -webkit-appearance: none;
    color: #888;
    border: none;
    background: transparent;
    white-space: nowrap;
    line-height: 1;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
}
.xhclaw-agent-tab:hover {
    color: #555;
    background: rgba(255,255,255,0.6);
}
.xhclaw-agent-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #E8A87C, #D4796A);
    box-shadow: 0 2px 8px rgba(232, 168, 124, 0.35);
    font-weight: 600;
}
.xhclaw-agent-tab-icon {
    font-size: 13px;
    line-height: 1;
}
.xhclaw-agent-tab-name {
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.xhclaw-agent-tab.xhclaw-web-search-on .xhclaw-agent-tab-name::after,
.xhclaw-agent-tab-collapsed-btn.xhclaw-web-search-on #xhclaw-collapsed-name::after {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #57d07f;
    box-shadow: 0 0 0 3px rgba(87,208,127,0.18), 0 0 10px rgba(87,208,127,0.75);
    flex: 0 0 7px;
}

/* 空间不足时折叠为单按钮+弹窗 */
.xhclaw-agent-tabs.collapsed .xhclaw-agent-tab {
    display: none;
}
.xhclaw-agent-tab-collapsed-btn {
    display: none;
    align-items: center;
    gap: 4px;
    border: none;
    background: linear-gradient(135deg, #E8A87C, #D4796A);
    color: #fff;
    border-radius: 14px;
    padding: 4px 12px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    flex-shrink: 1;
    overflow: hidden;
    min-width: 0;
}
.xhclaw-agent-tab-collapsed-btn #xhclaw-collapsed-name {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
    display: inline-block;
    vertical-align: middle;
}
.xhclaw-agent-tab-collapsed-btn:active {
    opacity: 0.8;
}

/* 智能体选择弹窗 */
.xhclaw-agent-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99999998;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.xhclaw-agent-modal.show {
    display: flex;
    animation: xhclawModalFadeIn 0.2s ease-out;
}
.xhclaw-agent-modal.show .xhclaw-agent-modal-content {
    animation: xhclawModalSlideUp 0.25s ease-out;
}
@keyframes xhclawModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes xhclawModalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.xhclaw-agent-modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
}
.xhclaw-agent-modal-content {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    margin: 0 auto;
}
.xhclaw-agent-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 16px;
}
.xhclaw-agent-modal-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: 2px solid #f0f0f0;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    text-align: left;
}
.xhclaw-agent-modal-option:last-child {
    margin-bottom: 0;
}
.xhclaw-agent-modal-option:active {
    background: #f9f9f9;
}
.xhclaw-agent-modal-option.active {
    border-color: #E8A87C;
    background: rgba(232,168,124,0.06);
}
.xhclaw-agent-modal-icon {
    font-size: 22px;
    line-height: 1;
    width: 28px;
    text-align: center;
}
.xhclaw-agent-modal-info {
    flex: 1;
    min-width: 0;
}
.xhclaw-agent-modal-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}
.xhclaw-agent-modal-desc {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}
.xhclaw-agent-modal-check {
    display: none;
    color: #E8A87C;
    font-size: 16px;
    font-weight: bold;
}
.xhclaw-agent-modal-option.active .xhclaw-agent-modal-check {
    display: inline;
}
.xhclaw-user-name {
    font-size: 13px;
    color: var(--xhclaw-text-light);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.xhclaw-points-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    background: var(--xhclaw-gradient);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.xhclaw-points-badge:hover {
    box-shadow: var(--xhclaw-shadow);
    transform: translateY(-1px);
}
.xhclaw-points-icon {
    color: var(--xhclaw-orange-deep);
}
.xhclaw-points-value {
    font-weight: 600;
    color: var(--xhclaw-orange-deep);
}
.xhclaw-points-unit {
    color: var(--xhclaw-text-light);
}
.xhclaw-login-btn {
    padding: 4px 14px;
    background: var(--xhclaw-gradient-btn);
    color: #fff;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s;
}
.xhclaw-login-btn:hover {
    opacity: 0.9;
    color: #fff;
}

/* Chat Area - 参与页面整体滚动 */
.xhclaw-chat-area {
    padding: 16px;
    padding-bottom: 180px; /* 为底部悬浮栏预留空间，防止消息被遮挡 */
    margin-top: -15px !important;
    background: transparent;
    overflow: visible; /* 不设独立滚动，跟随页面 */
    transition: opacity 0.2s ease;
}

/* Chat Messages Container */
.xhclaw-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 100%;
}

/* Messages */
.xhclaw-msg {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: xhclaw-fade-in 0.3s ease;
}
@keyframes xhclaw-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.xhclaw-msg-user {
    flex-direction: row-reverse;
}
.xhclaw-msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.xhclaw-ai-avatar {
    background: var(--xhclaw-gradient);
    color: #fff;
}
.xhclaw-user-avatar {
    background: var(--xhclaw-blue);
    color: #fff;
}
.xhclaw-msg-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: var(--xhclaw-radius-sm);
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow-x: hidden;
    min-width: 0;
    box-sizing: border-box;
}
.xhclaw-msg-assistant .xhclaw-msg-bubble {
    background: var(--xhclaw-card);
    backdrop-filter: var(--xhclaw-blur);
    -webkit-backdrop-filter: var(--xhclaw-blur);
    border: 1px solid var(--xhclaw-border);
    border-top-left-radius: 4px;
    box-shadow: var(--xhclaw-shadow);
    min-width: 0;
}
/* 图片卡片气泡 - 限制最大宽度 */
.xhclaw-msg-assistant[data-msg-type="image_card"] .xhclaw-msg-bubble {
    max-width: 360px;
    width: fit-content;
}
/* AI 思考过程框 */
.xhclaw-thinking-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f4f8 100%);
    border-left: 3px solid #a8c8d8;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    max-height: 280px;
    overflow-y: auto;
    position: relative;
    transition: max-height 0.3s ease;
}
.xhclaw-thinking-box .xhclaw-thinking-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #7ba8bd;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(168, 200, 216, 0.4);
}
.xhclaw-thinking-box .xhclaw-thinking-header .xhclaw-thinking-arrow {
    display: inline-block;
    font-size: 10px;
    transition: transform 0.2s ease;
    transform: rotate(90deg);
    color: #a8c8d8;
}
.xhclaw-thinking-box.xhclaw-thinking-collapsed .xhclaw-thinking-header .xhclaw-thinking-arrow {
    transform: rotate(0deg);
}
.xhclaw-thinking-box .xhclaw-thinking-header .xhclaw-thinking-icon {
    font-size: 13px;
    line-height: 1;
}
.xhclaw-thinking-box .xhclaw-thinking-body {
    margin-top: 8px;
    color: #6b7280;
    font-style: italic;
    line-height: 1.7;
    white-space: pre-wrap;
    display: block;
}
.xhclaw-thinking-box.xhclaw-thinking-collapsed .xhclaw-thinking-body {
    display: none;
}
.xhclaw-thinking-box.xhclaw-thinking-collapsed {
    max-height: 40px;
    overflow: hidden;
    cursor: pointer;
}
.xhclaw-thinking-box::-webkit-scrollbar {
    width: 4px;
}
.xhclaw-thinking-box::-webkit-scrollbar-track {
    background: transparent;
}
.xhclaw-thinking-box::-webkit-scrollbar-thumb {
    background: #d0d5dd;
    border-radius: 2px;
}

.xhclaw-msg-content {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}
.xhclaw-msg-content * {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}
/* 表格元素需要特殊处理：table 不受 max-width 约束，由外层 wrap 控制 */
.xhclaw-msg-content table,
.xhclaw-msg-content .xhclaw-table,
.xhclaw-msg-content .xhclaw-table-wrap table {
    max-width: none;
}
.xhclaw-msg-user .xhclaw-msg-bubble {
    background: var(--xhclaw-gradient-btn);
    color: #fff;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(212, 132, 90, 0.25);
}
.xhclaw-msg-content p {
    margin: 0 0 4px 0;
}
.xhclaw-msg-content p:last-child {
    margin-bottom: 0;
}
.xhclaw-msg-content pre {
    background: rgba(0,0,0,0.06);
    padding: 8px 12px;
    border-radius: var(--xhclaw-radius-xs);
    overflow-x: auto;
    font-size: 13px;
    margin: 8px 0;
}
.xhclaw-msg-content code {
    background: rgba(0,0,0,0.06);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 13px;
}
.xhclaw-msg-content pre code {
    background: none;
    padding: 0;
}
.xhclaw-msg-content ul, .xhclaw-msg-content ol {
    margin: 4px 0;
    padding-left: 18px;
}
.xhclaw-msg-content li {
    margin: 2px 0;
    overflow-wrap: break-word;
    word-break: break-word;
}
.xhclaw-msg-content strong {
    color: var(--xhclaw-orange-deep);
}

/* Thinking area */
.xhclaw-thinking {
    margin-top: 8px;
    border-top: 1px dashed var(--xhclaw-border);
    padding-top: 8px;
}
.xhclaw-thinking-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--xhclaw-text-muted);
    cursor: pointer;
    user-select: none;
}
.xhclaw-thinking-toggle:hover {
    color: var(--xhclaw-orange-deep);
}
.xhclaw-thinking-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}
.xhclaw-thinking-toggle.open svg {
    transform: rotate(90deg);
}
.xhclaw-thinking-content {
    display: none;
    margin-top: 6px;
    padding: 8px;
    background: rgba(168, 200, 216, 0.15);
    border-radius: var(--xhclaw-radius-xs);
    font-size: 12px;
    color: var(--xhclaw-text-light);
    line-height: 1.5;
}
.xhclaw-thinking-content.show {
    display: block;
}

/* 智能体思考中加载动画 */
.xhclaw-thinking-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    margin-bottom: 4px;
}
.xhclaw-thinking-loading-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}
.xhclaw-thinking-loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--xhclaw-primary, #D4845A);
    animation: xhclaw-loading-bounce 1.4s ease-in-out infinite both;
}
.xhclaw-thinking-loading-dots span:nth-child(1) { animation-delay: 0s; }
.xhclaw-thinking-loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.xhclaw-thinking-loading-dots span:nth-child(3) { animation-delay: 0.32s; }
.xhclaw-thinking-loading-text {
    font-size: 13px;
    color: var(--xhclaw-text-light, #999);
    letter-spacing: 0.5px;
}
@keyframes xhclaw-loading-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Confirm Card */
/* 确认步骤卡片 - 匹配参考图设计 */
/* ===== 确认卡片 ===== */
.xhclaw-confirm-card {
    background: rgba(255, 252, 248, 0.95);
    border: 1px solid rgba(232, 168, 124, 0.25);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 6px 24px rgba(212, 132, 90, 0.1);
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
/* 文件上传区域 */
.xhclaw-file-upload-section { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(0,0,0,0.06); }
.xhclaw-file-upload-label { font-size: 12px; color: #666; margin-bottom: 6px; }
.xhclaw-file-upload-area {
    margin-top: 10px;
    padding: 10px;
    background: #f8f6f3;
    border-radius: 8px;
    border: 1px dashed rgba(232, 168, 124, 0.4);
}
.xhclaw-file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--xhclaw-orange);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}
.xhclaw-file-upload-btn:hover { background: var(--xhclaw-orange-deep); }
.xhclaw-file-list { margin-top: 8px; }
.xhclaw-file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 12px;
    color: #555;
}
.xhclaw-file-item-icon { color: var(--xhclaw-orange); font-size: 14px; }
.xhclaw-file-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xhclaw-file-item-size { color: #999; font-size: 11px; white-space: nowrap; }
.xhclaw-file-item-remove {
    color: #999;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
}
.xhclaw-file-item-remove:hover { color: #e74c3c; }
.xhclaw-confirm-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--xhclaw-orange-deep);
    margin: 0 0 12px 0;
    text-align: center;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: break-word;
}
.xhclaw-confirm-req-section {
    background: #F5F5F5;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
}
.xhclaw-confirm-req-label {
    font-size: 11px;
    color: var(--xhclaw-text-muted);
    margin-bottom: 4px;
}
.xhclaw-confirm-req-text {
    font-size: 14px;
    color: var(--xhclaw-text);
    font-weight: 500;
    line-height: 1.5;
}
.xhclaw-confirm-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.xhclaw-confirm-tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
}
.xhclaw-confirm-steps-section {
    margin-bottom: 16px;
}
.xhclaw-confirm-steps-label {
    font-size: 11px;
    color: var(--xhclaw-text-muted);
    margin-bottom: 8px;
}
.xhclaw-confirm-steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.xhclaw-confirm-step-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}
.xhclaw-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #E8E8E8;
    color: var(--xhclaw-text-light);
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.xhclaw-step-text {
    font-size: 13px;
    color: var(--xhclaw-text);
    line-height: 22px;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}
.xhclaw-confirm-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.xhclaw-btn-confirm {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    background: linear-gradient(135deg, var(--xhclaw-orange), var(--xhclaw-blue-deep));
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xhclaw-btn-confirm:hover {
    box-shadow: 0 4px 16px rgba(212, 132, 90, 0.4);
    transform: translateY(-1px);
}
.xhclaw-btn-retry {
    padding: 9px 16px;
    background: #F0F0F0;
    color: var(--xhclaw-text-light);
    border: none;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.xhclaw-btn-retry:hover {
    background: #E5E5E5;
}
.xhclaw-btn-edit {
    padding: 9px 16px;
    background: transparent;
    color: var(--xhclaw-orange);
    border: 1px solid var(--xhclaw-orange);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.xhclaw-btn-edit:hover {
    background: rgba(232, 168, 124, 0.08);
}
.xhclaw-confirm-hint {
    text-align: center;
    font-size: 11px;
    color: var(--xhclaw-text-muted);
    margin-bottom: 6px;
}
.xhclaw-confirm-disclaimer {
    text-align: center;
    font-size: 10px;
    color: var(--xhclaw-text-muted);
    opacity: 0.7;
}

/* AI 分析中指示器 */
.xhclaw-analyzing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.xhclaw-analyzing-icon {
    animation: xhclaw-pulse 1.5s ease-in-out infinite;
}
.xhclaw-analyzing-text {
    font-size: 13px;
    color: var(--xhclaw-text-light);
}
.xhclaw-analyzing-dots span {
    animation: xhclaw-dot-blink 1.4s infinite;
    opacity: 0;
}
.xhclaw-analyzing-dots span:nth-child(1) { animation-delay: 0s; }
.xhclaw-analyzing-dots span:nth-child(2) { animation-delay: 0.2s; }
.xhclaw-analyzing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes xhclaw-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}
@keyframes xhclaw-dot-blink {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Task Card */
.xhclaw-task-card {
    background: var(--xhclaw-card);
    backdrop-filter: var(--xhclaw-blur);
    -webkit-backdrop-filter: var(--xhclaw-blur);
    border: 1px solid var(--xhclaw-border);
    border-radius: var(--xhclaw-radius-sm);
    padding: 14px;
    margin-top: 8px;
    box-shadow: var(--xhclaw-shadow);
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.xhclaw-task-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
    flex-wrap: wrap;
}
.xhclaw-task-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--xhclaw-orange-deep);
    overflow-wrap: break-word;
    word-break: break-word;
    flex: 1;
    min-width: 0;
}
.xhclaw-task-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.xhclaw-status-pending { background: #FFF3E0; color: #E65100; }
.xhclaw-status-processing { background: #E3F2FD; color: #1565C0; }
.xhclaw-status-completed { background: #E8F5E9; color: #2E7D32; }
.xhclaw-status-cancelled { background: #F5F5F5; color: #757575; }
.xhclaw-status-error { background: #FFEBEE; color: #C62828; }

.xhclaw-task-steps {
    margin: 0 0 8px 0;
    padding-left: 18px;
}
.xhclaw-task-steps li {
    font-size: 12px;
    color: var(--xhclaw-text-light);
    margin-bottom: 3px;
    position: relative;
    list-style: none;
    padding-left: 16px;
}
.xhclaw-task-steps li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--xhclaw-blue-light);
}
.xhclaw-task-steps li.step-completed::before {
    background: #4CAF50;
}
.xhclaw-task-steps li.step-processing::before {
    background: #2196F3;
    animation: xhclaw-pulse 1.5s infinite;
}
@keyframes xhclaw-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.xhclaw-task-progress {
    margin-top: 8px;
}
.xhclaw-progress-bar {
    height: 6px;
    background: var(--xhclaw-blue-light);
    border-radius: 3px;
    overflow: hidden;
}
.xhclaw-progress-fill {
    height: 100%;
    background: var(--xhclaw-gradient-btn);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.xhclaw-progress-text {
    font-size: 11px;
    color: var(--xhclaw-text-muted);
    margin-top: 3px;
    text-align: right;
}

/* Quick Actions */
.xhclaw-quick-actions {
    display: flex;
    gap: 6px;
    padding: 0 0 8px 0;
    background: transparent;
    overflow-x: auto;
    flex-wrap: nowrap;
}
.xhclaw-quick-btn {
    padding: 5px 12px;
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--xhclaw-border);
    border-radius: 16px;
    font-size: 12px;
    color: var(--xhclaw-text-light);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s;
}
.xhclaw-quick-btn:hover {
    background: var(--xhclaw-orange-light);
    color: var(--xhclaw-orange-deep);
}

/* Input Area - 已改由 JS 动态创建悬浮栏，此处不再需要 */
.xhclaw-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: rgba(255,255,255,0.6);
    border: 1px solid var(--xhclaw-border);
    border-radius: var(--xhclaw-radius-sm);
    padding: 6px 8px;
    transition: border-color 0.2s;
}
.xhclaw-input-wrapper:focus-within {
    border-color: var(--xhclaw-orange);
    box-shadow: 0 0 0 3px rgba(232, 168, 124, 0.15);
}
.xhclaw-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.5;
    color: var(--xhclaw-text);
    max-height: 100px;
    min-height: 22px;
    font-family: inherit;
}
.xhclaw-input::placeholder {
    color: var(--xhclaw-text-muted);
}
.xhclaw-attach-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--xhclaw-text-muted);
    font-size: 20px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.xhclaw-attach-btn:hover {
    background: rgba(232,168,124,0.15);
    color: var(--xhclaw-orange);
}
/* 会话选择器 */
.xhclaw-session-select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--xhclaw-border);
    background: var(--xhclaw-bg);
    color: var(--xhclaw-text-main);
    font-size: 13px;
    padding: 4px 22px 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%2394a3b8'%3E%3Cpath d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.xhclaw-session-select:hover {
    border-color: var(--xhclaw-border-focus);
}
.xhclaw-session-select:focus {
    border-color: var(--xhclaw-orange);
    box-shadow: 0 0 0 2px rgba(232,168,124,0.2);
}
.xhclaw-session-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--xhclaw-text-muted);
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.xhclaw-session-btn:hover {
    background: rgba(232,168,124,0.15);
    color: var(--xhclaw-orange);
}
.xhclaw-session-edit {
    position: fixed;
    background: var(--xhclaw-bg);
    border: 1px solid var(--xhclaw-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 8px 12px;
    display: flex;
    gap: 8px;
    align-items: center;
    z-index: 99999999;
}
.xhclaw-session-edit input {
    border: 1px solid var(--xhclaw-border);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    outline: none;
    min-width: 120px;
    background: var(--xhclaw-bg);
    color: var(--xhclaw-text-main);
}
.xhclaw-session-edit input:focus {
    border-color: var(--xhclaw-orange);
}
.xhclaw-session-edit button {
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.xhclaw-session-edit .xhclaw-session-save {
    background: var(--xhclaw-orange);
    color: #fff;
}
.xhclaw-session-edit .xhclaw-session-save:hover {
    background: var(--xhclaw-orange-hover);
}
.xhclaw-session-edit .xhclaw-session-cancel {
    background: var(--xhclaw-bg-tertiary);
    color: var(--xhclaw-text-muted);
}
.xhclaw-session-edit .xhclaw-session-cancel:hover {
    background: var(--xhclaw-border);
}
.xhclaw-chat-img-preview {
    position: relative;
    display: inline-block;
    margin: 4px 0;
}
.xhclaw-chat-img-thumb {
    position: relative;
    display: inline-block;
    margin-right: 6px;
}
.xhclaw-chat-img-thumb img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--xhclaw-border);
    cursor: pointer;
    transition: transform 0.15s;
}
.xhclaw-chat-img-thumb img:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
/* 图片弹窗 */
.xhclaw-img-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999999;
    cursor: pointer;
    animation: xhclaw-modal-fadein 0.2s;
}
.xhclaw-img-modal img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
@keyframes xhclaw-modal-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}
.xhclaw-chat-img-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #ff4d4f;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.xhclaw-chat-img-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}
.xhclaw-chat-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.xhclaw-chat-img-wrap {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-block;
    margin: 2px 4px 2px 0;
}
.xhclaw-chat-img-wrap img.xhclaw-chat-img {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
    object-fit: cover;
    margin: 0;
    display: block;
    transition: transform 0.2s;
}
.xhclaw-chat-img-wrap:hover img.xhclaw-chat-img {
    transform: scale(1.05);
}
.xhclaw-send-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--xhclaw-gradient-btn);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.xhclaw-send-btn:hover {
    box-shadow: 0 4px 12px rgba(212, 132, 90, 0.4);
    transform: scale(1.05);
}
.xhclaw-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.xhclaw-send-btn.loading svg {
    animation: xhclaw-spin 1s linear infinite;
}
@keyframes xhclaw-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.xhclaw-disclaimer {
    font-size: 11px;
    color: var(--xhclaw-text-muted);
    text-align: center;
    margin-top: 6px;
}

/* Load More */
.xhclaw-load-more, .xhclaw-no-more {
    text-align: center;
    padding: 8px;
}
.xhclaw-btn-text {
    background: none;
    border: none;
    color: var(--xhclaw-blue-deep);
    font-size: 12px;
    cursor: pointer;
}
.xhclaw-btn-text:hover {
    text-decoration: underline;
}
.xhclaw-no-more {
    font-size: 12px;
    color: var(--xhclaw-text-muted);
}

/* Modals */
.xhclaw-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999999;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: xhclaw-fade-in 0.2s ease;
}
.xhclaw-modal-content {
    background: rgba(255,255,255,0.92);
    backdrop-filter: var(--xhclaw-blur);
    -webkit-backdrop-filter: var(--xhclaw-blur);
    border: 1px solid var(--xhclaw-border);
    border-radius: var(--xhclaw-radius);
    box-shadow: var(--xhclaw-shadow-lg);
    width: 90%;
    max-width: 440px;
    max-height: 85vh;
    overflow-y: auto;
}
.xhclaw-modal-content.xhclaw-modal-large {
    max-width: 560px;
}
.xhclaw-modal-content.xhclaw-modal-small {
    max-width: 320px;
}
.xhclaw-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--xhclaw-border);
}
.xhclaw-modal-header h2, .xhclaw-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--xhclaw-text);
}
.xhclaw-modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0,0,0,0.06);
    border-radius: 50%;
    font-size: 18px;
    color: var(--xhclaw-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.xhclaw-modal-close:hover {
    background: rgba(0,0,0,0.12);
}
.xhclaw-modal-body {
    padding: 18px;
}

/* Form */
.xhclaw-form-group {
    margin-bottom: 14px;
}
.xhclaw-form-group label {
    display: block;
    font-size: 13px;
    color: var(--xhclaw-text-light);
    margin-bottom: 5px;
}
.xhclaw-input-field {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--xhclaw-border);
    border-radius: var(--xhclaw-radius-xs);
    background: rgba(255,255,255,0.6);
    font-size: 14px;
    color: var(--xhclaw-text);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.xhclaw-input-field:focus {
    border-color: var(--xhclaw-orange);
    box-shadow: 0 0 0 3px rgba(232, 168, 124, 0.12);
}
.xhclaw-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.xhclaw-create-site-link {
    margin-top: 12px;
    font-size: 12px;
    color: var(--xhclaw-text-muted);
    text-align: center;
}
.xhclaw-create-site-link a {
    color: var(--xhclaw-orange-deep);
    text-decoration: none;
}
.xhclaw-create-site-link a:hover {
    text-decoration: underline;
}

/* Points Center */
.xhclaw-points-summary {
    text-align: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--xhclaw-border);
    margin-bottom: 14px;
}
.xhclaw-points-total {
    font-size: 36px;
    font-weight: 700;
    color: var(--xhclaw-orange-deep);
}
.xhclaw-points-total-unit {
    font-size: 14px;
    color: var(--xhclaw-text-muted);
    margin-left: 4px;
}
.xhclaw-recharge-btn {
    display: inline-block;
    margin-top: 8px;
}
/* 积分限制/提醒弹窗 */
.xhclaw-points-alert-modal {
    max-width: 400px !important;
    border-radius: 18px !important;
    overflow: hidden;
    border: 1px solid rgba(232,168,124,0.18);
    box-shadow: 0 18px 48px rgba(92, 58, 34, 0.20);
}
.xhclaw-points-alert-modal .xhclaw-modal-header {
    background: linear-gradient(135deg, rgba(232,168,124,0.14), rgba(255,255,255,0.96));
    border-bottom: 1px solid rgba(232,168,124,0.14);
}
.xhclaw-points-alert-modal .xhclaw-modal-header h3 {
    color: #6f4a2f;
    font-weight: 800;
}
.xhclaw-points-alert-modal .xhclaw-modal-close {
    background: rgba(232,168,124,0.12);
    color: #8a5a35;
}
.xhclaw-points-alert-modal .xhclaw-modal-close:hover {
    background: linear-gradient(135deg, #E8A87C, #D4796A);
    color: #fff;
}
.xhclaw-points-alert-icon {
    text-align: center;
    margin: 4px 0 14px;
}
.xhclaw-points-alert-icon-blocked {
    font-size: 42px;
    display: none;
    width: 72px;
    height: 72px;
    line-height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(212,80,80,0.12), rgba(255,255,255,0.85));
    box-shadow: 0 8px 24px rgba(212,80,80,0.12);
}
.xhclaw-points-alert-icon-warning {
    font-size: 42px;
    display: none;
    width: 72px;
    height: 72px;
    line-height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(232,168,124,0.18), rgba(255,255,255,0.9));
    box-shadow: 0 8px 24px rgba(232,168,124,0.16);
}
.xhclaw-points-alert-modal.xhclaw-points-alert-type-blocked .xhclaw-points-alert-icon-blocked {
    display: inline-block;
}
.xhclaw-points-alert-modal.xhclaw-points-alert-type-warning .xhclaw-points-alert-icon-warning {
    display: inline-block;
}
.xhclaw-points-alert-balance {
    text-align: center;
    padding: 18px 0 16px;
    background: linear-gradient(135deg, rgba(232,168,124,0.10), rgba(255,255,255,0.88));
    border-radius: 14px;
    margin-bottom: 16px;
    border: 1px solid rgba(232,168,124,0.20);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}
.xhclaw-points-alert-balance-label {
    font-size: 13px;
    color: var(--xhclaw-text-muted);
    margin-bottom: 8px;
}
.xhclaw-points-alert-balance-value {
    font-size: 44px;
    font-weight: 700;
    color: var(--xhclaw-orange-deep);
    line-height: 1;
}
.xhclaw-points-alert-type-blocked .xhclaw-points-alert-balance-value {
    color: #cc5a4d;
}
.xhclaw-points-alert-balance-unit {
    font-size: 14px;
    color: var(--xhclaw-text-muted);
    margin-left: 4px;
    font-weight: 400;
}
.xhclaw-points-alert-text {
    text-align: center;
    font-size: 14px;
    color: var(--xhclaw-text);
    line-height: 1.7;
    margin: 0 4px 22px;
    padding: 0 6px;
}
/* 弹窗按钮区域 */
.xhclaw-points-alert-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
    margin-top: 6px;
}
#xhclaw-points-alert-recharge-wrap {
    display: flex;
    min-width: 0;
}
.xhclaw-points-alert-actions > * {
    min-width: 0;
    width: 100%;
}
/* 充值按钮（链接形式） */
.xhclaw-points-alert-actions a,
.xhclaw-points-alert-actions .xhclaw-recharge-btn,
#xhclaw-points-alert-recharge-wrap a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 18px !important;
    background: linear-gradient(135deg, var(--xhclaw-orange), var(--xhclaw-orange-deep));
    color: #fff !important;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 16px rgba(212,132,90,0.24);
    line-height: 44px !important;
    box-sizing: border-box !important;
    text-align: center;
    white-space: nowrap;
}
.xhclaw-points-alert-actions a:hover,
.xhclaw-points-alert-actions .xhclaw-recharge-btn:hover,
#xhclaw-points-alert-recharge-wrap a:hover {
    background: linear-gradient(135deg, var(--xhclaw-orange-deep), #c46a3a);
    box-shadow: 0 4px 14px rgba(212,132,90,0.35);
    transform: translateY(-1px);
}
/* 关闭 / 继续发送 按钮 — 与充值按钮完全一致，仅颜色不同 */
.xhclaw-points-alert-btn-secondary {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 18px !important;
    background: var(--xhclaw-gray-100);
    color: var(--xhclaw-text) !important;
    border: 1px solid var(--xhclaw-border);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    line-height: 44px !important;
    box-sizing: border-box !important;
    text-align: center;
    white-space: nowrap;
}
.xhclaw-points-alert-btn-secondary:hover {
    background: var(--xhclaw-gray-200);
    border-color: var(--xhclaw-gray-300);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
/* 提醒模式下，继续发送按钮变为主色调 */
.xhclaw-points-alert-modal.xhclaw-points-alert-type-warning .xhclaw-points-alert-btn-secondary {
    background: linear-gradient(135deg, var(--xhclaw-orange), var(--xhclaw-orange-deep));
    color: #fff !important;
    border: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(212,132,90,0.25);
}
.xhclaw-points-alert-modal.xhclaw-points-alert-type-warning .xhclaw-points-alert-btn-secondary:hover {
    background: linear-gradient(135deg, var(--xhclaw-orange-deep), #c46a3a);
    box-shadow: 0 4px 14px rgba(212,132,90,0.35);
}
@media (max-width: 360px) {
    .xhclaw-points-alert-actions {
        grid-template-columns: 1fr;
    }
}
.xhclaw-points-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--xhclaw-border);
}
.xhclaw-points-tab {
    flex: 1;
    padding: 8px 0;
    border: none;
    background: none;
    font-size: 13px;
    color: var(--xhclaw-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.xhclaw-points-tab.active {
    color: var(--xhclaw-orange-deep);
    border-bottom-color: var(--xhclaw-orange-deep);
}
.xhclaw-points-tab:hover {
    color: var(--xhclaw-orange);
}
.xhclaw-points-list {
    min-height: 100px;
}
.xhclaw-points-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 13px;
}
.xhclaw-points-list-item:last-child {
    border-bottom: none;
}
.xhclaw-points-item-desc {
    color: var(--xhclaw-text);
}
.xhclaw-points-item-time {
    font-size: 11px;
    color: var(--xhclaw-text-muted);
}
.xhclaw-points-item-value {
    font-weight: 600;
}
.xhclaw-points-item-value.positive {
    color: #4CAF50;
}
.xhclaw-points-item-value.negative {
    color: #E53935;
}

/* Points status tags */
.xhclaw-tag {
    display: inline-block;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
    font-weight: 500;
}
.xhclaw-tag-pending { background: #FFF3E0; color: #E65100; }
.xhclaw-tag-processing { background: #E3F2FD; color: #1565C0; }
.xhclaw-tag-done { background: #E8F5E9; color: #2E7D32; }
.xhclaw-tag-cancelled { background: #F5F5F5; color: #757575; }
.xhclaw-tag-error { background: #FFEBEE; color: #C62828; }

/* Customer Service */
.xhclaw-cs-body {
    text-align: center;
}
.xhclaw-qr-img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: var(--xhclaw-radius-sm);
    margin: 10px 0;
}
.xhclaw-muted {
    color: var(--xhclaw-text-muted);
}

/* Loading dots */
.xhclaw-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}
.xhclaw-typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--xhclaw-orange);
    animation: xhclaw-typing 1.4s infinite both;
}
.xhclaw-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.xhclaw-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes xhclaw-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Follow-up question button */
/* Follow-up button (outside bubble, right-bottom for AI messages) */
.xhclaw-followup-outside {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    color: rgba(148,163,184,0.4);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    padding: 0;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.xhclaw-followup-outside:hover {
    background: rgba(59,130,246,0.1);
    color: #3b82f6;
}
.xhclaw-followup-outside:active {
    transform: scale(0.92);
}
.xhclaw-msg-user .xhclaw-followup-outside {
    display: none;
}

/* Re-edit button (outside bubble, left-bottom) */
.xhclaw-reedit-outside {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    color: rgba(148,163,184,0.4);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    padding: 0;
    margin-bottom: 2px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    flex-shrink: 0;
}
.xhclaw-reedit-outside:hover {
    color: var(--xhclaw-primary);
    background: rgba(0,114,255,0.08);
}
.xhclaw-reedit-outside:active {
    transform: scale(0.9);
}

/* 分页 - 聊天历史分页组件 */
.xhclaw-pagination {
    display: none;
    justify-content: center;
    margin-top: 12px;
    padding: 10px 0;
    font-family: inherit;
}
.xhclaw-pagination-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: var(--xhclaw-blur);
    -webkit-backdrop-filter: var(--xhclaw-blur);
    border: 1px solid var(--xhclaw-border);
    border-radius: var(--xhclaw-radius-sm);
    padding: 8px 16px;
    box-shadow: 0 2px 12px rgba(212, 132, 90, 0.08);
}
.xhclaw-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    min-width: 32px;
    height: 30px;
    border: 1px solid var(--xhclaw-border);
    border-radius: var(--xhclaw-radius-xs);
    background: rgba(255, 255, 255, 0.6);
    color: var(--xhclaw-text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
    box-sizing: border-box;
}
.xhclaw-page-btn:hover:not(:disabled):not(.active) {
    background: rgba(232, 168, 124, 0.15);
    border-color: var(--xhclaw-orange);
    color: var(--xhclaw-orange-deep);
}
.xhclaw-page-btn.active {
    background: var(--xhclaw-gradient-btn);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(212, 132, 90, 0.25);
    font-weight: 500;
}
.xhclaw-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.3);
}
.xhclaw-page-btn.xhclaw-page-nav {
    padding: 5px 10px;
    font-size: 12px;
}
.xhclaw-page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}
.xhclaw-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    color: var(--xhclaw-text-muted);
    font-size: 13px;
    user-select: none;
}
.xhclaw-page-jump {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    padding-left: 10px;
    border-left: 1px solid var(--xhclaw-border);
}
.xhclaw-page-jump-label {
    font-size: 12px;
    color: var(--xhclaw-text-light);
    white-space: nowrap;
}
.xhclaw-page-jump-input {
    width: 42px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid var(--xhclaw-border);
    border-radius: var(--xhclaw-radius-xs);
    background: rgba(255, 255, 255, 0.7);
    color: var(--xhclaw-text);
    font-size: 13px;
    font-family: inherit;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    -moz-appearance: textfield;
}
.xhclaw-page-jump-input::-webkit-outer-spin-button,
.xhclaw-page-jump-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.xhclaw-page-jump-input:focus {
    border-color: var(--xhclaw-orange);
    box-shadow: 0 0 0 2px rgba(232, 168, 124, 0.2);
}
.xhclaw-page-go-btn {
    padding: 5px 10px;
    height: 28px;
    font-size: 12px;
    font-weight: 500;
    background: var(--xhclaw-gradient-btn);
    color: #fff;
    border: none;
    border-radius: var(--xhclaw-radius-xs);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 4px rgba(212, 132, 90, 0.2);
}
.xhclaw-page-go-btn:hover {
    opacity: 0.9;
    box-shadow: 0 2px 8px rgba(212, 132, 90, 0.3);
}
.xhclaw-per-page-select {
    margin-left: 8px;
    padding-left: 10px;
    border-left: 1px solid var(--xhclaw-border);
}
.xhclaw-per-page-dropdown {
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--xhclaw-border);
    border-radius: var(--xhclaw-radius-xs);
    background: rgba(255, 255, 255, 0.7);
    color: var(--xhclaw-text);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    appearance: auto;
    -webkit-appearance: auto;
}
.xhclaw-per-page-dropdown:focus {
    border-color: var(--xhclaw-orange);
    box-shadow: 0 0 0 2px rgba(232, 168, 124, 0.2);
}

/* Shortcode wrapper */
.xhclaw-shortcode-wrapper {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    margin-top: -15px !important;
}

/* 隐藏子比悬浮按钮 - 仅在插件容器内生效，由JS控制更安全 */
.xhclaw-app .zib-widget {
    margin-top: -15px !important;
}

.xhclaw-shortcode-wrapper .xhclaw-app {
    width: 100%;
    overflow: visible !important;
    height: auto !important;
}

/* AI消息内容Markdown样式+防溢出（旧规则已由文件末尾的新规则覆盖） */
.xhclaw-msg-content li {
    margin-left: 16px;
    line-height: 1.6;
}
/* 增强Markdown样式 */
.xhclaw-msg-content .xhclaw-code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.5;
}
.xhclaw-msg-content .xhclaw-code-block code {
    background: none;
    padding: 0;
    word-break: normal;
    color: inherit;
}
.xhclaw-msg-content .xhclaw-inline-code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #c7254e;
}
.xhclaw-msg-content .xhclaw-h {
    margin: 12px 0 6px 0;
    font-weight: 700;
    line-height: 1.4;
}
.xhclaw-msg-content .xhclaw-h2 { font-size: 1.15em; }
.xhclaw-msg-content .xhclaw-h3 { font-size: 1.05em; }
.xhclaw-msg-content .xhclaw-h4 { font-size: 1em; }
.xhclaw-msg-content .xhclaw-quote {
    border-left: 3px solid #e8a87c;
    padding: 6px 12px;
    margin: 8px 0;
    background: #fff8f3;
    border-radius: 0 6px 6px 0;
    color: #555;
    font-size: 0.95em;
}
.xhclaw-msg-content .xhclaw-link {
    color: #e8a87c;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.xhclaw-msg-content .xhclaw-link:hover {
    color: #d4935e;
}
.xhclaw-msg-content .xhclaw-hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 12px 0;
}
.xhclaw-msg-content .xhclaw-ol {
    padding-left: 20px;
    margin: 6px 0;
}
.xhclaw-msg-content .xhclaw-ol li {
    margin-left: 0;
    padding-left: 4px;
    line-height: 1.7;
}
.xhclaw-msg-content .xhclaw-ul {
    padding-left: 20px;
    margin: 6px 0;
    list-style: disc;
}
.xhclaw-msg-content .xhclaw-ul li {
    margin-left: 0;
    padding-left: 4px;
    line-height: 1.7;
}
.xhclaw-msg-content h1, .xhclaw-msg-content h2, .xhclaw-msg-content h3 {
    margin: 8px 0 4px;
    font-weight: 600;
}
.xhclaw-msg-content h1 { font-size: 16px; }
.xhclaw-msg-content h2 { font-size: 15px; }
.xhclaw-msg-content h3 { font-size: 14px; }
.xhclaw-msg-content hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 8px 0;
}
.xhclaw-msg-content a {
    color: var(--xhclaw-orange);
    word-break: break-all;
}

/* ===== 聊天图片预览行（浮动栏上方独立行，横向滚动） ===== */
.xhclaw-chat-img-preview-bar {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: var(--xhclaw-blue-light) transparent;
}
.xhclaw-chat-img-preview-bar.has-images {
    display: flex;
}
.xhclaw-chat-img-preview-bar::-webkit-scrollbar {
    height: 4px;
}
.xhclaw-chat-img-preview-bar::-webkit-scrollbar-track {
    background: transparent;
}
.xhclaw-chat-img-preview-bar::-webkit-scrollbar-thumb {
    background: var(--xhclaw-blue-light);
    border-radius: 2px;
}
.xhclaw-chat-img-thumb {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--xhclaw-border-color);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.xhclaw-chat-img-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    border-color: var(--xhclaw-blue-light);
}
.xhclaw-chat-img-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.xhclaw-chat-img-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 13px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
}
.xhclaw-chat-img-thumb:hover .xhclaw-chat-img-remove {
    opacity: 1;
}
.xhclaw-chat-img-remove:hover {
    background: #dc3545;
    transform: scale(1.15);
}

/* 流中断提示 */
.xhclaw-stream-interrupted {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    font-size: 13px;
    color: #856404;
    line-height: 1.6;
}
.xhclaw-stream-interrupted-icon {
    margin-right: 4px;
}
.xhclaw-stream-interrupted .xhclaw-retry-link {
    color: #ff6600;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}
.xhclaw-stream-interrupted .xhclaw-retry-link:hover {
    color: #e55a00;
}

/* 拖拽上传高亮 */
.xhclaw-drag-over {
    border-color: #E8A87C !important;
    background: rgba(232,168,124,0.06) !important;
    box-shadow: 0 0 0 4px rgba(232,168,124,0.15), inset 0 0 20px rgba(232,168,124,0.08) !important;
    position: relative;
}
.xhclaw-drag-over::after {
    content: '拖放图片到此处上传';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #E8A87C;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    z-index: 10;
    background: rgba(255,255,255,0.85);
    padding: 8px 20px;
    border-radius: 20px;
    border: 1.5px dashed #E8A87C;
    white-space: nowrap;
}
.xhclaw-drag-over .xhclaw-fb-textarea,
.xhclaw-drag-over .xhclaw-fb-icon-btn,
.xhclaw-drag-over .xhclaw-fb-send-btn,
.xhclaw-drag-over .xhclaw-chat-img-preview-bar {
    opacity: 0.3;
    pointer-events: none;
}

/* 追加描述提示行 */
.xhclaw-append-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #FFF8F0;
    border: 1px solid #FFD8A8;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 12px;
    line-height: 1.4;
}
.xhclaw-append-hint-label {
    display: inline-block;
    padding: 1px 8px;
    background: linear-gradient(135deg, #FF8A50, #E65100);
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
}
.xhclaw-append-hint-text {
    color: #5D4037;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.xhclaw-append-hint-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #F5F5F5;
    color: #999;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}
.xhclaw-append-hint-close:hover {
    background: #FFCDD2;
    color: #C62828;
}
.xhclaw-msg-content img {
    max-width: 100%;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}
/* 用户上传的图片缩略图 - 必须覆盖上面通用img样式 */
.xhclaw-msg-content .xhclaw-chat-img-wrap {
    width: 80px;
    height: 80px;
    display: inline-block;
    margin: 2px 4px 2px 0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}
.xhclaw-msg-content .xhclaw-chat-img {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
    object-fit: cover;
    border-radius: 6px;
}
.xhclaw-msg-content img:hover {
    opacity: 0.85;
}
/* 图片弹窗 */
.xhclaw-img-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 99999999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: xhclaw-fade-in 0.2s ease;
}
.xhclaw-img-modal img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    cursor: default;
}
.xhclaw-img-modal-close {
    position: absolute;
    top: 16px; right: 20px;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 99999999;
}
.xhclaw-img-modal-close:hover { opacity: 1; }
@keyframes xhclaw-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.xhclaw-confirm-card, .xhclaw-task-card {
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .xhclaw-app {
        max-height: none;
        min-height: 300px;
        border-radius: 0;
    }
    .xhclaw-banner {
        border-radius: 0;
    }
    .xhclaw-header {
        padding: 10px 12px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .xhclaw-header-left, .xhclaw-header-right {
        flex-wrap: wrap;
    }
    .xhclaw-site-select {
        max-width: 120px;
    }
    .xhclaw-agent-opt-desc {
        display: none;
    }
    .xhclaw-agent-tabs {
        order: 3;
        width: auto;
        max-width: 100%;
    }
        margin-top: 4px;
    }
    .xhclaw-user-name {
        max-width: 60px;
    }
    .xhclaw-msg-bubble {
        max-width: 90%;
        font-size: 14px;
    }
    .xhclaw-msg-content {
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .xhclaw-confirm-card {
        padding: 12px;
    }
    .xhclaw-confirm-title {
        font-size: 14px;
    }
    .xhclaw-confirm-actions {
        flex-direction: column;
        gap: 8px;
    }
    .xhclaw-btn-confirm,
    .xhclaw-btn-retry,
    .xhclaw-btn-edit {
        width: 100%;
        text-align: center;
        padding: 10px 12px;
    }
    .xhclaw-task-card {
        padding: 12px;
    }
    .xhclaw-task-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .xhclaw-task-status {
        align-self: flex-start;
    }
    .xhclaw-quick-actions {
        padding: 0 0 6px 0;
    }
    .xhclaw-chat-area {
        padding-bottom: 160px;
    }
    .xhclaw-modal-content {
        width: 95%;
    }
}

/* ===== 作图相关样式 ===== */
.xhclaw-image-controls {
    display: none;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
}
.xhclaw-img-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    color: #999;
    flex-shrink: 0;
    transition: all 0.2s;
}
.xhclaw-img-upload-btn:hover {
    border-color: #E8A87C;
    color: #E8A87C;
}
.xhclaw-img-ref-preview {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}
.xhclaw-img-ref-preview img {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #e0e0e0;
}
.xhclaw-img-ref-preview button {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff4d4f;
    color: #fff;
    border: none;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 图片卡片 */
.xhclaw-img-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}
.xhclaw-img-card-model {
    color: #999;
}
.xhclaw-img-card-cost {
    color: #E8A87C;
    font-weight: 500;
}
.xhclaw-img-card-prompt {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: rgba(0,0,0,0.03);
    border-radius: 6px;
    word-break: break-all;
}
.xhclaw-img-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.xhclaw-img-card-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    aspect-ratio: auto;
    max-width: 100%;
}
.xhclaw-img-card-item img {
    width: 100%;
    display: block;
    border-radius: 7px;
}
.xhclaw-img-card-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 6px;
    background: linear-gradient(transparent, rgba(0,0,0,0.5));
    opacity: 0;
    transition: opacity 0.2s;
}
.xhclaw-img-card-item:hover .xhclaw-img-card-actions {
    opacity: 1;
}
.xhclaw-img-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}
.xhclaw-img-btn:hover {
    transform: scale(1.1);
}
.xhclaw-img-card-errors {
    margin-top: 8px;
    font-size: 12px;
    color: #ff4d4f;
}
.xhclaw-loading-dots span {
    animation: xhclaw-dots 1.4s infinite;
    opacity: 0;
}
.xhclaw-loading-dots span:nth-child(1) { animation-delay: 0s; }
.xhclaw-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.xhclaw-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
/* 图片放大查看遮罩 */
.xhclaw-img-zoom-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85); z-index: 99999;
    display: flex; align-items: center; justify-content: center;
}
.xhclaw-img-zoom-container {
    position: relative; max-width: 90vw; max-height: 90vh;
}
.xhclaw-img-zoom-container img {
    max-width: 90vw; max-height: 85vh; object-fit: contain;
    border-radius: 8px; box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}
.xhclaw-img-zoom-close {
    position: absolute; top: -12px; right: -12px;
    width: 36px; height: 36px; border-radius: 50%;
    background: #fff; border: none; font-size: 20px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.xhclaw-img-zoom-close:hover { background: #f0f0f0; }

/* 图片卡片底部 */
.xhclaw-img-card-footer {
    margin-top: 8px;
    display: flex;
    align-items: center;
}
.xhclaw-img-regen-btn {
    background: transparent; color: #999; border: 1px solid #e0e0e0;
    padding: 3px 10px; border-radius: 4px; cursor: pointer;
    font-size: 11px; transition: all 0.2s; line-height: 1.4;
}
.xhclaw-img-regen-btn:hover {
    color: #E8A87C; border-color: #E8A87C; background: rgba(232,168,124,0.06);
}

/* 图片生成中动画 */
.xhclaw-img-gen-loading {
    padding: 12px 16px;
}
.xhclaw-img-gen-loading-row {
    display: flex; align-items: center; gap: 10px;
}
.xhclaw-img-gen-spinner {
    width: 28px; height: 28px; border: 3px solid #f0f0f0;
    border-top-color: #E8A87C; border-radius: 50%;
    animation: xhclaw-spin 0.8s linear infinite;
    flex-shrink: 0;
}
.xhclaw-img-gen-text {
    font-size: 13px; color: #999;
}
.xhclaw-img-gen-text .count {
    color: #E8A87C; font-weight: 600;
}
.xhclaw-img-generating-tip {
    margin-top: 8px; font-size: 12px; color: #bbb;
    min-height: 18px; line-height: 18px;
}

/* 图片懒加载占位 */
.xhclaw-img-lazy-wrap {
    position: relative; background: #f8f8f8; border-radius: 7px;
    min-height: 120px; display: flex; align-items: center; justify-content: center;
}
.xhclaw-img-lazy-wrap img {
    transition: opacity 0.3s;
}
.xhclaw-img-lazy-spinner {
    position: absolute; width: 24px; height: 24px;
    border: 2px solid #eee; border-top-color: #E8A87C;
    border-radius: 50%; animation: xhclaw-spin 0.7s linear infinite;
}

@keyframes xhclaw-dots {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}
@keyframes xhclaw-spin {
    to { transform: rotate(360deg); }
}

/* 作图模式选择菜单 */
.xhclaw-img-mode-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35); z-index: 999999;
    display: flex; align-items: center; justify-content: center;
    animation: xhclaw-overlay-fadein 0.15s ease;
}
.xhclaw-img-mode-menu {
    background: #fff; border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 16px; min-width: 240px; max-width: 90vw;
    animation: xhclaw-menu-fadein 0.2s ease;
    position: relative;
}
.xhclaw-img-mode-title {
    font-size: 14px; font-weight: 600; color: #333; margin-bottom: 12px;
    text-align: center;
}
.xhclaw-img-mode-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; cursor: pointer; font-size: 13px;
    color: #333; border-radius: 10px; transition: background 0.15s;
}
.xhclaw-img-mode-item:hover {
    background: #f5f5f5;
}
.xhclaw-img-mode-item.active {
    background: #FFF5EE; color: #E8A87C; font-weight: 600;
}
.xhclaw-img-mode-item .mode-icon {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.xhclaw-img-mode-item .mode-name { flex: 1; }
.xhclaw-img-mode-item .mode-cost {
    font-size: 11px; color: #bbb;
}
.xhclaw-img-mode-item.active .mode-cost { color: #E8A87C; }

.xhclaw-chat-model-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(232,168,124,0.12);
    color: #9a6a49;
    font-size: 20px;
    line-height: 26px;
    cursor: pointer;
    transition: all 0.18s ease;
}
.xhclaw-chat-model-close:hover {
    background: linear-gradient(135deg, #E8A87C, #D4796A);
    color: #fff;
    box-shadow: 0 4px 12px rgba(232,168,124,0.28);
    transform: rotate(90deg);
}
#xhclaw-chat-model-overlay .xhclaw-img-mode-menu {
    width: min(430px, 92vw);
    padding: 18px;
    border: 1px solid rgba(232,168,124,0.14);
}
#xhclaw-chat-model-overlay .xhclaw-img-mode-title {
    color: #6f4a2f;
    font-weight: 700;
    padding-right: 32px;
}

@keyframes xhclaw-overlay-fadein {
    from { opacity: 0; } to { opacity: 1; }
}
@keyframes xhclaw-menu-fadein {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 对话模型选择器 */
.xhclaw-chat-model-arrow {
    font-size: 10px; cursor: pointer; margin-left: 4px; opacity: 0.6;
    transition: transform 0.2s;
}
.xhclaw-chat-model-arrow:hover { opacity: 1; }
.xhclaw-chat-model-arrow.open { transform: rotate(180deg); }
.xhclaw-chat-model-menu {
    display: none; position: absolute; top: 100%; left: 0; z-index: 999999;
    background: #fff; border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 8px; min-width: 180px; margin-top: 4px;
    animation: xhclaw-menu-fadein 0.2s ease;
}
.xhclaw-chat-model-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; cursor: pointer; font-size: 13px;
    color: #333; border-radius: 8px; transition: background 0.15s;
}
.xhclaw-chat-model-item:hover { background: #f5f5f5; }
.xhclaw-chat-model-item.active { background: #FFF5EE; color: #E8A87C; font-weight: 600; }
.xhclaw-chat-model-item .model-name { flex: 1; }
.xhclaw-chat-model-item .model-cost { font-size: 11px; color: #bbb; }
.xhclaw-chat-model-item.active .model-cost { color: #E8A87C; }

/* 图片生成中 loading */
.xhclaw-img-loading {
    text-align: center;
    padding: 20px;
}
.xhclaw-img-loading-spinner {
    width: 32px; height: 32px;
    border: 3px solid #f0f0f0;
    border-top-color: #E8A87C;
    border-radius: 50%;
    animation: xhclaw-spin 0.8s linear infinite;
    margin: 0 auto 10px;
}
@keyframes xhclaw-spin {
    to { transform: rotate(360deg); }
}
.xhclaw-img-loading > span {
    display: block;
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}
.xhclaw-img-generating-tip {
    font-size: 12px;
    color: #bbb;
    min-height: 18px;
    line-height: 18px;
    transition: opacity 0.5s ease-in-out;
}

/* ===== 指令面板 ===== */
.xhclaw-cmd-tab {
    transition: color 0.2s;
}
.xhclaw-cmd-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 2px;
    background: linear-gradient(135deg, #E8A87C, #D4845A);
    border-radius: 1px;
}
.xhclaw-cmd-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    transition: background 0.2s;
    gap: 10px;
}
.xhclaw-cmd-item:hover {
    background: #f0ebe6;
}
.xhclaw-cmd-item-info {
    flex: 1;
    min-width: 0;
}
.xhclaw-cmd-item-title {
    font-size: 13px;
    font-weight: 500;
    color: #3D3D3D;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xhclaw-cmd-item-content {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xhclaw-cmd-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.xhclaw-cmd-item-actions button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
    transition: all 0.2s;
}
.xhclaw-cmd-item-actions button:hover {
    background: #f0ebe6;
    color: #E8A87C;
}
.xhclaw-cmd-item-actions button.xhclaw-cmd-delete:hover {
    color: #e74c3c;
}
.xhclaw-cmd-cat-header {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    padding: 8px 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.xhclaw-cmd-fold-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    font-size: 12px;
    color: #E8A87C;
    cursor: pointer;
    gap: 4px;
}
.xhclaw-cmd-fold-toggle:hover {
    text-decoration: underline;
}
.xhclaw-cmd-star {
    color: #E8A87C;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.xhclaw-cmd-star:hover {
    transform: scale(1.2);
}
.xhclaw-cmd-star.inactive {
    color: #ddd;
}
.xhclaw-cmd-edit-area {
    background: #f8f6f4;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 6px;
}
.xhclaw-cmd-edit-area input,
.xhclaw-cmd-edit-area textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
    margin-bottom: 6px;
    font-family: inherit;
}
.xhclaw-cmd-edit-area textarea {
    resize: vertical;
    min-height: 60px;
}
.xhclaw-cmd-edit-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}
.xhclaw-cmd-edit-actions button {
    padding: 4px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}
.xhclaw-cmd-apply-btn {
    background: linear-gradient(135deg, #E8A87C, #D4845A) !important;
    color: #fff !important;
}
.xhclaw-cmd-apply-btn:hover {
    opacity: 0.9;
}
.xhclaw-cmd-cancel-btn {
    background: #f0f0f0 !important;
    color: #666 !important;
}

/* 对话气泡AI模型名称标签 */
.xhclaw-msg-model-name {
    display: inline-block;
    font-size: 11px;
    color: #999;
    background: rgba(0,0,0,0.03);
    padding: 1px 8px;
    border-radius: 8px;
    margin-bottom: 4px;
    line-height: 1.6;
    letter-spacing: 0.3px;
}

/* 产品生成器模式：隐藏/显示切换 */
.xhclaw-wooai-mode .xhclaw-fb-input-wrap,
.xhclaw-wooai-mode #xhclaw-chat-img-preview,
.xhclaw-wooai-mode #xhclaw-image-controls {
    display: none !important;
}
.xhclaw-wooai-mode .wooai-fb-tabs {
    display: flex !important;
}
/* 非wooai模式：确保wooai子Tab隐藏 */
#xhclaw-floating-bar:not(.xhclaw-wooai-mode) .wooai-fb-tabs {
    display: none !important;
}

/* ===================== 媒体库面板 ===================== */
#xhclaw-media-panel {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.xhclaw-media-panel-inner {
    max-width: 800px;
    margin: 0 auto;
}
.xhclaw-media-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.xhclaw-media-search-input {
    flex: 1;
    min-width: 160px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.xhclaw-media-search-input:focus {
    border-color: #6366f1;
}
.xhclaw-media-view-toggle {
    display: flex;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.xhclaw-media-view-toggle button {
    background: #fff;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 16px;
    color: #94a3b8;
    transition: all 0.15s;
}
.xhclaw-media-view-toggle button.active {
    background: #6366f1;
    color: #fff;
}
.xhclaw-media-view-toggle button + button {
    border-left: 1px solid #e2e8f0;
}

/* 网格模式 */
.xhclaw-media-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.xhclaw-media-card-grid {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    transition: box-shadow 0.2s, transform 0.15s;
    cursor: pointer;
}
.xhclaw-media-card-grid:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.xhclaw-media-card-grid .xhclaw-media-card-thumb {
    width: 100%;
    aspect-ratio: 1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.xhclaw-media-card-grid .xhclaw-media-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.xhclaw-media-card-grid .xhclaw-media-card-info {
    padding: 8px 10px;
}
.xhclaw-media-card-grid .xhclaw-media-card-name {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xhclaw-media-card-grid .xhclaw-media-card-meta {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}
.xhclaw-media-card-grid .xhclaw-media-card-actions {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    gap: 4px;
}
.xhclaw-media-card-grid:hover .xhclaw-media-card-actions {
    display: flex;
}

/* 列表模式 */
.xhclaw-media-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.xhclaw-media-card-list {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #f1f5f9;
    transition: box-shadow 0.2s;
    cursor: pointer;
}
.xhclaw-media-card-list:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.xhclaw-media-card-list .xhclaw-media-card-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}
.xhclaw-media-card-list .xhclaw-media-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.xhclaw-media-card-list .xhclaw-media-card-info {
    flex: 1;
    min-width: 0;
}
.xhclaw-media-card-list .xhclaw-media-card-name {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xhclaw-media-card-list .xhclaw-media-card-meta {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}
.xhclaw-media-card-list .xhclaw-media-card-actions {
    display: flex;
    gap: 4px;
}

/* 卡片通用 */
.xhclaw-media-card {
    position: relative;
}
.xhclaw-media-card-placeholder {
    font-size: 32px;
    color: #cbd5e1;
}
.xhclaw-media-card-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.xhclaw-media-card-btn[data-action="select"] {
    background: #eef2ff;
    color: #6366f1;
}
.xhclaw-media-card-btn[data-action="select"]:hover {
    background: #6366f1;
    color: #fff;
}
.xhclaw-media-card-btn[data-action="delete"] {
    background: #fef2f2;
    color: #ef4444;
}
.xhclaw-media-card-btn[data-action="delete"]:hover {
    background: #ef4444;
    color: #fff;
}
.xhclaw-media-items-empty {
    display: block;
}

/* ===================== 上传选择器 ===================== */
.xhclaw-upload-picker {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: xhclawFadeIn 0.2s ease;
}
.xhclaw-upload-picker-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
}
.xhclaw-upload-picker-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    animation: xhclawSlideUp 0.25s ease;
}
.xhclaw-upload-picker-title {
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    margin-bottom: 18px;
}
.xhclaw-upload-picker-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.xhclaw-upload-picker-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}
.xhclaw-upload-picker-btn:hover {
    border-color: #6366f1;
    background: #f8faff;
}
.xhclaw-upload-picker-btn-icon {
    font-size: 28px;
    flex-shrink: 0;
}
.xhclaw-upload-picker-btn-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.xhclaw-upload-picker-btn-label {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}
.xhclaw-upload-picker-btn-desc {
    font-size: 12px;
    color: #94a3b8;
}
@keyframes xhclawFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes xhclawSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 媒体库选择弹窗 ===== */
/* JS 动态创建的是 id="xhclaw-media-modal"，没有 class，所以用 ID 选择器 */
#xhclaw-media-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: xhclawFadeIn 0.2s ease;
}
.xhclaw-media-modal-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
}
.xhclaw-media-modal-box {
    position: relative;
    background: #fff; border-radius: 16px; width: 90%; max-width: 560px;
    max-height: 75vh; display: flex; flex-direction: column;
    box-shadow: 0 12px 48px rgba(0,0,0,0.2); animation: xhclawSlideUp 0.2s ease;
    overflow: hidden;
}
.xhclaw-media-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid #f0f0f0; font-size: 16px; font-weight: 600;
}
.xhclaw-media-modal-close {
    background: none; border: none; font-size: 22px; cursor: pointer; color: #999;
    width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.xhclaw-media-modal-close:hover { background: #f5f5f5; color: #333; }
.xhclaw-media-modal-body {
    flex: 1; overflow-y: auto; padding: 16px; min-height: 200px;
}
.xhclaw-media-modal-loading,
.xhclaw-media-modal-empty {
    text-align: center; padding: 40px 20px; color: #999; font-size: 14px;
}
.xhclaw-media-modal-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px;
}
.xhclaw-media-modal-item {
    cursor: pointer; border-radius: 10px; border: 2px solid transparent;
    overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s;
    background: #fafafa;
}
.xhclaw-media-modal-item:hover {
    border-color: #6366f1; box-shadow: 0 2px 12px rgba(99,102,241,0.18);
}
.xhclaw-media-modal-item-thumb {
    width: 100%; aspect-ratio: 1; overflow: hidden; display: flex; align-items: center; justify-content: center;
    background: #f5f5f5;
}
.xhclaw-media-modal-item-thumb img {
    width: 100%; height: 100%; object-fit: cover;
}
.xhclaw-media-modal-item-placeholder {
    font-size: 28px; color: #ccc;
}
.xhclaw-media-modal-item-name {
    padding: 6px 8px; font-size: 11px; color: #666; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 480px) {
    .xhclaw-media-modal-box { width: 95%; max-width: none; max-height: 80vh; border-radius: 12px; }
    .xhclaw-media-modal-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
}

/* ==============================
   AI 消息内容排版优化（表格、代码、列表、引用、移动端适配）
   ============================== */

/* 表格横向滚动容器 */
.xhclaw-msg-content .xhclaw-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.06);
    background: #fff;
    -webkit-overflow-scrolling: touch;
    display: block;
}
.xhclaw-msg-content .xhclaw-table-wrap::-webkit-scrollbar {
    height: 5px;
}
.xhclaw-msg-content .xhclaw-table-wrap::-webkit-scrollbar-thumb {
    background: var(--xhclaw-blue-light);
    border-radius: 3px;
}
.xhclaw-msg-content .xhclaw-table {
    width: 100%;
    min-width: 320px;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.5;
}
.xhclaw-msg-content .xhclaw-table th,
.xhclaw-msg-content .xhclaw-table td {
    padding: 10px 12px;
    border: 1px solid rgba(0,0,0,0.08);
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}
.xhclaw-msg-content .xhclaw-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #4a4a4a;
    white-space: nowrap;
}
.xhclaw-msg-content .xhclaw-table tbody tr:nth-child(even) {
    background: #fafbfc;
}
.xhclaw-msg-content .xhclaw-table tbody tr:hover {
    background: #f3f6f8;
}

/* 简约代码块 */
.xhclaw-msg-content .xhclaw-code-block {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    padding: 12px 14px;
    margin: 10px 0;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    -webkit-overflow-scrolling: touch;
    color: #333;
    max-width: 100%;
}
.xhclaw-msg-content .xhclaw-code-block code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
    word-break: normal;
    white-space: pre;
}
.xhclaw-msg-content .xhclaw-inline-code {
    background: rgba(0,0,0,0.06);
    color: #c7254e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    word-break: break-all;
}

/* 引用块优化 */
.xhclaw-msg-content blockquote,
.xhclaw-msg-content .xhclaw-quote {
    border-left: 3px solid var(--xhclaw-orange);
    padding: 10px 14px;
    margin: 10px 0;
    background: rgba(232,168,124,0.08);
    border-radius: 0 8px 8px 0;
    color: #555;
    font-size: 0.95em;
    line-height: 1.7;
}

/* 列表优化 */
.xhclaw-msg-content ul,
.xhclaw-msg-content ol {
    margin: 8px 0;
    padding-left: 22px;
}
.xhclaw-msg-content ul {
    list-style: disc;
}
.xhclaw-msg-content ol {
    list-style: decimal;
}
.xhclaw-msg-content ul.xhclaw-ul,
.xhclaw-msg-content ol.xhclaw-ol {
    padding-left: 22px;
}
.xhclaw-msg-content ul.xhclaw-ul {
    list-style: disc;
}
.xhclaw-msg-content ol.xhclaw-ol {
    list-style: decimal;
}
.xhclaw-msg-content li {
    margin: 4px 0;
    line-height: 1.7;
}

/* 段落与标题间距 */
.xhclaw-msg-content p {
    margin: 6px 0;
    line-height: 1.75;
}
.xhclaw-msg-content h1,
.xhclaw-msg-content h2,
.xhclaw-msg-content h3,
.xhclaw-msg-content h4,
.xhclaw-msg-content .xhclaw-h {
    margin: 14px 0 8px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
}
.xhclaw-msg-content h1 { font-size: 1.25em; }
.xhclaw-msg-content h2 { font-size: 1.15em; }
.xhclaw-msg-content h3 { font-size: 1.05em; }
.xhclaw-msg-content h4 { font-size: 1em; }

/* 水平线 */
.xhclaw-msg-content hr,
.xhclaw-msg-content .xhclaw-hr {
    border: none;
    border-top: 1px solid rgba(0,0,0,0.08);
    margin: 12px 0;
}

/* 链接 */
.xhclaw-msg-content a,
.xhclaw-msg-content .xhclaw-link {
    color: var(--xhclaw-orange-deep);
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
}

/* 图片/表情限制 */
.xhclaw-msg-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .xhclaw-msg-bubble {
        max-width: 92%;
        padding: 10px 12px;
        font-size: 15px;
    }
    .xhclaw-msg-content .xhclaw-code-block {
        padding: 10px 12px;
        font-size: 12px;
    }
    .xhclaw-msg-content .xhclaw-table th,
    .xhclaw-msg-content .xhclaw-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    .xhclaw-msg-content .xhclaw-table {
        min-width: 280px;
    }
    .xhclaw-msg-content h1 { font-size: 1.15em; }
    .xhclaw-msg-content h2 { font-size: 1.08em; }
    .xhclaw-msg-content h3 { font-size: 1em; }
}

@media (max-width: 480px) {
    .xhclaw-msg-bubble {
        max-width: 95%;
        padding: 8px 10px;
        font-size: 14px;
    }
    .xhclaw-msg-content .xhclaw-code-block {
        padding: 8px 10px;
        font-size: 11px;
    }
    .xhclaw-msg-content .xhclaw-inline-code {
        font-size: 0.85em;
        padding: 1px 4px;
    }
    .xhclaw-msg-content .xhclaw-table th,
    .xhclaw-msg-content .xhclaw-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
    .xhclaw-msg-content ul,
    .xhclaw-msg-content ol,
    .xhclaw-msg-content ul.xhclaw-ul,
    .xhclaw-msg-content ol.xhclaw-ol {
        padding-left: 18px;
    }
    .xhclaw-thinking-box {
        max-height: 220px;
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* 当前模型工具栏（联网搜索） */
.xhclaw-model-tools-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin: 4px 0 2px;
    min-height: 32px;
}

/* 联网搜索开关 */
.xhclaw-web-search-toggle {
    opacity: 0.45;
    transition: opacity 0.2s, color 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: none;
    background: transparent;
    color: inherit;
    border-radius: 8px;
}
.xhclaw-web-search-toggle:hover {
    opacity: 0.7;
    background: rgba(0,0,0,0.05);
}
.xhclaw-web-search-toggle.active {
    opacity: 1;
    color: #E8A87C;
    background: rgba(232,168,124,0.12);
}
.xhclaw-web-search-toggle:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

/* 文字版联网搜索开关（主题橙色） */
.xhclaw-web-search-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid rgba(0,0,0,0.1);
    background: #fff;
    color: #666;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.xhclaw-web-search-toggle-btn:hover {
    border-color: rgba(232,168,124,0.8);
    color: #E8A87C;
}
.xhclaw-web-search-toggle-btn.active {
    border-color: #E8A87C;
    color: #fff;
    background: linear-gradient(135deg, #E8A87C 0%, #d9956c 100%);
    box-shadow: 0 2px 6px rgba(232,168,124,0.35);
}
.xhclaw-web-search-toggle-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.xhclaw-web-search-toggle-btn .xhclaw-ws-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #bbb;
    transition: background 0.2s;
}
.xhclaw-web-search-toggle-btn.active .xhclaw-ws-dot {
    background: #fff;
}
.xhclaw-search-badge {
    font-size: 11px;
    color: #E8A87C;
    margin-right: 6px;
    white-space: nowrap;
}
.xhclaw-search-sources-card {
    margin: 6px 0 10px;
    padding: 10px 12px;
    border: 1px solid rgba(232,168,124,0.28);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(232,168,124,0.10), rgba(255,255,255,0.82));
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.xhclaw-search-sources-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.xhclaw-search-sources-title {
    font-size: 13px;
    font-weight: 600;
    color: #6f4a2f;
    display: flex;
    align-items: center;
    gap: 4px;
}
.xhclaw-search-sources-meta {
    font-size: 12px;
    color: #9a7a62;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.xhclaw-search-sources-toggle {
    border: 0;
    background: rgba(232,168,124,0.16);
    color: #8a5a35;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    cursor: pointer;
}
.xhclaw-search-sources-toggle:hover {
    background: rgba(232,168,124,0.28);
}
.xhclaw-search-sources-body {
    margin-top: 10px;
}
.xhclaw-search-query {
    font-size: 12px;
    color: #8a7565;
    margin-bottom: 8px;
}
.xhclaw-search-source-item {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.xhclaw-search-source-index {
    width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 50%;
    background: rgba(232,168,124,0.20);
    color: #8a5a35;
    font-size: 12px;
    text-align: center;
    flex: 0 0 20px;
}
.xhclaw-search-source-main {
    min-width: 0;
    flex: 1;
}
.xhclaw-search-source-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #315f8a;
    line-height: 1.35;
    text-decoration: none;
}
.xhclaw-search-source-title:hover {
    text-decoration: underline;
}
.xhclaw-search-source-snippet {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.45;
    color: #666;
}
.xhclaw-search-source-host {
    margin-top: 4px;
    font-size: 11px;
    color: #999;
}
.xhclaw-search-empty {
    font-size: 12px;
    color: #999;
}
.xhclaw-search-provider-select,
.xhclaw-search-mode-select {
    padding: 7px 10px;
    border: 1px solid rgba(232,168,124,0.26);
    border-radius: 12px;
    background: rgba(255,255,255,0.86);
    font-size: 13px;
    color: #6e4a32;
    width: 100%;
    max-width: none;
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.025);
}
.xhclaw-search-provider-select:focus,
.xhclaw-search-mode-select:focus {
    border-color: rgba(232,168,124,0.8);
    box-shadow: 0 0 0 3px rgba(232,168,124,0.12);
}
.xhclaw-search-price-hint {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

/* 提现面板 */
#xhclaw-withdraw-panel {
    margin-top: 10px;
}
.xhclaw-withdraw-summary {
    background: #FFF9F5;
    border: 1px solid rgba(232,168,124,0.18);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.xhclaw-withdraw-balance {
    font-size: 15px;
    color: #5D4037;
    font-weight: 500;
}
.xhclaw-withdraw-balance span {
    font-size: 20px;
    color: #E8A87C;
    font-weight: 700;
}
.xhclaw-withdraw-min {
    font-size: 12px;
    color: #888;
}
.xhclaw-withdraw-wallet,
.xhclaw-withdraw-form,
.xhclaw-withdraw-records {
    background: #fff;
    border: 1px solid #f0e8e2;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.xhclaw-withdraw-wallet h4,
.xhclaw-withdraw-form h4,
.xhclaw-withdraw-records h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: #5D4037;
}
.xhclaw-withdraw-fee-line {
    font-size: 13px;
    color: #666;
    margin: -6px 0 12px;
}
.xhclaw-withdraw-fee-line span {
    color: #E8A87C;
    font-weight: 600;
}
.xhclaw-withdraw-agree {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
}
.xhclaw-withdraw-agree a {
    color: #E8A87C;
    text-decoration: underline;
}
.xhclaw-withdraw-records #xhclaw-withdraw-records-list {
    min-height: 60px;
}
.xhclaw-withdraw-records #xhclaw-withdraw-records-pagination {
    margin-top: 10px;
}
