/**
 * 关键词选中提示框样式
 */

/* 提示框容器 */
.keyword-tooltip {
    position: absolute;
    z-index: 10000;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    min-width: 340px;
    max-width: 400px;
    animation: keyword-tooltip-fadeIn 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@keyframes keyword-tooltip-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 提示框内容 */
.keyword-tooltip-content {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.keyword-text {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.keyword-discuss-badge {
    margin-left: 8px;
    padding: 2px 8px;
    background: #ff9800;
    color: #fff;
    font-size: 12px;
    border-radius: 10px;
    white-space: nowrap;
}

/* 操作按钮区域 */
.keyword-tooltip-actions {
    display: flex;
    gap: 8px;
}

.keyword-action-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.keyword-action-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

.keyword-action-btn i {
    font-size: 14px;
}

/* 搜索按钮 */
.keyword-search-btn:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #2196f3;
}

/* 讨论按钮 */
.keyword-discuss-btn:hover {
    background: #fff3e0;
    border-color: #ff9800;
    color: #ff9800;
}

.keyword-discuss-btn.has-discuss {
    background: #fff3e0;
    border-color: #ff9800;
    color: #ff9800;
}

/* 复制按钮 */
.keyword-copy-btn:hover {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #4caf50;
}

/* 讨论模态框 */
.keyword-discuss-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: keyword-modal-fadeIn 0.2s ease;
}

@keyframes keyword-modal-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.keyword-discuss-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: keyword-modal-slideIn 0.3s ease;
}

@keyframes keyword-modal-slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.keyword-discuss-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.keyword-discuss-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.keyword-discuss-modal-header h3 i {
    color: #ff9800;
}

.keyword-discuss-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.keyword-discuss-close:hover {
    background: #f5f5f5;
    color: #666;
}

.keyword-discuss-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* 讨论列表 */
.keyword-discuss-list {
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.keyword-discuss-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.keyword-discuss-item {
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 12px;
}

.keyword-discuss-item:last-child {
    margin-bottom: 0;
}

.keyword-discuss-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.keyword-discuss-author {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.keyword-discuss-author i {
    color: #2196f3;
}

.keyword-discuss-time {
    font-size: 12px;
    color: #999;
}

.keyword-discuss-item-content {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    word-wrap: break-word;
}

/* 讨论表单 */
.keyword-discuss-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.keyword-discuss-input {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.keyword-discuss-input:focus {
    outline: none;
    border-color: #ff9800;
}

.keyword-discuss-submit {
    align-self: flex-end;
    padding: 10px 24px;
    font-size: 14px;
}

/* 有讨论的关键词高亮 */
.keyword-has-discuss {
    background: linear-gradient(to bottom, transparent 60%, #fff3e0 60%);
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
}

.keyword-has-discuss:hover {
    background: linear-gradient(to bottom, transparent 60%, #ffe0b2 60%);
}

.keyword-has-discuss::after {
    content: '💬';
    font-size: 12px;
    position: absolute;
    top: -8px;
    right: -14px;
    opacity: 0.8;
}

/* Toast提示 */
.keyword-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10002;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: transform 0.3s ease;
}

.keyword-toast-show {
    transform: translateX(-50%) translateY(0);
}

.keyword-toast-success {
    color: #4caf50;
}

.keyword-toast-success i {
    color: #4caf50;
}

.keyword-toast-error {
    color: #f44336;
}

.keyword-toast-error i {
    color: #f44336;
}

.keyword-toast-info {
    color: #2196f3;
}

.keyword-toast-info i {
    color: #2196f3;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .keyword-tooltip {
        min-width: 240px;
        max-width: 300px;
    }

    .keyword-tooltip-actions {
        flex-direction: column;
    }

    .keyword-action-btn {
        width: 100%;
    }

    .keyword-discuss-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .keyword-discuss-modal-header {
        padding: 16px;
    }

    .keyword-discuss-modal-body {
        padding: 16px;
    }
}
