/* AI线索助手 - 网页版组件样式 */

/* 强制重置所有组件内部元素的样式，防止外部样式影响 */
#ai-clue-assistant-widget *,
.widget-container *,
#selectionTooltip *,
.login-modal *,
.ai-clue-btn-primary,
.ai-clue-btn-block {
    
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 针对外部CSS框架的按钮样式对抗规则 - 防止用户提到的特定CSS选择器影响 */
/* 针对 .btn-menu a.btn-primary, .btn-group a.btn-primary, .button.btn-primary, button.btn-primary, .input-list a.btn-primary */
#ai-clue-assistant-widget .btn-menu a,
#ai-clue-assistant-widget .btn-group a,
#ai-clue-assistant-widget .button,
#ai-clue-assistant-widget button,
#ai-clue-assistant-widget .input-list a {
    /* 重置可能影响按钮的外部样式 */
    all: unset !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    user-select: none !important;
    border: none !important;
    border-radius: 6px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    padding: 12px 24px !important;
    background: #3b82f6 !important;
    color: white !important;
    transition: background 0.2s !important;
    min-width: auto !important;
    max-width: none !important;
    flex: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    position: relative !important;
    overflow: visible !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-indent: 0 !important;
    text-shadow: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* 重置根级组件容器的基础样式 */
#ai-clue-assistant-widget,
.widget-container,
#selectionTooltip,
.login-modal {
    all: initial;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 极致按钮样式隔离，完全防止外部CSS影响 */
#ai-clue-assistant-widget #searchBtn {
    all: unset !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    user-select: none !important;
    border: none !important;
    border-radius: 6px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    padding: 12px 24px !important;
    background: #3b82f6 !important;
    color: white !important;
    transition: background 0.2s !important;
    min-width: auto !important;
    max-width: none !important;
    flex: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    position: relative !important;
    overflow: visible !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-indent: 0 !important;
    text-shadow: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-decoration-line: none !important;
    text-underline-offset: 0 !important;
    text-decoration-thickness: 0 !important;
    clip-path: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    transform: none !important;
    transform-origin: 0 0 !important;
    perspective-origin: 0 0 !important;
    isolation: auto !important;
    mix-blend-mode: normal !important;
    mask-image: none !important;
    mask-mode: match-source !important;
    mask-repeat: repeat !important;
    mask-position: center !important;
    mask-clip: border-box !important;
    mask-origin: border-box !important;
    mask-size: auto !important;
    mask-composite: add !important;
    mask-type: luminance !important;
    clip-rule: nonzero !important;
    fill-rule: nonzero !important;
    dominant-baseline: auto !important;
    alignment-baseline: baseline !important;
    shape-rendering: auto !important;
    color-interpolation: srgb !important;
    color-interpolation-filters: linearrgb !important;
    color-rendering: auto !important;
    image-rendering: auto !important;
    paint-order: normal !important;
    vector-effect: none !important;
    shape-margin: 0 !important;
    shape-padding: 0 !important;
    shape-outside: none !important;
    fill: none !important;
    stroke: none !important;
    stroke-width: 1 !important;
    stroke-linecap: butt !important;
    stroke-linejoin: miter !important;
    stroke-miterlimit: 4 !important;
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
    stroke-opacity: 1 !important;
    fill-opacity: 1 !important;
    stop-color: #000 !important;
    stop-opacity: 1 !important;
    flood-color: #000 !important;
    flood-opacity: 1 !important;
    lighting-color: #fff !important;
    color-adjust: economy !important;
    -webkit-print-color-adjust: economy !important;
    color-scheme: normal !important;
    forced-color-adjust: auto !important;
    scrollbar-width: auto !important;
    scrollbar-color: auto !important;
}

#ai-clue-assistant-widget #searchBtn:hover {
    background: #1d4ed8 !important;
}

#ai-clue-assistant-widget #searchBtn:disabled {
    background: #93c5fd !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 侧边栏容器 */
#ai-clue-assistant-widget {
    all: initial;
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
    overscroll-behavior: contain;
}

/* 内部滚动区域样式 */
#ai-clue-assistant-widget .widget-content {
    padding: 16px;
    overflow-y: auto;
    flex: 0 0 auto;
    max-height: 40vh;
    overscroll-behavior: contain;
}

#ai-clue-assistant-widget .results-section {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    margin-top: -16px;
    min-height: 0; /* 确保Flex子项可以滚动 */
    overscroll-behavior: contain;
}

#ai-clue-assistant-widget.open {
    transform: translateX(0);
}

