﻿/* ===== AI作图助手面板（详情页右侧） ===== */
.ai-helper-section {
    margin-top: 20px;
    background: #fff;
    border-radius: 21px;
    padding: 29px 0 0;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    position: relative;
    width: 362px;
    box-sizing: border-box;
    margin-bottom: 19px;
    box-shadow: 0 4px 16px rgba(43, 53, 86, 0.04);
}
@media screen and (max-width:1300px) {
    .ai-helper-section {
        width: 300px;
    }
}
.ai-helper-section::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, #f6a7d5, #8e8dff);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.ai-helper-section .ah-title {
    font-size: 22px;
    /* font-weight: 700; */
    color: #1f1f22;
    margin-bottom: 9px;
    text-align: left;
    letter-spacing: 1.2px;
    padding: 0 20px;
}
.ai-helper-section .ah-subtitle {
    font-size: 13px;
    color: #acabb2;
    margin-bottom: 18px;
    text-align: left;
    padding: 0 20px;
}

/* --- 快捷操作按钮 --- */
.ai-helper-section .ah-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 32px;
    padding: 0 20px;
}

/* --- 精灵图标通用 --- */
.sp-icontwo {
    display: inline-block;
    width: 16px;
    height: 19px;
    background: url('../img/icon.png') no-repeat;
    background-size: 221px 171px;
    vertical-align: middle;
    flex-shrink: 0;
}
.sp-icontwo.icon-model    {background-position: -6px -95px;}
.sp-icontwo.icon-ratio    { background-position: -42px -97px; }
.sp-icontwo.icon-setting  { background-position: -80px -97px; }
.sp-icontwo.icon-sparkle  {background-position: -32.3px -52px;}
.sp-icontwo.icon-sparkle1  {background-position: -52.3px -52px;}
.sp-icontwo.icon-model,
.sp-icontwo.icon-setting {
    filter: grayscale(1) saturate(0) brightness(0.65);
}

.ai-helper-section .ah-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #e8e8ef;
    border-radius: 12px;
    background: #f8f8f8;
    color: #171a21;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    letter-spacing: 1px;
}
.ai-helper-section .ah-action-btn:hover {
    background: #f2f2f7;
    border-color: #d8d8e3;
}
.ai-helper-section .ah-action-btn .ah-btn-icon {
    font-size: 14px;
    flex-shrink: 0;
}

/* --- 描述输入区 --- */
.ai-helper-section .ah-input-area {
    display: none;
}
.ai-helper-section .ah-textarea {
    width: 100%;
    min-height: 60px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    outline: none;
    resize: none;
    font-size: 13px;
    color: #333;
    padding: 10px 12px;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.6;
    transition: border-color 0.2s;
    text-align: left;
    max-width: 100%;
}
.ai-helper-section .ah-textarea:focus {
    border-color: #6c5ce7;
}
.ai-helper-section .ah-textarea::placeholder {
    color: #bbb;
    font-size: 12px;
    line-height: 1.6;
}

/* --- 附件预览（知识库解析等） --- */
.ai-helper-section .ah-attachment {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 19px 0;
    margin-bottom: 20px;
    border-top: 1px solid #ececf2;
    font-size: 13px;
    color: #acabb2;
    line-height: 1.7;
    /* padding: 0 20px; */
}
.ai-helper-section .ah-attachment .att-icon {
    width: 52px;
    height: 63px;
    border-radius: 10px;
    overflow: visible;
    flex-shrink: 0;
    position: relative;
    transform: skewX(5deg);
}
.ai-helper-section .ah-attachment .att-icon img {
    cursor: pointer;
    width: 52px;;
    height: 63px;
    object-fit: cover;
    border-radius: 10px;
}
/* 当图片悬停时，上传按钮放大 */
.ai-helper-section .ah-attachment .att-icon:hover .upload-plus-btn {
    width: 52px !important;
    height: 63px !important;
    border-radius: 10px !important;
    bottom: -5px;
    right: -40px;
}
/*.ai-helper-section .ah-attachment .att-icon::after {*/
/*    content: '+';*/
/*    position: absolute;*/
/*    bottom: -4px;*/
/*    right: -4px;*/
/*    width: 20px;*/
/*    height: 20px;*/
/*    background: #fff;*/
/*    color: #6f79ff;*/
/*    border-radius: 50%;*/
/*    font-size: 18px;*/
/*    line-height: 18px;*/
/*    text-align: center;*/
/*    font-weight: 700;*/
/*    border: 1px solid #bfbfbf;*/
/*}*/

