/**
 * AI 绘画页面样式 - AI 科技风格
 *
 * @package    Hui
 * @subpackage AI_Image
 * @since      1.5.0
 */

/* ============================================================================
   页面全局设置
   ============================================================================ */

body.hui-ai-image-body {
    overflow: hidden !important;
    height: 100vh !important;
}

body.hui-ai-image-body #colophon,
body.hui-ai-image-body .xun-footer,
body.hui-ai-image-body footer.site-footer {
    display: none !important;
}

body.hui-ai-image-body .hui-mobile-tabbar,
body.hui-ai-image-body .hui-mobile-tabbar-overlay,
body.hui-ai-image-body .hui-mobile-tabbar-menu {
    display: none !important;
}

body.hui-ai-image-body {
    padding-bottom: 0 !important;
}

/* ============================================================================
   页面容器
   ============================================================================ */

.hui-ai-image-page {
    display: flex;
    height: calc(100vh - 64px);
    background: var(--color-bg-layout, #f5f5f5);
    overflow: hidden;
}

/* ============================================================================
   左侧图标导航
   ============================================================================ */

.hui-ai-image-nav {
    display: flex;
    flex-direction: column;
    width: 72px;
    background: var(--color-bg-container, #fff);
    border-right: 1px solid var(--color-border-secondary, #f0f0f0);
    flex-shrink: 0;
}

.hui-ai-image-nav-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    gap: 4px;
}

.hui-ai-image-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    padding: 10px 0;
    color: var(--color-text-tertiary, #999);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s var(--ease-smooth, ease);
}

.hui-ai-image-nav-item:hover {
    color: var(--color-text-secondary, #666);
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
}

.hui-ai-image-nav-item.is-active {
    color: var(--xun-secondary, var(--color-primary)) !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%) !important;
}

.hui-ai-image-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.hui-ai-image-nav-text {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* ============================================================================
   左侧边栏 - 模型选择
   ============================================================================ */

.hui-ai-image-sidebar {
    width: 280px;
    background: var(--color-bg-container, #fff);
    border-right: 1px solid var(--color-border-secondary, #f0f0f0);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.hui-ai-image-sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--color-border-secondary, #f0f0f0);
}

.hui-ai-image-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 10px;
    color: var(--xun-secondary, var(--color-primary));
}

.hui-ai-image-logo-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text, #333);
}

/* 模型列表 */
.hui-ai-image-models {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.hui-ai-image-model-group {
    margin-bottom: 16px;
}

.hui-ai-image-model-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-tertiary, #999);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hui-ai-image-model-group-icon {
    font-size: 14px;
}

.hui-ai-image-model-group-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hui-ai-image-model-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s var(--ease-smooth, ease);
}

.hui-ai-image-model-item:hover {
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
}

.hui-ai-image-model-item.is-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(139, 92, 246, 0.2);
}

.hui-ai-image-model-item-icon {
    font-size: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-fill-tertiary, rgba(0, 0, 0, 0.04));
    border-radius: 8px;
}

.hui-ai-image-model-item.is-active .hui-ai-image-model-item-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
}

/* 模型图片图标 */
.hui-ai-image-model-icon-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
}

.hui-ai-image-model-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.hui-ai-image-model-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hui-ai-image-model-item.is-active .hui-ai-image-model-item-name {
    color: #8b5cf6;
    font-weight: 600;
}

.hui-ai-image-model-item-points {
    font-size: 11px;
    color: var(--color-text-tertiary, #999);
}

/* 用户信息 - AI 科技风格 */
.hui-ai-image-user {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    margin: 12px;
    background: linear-gradient(135deg, 
        rgba(16, 185, 129, 0.08) 0%, 
        rgba(59, 130, 246, 0.08) 50%,
        rgba(139, 92, 246, 0.08) 100%
    );
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.hui-ai-image-user::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6);
    opacity: 0.8;
}

.hui-ai-image-user-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.hui-ai-image-user-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: visible;
    flex-shrink: 0;
}

.hui-ai-image-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* 确保认证图标不被遮挡 */
.hui-ai-image-user-avatar .xun-badge,
.hui-ai-image-user-avatar .hui-verification-badge {
    position: absolute;
    right: -4px;
    bottom: -4px;
    z-index: 10;
}