/* 侧边栏头部 */
#ai-clue-assistant-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

#ai-clue-assistant-widget .widget-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .widget-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .widget-close-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* 登出按钮 */
#ai-clue-assistant-widget .widget-logout-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .widget-logout-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* 历史记录按钮 */
#ai-clue-assistant-widget .widget-history-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .widget-history-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* 登录按钮 */
#ai-clue-assistant-widget .widget-login-btn {
    background: none;
    border: none;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .widget-login-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* 标签页 */
#ai-clue-assistant-widget .widget-tabs {
    display: flex;
    overflow-x: auto;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 16px;
    gap: 16px;
    flex-wrap: nowrap;
}

#ai-clue-assistant-widget .widget-tabs::-webkit-scrollbar {
    display: none;
}

#ai-clue-assistant-widget .tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    min-width: fit-content;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

#ai-clue-assistant-widget .tab-btn:hover:not(.active) {
    color: #374151;
}

#ai-clue-assistant-widget .new-content-indicator {
    color: #ef4444;
    margin-left: 4px;
    font-weight: bold;
}

/* 内容区域 */
#ai-clue-assistant-widget .widget-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1; /* 改为可伸缩，让结果区域能够获得剩余空间 */
    min-height: 0; /* 允许收缩到最小高度 */
}

/* 表单样式 */
/* 表单样式 */
#ai-clue-assistant-widget .search-form {
    display: none;
    overflow-y: auto; /* 为表单添加滚动 */
    flex: 1; /* 让表单可以扩展 */
    min-height: 0; /* 允许收缩 */
}

#ai-clue-assistant-widget .search-form.active {
    display: block;
    overflow-y: auto; /* 确保激活状态时可以滚动 */
}

/* 表单组 */
#ai-clue-assistant-widget .form-group {
    margin-bottom: 16px;
    overflow-y: auto; /* 为表单组添加滚动 */
}

#ai-clue-assistant-widget .form-group {
    margin-bottom: 12px;
}

#ai-clue-assistant-widget .form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: white;
    color: #374151;
}

#ai-clue-assistant-widget .form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* 按钮样式 - 完全隔离外部CSS影响 */
#ai-clue-assistant-widget .ai-clue-btn-primary {
    /* 完全重置所有样式 */
    all: unset !important;
    
    /* 重新定义所有必要样式 */
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    user-select: none !important;
    border: none !important;
    border-radius: 6px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    padding: 12px 24px !important;
    background: #3b82f6 !important;
    color: white !important;
    transition: background 0.2s !important;
    min-width: auto !important;
    max-width: none !important;
    flex: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    position: relative !important;
    overflow: visible !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-indent: 0 !important;
    text-shadow: none !important;
}

#ai-clue-assistant-widget .ai-clue-btn-primary:hover {
    background: #1d4ed8 !important;
}

#ai-clue-assistant-widget .ai-clue-btn-primary:disabled {
    background: #93c5fd !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

#ai-clue-assistant-widget .ai-clue-btn-block {
    /* 完全重置所有样式 */
    all: unset !important;
    
    /* 重新定义所有必要样式 */
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    padding: 14px !important;
    gap: 8px !important;
    text-align: center !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    border: none !important;
    border-radius: 6px !important;
    background: #3b82f6 !important;
    color: white !important;
    transition: background 0.2s !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    position: relative !important;
    overflow: visible !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-indent: 0 !important;
    text-shadow: none !important;
}

/* 加载状态 */
#ai-clue-assistant-widget .loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    color: #6b7280;
}

#ai-clue-assistant-widget .spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 结果展示 */
#ai-clue-assistant-widget .results-section {
    flex: 2; /*flex比例，获得更多空间 */
    overflow-y: auto;
    padding: 16px;
    margin-top: -16px; /*减与上方按钮的间距 */
    min-height: 0; /*确保可以收缩 */
    /*滚动事件冒泡到页面 */
    touch-action: pan-y;
    /*确保有足够的最小高度 */
    min-height: 200px;
    /* 关键修复：设置最大高度限制，避免内容超出可视区域 */
    max-height: calc(100vh - 150px);
}

/* 结果内容 */
#ai-clue-assistant-widget .result-content {
    display: none;
    overflow-y: auto; /* 为结果内容添加滚动 */
    flex: 1; /*让结果内容可以扩展 */
    min-height: 0; /*允许收缩 */
    /* 关键修复：限制最大高度 */
    max-height: calc(100vh - 200px);
}