/* 加号按钮样式 - 将伪元素改为实际元素 */
.ai-helper-section .ah-attachment .att-icon .upload-plus-btn {
    position: absolute;
    bottom: -10px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    font-size: 18px;
    line-height: 18px;
    text-align: center;
    font-weight: 700;
    border: 1px solid #bfbfbf;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}


/* 上传鼠标悬停时放大 */
.ai-helper-section .ah-attachment .att-icon .upload-plus-btn:hover {
    width: 52px !important;
    height: 63px !important;
    border-radius: 10px !important;
    bottom: -5px;
    right: -40px;
}

/* 3.0 模型时隐藏加号 */
.ai-helper-section .ah-attachment.model-3-0 .upload-plus-btn {
    display: none;
}

/* 鼠标移入图片时图片放大，加号不放大 */
.ai-helper-section .ah-attachment .att-icon:hover img {
    transform: scale(1.05);
}
.ai-helper-section .ah-attachment .att-close {
    margin-left: auto;
    cursor: pointer;
    color: #ccc;
    font-size: 14px;
}
.ai-helper-section .ah-attachment .att-close:hover {
    color: #999;
}
/*.ai-helper-section .ah-attachment .att-textarea {*/
/*    flex: 1;*/
/*    min-height: 58px;*/
/*    border: none;*/
/*    outline: none;*/
/*    resize: none;*/
/*    font-size: 13px;*/
/*    color: #878787;*/
/*    padding: 0;*/
/*    box-sizing: border-box;*/
/*    font-family: inherit;*/
/*    line-height: 1.7;*/
/*    background: transparent;*/
/*    max-width: 100%;*/
/*}*/
/*.ai-helper-section .ah-attachment .att-textarea::placeholder {*/
/*    color: #acabb2;*/
/*    font-size: 13px;*/
/*    line-height: 1.7;*/
/*}*/

/* --- 底部操作栏 --- */
.ai-helper-section .ah-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 12px 11px 13px;
    background: #f8f8f8;
    /* border-radius: 22px; */
    border-bottom-right-radius: 22px;
    border-bottom-left-radius: 22px;
}
.ai-helper-section .ah-settings {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ai-helper-section .ah-model-select {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #ededf3;
    border-radius: 18px;
    font-size: 12px;
    color: #4a4a52;
    cursor: pointer;
    position: relative;
    user-select: none;
    background: #fff;
    transition: border-color 0.2s;
}
.ai-helper-section .ah-model-select:hover {
    border-color: #dad9e4;
}
.ai-helper-section .ah-model-select .model-icon {
    font-size: 14px;
}
.ai-helper-section .ah-model-select .model-arrow {
    /* font-size: 11px; */
    /* color: #8b8e9c; */
/* 定义箭头大小 */
    width: 6px;
    height: 6px;
  /* 边框实现 V 形 */
    border-right: 1px solid #333;
    border-bottom: 1px solid #333;
  /* 旋转 45 度变成向下箭头 */
    transform: rotate(45deg);
  /* 居中展示 */
    display: inline-block;
    /* margin: 10px; */
    margin-left: 3px;
    margin-top: -2px;
}

/* --- 模型下拉菜单 --- */
.ai-helper-section .ah-model-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 6px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    padding: 11px 12px;
    min-width: 220px;
    display: none;
    z-index: 10;
}
.ai-helper-section .ah-model-dropdown.show {
    display: block;
}
.ai-helper-section .ah-model-dropdown .md-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
}
.ai-helper-section .ah-model-dropdown .md-item:hover {
    background: #f8f8f8;
}
.ai-helper-section .ah-model-dropdown .md-item .md-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.ai-helper-section .ah-model-dropdown .md-item .md-desc {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}
.ai-helper-section .ah-model-dropdown .md-item .md-check {
    color: #6c5ce7;
    font-size: 16px;
    font-weight: 700;
}