.hui-ai-image-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.hui-ai-image-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hui-ai-image-user-role {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(59, 130, 246, 0.15));
    padding: 2px 8px;
    border-radius: 20px;
    width: fit-content;
}

/* 用户点数显示 - 双点数布局 */
.hui-ai-image-user-points {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    background: var(--color-bg-container, #fff);
    border: 1px solid rgba(16, 185, 129, 0.1);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

.hui-ai-image-points-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hui-ai-image-points-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.hui-ai-image-points-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-tertiary, #999);
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.hui-ai-image-points-item:first-child .hui-ai-image-points-label::before {
    content: '🎁';
    margin-right: 4px;
}

.hui-ai-image-points-item:last-child .hui-ai-image-points-label::before {
    content: '💰';
    margin-right: 4px;
}

.hui-ai-image-points-value {
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* 充值按钮 - 内嵌在点数区域 */
.hui-ai-image-user-points .hui-ai-recharge-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth, ease);
}

.hui-ai-image-user-points .hui-ai-recharge-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.hui-ai-image-user-points .hui-ai-recharge-btn svg {
    width: 14px;
    height: 14px;
}

.hui-ai-image-user-points .hui-ai-recharge-btn span {
    display: inline;
}

/* 游客登录 */
.hui-ai-image-guest-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hui-ai-image-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth, ease);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
}

.hui-ai-image-login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.hui-ai-image-login-btn:hover::before {
    left: 100%;
}

