/* ==================== 故事背景设定表单样式 ==================== */

/* 表单弹窗 */
.story-background-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.story-background-content {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: linear-gradient(145deg, #1a1a2e 0%, #0f1419 100%);
    border: 2px solid #8b5cf6;
    border-radius: 20px;
    padding: 30px;
    color: #e0e0e0;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 头部 */
.sb-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}

.sb-header h2 {
    margin: 0 0 10px;
    font-size: 28px;
    background: linear-gradient(90deg, #8b5cf6, #e94560);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sb-subtitle {
    margin: 0;
    font-size: 14px;
    color: #9ca3af;
}

.sb-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(233, 69, 96, 0.2);
    border: 1px solid rgba(233, 69, 96, 0.5);
    color: #ff6b6b;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
}

.sb-close:hover {
    background: rgba(233, 69, 96, 0.4);
    transform: rotate(90deg);
}

/* 示例展示区 */
.sb-example-section {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
}

.sb-example-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.sb-example-tab {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #9ca3af;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.sb-example-tab:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    color: #c4b5fd;
}

.sb-example-tab.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-color: #8b5cf6;
    color: white;
}

.sb-example-content {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    min-height: 200px;
}

.sb-example-content h3 {
    margin: 0 0 15px;
    font-size: 20px;
    color: #f4a261;
}

.sb-example-content p {
    margin: 8px 0;
    line-height: 1.8;
    color: #d1d5db;
}

.sb-example-content strong {
    color: #8b5cf6;
}

/* 表单字段 */
.sb-form-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.sb-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sb-label {
    font-size: 16px;
    font-weight: 600;
    color: #c4b5fd;
}

.sb-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    color: #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    line-height: 1.6;
    transition: all 0.2s;
}

.sb-textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.sb-textarea::placeholder {
    color: #6b7280;
}

.field-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.examples-label {
    font-size: 12px;
    color: #6b7280;
}

.example-tag {
    padding: 4px 12px;
    background: rgba(233, 69, 96, 0.15);
    border: 1px solid rgba(233, 69, 96, 0.3);
    border-radius: 15px;
    color: #fca5a5;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.example-tag:hover {
    background: rgba(233, 69, 96, 0.3);
    border-color: rgba(233, 69, 96, 0.5);
    transform: translateY(-1px);
}

/* 底部按钮 */
.sb-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 10px;
}

.sb-footer-tip {
    margin: 0;
    padding: 12px 18px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px dashed rgba(139, 92, 246, 0.5);
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
    color: #c4b5fd;
    line-height: 1.6;
}

.sb-footer-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.sb-btn-primary,
.sb-btn-secondary {
    padding: 14px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.sb-btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.sb-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.6);
}

.sb-btn-secondary {
    background: rgba(107, 114, 128, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #d1d5db;
}

.sb-btn-secondary:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5f6;
}

/* 滚动条 */
.story-background-content::-webkit-scrollbar {
    width: 8px;
}

.story-background-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.story-background-content::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}

.story-background-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

/* 响应式 */
@media (max-width: 600px) {
    .story-background-content {
        width: 95vw;
        padding: 20px;
    }

    .sb-header h2 {
        font-size: 22px;
    }

    .sb-example-toggle {
        flex-direction: column;
    }

    .sb-example-tab {
        width: 100%;
        text-align: center;
    }

    .sb-footer-buttons {
        flex-direction: column;
    }

    .sb-btn-primary,
    .sb-btn-secondary {
        width: 100%;
    }
}
