/*!
Theme Name: AI Image主题
Theme URI: https://www1.foxlet.cn/
Description: AI图片生成主题，支持任务管理和实时生图交互。
Author: 龙坤智创
Author URI: https://www1.foxlet.cn/
Version: 1.0.1
*/

/* 重置基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* WordPress默认类 */
.alignnone {
    margin: 5px 20px 20px 0;
}

.aligncenter,
div.aligncenter {
    display: block;
    margin: 5px auto 5px auto;
}

.alignright {
    float: right;
    margin: 5px 0 20px 20px;
}

.alignleft {
    float: left;
    margin: 5px 20px 20px 0;
}

a img.alignright {
    float: right;
    margin: 5px 0 20px 20px;
}

a img.alignnone {
    margin: 5px 20px 20px 0;
}

a img.alignleft {
    float: left;
    margin: 5px 20px 20px 0;
}

a img.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption {
    background: #fff;
    border: 1px solid #f0f0f0;
    max-width: 96%;
    padding: 5px 3px 10px;
    text-align: center;
}

.wp-caption.alignnone {
    margin: 5px 20px 20px 0;
}

.wp-caption.alignleft {
    margin: 5px 20px 20px 0;
}

.wp-caption.alignright {
    margin: 5px 0 20px 20px;
}

.wp-caption img {
    border: 0 none;
    height: auto;
    margin: 0;
    max-width: 98.5%;
    padding: 0;
    width: auto;
}

.wp-caption p.wp-caption-text {
    font-size: 11px;
    line-height: 17px;
    margin: 0;
    padding: 0 4px 5px;
}

/* 屏幕阅读器文本 */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-size: 0.875rem;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* 响应式图片 */
img {
    max-width: 100%;
    height: auto;
}

/* 清除浮动 */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* 主题特定样式将在后续模板文件中通过Tailwind CSS实现 */

/* 模型选择器自定义样式 */
#modelSelect {
    overflow: visible;
    position: relative;
}

/* 确保下拉选项可以超出选择框宽度 */
#modelSelect option {
    min-width: max-content;
    white-space: nowrap;
    padding: 4px 8px;
}

/* Firefox特殊处理 */
@-moz-document url-prefix() {
    #modelSelect {
        text-overflow: ellipsis;
        overflow: hidden;
    }
    
    #modelSelect option {
        background: white;
        color: #374151;
        padding: 6px 8px;
    }
}

/* Safari/WebKit特殊处理 */
@supports (-webkit-appearance: menulist) {
    #modelSelect option {
        background: white;
        color: #374151;
    }
}

/* 内联图片显示样式 */
.inline-image-item {
    position: relative;
    display: inline-block;
    max-width: 64px; /* 原80 → 64 */
    height: 48px;    /* 原60 → 48 */
    border-radius: 8px;
    overflow: visible; /* 允许右上角删除按钮不被裁剪 */
    border: 2px solid #e5e7eb;
    z-index: 10;
}

.inline-image-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.inline-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.inline-image-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;  /* 原20 → 18 */
    height: 18px; /* 原20 → 18 */
    background: #ef4444;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    z-index: 20;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.inline-image-item:hover .inline-image-remove {
    opacity: 1;
}

.inline-image-remove:hover {
    background: #dc2626;
}

/* 响应式优化 */
@media (max-width: 640px) {
    .inline-image-item {
        max-width: 48px; /* 原60 → 48 */
        height: 36px;    /* 原45 → 36 */
    }
    
    .inline-image-remove {
        width: 16px; /* 原18 → 16 */
        height: 16px; /* 原18 → 16 */
        font-size: 11px;
        top: -5px;
        right: -5px;
        opacity: 1; /* 移动端始终显示删除图标 */
    }

    /* 移动端：旧预览列表中的删除按钮始终可见 */
    .image-preview-item .remove-image {
        opacity: 1 !important;
    }

    /* 移动端：为文本域留出底部工具栏的空间，避免被遮挡 */
    #messageInput {
        padding-bottom: 32px; /* 优化输入区与工具栏的间距 */
    }
}