.hui-ai-image-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.hui-ai-image-login-hint {
    margin: 0;
    font-size: 12px;
    color: var(--color-text-tertiary, #999);
    text-align: center;
    padding: 8px 12px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 8px;
}

/* ============================================================================
   主内容区域
   ============================================================================ */

.hui-ai-image-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* 顶部导航 */
.hui-ai-image-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background: var(--color-bg-container, #fff);
    border-bottom: 1px solid var(--color-border-secondary, #f0f0f0);
    flex-shrink: 0;
}

.hui-ai-image-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--color-text-secondary, #666);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.hui-ai-image-header-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text, #333);
}

.hui-ai-image-header-points {
    font-size: 12px;
    color: var(--color-text-tertiary, #999);
    padding: 4px 10px;
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border-radius: 6px;
}

/* ============================================================================
   内容区域
   ============================================================================ */

.hui-ai-image-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
}

/* 输入区域 */
.hui-ai-image-input-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 卡片通用样式 */
.hui-ai-image-prompt-card,
.hui-ai-image-ref-card,
.hui-ai-image-ratio-card,
.hui-ai-image-count-card,
.hui-ai-image-style-card {
    background: var(--color-bg-container, #fff);
    border: 1px solid var(--color-border-secondary, #f0f0f0);
    border-radius: 12px;
    padding: 16px;
}

.hui-ai-image-generate-card {
    background: transparent;
    border: none;
    padding: 0;
}

/* 提示词输入 */
.hui-ai-image-prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.hui-ai-image-prompt-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #333);
}

.hui-ai-image-prompt-count {
    font-size: 12px;
    color: var(--color-text-tertiary, #999);
}

.hui-ai-image-prompt-input {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text, #333);
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border: 1px solid var(--color-border-secondary, #f0f0f0);
    border-radius: 8px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s var(--ease-smooth, ease);
}

.hui-ai-image-prompt-input:focus {
    border-color: #8b5cf6;
    background: var(--color-bg-container, #fff);
}

.hui-ai-image-prompt-input::placeholder {
    color: var(--color-text-quaternary, #bbb);
}

.hui-ai-image-prompt-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.hui-ai-image-prompt-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--color-text-secondary, #666);
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border: 1px solid var(--color-border-secondary, #f0f0f0);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth, ease);
}

.hui-ai-image-prompt-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.hui-ai-image-prompt-btn.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 风格选择 */
.hui-ai-image-style-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.hui-ai-image-style-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #333);
}

.hui-ai-image-style-hint {
    font-size: 12px;
    color: var(--color-text-tertiary, #999);
}

.hui-ai-image-style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.hui-ai-image-style-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth, ease);
}

.hui-ai-image-style-item:hover {
    background: var(--color-fill-tertiary, rgba(0, 0, 0, 0.04));
}

.hui-ai-image-style-item.is-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: #8b5cf6;
}

.hui-ai-image-style-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--color-text-tertiary, #999);
    background: var(--color-bg-container, #fff);
    border-radius: 8px;
}

.hui-ai-image-style-item.is-active .hui-ai-image-style-icon {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

.hui-ai-image-style-name {
    font-size: 11px;
    color: var(--color-text-secondary, #666);
    text-align: center;
}

.hui-ai-image-style-item.is-active .hui-ai-image-style-name {
    color: #8b5cf6;
    font-weight: 500;
}

/* 参考图上传 */
.hui-ai-image-ref-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.hui-ai-image-ref-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #333);
}

.hui-ai-image-ref-hint {
    font-size: 12px;
    color: var(--color-text-tertiary, #999);
}

.hui-ai-image-ref-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 20px;
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border: 2px dashed var(--color-border, #e5e5e5);
    border-radius: 8px;
    color: var(--color-text-tertiary, #999);
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth, ease);
}

.hui-ai-image-ref-dropzone:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.hui-ai-image-ref-dropzone.is-dragover {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.hui-ai-image-ref-limit {
    font-size: 11px;
    color: var(--color-text-quaternary, #bbb);
}

.hui-ai-image-ref-preview {
    display: none;
    position: relative;
}

.hui-ai-image-ref-preview.is-visible {
    display: block;
}

.hui-ai-image-ref-preview img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 8px;
    object-fit: contain;
}

.hui-ai-image-ref-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.hui-ai-image-ref-remove:hover {
    background: #dc2626;
}

/* 画幅比例 */
.hui-ai-image-ratio-header {
    margin-bottom: 12px;
}

.hui-ai-image-ratio-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #333);
}

.hui-ai-image-ratio-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hui-ai-image-ratio-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth, ease);
}

.hui-ai-image-ratio-item:hover {
    background: var(--color-fill-tertiary, rgba(0, 0, 0, 0.04));
}

.hui-ai-image-ratio-item.is-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: #8b5cf6;
}

.hui-ai-image-ratio-icon {
    display: block;
    background: var(--color-border, #e5e5e5);
    border-radius: 2px;
}

.hui-ai-image-ratio-item.is-active .hui-ai-image-ratio-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

.hui-ai-image-ratio-icon--1-1 { width: 24px; height: 24px; }
.hui-ai-image-ratio-icon--16-9 { width: 32px; height: 18px; }
.hui-ai-image-ratio-icon--9-16 { width: 18px; height: 32px; }
.hui-ai-image-ratio-icon--4-3 { width: 28px; height: 21px; }
.hui-ai-image-ratio-icon--3-4 { width: 21px; height: 28px; }

.hui-ai-image-ratio-text {
    font-size: 12px;
    color: var(--color-text-secondary, #666);
}

.hui-ai-image-ratio-item.is-active .hui-ai-image-ratio-text {
    color: #8b5cf6;
    font-weight: 500;
}

/* 生成数量 */
.hui-ai-image-count-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.hui-ai-image-count-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #333);
}

.hui-ai-image-count-hint {
    font-size: 12px;
    color: var(--color-text-tertiary, #999);
}

.hui-ai-image-count-grid {
    display: flex;
    gap: 8px;
}

.hui-ai-image-count-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 8px;
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth, ease);
}

.hui-ai-image-count-item:hover {
    background: var(--color-fill-tertiary, rgba(0, 0, 0, 0.04));
}

.hui-ai-image-count-item.is-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: #8b5cf6;
}

.hui-ai-image-count-num {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text, #333);
}

.hui-ai-image-count-item.is-active .hui-ai-image-count-num {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hui-ai-image-count-text {
    font-size: 11px;
    color: var(--color-text-tertiary, #999);
}

/* 生成按钮 */
.hui-ai-image-generate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth, ease);
}

.hui-ai-image-generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.hui-ai-image-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hui-ai-image-generate-btn.is-loading {
    pointer-events: none;
}

.hui-ai-image-generate-points {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.8;
}

/* ============================================================================
   结果区域
   ============================================================================ */

.hui-ai-image-result-section {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-container, #fff);
    border: 1px solid var(--color-border-secondary, #f0f0f0);
    border-radius: 12px;
    overflow: hidden;
}

.hui-ai-image-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border-secondary, #f0f0f0);
}

.hui-ai-image-result-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #333);
}