#ai-clue-assistant-widget .result-content.active {
    display: block;
    overflow-y: auto; /*确保激活状态时可以滚动 */
    /* 关键修复：确保激活时也有正确的高度约束 */
    max-height: calc(100vh - 200px);
    height: auto;
}

/* 结果详情 */
#ai-clue-assistant-widget .result-details {
    overflow-y: auto; /* 为详情区域添加滚动 */
    flex: 1; /*让详情可以扩展 */
    min-height: 0; /*允许收缩 */
    /* 关键修复：限制最大高度 */
    max-height: calc(100vh - 250px);
}

/* 通用结果容器 */
#ai-clue-assistant-widget .generic-result {
    overflow-y: auto; /* 为通用结果容器添加滚动 */
    flex: 1; /*让通用结果可以扩展 */
    min-height: 100px; /*确保最小高度 */
    height: auto; /*允许自动调整高度 */
    /* 关键修复：明确设置最大高度，避免内容溢出 */
    max-height: calc(100vh - 200px);
}

/* 结果文本 */
#ai-clue-assistant-widget .result-text {
    overflow-y: auto; /* 为结果文本添加滚动 */
    flex: 1; /*让文本区域可以扩展 */
    min-height: 50px; /*确保最小高度 */
    height: auto; /*允许自动调整高度 */
    /* 关键修复：文本容器不设置最大高度限制，让它自然扩展 */
    max-height: none;
    white-space: pre-wrap; /* 保持换行 */
    word-wrap: break-word; /* 自动换行 */
    word-break: break-word; /*强换行 */
    line-height: 1.5; /*行 */
}

#ai-clue-assistant-widget .result-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .result-details {
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 错误状态 */
#ai-clue-assistant-widget .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: #fee2e2;
    border-radius: 8px;
    color: #991b1b;
    margin: 16px;
}

#ai-clue-assistant-widget .error-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 8px;
}

#ai-clue-assistant-widget .error-button-container {
    margin-top: 8px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
}

#ai-clue-assistant-widget #goToLoginBtn {
    all: unset !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    user-select: none !important;
    border: none !important;
    border-radius: 6px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    padding: 6px 16px !important;
    margin-top: 10px !important;
    background: #3b82f6 !important;
    color: white !important;
    transition: background 0.2s !important;
    min-width: auto !important;
    max-width: none !important;
    flex: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    position: relative !important;
    overflow: visible !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-indent: 0 !important;
    text-shadow: none !important;
}

#ai-clue-assistant-widget #retryBtn {
    padding: 6px 16px;
    margin-top: 10px;
    background-color: rgb(59, 130, 246);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 重试和登录按钮样式 - 按照用户偏好缩小尺寸 */
#ai-clue-assistant-widget .ai-clue-btn-login,
#ai-clue-assistant-widget .ai-clue-btn-retry {
    /* 完全重置所有样式 */
    all: unset !important;
    
    /* 重新定义所有必要样式 */
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    user-select: none !important;
    border: none !important;
    border-radius: 6px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 12px !important;  /* 按照用户偏好缩小字体 */
    font-weight: 500 !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    padding: 2px 8px !important;  /* 按照用户偏好缩小内边距 */
    margin-top: 10px !important;
    background: #3b82f6 !important;
    color: white !important;
    transition: background 0.2s !important;
    min-width: auto !important;
    max-width: none !important;
    flex: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    position: relative !important;
    overflow: visible !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-indent: 0 !important;
    text-shadow: none !important;
}

#ai-clue-assistant-widget .ai-clue-btn-login:hover,
#ai-clue-assistant-widget .ai-clue-btn-retry:hover {
    background: #1d4ed8 !important;
}

#ai-clue-assistant-widget .ai-clue-btn-login:disabled,
#ai-clue-assistant-widget .ai-clue-btn-retry:disabled {
    background: #93c5fd !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

/* 隐藏类 */
#ai-clue-assistant-widget .hidden {
    display: none !important;
}

/* 浮动按钮 */
#ai-clue-assistant-widget .widget-toggle-btn {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #2563eb;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .widget-toggle-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

/* 浮动按钮内容布局 */
#ai-clue-assistant-widget .toggle-btn-content {
    display: flex;
    align-items: center;
    gap: 4px;
}

#ai-clue-assistant-widget .toggle-btn-text {
    font-size: 10px;
    font-weight: bold;
    color: white;
    white-space: nowrap;
}

/* 文本选择提示框 */
#selectionTooltip {
    position: absolute;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.2s ease;
    pointer-events: none;
    min-width: 200px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#selectionTooltip.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#selectionTooltip .tooltip-content {
    padding: 8px;
}