/* --- 设置按钮 --- */
.ai-helper-section .ah-setting-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #ededf3;
    border-radius: 18px;
    font-size: 14px;
    color: #4a4a52;
    cursor: pointer;
    background: #fff;
    font-family: inherit;
    transition: border-color 0.2s;
    position: relative;
}
.ai-helper-section .ah-setting-btn:hover {
    border-color: #dad9e4;
}
.ai-helper-section .ah-setting-btn .set-icon {
    font-size: 14px;
}

/* --- 设置弹窗（比例/张数） --- */
.ai-helper-section .ah-setting-popup {
    position: absolute;
    bottom: 100%;
    right: -179%;
    margin-bottom: 6px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    padding: 16px;
    min-width: 270px;
    display: none;
    z-index: 10;
}
.ai-helper-section .ah-setting-popup.show {
    display: block;
}
.ai-helper-section .ah-setting-popup .popup-title {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    margin-bottom: 13px;
    text-align: left;
}
.ai-helper-section .ah-ratio-options {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.ai-helper-section .ah-r-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    width: 34px;
    height: 36px;
    padding: 10px  14px;
    border-radius: 10px;
    border: 1px solid #fff;
}
.ai-helper-section .ah-r-item .ah-r-box {
    border: 2px solid #ddd;
    border-radius: 3px;
    transition: border-color 0.2s;
}
.ai-helper-section .ah-r-item.active{
    background: #f8f8f8;
    border: 1px solid #ececec;
}
.ai-helper-section .ah-r-item.active .ah-r-box {
    /* border-color: #6c5ce7; */
}
.ai-helper-section .ah-r-item .ah-r-label {
    font-size: 11px;
    /* color: #666; */
}
.ai-helper-section .ah-count-options {
    display: flex;
    gap: 8px;
}
.ai-helper-section .ah-c-item {
    padding: 12px 12px;
    border: 1px solid #fff;
    border-radius: 6px;
    font-size: 13px;
    /* color: #666; */
    cursor: pointer;
    transition: all 0.2s;
}
.ai-helper-section .ah-c-item.active {
    /* border-color: #6c5ce7; */
    /* color: #6c5ce7; */
    background: #f8f8f8;
    border: 1px solid #ddd;
}

/* --- AI生图按钮 --- */
.ai-helper-section .ah-generate {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 18px;
    background: linear-gradient(135deg, #4325e6, #6b2cff);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    /* font-weight: 600; */
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    white-space: nowrap;
}
.ai-helper-section .ah-generate:hover {
    background: linear-gradient(135deg, #4f32ed, #7740ff);
}
.ai-helper-section .ah-generate .gen-sparkle {
    font-size: 13px;
}

.image-delete-btn{
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all .2s ease;
    font-size: 16px;
    border: none;
    color: #fff;
    z-index: 10;
}

.att-editor {
    flex: 1;
    min-height: 58px;
    max-height: 63px;
    font-size: 13px;
    color: #333;
    padding: 5px;
    font-family: inherit;
    line-height: 1.7;
    background: transparent;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-all;
    white-space: pre-wrap;
    overflow-x: hidden;
    overflow-y: auto;
    outline: none;
    text-align: left;
}

/* 当编辑器为空时，显示 data-placeholder 的内容作为 placeholder */
.att-editor:empty:before {
    content: attr(data-placeholder);
    color: #aaa;
    pointer-events: none;
}
