/* 实体标注工具样式 - 版本 1.4.0 */

/* 添加旋转动画 */
.dashicons-update.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* API状态指示器 */
.api-status {
    padding: 10px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #007cba;
}

.api-status .dashicons {
    margin-right: 8px;
    vertical-align: middle;
}

/* 全局进度条容器 */
#entity-annotator-global-progress {
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.entity-annotator-progress-container {
    padding: 15px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
}

.progress-header strong {
    color: #007cba;
}

.progress-close {
    color: #666;
    font-size: 16px;
}

.progress-close:hover {
    color: #000;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid #ddd;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007cba, #00a0d2);
    border-radius: 12px;
    transition: width 0.5s ease, background 0.3s ease;
    width: 0%;
}

.progress-fill.progress-success {
    background: #46b450;
}

.progress-fill.progress-error {
    background: #dc3232;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.progress-text {
    font-weight: bold;
    color: #007cba;
    font-size: 14px;
}

.progress-details {
    color: #666;
    text-align: right;
    flex: 1;
    margin-left: 10px;
}

/* 实体类型颜色说明 */
.entity-types {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.entity-types h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.entity-color-scheme {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.color-box {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: middle;
}

.person-color {
    background-color: #ffeb3b;
}

.location-color {
    background-color: #90caf9;
}

.official-color {
    background-color: #a5d6a7;
}

.time-color {
    background-color: #f48fb1;
}

/* 模态框样式 */
#entity-annotator-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.entity-annotator-modal-content {
    background: #fff;
    width: 600px;
    max-width: 90%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.entity-annotator-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entity-annotator-header h2 {
    margin: 0;
    font-size: 18px;
}

.close-modal {
    cursor: pointer;
    color: #666;
}

.close-modal:hover {
    color: #000;
}

.entity-annotator-body {
    padding: 20px;
}

.annotation-controls {
    margin-bottom: 20px;
}

.annotation-controls .button {
    margin-right: 10px;
    margin-bottom: 10px;
}

.manual-annotation {
    padding: 15px;
    background: #f0f0f1;
    border-radius: 4px;
}

.manual-annotation h4 {
    margin-top: 0;
}

.manual-annotation select {
    margin-right: 10px;
    margin-bottom: 10px;
}

.entity-annotator-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    text-align: right;
}

/* 实体标注样式 - 核心修复部分 */
.entity-annotation {
    padding: 2px 4px !important;
    border-radius: 3px !important;
    font-weight: 500 !important;
    display: inline !important;
    margin: 0 1px !important;
    line-height: 1.4 !important;
    vertical-align: baseline !important;
}

.entity-annotation:hover {
    opacity: 0.9;
}

.entity-person {
    background-color: #ffeb3b !important;
    color: #000 !important;
}

.entity-location {
    background-color: #90caf9 !important;
    color: #000 !important;
}

.entity-official {
    background-color: #a5d6a7 !important;
    color: #000 !important;
}

.entity-time {
    background-color: #f48fb1 !important;
    color: #000 !important;
}

/* 确保在WordPress编辑器中样式生效 */
#wp-content-editor-container .entity-annotation,
.wp-editor-area .entity-annotation,
.mce-content-body .entity-annotation,
#content_ifr .entity-annotation {
    padding: 2px 4px !important;
    border-radius: 3px !important;
    font-weight: 500 !important;
    display: inline !important;
    line-height: 1.4 !important;
    vertical-align: baseline !important;
}

/* 前端显示样式 */
.content .entity-annotation,
.entry-content .entity-annotation,
.woocommerce-product-details__short-description .entity-annotation,
.product_description .entity-annotation {
    padding: 2px 4px !important;
    border-radius: 3px !important;
    font-weight: 500 !important;
    display: inline !important;
    line-height: 1.4 !important;
    vertical-align: baseline !important;
    margin: 0 1px !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .entity-annotator-modal-content {
        width: 95%;
    }
    
    .annotation-controls .button {
        display: block;
        width: 100%;
        margin-right: 0;
    }
    
    .entity-color-scheme {
        flex-direction: column;
        gap: 8px;
    }
    
    .progress-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .progress-details {
        margin-left: 0;
        text-align: left;
    }
}