/*
 * @Author: iowen
 * @Author URI: https://www.iowen.cn/
 * @Date: 2024-01-03 00:15:11
 * @LastEditors: iowen
 * @LastEditTime: 2024-01-13 11:05:39
 * @FilePath: \onenavsub\assets\css\sub-style.css
 * @Description: 自定义样式
 */

/* WPOPT AI摘要样式优化 */

/* 统一控制AI摘要容器基础样式 */
.wpopt-ai-summary {
    padding: 8px 20px 5px  !important; /* 减小上下内边距 */
    margin: 15px 0 20px !important; /* 优化外边距写法 */
    border: none !important;
    box-shadow: none !important;
    position: relative !important; /* 为 tooltip 提供定位上下文 */
    background-color: rgb(247, 247, 249) !important; /* 白天模式背景色 */
}

/* 标题区域样式：隐藏原文本 + 自定义图标与文字 */
.wpopt-ai-summary .summary-title {
    visibility: hidden !important; /* 隐藏原文本 */
    position: relative !important;
    margin-left: 25px !important; /* 预留图标位置 */
    white-space: nowrap !important; /* 防止文字换行 */
    height: 24px !important; /* 固定高度确保文字在一行 */
    line-height: 24px !important; /* 垂直居中 */
}

/* 自定义主题图标（使用用户提供SVG） */
.wpopt-ai-summary .summary-title::before {
    content: url("data:image/svg+xml,%3Csvg t='1763385754876' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1779'%3E%3Cpath d='M717.12 274H762c82.842 0 150 67.158 150 150v200c0 82.842-67.158 150-150 150H262c-82.842 0-150-67.158-150-150V424c0-82.842 67.158-150 150-150h44.88l-18.268-109.602c-4.086-24.514 12.476-47.7 36.99-51.786 24.514-4.086 47.7 12.476 51.786 36.99l20 120c0.246 1.472 0.416 2.94 0.516 4.398h228.192c0.1-1.46 0.27-2.926 0.516-4.398l20-120c4.086-24.514 27.272-41.076 51.786-36.99 24.514 4.086 41.076 27.272 36.99 51.786L717.12 274zM262 364c-33.138 0-60 26.862-60 60v200c0 33.138 26.862 60 60 60h500c33.138 0 60-26.862 60-60V424c0-33.138-26.862-60-60-60H262z m50 548c-24.852 0-45-20.148-45-45S287.148 822 312 822h400c24.852 0 45 20.148 45 45S736.852 912 712 912H312z m-4-428c0-24.852 20.148-45 45-45S398 459.148 398 484v40c0 24.852-20.148 45-45 45S308 548.852 308 524v-40z m318 0c0-24.852 20.148-45 45-45S716 459.148 716 484v40c0 24.852-20.148 45-45 45S626 548.852 626 524v-40z' fill='%23444444' p-id='1780'%3E%3C/path%3E%3C/svg%3E") !important;
    position: absolute !important;
    left: -25px !important; /* 图标定位到预留位置 */
    top: 45% !important;
    transform: translateY(-50%) !important; /* 垂直居中 */
    visibility: visible !important; /* 显示自定义图标 */
    width:19px !important;
    height: 19px !important;
}

/* 自定义标题文字：将"AI摘要"改为"文章摘要" */
.wpopt-ai-summary .summary-title::after {
    content: "文章摘要" !important;
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important; /* 垂直居中（与图标对齐） */
    visibility: visible !important; /* 显示自定义文字 */
    color: inherit !important; /* 继承原有颜色 */
    font-weight: 600 !important;
    font-size: 15px !important;
    white-space: nowrap !important; /* 防止文字换行（已在父级定义，可保留作为双重保障） */
}

/* 隐藏冗余元素 */
.wpopt-ai-summary .summary-desc, /* JS生成的原提示框 */
.wpopt-ai-summary .summary-link, /* 右上角插件标识 */
.wpopt-ai-summary .wpopt-bot-avatar { /* 中间机器人图标 */
    display: none !important;
    visibility: hidden !important; /* 双重保障隐藏 */
}

/* 优化内容区域样式 - 去掉白色底框 */
.wpopt-ai-summary .summary-content {
    padding: 5px 0 !important; /* 减小上下内边距 */
    border-radius: 0 !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    background-color: transparent !important;
    border: none !important;
}

/* AI摘要提示框 */
.wpopt-ai-summary::after {
    content: "内容由AI根据文章内容自动生成" !important;
    display: none !important; /* 默认隐藏 */
    position: absolute !important;
    top: -30px !important;
    left: 40px !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    background-color: var(--wp--preset--color--background) !important;
    color: var(--wp--preset--color--foreground) !important;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2) !important;
    white-space: nowrap !important;
    z-index: 1000 !important;
}

/* 鼠标悬停显示提示框 */
.wpopt-ai-summary:hover::after {
    display: block !important;
}

/* 夜间模式适配（仅修改差异样式） */
.io-black-mode .wpopt-ai-summary {
    background-color: rgb(33, 35, 42) !important; /* 用户指定夜间模式背景色 */
}

.io-black-mode .wpopt-ai-summary .summary-title::after {
    color: var(--muted-color2) !important; /* 深色模式标题色 */
}

.io-black-mode .wpopt-ai-summary .summary-content {
    color: var(--main-color) !important; /* 深色模式内容文本色 */
}