.hui-ai-image-result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hui-ai-image-history-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--color-text-secondary, #666);
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border: 1px solid var(--color-border-secondary, #f0f0f0);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth, ease);
}

.hui-ai-image-history-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.hui-ai-image-result-clear {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--color-text-tertiary, #999);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.hui-ai-image-result-clear:hover {
    color: #ef4444;
}

/* 生成中状态 */
.hui-ai-image-generating {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 48px 24px;
}

.hui-ai-image-generating-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-fill-secondary, rgba(0, 0, 0, 0.06));
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: hui-ai-image-spin 1s linear infinite;
}

@keyframes hui-ai-image-spin {
    to { transform: rotate(360deg); }
}

.hui-ai-image-generating-text {
    font-size: 14px;
    color: var(--color-text-secondary, #666);
}

.hui-ai-image-generating-progress {
    font-size: 12px;
    color: var(--color-text-tertiary, #999);
}

/* 结果网格 */
.hui-ai-image-result-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
    align-content: start;
}

/* 空状态 */
.hui-ai-image-result-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    color: var(--color-text-tertiary, #999);
    text-align: center;
}

.hui-ai-image-result-empty p {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-secondary, #666);
}

.hui-ai-image-result-empty span {
    font-size: 12px;
}

/* 结果项 */
.hui-ai-image-result-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--color-fill-quaternary, #f5f5f5);
}

.hui-ai-image-result-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hui-ai-image-result-item:hover img {
    transform: scale(1.05);
}

.hui-ai-image-result-item-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.hui-ai-image-result-item:hover .hui-ai-image-result-item-overlay {
    opacity: 1;
}

.hui-ai-image-result-item-actions {
    display: flex;
    gap: 8px;
}

.hui-ai-image-result-item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: var(--color-text, #333);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hui-ai-image-result-item-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

/* ============================================================================
   预览弹窗
   ============================================================================ */

.hui-ai-image-preview-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.hui-ai-image-preview-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.hui-ai-image-preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.hui-ai-image-preview-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.hui-ai-image-preview-content img {
    max-width: 100%;
    max-height: calc(90vh - 60px);
    object-fit: contain;
    border-radius: 8px;
}

.hui-ai-image-preview-actions {
    display: flex;
    gap: 12px;
}

.hui-ai-image-preview-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.hui-ai-image-preview-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================================================
   侧边栏遮罩（移动端）
   ============================================================================ */

.hui-ai-image-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 940;
}

.hui-ai-image-sidebar-overlay.is-visible {
    display: block;
}

/* ============================================================================
   历史记录弹窗
   ============================================================================ */

.hui-ai-image-history-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.hui-ai-image-history-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.hui-ai-image-history-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.hui-ai-image-history-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    background: var(--color-bg-container, #fff);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hui-ai-image-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border-secondary, #f0f0f0);
    flex-shrink: 0;
}

.hui-ai-image-history-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text, #333);
}

.hui-ai-image-history-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hui-ai-image-history-clear {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--color-text-tertiary, #999);
    background: transparent;
    border: 1px solid var(--color-border-secondary, #f0f0f0);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hui-ai-image-history-clear:hover {
    color: #ef4444;
    border-color: #ef4444;
}

.hui-ai-image-history-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--color-text-tertiary, #999);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hui-ai-image-history-close-btn:hover {
    color: var(--color-text, #333);
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
}

.hui-ai-image-history-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.hui-ai-image-history-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.hui-ai-image-history-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--color-fill-quaternary, #f5f5f5);
}

.hui-ai-image-history-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hui-ai-image-history-item:hover img {
    transform: scale(1.05);
}

.hui-ai-image-history-item-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.hui-ai-image-history-item:hover .hui-ai-image-history-item-overlay {
    opacity: 1;
}

.hui-ai-image-history-item-actions {
    display: flex;
    gap: 6px;
}

.hui-ai-image-history-item-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: var(--color-text, #333);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hui-ai-image-history-item-btn:hover {
    background: #fff;
    transform: scale(1.1);
    color: #8b5cf6;
}

.hui-ai-image-history-item-btn--danger:hover {
    color: #ef4444;
}

.hui-ai-image-history-item-date {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    font-size: 10px;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    text-align: center;
}

