/* Apple Design System - 组件样式 */

/* SVG图标样式 */
.btn-minimal svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    transition: all 0.2s ease;
}

.btn-minimal:hover svg {
    transform: scale(1.1);
}

/* 顶部操作按钮容器 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* API设置和主题切换按钮样式 */
.btn.btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px;
}

.btn.btn-ghost svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: all 0.3s ease;
}

.btn.btn-ghost:hover svg {
    transform: rotate(45deg);
}

/* 主题切换按钮特殊样式 */
#theme-toggle-btn {
    position: relative;
    overflow: hidden;
}

#theme-toggle-btn .theme-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

#theme-toggle-btn .sun-icon {
    opacity: 1;
    visibility: visible;
}

#theme-toggle-btn .moon-icon {
    opacity: 0;
    visibility: hidden;
}

/* 深色主题下的主题切换按钮 */
[data-theme="dark"] #theme-toggle-btn .sun-icon {
    opacity: 0;
    visibility: hidden;
}

[data-theme="dark"] #theme-toggle-btn .moon-icon {
    opacity: 1;
    visibility: visible;
}

#theme-toggle-btn:hover .theme-icon {
    transform: translate(-50%, -50%) rotate(180deg);
}

/* 通知弹窗样式 */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.notification-content {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-icon {
    color: #4CAF50;
    flex-shrink: 0;
}

.notification-message {
    white-space: nowrap;
}

/* 隐藏滚动条但保持滚动功能 */
body {
    overflow-x: hidden;
}

/* 隐藏所有滚动条 */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* 针对Firefox隐藏滚动条 */
html {
    scrollbar-width: none;
}

/* 针对IE隐藏滚动条 */
body {
    -ms-overflow-style: none;
}

/* 模态框组件 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    justify-content: flex-end;
}

/* 表单组件 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.form-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* API输入框样式 */
.api-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    font-size: 14px;
    font-family: 'SF Mono', Monaco, monospace;
    color: var(--text-primary);
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.api-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    background: var(--bg-secondary);
}

.api-input::placeholder {
    color: var(--text-placeholder);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    letter-spacing: normal;
}

/* API状态组件 */
.api-status {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
    margin-top: 16px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.status-value {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, monospace;
}

.status-value.not-set {
    background: #FFF3CD;
    color: #856404;
}

.status-value.connected {
    background: #D1F2EB;
    color: #00875F;
}

.status-value.error {
    background: #FFE6E6;
    color: #DE350B;
}

.status-value.testing {
    background: #DEEBFF;
    color: #0747A6;
}

/* 图片上传组件 - Apple 风格 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    margin-top: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(0, 122, 255, 0.02);
}

.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(0, 122, 255, 0.05);
    transform: scale(1.02);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-icon {
    font-size: 32px;
    opacity: 0.7;
}

.upload-text p {
    margin: 0;
    font-size: 15px;
    color: var(--text-primary);
}

.upload-text strong {
    color: var(--primary);
    font-weight: 600;
}

.upload-hint {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* 已上传图片预览 */
.uploaded-images {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.image-preview {
    position: relative;
    display: inline-block;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.image-preview:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.image-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    display: block;
}

.image-preview .image-actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: all 0.2s ease;
}

.image-preview:hover .image-actions {
    opacity: 1;
}

.image-preview .btn-small {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.image-preview .btn-copy {
    background: var(--primary);
    color: white;
}

.image-preview .btn-copy:hover {
    background: var(--primary-hover);
}

.image-preview .btn-remove {
    background: #FF3B30;
    color: white;
}

.image-preview .btn-remove:hover {
    background: #D70015;
}

/* 旧的 image-remove 样式已移除，使用新的 hover 效果 */

/* 状态消息组件 */
.upload-status,
.optimize-status,
.copy-status {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.upload-status.show,
.optimize-status.show,
.copy-status.show {
    opacity: 1;
    transform: translateY(0);
}

.upload-status.success,
.optimize-status.success,
.copy-status.success {
    background: rgba(52, 199, 89, 0.1);
    color: #1D8348;
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.upload-status.error,
.optimize-status.error,
.copy-status.error {
    background: rgba(255, 59, 48, 0.1);
    color: #C0392B;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.upload-status.optimizing,
.optimize-status.optimizing {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary);
    border: 1px solid rgba(0, 122, 255, 0.3);
}

/* 优化按钮加载状态 */
.btn-optimize.optimizing {
    background: linear-gradient(135deg, #6C757D 0%, #ADB5BD 100%);
    cursor: not-allowed;
    transform: none !important;
}

.btn-optimize.optimizing:hover {
    transform: none !important;
}

/* 字符计数和操作按钮 */
.description-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    gap: 16px;
}

.char-count {
    font-size: 13px;
    color: var(--text-tertiary);
    font-family: 'SF Mono', Monaco, monospace;
}

/* API密钥输入框特殊样式 */
.api-input {
    font-family: 'SF Mono', Monaco, monospace;
    letter-spacing: 0.02em;
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.btn-optimize.optimizing {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 微交互动画 */
.btn,
.ratio-btn,
.image-preview,
.param-item {
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn:active {
    transform: scale(0.98);
}

.ratio-btn:active,
.image-preview:active {
    transform: scale(0.95);
}

/* 焦点可访问性 */
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* 选择框样式增强 - Apple 风格 */
.form-group select,
.param-item select,
.select-input {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: var(--space-sm) var(--space-md) !important;
    font-size: 14px !important;
    color: var(--text-primary) !important;
    min-height: 40px !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m7 10 5 5 5-5'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right var(--space-md) center !important;
    background-size: 12px !important;
    padding-right: 40px !important;
    transition: all 0.2s ease !important;
}

.form-group select:hover,
.param-item select:hover,
.select-input:hover {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.form-group select:focus,
.param-item select:focus,
.select-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* 表单验证状态 */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #FF3B30;
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1);
}

.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: #30D158;
    box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.1);
}

/* 工具提示 - Apple 风格 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    font-weight: 500;
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-primary);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}

/* 响应式组件调整 */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px 20px;
    }
    
    .upload-area {
        padding: 20px 16px;
    }
    
    .description-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .char-count {
        text-align: center;
    }
    
    .uploaded-images {
        justify-content: center;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}/* 强制更新 2025年 8月26日 星期二 13时29分25秒 CST */
