/* NAI 高级功能页面样式 */

/* Badge 标签 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    margin-left: 8px;
    text-transform: uppercase;
}

.badge.new {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* 帮助提示 */
.help-tip {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.6;
}

.help-tip p {
    margin: 5px 0;
}

.help-tip code {
    background: rgba(99, 102, 241, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    color: #6366f1;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    margin: 10px 0 15px 0;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #374151;
}

.toggle-row small {
    font-size: 12px;
    color: #6b7280;
}

.btn {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: #f3f4f6;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn.primary {
    border-color: transparent;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.btn.primary:hover {
    filter: brightness(1.02);
}

.format-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.format-btn.active {
    border-color: transparent;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.2);
}

.position-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.position-tip {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 18px;
}

.modal {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.modal-body {
    padding: 16px;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 16px 16px;
    border-top: 1px solid #e5e7eb;
}

.position-grid-labeled {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.position-cell-labeled {
    aspect-ratio: 1;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.position-cell-labeled:hover {
    background: #f3f4f6;
    color: #374151;
}

.position-cell-labeled.selected {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

/* 角色卡片 */
.character-card {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
    transition: all 0.3s ease;
}

.character-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
}

.character-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.character-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.icon-btn.danger:hover {
    background: #fee2e2;
    color: #ef4444;
}

.character-title {
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.character-number {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.remove-character-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.remove-character-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

.character-card .input-group {
    margin-bottom: 12px;
}

.character-card .input-group:last-child {
    margin-bottom: 0;
}

.character-card textarea {
    font-size: 13px;
}

/* 位置选择器 */
.position-selector {
    margin-top: 15px;
}

.position-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.position-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    max-width: 200px;
}

.position-cell {
    aspect-ratio: 1;
    background: #e5e7eb;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.position-cell:hover {
    background: #d1d5db;
}

.position-cell.selected {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: #4f46e5;
}

/* Vibe 卡片 */
.vibe-card {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.vibe-preview {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.vibe-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vibe-preview .upload-icon {
    color: #9ca3af;
}

.vibe-settings {
    flex: 1;
}

.vibe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.vibe-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.slider-group {
    margin-bottom: 12px;
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 5px;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-group small {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.slider-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.upload-placeholder {
    color: #9ca3af;
}

.upload-placeholder p {
    margin-top: 10px;
    font-size: 14px;
}

.preview-container {
    position: relative;
    display: inline-block;
}

.preview-container img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    object-fit: contain;
}

.remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.remove-btn:hover {
    background: #dc2626;
}

/* 添加按钮 */
.add-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    color: #6366f1;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border-color: #6366f1;
}

.add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 生成按钮 */
.generate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 结果区域 */
.result-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.result-images img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.result-section {
    margin-top: 20px;
}

.result-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1f2937;
}

.result-section textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    resize: vertical;
    background: #f9fafb;
}

.copy-btn {
    margin-top: 10px;
    padding: 10px 20px;
    background: #4c7aaf;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #3d6a9f;
}

/* 导航栏更新 */
.nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-links a {
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #4b5563;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nav-links a:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.nav-links a.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

/* 信息框 */
.info-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}

.info-box ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.info-box li {
    margin: 5px 0;
    font-size: 14px;
    color: #4b5563;
}

/* 帮助内容 */
.help-content h3 {
    font-size: 15px;
    color: #1f2937;
    margin: 20px 0 10px 0;
}

.help-content h3:first-child {
    margin-top: 0;
}

.help-content p {
    font-size: 13px;
    color: #4b5563;
    margin: 5px 0;
    line-height: 1.6;
}

.help-content code {
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    color: #6366f1;
}

/* 响应式 */
@media (max-width: 600px) {
    .nav-links {
        justify-content: center;
    }
    
    .vibe-card {
        flex-direction: column;
    }
    
    .vibe-preview {
        width: 100%;
        height: 150px;
    }
}