.hui-ai-image-history-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 24px;
    color: var(--color-text-tertiary, #999);
    text-align: center;
}

.hui-ai-image-history-empty.is-visible {
    display: flex;
}

.hui-ai-image-history-empty p {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-secondary, #666);
}

.hui-ai-image-history-empty span {
    font-size: 12px;
}

/* ============================================================================
   Toast 提示
   ============================================================================ */

.hui-ai-image-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 12px 24px;
    font-size: 14px;
    color: #fff;
    background: var(--color-text, #333);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10000;
}

.hui-ai-image-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.hui-ai-image-toast.is-success {
    background: #10b981;
}

.hui-ai-image-toast.is-error {
    background: #ef4444;
}

.hui-ai-image-toast.is-warning {
    background: #f59e0b;
}

/* ============================================================================
   响应式设计
   ============================================================================ */

@media (max-width: 1200px) {
    .hui-ai-image-content {
        grid-template-columns: 1fr;
    }
    
    .hui-ai-image-result-section {
        min-height: 400px;
    }
}

@media (max-width: 1024px) {
    .hui-ai-image-sidebar {
        position: fixed;
        left: 72px;
        top: 64px;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s var(--ease-smooth, ease);
    }
    
    .hui-ai-image-sidebar.is-open {
        transform: translateX(0);
    }
    
    .hui-ai-image-menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .hui-ai-image-nav {
        display: none;
    }
    
    .hui-ai-image-sidebar {
        left: 0;
        top: 0;
        width: 280px;
        z-index: 950;
    }
    
    .hui-ai-image-content {
        padding: 16px;
        gap: 16px;
    }
    
    .hui-ai-image-result-grid {
        grid-template-columns: 1fr;
    }
    
    .hui-ai-image-ratio-grid {
        justify-content: center;
    }
    
    .hui-ai-image-history-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .hui-ai-image-history-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================================
   移动端底部导航 Tab
   ============================================================================ */

.hui-ai-image-mobile-nav {
    display: none;
}

@media (max-width: 768px) {
    .hui-ai-image-mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 900;
        background: var(--color-bg-container, #fff);
        border-top: 1px solid var(--color-border-secondary, #f0f0f0);
        padding: 6px 0;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
        align-items: center;
    }

    .hui-ai-image-mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        padding: 6px 0;
        color: var(--color-text-tertiary, #999);
        text-decoration: none;
        transition: color 0.2s var(--ease-smooth, ease);
    }

    .hui-ai-image-mobile-nav-item.is-active {
        color: var(--xun-secondary, var(--color-primary));
    }

    .hui-ai-image-mobile-nav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 2px;
    }

    .hui-ai-image-mobile-nav-icon svg {
        width: 20px;
        height: 20px;
    }

    .hui-ai-image-mobile-nav-text {
        font-size: 10px;
        font-weight: 500;
        white-space: nowrap;
    }

    /* 有底部导航时，内容区域留出空间 */
    .hui-ai-image-page {
        padding-bottom: calc(54px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 480px) {
    .hui-ai-image-header {
        padding: 12px 16px;
    }
    
    .hui-ai-image-header-title {
        font-size: 14px;
    }
    
    .hui-ai-image-prompt-card,
    .hui-ai-image-ref-card,
    .hui-ai-image-ratio-card,
    .hui-ai-image-count-card,
    .hui-ai-image-style-card {
        padding: 12px;
    }
    
    .hui-ai-image-generate-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .hui-ai-image-history-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hui-ai-image-history-header {
        padding: 12px 16px;
    }
}

/* ============================================================================
   深色模式适配
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    :root:not(.light) .hui-ai-image-nav-item.is-active {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%) !important;
    }
    
    :root:not(.light) .hui-ai-image-model-item.is-active {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    }
    
    :root:not(.light) .hui-ai-image-style-item.is-active,
    :root:not(.light) .hui-ai-image-ratio-item.is-active,
    :root:not(.light) .hui-ai-image-count-item.is-active {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    }
}

.dark .hui-ai-image-nav-item.is-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%) !important;
}

.dark .hui-ai-image-model-item.is-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
}

.dark .hui-ai-image-style-item.is-active,
.dark .hui-ai-image-ratio-item.is-active,
.dark .hui-ai-image-count-item.is-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
}


/* ============================================================================
   分享弹窗
   ============================================================================ */

.hui-ai-image-share-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.hui-ai-image-share-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.hui-ai-image-share-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.hui-ai-image-share-content {
    position: relative;
    width: 90%;
    max-width: 420px;
    background: var(--color-bg-container, #fff);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.hui-ai-image-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border-secondary, #f0f0f0);
}

.hui-ai-image-share-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text, #333);
}

.hui-ai-image-share-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--color-text-tertiary, #999);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hui-ai-image-share-close:hover {
    color: var(--color-text, #333);
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
}

.hui-ai-image-share-body {
    padding: 24px;
}

.hui-ai-image-share-field {
    margin-bottom: 0;
}

.hui-ai-image-share-field label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary, #666);
}

.hui-ai-image-share-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hui-ai-image-share-category {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary, #666);
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border: 1px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hui-ai-image-share-category:hover {
    color: #8b5cf6;
    background: var(--color-fill-tertiary, rgba(0, 0, 0, 0.04));
}

.hui-ai-image-share-category.is-active {
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    border-color: transparent;
}

.hui-ai-image-share-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--color-border-secondary, #f0f0f0);
}

.hui-ai-image-share-cancel {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary, #666);
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border: 1px solid var(--color-border-secondary, #f0f0f0);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hui-ai-image-share-cancel:hover {
    background: var(--color-fill-tertiary, rgba(0, 0, 0, 0.04));
}

.hui-ai-image-share-submit {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hui-ai-image-share-submit:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.hui-ai-image-share-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 分享按钮样式 */
.hui-ai-image-result-item-btn--share {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(59, 130, 246, 0.9)) !important;
    color: #fff !important;
}

.hui-ai-image-result-item-btn--share:hover {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6) !important;
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    :root:not(.light) .hui-ai-image-share-content {
        background: var(--color-bg-elevated, #1f1f1f);
    }

    :root:not(.light) .hui-ai-image-share-overlay {
        background: rgba(0, 0, 0, 0.75);
    }
}

.dark .hui-ai-image-share-content {
    background: var(--color-bg-elevated, #1f1f1f);
}

.dark .hui-ai-image-share-overlay {
    background: rgba(0, 0, 0, 0.75);
}


/* ============================================================================
   标签切换器
   ============================================================================ */

.hui-ai-image-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border-radius: 10px;
}

.hui-ai-image-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-tertiary, #999);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth, ease);
}

.hui-ai-image-tab:hover {
    color: var(--color-text-secondary, #666);
}

.hui-ai-image-tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.hui-ai-image-tab svg {
    width: 16px;
    height: 16px;
}

/* 创作标签页头部信息 */
[data-create-header-info] {
    margin-left: auto;
}

/* ============================================================================
   广场内嵌样式
   ============================================================================ */

.hui-ai-image-gallery-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

/* 广场头部 - 内嵌在 AI Image 页面 */
.hui-ai-image-gallery-content .hui-ai-gallery-header {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.hui-ai-image-gallery-content .hui-ai-gallery-search-wrap {
    width: 100%;
    max-width: 500px;
}

.hui-ai-image-gallery-content .hui-ai-gallery-search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--color-bg-container, #fff);
    border: 1px solid var(--color-border-secondary, #f0f0f0);
    border-radius: 24px;
    box-shadow: none;
    transition: all 0.2s ease;
}

.hui-ai-image-gallery-content .hui-ai-gallery-search-inner:focus-within {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.hui-ai-image-gallery-content .hui-ai-gallery-search-icon {
    color: var(--color-text-tertiary, #999);
    flex-shrink: 0;
}

.hui-ai-image-gallery-content .hui-ai-gallery-search-input {
    flex: 1;
    min-width: 0;
    padding: 4px 0;
    font-size: 14px;
    color: var(--color-text, #333);
    background: transparent;
    border: none;
    outline: none;
}

.hui-ai-image-gallery-content .hui-ai-gallery-search-input::placeholder {
    color: var(--color-text-quaternary, #bbb);
}

.hui-ai-image-gallery-content .hui-ai-gallery-search-btn {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.hui-ai-image-gallery-content .hui-ai-gallery-search-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* 分类标签 - 内嵌在 AI Image 页面 */
.hui-ai-image-gallery-content .hui-ai-gallery-categories {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

.hui-ai-image-gallery-content .hui-ai-gallery-categories-inner {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 6px;
    background: var(--color-bg-container, #fff);
    border-radius: 28px;
    border: 1px solid var(--color-border-secondary, #f0f0f0);
}

.hui-ai-image-gallery-content .hui-ai-gallery-category {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary, #666);
    background: transparent;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.hui-ai-image-gallery-content .hui-ai-gallery-category:hover {
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.08);
}

.hui-ai-image-gallery-content .hui-ai-gallery-category.is-active {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

/* 图片瀑布流 - 内嵌在 AI Image 页面 */
.hui-ai-image-gallery-content .hui-ai-gallery-grid {
    display: block !important;
    column-count: 4;
    column-gap: 16px;
    flex: 1;
}

@media (max-width: 1200px) {
    .hui-ai-image-gallery-content .hui-ai-gallery-grid {
        column-count: 3;
    }
}

@media (max-width: 900px) {
    .hui-ai-image-gallery-content .hui-ai-gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .hui-ai-image-gallery-content .hui-ai-gallery-grid {
        column-count: 2;
    }
}

.hui-ai-image-gallery-content .hui-ai-gallery-item {
    position: relative;
    break-inside: avoid;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-bg-container, #fff);
    border: 1px solid var(--color-border-secondary, #f0f0f0);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
}

.hui-ai-image-gallery-content .hui-ai-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.hui-ai-image-gallery-content .hui-ai-gallery-item-image {
    position: relative;
    width: 100%;
    padding-bottom: 0;
    overflow: hidden;
    line-height: 0;
}

.hui-ai-image-gallery-content .hui-ai-gallery-item-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.hui-ai-image-gallery-content .hui-ai-gallery-item:hover .hui-ai-gallery-item-image img {
    transform: scale(1.02);
}

/* 卡片底部 - 内嵌在 AI Image 页面 */
.hui-ai-image-gallery-content .hui-ai-gallery-item-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--color-border-secondary, #f0f0f0);
}

.hui-ai-image-gallery-content .hui-ai-gallery-item-footer-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hui-ai-image-gallery-content .hui-ai-gallery-item-footer-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.hui-ai-image-gallery-content .hui-ai-gallery-item-footer-info {
    flex: 1;
    min-width: 0;
}

.hui-ai-image-gallery-content .hui-ai-gallery-item-footer-name {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hui-ai-image-gallery-content .hui-ai-gallery-item-footer-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hui-ai-image-gallery-content .hui-ai-gallery-item-footer-stat {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--color-text-tertiary, #999);
}

.hui-ai-image-gallery-content .hui-ai-gallery-item-footer-stat svg {
    width: 12px;
    height: 12px;
}

/* 加载状态 - 内嵌在 AI Image 页面 */
.hui-ai-image-gallery-content .hui-ai-gallery-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--color-text-tertiary, #999);
}

.hui-ai-image-gallery-content .hui-ai-gallery-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-fill-secondary, rgba(0, 0, 0, 0.06));
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: hui-ai-image-spin 1s linear infinite;
}

/* 空状态 - 内嵌在 AI Image 页面 */
.hui-ai-image-gallery-content .hui-ai-gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--color-text-tertiary, #999);
    text-align: center;
}

.hui-ai-image-gallery-content .hui-ai-gallery-empty p {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-secondary, #666);
}

.hui-ai-image-gallery-content .hui-ai-gallery-empty span {
    font-size: 12px;
}

/* 加载更多 - 内嵌在 AI Image 页面 */
.hui-ai-image-gallery-content .hui-ai-gallery-load-more {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.hui-ai-image-gallery-content .hui-ai-gallery-load-more-btn {
    padding: 10px 32px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary, #666);
    background: var(--color-bg-container, #fff);
    border: 1px solid var(--color-border-secondary, #f0f0f0);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hui-ai-image-gallery-content .hui-ai-gallery-load-more-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.hui-ai-image-gallery-content .hui-ai-gallery-load-more-btn.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 没有更多 - 内嵌在 AI Image 页面 */
.hui-ai-image-gallery-content .hui-ai-gallery-no-more {
    display: flex;
    justify-content: center;
    padding: 20px;
    font-size: 13px;
    color: var(--color-text-tertiary, #999);
}

/* 时间显示 - 内嵌在 AI Image 页面 */
.hui-ai-image-gallery-content .hui-ai-gallery-item-footer-time {
    display: block;
    font-size: 11px;
    color: var(--color-text-tertiary, #999);
    margin-top: 2px;
}

/* ============================================================================
   广场详情弹窗
   ============================================================================ */

.hui-ai-gallery-detail-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.hui-ai-gallery-detail-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.hui-ai-gallery-detail-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.hui-ai-gallery-detail-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background: var(--color-bg-container, #fff);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.hui-ai-gallery-detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--color-text-tertiary, #999);
    background: var(--color-bg-container, #fff);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hui-ai-gallery-detail-close:hover {
    color: var(--color-text, #333);
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
}

.hui-ai-gallery-detail-body {
    display: flex;
    max-height: 90vh;
}

.hui-ai-gallery-detail-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 400px;
}

.hui-ai-gallery-detail-image img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.hui-ai-gallery-detail-info {
    width: 360px;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
    flex-shrink: 0;
}

.hui-ai-gallery-detail-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border-secondary, #f0f0f0);
}

.hui-ai-gallery-detail-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.hui-ai-gallery-detail-author-info {
    flex: 1;
}

.hui-ai-gallery-detail-author-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text, #333);
}

.hui-ai-gallery-detail-time {
    font-size: 12px;
    color: var(--color-text-tertiary, #999);
}

.hui-ai-gallery-detail-section {
    margin-bottom: 20px;
}

.hui-ai-gallery-detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.hui-ai-gallery-detail-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary, #666);
}

.hui-ai-gallery-detail-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--color-text-tertiary, #999);
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hui-ai-gallery-detail-copy:hover {
    color: #8b5cf6;
    background: var(--color-fill-tertiary, rgba(0, 0, 0, 0.04));
}

.hui-ai-gallery-detail-prompt {
    margin: 0;
    padding: 12px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text, #333);
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border-radius: 8px;
    word-break: break-word;
}

.hui-ai-gallery-detail-params {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.hui-ai-gallery-detail-param {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border-radius: 8px;
}

.hui-ai-gallery-detail-param-label {
    font-size: 11px;
    color: var(--color-text-tertiary, #999);
}

.hui-ai-gallery-detail-param-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text, #333);
}

.hui-ai-gallery-detail-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 12px 0;
    border-top: 1px solid var(--color-border-secondary, #f0f0f0);
    border-bottom: 1px solid var(--color-border-secondary, #f0f0f0);
}

.hui-ai-gallery-detail-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-secondary, #666);
}

.hui-ai-gallery-detail-stat svg {
    color: var(--color-text-tertiary, #999);
}

.hui-ai-gallery-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.hui-ai-gallery-detail-btn {
    flex: 1;
    min-width: calc(50% - 4px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary, #666);
    background: var(--color-fill-quaternary, rgba(0, 0, 0, 0.02));
    border: 1px solid var(--color-border-secondary, #f0f0f0);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hui-ai-gallery-detail-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.hui-ai-gallery-detail-btn--like.is-liked {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.hui-ai-gallery-detail-btn--like.is-liked svg {
    fill: #ef4444;
}

.hui-ai-gallery-detail-btn--create {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-color: transparent;
}

.hui-ai-gallery-detail-btn--create:hover {
    color: #fff;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.hui-ai-gallery-detail-btn--delete {
    color: #ef4444;
    border-color: #ef4444;
}

.hui-ai-gallery-detail-btn--delete:hover {
    color: #fff;
    background: #ef4444;
}

/* 响应式 - 广场详情弹窗 */
@media (max-width: 768px) {
    .hui-ai-image-tabs {
        padding: 3px;
    }
    
    .hui-ai-image-tab {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .hui-ai-image-tab span {
        display: none;
    }
    
    .hui-ai-gallery-detail-body {
        flex-direction: column;
    }
    
    .hui-ai-gallery-detail-image {
        min-height: 250px;
    }
    
    .hui-ai-gallery-detail-info {
        width: 100%;
        max-height: 50vh;
    }
    
    .hui-ai-gallery-detail-params {
        grid-template-columns: 1fr;
    }
}