#selectionTooltip .tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

#selectionTooltip .tooltip-text {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#selectionTooltip .tooltip-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

#selectionTooltip .tooltip-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#selectionTooltip .tooltip-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

#selectionTooltip .tooltip-btn svg {
    width: 12px;
    height: 12px;
}

/* Markdown Result Styles */
#ai-clue-assistant-widget .result-text {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .result-text h1 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 16px 0 8px 0;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .result-text h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 14px 0 8px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .result-text h3 {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin: 12px 0 6px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .result-text p {
    margin-bottom: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .result-text ul {
    margin: 8px 0 12px 20px;
    padding: 0;
    list-style-type: disc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .result-text li {
    margin-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .result-text mark {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0 2px;
    border-radius: 2px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .result-text strong {
    font-weight: 600;
    color: #111827;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .result-text hr {
    border: 0;
    border-top: 1px dashed #e5e7eb;
    margin: 16px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .result-text blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 12px;
    color: #4b5563;
    margin: 12px 0;
    font-style: italic;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Markdown Table Styles */
#ai-clue-assistant-widget .table-container {
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

#ai-clue-assistant-widget .result-text table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .result-text th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .result-text td {
    padding: 8px 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#ai-clue-assistant-widget .result-text tr:last-child td {
    border-bottom: none;
}

#ai-clue-assistant-widget .result-text tr:nth-child(even) {
    background-color: #f9fafb;
}

/* 通用滚动条样式 */
#ai-clue-assistant-widget ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

#ai-clue-assistant-widget ::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
}

#ai-clue-assistant-widget ::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 5px;
    border: 2px solid #f1f5f9;
}

#ai-clue-assistant-widget ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
    border-color: #e2e8f0;
}

/* 侧边栏内容区域滚动条样式（更明显） */
#ai-clue-assistant-widget .widget-content::-webkit-scrollbar,
#ai-clue-assistant-widget .results-section::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

#ai-clue-assistant-widget .widget-content::-webkit-scrollbar-track,
#ai-clue-assistant-widget .results-section::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

#ai-clue-assistant-widget .widget-content::-webkit-scrollbar-thumb,
#ai-clue-assistant-widget .results-section::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
    border: 2px solid #f8fafc;
}

#ai-clue-assistant-widget .widget-content::-webkit-scrollbar-thumb:hover,
#ai-clue-assistant-widget .results-section::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    border-color: #f1f5f9;
}

/* 登录模态框样式 */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.login-modal.hidden {
    display: none;
}

.login-modal-content {
    background: white;
    padding: 24px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.login-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.login-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.login-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.login-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.login-form-group {
    margin-bottom: 16px;
}

.login-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.login-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: white;
    color: #374151;
}

.login-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.login-checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.login-checkbox {
    margin-right: 8px;
}

.login-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.login-submit-btn {
    flex: 1;
    padding: 10px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.login-submit-btn:hover {
    background: #1d4ed8;
}

.register-switch {
    margin-top: 12px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.register-link {
    color: #3b82f6;
    text-decoration: none;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.register-link:hover {
    text-decoration: underline;
}

.error-message {
    color: #e53e3e;
    font-size: 14px;
    margin-top: 8px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 注册表单样式 */
.register-form {
    display: none;
}

.register-form.active {
    display: block;
}

/* 新增按钮样式 */
#ai-clue-assistant-widget .ai-clue-btn-receive-trial,
#ai-clue-assistant-widget .ai-clue-btn-buy-service {
    /* 完全重置所有样式 */
    all: unset !important;
    
    /* 重新定义所有必要样式 */
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    vertical-align: middle !important;
    cursor: pointer !important;
    user-select: none !important;
    border: none !important;
    border-radius: 6px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    padding: 6px 16px !important;
    margin-top: 10px !important;
    background: #3b82f6 !important;
    color: white !important;
    transition: background 0.2s !important;
    min-width: auto !important;
    max-width: none !important;
    flex: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    position: relative !important;
    overflow: visible !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-indent: 0 !important;
    text-shadow: none !important;
}

#ai-clue-assistant-widget .ai-clue-btn-receive-trial:hover,
#ai-clue-assistant-widget .ai-clue-btn-buy-service:hover {
    background: #1d4ed8 !important;
}

#ai-clue-assistant-widget .ai-clue-btn-receive-trial:disabled,
#ai-clue-assistant-widget .ai-clue-btn-buy-service:disabled {
    background: #93c5fd !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}
